blob: 7790f087a09d4d79a76ca0c2d56205dd0fb8f15d [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>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Minkyu Kang87649982009-10-01 17:20:01 +09009#include <asm/io.h>
10#include <asm/arch/clk.h>
11
Przemyslaw Marczak808b6442015-10-27 13:07:55 +010012DECLARE_GLOBAL_DATA_PTR;
13
Minkyu Kang87649982009-10-01 17:20:01 +090014/* Default is s5pc100 */
Minkyu Kang2917c0a2010-08-19 20:41:50 +090015unsigned int s5p_cpu_id = 0xC100;
Minkyu Kang13398722011-05-16 19:45:54 +090016/* Default is EVT1 */
17unsigned int s5p_cpu_rev = 1;
Minkyu Kang87649982009-10-01 17:20:01 +090018
19#ifdef CONFIG_ARCH_CPU_INIT
20int arch_cpu_init(void)
21{
Minkyu Kang2917c0a2010-08-19 20:41:50 +090022 s5p_set_cpu_id();
Minkyu Kang87649982009-10-01 17:20:01 +090023
Minkyu Kang87649982009-10-01 17:20:01 +090024 return 0;
25}
26#endif
27
28u32 get_device_type(void)
29{
Minkyu Kang2917c0a2010-08-19 20:41:50 +090030 return s5p_cpu_id;
Minkyu Kang87649982009-10-01 17:20:01 +090031}
32
33#ifdef CONFIG_DISPLAY_CPUINFO
34int print_cpuinfo(void)
35{
Przemyslaw Marczak808b6442015-10-27 13:07:55 +010036 const char *cpu_model;
37 int len;
38
39 /* For SoC with no real CPU ID in naming convention. */
40 cpu_model = fdt_getprop(gd->fdt_blob, 0, "cpu-model", &len);
41 if (cpu_model)
42 printf("CPU: %.*s @ ", len, cpu_model);
43 else
44 printf("CPU: %s%X @ ", s5p_get_cpu_name(), s5p_cpu_id);
45
Simon Glass004ee3b2015-07-02 18:16:15 -060046 print_freq(get_arm_clk(), "\n");
Minkyu Kang87649982009-10-01 17:20:01 +090047
48 return 0;
49}
50#endif