blob: 5ad586ac17fb079974c682a3e0a5dcda0c6a27a0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Warren41b68382011-01-27 10:58:05 +00002/*
3 * (C) Copyright 2010,2011
4 * NVIDIA Corporation <www.nvidia.com>
Tom Warren41b68382011-01-27 10:58:05 +00005 */
6
7#include <common.h>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Tom Warren61c6d0e2012-12-11 13:34:15 +00009#include <linux/ctype.h>
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030010#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
11#include <asm/arch-tegra/pmc.h>
Tom Warren41b68382011-01-27 10:58:05 +000012
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030013static char *get_reset_cause(void)
Tom Warren61c6d0e2012-12-11 13:34:15 +000014{
Dominik Sliwa4e9c07f2019-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 Warren61c6d0e2012-12-11 13:34:15 +000028 }
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030029 return "UNKNOWN";
Tom Warren61c6d0e2012-12-11 13:34:15 +000030}
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030031#endif
Tom Warren61c6d0e2012-12-11 13:34:15 +000032
Tom Warren41b68382011-01-27 10:58:05 +000033/* Print CPU information */
34int print_cpuinfo(void)
35{
Dominik Sliwa4e9c07f2019-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 Warren41b68382011-01-27 10:58:05 +000040
41 /* TBD: Add printf of major/minor rev info, stepping, etc. */
42 return 0;
43}