summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2021-05-18 14:51:46 -0500
committerJoel Sherrill <joel@rtems.org>2021-05-27 14:09:00 -0500
commit5fe49a0853e55dce9d81ac3241edb878216b48bd (patch)
treeca67e6bdc354313c5b0b207ade1e595f6e62d9a6 /spec
parentbsps/a53: Increase available RAM (diff)
downloadrtems-5fe49a0853e55dce9d81ac3241edb878216b48bd.tar.bz2
bsps/aarch64: Add MMU driver to relax alignment
Currently, the AArch64 BSPs have a hard time running on real hardware without building the toolchain and the bsps with -mstrict-align in multiple places. Configuring the MMU on these chips allows for unaligned memory accesses for non-device memory which avoids requiring strict alignment in the toolchain and in the BSPs themselves. In writing this driver, it was found that the synchronous exception handling code needed to be rewritten since it relied on clearing SCTLR_EL1 to avoid thread stack misalignments in RTEMS_DEBUG mode. This is now avoided by exactly preserving thread mode stack and flags and the new implementation is compatible with the draft information provided on the mailing list covering the Exception Management API.
Diffstat (limited to '')
-rw-r--r--spec/build/bsps/aarch64/optmmupages.yml19
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml2
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_ilp32.yml8
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_lp64.yml8
-rw-r--r--spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml2
5 files changed, 35 insertions, 4 deletions
diff --git a/spec/build/bsps/aarch64/optmmupages.yml b/spec/build/bsps/aarch64/optmmupages.yml
new file mode 100644
index 0000000000..d737002f87
--- /dev/null
+++ b/spec/build/bsps/aarch64/optmmupages.yml
@@ -0,0 +1,19 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-integer: null
+- assert-ge: 0x1
+- assert-le: 0x800
+- env-assign: null
+- format-and-define: null
+build-type: option
+copyrights:
+- Copyright (C) 2021 On-Line Applications Research (OAR)
+default: 0x40
+default-by-variant: []
+description: |
+ Defines the number of MMU translation table pages to provide.
+enabled-by: true
+format: '{:#010x}'
+links: []
+name: AARCH64_MMU_TRANSLATION_TABLE_PAGES
+type: build
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml b/spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml
index 38b9be59da..16e2b8a7e9 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/grp.yml
@@ -12,6 +12,8 @@ links:
- role: build-dependency
uid: ../start
- role: build-dependency
+ uid: ../optmmupages
+- role: build-dependency
uid: abi
- role: build-dependency
uid: obj
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_ilp32.yml b/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_ilp32.yml
index f0d9f71401..b530969de7 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_ilp32.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_ilp32.yml
@@ -30,8 +30,9 @@ content: |
*/
MEMORY {
- RAM : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_LOAD_OFFSET}, LENGTH = ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - ${BSP_XILINX_ZYNQMP_LOAD_OFFSET} - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}
- NOCACHE : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}, LENGTH = ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}
+ RAM : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_LOAD_OFFSET}, LENGTH = ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - ${BSP_XILINX_ZYNQMP_LOAD_OFFSET} - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH} - (0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES})
+ NOCACHE : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - (0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}) - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}, LENGTH = ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}
+ RAM_MMU : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - (0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}), LENGTH = 0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}
}
REGION_ALIAS ("REGION_START", RAM);
@@ -58,6 +59,9 @@ content: |
bsp_vector_table_in_start_section = 1;
+ bsp_translation_table_base = ORIGIN (RAM_MMU);
+ bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU);
+
OUTPUT_FORMAT ("elf32-littleaarch64")
OUTPUT_ARCH (aarch64:ilp32)
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_lp64.yml b/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_lp64.yml
index 045ab16d0a..d9696be5d4 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_lp64.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/linkcmds_lp64.yml
@@ -30,8 +30,9 @@ content: |
*/
MEMORY {
- RAM : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_LOAD_OFFSET}, LENGTH = ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - ${BSP_XILINX_ZYNQMP_LOAD_OFFSET} - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}
- NOCACHE : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}, LENGTH = ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}
+ RAM : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_LOAD_OFFSET}, LENGTH = ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - ${BSP_XILINX_ZYNQMP_LOAD_OFFSET} - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH} - (0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES})
+ NOCACHE : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - (0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}) - ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}, LENGTH = ${BSP_XILINX_ZYNQMP_NOCACHE_LENGTH}
+ RAM_MMU : ORIGIN = ${BSP_XILINX_ZYNQMP_RAM_BASE} + ${BSP_XILINX_ZYNQMP_RAM_LENGTH} - (0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}), LENGTH = 0x4000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}
}
REGION_ALIAS ("REGION_START", RAM);
@@ -58,6 +59,9 @@ content: |
bsp_vector_table_in_start_section = 1;
+ bsp_translation_table_base = ORIGIN (RAM_MMU);
+ bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU);
+
OUTPUT_FORMAT ("elf64-littleaarch64")
OUTPUT_ARCH (aarch64)
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml b/spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml
index a4a4c74333..d8286bec35 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml
@@ -15,6 +15,7 @@ install:
- destination: ${BSP_INCLUDEDIR}/bsp
source:
- bsps/aarch64/xilinx-zynqmp/include/bsp/irq.h
+ - bsps/aarch64/include/bsp/aarch64-mmu.h
links: []
source:
- bsps/aarch64/shared/cache/cache.c
@@ -22,6 +23,7 @@ source:
- bsps/aarch64/xilinx-zynqmp/console/console.c
- bsps/aarch64/xilinx-zynqmp/start/bspstart.c
- bsps/aarch64/xilinx-zynqmp/start/bspstarthooks.c
+- bsps/aarch64/xilinx-zynqmp/start/bspstartmmu.c
- bsps/shared/dev/btimer/btimer-cpucounter.c
- bsps/shared/dev/clock/arm-generic-timer.c
- bsps/shared/dev/getentropy/getentropy-cpucounter.c