diff options
author | Stefan Agner <stefan@agner.ch> | 2014-11-27 23:58:20 +0100 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2014-12-01 10:20:22 +0100 |
commit | 9e89a64fbd0ddfde17741b38cc95fbdc02679d86 (patch) | |
tree | 81fc8ca2bf0c887d9136bcbc2940a13699128298 /arch/arm/cpu/armv7/vf610/generic.c | |
parent | 16159be761c2f8f2a3c33e307e5fc9865191e3da (diff) |
arm: vf610: improve evaluation of reset source
Improve the evaluation of the reset source. Bit description according
to latest reference manual rev. 7.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'arch/arm/cpu/armv7/vf610/generic.c')
-rw-r--r-- | arch/arm/cpu/armv7/vf610/generic.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c index a26d63ebe0..92aaad9415 100644 --- a/arch/arm/cpu/armv7/vf610/generic.c +++ b/arch/arm/cpu/armv7/vf610/generic.c @@ -265,20 +265,21 @@ static char *get_reset_cause(void) cause = readl(&src_regs->srsr); writel(cause, &src_regs->srsr); - cause &= 0xff; - switch (cause) { - case 0x08: - return "WDOG"; - case 0x20: + if (cause & SRC_SRSR_POR_RST) + return "POWER ON RESET"; + else if (cause & SRC_SRSR_WDOG_A5) + return "WDOG A5"; + else if (cause & SRC_SRSR_WDOG_M4) + return "WDOG M4"; + else if (cause & SRC_SRSR_JTAG_RST) return "JTAG HIGH-Z"; - case 0x80: + else if (cause & SRC_SRSR_SW_RST) + return "SW RESET"; + else if (cause & SRC_SRSR_RESETB) return "EXTERNAL RESET"; - case 0xfd: - return "POR"; - default: + else return "unknown reset"; - } } int print_cpuinfo(void) |