]>
Commit | Line | Data |
---|---|---|
4fb44e22 NI |
1 | /* |
2 | * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> | |
3 | * (C) Copyright 2012 Renesas Solutions Corp. | |
4 | * | |
1a459660 | 5 | * SPDX-License-Identifier: GPL-2.0+ |
4fb44e22 NI |
6 | */ |
7 | #include <common.h> | |
8 | #include <asm/io.h> | |
4fb44e22 NI |
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 | { | |
a523af69 MV |
21 | #if defined(CONFIG_RCAR_GEN3) |
22 | rcar_gen3_memmap_fixup(); | |
23 | #endif | |
4fb44e22 NI |
24 | dcache_enable(); |
25 | } | |
26 | #endif | |
27 | ||
28 | #ifdef CONFIG_DISPLAY_CPUINFO | |
1cdf2482 | 29 | static u32 __rmobile_get_cpu_type(void) |
4fb44e22 | 30 | { |
1cdf2482 | 31 | return 0x0; |
4fb44e22 | 32 | } |
1cdf2482 NI |
33 | u32 rmobile_get_cpu_type(void) |
34 | __attribute__((weak, alias("__rmobile_get_cpu_type"))); | |
4fb44e22 | 35 | |
4f007b83 | 36 | static u32 __rmobile_get_cpu_rev_integer(void) |
4fb44e22 | 37 | { |
1cdf2482 | 38 | return 0; |
4fb44e22 | 39 | } |
4f007b83 TK |
40 | u32 rmobile_get_cpu_rev_integer(void) |
41 | __attribute__((weak, alias("__rmobile_get_cpu_rev_integer"))); | |
42 | ||
43 | static u32 __rmobile_get_cpu_rev_fraction(void) | |
44 | { | |
45 | return 0; | |
46 | } | |
47 | u32 rmobile_get_cpu_rev_fraction(void) | |
48 | __attribute__((weak, alias("__rmobile_get_cpu_rev_fraction"))); | |
4fb44e22 | 49 | |
73ff6801 NI |
50 | /* CPU infomation table */ |
51 | static const struct { | |
52 | u16 cpu_type; | |
53 | u8 cpu_name[10]; | |
54 | } rmobile_cpuinfo[] = { | |
262e9156 MV |
55 | { RMOBILE_CPU_TYPE_SH73A0, "SH73A0" }, |
56 | { RMOBILE_CPU_TYPE_R8A7740, "R8A7740" }, | |
57 | { RMOBILE_CPU_TYPE_R8A7790, "R8A7790" }, | |
58 | { RMOBILE_CPU_TYPE_R8A7791, "R8A7791" }, | |
59 | { RMOBILE_CPU_TYPE_R8A7792, "R8A7792" }, | |
60 | { RMOBILE_CPU_TYPE_R8A7793, "R8A7793" }, | |
61 | { RMOBILE_CPU_TYPE_R8A7794, "R8A7794" }, | |
62 | { RMOBILE_CPU_TYPE_R8A7795, "R8A7795" }, | |
63 | { RMOBILE_CPU_TYPE_R8A7796, "R8A7796" }, | |
5cb19e7a | 64 | { RMOBILE_CPU_TYPE_R8A77970, "R8A77970" }, |
1154541a | 65 | { RMOBILE_CPU_TYPE_R8A77995, "R8A77995" }, |
73ff6801 NI |
66 | { 0x0, "CPU" }, |
67 | }; | |
68 | ||
4fb44e22 NI |
69 | int print_cpuinfo(void) |
70 | { | |
73ff6801 NI |
71 | int i = 0; |
72 | u32 cpu_type = rmobile_get_cpu_type(); | |
73 | for (; i < ARRAY_SIZE(rmobile_cpuinfo); i++) { | |
74 | if (rmobile_cpuinfo[i].cpu_type == cpu_type) { | |
75 | printf("CPU: Renesas Electronics %s rev %d.%d\n", | |
76 | rmobile_cpuinfo[i].cpu_name, | |
77 | rmobile_get_cpu_rev_integer(), | |
78 | rmobile_get_cpu_rev_fraction()); | |
79 | break; | |
80 | } | |
4fb44e22 NI |
81 | } |
82 | return 0; | |
83 | } | |
1cdf2482 | 84 | #endif /* CONFIG_DISPLAY_CPUINFO */ |