blob: 764c6614ea7f2bad8eb6dd15fb3c9c2a3f20081a [file] [log] [blame]
Minkyu Kang87649982009-10-01 17:20:01 +09001/*
2 * Copyright (C) 2009 Samsung Electronics
3 * Minkyu Kang <mk7.kang@samsung.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Minkyu Kang87649982009-10-01 17:20:01 +09006 */
7#include <common.h>
Przemyslaw Marczak808b6442015-10-27 13:07:55 +01008#include <fdtdec.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