All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 6/6] rockchip: rk3368: remove setup of secure timer from TPL/SPL
Date: Wed,  2 Aug 2017 22:40:02 +0200	[thread overview]
Message-ID: <1501706406-10284-7-git-send-email-philipp.tomsich@theobroma-systems.com> (raw)
In-Reply-To: <1501706406-10284-1-git-send-email-philipp.tomsich@theobroma-systems.com>

When using DM timers w/ the timer0 block within the RK3368, we no
longer depend on the ARMv8 generic timer counting.  This allows us to
drop the secure timer initialisation from the TPL and SPL stages.

The secure timer will later be set up by ATF, which starts the ARMv8
generic timer.  Thus, there will be a dependency from Linux to the ATF
through the ARMv8 generic timer... this seems reasonable, as Linux
will require the ATF (and PSCI) to start up the secondary cores anyway
(in other words: we don't add any new dependencies).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

Changes in v2: None

 arch/arm/mach-rockchip/rk3368-board-spl.c | 20 --------------------
 arch/arm/mach-rockchip/rk3368-board-tpl.c | 19 -------------------
 2 files changed, 39 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c b/arch/arm/mach-rockchip/rk3368-board-spl.c
index 691db41..cabf344 100644
--- a/arch/arm/mach-rockchip/rk3368-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3368-board-spl.c
@@ -19,23 +19,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/*
- * The ARMv8 generic timer uses the STIMER1 as its clock-source.
- * Set up the STIMER1 to free-running (i.e. auto-reload) to start
- * the generic timer counting (if we don't do this, udelay will not
- * work and block indefinitively).
- */
-static void secure_timer_init(void)
-{
-	struct rk_timer * const stimer1 =
-		(struct rk_timer * const)0xff830020;
-	const u32 TIMER_EN = BIT(0);
-
-	writel(~0u, &stimer1->timer_load_count0);
-	writel(~0u, &stimer1->timer_load_count1);
-	writel(TIMER_EN, &stimer1->timer_ctrl_reg);
-}
-
 void board_debug_uart_init(void)
 {
 }
@@ -52,9 +35,6 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
-	/* Make sure the ARMv8 generic timer counts */
-	secure_timer_init();
-
 	/* Set up our preloader console */
 	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
 	if (ret) {
diff --git a/arch/arm/mach-rockchip/rk3368-board-tpl.c b/arch/arm/mach-rockchip/rk3368-board-tpl.c
index 2a91007..c610cfc 100644
--- a/arch/arm/mach-rockchip/rk3368-board-tpl.c
+++ b/arch/arm/mach-rockchip/rk3368-board-tpl.c
@@ -21,23 +21,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
- * The ARMv8 generic timer uses the STIMER1 as its clock-source.
- * Set up the STIMER1 to free-running (i.e. auto-reload) to start
- * the generic timer counting (if we don't do this, udelay will not
- * work and block indefinitively).
- */
-static void secure_timer_init(void)
-{
-	struct rk_timer * const stimer1 =
-		(struct rk_timer * const)0xff830020;
-	const u32 TIMER_EN = BIT(0);
-
-	writel(~0u, &stimer1->timer_load_count0);
-	writel(~0u, &stimer1->timer_load_count1);
-	writel(TIMER_EN, &stimer1->timer_ctrl_reg);
-}
-
-/*
  * The SPL (and also the full U-Boot stage on the RK3368) will run in
  * secure mode (i.e. EL3) and an ATF will eventually be booted before
  * starting up the operating system... so we can initialize the SGRF
@@ -153,8 +136,6 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
-	/* Make sure the ARMv8 generic timer counts */
-	secure_timer_init();
 	/* Reset security, so we can use DMA in the MMC drivers */
 	sgrf_init();
 
-- 
2.1.4

  parent reply	other threads:[~2017-08-02 20:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 20:39 [U-Boot] [PATCH v2 0/6] rockchip: rk3368: remove secure timer usage and use DM timer Philipp Tomsich
2017-08-02 20:39 ` [U-Boot] [PATCH v2 1/6] timer: add OF_PLATDATA support for timer-uclass Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:39 ` [U-Boot] [PATCH v2 2/6] dm: timer: normalise SPL and TPL support Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:39 ` [U-Boot] [PATCH v2 3/6] rockchip: timer: add device-model timer driver for RK3368 (and similar) Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:40 ` [U-Boot] [PATCH v2 4/6] dts: rk3368: make timer0 accessible for SPL and TPL Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:40 ` [U-Boot] [PATCH v2 5/6] rockchip: lion-rk3368: defconfig: enable DM timer for all stages Philipp Tomsich
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, " Philipp Tomsich
2017-08-02 20:40 ` Philipp Tomsich [this message]
2017-08-06 17:18   ` [U-Boot] [U-Boot, v2, 6/6] rockchip: rk3368: remove setup of secure timer from TPL/SPL Philipp Tomsich

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=1501706406-10284-7-git-send-email-philipp.tomsich@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.