blob: 103e48479c5845d4174eee8c16dcfe98a9b8593c [file] [log] [blame]
Andrew Geissler2edf0642023-09-11 08:24:07 -04001From 5b42322cb57692dbea7d2c39fd8769b6f0f6b7af Mon Sep 17 00:00:00 2001
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002From: Qi Feng <qi.feng@arm.com>
3Date: Tue, 26 Jul 2022 18:13:23 +0800
Andrew Geissler2edf0642023-09-11 08:24:07 -04004Subject: [PATCH] vexpress64: add MPU memory map for the BASER_FVP
Brad Bishopbec4ebc2022-08-03 09:55:16 -04005
6The previous patch added support for initializing an Armv8 MPU. There is only an
7MPU at S-EL2 on the BASER_FVP, so add a platform-specific MPU memory map.
8
9See https://developer.arm.com/documentation/100964/1117/Base-Platform/Base---memory/BaseR-Platform-memory-map
10
11Upstream-Status: Inappropriate [other]
12 Implementation pending further discussion
13Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
14Signed-off-by: Qi Feng <qi.feng@arm.com>
Andrew Geissler2edf0642023-09-11 08:24:07 -040015
Brad Bishopbec4ebc2022-08-03 09:55:16 -040016---
17 board/armltd/vexpress64/vexpress64.c | 22 ++++++++++++++++++++++
18 1 file changed, 22 insertions(+)
19
20diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c
Andrew Geisslerea144b032023-01-27 16:03:57 -060021index af326dc6f4..2310d18eb7 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040022--- a/board/armltd/vexpress64/vexpress64.c
23+++ b/board/armltd/vexpress64/vexpress64.c
24@@ -19,6 +19,7 @@
25 #include <dm/platform_data/serial_pl01x.h>
26 #include "pcie.h"
27 #include <asm/armv8/mmu.h>
28+#include <asm/armv8/mpu.h>
29 #ifdef CONFIG_VIRTIO_NET
30 #include <virtio_types.h>
31 #include <virtio.h>
32@@ -37,6 +38,27 @@ U_BOOT_DRVINFO(vexpress_serials) = {
33 .plat = &serial_plat,
34 };
35
36+static struct mpu_region vexpress64_aemv8r_mem_map[] = {
37+ {
38+ .start = 0x0UL,
39+ .end = 0x7fffffffUL,
40+ .attrs = PRLAR_ATTRIDX(MT_NORMAL)
41+ }, {
42+ .start = 0x80000000UL,
43+ .end = 0xffffffffUL,
44+ .attrs = PRLAR_ATTRIDX(MT_DEVICE_NGNRNE)
45+ }, {
46+ .start = 0x100000000UL,
47+ .end = 0xffffffffffUL,
48+ .attrs = PRLAR_ATTRIDX(MT_NORMAL)
49+ }, {
50+ /* List terminator */
51+ 0,
52+ }
53+};
54+
55+struct mpu_region *mpu_mem_map = vexpress64_aemv8r_mem_map;
56+
57 static struct mm_region vexpress64_mem_map[] = {
58 {
59 .virt = V2M_PA_BASE,