~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/arch/arm/cpu/armv7/rmobile/cpu_info.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
 
3
 * (C) Copyright 2012 Renesas Solutions Corp.
 
4
 *
 
5
 * SPDX-License-Identifier:     GPL-2.0+
 
6
 */
 
7
#include <common.h>
 
8
#include <asm/io.h>
 
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
 
26
static u32 __rmobile_get_cpu_type(void)
 
27
{
 
28
        return 0x0;
 
29
}
 
30
u32 rmobile_get_cpu_type(void)
 
31
                __attribute__((weak, alias("__rmobile_get_cpu_type")));
 
32
 
 
33
static u32 __rmobile_get_cpu_rev_integer(void)
 
34
{
 
35
        return 0;
 
36
}
 
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")));
 
46
 
 
47
int print_cpuinfo(void)
 
48
{
 
49
        switch (rmobile_get_cpu_type()) {
 
50
        case 0x37:
 
51
                printf("CPU: Renesas Electronics SH73A0 rev %d.%d\n",
 
52
                       rmobile_get_cpu_rev_integer(),
 
53
                       rmobile_get_cpu_rev_fraction());
 
54
                break;
 
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
 
 
61
        case 0x45:
 
62
                printf("CPU: Renesas Electronics R8A7790 rev %d\n",
 
63
                       rmobile_get_cpu_rev_integer());
 
64
                break;
 
65
 
 
66
        case 0x47:
 
67
                printf("CPU: Renesas Electronics R8A7791 rev %d\n",
 
68
                        rmobile_get_cpu_rev_integer());
 
69
                break;
 
70
 
 
71
        default:
 
72
                printf("CPU: Renesas Electronics CPU rev %d.%d\n",
 
73
                       rmobile_get_cpu_rev_integer(),
 
74
                       rmobile_get_cpu_rev_fraction());
 
75
                break;
 
76
        }
 
77
        return 0;
 
78
}
 
79
#endif /* CONFIG_DISPLAY_CPUINFO */