2019-11-01 13:45:29 +01:00
|
|
|
# XTENSA architecture configuration options
|
|
|
|
|
2017-01-13 12:14:33 +01:00
|
|
|
# Copyright (c) 2016 Cadence Design Systems, Inc.
|
2017-01-25 00:10:39 +01:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2017-01-13 12:14:33 +01:00
|
|
|
|
|
|
|
menu "XTENSA Options"
|
|
|
|
depends on XTENSA
|
|
|
|
|
|
|
|
config ARCH
|
|
|
|
default "xtensa"
|
|
|
|
|
2017-05-11 15:01:09 +02:00
|
|
|
config SIMULATOR_XTENSA
|
2023-12-06 20:33:11 +01:00
|
|
|
bool "Simulator Target"
|
2017-05-11 15:01:09 +02:00
|
|
|
help
|
2023-12-06 20:33:11 +01:00
|
|
|
Enable if building to run on simulator.
|
2017-05-11 15:01:09 +02:00
|
|
|
|
2017-05-11 18:46:08 +02:00
|
|
|
config XTENSA_RESET_VECTOR
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
bool "Build reset vector code"
|
2017-05-11 18:46:08 +02:00
|
|
|
default y
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
This option controls whether the initial reset vector code is built.
|
|
|
|
This is always needed for the simulator. Real boards may already
|
|
|
|
implement this in boot ROM.
|
2017-05-11 18:46:08 +02:00
|
|
|
|
2023-07-31 17:34:28 +02:00
|
|
|
config XTENSA_GEN_HANDLERS
|
|
|
|
bool "Automatically generate interrupt handlers"
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
When set, an "xtensa_handlers.h" file is generated
|
|
|
|
containing definitions for the interrupt entry code of the
|
|
|
|
target Xtensa core, based automatically on the details in
|
|
|
|
the core-isa.h file. This replaces the previous scheme
|
|
|
|
where a _soc_inthandlers.h file would be generated offline.
|
|
|
|
|
2017-06-13 19:48:38 +02:00
|
|
|
config XTENSA_USE_CORE_CRT1
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
bool "Use crt1.S from core"
|
2017-06-13 19:48:38 +02:00
|
|
|
default y
|
|
|
|
help
|
2017-12-13 16:08:21 +01:00
|
|
|
SoC or boards might define their own __start by setting this setting
|
|
|
|
to false.
|
2017-06-13 19:48:38 +02:00
|
|
|
|
2021-01-07 07:11:11 +01:00
|
|
|
config XTENSA_ENABLE_BACKTRACE
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Backtrace on panic exception"
|
2021-01-07 07:11:11 +01:00
|
|
|
default y
|
2023-08-24 22:58:26 +02:00
|
|
|
depends on SOC_SERIES_ESP32 || SOC_FAMILY_INTEL_ADSP || SOC_XTENSA_DC233C
|
2021-01-07 07:11:11 +01:00
|
|
|
help
|
|
|
|
Enable this config option to print backtrace on panic exception
|
|
|
|
|
2021-09-10 12:58:53 +02:00
|
|
|
config XTENSA_SMALL_VECTOR_TABLE_ENTRY
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Workaround for small vector table entries"
|
2021-09-10 12:58:53 +02:00
|
|
|
help
|
|
|
|
This option enables a small indirection to bypass the size
|
|
|
|
constraint of the vector table entry and moved the default
|
|
|
|
handlers to the end of vector table, renaming them to
|
|
|
|
_Level\LVL\()VectorHelper.
|
|
|
|
|
2022-08-25 15:29:11 +02:00
|
|
|
config XTENSA_RPO_CACHE
|
|
|
|
bool "Cached/uncached RPO mapping"
|
|
|
|
help
|
|
|
|
Support Cached/uncached RPO mapping.
|
|
|
|
|
|
|
|
A design trick on multi-core hardware is to map memory twice
|
|
|
|
so that it can be seen in both (incoherent) cached mappings
|
|
|
|
and a coherent "shared" area.
|
|
|
|
|
|
|
|
if XTENSA_RPO_CACHE
|
2022-01-07 14:09:39 +01:00
|
|
|
config XTENSA_CACHED_REGION
|
|
|
|
int "Cached RPO mapping"
|
|
|
|
range 0 7
|
|
|
|
help
|
2022-08-25 15:29:11 +02:00
|
|
|
This specifies which 512M region (0-7, as defined by the Xtensa
|
|
|
|
Region Protection Option) contains the "cached" mapping.
|
2022-01-07 14:09:39 +01:00
|
|
|
|
|
|
|
config XTENSA_UNCACHED_REGION
|
|
|
|
int "Uncached RPO mapping"
|
|
|
|
range 0 7
|
|
|
|
help
|
|
|
|
As for XTENSA_CACHED_REGION, this specifies which 512M
|
|
|
|
region (0-7) contains the "uncached" mapping.
|
|
|
|
|
2022-08-25 15:29:11 +02:00
|
|
|
endif
|
|
|
|
|
2022-06-06 16:49:27 +02:00
|
|
|
config XTENSA_CCOUNT_HZ
|
|
|
|
int "CCOUNT cycle rate"
|
|
|
|
default 1000000
|
|
|
|
help
|
|
|
|
Rate in HZ of the Xtensa core as measured by the value of
|
|
|
|
the CCOUNT register.
|
|
|
|
|
2023-07-19 02:44:58 +02:00
|
|
|
config XTENSA_MORE_SPIN_RELAX_NOPS
|
|
|
|
bool "Use Xtensa specific arch_spin_relax() with more NOPs"
|
|
|
|
help
|
|
|
|
Some Xtensa SoCs, especially under SMP, may need extra
|
|
|
|
NOPs after failure to lock a spinlock. This gives
|
|
|
|
the bus extra time to synchronize the RCW transaction
|
|
|
|
among CPUs.
|
|
|
|
|
|
|
|
config XTENSA_NUM_SPIN_RELAX_NOPS
|
|
|
|
int "Number of NOPs to be used in arch_spin_relax()"
|
|
|
|
default 1
|
|
|
|
depends on XTENSA_MORE_SPIN_RELAX_NOPS
|
|
|
|
help
|
|
|
|
Specify the number of NOPs in Xtensa specific
|
|
|
|
arch_spin_relax().
|
|
|
|
|
2024-01-18 20:50:06 +01:00
|
|
|
menu "Xtensa HiFi Options"
|
|
|
|
|
|
|
|
config XTENSA_CPU_HAS_HIFI
|
|
|
|
bool
|
|
|
|
|
|
|
|
config XTENSA_CPU_HAS_HIFI3
|
|
|
|
select XTENSA_CPU_HAS_HIFI
|
|
|
|
bool
|
|
|
|
|
|
|
|
config XTENSA_CPU_HAS_HIFI4
|
|
|
|
select XTENSA_CPU_HAS_HIFI
|
|
|
|
bool
|
|
|
|
|
|
|
|
# Selected when at least one XTENSA_HIFIn version has been configured
|
|
|
|
config XTENSA_HIFI
|
|
|
|
bool
|
|
|
|
|
|
|
|
if XTENSA_CPU_HAS_HIFI
|
|
|
|
|
|
|
|
config XTENSA_HIFI3
|
|
|
|
bool "HiFi3 AudioEngine instructions"
|
|
|
|
depends on XTENSA_CPU_HAS_HIFI3
|
|
|
|
default y
|
|
|
|
select XTENSA_HIFI
|
|
|
|
help
|
|
|
|
This option enables HiFi 3 instruction support.
|
|
|
|
|
|
|
|
config XTENSA_HIFI4
|
|
|
|
bool "HiFi4 AudioEngine instructions"
|
|
|
|
depends on XTENSA_CPU_HAS_HIFI4
|
|
|
|
default y
|
|
|
|
select XTENSA_HIFI
|
|
|
|
help
|
|
|
|
This option enables HiFi 4 instruction support.
|
|
|
|
|
|
|
|
config XTENSA_HIFI_SHARING
|
|
|
|
bool "HiFi register sharing"
|
|
|
|
depends on XTENSA_HIFI
|
|
|
|
help
|
|
|
|
This option enables preservation of the hardware HiFi registers
|
|
|
|
across context switches to allow multiple threads to perform
|
|
|
|
concurrent HiFi operations.
|
|
|
|
|
|
|
|
endif # XTENSA_CPU_HAS_HIFI
|
|
|
|
|
|
|
|
endmenu # Xtensa HiFi Options
|
|
|
|
|
2023-05-09 23:44:22 +02:00
|
|
|
if CPU_HAS_MMU
|
|
|
|
|
|
|
|
config XTENSA_MMU
|
|
|
|
bool "Xtensa MMU Support"
|
|
|
|
select MMU
|
2022-12-14 09:35:36 +01:00
|
|
|
select ARCH_MEM_DOMAIN_SYNCHRONOUS_API if USERSPACE
|
2023-01-27 03:04:08 +01:00
|
|
|
select XTENSA_SMALL_VECTOR_TABLE_ENTRY
|
2023-10-12 20:00:45 +02:00
|
|
|
select KERNEL_VM_USE_CUSTOM_MEM_RANGE_CHECK if XTENSA_RPO_CACHE
|
2023-09-30 06:33:45 +02:00
|
|
|
select CURRENT_THREAD_USE_NO_TLS if USERSPACE
|
2023-05-09 23:44:22 +02:00
|
|
|
help
|
|
|
|
Enable support for Xtensa Memory Management Unit.
|
|
|
|
|
|
|
|
if XTENSA_MMU
|
|
|
|
|
2023-12-06 20:33:11 +01:00
|
|
|
choice
|
|
|
|
prompt "PageTable virtual address"
|
|
|
|
default XTENSA_MMU_PTEVADDR_20000000
|
|
|
|
help
|
|
|
|
The virtual address for Xtensa page table (PTEVADDR).
|
|
|
|
|
|
|
|
config XTENSA_MMU_PTEVADDR_20000000
|
|
|
|
bool "0x20000000"
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
config XTENSA_MMU_PTEVADDR
|
|
|
|
hex
|
|
|
|
default 0x20000000 if XTENSA_MMU_PTEVADDR_20000000
|
|
|
|
help
|
|
|
|
The virtual address for Xtensa page table (PTEVADDR).
|
|
|
|
|
|
|
|
config XTENSA_MMU_PTEVADDR_SHIFT
|
|
|
|
int
|
|
|
|
default 29 if XTENSA_MMU_PTEVADDR_20000000
|
|
|
|
help
|
|
|
|
The bit shift number for the virtual address for Xtensa
|
|
|
|
page table (PTEVADDR).
|
|
|
|
|
|
|
|
config XTENSA_MMU_NUM_L1_TABLES
|
|
|
|
int "Number of L1 page tables"
|
|
|
|
default 1 if !USERSPACE
|
|
|
|
default 4
|
|
|
|
help
|
|
|
|
This option specifies the maximum number of traslation tables.
|
|
|
|
Translation tables are directly related to the number of
|
|
|
|
memory domains in the target, considering the kernel itself requires one.
|
|
|
|
|
|
|
|
config XTENSA_MMU_NUM_L2_TABLES
|
|
|
|
int "Number of L2 page tables"
|
|
|
|
default 20 if USERSPACE
|
|
|
|
default 10
|
|
|
|
help
|
|
|
|
Each table can address up to 4MB memory address.
|
|
|
|
|
|
|
|
config XTENSA_MMU_DOUBLE_MAP
|
|
|
|
bool "Map memory in cached and uncached region"
|
|
|
|
help
|
|
|
|
This option specifies that the memory is mapped in two
|
|
|
|
distinct region, cached and uncached.
|
2022-11-17 23:49:35 +01:00
|
|
|
|
2023-12-02 01:51:46 +01:00
|
|
|
config XTENSA_INVALIDATE_MEM_DOMAIN_TLB_ON_SWAP
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
This invalidates all TLBs referred by the incoming thread's
|
|
|
|
memory domain when swapping page tables.
|
|
|
|
|
2024-03-04 20:32:42 +01:00
|
|
|
config PRIVILEGED_STACK_SIZE
|
|
|
|
# Must be multiple of CONFIG_MMU_PAGE_SIZE
|
|
|
|
default 4096
|
|
|
|
|
2023-05-09 23:44:22 +02:00
|
|
|
endif # XTENSA_MMU
|
|
|
|
|
2024-01-29 21:14:15 +01:00
|
|
|
endif # CPU_HAS_MMU
|
|
|
|
|
2024-03-16 01:37:23 +01:00
|
|
|
if CPU_HAS_MPU
|
|
|
|
|
|
|
|
menuconfig XTENSA_MPU
|
|
|
|
bool "Xtensa MPU Support"
|
|
|
|
select MPU
|
|
|
|
select SRAM_REGION_PERMISSIONS
|
|
|
|
select XTENSA_SMALL_VECTOR_TABLE_ENTRY
|
2024-01-30 23:33:42 +01:00
|
|
|
select ARCH_MEM_DOMAIN_SYNCHRONOUS_API if USERSPACE
|
|
|
|
select CURRENT_THREAD_USE_NO_TLS if USERSPACE
|
2024-03-16 01:37:23 +01:00
|
|
|
select EXPERIMENTAL
|
|
|
|
# TODO: the target the MPU code developed on (basically sample_controller
|
|
|
|
# plus MPU minus s32c1i) does not have cache or SMP capability.
|
|
|
|
# Need to verify functionalities with targets supporting these.
|
|
|
|
depends on !CACHE && !SMP
|
|
|
|
help
|
|
|
|
Enable support for Xtensa Memory Protection Unit.
|
|
|
|
|
|
|
|
if XTENSA_MPU
|
|
|
|
|
|
|
|
config XTENSA_MPU_DEFAULT_MEM_TYPE
|
|
|
|
hex "Default Memory Type"
|
|
|
|
default 0x18
|
|
|
|
help
|
|
|
|
Default memory type for memory regions: non-cacheable memory,
|
|
|
|
non-shareable, non-bufferable and interruptible.
|
|
|
|
|
2024-01-30 23:33:42 +01:00
|
|
|
If userspace is enabled, it will be used to restore the memory type of
|
|
|
|
the region being removed from a memory domain.
|
|
|
|
|
2024-02-16 21:30:18 +01:00
|
|
|
config XTENSA_MPU_ONLY_SOC_RANGES
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Enable this by the SoC to indicate to the architecture code to use
|
|
|
|
the MPU ranges specified by SoC only, and skip the common ranges
|
|
|
|
defined in the core architecture code. This gives total control to
|
|
|
|
the SoC on the MPU ranges.
|
|
|
|
|
2024-03-16 01:37:23 +01:00
|
|
|
endif # XTENSA_MPU
|
|
|
|
|
|
|
|
endif # CPU_HAS_MPU
|
|
|
|
|
2022-12-14 09:35:36 +01:00
|
|
|
config XTENSA_SYSCALL_USE_HELPER
|
|
|
|
bool "Use userspace syscall helper"
|
2023-02-25 01:42:14 +01:00
|
|
|
default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "xt-clang"
|
2024-01-30 23:33:42 +01:00
|
|
|
depends on (XTENSA_MMU || XTENSA_MPU) && USERSPACE
|
2022-12-14 09:35:36 +01:00
|
|
|
help
|
|
|
|
Use syscall helpers for passing more then 3 arguments.
|
|
|
|
This is a workaround for toolchains where they have
|
|
|
|
issue modeling register usage.
|
|
|
|
|
2023-10-18 00:50:31 +02:00
|
|
|
config XTENSA_INSECURE_USERSPACE
|
|
|
|
bool
|
2024-01-29 21:14:15 +01:00
|
|
|
default y
|
2024-01-30 23:33:42 +01:00
|
|
|
depends on (XTENSA_MMU || XTENSA_MPU) && USERSPACE
|
2023-05-09 23:44:22 +02:00
|
|
|
|
2017-01-13 12:14:33 +01:00
|
|
|
endmenu
|