Skip to content

Commit

Permalink
xtensa: make secondary reset vector support conditional
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jcmvbkbc committed Mar 10, 2022
1 parent c20e111 commit 89b184f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions arch/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ config HOTPLUG_CPU

Say N if you want to disable CPU hotplug.

config SECONDARY_RESET_VECTOR
bool "Secondary cores use alternative reset vector"
default y
depends on HAVE_SMP
help
Secondary cores may be configured to use alternative reset vector,
or all cores may use primary reset vector.
Say Y here to supply handler for the alternative reset location.

config FAST_SYSCALL_XTENSA
bool "Enable fast atomic syscalls"
default n
Expand Down
3 changes: 2 additions & 1 deletion arch/xtensa/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ obj-$(CONFIG_MMU) += pci-dma.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o
obj-$(CONFIG_SMP) += smp.o mxhead.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_SECONDARY_RESET_VECTOR) += mxhead.o
obj-$(CONFIG_XTENSA_VARIANT_HAVE_PERF_EVENTS) += perf_event.o
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_S32C1I_SELFTEST) += s32c1i_selftest.o
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void __init setup_arch(char **cmdline_p)

#endif /* CONFIG_VECTORS_ADDR */

#ifdef CONFIG_SMP
#ifdef CONFIG_SECONDARY_RESET_VECTOR
mem_reserve(__pa(_SecondaryResetVector_text_start),
__pa(_SecondaryResetVector_text_end));
#endif
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ SECTIONS
RELOCATE_ENTRY(_xip_data, .data);
RELOCATE_ENTRY(_xip_init_data, .init.data);
#endif
#if defined(CONFIG_SMP)
#if defined(CONFIG_SECONDARY_RESET_VECTOR)
RELOCATE_ENTRY(_SecondaryResetVector_text,
.SecondaryResetVector.text);
#endif
Expand Down Expand Up @@ -303,7 +303,7 @@ SECTIONS
#define LAST .DoubleExceptionVector.text

#endif
#if defined(CONFIG_SMP)
#if defined(CONFIG_SECONDARY_RESET_VECTOR)

SECTION_VECTOR4 (_SecondaryResetVector_text,
.SecondaryResetVector.text,
Expand Down

0 comments on commit 89b184f

Please sign in to comment.