[U-Boot] [PATCH 1/8] arm: rmobile: Merge functions to get the CPU information of R8A7790 and R8A7791

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Thu Apr 3 07:19:03 CEST 2014


Functions to get the CPU information of R8A7790 and R8A7791 are common.
This merges these as cpu_info-rcar.c.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
---
 arch/arm/cpu/armv7/rmobile/Makefile           |  4 ++--
 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c | 22 --------------------
 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c | 29 ---------------------------
 arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c    | 21 +++++++++++++++++++
 4 files changed, 23 insertions(+), 53 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
 delete mode 100644 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
 create mode 100644 arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c

diff --git a/arch/arm/cpu/armv7/rmobile/Makefile b/arch/arm/cpu/armv7/rmobile/Makefile
index 2221999..fad004c 100644
--- a/arch/arm/cpu/armv7/rmobile/Makefile
+++ b/arch/arm/cpu/armv7/rmobile/Makefile
@@ -11,7 +11,7 @@ obj-y += emac.o
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board.o
 obj-$(CONFIG_GLOBAL_TIMER) += timer.o
 obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o
-obj-$(CONFIG_R8A7790) += lowlevel_init_ca15.o cpu_info-r8a7790.o pfc-r8a7790.o
-obj-$(CONFIG_R8A7791) += lowlevel_init_ca15.o cpu_info-r8a7791.o pfc-r8a7791.o
+obj-$(CONFIG_R8A7790) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7790.o
+obj-$(CONFIG_R8A7791) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7791.o
 obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
 obj-$(CONFIG_TMU_TIMER) += ../../../../sh/lib/time.o
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c b/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
deleted file mode 100644
index 7232e23..0000000
--- a/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * arch/arm/cpu/armv7/rmobile/cpu_info-r8a7790.c
- *     This file is r8a7790 processor support.
- *
- * Copyright (C) 2013 Renesas Electronics Corporation
- *
- * SPDX-License-Identifier: GPL-2.0
- */
-#include <common.h>
-#include <asm/io.h>
-
-#define PRR 0xFF000044
-
-u32 rmobile_get_cpu_type(void)
-{
-	return (readl(PRR) & 0x00007F00) >> 8;
-}
-
-u32 rmobile_get_cpu_rev_integer(void)
-{
-	return (readl(PRR) & 0x000000F0) >> 4;
-}
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c b/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
deleted file mode 100644
index 2de58ed..0000000
--- a/arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c
- *
- * Copyright (C) 2013 Renesas Electronics Corporation
- *
- * SPDX-License-Identifier: GPL-2.0
- */
-#include <common.h>
-#include <asm/io.h>
-
-#define PRR 0xFF000044
-
-u32 rmobile_get_cpu_type(void)
-{
-	u32 product;
-
-	product = readl(PRR);
-
-	return (u32)((product & 0x00007F00) >> 8);
-}
-
-u32 rmobile_get_cpu_rev_integer(void)
-{
-	u32 product;
-
-	product = readl(PRR);
-
-	return (u32)((product & 0x000000F0) >> 4);
-}
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c b/arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
new file mode 100644
index 0000000..0289ece
--- /dev/null
+++ b/arch/arm/cpu/armv7/rmobile/cpu_info-rcar.c
@@ -0,0 +1,21 @@
+/*
+ * 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
+
+u32 rmobile_get_cpu_type(void)
+{
+	return (readl(PRR) & 0x00007F00) >> 8;
+}
+
+u32 rmobile_get_cpu_rev_integer(void)
+{
+	return (readl(PRR) & 0x000000F0) >> 4;
+}
-- 
1.8.5



More information about the U-Boot mailing list