1 // SPDX-License-Identifier: GPL-2.0
3 * arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
5 * Copyright (C) 2013,2014 Renesas Electronics Corporation
10 #define PRR_MASK 0x7fff
11 #define R8A7796_REV_1_0 0x5200
12 #define R8A7796_REV_1_1 0x5210
14 static u32 rmobile_get_prr(void)
16 #ifdef CONFIG_RCAR_GEN3
17 return readl(0xFFF00044);
19 return readl(0xFF000044);
23 u32 rmobile_get_cpu_type(void)
25 return (rmobile_get_prr() & 0x00007F00) >> 8;
28 u32 rmobile_get_cpu_rev_integer(void)
30 const u32 prr = rmobile_get_prr();
32 if ((prr & PRR_MASK) == R8A7796_REV_1_1)
35 return ((prr & 0x000000F0) >> 4) + 1;
38 u32 rmobile_get_cpu_rev_fraction(void)
40 const u32 prr = rmobile_get_prr();
42 if ((prr & PRR_MASK) == R8A7796_REV_1_1)
45 return prr & 0x0000000F;