blob: 11b40480246620d88c8a0dd7e89b93227d0295f1 [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
Simon Glass97589732020-05-10 11:40:02 -06007#include <init.h>
Tom Warren61c6d0e2012-12-11 13:34:15 +00008#include <linux/ctype.h>
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +03009#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
10#include <asm/arch-tegra/pmc.h>
Tom Warren41b68382011-01-27 10:58:05 +000011
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030012static char *get_reset_cause(void)
Tom Warren61c6d0e2012-12-11 13:34:15 +000013{
Dominik Sliwa4e9c07f2019-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 Warren61c6d0e2012-12-11 13:34:15 +000027 }
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030028 return "UNKNOWN";
Tom Warren61c6d0e2012-12-11 13:34:15 +000029}
Dominik Sliwa4e9c07f2019-08-01 11:06:37 +030030#endif
Tom Warren61c6d0e2012-12-11 13:34:15 +000031
Tom Warren41b68382011-01-27 10:58:05 +000032/* Print CPU information */
33int print_cpuinfo(void)
34{
Dominik Sliwa4e9c07f2019-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 Warren41b68382011-01-27 10:58:05 +000039
40 /* TBD: Add printf of major/minor rev info, stepping, etc. */
41 return 0;
42}