summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2016-10-14 10:35:24 +0530
committerTom Rini <trini@konsulko.com>2016-11-21 13:58:55 -0500
commitb64a7cb92dcf6e0047fb524c08c90d5894ba4e39 (patch)
treebb744d4b230efd82bc42475ee2662a5baadb591c /arch
parentc704a99dff693d3e2d0fe1ad095febb89f872de9 (diff)
ARM: AMx3xx: Centralize early clock initialization
This is similar to Commit 93e6253d11030 ("ARM: OMAP4/5: Centralize early clock initialization") that was done for OMAP4+, reflecting the same for AM33xx and AM43xx SoCs to centralize clock initialization. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Add setup_early_clocks that calls setup_clocks_for_console for ti81xx] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/am33xx/board.c2
-rw-r--r--arch/arm/cpu/armv7/am33xx/clock.c9
-rw-r--r--arch/arm/cpu/armv7/am33xx/clock_ti814x.c6
-rw-r--r--arch/arm/cpu/armv7/am33xx/clock_ti816x.c5
-rw-r--r--arch/arm/include/asm/arch-am33xx/sys_proto.h1
5 files changed, 20 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
index 1ba4ec5a96..8340b5437a 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -286,7 +286,7 @@ void early_system_init(void)
#endif
watchdog_disable();
set_uart_mux_conf();
- setup_clocks_for_console();
+ setup_early_clocks();
uart_soft_reset();
#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
/* Enable RTC32K clock */
diff --git a/arch/arm/cpu/armv7/am33xx/clock.c b/arch/arm/cpu/armv7/am33xx/clock.c
index 9b9b78eddd..3d17698e18 100644
--- a/arch/arm/cpu/armv7/am33xx/clock.c
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -232,10 +232,15 @@ __weak void scale_vcores(void)
{
}
-void prcm_init()
+void setup_early_clocks(void)
{
+ setup_clocks_for_console();
enable_basic_clocks();
+ timer_init();
+}
+
+void prcm_init(void)
+{
scale_vcores();
setup_dplls();
- timer_init();
}
diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
index 9b5a47b018..50bd631cf6 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
@@ -386,6 +386,12 @@ void setup_clocks_for_console(void)
while (readl(&cmalwon->uart0clkctrl) != PRCM_MOD_EN)
;
}
+
+void setup_early_clocks(void)
+{
+ setup_clocks_for_console();
+}
+
/*
* Configure the PLL/PRCM for necessary peripherals
*/
diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti816x.c b/arch/arm/cpu/armv7/am33xx/clock_ti816x.c
index ace4a5afef..079ddd7eb9 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_ti816x.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_ti816x.c
@@ -429,6 +429,11 @@ void setup_clocks_for_console(void)
;
}
+void setup_early_clocks(void)
+{
+ setup_clocks_for_console();
+}
+
void prcm_init(void)
{
/* Enable the control */
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index ed1a46c2e7..4e942baa68 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -19,6 +19,7 @@ u32 get_sysboot_value(void);
extern struct ctrl_stat *cstat;
u32 get_device_type(void);
void save_omap_boot_params(void);
+void setup_early_clocks(void);
void setup_clocks_for_console(void);
void mpu_pll_config_val(int mpull_m);
void ddr_pll_config(unsigned int ddrpll_M);