diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-11-27 23:48:59 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-11-27 23:48:59 +0100 |
commit | d7808def2faa98140e0ac9c61ec5816b65cebd56 (patch) | |
tree | 135725ff5be7d2c907be1861fb26015031481cde | |
parent | 73efb734a2b5eea2e63824978bc9e9a3ba1e34e8 (diff) |
arm: vf610: improve evaluation of reset source
Improve the evaluation of the reset source. Bit description according
to latest reference manual rev. 7.
-rw-r--r-- | arch/arm/cpu/armv7/vf610/generic.c | 21 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-vf610/imx-regs.h | 7 |
2 files changed, 18 insertions, 10 deletions
diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c index f586d064fd..f0ca019696 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) diff --git a/arch/arm/include/asm/arch-vf610/imx-regs.h b/arch/arm/include/asm/arch-vf610/imx-regs.h index 6a798e801f..68b97bbd39 100644 --- a/arch/arm/include/asm/arch-vf610/imx-regs.h +++ b/arch/arm/include/asm/arch-vf610/imx-regs.h @@ -270,6 +270,13 @@ #define SRC_SBMR2_BMOD_SERIAL 0x1 #define SRC_SBMR2_BMOD_RCON 0x2 +#define SRC_SRSR_SW_RST (0x1 << 18) +#define SRC_SRSR_RESETB (0x1 << 7) +#define SRC_SRSR_JTAG_RST (0x1 << 5) +#define SRC_SRSR_WDOG_M4 (0x1 << 4) +#define SRC_SRSR_WDOG_A5 (0x1 << 3) +#define SRC_SRSR_POR_RST (0x1 << 0) + #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) #include <asm/types.h> |