aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/vectors.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-01-03 17:57:51 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-11-26 11:33:38 -0800
commit7af710d988775aadf440222ecbe0c10eecf3eb54 (patch)
treef499a51c705441d0aa2019ef88f13e8598627b92 /arch/xtensa/include/asm/vectors.h
parentxtensa: move kernel memory layout to platform options (diff)
downloadlinux-dev-7af710d988775aadf440222ecbe0c10eecf3eb54.tar.xz
linux-dev-7af710d988775aadf440222ecbe0c10eecf3eb54.zip
xtensa: add XIP kernel support
XIP (eXecute In Place) kernel image is the image that can be run directly from ROM, using RAM only for writable data. XIP xtensa kernel differs from regular xtensa kernel in the following ways: - it has exception/IRQ vectors merged into text section. No vectors relocation takes place at kernel startup. - .data/.bss location must be specified in the kernel configuration, its content is copied there in the _startup function. - .init.text is merged with the rest of text and is executed from ROM. - when MMU is used the virtual address where the kernel will be mapped must be specified in the kernel configuration. It may be in the KSEG or in the KIO, __pa macro is adjusted to be able to handle both. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/vectors.h')
-rw-r--r--arch/xtensa/include/asm/vectors.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/vectors.h b/arch/xtensa/include/asm/vectors.h
index 4220c6dac44f..fd99b25037a7 100644
--- a/arch/xtensa/include/asm/vectors.h
+++ b/arch/xtensa/include/asm/vectors.h
@@ -22,9 +22,13 @@
#include <asm/kmem_layout.h>
#if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
+#ifdef CONFIG_KERNEL_VIRTUAL_ADDRESS
+#define KERNELOFFSET CONFIG_KERNEL_VIRTUAL_ADDRESS
+#else
#define KERNELOFFSET (CONFIG_KERNEL_LOAD_ADDRESS + \
XCHAL_KSEG_CACHED_VADDR - \
XCHAL_KSEG_PADDR)
+#endif
#else
#define KERNELOFFSET CONFIG_KERNEL_LOAD_ADDRESS
#endif