sys_info.c 859 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2010,2011
  4. * NVIDIA Corporation <www.nvidia.com>
  5. */
  6. #include <common.h>
  7. #include <init.h>
  8. #include <linux/ctype.h>
  9. #if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
  10. #include <asm/arch-tegra/pmc.h>
  11. static char *get_reset_cause(void)
  12. {
  13. struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
  14. switch (pmc->pmc_reset_status) {
  15. case 0x00:
  16. return "POR";
  17. case 0x01:
  18. return "WATCHDOG";
  19. case 0x02:
  20. return "SENSOR";
  21. case 0x03:
  22. return "SW_MAIN";
  23. case 0x04:
  24. return "LP0";
  25. }
  26. return "UNKNOWN";
  27. }
  28. #endif
  29. /* Print CPU information */
  30. int print_cpuinfo(void)
  31. {
  32. printf("SoC: %s\n", CONFIG_SYS_SOC);
  33. #if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA30)
  34. printf("Reset cause: %s\n", get_reset_cause());
  35. #endif
  36. /* TBD: Add printf of major/minor rev info, stepping, etc. */
  37. return 0;
  38. }