[U-Boot] [PATCH 1/2] rockchip: fix turning off boot-mode via Kconfig

Philipp Tomsich philipp.tomsich at theobroma-systems.com
Fri Nov 24 13:44:58 UTC 2017


The ROCKCHIP_BOOT_MODE_REG option defaults to a hex value, so 0 will
show as 0x0.  Consequently, the "is set to something other than 0" test
in a Makefile needs to be an ifneq($(CONFIG_ROCKCHIP_BOOT_MODE_REG), 0x0).

This commit fixes mach-rockchip/Makefile and also resulting link
issues (if boot_mode.o is not included) by defining a stub function
(in case the functionality is not built in) for setup_boot_mode in
boot_mode.h.

Fixes: e306779 (rockchip: make boot_mode related codes reused across all platforms)
Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
---

 arch/arm/include/asm/arch-rockchip/boot_mode.h | 6 ++++++
 arch/arm/mach-rockchip/Makefile                | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-rockchip/boot_mode.h b/arch/arm/include/asm/arch-rockchip/boot_mode.h
index 6b2a610..f3f62ee 100644
--- a/arch/arm/include/asm/arch-rockchip/boot_mode.h
+++ b/arch/arm/include/asm/arch-rockchip/boot_mode.h
@@ -19,7 +19,13 @@
 #define BOOT_BROM_DOWNLOAD	0xEF08A53C
 
 #ifndef __ASSEMBLY__
+
+#if (CONFIG_ROCKCHIP_BOOT_MODE_REG == 0)
+static inline int setup_boot_mode(void) { return 0; };
+#else
 int setup_boot_mode(void);
 #endif
 
 #endif
+
+#endif
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 2127f2b..051d2a3 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -23,7 +23,7 @@ obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o
 
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 
-ifneq ($(CONFIG_ROCKCHIP_BOOT_MODE_REG),0)
+ifneq ($(CONFIG_ROCKCHIP_BOOT_MODE_REG),0x0)
 obj-y += boot_mode.o
 endif
 
-- 
2.1.4



More information about the U-Boot mailing list