Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2009 Samsung Electronics |
| 4 | * Minkyu Kang <mk7.kang@samsung.com> |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 5 | */ |
Simon Glass | 1ab1692 | 2022-07-31 12:28:48 -0600 | [diff] [blame] | 6 | #include <display_options.h> |
Przemyslaw Marczak | 808b644 | 2015-10-27 13:07:55 +0100 | [diff] [blame] | 7 | #include <fdtdec.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 9 | #include <asm/global_data.h> |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 10 | #include <asm/io.h> |
| 11 | #include <asm/arch/clk.h> |
| 12 | |
Przemyslaw Marczak | 808b644 | 2015-10-27 13:07:55 +0100 | [diff] [blame] | 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 15 | /* Default is s5pc100 */ |
Minkyu Kang | 2917c0a | 2010-08-19 20:41:50 +0900 | [diff] [blame] | 16 | unsigned int s5p_cpu_id = 0xC100; |
Minkyu Kang | 1339872 | 2011-05-16 19:45:54 +0900 | [diff] [blame] | 17 | /* Default is EVT1 */ |
| 18 | unsigned int s5p_cpu_rev = 1; |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 19 | |
| 20 | #ifdef CONFIG_ARCH_CPU_INIT |
| 21 | int arch_cpu_init(void) |
| 22 | { |
Minkyu Kang | 2917c0a | 2010-08-19 20:41:50 +0900 | [diff] [blame] | 23 | s5p_set_cpu_id(); |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 24 | |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 25 | return 0; |
| 26 | } |
| 27 | #endif |
| 28 | |
| 29 | u32 get_device_type(void) |
| 30 | { |
Minkyu Kang | 2917c0a | 2010-08-19 20:41:50 +0900 | [diff] [blame] | 31 | return s5p_cpu_id; |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | #ifdef CONFIG_DISPLAY_CPUINFO |
| 35 | int print_cpuinfo(void) |
| 36 | { |
Przemyslaw Marczak | 808b644 | 2015-10-27 13:07:55 +0100 | [diff] [blame] | 37 | 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 Glass | 004ee3b | 2015-07-02 18:16:15 -0600 | [diff] [blame] | 47 | print_freq(get_arm_clk(), "\n"); |
Minkyu Kang | 8764998 | 2009-10-01 17:20:01 +0900 | [diff] [blame] | 48 | |
| 49 | return 0; |
| 50 | } |
| 51 | #endif |