cpu.c 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <linux/stringify.h>
  12. #include <asm/global_data.h>
  13. #include <asm/cache.h>
  14. #include <asm/string.h>
  15. #include <asm/misc.h>
  16. DECLARE_GLOBAL_DATA_PTR;
  17. gd_t *gd __attribute__((section(".data")));
  18. #if defined(CONFIG_DISPLAY_CPUINFO)
  19. /*
  20. * Print information about the CPU.
  21. */
  22. int print_cpuinfo(void)
  23. {
  24. char buf[120], mhz[8];
  25. uint32_t id0, id1;
  26. asm volatile ("rsr %0, 176\n"
  27. "rsr %1, 208\n"
  28. : "=r"(id0), "=r"(id1));
  29. sprintf(buf, "CPU: Xtensa %s (id: %08x:%08x) at %s MHz\n",
  30. XCHAL_CORE_ID, id0, id1, strmhz(mhz, gd->cpu_clk));
  31. puts(buf);
  32. return 0;
  33. }
  34. #endif
  35. int arch_cpu_init(void)
  36. {
  37. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  38. return 0;
  39. }
  40. int dram_init(void)
  41. {
  42. return 0;
  43. }