diff options
author | Vaibhav Hiremath <hvaibhav@ti.com> | 2012-03-08 11:45:47 (GMT) |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-10-25 18:30:22 (GMT) |
commit | 000820b5835c2b8b863af992b66dc973dc4bd202 (patch) | |
tree | f6abab9e0b1e696f8a21a8e7defbf6bd0fae0ee6 /arch/arm/cpu/armv7/am33xx/board.c | |
parent | 3530a35d747508e98976a1d86a6d3f9b31cb3fd2 (diff) | |
download | u-boot-000820b5835c2b8b863af992b66dc973dc4bd202.tar.xz |
am335x: Enable RTC 32K OSC clock
In order to support low power state, you must source kernel system
timers to persistent clock, available across suspend/resume. In case of
AM335x device, the only source we have is, RTC32K, available in
wakeup/always-on domain. Having said that, during validation it has
been observed that, RTC clock need couple of seconds delay to stabilize
the RTC OSC clock; and such a huge delay is not acceptable in kernel
especially during early init and also it will impact quick/fast boot
use-cases.
So, RTC32k OSC enable dependency has been shifted to
SPL/first-bootloader.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm/cpu/armv7/am33xx/board.c')
-rw-r--r-- | arch/arm/cpu/armv7/am33xx/board.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c index 6de03fd..772203f 100644 --- a/arch/arm/cpu/armv7/am33xx/board.c +++ b/arch/arm/cpu/armv7/am33xx/board.c @@ -116,11 +116,27 @@ static int read_eeprom(void) return 0; } -/* UART Defines */ #ifdef CONFIG_SPL_BUILD +/* UART Defines */ #define UART_RESET (0x1 << 1) #define UART_CLK_RUNNING_MASK 0x1 #define UART_SMART_IDLE_EN (0x1 << 0x3) + +static void rtc32k_enable(void) +{ + struct rtc_regs *rtc = (struct rtc_regs *)AM335X_RTC_BASE; + + /* + * Unlock the RTC's registers. For more details please see the + * RTC_SS section of the TRM. In order to unlock we need to + * write these specific values (keys) in this order. + */ + writel(0x83e70b13, &rtc->kick0r); + writel(0x95a4f1e0, &rtc->kick1r); + + /* Enable the RTC 32K OSC by setting bits 3 and 6. */ + writel((1 << 3) | (1 << 6), &rtc->osc); +} #endif /* @@ -154,6 +170,9 @@ void s_init(void) /* Setup the PLLs and the clocks for the peripherals */ pll_init(); + /* Enable RTC32K clock */ + rtc32k_enable(); + /* UART softreset */ u32 regVal; |