diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 6c4954b9e0..ee03940ac0 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -28,9 +28,11 @@ 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) +# Always include boot_mode.o, as we bypass it (i.e. turn it off) +# inside of boot_mode.c when CONFIG_BOOT_MODE_REG is 0. This way, +# we can have the preprocessor correctly recognise both 0x0 and 0 +# meaning "turn it off". obj-y += boot_mode.o -endif obj-$(CONFIG_ROCKCHIP_CRC) += rockchip_crc.o obj-$(CONFIG_ROCKCHIP_SMCCC) += rockchip_smccc.o diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c index f105f57f1f..b50b17329c 100644 --- a/arch/arm/mach-rockchip/boot_mode.c +++ b/arch/arm/mach-rockchip/boot_mode.c @@ -15,6 +15,15 @@ DECLARE_GLOBAL_DATA_PTR; +#if (CONFIG_ROCKCHIP_BOOT_MODE_REG == 0) + +int setup_boot_mode(void) +{ + return 0; +} + +#else + void set_back_to_bootrom_dnl_flag(void) { writel(BOOT_BROM_DOWNLOAD, CONFIG_ROCKCHIP_BOOT_MODE_REG); @@ -119,3 +128,5 @@ int setup_boot_mode(void) return 0; } + +#endif