mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-02 01:19:49 +00:00
apalis-tk1/t30: colibri_t30: display reset reason
Display proper reset reason after the SoC info. Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
This commit is contained in:
parent
8c57395d49
commit
fbcb925654
1 changed files with 22 additions and 10 deletions
|
@ -6,24 +6,36 @@
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <linux/ctype.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) {
|
struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
|
||||||
*s = toupper(*s);
|
|
||||||
s++;
|
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 */
|
/* Print CPU information */
|
||||||
int print_cpuinfo(void)
|
int print_cpuinfo(void)
|
||||||
{
|
{
|
||||||
char soc_name[10];
|
printf("SoC: %s\n", CONFIG_SYS_SOC);
|
||||||
|
#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
|
||||||
strncpy(soc_name, CONFIG_SYS_SOC, 10);
|
printf("Reset cause: %s\n", get_reset_cause());
|
||||||
upstring(soc_name);
|
#endif
|
||||||
puts(soc_name);
|
|
||||||
puts("\n");
|
|
||||||
|
|
||||||
/* TBD: Add printf of major/minor rev info, stepping, etc. */
|
/* TBD: Add printf of major/minor rev info, stepping, etc. */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue