2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2011-01-27 10:58:05 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2010,2011
|
|
|
|
* NVIDIA Corporation <www.nvidia.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2012-12-11 13:34:15 +00:00
|
|
|
#include <linux/ctype.h>
|
2019-08-01 08:06:37 +00:00
|
|
|
#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
|
|
|
|
#include <asm/arch-tegra/pmc.h>
|
2011-01-27 10:58:05 +00:00
|
|
|
|
2019-08-01 08:06:37 +00:00
|
|
|
static char *get_reset_cause(void)
|
2012-12-11 13:34:15 +00:00
|
|
|
{
|
2019-08-01 08:06:37 +00:00
|
|
|
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";
|
2012-12-11 13:34:15 +00:00
|
|
|
}
|
2019-08-01 08:06:37 +00:00
|
|
|
return "UNKNOWN";
|
2012-12-11 13:34:15 +00:00
|
|
|
}
|
2019-08-01 08:06:37 +00:00
|
|
|
#endif
|
2012-12-11 13:34:15 +00:00
|
|
|
|
2011-01-27 10:58:05 +00:00
|
|
|
/* Print CPU information */
|
|
|
|
int print_cpuinfo(void)
|
|
|
|
{
|
2019-08-01 08:06:37 +00:00
|
|
|
printf("SoC: %s\n", CONFIG_SYS_SOC);
|
|
|
|
#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
|
|
|
|
printf("Reset cause: %s\n", get_reset_cause());
|
|
|
|
#endif
|
2011-01-27 10:58:05 +00:00
|
|
|
|
|
|
|
/* TBD: Add printf of major/minor rev info, stepping, etc. */
|
|
|
|
return 0;
|
|
|
|
}
|