]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mx6: soc: Switch to cold reset
authorDirk Behme <dirk.behme@de.bosch.com>
Mon, 9 Mar 2015 13:48:48 +0000 (14:48 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:30:59 +0000 (14:30 +0200)
Disable the warm reset and enable the cold reset for a more reliable
restart ('reset'). This is taken from the Linux kernel, see imx_src_init()
in arch/arm/mach-imx/src.c.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
arch/arm/cpu/armv7/mx6/soc.c

index 94bec4243b644ac71d3046ee53601ca2dea72beb..e9f69d4181a674f6c6df91044848c070185ec6ac 100644 (file)
@@ -483,6 +483,22 @@ static void set_preclk_from_osc(void)
 }
 #endif
 
 }
 #endif
 
+#define SRC_SCR_WARM_RESET_ENABLE      0
+
+static void init_src(void)
+{
+       struct src *src_regs = (struct src *)SRC_BASE_ADDR;
+       u32 val;
+
+       /*
+        * force warm reset sources to generate cold reset
+        * for a more reliable restart
+        */
+       val = readl(&src_regs->scr);
+       val &= ~(1 << SRC_SCR_WARM_RESET_ENABLE);
+       writel(val, &src_regs->scr);
+}
+
 int arch_cpu_init(void)
 {
        init_aips();
 int arch_cpu_init(void)
 {
        init_aips();
@@ -521,6 +537,8 @@ int arch_cpu_init(void)
        mxs_dma_init();
 #endif
 
        mxs_dma_init();
 #endif
 
+       init_src();
+
        return 0;
 }
 
        return 0;
 }