[4/5] fdt_region: move fdt_region.c to common/ from lib/libfdt/

Message ID 1521623017-29312-5-git-send-email-yamada.masahiro@socionext.com
State New
Headers show
Series
  • libfdt: make lib/libfdt/ more synced with scripts/dtc/libfdt/
Related show

Commit Message

Masahiro Yamada March 21, 2018, 9:03 a.m.
My goal is to sync lib/libfdt/ with scripts/dtc/libfdt/, that is,
make lib/libfdt/ contain only wrapper files.

fdt_region.c was written only for U-Boot to implement the verified
boot.  So, this belongs to the same group as common/fdt_support.c,
which is a collection of U-Boot own fdt helpers.

Move lib/libfdt/fdt_region.c to common/fdt_region.c .  This is
necessary only when CONFIG_(SPL_)_FIT_SIGNATURE is enabled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 common/Makefile                     | 2 ++
 {lib/libfdt => common}/fdt_region.c | 0
 lib/libfdt/Makefile                 | 3 ---
 tools/Makefile                      | 5 +++--
 4 files changed, 5 insertions(+), 5 deletions(-)
 rename {lib/libfdt => common}/fdt_region.c (100%)

Comments

Simon Glass March 23, 2018, 2:30 p.m. | #1
Hi Masahiro,

On 21 March 2018 at 03:03, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> My goal is to sync lib/libfdt/ with scripts/dtc/libfdt/, that is,
> make lib/libfdt/ contain only wrapper files.
>
> fdt_region.c was written only for U-Boot to implement the verified
> boot.  So, this belongs to the same group as common/fdt_support.c,
> which is a collection of U-Boot own fdt helpers.

Actually it was written for the fdtgrep tool as well, which was sent
upstream, but not accepted.

Perhaps I should try to send that again.

>
> Move lib/libfdt/fdt_region.c to common/fdt_region.c .  This is
> necessary only when CONFIG_(SPL_)_FIT_SIGNATURE is enabled.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  common/Makefile                     | 2 ++
>  {lib/libfdt => common}/fdt_region.c | 0
>  lib/libfdt/Makefile                 | 3 ---
>  tools/Makefile                      | 5 +++--
>  4 files changed, 5 insertions(+), 5 deletions(-)
>  rename {lib/libfdt => common}/fdt_region.c (100%)

Regards,
Simon

Patch

diff --git a/common/Makefile b/common/Makefile
index 7011dad..bf1713b 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -31,6 +31,7 @@  obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
 
 obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
+obj-$(CONFIG_FIT_SIGNATURE) += fdt_region.o
 
 obj-$(CONFIG_MII) += miiphyutil.o
 obj-$(CONFIG_CMD_MII) += miiphyutil.o
@@ -75,6 +76,7 @@  obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
 obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o
 obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
+obj-$(CONFIG_SPL_FIT_SIGNATURE) += fdt_region.o
 ifdef CONFIG_SPL_USB_HOST_SUPPORT
 obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
 obj-$(CONFIG_USB_STORAGE) += usb_storage.o
diff --git a/lib/libfdt/fdt_region.c b/common/fdt_region.c
similarity index 100%
rename from lib/libfdt/fdt_region.c
rename to common/fdt_region.c
diff --git a/lib/libfdt/Makefile b/lib/libfdt/Makefile
index edd8e64..dd30d52 100644
--- a/lib/libfdt/Makefile
+++ b/lib/libfdt/Makefile
@@ -21,7 +21,4 @@  obj-$(CONFIG_OF_LIBFDT_OVERLAY) += fdt_overlay.o
 # TODO: split out the local modifiction.
 obj-y += fdt_ro.o
 
-# U-Boot own file
-obj-y += fdt_region.o
-
 ccflags-y := -I$(srctree)/scripts/dtc/libfdt
diff --git a/tools/Makefile b/tools/Makefile
index 55efb74..e7f701a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -67,7 +67,7 @@  LIBFDT_SRCS_SYNCED := fdt.c fdt_wip.c fdt_sw.c fdt_rw.c \
 		fdt_strerror.c fdt_empty_tree.c fdt_addresses.c fdt_overlay.c
 # The following files are locally modified for U-Boot (unfotunately).
 # Use U-Boot own versions from lib/libfdt/.
-LIBFDT_SRCS_UNSYNCED := fdt_ro.c fdt_region.c
+LIBFDT_SRCS_UNSYNCED := fdt_ro.c
 
 LIBFDT_OBJS := $(addprefix libfdt/, $(patsubst %.c, %.o, $(LIBFDT_SRCS_SYNCED))) \
 	       $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_SRCS_UNSYNCED)))
@@ -82,6 +82,7 @@  ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
 dumpimage-mkimage-objs := aisimage.o \
 			atmelimage.o \
 			$(FIT_SIG_OBJS-y) \
+			common/fdt_region.o \
 			common/bootm.o \
 			lib/crc32.o \
 			default_image.o \
@@ -192,7 +193,7 @@  hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela
 hostprogs-$(CONFIG_RISCV) += prelink-riscv
 
 hostprogs-y += fdtgrep
-fdtgrep-objs += $(LIBFDT_OBJS) fdtgrep.o
+fdtgrep-objs += $(LIBFDT_OBJS) common/fdt_region.o fdtgrep.o
 
 hostprogs-$(CONFIG_MIPS) += mips-relocs