* [U-Boot] [PATCH] mx6: soc: Switch to cold reset
@ 2015-03-09 13:48 Dirk Behme
2015-03-13 12:46 ` Stefano Babic
0 siblings, 1 reply; 2+ messages in thread
From: Dirk Behme @ 2015-03-09 13:48 UTC (permalink / raw)
To: u-boot
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 | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 5f5f497..12be6ff 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -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;
}
--
1.8.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot] [PATCH] mx6: soc: Switch to cold reset
2015-03-09 13:48 [U-Boot] [PATCH] mx6: soc: Switch to cold reset Dirk Behme
@ 2015-03-13 12:46 ` Stefano Babic
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2015-03-13 12:46 UTC (permalink / raw)
To: u-boot
Hi Dirk,
On 09/03/2015 14:48, Dirk Behme wrote:
> 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>
> ---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-13 12:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-09 13:48 [U-Boot] [PATCH] mx6: soc: Switch to cold reset Dirk Behme
2015-03-13 12:46 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox