Skip to content

Commit 435d422

Browse files
committed
ARM: shmobile: sh73a0: Reserve boot area when SMP is enabled
CPU core bringup on SH-Mobile AG5 uses the SYS Boot Address (SBAR) and Address Translation Area (APARMBAREA) registers 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 SBAR 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> Link: https://lore.kernel.org/r/20eb4e7fca9c41a34500fc5984602b41006b4575.1693409184.git.geert+renesas@glider.be
1 parent 8d17004 commit 435d422

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

arch/arm/mach-shmobile/smp-sh73a0.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle)
4444

4545
static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
4646
{
47-
void __iomem *ap = ioremap(AP_BASE, PAGE_SIZE);
48-
void __iomem *sysc = ioremap(SYSC_BASE, PAGE_SIZE);
47+
void __iomem *ap, *sysc;
48+
49+
if (!request_mem_region(0, SZ_4K, "Boot Area")) {
50+
pr_err("Failed to request boot area\n");
51+
return;
52+
}
4953

5054
/* Map the reset vector (in headsmp.S) */
55+
ap = ioremap(AP_BASE, PAGE_SIZE);
56+
sysc = ioremap(SYSC_BASE, PAGE_SIZE);
5157
writel(0, ap + APARMBAREA); /* 4k */
5258
writel(__pa(shmobile_boot_vector), sysc + SBAR);
5359
iounmap(sysc);

0 commit comments

Comments
 (0)