Skip to contentSkip to conversation

mx6: soc: Switch to cold reset

PATCH New Dirk Behme 2 participants 2 messages Mar 9, 2015 – Mar 13, 2015 Arm (32-bit)

lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

PATCH 1/1 mx6: soc: Switch to cold reset

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.

---
 arch/arm/cpu/armv7/mx6/soc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/cpu/armv7/mx6/soc.c +18 -0
index 5f5f497..12be6ff 100644
@@ -267,6 +267,22 @@ static void set_preclk_from_osc(void)
 }
 #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();
@@ -294,6 +310,8 @@ int arch_cpu_init(void)
 	mxs_dma_init();
 #endif
 
+	init_src();
+
 	return 0;
 }
 
Signature · 1 line
1.8.2
#1 lore raw

PATCH 1/1 mx6: soc: Switch to cold reset

Hi Dirk,

Quoted 6 lines · Dirk Behme

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.

---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================