RISC-V: enable XIP
authorVitaly Wool <vitaly.wool@konsulko.com>
Tue, 13 Apr 2021 06:35:14 +0000 (02:35 -0400)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Mon, 26 Apr 2021 15:31:28 +0000 (08:31 -0700)
commit44c922572952d89a1ed15764f2b373ba62692865
treed222695f2d1e336a1be86c47be29aade75af7b1f
parent5640975003d0234da08559677e22ec25b9cb3267
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>
arch/riscv/Kconfig
arch/riscv/Makefile
arch/riscv/boot/Makefile
arch/riscv/include/asm/page.h
arch/riscv/include/asm/pgtable.h
arch/riscv/kernel/head.S
arch/riscv/kernel/head.h
arch/riscv/kernel/setup.c
arch/riscv/kernel/vmlinux-xip.lds.S [new file with mode: 0644]
arch/riscv/kernel/vmlinux.lds.S
arch/riscv/mm/init.c