blob: 223140213f48d5d37420b01b7d035c7ea2b8ebec [file] [log] [blame]
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +09001/*
2 * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
3 * (C) Copyright 2012 Renesas Solutions Corp.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23#include <common.h>
24#include <asm/io.h>
25
26u32 rmobile_get_cpu_type(void)
27{
28 u32 id;
29 u32 type;
30 struct r8a7740_hpb *hpb = (struct r8a7740_hpb *)HPB_BASE;
31
32 id = readl(hpb->cccr);
33 type = (id >> 8) & 0xFF;
34
35 return type;
36}
37
Nobuhiro Iwamatsu852a0a22012-07-20 13:07:43 +090038u32 rmobile_get_cpu_rev(void)
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +090039{
40 u32 id;
41 u32 rev;
42 struct r8a7740_hpb *hpb = (struct r8a7740_hpb *)HPB_BASE;
43
44 id = readl(hpb->cccr);
45 rev = (id >> 4) & 0xF;
46
47 return rev;
48}