blob: 4331dde7643d529307157d1e30ee2b0502ff0687 [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 */
Simon Glass1ab16922022-07-31 12:28:48 -06006#include <display_options.h>
Przemyslaw Marczak808b6442015-10-27 13:07:55 +01007#include <fdtdec.h>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06009#include <asm/global_data.h>
Minkyu Kang87649982009-10-01 17:20:01 +090010#include <asm/io.h>
11#include <asm/arch/clk.h>
12
Przemyslaw Marczak808b6442015-10-27 13:07:55 +010013DECLARE_GLOBAL_DATA_PTR;
14
Minkyu Kang87649982009-10-01 17:20:01 +090015/* Default is s5pc100 */
Minkyu Kang2917c0a2010-08-19 20:41:50 +090016unsigned int s5p_cpu_id = 0xC100;
Minkyu Kang13398722011-05-16 19:45:54 +090017/* Default is EVT1 */
18unsigned int s5p_cpu_rev = 1;
Minkyu Kang87649982009-10-01 17:20:01 +090019
20#ifdef CONFIG_ARCH_CPU_INIT
21int arch_cpu_init(void)
22{
Minkyu Kang2917c0a2010-08-19 20:41:50 +090023 s5p_set_cpu_id();
Minkyu Kang87649982009-10-01 17:20:01 +090024
Minkyu Kang87649982009-10-01 17:20:01 +090025 return 0;
26}
27#endif
28
29u32 get_device_type(void)
30{
Minkyu Kang2917c0a2010-08-19 20:41:50 +090031 return s5p_cpu_id;
Minkyu Kang87649982009-10-01 17:20:01 +090032}
33
34#ifdef CONFIG_DISPLAY_CPUINFO
35int print_cpuinfo(void)
36{
Przemyslaw Marczak808b6442015-10-27 13:07:55 +010037 const char *cpu_model;
38 int len;
39
40 /* For SoC with no real CPU ID in naming convention. */
41 cpu_model = fdt_getprop(gd->fdt_blob, 0, "cpu-model", &len);
42 if (cpu_model)
43 printf("CPU: %.*s @ ", len, cpu_model);
44 else
45 printf("CPU: %s%X @ ", s5p_get_cpu_name(), s5p_cpu_id);
46
Simon Glass004ee3b2015-07-02 18:16:15 -060047 print_freq(get_arm_clk(), "\n");
Minkyu Kang87649982009-10-01 17:20:01 +090048
49 return 0;
50}
51#endif