blob: 42ee30fbe7acf29ac423ac966f8490aaf13ff0a8 [file] [log] [blame]
Nobuhiro Iwamatsu1d0e9272013-11-21 17:06:45 +09001/*
Nobuhiro Iwamatsu9b7fa2f2014-03-28 11:07:39 +09002 * arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
Nobuhiro Iwamatsu1d0e9272013-11-21 17:06:45 +09003 *
Nobuhiro Iwamatsu9b7fa2f2014-03-28 11:07:39 +09004 * Copyright (C) 2013,2014 Renesas Electronics Corporation
Nobuhiro Iwamatsu1d0e9272013-11-21 17:06:45 +09005 *
6 * SPDX-License-Identifier: GPL-2.0
7 */
8#include <common.h>
9#include <asm/io.h>
10
11#define PRR 0xFF000044
12
13u32 rmobile_get_cpu_type(void)
14{
15 return (readl(PRR) & 0x00007F00) >> 8;
16}
17
18u32 rmobile_get_cpu_rev_integer(void)
19{
Nobuhiro Iwamatsu210f7b22014-03-28 11:12:49 +090020 return ((readl(PRR) & 0x000000F0) >> 4) + 1;
Nobuhiro Iwamatsu1d0e9272013-11-21 17:06:45 +090021}
Nobuhiro Iwamatsua028abe2014-03-28 11:15:59 +090022
23u32 rmobile_get_cpu_rev_fraction(void)
24{
25 return readl(PRR) & 0x0000000F;
26}