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