diff mbox series

[U-Boot,2/2] ARM: AM43XX: Call hw_data_init() again after relocation to update *ctrl

Message ID 1516356168-16697-3-git-send-email-faiz_abbas@ti.com
State Accepted
Commit a93feb2edc60b9db76ec794bff5ad0fcb10ce3eb
Delegated to: Tom Rini
Headers show
Series Fix QSPI boot on am43xx_idk | expand

Commit Message

Faiz Abbas Jan. 19, 2018, 10:02 a.m. UTC
hw_data_init() is called before relocation to initialise hardware data.
Since ctrl is initialized to OMAP_SRAM_SCRATCH_SYS_CTRL in
arch/arm/mach-omap2/am33xx/hw_data.c, the pointer *ctrl will not be
updated during relocation and will hold a stale value.

Therefore call hw_data_init() again after relocation to
reinitialize *ctrl.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
---
 board/ti/am43xx/board.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Tom Rini Jan. 28, 2018, 6:53 p.m. UTC | #1
On Fri, Jan 19, 2018 at 03:32:48PM +0530, Faiz Abbas wrote:

> hw_data_init() is called before relocation to initialise hardware data.
> Since ctrl is initialized to OMAP_SRAM_SCRATCH_SYS_CTRL in
> arch/arm/mach-omap2/am33xx/hw_data.c, the pointer *ctrl will not be
> updated during relocation and will hold a stale value.
> 
> Therefore call hw_data_init() again after relocation to
> reinitialize *ctrl.
> 
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 2c417e7..16fa818 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -580,6 +580,11 @@  int board_init(void)
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 	gpmc_init();
 
+	/*
+	 * Call this to initialize *ctrl again
+	 */
+	hw_data_init();
+
 	/* Clear all important bits for DSS errata that may need to be tweaked*/
 	mreqprio_0 = readl(&cdev->mreqprio_0) & MREQPRIO_0_SAB_INIT1_MASK &
 	                   MREQPRIO_0_SAB_INIT0_MASK;