[U-Boot] [PATCH] mach-stm32: Fix mpu region's attribute for STM32H7

patrice.chotard at st.com patrice.chotard at st.com
Mon Nov 13 16:26:18 UTC 2017


From: Patrice Chotard <patrice.chotard at st.com>

The SDRAM region was setup with the wrong attributes.
It must be set to :
  _ XN_EN (Execution of an instruction fetched from this region permitted)
  _ O_I_WB_RD_WR_ALLOC (Outer and inner write-back, write and read allocate)

This fixes hard fault when trying to load and execute kernel linux
in this area.

Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
---
 arch/arm/mach-stm32/stm32h7/soc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-stm32/stm32h7/soc.c b/arch/arm/mach-stm32/stm32h7/soc.c
index 692dbcc..e0d3f11 100644
--- a/arch/arm/mach-stm32/stm32h7/soc.c
+++ b/arch/arm/mach-stm32/stm32h7/soc.c
@@ -30,9 +30,12 @@ int arch_cpu_init(void)
 		{ 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
 		O_I_WB_RD_WR_ALLOC, REGION_4GB },
 
-		/* Code area, executable & strongly ordered */
-		{ 0xD0000000, REGION_1, XN_EN, PRIV_RW_USR_RW,
-		STRONG_ORDER, REGION_8MB },
+		/*
+		 * Code area, executable, Outer and inner write-back,
+		 * no write allocate
+		 */
+		{ 0xD0000000, REGION_1, XN_DIS, PRIV_RW_USR_RW,
+		O_I_WB_RD_WR_ALLOC, REGION_32MB },
 
 		/* Device area in all H7 : Not executable */
 		{ 0x40000000, REGION_2, XN_EN, PRIV_RW_USR_RW,
-- 
1.9.1



More information about the U-Boot mailing list