blob: 5a94235c4b9e90e500daa63f6940ec3ddec7f9ab [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +09002/*
3 * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
4 * (C) Copyright 2012 Renesas Solutions Corp.
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +09005 */
Paul Barker442ce1c2023-11-01 20:05:53 +00006
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +09007#include <asm/io.h>
8
9u32 rmobile_get_cpu_type(void)
10{
11 u32 id;
12 u32 type;
13 struct r8a7740_hpb *hpb = (struct r8a7740_hpb *)HPB_BASE;
14
15 id = readl(hpb->cccr);
16 type = (id >> 8) & 0xFF;
17
18 return type;
19}
20
Nobuhiro Iwamatsu852a0a22012-07-20 13:07:43 +090021u32 rmobile_get_cpu_rev(void)
Nobuhiro Iwamatsu3966dea2012-07-20 13:06:54 +090022{
23 u32 id;
24 u32 rev;
25 struct r8a7740_hpb *hpb = (struct r8a7740_hpb *)HPB_BASE;
26
27 id = readl(hpb->cccr);
28 rev = (id >> 4) & 0xF;
29
30 return rev;
31}