~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-r8a7740.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
u32 rmobile_get_cpu_type(void)
 
11
{
 
12
        u32 id;
 
13
        u32 type;
 
14
        struct r8a7740_hpb *hpb = (struct r8a7740_hpb *)HPB_BASE;
 
15
 
 
16
        id = readl(hpb->cccr);
 
17
        type = (id >> 8) & 0xFF;
 
18
 
 
19
        return type;
 
20
}
 
21
 
 
22
u32 rmobile_get_cpu_rev(void)
 
23
{
 
24
        u32 id;
 
25
        u32 rev;
 
26
        struct r8a7740_hpb *hpb = (struct r8a7740_hpb *)HPB_BASE;
 
27
 
 
28
        id = readl(hpb->cccr);
 
29
        rev = (id >> 4) & 0xF;
 
30
 
 
31
        return rev;
 
32
}