Skip to contentSkip to conversation

stm32mp1: mmu_set_region_dcache_behaviour

PATCH New Patrick Delaunay 2 participants 3 messages Jul 24, 2020 – Jul 28, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stm32mp1: mmu_set_region_dcache_behaviour

Since commit d877f8fd0f09 ("arm: provide a function for boards init code to modify MMU virtual-physical map") the parameter of mmu_set_region_dcache_behaviour need to be MMU_SECTION_SIZE aligned.

---

 arch/arm/mach-stm32mp/cpu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-stm32mp/cpu.c +4 -3
index 56092c8bf6..b7fcee2b36 100644
@@ -225,9 +225,10 @@ static void early_enable_caches(void)
 	dcache_enable();
 
 	if (IS_ENABLED(CONFIG_SPL_BUILD))
-		mmu_set_region_dcache_behaviour(STM32_SYSRAM_BASE,
-						STM32_SYSRAM_SIZE,
-						DCACHE_DEFAULT_OPTION);
+		mmu_set_region_dcache_behaviour(
+			ALIGN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE),
+			round_up(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE),
+			DCACHE_DEFAULT_OPTION);
 	else
 		mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
 						DCACHE_DEFAULT_OPTION);
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 stm32mp1: mmu_set_region_dcache_behaviour

Quoted 19 lines · Patrick Delaunay

Since commit d877f8fd0f09 ("arm: provide a function for boards init code to modify MMU virtual-physical map") the parameter of mmu_set_region_dcache_behaviour need to be MMU_SECTION_SIZE aligned.

---

 arch/arm/mach-stm32mp/cpu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-stm32mp/cpu.c +0 -0
index 56092c8bf6..b7fcee2b36 100644
@@ -225,9 +225,10 @@ static void early_enable_caches(void)
 	dcache_enable();
 
 	if (IS_ENABLED(CONFIG_SPL_BUILD))

arch/arm/mach-stm32mp/cpu.c static void early_enable_caches(void) · line 234

Quoted 10 lines
arch/arm/mach-stm32mp/cpu.c +4 -3
-		mmu_set_region_dcache_behaviour(STM32_SYSRAM_BASE,
-						STM32_SYSRAM_SIZE,
-						DCACHE_DEFAULT_OPTION);
+		mmu_set_region_dcache_behaviour(
+			ALIGN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE),
+			round_up(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE),
+			DCACHE_DEFAULT_OPTION);
 	else
 		mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
 						DCACHE_DEFAULT_OPTION);

Thanks

Patrice

#2 lore raw

PATCH 1/1 stm32mp1: mmu_set_region_dcache_behaviour

Quoted 32 lines · Patrice CHOTARD
Quoted 19 lines · Patrick Delaunay

Since commit d877f8fd0f09 ("arm: provide a function for boards init code to modify MMU virtual-physical map") the parameter of mmu_set_region_dcache_behaviour need to be MMU_SECTION_SIZE aligned.

---

 arch/arm/mach-stm32mp/cpu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-stm32mp/cpu.c +0 -0
index 56092c8bf6..b7fcee2b36 100644
@@ -225,9 +225,10 @@ static void early_enable_caches(void)
 	dcache_enable();
 
 	if (IS_ENABLED(CONFIG_SPL_BUILD))

arch/arm/mach-stm32mp/cpu.c static void early_enable_caches(void) · line 234

Quoted 10 lines
arch/arm/mach-stm32mp/cpu.c +4 -3
-		mmu_set_region_dcache_behaviour(STM32_SYSRAM_BASE,
-						STM32_SYSRAM_SIZE,
-						DCACHE_DEFAULT_OPTION);
+		mmu_set_region_dcache_behaviour(
+			ALIGN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE),
+			round_up(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE),
+			DCACHE_DEFAULT_OPTION);
 	else
 		mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
 						DCACHE_DEFAULT_OPTION);
Quoted 7 lines

Thanks

Patrice
_______________________________________________
Uboot-stm32 mailing list
Uboot-stm32 at st-md-mailman.stormreply.com
https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32

Applied to u-boot-stm/master

Thanks

Patrice