Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: make secondary reset vector support conditional

Whether xtensa cores start from primary or secondary reset vector is
configurable and may be chosen by board designer or controlled at
runtime. When secondary reset vector is unused its location in memory
may not be writable.
Make secondary reset vector support conditional and don't build and load
secondary reset vector code when it is disabled.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+14 -4
+9
arch/xtensa/Kconfig
··· 227 227 228 228 Say N if you want to disable CPU hotplug. 229 229 230 + config SECONDARY_RESET_VECTOR 231 + bool "Secondary cores use alternative reset vector" 232 + default y 233 + depends on HAVE_SMP 234 + help 235 + Secondary cores may be configured to use alternative reset vector, 236 + or all cores may use primary reset vector. 237 + Say Y here to supply handler for the alternative reset location. 238 + 230 239 config FAST_SYSCALL_XTENSA 231 240 bool "Enable fast atomic syscalls" 232 241 default n
+2 -1
arch/xtensa/kernel/Makefile
··· 13 13 obj-$(CONFIG_PCI) += pci.o 14 14 obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o 15 15 obj-$(CONFIG_FUNCTION_TRACER) += mcount.o 16 - obj-$(CONFIG_SMP) += smp.o mxhead.o 16 + obj-$(CONFIG_SMP) += smp.o 17 + obj-$(CONFIG_SECONDARY_RESET_VECTOR) += mxhead.o 17 18 obj-$(CONFIG_XTENSA_VARIANT_HAVE_PERF_EVENTS) += perf_event.o 18 19 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o 19 20 obj-$(CONFIG_S32C1I_SELFTEST) += s32c1i_selftest.o
+1 -1
arch/xtensa/kernel/setup.c
··· 349 349 350 350 #endif /* CONFIG_VECTORS_ADDR */ 351 351 352 - #ifdef CONFIG_SMP 352 + #ifdef CONFIG_SECONDARY_RESET_VECTOR 353 353 mem_reserve(__pa(_SecondaryResetVector_text_start), 354 354 __pa(_SecondaryResetVector_text_end)); 355 355 #endif
+2 -2
arch/xtensa/kernel/vmlinux.lds.S
··· 207 207 RELOCATE_ENTRY(_xip_data, .data); 208 208 RELOCATE_ENTRY(_xip_init_data, .init.data); 209 209 #endif 210 - #if defined(CONFIG_SMP) 210 + #if defined(CONFIG_SECONDARY_RESET_VECTOR) 211 211 RELOCATE_ENTRY(_SecondaryResetVector_text, 212 212 .SecondaryResetVector.text); 213 213 #endif ··· 303 303 #define LAST .DoubleExceptionVector.text 304 304 305 305 #endif 306 - #if defined(CONFIG_SMP) 306 + #if defined(CONFIG_SECONDARY_RESET_VECTOR) 307 307 308 308 SECTION_VECTOR4 (_SecondaryResetVector_text, 309 309 .SecondaryResetVector.text,