cpu.c 943 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2008 - 2013 Tensilica Inc.
  4. * (C) Copyright 2014 - 2016 Cadence Design Systems Inc.
  5. */
  6. /*
  7. * CPU specific code
  8. */
  9. #include <common.h>
  10. #include <command.h>
  11. #include <init.h>
  12. #include <vsprintf.h>
  13. #include <linux/stringify.h>
  14. #include <asm/global_data.h>
  15. #include <asm/cache.h>
  16. #include <asm/string.h>
  17. #include <asm/misc.h>
  18. DECLARE_GLOBAL_DATA_PTR;
  19. gd_t *gd __section(".data");
  20. #if defined(CONFIG_DISPLAY_CPUINFO)
  21. /*
  22. * Print information about the CPU.
  23. */
  24. int print_cpuinfo(void)
  25. {
  26. char buf[120], mhz[8];
  27. uint32_t id0, id1;
  28. asm volatile ("rsr %0, 176\n"
  29. "rsr %1, 208\n"
  30. : "=r"(id0), "=r"(id1));
  31. sprintf(buf, "CPU: Xtensa %s (id: %08x:%08x) at %s MHz\n",
  32. XCHAL_CORE_ID, id0, id1, strmhz(mhz, gd->cpu_clk));
  33. puts(buf);
  34. return 0;
  35. }
  36. #endif
  37. int arch_cpu_init(void)
  38. {
  39. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  40. return 0;
  41. }
  42. int dram_init(void)
  43. {
  44. return 0;
  45. }