cpu_info.c 934 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <init.h>
  9. #include <asm/global_data.h>
  10. #include <asm/io.h>
  11. #include <asm/arch/clk.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. /* Default is s5pc100 */
  14. unsigned int s5p_cpu_id = 0xC100;
  15. /* Default is EVT1 */
  16. unsigned int s5p_cpu_rev = 1;
  17. #ifdef CONFIG_ARCH_CPU_INIT
  18. int arch_cpu_init(void)
  19. {
  20. s5p_set_cpu_id();
  21. return 0;
  22. }
  23. #endif
  24. u32 get_device_type(void)
  25. {
  26. return s5p_cpu_id;
  27. }
  28. #ifdef CONFIG_DISPLAY_CPUINFO
  29. int print_cpuinfo(void)
  30. {
  31. const char *cpu_model;
  32. int len;
  33. /* For SoC with no real CPU ID in naming convention. */
  34. cpu_model = fdt_getprop(gd->fdt_blob, 0, "cpu-model", &len);
  35. if (cpu_model)
  36. printf("CPU: %.*s @ ", len, cpu_model);
  37. else
  38. printf("CPU: %s%X @ ", s5p_get_cpu_name(), s5p_cpu_id);
  39. print_freq(get_arm_clk(), "\n");
  40. return 0;
  41. }
  42. #endif