aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
authorVitaly Wool <vitaly.wool@konsulko.com>2021-04-13 02:35:14 -0400
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-04-26 08:31:28 -0700
commit44c922572952d89a1ed15764f2b373ba62692865 (patch)
treed222695f2d1e336a1be86c47be29aade75af7b1f /arch/riscv/kernel/vmlinux.lds.S
parentRISC-V: Add crash kernel support (diff)
downloadlinux-dev-44c922572952d89a1ed15764f2b373ba62692865.tar.xz
linux-dev-44c922572952d89a1ed15764f2b373ba62692865.zip
RISC-V: enable XIP
Introduce XIP (eXecute In Place) support for RISC-V platforms. It allows code to be executed directly from non-volatile storage directly addressable by the CPU, such as QSPI NOR flash which can be found on many RISC-V platforms. This makes way for significant optimization of RAM footprint. The XIP kernel is not compressed since it has to run directly from flash, so it will occupy more space on the non-volatile storage. The physical flash address used to link the kernel object files and for storing it has to be known at compile time and is represented by a Kconfig option. XIP on RISC-V will for the time being only work on MMU-enabled kernels. Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com> [Alex: Rebase on top of "Move kernel mapping outside the linear mapping" ] Signed-off-by: Alexandre Ghiti <alex@ghiti.fr> [Palmer: disable XIP for allyesconfig] Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kernel/vmlinux.lds.S')
-rw-r--r--arch/riscv/kernel/vmlinux.lds.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 56677137c85b..891742ff75a7 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -4,8 +4,13 @@
* Copyright (C) 2017 SiFive
*/
+#ifdef CONFIG_XIP_KERNEL
+#include "vmlinux-xip.lds.S"
+#else
+
#include <asm/pgtable.h>
#define LOAD_OFFSET KERNEL_LINK_ADDR
+
#include <asm/vmlinux.lds.h>
#include <asm/page.h>
#include <asm/cache.h>
@@ -140,3 +145,4 @@ SECTIONS
DISCARDS
}
+#endif /* CONFIG_XIP_KERNEL */