summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-02-06 13:23:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-02-09 10:47:37 +0100
commitfffa2bb1f98f9e0488f05f7da271be21aeef8734 (patch)
tree208ca703a0abd420fb56b1d7772eaf3a22c8ea27
parent42e1cec47fe59e7bf95331fab23f3617335d6a04 (diff)
downloadbarebox-fffa2bb1f98f9e0488f05f7da271be21aeef8734.tar.gz
barebox-fffa2bb1f98f9e0488f05f7da271be21aeef8734.tar.xz
ARM: i.MX25: Fix restoring of volatile register
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-imx/imx25.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/imx25.c b/arch/arm/mach-imx/imx25.c
index a4e27dd913..d27680e428 100644
--- a/arch/arm/mach-imx/imx25.c
+++ b/arch/arm/mach-imx/imx25.c
@@ -67,14 +67,16 @@ int imx25_init(void)
* To still be able to use the GPR for its intended purpose, copy the
* saved SRAM value back manually.
*/
- val = readl(MX25_IRAM_BASE_ADDR + 0x1734);
/*
- * When there is a different value in SRAM than the magic value
- * it must be a value saved to the GPR.
+ * When the value in the GPR matches the value the ROM has written there then
+ * we have to copy back the value from the SRAM back to the GPR.
*/
- if (val != MX25_BOOTROM_HAB_MAGIC)
+ val = readl(MX25_DRYICE_BASE_ADDR + MX25_DRYICE_GPR);
+ if (val == MX25_BOOTROM_HAB_MAGIC) {
+ val = readl(MX25_IRAM_BASE_ADDR + 0x1734);
writel(val, MX25_DRYICE_BASE_ADDR + MX25_DRYICE_GPR);
+ }
return 0;
}