Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> |
| 3 | * (C) Copyright 2012 Renesas Solutions Corp. |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 6 | */ |
| 7 | #include <common.h> |
| 8 | #include <asm/io.h> |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 9 | |
| 10 | #ifdef CONFIG_ARCH_CPU_INIT |
| 11 | int arch_cpu_init(void) |
| 12 | { |
| 13 | icache_enable(); |
| 14 | return 0; |
| 15 | } |
| 16 | #endif |
| 17 | |
| 18 | #ifndef CONFIG_SYS_DCACHE_OFF |
| 19 | void enable_caches(void) |
| 20 | { |
| 21 | dcache_enable(); |
| 22 | } |
| 23 | #endif |
| 24 | |
| 25 | #ifdef CONFIG_DISPLAY_CPUINFO |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 26 | static u32 __rmobile_get_cpu_type(void) |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 27 | { |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 28 | return 0x0; |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 29 | } |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 30 | u32 rmobile_get_cpu_type(void) |
| 31 | __attribute__((weak, alias("__rmobile_get_cpu_type"))); |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 32 | |
Tetsuyuki Kobayashi | 7811e54 | 2012-07-25 18:24:21 +0000 | [diff] [blame] | 33 | static u32 __rmobile_get_cpu_rev_integer(void) |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 34 | { |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 35 | return 0; |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 36 | } |
Tetsuyuki Kobayashi | 7811e54 | 2012-07-25 18:24:21 +0000 | [diff] [blame] | 37 | u32 rmobile_get_cpu_rev_integer(void) |
| 38 | __attribute__((weak, alias("__rmobile_get_cpu_rev_integer"))); |
| 39 | |
| 40 | static u32 __rmobile_get_cpu_rev_fraction(void) |
| 41 | { |
| 42 | return 0; |
| 43 | } |
| 44 | u32 rmobile_get_cpu_rev_fraction(void) |
| 45 | __attribute__((weak, alias("__rmobile_get_cpu_rev_fraction"))); |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 46 | |
| 47 | int print_cpuinfo(void) |
| 48 | { |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 49 | switch (rmobile_get_cpu_type()) { |
| 50 | case 0x37: |
Tetsuyuki Kobayashi | 7811e54 | 2012-07-25 18:24:21 +0000 | [diff] [blame] | 51 | printf("CPU: Renesas Electronics SH73A0 rev %d.%d\n", |
| 52 | rmobile_get_cpu_rev_integer(), |
| 53 | rmobile_get_cpu_rev_fraction()); |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 54 | break; |
Nobuhiro Iwamatsu | 3966dea | 2012-07-20 13:06:54 +0900 | [diff] [blame] | 55 | case 0x40: |
| 56 | printf("CPU: Renesas Electronics R8A7740 rev %d.%d\n", |
| 57 | rmobile_get_cpu_rev_integer(), |
| 58 | rmobile_get_cpu_rev_fraction()); |
| 59 | break; |
| 60 | |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 61 | default: |
Tetsuyuki Kobayashi | 7811e54 | 2012-07-25 18:24:21 +0000 | [diff] [blame] | 62 | printf("CPU: Renesas Electronics CPU rev %d.%d\n", |
| 63 | rmobile_get_cpu_rev_integer(), |
| 64 | rmobile_get_cpu_rev_fraction()); |
Nobuhiro Iwamatsu | f3db9da | 2012-06-13 16:29:47 +0900 | [diff] [blame] | 65 | break; |
| 66 | } |
| 67 | return 0; |
| 68 | } |
Nobuhiro Iwamatsu | 940103d | 2012-08-19 04:40:05 +0000 | [diff] [blame] | 69 | #endif /* CONFIG_DISPLAY_CPUINFO */ |