[PATCH v5 03/13] rockchip: tpl: change call condition rockchip_stimer_init()
Johan Jonker
jbx6244 at gmail.com
Sat Apr 9 18:55:04 CEST 2022
The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE
defined. Currently there's no exception in TPL. Make this more
generic and compile the code inside the function rockchip_stimer_init()
only when CONFIG_ROCKCHIP_STIMER_BASE is available.
Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
---
Changed V5:
reword
remove IS_ENABLED
remove include kconfig.h
Changed V3:
use CONFIG_ROCKCHIP_STIMER
Changed V2:
use IS_ENABLED
add include kconfig.h
move define location so that rockchip_stimer_init() is always
visible to the compiler
---
arch/arm/mach-rockchip/tpl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index 3c007bb450..7f43f58406 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -29,6 +29,7 @@
__weak void rockchip_stimer_init(void)
{
+#if defined(CONFIG_ROCKCHIP_STIMER_BASE)
/* If Timer already enabled, don't re-init it */
u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
@@ -45,6 +46,7 @@ __weak void rockchip_stimer_init(void)
writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
TIMER_CONTROL_REG);
+#endif
}
void board_init_f(ulong dummy)
--
2.20.1
More information about the U-Boot
mailing list