mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-12 07:57:21 +00:00
e965c89008
The R8A7796 r1.1 reports itself as r2.0 , add quirk into the PRR code to fix this report. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
39 lines
719 B
C
39 lines
719 B
C
/*
|
|
* arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
|
|
*
|
|
* Copyright (C) 2013,2014 Renesas Electronics Corporation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0
|
|
*/
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
|
|
#define PRR 0xFF000044
|
|
#define PRR_MASK 0x7fff
|
|
#define R8A7796_REV_1_0 0x5200
|
|
#define R8A7796_REV_1_1 0x5210
|
|
|
|
u32 rmobile_get_cpu_type(void)
|
|
{
|
|
return (readl(PRR) & 0x00007F00) >> 8;
|
|
}
|
|
|
|
u32 rmobile_get_cpu_rev_integer(void)
|
|
{
|
|
const u32 prr = readl(PRR);
|
|
|
|
if ((prr & PRR_MASK) == R8A7796_REV_1_1)
|
|
return 1;
|
|
else
|
|
return ((prr & 0x000000F0) >> 4) + 1;
|
|
}
|
|
|
|
u32 rmobile_get_cpu_rev_fraction(void)
|
|
{
|
|
const u32 prr = readl(PRR);
|
|
|
|
if ((prr & PRR_MASK) == R8A7796_REV_1_1)
|
|
return 1;
|
|
else
|
|
return prr & 0x0000000F;
|
|
}
|