1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
4 * (C) Copyright 2012 Renesas Solutions Corp.
11 #include <linux/ctype.h>
13 #ifdef CONFIG_ARCH_CPU_INIT
14 int arch_cpu_init(void)
21 /* R-Car Gen3 D-cache is enabled in memmap-gen3.c */
22 #ifndef CONFIG_RCAR_GEN3
23 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
24 void enable_caches(void)
31 #ifdef CONFIG_DISPLAY_CPUINFO
33 static u32 __rmobile_get_cpu_type(void)
37 u32 rmobile_get_cpu_type(void)
38 __attribute__((weak, alias("__rmobile_get_cpu_type")));
40 static u32 __rmobile_get_cpu_rev_integer(void)
44 u32 rmobile_get_cpu_rev_integer(void)
45 __attribute__((weak, alias("__rmobile_get_cpu_rev_integer")));
47 static u32 __rmobile_get_cpu_rev_fraction(void)
51 u32 rmobile_get_cpu_rev_fraction(void)
52 __attribute__((weak, alias("__rmobile_get_cpu_rev_fraction")));
54 /* CPU infomation table */
58 } rmobile_cpuinfo[] = {
59 { RMOBILE_CPU_TYPE_SH73A0, "SH73A0" },
60 { RMOBILE_CPU_TYPE_R8A7740, "R8A7740" },
61 { RMOBILE_CPU_TYPE_R8A7790, "R8A7790" },
62 { RMOBILE_CPU_TYPE_R8A7791, "R8A7791" },
63 { RMOBILE_CPU_TYPE_R8A7792, "R8A7792" },
64 { RMOBILE_CPU_TYPE_R8A7793, "R8A7793" },
65 { RMOBILE_CPU_TYPE_R8A7794, "R8A7794" },
66 { RMOBILE_CPU_TYPE_R8A7795, "R8A7795" },
67 { RMOBILE_CPU_TYPE_R8A7796, "R8A7796" },
68 { RMOBILE_CPU_TYPE_R8A77965, "R8A77965" },
69 { RMOBILE_CPU_TYPE_R8A77970, "R8A77970" },
70 { RMOBILE_CPU_TYPE_R8A77980, "R8A77980" },
71 { RMOBILE_CPU_TYPE_R8A77990, "R8A77990" },
72 { RMOBILE_CPU_TYPE_R8A77995, "R8A77995" },
76 static int rmobile_cpuinfo_idx(void)
79 u32 cpu_type = rmobile_get_cpu_type();
81 for (; i < ARRAY_SIZE(rmobile_cpuinfo); i++)
82 if (rmobile_cpuinfo[i].cpu_type == cpu_type)
88 #ifdef CONFIG_ARCH_MISC_INIT
89 int arch_misc_init(void)
91 int i, idx = rmobile_cpuinfo_idx();
94 for (i = 0; i < sizeof(cpu); i++)
95 cpu[i] = tolower(rmobile_cpuinfo[idx].cpu_name[i]);
97 env_set("platform", cpu);
103 int print_cpuinfo(void)
105 int i = rmobile_cpuinfo_idx();
107 printf("CPU: Renesas Electronics %s rev %d.%d\n",
108 rmobile_cpuinfo[i].cpu_name, rmobile_get_cpu_rev_integer(),
109 rmobile_get_cpu_rev_fraction());
114 int print_cpuinfo(void)
116 printf("CPU: Renesas Electronics RZ/A1\n");
120 #endif /* CONFIG_DISPLAY_CPUINFO */