diff options
author | Eric Nelson <eric.nelson@boundarydevices.com> | 2015-02-15 14:37:21 -0700 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2015-02-17 10:42:54 +0100 |
commit | 11c2e505c4505a8c709cfa65675ba07aedec4e76 (patch) | |
tree | 96140dfe00cc75a7628e82742795bf24e9a7abe4 /arch/arm/imx-common | |
parent | fb2589b3307bcbb1c763b2039a50b5e8198af048 (diff) | |
download | u-boot-imx-11c2e505c4505a8c709cfa65675ba07aedec4e76.zip u-boot-imx-11c2e505c4505a8c709cfa65675ba07aedec4e76.tar.gz u-boot-imx-11c2e505c4505a8c709cfa65675ba07aedec4e76.tar.bz2 |
ARM: i.MX: provide access to reset cause through get_imx_reset_cause()
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Diffstat (limited to 'arch/arm/imx-common')
-rw-r--r-- | arch/arm/imx-common/cpu.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 28ccd29..067d08f 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -24,13 +24,16 @@ #include <fsl_esdhc.h> #endif -char *get_reset_cause(void) +static u32 reset_cause = -1; + +static char *get_reset_cause(void) { u32 cause; struct src *src_regs = (struct src *)SRC_BASE_ADDR; cause = readl(&src_regs->srsr); writel(cause, &src_regs->srsr); + reset_cause = cause; switch (cause) { case 0x00001: @@ -53,6 +56,11 @@ char *get_reset_cause(void) } } +u32 get_imx_reset_cause(void) +{ + return reset_cause; +} + #if defined(CONFIG_MX53) || defined(CONFIG_MX6) #if defined(CONFIG_MX53) #define MEMCTL_BASE ESDCTL_BASE_ADDR |