blob: 5dc998a52b24412628337cd7c16d2e4dcf027894 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Warren3f82b1d2011-01-27 10:58:05 +00002/*
3 * (C) Copyright 2010,2011
4 * NVIDIA Corporation <www.nvidia.com>
Tom Warren3f82b1d2011-01-27 10:58:05 +00005 */
6
7#include <common.h>
Tom Warrenb2871032012-12-11 13:34:15 +00008#include <linux/ctype.h>
Dominik Sliwafbcb9252019-08-01 11:06:37 +03009#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
10#include <asm/arch-tegra/pmc.h>
Tom Warren3f82b1d2011-01-27 10:58:05 +000011
Dominik Sliwafbcb9252019-08-01 11:06:37 +030012static char *get_reset_cause(void)
Tom Warrenb2871032012-12-11 13:34:15 +000013{
Dominik Sliwafbcb9252019-08-01 11:06:37 +030014 struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
15
16 switch (pmc->pmc_reset_status) {
17 case 0x00:
18 return "POR";
19 case 0x01:
20 return "WATCHDOG";
21 case 0x02:
22 return "SENSOR";
23 case 0x03:
24 return "SW_MAIN";
25 case 0x04:
26 return "LP0";
Tom Warrenb2871032012-12-11 13:34:15 +000027 }
Dominik Sliwafbcb9252019-08-01 11:06:37 +030028 return "UNKNOWN";
Tom Warrenb2871032012-12-11 13:34:15 +000029}
Dominik Sliwafbcb9252019-08-01 11:06:37 +030030#endif
Tom Warrenb2871032012-12-11 13:34:15 +000031
Tom Warren3f82b1d2011-01-27 10:58:05 +000032/* Print CPU information */
33int print_cpuinfo(void)
34{
Dominik Sliwafbcb9252019-08-01 11:06:37 +030035 printf("SoC: %s\n", CONFIG_SYS_SOC);
36#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
37 printf("Reset cause: %s\n", get_reset_cause());
38#endif
Tom Warren3f82b1d2011-01-27 10:58:05 +000039
40 /* TBD: Add printf of major/minor rev info, stepping, etc. */
41 return 0;
42}