cpu_info.c 887 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2009 Samsung Electronics
  4. * Minkyu Kang <mk7.kang@samsung.com>
  5. */
  6. #include <common.h>
  7. #include <fdtdec.h>
  8. #include <asm/io.h>
  9. #include <asm/arch/clk.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. /* Default is s5pc100 */
  12. unsigned int s5p_cpu_id = 0xC100;
  13. /* Default is EVT1 */
  14. unsigned int s5p_cpu_rev = 1;
  15. #ifdef CONFIG_ARCH_CPU_INIT
  16. int arch_cpu_init(void)
  17. {
  18. s5p_set_cpu_id();
  19. return 0;
  20. }
  21. #endif
  22. u32 get_device_type(void)
  23. {
  24. return s5p_cpu_id;
  25. }
  26. #ifdef CONFIG_DISPLAY_CPUINFO
  27. int print_cpuinfo(void)
  28. {
  29. const char *cpu_model;
  30. int len;
  31. /* For SoC with no real CPU ID in naming convention. */
  32. cpu_model = fdt_getprop(gd->fdt_blob, 0, "cpu-model", &len);
  33. if (cpu_model)
  34. printf("CPU: %.*s @ ", len, cpu_model);
  35. else
  36. printf("CPU: %s%X @ ", s5p_get_cpu_name(), s5p_cpu_id);
  37. print_freq(get_arm_clk(), "\n");
  38. return 0;
  39. }
  40. #endif