diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2018-06-19 14:51:39 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-06-19 15:20:31 +0200 |
commit | aca804c9ddadbf34a8ff82779e5598ec5e319f23 (patch) | |
tree | b30e8cf5aea1c7052dcb7c32c1e0df54c5482494 | |
parent | df2b46ba248687c208767865abe5fca32a43faaf (diff) |
apalis-tk1: apalis_t30: colibri_t30: display reset reasonColibri-iMX7_LXDE-Image_2.8b3.111-20180627Colibri-iMX6_LXDE-Image_2.8b3.111-20180627Colibri-iMX6ULL_LXDE-Image_2.8b3.111-20180627Colibri-VF_LXDE-Image_2.8b3.111-20180626Colibri-T30_LXDE-Image_2.8b3.111-20180627Colibri-T20_LXDE-Image_2.8b3.111-20180626Apalis-iMX6_LXDE-Image_2.8b3.111-20180626Apalis-TK1_LXDE-Image_2.8b3.111-20180626Apalis-TK1-Mainline_LXDE-Image_2.8b3.111-20180627Apalis-T30_LXDE-Image_2.8b3.111-20180626
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r-- | arch/arm/mach-tegra/sys_info.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/arch/arm/mach-tegra/sys_info.c b/arch/arm/mach-tegra/sys_info.c index 5933c35ddd4..4fa25be1fa3 100644 --- a/arch/arm/mach-tegra/sys_info.c +++ b/arch/arm/mach-tegra/sys_info.c @@ -7,24 +7,36 @@ #include <common.h> #include <linux/ctype.h> +#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30) +#include <asm/arch-tegra/pmc.h> -static void upstring(char *s) +static char *get_reset_cause(void) { - while (*s) { - *s = toupper(*s); - s++; - } + struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; + + switch (pmc->pmc_reset_status) { + case 0x00: + return "POR"; + case 0x01: + return "WATCHDOG"; + case 0x02: + return "SENSOR"; + case 0x03: + return "SW_MAIN"; + case 0x04: + return "LP0"; + } + return "UNKNOWN"; } +#endif /* Print CPU information */ int print_cpuinfo(void) { - char soc_name[10]; - - strncpy(soc_name, CONFIG_SYS_SOC, 10); - upstring(soc_name); - puts(soc_name); - puts("\n"); + printf("SoC: %s\n", CONFIG_SYS_SOC); +#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30) + printf("Reset cause: %s\n", get_reset_cause()); +#endif /* TBD: Add printf of major/minor rev info, stepping, etc. */ return 0; |