diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/arch/arm/mach-tegra/sys_info.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/arch/arm/mach-tegra/sys_info.c')
-rw-r--r-- | roms/u-boot/arch/arm/mach-tegra/sys_info.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/roms/u-boot/arch/arm/mach-tegra/sys_info.c b/roms/u-boot/arch/arm/mach-tegra/sys_info.c new file mode 100644 index 000000000..5ad586ac1 --- /dev/null +++ b/roms/u-boot/arch/arm/mach-tegra/sys_info.c @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2010,2011 + * NVIDIA Corporation <www.nvidia.com> + */ + +#include <common.h> +#include <init.h> +#include <linux/ctype.h> +#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30) +#include <asm/arch-tegra/pmc.h> + +static char *get_reset_cause(void) +{ + struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; + + switch (pmc->pmc_reset_status) { + case 0x00: + return "POR"; + case 0x01: + return "WATCHDOG"; + case 0x02: + return "SENSOR"; + case 0x03: + return "SW_MAIN"; + case 0x04: + return "LP0"; + } + return "UNKNOWN"; +} +#endif + +/* Print CPU information */ +int print_cpuinfo(void) +{ + printf("SoC: %s\n", CONFIG_SYS_SOC); +#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30) + printf("Reset cause: %s\n", get_reset_cause()); +#endif + + /* TBD: Add printf of major/minor rev info, stepping, etc. */ + return 0; +} |