summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra124
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-31 17:57:16 -0600
committerSimon Glass <sjg@chromium.org>2017-06-09 13:39:32 -0600
commit46864cc8e82ade3523f4c474b7451bb960e4ad70 (patch)
treea6988c39ce1c1b0548cf4bee3ccf395a325449b7 /arch/arm/mach-tegra/tegra124
parent422f04b68f59a8348428a6a5628a00a5689d0168 (diff)
tegra: Init clocks even when SPL did not run
At present early clock init happens in SPL. If SPL did not run (because for example U-Boot is chain-loaded from another boot loader) then the clocks are not set as U-Boot expects. Add a function to detect this and call the early clock init in U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/mach-tegra/tegra124')
-rw-r--r--arch/arm/mach-tegra/tegra124/clock.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra124/clock.c b/arch/arm/mach-tegra/tegra124/clock.c
index 5e4406102f1..5ae718b3426 100644
--- a/arch/arm/mach-tegra/tegra124/clock.c
+++ b/arch/arm/mach-tegra/tegra124/clock.c
@@ -891,6 +891,24 @@ void clock_early_init(void)
udelay(2);
}
+/*
+ * clock_early_init_done - Check if clock_early_init() has been called
+ *
+ * Check a register that we set up to see if clock_early_init() has already
+ * been called.
+ *
+ * @return true if clock_early_init() was called, false if not
+ */
+bool clock_early_init_done(void)
+{
+ struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+ u32 val;
+
+ val = readl(&clkrst->crc_sclk_brst_pol);
+
+ return val == 0x20002222;
+}
+
void arch_timer_init(void)
{
struct sysctr_ctlr *sysctr = (struct sysctr_ctlr *)NV_PA_TSC_BASE;