Patchwork [U-Boot,v4,11/13] tegra20: move SDRAM param save to later in boot

login
register
mail settings
Submitter Allen Martin
Date June 22, 2012, midnight
Message ID <1340323247-15512-12-git-send-email-amartin@nvidia.com>
Download mbox | patch
Permalink /patch/166444/
State Accepted
Commit a49716aa7cda96f5e8cd15e57587da7a99f9e330
Headers show

Comments

Allen Martin - June 22, 2012, midnight
Move warmboot_save_sdram_params() to later in the boot sequence.  This
code relies on devicetree to get the address of the memory controller
and with upcoming changes for SPL boot it gets called early in the
boot process when devicetree is not initialized yet.

Signed-off-by: Allen Martin <amartin@nvidia.com>
---
 arch/arm/cpu/tegra20-common/ap20.c |    5 -----
 board/nvidia/common/board.c        |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

Patch

diff --git a/arch/arm/cpu/tegra20-common/ap20.c b/arch/arm/cpu/tegra20-common/ap20.c
index 8b6afbc..6ff71e0 100644
--- a/arch/arm/cpu/tegra20-common/ap20.c
+++ b/arch/arm/cpu/tegra20-common/ap20.c
@@ -345,11 +345,6 @@  void init_pmc_scratch(void)
 	/* ODMDATA is for kernel use to determine RAM size, LP config, etc. */
 	odmdata = get_odmdata();
 	writel(odmdata, &pmc->pmc_scratch20);
-
-#ifdef CONFIG_TEGRA20_LP0
-	/* save Sdram params to PMC 2, 4, and 24 for WB0 */
-	warmboot_save_sdram_params();
-#endif
 }
 
 void tegra20_start(void)
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index f349243..03f629d 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -126,6 +126,9 @@  int board_init(void)
 #endif
 
 #ifdef CONFIG_TEGRA20_LP0
+	/* save Sdram params to PMC 2, 4, and 24 for WB0 */
+	warmboot_save_sdram_params();
+
 	/* prepare the WB code to LP0 location */
 	warmboot_prepare_code(TEGRA_LP0_ADDR, TEGRA_LP0_SIZE);
 #endif