blob: 07a33fb2aed1bb4229796356fc67bde51f5569b2 [file] [log] [blame]
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +09001/*
2 * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
3 * (C) Copyright 2012 Renesas Solutions Corp.
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +09006 */
7#include <common.h>
8#include <asm/io.h>
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +09009
10#ifdef CONFIG_ARCH_CPU_INIT
11int arch_cpu_init(void)
12{
13 icache_enable();
14 return 0;
15}
16#endif
17
18#ifndef CONFIG_SYS_DCACHE_OFF
19void enable_caches(void)
20{
21 dcache_enable();
22}
23#endif
24
25#ifdef CONFIG_DISPLAY_CPUINFO
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000026static u32 __rmobile_get_cpu_type(void)
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090027{
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000028 return 0x0;
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090029}
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000030u32 rmobile_get_cpu_type(void)
31 __attribute__((weak, alias("__rmobile_get_cpu_type")));
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090032
Tetsuyuki Kobayashi7811e542012-07-25 18:24:21 +000033static u32 __rmobile_get_cpu_rev_integer(void)
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090034{
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000035 return 0;
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090036}
Tetsuyuki Kobayashi7811e542012-07-25 18:24:21 +000037u32 rmobile_get_cpu_rev_integer(void)
38 __attribute__((weak, alias("__rmobile_get_cpu_rev_integer")));
39
40static u32 __rmobile_get_cpu_rev_fraction(void)
41{
42 return 0;
43}
44u32 rmobile_get_cpu_rev_fraction(void)
45 __attribute__((weak, alias("__rmobile_get_cpu_rev_fraction")));
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090046
47int print_cpuinfo(void)
48{
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000049 switch (rmobile_get_cpu_type()) {
50 case 0x37:
Tetsuyuki Kobayashi7811e542012-07-25 18:24:21 +000051 printf("CPU: Renesas Electronics SH73A0 rev %d.%d\n",
52 rmobile_get_cpu_rev_integer(),
53 rmobile_get_cpu_rev_fraction());
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000054 break;
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +090055 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 Iwamatsuf3db9da2012-06-13 16:29:47 +090061 default:
Tetsuyuki Kobayashi7811e542012-07-25 18:24:21 +000062 printf("CPU: Renesas Electronics CPU rev %d.%d\n",
63 rmobile_get_cpu_rev_integer(),
64 rmobile_get_cpu_rev_fraction());
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +090065 break;
66 }
67 return 0;
68}
Nobuhiro Iwamatsu940103d2012-08-19 04:40:05 +000069#endif /* CONFIG_DISPLAY_CPUINFO */