[U-Boot] [PATCH PATCH v3 10/12] Makefile: Query the SPL Fit Generator for its dependencies
Jean-Jacques Hiblot
jjhiblot at ti.com
Thu May 23 10:39:10 UTC 2019
To reduce the complexity of the Makefile, let the generator tell what its
dependencies are. For this purpose use the "--deps" option.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
---
Changes in v3: None
Changes in v2: None
Makefile | 9 ++-------
arch/arm/mach-imx/mkimage_fit_atf.sh | 7 +++++++
arch/arm/mach-rockchip/make_fit_atf.py | 8 ++++++++
board/sunxi/mksunxi_fit_atf.sh | 5 +++++
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 048d12340b..3f8899b91b 100644
--- a/Makefile
+++ b/Makefile
@@ -1211,13 +1211,8 @@ U_BOOT_ITS = $(src)/$(SPL_FIT_SOURCE)
else
ifneq ($(SPL_FIT_GENERATOR),)
U_BOOT_ITS := u-boot.its
-ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-imx/mkimage_fit_atf.sh")
-U_BOOT_ITS_DEPS += u-boot-nodtb.bin
-endif
-ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-rockchip/make_fit_atf.py")
-U_BOOT_ITS_DEPS += u-boot
-endif
-$(U_BOOT_ITS): $(U_BOOT_ITS_DEPS) FORCE
+U_BOOT_ITS_DEPS += $(shell $(srctree)/$(SPL_FIT_GENERATOR) --deps $(BOARD))
+$(U_BOOT_ITS): u-boot-nodtb.bin $(U_BOOT_ITS_DEPS) FORCE
$(srctree)/$(SPL_FIT_GENERATOR) $(BOARD) \
$(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) > $@
endif
diff --git a/arch/arm/mach-imx/mkimage_fit_atf.sh b/arch/arm/mach-imx/mkimage_fit_atf.sh
index 45b325665e..45a81fbad3 100755
--- a/arch/arm/mach-imx/mkimage_fit_atf.sh
+++ b/arch/arm/mach-imx/mkimage_fit_atf.sh
@@ -11,6 +11,13 @@
[ -z "$ATF_LOAD_ADDR" ] && ATF_LOAD_ADDR="0x00910000"
[ -z "$BL33_LOAD_ADDR" ] && BL33_LOAD_ADDR="0x40200000"
+if [ x"$1" = x"--deps" ]; then
+ echo $BL31
+ echo "tee.bin"
+ echo "u-boot-nodtb.bin"
+ exit 0
+fi
+
if [ ! -f $BL31 ]; then
echo "ERROR: BL31 file $BL31 NOT found" >&2
exit 0
diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
index 4138b04a37..afd734e736 100755
--- a/arch/arm/mach-rockchip/make_fit_atf.py
+++ b/arch/arm/mach-rockchip/make_fit_atf.py
@@ -192,11 +192,19 @@ def get_bl31_segments_info(bl31_file_name):
paddr = seg[ELF_SEG_P_PADDR]
print('paddr: %08x' % paddr)
+def show_deps_and_exit():
+ print("u-boot")
+ print("bl31.elf")
+ sys.exit(0)
+
def main():
uboot_elf="./u-boot"
bl31_elf="./bl31.elf"
FIT_ITS=sys.stdout
+ if sys.argv[1] == "--deps":
+ show_deps_and_exit()
+
opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h")
for opt, val in opts:
if opt == "-o":
diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh
index 0dc7ab4348..8f87514a6f 100755
--- a/board/sunxi/mksunxi_fit_atf.sh
+++ b/board/sunxi/mksunxi_fit_atf.sh
@@ -5,6 +5,11 @@
#
# usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
+if [ x"$1" = x"--deps" ]; then
+ echo "u-boot-nodtb.bin"
+ exit 0
+fi
+
[ -z "$BL31" ] && BL31="bl31.bin"
if [ ! -f $BL31 ]; then
--
2.17.1
More information about the U-Boot
mailing list