diff mbox series

[PATCH/RFC,3/4] ARM: shmobile: r8a7779: Reserve boot area when SMP is enabled

Message ID 924961188abdf2adb52167edb7ed848a6efcca39.1693409184.git.geert+renesas@glider.be (mailing list archive)
State Mainlined
Commit 6d9542fc61241990ffc27a8eaec40e550fe36e3f
Delegated to: Geert Uytterhoeven
Headers show
Series ARM: shmobile: Reserve boot area when SMP is enabled | expand

Commit Message

Geert Uytterhoeven Aug. 31, 2023, 11:17 a.m. UTC
CPU core bringup on R-Car H1 uses the ARM Reset Vector Address Register
(AVECR) to specify the base address and size of the boot area of the
System CPU.  With this enabled, when the System CPU accesses a physical
address in the range from zero up to the configured size, the top
address bits are replaced by those specified in the AVECR register.
Hence any device residing in this low part of physical address space
cannot be accessed,

Prevent conflicts by reserving this memory region using
request_mem_region().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/smp-r8a7779.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 1bc609986c160d2b..2b1b8248450c8dd2 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -38,7 +38,14 @@  static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
 {
-	void __iomem *base = ioremap(HPBREG_BASE, 0x1000);
+	void __iomem *base;
+
+	if (!request_mem_region(0, SZ_4K, "Boot Area")) {
+		pr_err("Failed to request boot area\n");
+		return;
+	};
+
+	base = ioremap(HPBREG_BASE, 0x1000);
 
 	/* Map the reset vector (in headsmp-scu.S, headsmp.S) */
 	writel(__pa(shmobile_boot_vector), base + AVECR);