mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
ARM: mx25: Print the source of reset
Print the source of reset during boot. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
This commit is contained in:
parent
986d0d1bc5
commit
957dc02474
1 changed files with 24 additions and 1 deletions
|
@ -105,6 +105,28 @@ ulong imx_get_perclk (int clk)
|
||||||
return lldiv (fref, div);
|
return lldiv (fref, div);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *get_reset_cause(void)
|
||||||
|
{
|
||||||
|
/* read RCSR register from CCM module */
|
||||||
|
struct ccm_regs *ccm =
|
||||||
|
(struct ccm_regs *)IMX_CCM_BASE;
|
||||||
|
|
||||||
|
u32 cause = readl(&ccm->rcsr) & 0x0f;
|
||||||
|
|
||||||
|
if (cause == 0)
|
||||||
|
return "POR";
|
||||||
|
else if (cause == 1)
|
||||||
|
return "RST";
|
||||||
|
else if ((cause & 2) == 2)
|
||||||
|
return "WDOG";
|
||||||
|
else if ((cause & 4) == 4)
|
||||||
|
return "SW RESET";
|
||||||
|
else if ((cause & 8) == 8)
|
||||||
|
return "JTAG";
|
||||||
|
else
|
||||||
|
return "unknown reset";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
u32 get_cpu_rev(void)
|
u32 get_cpu_rev(void)
|
||||||
{
|
{
|
||||||
|
@ -136,10 +158,11 @@ int print_cpuinfo (void)
|
||||||
char buf[32];
|
char buf[32];
|
||||||
u32 cpurev = get_cpu_rev();
|
u32 cpurev = get_cpu_rev();
|
||||||
|
|
||||||
printf("CPU: Freescale i.MX25 rev%d.%d%s at %s MHz\n\n",
|
printf("CPU: Freescale i.MX25 rev%d.%d%s at %s MHz\n",
|
||||||
(cpurev & 0xF0) >> 4, (cpurev & 0x0F),
|
(cpurev & 0xF0) >> 4, (cpurev & 0x0F),
|
||||||
((cpurev & 0x8000) ? " unknown" : ""),
|
((cpurev & 0x8000) ? " unknown" : ""),
|
||||||
strmhz (buf, imx_get_armclk ()));
|
strmhz (buf, imx_get_armclk ()));
|
||||||
|
printf("Reset cause: %s\n\n", get_reset_cause());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue