From c31640239c7f3c50908a099f0f7cbfb64b458b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Arg=C3=BCelles?= Date: Thu, 15 May 2025 14:07:25 -0500 Subject: [PATCH] soc: nxp: s32k3: fix erratum ERR011573 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to erratum ERR011573, speculative accesses might be performed to normal memory unmapped in the MPU. This can be avoided by using MPU region 0 to cover all unmapped memory and make this region execute-never and inaccessible. Fixes #89852 Co-authored-by: Peter van der Perk Signed-off-by: Manuel Argüelles --- soc/nxp/s32/s32k3/mpu_regions.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/soc/nxp/s32/s32k3/mpu_regions.c b/soc/nxp/s32/s32k3/mpu_regions.c index acd3ee9d916..ce6e5fcfd20 100644 --- a/soc/nxp/s32/s32k3/mpu_regions.c +++ b/soc/nxp/s32/s32k3/mpu_regions.c @@ -1,5 +1,5 @@ /* - * Copyright 2023 NXP + * Copyright 2023, 2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,13 @@ extern char _rom_attr[]; static struct arm_mpu_region mpu_regions[] = { + /* ERR011573: use first region to prevent speculative access in entire memory space */ + { + .name = "BACKGROUND", + .base = 0, + .attr = {REGION_4G | MPU_RASR_XN_Msk | P_NA_U_NA_Msk}, + }, + /* Keep before CODE region so it can be overlapped by SRAM CODE in non-XIP systems */ { .name = "SRAM",