Re: [U-Boot] [PATCH v2 4/6] arm: mach-omap2: am33xx: Disable EMIF_DEVOFF immediately before hw leveling

2019-05-06 Thread Tom Rini
On Mon, Apr 29, 2019 at 09:59:31AM +0530, Keerthy wrote:

> From: Brad Griffis 
> 
> In case of RTC+DDR resume, need to restore EMIF context
> before initiating hardware leveling.
> 
> Signed-off-by: Brad Griffis 
> [j-keer...@ti.com Fixed the am335x build issues]
> Signed-off-by: Keerthy 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 4/6] arm: mach-omap2: am33xx: Disable EMIF_DEVOFF immediately before hw leveling

2019-04-28 Thread Keerthy
From: Brad Griffis 

In case of RTC+DDR resume, need to restore EMIF context
before initiating hardware leveling.

Signed-off-by: Brad Griffis 
[j-keer...@ti.com Fixed the am335x build issues]
Signed-off-by: Keerthy 
---

Changes in v2:

  * Added the am43xx specific changes under #ifdef

 arch/arm/mach-omap2/am33xx/board.c |  3 ---
 arch/arm/mach-omap2/am33xx/ddr.c   | 14 ++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/am33xx/board.c 
b/arch/arm/mach-omap2/am33xx/board.c
index fe7b8e1e55..5507348981 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -481,9 +481,6 @@ static void rtc_only(void)
rtc_only_prcm_init();
sdram_init();
 
-   /* Disable EMIF_DEVOFF for normal operation and to exit self-refresh */
-   writel(0, _device->emif_ctrl);
-
/* Check EMIF4D_SDRAM_CONFIG[31:29] SDRAM_TYPE */
/* Only perform leveling if SDRAM_TYPE = 3 (DDR3) */
sdrc = readl(AM43XX_EMIF_BASE + AM43XX_SDRAM_CONFIG_OFFSET);
diff --git a/arch/arm/mach-omap2/am33xx/ddr.c b/arch/arm/mach-omap2/am33xx/ddr.c
index 5d947a68c3..c70b6fe31b 100644
--- a/arch/arm/mach-omap2/am33xx/ddr.c
+++ b/arch/arm/mach-omap2/am33xx/ddr.c
@@ -80,6 +80,11 @@ static void configure_mr(int nr, u32 cs)
  */
 void config_sdram_emif4d5(const struct emif_regs *regs, int nr)
 {
+#ifdef CONFIG_AM43XX
+   struct prm_device_inst *prm_device =
+   (struct prm_device_inst *)PRM_DEVICE_INST;
+#endif
+
writel(0xA0, _reg[nr]->emif_pwr_mgmt_ctrl);
writel(0xA0, _reg[nr]->emif_pwr_mgmt_ctrl_shdw);
writel(regs->zq_config, _reg[nr]->emif_zq_config);
@@ -126,6 +131,15 @@ void config_sdram_emif4d5(const struct emif_regs *regs, 
int nr)
writel(regs->ref_ctrl, _reg[nr]->emif_sdram_ref_ctrl);
writel(regs->ref_ctrl, _reg[nr]->emif_sdram_ref_ctrl_shdw);
 
+#ifdef CONFIG_AM43XX
+   /*
+* Disable EMIF_DEVOFF
+* -> Cold Boot: This is just rewriting the default register value.
+* -> RTC Resume: Must disable DEVOFF before leveling.
+*/
+   writel(0, _device->emif_ctrl);
+#endif
+
/* Perform hardware leveling for DDR3 */
if (emif_sdram_type(regs->sdram_config) == EMIF_SDRAM_TYPE_DDR3) {
writel(readl(_reg[nr]->emif_ddr_ext_phy_ctrl_36) |
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot