kconfig: Unify CACHE_* options

The kconfig options to configure the cache flushing framework are
currently living in the arch-specific kconfigs of ARC and X86 (32-bit)
architectures even though these are defining the same things.

Move the common symbols in one place accessible by all the architectures
and create a menu for those.

Leave the default values in the arch-specific locations.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2020-12-02 13:05:37 +01:00 committed by Anas Nashif
commit 923b3be890
3 changed files with 28 additions and 55 deletions

View file

@ -710,6 +710,34 @@ config FPU_SHARING
endmenu endmenu
menu "Cache Options"
config CACHE_LINE_SIZE_DETECT
bool "Detect cache line size at runtime"
help
This option enables querying some architecture-specific hardware for
finding the cache line size at the expense of taking more memory and
code and a slightly increased boot time.
If the CPU's cache line size is known in advance, disable this option and
manually enter the value for CACHE_LINE_SIZE.
config CACHE_LINE_SIZE
int "Cache line size" if !CACHE_LINE_SIZE_DETECT
default 0
help
Size in bytes of a CPU cache line.
Detect automatically at runtime by selecting CACHE_LINE_SIZE_DETECT.
config CACHE_FLUSHING
bool "Enable cache flushing mechanism"
help
This links in the cache flushing functions (d-cache and i-cache where
possible).
endmenu
config ARCH config ARCH
string string
help help

View file

@ -282,34 +282,8 @@ source "arch/arc/core/mpu/Kconfig"
endmenu endmenu
config CACHE_LINE_SIZE_DETECT
bool "Detect d-cache line size at runtime"
help
This option enables querying the d-cache build register for finding
the d-cache line size at the expense of taking more memory and code
and a slightly increased boot time.
If the CPU's d-cache line size is known in advance, disable this
option and manually enter the value for CACHE_LINE_SIZE.
config CACHE_LINE_SIZE config CACHE_LINE_SIZE
int "Cache line size" if !CACHE_LINE_SIZE_DETECT
default 32 default 32
help
Size in bytes of a CPU d-cache line.
Detect automatically at runtime by selecting CACHE_LINE_SIZE_DETECT.
config ARCH_CACHE_FLUSH_DETECT
bool
config CACHE_FLUSHING
bool "Enable d-cache flushing mechanism"
help
This links in the sys_cache_flush() function, which provides a
way to flush multiple lines of the d-cache.
If the d-cache is present, set this to y.
If the d-cache is NOT present, set this to n.
config ARC_EXCEPTION_STACK_SIZE config ARC_EXCEPTION_STACK_SIZE
int "ARC exception handling stack size" int "ARC exception handling stack size"

View file

@ -140,25 +140,8 @@ config LAZY_FPU_SHARING
endmenu endmenu
config CACHE_LINE_SIZE_DETECT
bool "Detect cache line size at runtime"
default y
help
This option enables querying the CPUID register for finding the cache line
size at the expense of taking more memory and code and a slightly increased
boot time.
If the CPU's cache line size is known in advance, disable this option and
manually enter the value for CACHE_LINE_SIZE.
config CACHE_LINE_SIZE config CACHE_LINE_SIZE
int "Cache line size" if !CACHE_LINE_SIZE_DETECT
default 64 if CPU_ATOM default 64 if CPU_ATOM
default 0
help
Size in bytes of a CPU cache line.
Detect automatically at runtime by selecting CACHE_LINE_SIZE_DETECT.
config CLFLUSH_INSTRUCTION_SUPPORTED config CLFLUSH_INSTRUCTION_SUPPORTED
bool "CLFLUSH instruction supported" bool "CLFLUSH instruction supported"
@ -185,18 +168,6 @@ config CLFLUSH_DETECT
If the CPU's support (or lack thereof) of CLFLUSH is known in advance, then If the CPU's support (or lack thereof) of CLFLUSH is known in advance, then
disable this option and set CLFLUSH_INSTRUCTION_SUPPORTED as appropriate. disable this option and set CLFLUSH_INSTRUCTION_SUPPORTED as appropriate.
config ARCH_CACHE_FLUSH_DETECT
bool
default y
depends on CLFLUSH_DETECT
config CACHE_FLUSHING
bool "Enable cache flushing mechanism"
help
This links in the sys_cache_flush() function. A mechanism for flushing the
cache must be selected as well. By default, that mechanism is discovered at
runtime.
config X86_DYNAMIC_IRQ_STUBS config X86_DYNAMIC_IRQ_STUBS
int "Number of dynamic interrupt stubs" int "Number of dynamic interrupt stubs"
depends on DYNAMIC_INTERRUPTS depends on DYNAMIC_INTERRUPTS