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