aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-renesas/cpu_info-rcar.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2024-02-27 17:05:56 +0100
committerTom Rini <trini@konsulko.com>2024-03-02 14:29:36 -0500
commit40b9d53c7402c2ceac03c4c2af77a025ce11a0ca (patch)
tree0b44b5aff4e364837093910bb38102d53c18d4ec /arch/arm/mach-renesas/cpu_info-rcar.c
parentf9aabd457930f5569297f8a0c4449b9768c1e0cf (diff)
downloadu-boot-40b9d53c7402c2ceac03c4c2af77a025ce11a0ca.zip
u-boot-40b9d53c7402c2ceac03c4c2af77a025ce11a0ca.tar.gz
u-boot-40b9d53c7402c2ceac03c4c2af77a025ce11a0ca.tar.bz2
ARM: renesas: Rename arch-/mach-rmobile to arch-/mach-renesas
Rename arch-rmobile to arch-renesas and mach-rmobile to mach-renesas because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename, with manual move of the directories using git mv and manual fix up to arch/arm/Makefile: " $ git grep -l '\<\(arch\|mach\)-rmobile\>' | \ xargs -I {} sed -i 's@\<\(arch\|mach\)-rmobile\>@\1-renesas@g' {} $ sed -i 's@rmobile@renesas@' board/*/*/Kconfig " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Diffstat (limited to 'arch/arm/mach-renesas/cpu_info-rcar.c')
-rw-r--r--arch/arm/mach-renesas/cpu_info-rcar.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-renesas/cpu_info-rcar.c b/arch/arm/mach-renesas/cpu_info-rcar.c
new file mode 100644
index 0000000..9418836
--- /dev/null
+++ b/arch/arm/mach-renesas/cpu_info-rcar.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
+ *
+ * Copyright (C) 2013,2014 Renesas Electronics Corporation
+ */
+
+#include <asm/io.h>
+
+#define PRR_MASK 0x7fff
+#define R8A7796_REV_1_0 0x5200
+#define R8A7796_REV_1_1 0x5210
+#define R8A7796_REV_1_3 0x5211
+#define R8A77995_REV_1_1 0x5810
+
+static u32 renesas_get_prr(void)
+{
+ if (IS_ENABLED(CONFIG_RCAR_64))
+ return readl(0xFFF00044);
+
+ return readl(0xFF000044);
+}
+
+u32 renesas_get_cpu_type(void)
+{
+ return (renesas_get_prr() & 0x00007F00) >> 8;
+}
+
+u32 renesas_get_cpu_rev_integer(void)
+{
+ const u32 prr = renesas_get_prr();
+ const u32 rev = prr & PRR_MASK;
+
+ if (rev == R8A7796_REV_1_1 || rev == R8A7796_REV_1_3 ||
+ rev == R8A77995_REV_1_1)
+ return 1;
+ else
+ return ((prr & 0x000000F0) >> 4) + 1;
+}
+
+u32 renesas_get_cpu_rev_fraction(void)
+{
+ const u32 prr = renesas_get_prr();
+ const u32 rev = prr & PRR_MASK;
+
+ if (rev == R8A7796_REV_1_1 || rev == R8A77995_REV_1_1)
+ return 1;
+ else if (rev == R8A7796_REV_1_3)
+ return 3;
+ else
+ return prr & 0x0000000F;
+}