diff mbox

[U-Boot,1/2] ARM: tegra: Initialize timer earlier

Message ID 1438076154-31892-1-git-send-email-thierry.reding@gmail.com
State Accepted
Delegated to: Tom Warren
Headers show

Commit Message

Thierry Reding July 28, 2015, 9:35 a.m. UTC
From: Thierry Reding <treding@nvidia.com>

A subsequent patch will enable the use of the architected timer on
ARMv8. Doing so implies that udelay() will be backed by this timer
implementation, and hence the architected timer must be ready when
udelay() is first called. The first time udelay() is used is while
resetting the debug UART, which happens very early. Make sure that
arch_timer_init() is called before that.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 arch/arm/mach-tegra/board2.c | 6 ++++++
 arch/arm/mach-tegra/clock.c  | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Stephen Warren July 28, 2015, 4:08 p.m. UTC | #1
On 07/28/2015 03:35 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> A subsequent patch will enable the use of the architected timer on
> ARMv8. Doing so implies that udelay() will be backed by this timer
> implementation, and hence the architected timer must be ready when
> udelay() is first called. The first time udelay() is used is while
> resetting the debug UART, which happens very early. Make sure that
> arch_timer_init() is called before that.

The series,
Acked-by: Stephen Warren <swarren@nvidia.com>

Again I've tested these in the context of a downstream/L4T version of 
U-Boot and they worked out fine. However since I haven't tested the 
exact upstream code-base, I won't give a Tested-by tag.
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index 82a8a3c08959..f76fcbec5a7d 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -218,6 +218,12 @@  void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init")));
 
 int board_early_init_f(void)
 {
+	/* Do any special system timer/TSC setup */
+#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
+	if (!tegra_cpu_is_non_secure())
+#endif
+		arch_timer_init();
+
 	pinmux_init();
 	board_init_uart_f();
 
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 0e0f7431b2fb..551ce88960e3 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -618,12 +618,6 @@  void clock_init(void)
 	debug("PLLC = %d\n", pll_rate[CLOCK_ID_CGENERAL]);
 	debug("PLLD = %d\n", pll_rate[CLOCK_ID_DISPLAY]);
 	debug("PLLX = %d\n", pll_rate[CLOCK_ID_XCPU]);
-
-	/* Do any special system timer/TSC setup */
-#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
-	if (!tegra_cpu_is_non_secure())
-#endif
-		arch_timer_init();
 }
 
 static void set_avp_clock_source(u32 src)