Skip to content

Commit

Permalink
mx6: soc: Switch to cold reset
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dirkbehme authored and sbabic committed Mar 13, 2015
1 parent 0c1842a commit 9d16c52
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/arm/cpu/armv7/mx6/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,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();
Expand Down Expand Up @@ -322,6 +338,8 @@ int arch_cpu_init(void)
mxs_dma_init();
#endif

init_src();

return 0;
}

Expand Down

0 comments on commit 9d16c52

Please sign in to comment.