blob: 5ad586ac17fb079974c682a3e0a5dcda0c6a27a0 [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>
Simon Glass691d7192020-05-10 11:40:02 -06008#include <init.h>
Tom Warrenb2871032012-12-11 13:34:15 +00009#include <linux/ctype.h>
Dominik Sliwafbcb9252019-08-01 11:06:37 +030010#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
11#include <asm/arch-tegra/pmc.h>
Tom Warren3f82b1d2011-01-27 10:58:05 +000012
Dominik Sliwafbcb9252019-08-01 11:06:37 +030013static char *get_reset_cause(void)
Tom Warrenb2871032012-12-11 13:34:15 +000014{
Dominik Sliwafbcb9252019-08-01 11:06:37 +030015 struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
16
17 switch (pmc->pmc_reset_status) {
18 case 0x00:
19 return "POR";
20 case 0x01:
21 return "WATCHDOG";
22 case 0x02:
23 return "SENSOR";
24 case 0x03:
25 return "SW_MAIN";
26 case 0x04:
27 return "LP0";
Tom Warrenb2871032012-12-11 13:34:15 +000028 }
Dominik Sliwafbcb9252019-08-01 11:06:37 +030029 return "UNKNOWN";
Tom Warrenb2871032012-12-11 13:34:15 +000030}
Dominik Sliwafbcb9252019-08-01 11:06:37 +030031#endif
Tom Warrenb2871032012-12-11 13:34:15 +000032
Tom Warren3f82b1d2011-01-27 10:58:05 +000033/* Print CPU information */
34int print_cpuinfo(void)
35{
Dominik Sliwafbcb9252019-08-01 11:06:37 +030036 printf("SoC: %s\n", CONFIG_SYS_SOC);
37#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
38 printf("Reset cause: %s\n", get_reset_cause());
39#endif
Tom Warren3f82b1d2011-01-27 10:58:05 +000040
41 /* TBD: Add printf of major/minor rev info, stepping, etc. */
42 return 0;
43}