cpu_info.c 905 B

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