diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-19 11:30:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-19 14:50:18 +0200 |
commit | 7e5a875fff7dfe65d7d884dff924fcc25e6cee06 (patch) | |
tree | 38b009279aef0fda2ef22aa03f70c8bebd220c13 /lib | |
parent | 9a9e8156d21f171368c136696abcfbd74978bc4b (diff) | |
download | barebox-7e5a875fff7dfe65d7d884dff924fcc25e6cee06.tar.gz barebox-7e5a875fff7dfe65d7d884dff924fcc25e6cee06.tar.xz |
Compile libfdt for barebox
libfdt can be useful for very early device tree parsing, so compile it
for barobox aswell. This is done the same way as done in the Kernel:
we put C files with the same name as in libfdt into lib/ and just
include the libfdt files from there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig | 3 | ||||
-rw-r--r-- | lib/Makefile | 10 | ||||
-rw-r--r-- | lib/fdt.c | 2 | ||||
-rw-r--r-- | lib/fdt_empty_tree.c | 2 | ||||
-rw-r--r-- | lib/fdt_ro.c | 2 | ||||
-rw-r--r-- | lib/fdt_rw.c | 2 | ||||
-rw-r--r-- | lib/fdt_strerror.c | 2 | ||||
-rw-r--r-- | lib/fdt_sw.c | 2 | ||||
-rw-r--r-- | lib/fdt_wip.c | 2 |
9 files changed, 27 insertions, 0 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index af178217f8..f75eba9220 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -100,6 +100,9 @@ config FSL_QE_FIRMWARE select CRC32 bool +config LIBFDT + bool + config RATP select CRC_ITU_T bool "RATP protocol support" diff --git a/lib/Makefile b/lib/Makefile index 161d3a756e..a07ceb15ab 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -79,3 +79,13 @@ obj-$(CONFIG_GENERIC_LIB_LSHRDI3) += lshrdi3.o obj-$(CONFIG_GENERIC_LIB_MULDI3) += muldi3.o pbl-$(CONFIG_GENERIC_LIB_ASHLDI3) += ashldi3.o + +libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \ + fdt_empty_tree.o +$(foreach file, $(libfdt_files), \ + $(eval CFLAGS_$(file) = -I $(srctree)/scripts/dtc/libfdt)) +$(foreach file, $(libfdt_files), \ + $(eval CFLAGS_pbl-$(file) = -I $(srctree)/scripts/dtc/libfdt)) + +obj-pbl-$(CONFIG_LIBFDT) += $(libfdt_files) + diff --git a/lib/fdt.c b/lib/fdt.c new file mode 100644 index 0000000000..97f20069fc --- /dev/null +++ b/lib/fdt.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt.c" diff --git a/lib/fdt_empty_tree.c b/lib/fdt_empty_tree.c new file mode 100644 index 0000000000..5d30c58150 --- /dev/null +++ b/lib/fdt_empty_tree.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt_empty_tree.c" diff --git a/lib/fdt_ro.c b/lib/fdt_ro.c new file mode 100644 index 0000000000..f73c04ea7b --- /dev/null +++ b/lib/fdt_ro.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt_ro.c" diff --git a/lib/fdt_rw.c b/lib/fdt_rw.c new file mode 100644 index 0000000000..0c1f0f4a4b --- /dev/null +++ b/lib/fdt_rw.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt_rw.c" diff --git a/lib/fdt_strerror.c b/lib/fdt_strerror.c new file mode 100644 index 0000000000..8713e3ff47 --- /dev/null +++ b/lib/fdt_strerror.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt_strerror.c" diff --git a/lib/fdt_sw.c b/lib/fdt_sw.c new file mode 100644 index 0000000000..9ac7e50c76 --- /dev/null +++ b/lib/fdt_sw.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt_sw.c" diff --git a/lib/fdt_wip.c b/lib/fdt_wip.c new file mode 100644 index 0000000000..45b3fc3d3b --- /dev/null +++ b/lib/fdt_wip.c @@ -0,0 +1,2 @@ +#include <linux/libfdt_env.h> +#include "../scripts/dtc/libfdt/fdt_wip.c" |