ARM: AM43xx: Add support for RTC only mode
Subsystems (3)
cover ARM: AM43xx: Add support for RTC only mode
Kernel stores information to the RTC_SCRATCH0 and RTC_SCRATCH1 registers for wakeup from RTC-only mode. Parse these registers during SPL boot and jump to the kernel resume vector if the device is waking up from RTC-only mode.
The RTC scratch register layout used is:
SCRATCH0 : bits00-31 : kernel resume address
SCRATCH1 : bits00-15 : RTC magic value used to detect valid config SCRATCH1 : bits16-31 : board type information populated by bootloader
During the normal boot path the SCRATCH1 : bits16-31 are updated with the eeprom read board type data. In the rtc_only boot path the rtc scratchpad register is read and the board type is determined and correspondingly ddr dpll parameters are set. This is done so as to avoid costly i2c read to eeprom.
RTC-only mode support is currently only enabled for am43xx_evm_rtconly_config.
This is not to be used with epos evm builds.
Dave Gerlach (1):
am43xx: Do not allow EMIF to control DDR_RESET in rtconly config
Tero Kristo (1):
ARM: AM43xx: Add support for RTC only mode
arch/arm/include/asm/arch-am33xx/clock.h | 6 ++ arch/arm/mach-omap2/am33xx/Kconfig | 7 ++ arch/arm/mach-omap2/am33xx/board.c | 109 +++++++++++++++++++++++++++--- arch/arm/mach-omap2/am33xx/clock.c | 10 +++ arch/arm/mach-omap2/am33xx/clock_am43xx.c | 21 ++++++ arch/arm/mach-omap2/am33xx/emif4.c | 5 ++ board/ti/am43xx/MAINTAINERS | 1 + board/ti/am43xx/board.c | 56 +++++++++++++++ configs/am43xx_evm_rtconly_defconfig | 59 ++++++++++++++++ 9 files changed, 266 insertions(+), 8 deletions(-) create mode 100644 configs/am43xx_evm_rtconly_defconfig
Signature · 1 line
1.9.1
PATCH 1/2 ARM: AM43xx: Add support for RTC only mode
From: Tero Kristo <[email protected]>
Kernel stores information to the RTC_SCRATCH0 and RTC_SCRATCH1 registers for wakeup from RTC-only mode. Parse these registers during SPL boot and jump to the kernel resume vector if the device is waking up from RTC-only mode.
The RTC scratch register layout used is:
SCRATCH0 : bits00-31 : kernel resume address
SCRATCH1 : bits00-15 : RTC magic value used to detect valid config SCRATCH1 : bits16-31 : board type information populated by bootloader
During the normal boot path the SCRATCH1 : bits16-31 are updated with the eeprom read board type data. In the rtc_only boot path the rtc scratchpad register is read and the board type is determined and correspondingly ddr dpll parameters are set. This is done so as to avoid costly i2c read to eeprom.
RTC-only mode support is currently only enabled for am43xx_evm_rtconly_config.
This is not to be used with epos evm builds.
--- arch/arm/include/asm/arch-am33xx/clock.h | 6 ++ arch/arm/mach-omap2/am33xx/Kconfig | 7 ++ arch/arm/mach-omap2/am33xx/board.c | 109 +++++++++++++++++++++++++++--- arch/arm/mach-omap2/am33xx/clock.c | 10 +++ arch/arm/mach-omap2/am33xx/clock_am43xx.c | 21 ++++++ board/ti/am43xx/MAINTAINERS | 1 + board/ti/am43xx/board.c | 56 +++++++++++++++ configs/am43xx_evm_rtconly_defconfig | 59 ++++++++++++++++ 8 files changed, 261 insertions(+), 8 deletions(-) create mode 100644 configs/am43xx_evm_rtconly_defconfig
arch/arm/include/asm/arch-am33xx/clock.h +6 -0
@@ -122,6 +122,12 @@ void scale_vcores(void);void do_setup_dpll (const struct dpll_regs *,const struct dpll_params *);void prcm_init (void );void enable_basic_clocks (void ); + +void rtc_only_update_board_type (u32 btype); +u32 rtc_only_get_board_type (void ); +void rtc_only_prcm_init (void ); +void rtc_only_enable_basic_clocks (void ); +void do_enable_clocks (u32 *const *,u32 *const *,u8 );void do_disable_clocks (u32 *const *,u32 *const *,u8 );
arch/arm/mach-omap2/am33xx/Kconfig +7 -0
@@ -239,6 +239,13 @@ config TARGET_CM_T43 endchoice +config SPL_RTC_ONLY_SUPPORT + bool + depends on SPL + prompt "Enable RTC ONLY Support" + help + If you want RTC ONLY Support, say Y. + endif if AM43XX || AM33XX
arch/arm/mach-omap2/am33xx/board.c +101 -8
141 lines not on this page · raw message
arch/arm/mach-omap2/am33xx/clock.c +10 -0
@@ -244,3 +244,13 @@ void prcm_init(void)scale_vcores ();setup_dplls (); } + +void rtc_only_prcm_init (void ) +{ +const struct dpll_params *params; + +rtc_only_enable_basic_clocks (); + + params =get_dpll_ddr_params (); +do_setup_dpll (&dpll_ddr_regs, params); +}
arch/arm/mach-omap2/am33xx/clock_am43xx.c +21 -0
@@ -124,6 +124,27 @@ void enable_basic_clocks(void)writel (0x4 , &cmdpll->clkselmacclk); } +void rtc_only_enable_basic_clocks (void ) +{ +u32 *const clk_domains[] = { + &cmper->emifclkstctrl, +0 + }; + +u32 *const clk_modules_explicit_en[] = { + &cmper->gpio5clkctrl, + &cmper->emiffwclkctrl, + &cmper->emifclkctrl, + &cmper->otfaemifclkctrl, +0 + }; + +do_enable_clocks (clk_domains, clk_modules_explicit_en,1 ); + +/* Select the Master osc clk as Timer2 clock source */ +writel (0x1 , &cmdpll->clktimer2clk); +} +#ifdef CONFIG_TI_EDMA3 void enable_edma3_clocks (void ) {
board/ti/am43xx/MAINTAINERS +1 -0
@@ -7,4 +7,5 @@ F: configs/am43xx_evm_defconfig F: configs/am43xx_evm_ethboot_defconfig F: configs/am43xx_evm_qspiboot_defconfig F: configs/am43xx_evm_usbhost_boot_defconfig +F: configs/am43xx_evm_rtconly_defconfig F: configs/am43xx_hs_evm_defconfig
board/ti/am43xx/board.c +56 -0
62 lines not on this page · raw message
configs/am43xx_evm_rtconly_defconfig new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH 1/2 ARM: AM43xx: Add support for RTC only mode
Quoted 6 lines · Keerthy
From: Tero Kristo <[email protected]>
Kernel stores information to the
RTC_SCRATCH0andRTC_SCRATCH1registers for wakeup from RTC-only mode. Parse these registers during SPL boot and jump to the kernel resume vector if the device is waking up from RTC-only mode.
[snip]
Quoted 5 lines
arch/arm/mach-omap2/am33xx/Kconfig +0
-0
arch/arm/mach-omap2/am33xx/Kconfig config TARGET_CM_T43 · line 247
Quoted 9 lines
arch/arm/mach-omap2/am33xx/Kconfig +6
-0@@ -239,6 +239,13 @@ config TARGET_CM_T43 endchoice +config SPL_RTC_ONLY_SUPPORT + bool + depends on SPL + prompt "Enable RTC ONLY Support" + help + If you want RTC ONLY Support, say Y.
Please expand on the help content here.
[snip]
arch/arm/mach-omap2/am33xx/Kconfig config TARGET_CM_T43
Quoted 5 lines
arch/arm/mach-omap2/am33xx/Kconfig +5
-0+/* + * RTC only mode magic value, checked against during boot to see if we have + * a valid config + */ +#define RTC_MAGIC_VAL 0x8cd0
Update the comment to include where this value needs to be kept in sync with (what file in the kernel?).
[snip]
Quoted 1 line
+CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm"
We don't support this on all of those, do we? I thought the comments said you can't do it on ePOS... Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180315/4aa854b7/attachment.sig>
PATCH 1/2 ARM: AM43xx: Add support for RTC only mode
Quoted 17 lines · Tom Rini
Quoted 6 lines · Keerthy
From: Tero Kristo <[email protected]>
Kernel stores information to the
RTC_SCRATCH0andRTC_SCRATCH1registers for wakeup from RTC-only mode. Parse these registers during SPL boot and jump to the kernel resume vector if the device is waking up from RTC-only mode.[snip]
Quoted 8 lines
arch/arm/mach-omap2/am33xx/Kconfig +0
-0@@ -239,6 +239,13 @@ config TARGET_CM_T43 endchoice
Quoted 8 lines
arch/arm/mach-omap2/am33xx/Kconfig config TARGET_CM_T43 · line 247
Quoted 6 lines
arch/arm/mach-omap2/am33xx/Kconfig +6
-0+config SPL_RTC_ONLY_SUPPORT + bool + depends on SPL + prompt "Enable RTC ONLY Support" + help + If you want RTC ONLY Support, say Y.Please expand on the help content here.
Sure
Quoted 10 lines
[snip]
arch/arm/mach-omap2/am33xx/Kconfig
Quoted 5 lines
arch/arm/mach-omap2/am33xx/Kconfig +5
-0+/* + * RTC only mode magic value, checked against during boot to see if we have + * a valid config + */ +#define RTC_MAGIC_VAL 0x8cd0Update the comment to include where this value needs to be kept in sync with (what file in the kernel?).
Okay.
Quoted 6 lines
[snip]
Quoted 1 line
+CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm"
We don't support this on all of those, do we? I thought the comments said you can't do it on ePOS... Thanks!
The config should surely have all the above booting. The RTC-Only mode will not be supported in ePOS.
Quoted 1 line
PATCH 1/2 ARM: AM43xx: Add support for RTC only mode
Quoted 45 lines · Keerthy
Quoted 17 lines · Tom Rini
Quoted 6 lines · Keerthy
From: Tero Kristo <[email protected]>
Kernel stores information to the
RTC_SCRATCH0andRTC_SCRATCH1registers for wakeup from RTC-only mode. Parse these registers during SPL boot and jump to the kernel resume vector if the device is waking up from RTC-only mode.[snip]
Quoted 8 lines
arch/arm/mach-omap2/am33xx/Kconfig +0
-0@@ -239,6 +239,13 @@ config TARGET_CM_T43 endchoiceQuoted 8 lines
arch/arm/mach-omap2/am33xx/Kconfig config TARGET_CM_T43 · line 247
Quoted 6 lines
arch/arm/mach-omap2/am33xx/Kconfig +6
-0+config SPL_RTC_ONLY_SUPPORT + bool + depends on SPL + prompt "Enable RTC ONLY Support" + help + If you want RTC ONLY Support, say Y.Please expand on the help content here.
Sure
Quoted 10 lines
[snip]
arch/arm/mach-omap2/am33xx/Kconfig
Quoted 5 lines
arch/arm/mach-omap2/am33xx/Kconfig +5
-0+/* + * RTC only mode magic value, checked against during boot to see if we have + * a valid config + */ +#define RTC_MAGIC_VAL 0x8cd0Update the comment to include where this value needs to be kept in sync with (what file in the kernel?).
Okay.
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
[snip]
Quoted 1 line
+CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm"
We don't support this on all of those, do we? I thought the comments said you can't do it on ePOS... Thanks!
The config should surely have all the above booting. The RTC-Only mode will not be supported in ePOS.
So we keep ePOS here to ensure that enabling it doesn't break on HW it's not supported on? OK.. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180315/93651c83/attachment.sig>
PATCH 2/2 am43xx: Do not allow EMIF to control DDR_RESET in rtconly config
In reply to KeerthyFrom: Dave Gerlach <[email protected]>
Prevent EMIF control of DDR_RESET line on DDR3 am43xx platforms for am43xx_evm_rtconly_config. Without this DDR is unstable and can become corrupted after multiple iterations of RTC+DDR mode.
--- arch/arm/mach-omap2/am33xx/emif4.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/am33xx/emif4.c +5 -0
@@ -95,8 +95,13 @@ void config_ddr(unsigned int pll, const struct ctrl_ioregs *ioregs,writel (DDR_CKE_CTRL_NORMAL , &ddrctrl->ddrckectrl); if (emif_sdram_type(regs->sdram_config) == EMIF_SDRAM_TYPE_DDR3) +#ifndef CONFIG_SPL_RTC_ONLY_SUPPORT /* Allow EMIF to control DDR_RESET */ writel (0x00000000 , &ddrctrl->ddrioctrl); +#else +/* Override EMIF DDR_RESET control */ +writel (0x80000000 , &ddrctrl->ddrioctrl); +#endif /* CONFIG_SPL_RTC_ONLY_SUPPORT */ #endif /* Program EMIF instance */
Signature · 1 line
1.9.1
PATCH 2/2 am43xx: Do not allow EMIF to control DDR_RESET in rtconly config
Quoted 9 lines · Keerthy
From: Dave Gerlach <[email protected]>
Prevent EMIF control of
DDR_RESETline on DDR3 am43xx platforms foram43xx_evm_rtconly_config. Without this DDR is unstable and can become corrupted after multiple iterations of RTC+DDR mode.Signed-off-by Dave Gerlach <[email protected]>[j-keerthy at ti.com Ported to latest master branch]Signed-off-by Keerthy <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180315/f14e3798/attachment.sig>