blob: 5f4076d6b701b399710b17093400dbc0cb380e79 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Minkyu Kang87649982009-10-01 17:20:01 +09002/*
3 * Copyright (C) 2009 Samsung Electronics
4 * Minkyu Kang <mk7.kang@samsung.com>
Minkyu Kang87649982009-10-01 17:20:01 +09005 */
6#include <common.h>
Przemyslaw Marczak808b6442015-10-27 13:07:55 +01007#include <fdtdec.h>
Minkyu Kang87649982009-10-01 17:20:01 +09008#include <asm/io.h>
9#include <asm/arch/clk.h>
10
Przemyslaw Marczak808b6442015-10-27 13:07:55 +010011DECLARE_GLOBAL_DATA_PTR;
12
Minkyu Kang87649982009-10-01 17:20:01 +090013/* Default is s5pc100 */
Minkyu Kang2917c0a2010-08-19 20:41:50 +090014unsigned int s5p_cpu_id = 0xC100;
Minkyu Kang13398722011-05-16 19:45:54 +090015/* Default is EVT1 */
16unsigned int s5p_cpu_rev = 1;
Minkyu Kang87649982009-10-01 17:20:01 +090017
18#ifdef CONFIG_ARCH_CPU_INIT
19int arch_cpu_init(void)
20{
Minkyu Kang2917c0a2010-08-19 20:41:50 +090021 s5p_set_cpu_id();
Minkyu Kang87649982009-10-01 17:20:01 +090022
Minkyu Kang87649982009-10-01 17:20:01 +090023 return 0;
24}
25#endif
26
27u32 get_device_type(void)
28{
Minkyu Kang2917c0a2010-08-19 20:41:50 +090029 return s5p_cpu_id;
Minkyu Kang87649982009-10-01 17:20:01 +090030}
31
32#ifdef CONFIG_DISPLAY_CPUINFO
33int print_cpuinfo(void)
34{
Przemyslaw Marczak808b6442015-10-27 13:07:55 +010035 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
Simon Glass004ee3b2015-07-02 18:16:15 -060045 print_freq(get_arm_clk(), "\n");
Minkyu Kang87649982009-10-01 17:20:01 +090046
47 return 0;
48}
49#endif