armv8: fsl-layerscape: make icid setup endianness aware
[oweals/u-boot.git] / arch / arm / mach-tegra / sys_info.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2010,2011
4  * NVIDIA Corporation <www.nvidia.com>
5  */
6
7 #include <common.h>
8 #include <linux/ctype.h>
9 #if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
10 #include <asm/arch-tegra/pmc.h>
11
12 static char *get_reset_cause(void)
13 {
14         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";
27         }
28         return "UNKNOWN";
29 }
30 #endif
31
32 /* Print CPU information */
33 int print_cpuinfo(void)
34 {
35         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
39
40         /* TBD: Add printf of major/minor rev info, stepping, etc. */
41         return 0;
42 }