[U-Boot] [PATCH 1/2] arm: Add minimal support for Cortex-R5

Michal Simek michal.simek at xilinx.com
Fri Apr 20 13:51:40 UTC 2018


This minimal support will be used by Xilinx ZynqMP R5 cpu.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 arch/arm/Kconfig              |  6 ++++++
 arch/arm/cpu/armv7r/Makefile  |  4 ++++
 arch/arm/cpu/armv7r/config.mk |  3 +++
 arch/arm/cpu/armv7r/cpu.c     | 24 ++++++++++++++++++++++++
 arch/arm/cpu/armv7r/start.S   | 17 +++++++++++++++++
 5 files changed, 54 insertions(+)
 create mode 100644 arch/arm/cpu/armv7r/Makefile
 create mode 100644 arch/arm/cpu/armv7r/config.mk
 create mode 100644 arch/arm/cpu/armv7r/cpu.c
 create mode 100644 arch/arm/cpu/armv7r/start.S

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b5fbce03667d..b10804f55224 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -192,6 +192,10 @@ config CPU_V7M
 	select THUMB2_KERNEL
 	select SYS_CACHE_SHIFT_5
 
+config CPU_V7R
+	bool
+	select SYS_CACHE_SHIFT_6
+
 config CPU_PXA
 	bool
 	select SYS_CACHE_SHIFT_5
@@ -209,6 +213,7 @@ config SYS_CPU
 	default "arm1176" if CPU_ARM1176
 	default "armv7" if CPU_V7
 	default "armv7m" if CPU_V7M
+	default "armv7r" if CPU_V7R
 	default "pxa" if CPU_PXA
 	default "sa1100" if CPU_SA1100
 	default "armv8" if ARM64
@@ -223,6 +228,7 @@ config SYS_ARM_ARCH
 	default 6 if CPU_ARM1176
 	default 7 if CPU_V7
 	default 7 if CPU_V7M
+	default 7 if CPU_V7R
 	default 5 if CPU_PXA
 	default 4 if CPU_SA1100
 	default 8 if ARM64
diff --git a/arch/arm/cpu/armv7r/Makefile b/arch/arm/cpu/armv7r/Makefile
new file mode 100644
index 000000000000..3c66976dfa62
--- /dev/null
+++ b/arch/arm/cpu/armv7r/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
+extra-y := start.o
+obj-y += cpu.o
diff --git a/arch/arm/cpu/armv7r/config.mk b/arch/arm/cpu/armv7r/config.mk
new file mode 100644
index 000000000000..224d191ff846
--- /dev/null
+++ b/arch/arm/cpu/armv7r/config.mk
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+PLATFORM_CPPFLAGS += -mcpu=cortex-r5 -DARMR5
diff --git a/arch/arm/cpu/armv7r/cpu.c b/arch/arm/cpu/armv7r/cpu.c
new file mode 100644
index 000000000000..e384a530c5e0
--- /dev/null
+++ b/arch/arm/cpu/armv7r/cpu.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * (C) Copyright 2018 Xilinx, Inc. (Michal Simek)
+ */
+
+#include <common.h>
+
+/*
+ * This is called right before passing control to
+ * the Linux kernel point.
+ */
+int cleanup_before_linux(void)
+{
+	return 0;
+}
+
+/*
+ * Perform the low-level reset.
+ */
+void reset_cpu(ulong addr)
+{
+	while (1)
+		;
+}
diff --git a/arch/arm/cpu/armv7r/start.S b/arch/arm/cpu/armv7r/start.S
new file mode 100644
index 000000000000..d6e8eecf54b7
--- /dev/null
+++ b/arch/arm/cpu/armv7r/start.S
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2015
+ * Kamil Lulko, <kamil.lulko at gmail.com>
+ *
+ */
+
+#include <asm/assembler.h>
+
+.globl	reset
+.type reset, %function
+reset:
+	W(b)	_main
+
+.globl	c_runtime_cpu_setup
+c_runtime_cpu_setup:
+	mov	pc, lr
-- 
2.17.0



More information about the U-Boot mailing list