public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Johan Jonker <jbx6244@gmail.com>
To: kever.yang@rock-chips.com
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, u-boot@lists.denx.de
Subject: [PATCH v3 4/6] rockchip: tpl: change call condition rockchip_stimer_init()
Date: Thu, 30 Dec 2021 17:48:23 +0100	[thread overview]
Message-ID: <20211230164825.6489-4-jbx6244@gmail.com> (raw)
In-Reply-To: <20211230164825.6489-1-jbx6244@gmail.com>

The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE
defined. Currently only rk3188 has an exception. Make this more
generic and call the function rockchip_stimer_init() only when
CONFIG_ROCKCHIP_STIMER_BASE is available.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---

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 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index 3c007bb4..2b561264 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -15,6 +15,7 @@
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <linux/bitops.h>
+#include <linux/kconfig.h>
 
 #if CONFIG_IS_ENABLED(BANNER_PRINT)
 #include <timestamp.h>
@@ -29,6 +30,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 +47,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)
@@ -74,7 +77,9 @@ void board_init_f(ulong dummy)
 	}
 
 	/* Init secure timer */
-	rockchip_stimer_init();
+	if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
+		rockchip_stimer_init();
+
 	/* Init ARM arch timer in arch/arm/cpu/ */
 	timer_init();
 
-- 
2.20.1


  parent reply	other threads:[~2021-12-30 16:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
2021-12-30 16:48 ` [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER " Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init() Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` Johan Jonker [this message]
2022-01-12 20:03   ` [PATCH v3 4/6] rockchip: tpl: " Simon Glass
2021-12-30 16:48 ` [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` [PATCH v3 6/6] rockchip: tpl: use " Johan Jonker
2022-01-12 20:03   ` Simon Glass
2022-01-12 20:03 ` [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Simon Glass
2022-03-12  8:51 ` Jagan Teki
2022-03-12 10:01   ` Johan Jonker
2022-03-12 14:39     ` Kever Yang
2022-03-13 12:41       ` Paweł Jarosz
2022-03-13 22:23         ` Simon Glass
2022-03-14 15:36       ` Johan Jonker
2022-03-16  7:06         ` Kever Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211230164825.6489-4-jbx6244@gmail.com \
    --to=jbx6244@gmail.com \
    --cc=kever.yang@rock-chips.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox