diff mbox series

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

Message ID 1511531099-53117-1-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Delegated to: Philipp Tomsich
Headers show
Series [U-Boot,1/2] rockchip: fix turning off boot-mode via Kconfig | expand

Commit Message

Philipp Tomsich Nov. 24, 2017, 1:44 p.m. UTC
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@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(-)

Comments

Philipp Tomsich Nov. 25, 2017, 11:39 p.m. UTC | #1
> 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@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(-)
> 

Applied to u-boot-rockchip, thanks!
diff mbox series

Patch

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