Skip to content

Commit 89b184f

Browse files
committed
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>
1 parent c20e111 commit 89b184f

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

arch/xtensa/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ config HOTPLUG_CPU
227227

228228
Say N if you want to disable CPU hotplug.
229229

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+
230239
config FAST_SYSCALL_XTENSA
231240
bool "Enable fast atomic syscalls"
232241
default n

arch/xtensa/kernel/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ obj-$(CONFIG_MMU) += pci-dma.o
1313
obj-$(CONFIG_PCI) += pci.o
1414
obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o
1515
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
1718
obj-$(CONFIG_XTENSA_VARIANT_HAVE_PERF_EVENTS) += perf_event.o
1819
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
1920
obj-$(CONFIG_S32C1I_SELFTEST) += s32c1i_selftest.o

arch/xtensa/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void __init setup_arch(char **cmdline_p)
349349

350350
#endif /* CONFIG_VECTORS_ADDR */
351351

352-
#ifdef CONFIG_SMP
352+
#ifdef CONFIG_SECONDARY_RESET_VECTOR
353353
mem_reserve(__pa(_SecondaryResetVector_text_start),
354354
__pa(_SecondaryResetVector_text_end));
355355
#endif

arch/xtensa/kernel/vmlinux.lds.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ SECTIONS
207207
RELOCATE_ENTRY(_xip_data, .data);
208208
RELOCATE_ENTRY(_xip_init_data, .init.data);
209209
#endif
210-
#if defined(CONFIG_SMP)
210+
#if defined(CONFIG_SECONDARY_RESET_VECTOR)
211211
RELOCATE_ENTRY(_SecondaryResetVector_text,
212212
.SecondaryResetVector.text);
213213
#endif
@@ -303,7 +303,7 @@ SECTIONS
303303
#define LAST .DoubleExceptionVector.text
304304

305305
#endif
306-
#if defined(CONFIG_SMP)
306+
#if defined(CONFIG_SECONDARY_RESET_VECTOR)
307307

308308
SECTION_VECTOR4 (_SecondaryResetVector_text,
309309
.SecondaryResetVector.text,

0 commit comments

Comments
 (0)