Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tom Warren | 3f82b1d | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2010,2011 |
| 4 | * NVIDIA Corporation <www.nvidia.com> |
Tom Warren | 3f82b1d | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Tom Warren | b287103 | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 9 | #include <linux/ctype.h> |
Dominik Sliwa | fbcb925 | 2019-08-01 11:06:37 +0300 | [diff] [blame] | 10 | #if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30) |
| 11 | #include <asm/arch-tegra/pmc.h> |
Tom Warren | 3f82b1d | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 12 | |
Dominik Sliwa | fbcb925 | 2019-08-01 11:06:37 +0300 | [diff] [blame] | 13 | static char *get_reset_cause(void) |
Tom Warren | b287103 | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 14 | { |
Dominik Sliwa | fbcb925 | 2019-08-01 11:06:37 +0300 | [diff] [blame] | 15 | 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 Warren | b287103 | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 28 | } |
Dominik Sliwa | fbcb925 | 2019-08-01 11:06:37 +0300 | [diff] [blame] | 29 | return "UNKNOWN"; |
Tom Warren | b287103 | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 30 | } |
Dominik Sliwa | fbcb925 | 2019-08-01 11:06:37 +0300 | [diff] [blame] | 31 | #endif |
Tom Warren | b287103 | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 32 | |
Tom Warren | 3f82b1d | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 33 | /* Print CPU information */ |
| 34 | int print_cpuinfo(void) |
| 35 | { |
Dominik Sliwa | fbcb925 | 2019-08-01 11:06:37 +0300 | [diff] [blame] | 36 | 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 Warren | 3f82b1d | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 40 | |
| 41 | /* TBD: Add printf of major/minor rev info, stepping, etc. */ |
| 42 | return 0; |
| 43 | } |