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