Skip to contentSkip to conversation

ARM: rmobile: Generate fitting mem_map on Gen3

PATCH New Marek Vasut 1 participant 1 message Oct 31, 2018

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

PATCH 1/1 ARM: rmobile: Generate fitting mem_map on Gen3

Patch "ARM: rmobile: Mark 4-64GiB as DRAM on Gen3" marked the entire 64bit DRAM space as cachable. On CortexA57, this might result in odd side effects, where the CPU tries to prefetch from those areas and if there is no DRAM backing them, CPU bus hang can happen.

This patch fixes it by generating the mem_map structure based on the actual memory layout obtained from the DT, thus not marking areas without any DRAM behind them as cachable.

Fixes c1ec34763811d ("ARM: rmobile: Mark 4-64GiB as DRAM on Gen3")
Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/mach-rmobile/cpu_info.c    |  3 +
 arch/arm/mach-rmobile/memmap-gen3.c | 89 ++++++++++++++++++++++++++++-
 2 files changed, 91 insertions(+), 1 deletion(-)
arch/arm/mach-rmobile/cpu_info.c +3 -0
index e110737471..c9ebc9f40e 100644
@@ -6,6 +6,8 @@
 #include <common.h>
 #include <asm/io.h>
 
+/* R-Car Gen3 caches are enabled in memmap-gen3.c */
+#ifndef CONFIG_RCAR_GEN3
 #ifdef CONFIG_ARCH_CPU_INIT
 int arch_cpu_init(void)
 {
@@ -20,6 +22,7 @@ void enable_caches(void)
 	dcache_enable();
 }
 #endif
+#endif
 
 #ifdef CONFIG_DISPLAY_CPUINFO
 static u32 __rmobile_get_cpu_type(void)
arch/arm/mach-rmobile/memmap-gen3.c +88 -1

98 lines not on this page · raw message

Signature · 1 line
2.18.0