Skip to contentSkip to conversation

ARM: Kconfig: Disable ARM_VIRT extension if XIP_KERNEL

PATCH New Rob Herring (Arm) 1 participant 1 message Apr 28 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Kconfig: Disable ARM_VIRT extension if XIP_KERNEL

From: Vishnu Banavath <[email protected]>

XIP is intended to execute kernel inplace and typically from flash and is used mostly on low memory devices.

.macro store_primary_cpu_mode reg1, reg2, reg3

        mrs     \reg1, cpsr
        and     \reg1, \reg1, #MODE_MASK
        adr     \reg2, .L__boot_cpu_mode_offset
        ldr     \reg3, [\reg2]
        str     \reg1, [\reg2, \reg3]

As text section is in flash memory and data section is in RAM. L__boot_cpu_mode_offset would evaluate to address based on virtual addresses provided by linker script. At this stage the MMU is OFF.

The logic used based stored @L__boot_cpu_mode_offset on the offset between the boot_cpu_mode in data section and the location of L__boot_cpu_mode_offset can't be used along with PC to fetch the value of boot_cpu_mode doesn't work.

---
This patch is from Alif E8 SoC tree which I'm working on. It's originally from corstone700 trees.

 arch/arm/mm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mm/Kconfig +1 -0
index 7b27ee9482b3..e2f5d3d7d3fb 100644
@@ -705,6 +705,7 @@ config ARM_THUMBEE
 
 config ARM_VIRT_EXT
 	bool
+	depends on MMU && !XIP_KERNEL
 	default y if CPU_V7
 	help
 	  Enable the kernel to make use of the ARM Virtualization
Signature · 1 line
2.53.0