Skip to content
Unverified Commit 6d7f91d9 authored by Alexandre Ghiti's avatar Alexandre Ghiti Committed by Palmer Dabbelt
Browse files

riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion



The usage of CONFIG_PHYS_RAM_BASE for all kernel types was a mistake:
this value is implementation-specific and this breaks the genericity of
the RISC-V kernel.

Fix this by introducing a new variable phys_ram_base that holds this
value at runtime and use it in the kernel physical address conversion
macro. Since this value is used only for XIP kernels, evaluate it only if
CONFIG_XIP_KERNEL is set which in addition optimizes this macro for
standard kernels at compile-time.

Signed-off-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
Tested-by: default avatarEmil Renner Berthing <kernel@esmil.dk>
Reviewed-by: default avatarJisheng Zhang <jszhang@kernel.org>
Fixes: 44c92257

 ("RISC-V: enable XIP")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent a18b14d8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment