diff options
Diffstat (limited to 'arch/arm/mach-imx/cpu.c')
-rw-r--r-- | arch/arm/mach-imx/cpu.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 3f19f7e4e5..67db961ea6 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -43,7 +43,12 @@ static char *get_reset_cause(void) struct src *src_regs = (struct src *)SRC_BASE_ADDR; cause = readl(&src_regs->srsr); +#ifndef CONFIG_ANDROID_BOOT_IMAGE + /* We will read the ssrs states later for android so we don't + * clear the states here. + */ writel(cause, &src_regs->srsr); +#endif reset_cause = cause; switch (cause) { @@ -87,6 +92,17 @@ static char *get_reset_cause(void) } } +#ifdef CONFIG_ANDROID_BOOT_IMAGE +void get_reboot_reason(char *ret) +{ + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + + strcpy(ret, (char *)get_reset_cause()); + /* clear the srsr here, its state has been recorded in reset_cause */ + writel(reset_cause, &src_regs->srsr); +} +#endif + u32 get_imx_reset_cause(void) { return reset_cause; |