summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@rivosinc.com>2022-02-04 22:13:37 +0100
committerPalmer Dabbelt <palmer@rivosinc.com>2022-02-04 22:18:56 +0100
commit4b1c70aa8ed8249608bb991380cb8ff423edf49e (patch)
tree6439a2c762f16772c513cb3f83c56c88210dff01
parentriscv: Fix XIP_FIXUP_FLASH_OFFSET (diff)
downloadlinux-4b1c70aa8ed8249608bb991380cb8ff423edf49e.tar.xz
linux-4b1c70aa8ed8249608bb991380cb8ff423edf49e.zip
riscv/mm: Add XIP_FIXUP for phys_ram_base
This manifests as a crash early in boot on VexRiscv. Signed-off-by: Myrtle Shah <gatecat@ds0.me> [Palmer: split commit] Fixes: 6d7f91d914bc ("riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-rw-r--r--arch/riscv/mm/init.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index cf4d018b7d66..eecfacac2cc5 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -522,6 +522,7 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size)
}
#ifdef CONFIG_XIP_KERNEL
+#define phys_ram_base (*(phys_addr_t *)XIP_FIXUP(&phys_ram_base))
extern char _xiprom[], _exiprom[], __data_loc;
/* called from head.S with MMU off */