summaryrefslogtreecommitdiffstats
path: root/spec/build/bsps/arm
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2022-12-09 10:20:17 +0100
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2022-12-15 09:20:52 +0100
commit7b968a2eb4358f958e4be3aedf462e250ba1749b (patch)
tree7db2d0bf9301ca019372ffeffc179ec00779527e /spec/build/bsps/arm
parentbsps/atsam: Fix unidirectional SPI transfers (diff)
downloadrtems-7b968a2eb4358f958e4be3aedf462e250ba1749b.tar.bz2
bsps/atsam: Add NULL pointer protection
Diffstat (limited to 'spec/build/bsps/arm')
-rw-r--r--spec/build/bsps/arm/atsam/bspatsam.yml2
-rw-r--r--spec/build/bsps/arm/atsam/linkcmds.yml7
-rw-r--r--spec/build/bsps/arm/atsam/optnullsz.yml17
-rw-r--r--spec/build/bsps/arm/atsam/opttcmsz.yml3
4 files changed, 27 insertions, 2 deletions
diff --git a/spec/build/bsps/arm/atsam/bspatsam.yml b/spec/build/bsps/arm/atsam/bspatsam.yml
index 6716bea248..679889d253 100644
--- a/spec/build/bsps/arm/atsam/bspatsam.yml
+++ b/spec/build/bsps/arm/atsam/bspatsam.yml
@@ -297,6 +297,8 @@ links:
- role: build-dependency
uid: optnocachesz
- role: build-dependency
+ uid: optnullsz
+- role: build-dependency
uid: optoscmain
- role: build-dependency
uid: optqspiflashsz
diff --git a/spec/build/bsps/arm/atsam/linkcmds.yml b/spec/build/bsps/arm/atsam/linkcmds.yml
index fe6211f82f..d475b6a245 100644
--- a/spec/build/bsps/arm/atsam/linkcmds.yml
+++ b/spec/build/bsps/arm/atsam/linkcmds.yml
@@ -2,7 +2,8 @@ SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
build-type: config-file
content: |
MEMORY {
- ITCM : ORIGIN = 0x00000000, LENGTH = ${ATSAM_MEMORY_TCM_SIZE}
+ NULL : ORIGIN = 0x00000000, LENGTH = ${ATSAM_MEMORY_NULL_SIZE}
+ ITCM : ORIGIN = ${ATSAM_MEMORY_NULL_SIZE}, LENGTH = ((${ATSAM_MEMORY_TCM_SIZE} > ${ATSAM_MEMORY_NULL_SIZE}) ? (${ATSAM_MEMORY_TCM_SIZE} - ${ATSAM_MEMORY_NULL_SIZE}) : 0)
INTFLASH : ORIGIN = 0x00400000, LENGTH = ${ATSAM_MEMORY_INTFLASH_SIZE}
DTCM : ORIGIN = 0x20000000, LENGTH = ${ATSAM_MEMORY_TCM_SIZE}
INTSRAM : ORIGIN = 0x20400000, LENGTH = ${ATSAM_MEMORY_INTSRAM_SIZE} - 2 * ${ATSAM_MEMORY_TCM_SIZE} - ${ATSAM_MEMORY_NOCACHE_SIZE}
@@ -13,6 +14,10 @@ content: |
/* Must be used only for MPU definitions */
+ atsam_memory_null_begin = ORIGIN (NULL);
+ atsam_memory_null_end = ORIGIN (NULL) + LENGTH (NULL);
+ atsam_memory_null_size = LENGTH (NULL);
+
atsam_memory_itcm_begin = ORIGIN (ITCM);
atsam_memory_itcm_end = ORIGIN (ITCM) + LENGTH (ITCM);
atsam_memory_itcm_size = LENGTH (ITCM);
diff --git a/spec/build/bsps/arm/atsam/optnullsz.yml b/spec/build/bsps/arm/atsam/optnullsz.yml
new file mode 100644
index 0000000000..d992c286e7
--- /dev/null
+++ b/spec/build/bsps/arm/atsam/optnullsz.yml
@@ -0,0 +1,17 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-integer: null
+- env-assign: null
+build-type: option
+default: 0
+default-by-variant: []
+enabled-by: true
+format: '{:#010x}'
+links: []
+name: ATSAM_MEMORY_NULL_SIZE
+description: |
+ Size of the NULL pointer protection area in bytes. This memory area reduces
+ the size of the ITCM available to the application.
+type: build
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
diff --git a/spec/build/bsps/arm/atsam/opttcmsz.yml b/spec/build/bsps/arm/atsam/opttcmsz.yml
index 7e8b1121e8..da3e575f55 100644
--- a/spec/build/bsps/arm/atsam/opttcmsz.yml
+++ b/spec/build/bsps/arm/atsam/opttcmsz.yml
@@ -9,7 +9,8 @@ copyrights:
default: 0
default-by-variant: []
description: |
- size of tightly coupled memories (TCM) in bytes
+ Size of tightly coupled memories (TCM) in bytes. Note that the ITCM is
+ reduced by the ATSAM_MEMORY_NULL_SIZE option. DTCM is unaffected.
enabled-by: true
format: '{:#010x}'
links: []