* [PATCH 2/6] RISC-V: rename HAS_CACHE to RISCV_ICACHE
2025-03-13 6:45 [PATCH 1/6] arch: move promptless options to end of Kconfig file Ahmad Fatoum
@ 2025-03-13 6:45 ` Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 3/6] treewide: retire CONFIG_HAS_CACHE Ahmad Fatoum
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2025-03-13 6:45 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
CONFIG_HAS_CACHE only serves a purpose on RISC-V to allow barebox to run
on softcores without fence.i instruction. Rename the symbol to reflect
that in preparation for removing HAS_CACHE altogether.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/riscv/Kconfig.socs | 9 ++++++---
arch/riscv/include/asm/cache.h | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index ccda688faf6d..4a3b56b5fff4 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -19,7 +19,7 @@ config SOC_VIRT
bool "QEMU Virt Machine"
select RISCV_S_MODE
select BOARD_GENERIC_DT
- select HAS_CACHE
+ select RISCV_ICACHE
select HAS_DEBUG_LL
help
Generates an image tht can be be booted by QEMU. The image is called
@@ -46,7 +46,7 @@ config BOARD_RISCVEMU
config CPU_SIFIVE
bool
- select HAS_CACHE
+ select RISCV_ICACHE
config SOC_SIFIVE
bool "SiFive SoCs"
@@ -116,7 +116,7 @@ config SOC_ALLWINNER_SUN20I
bool "Allwinner Sun20i SoCs"
depends on ARCH_RV64I
select HAS_DEBUG_LL
- select HAS_CACHE
+ select RISCV_ICACHE
if SOC_ALLWINNER_SUN20I
@@ -130,6 +130,9 @@ endif
comment "CPU features"
+config RISCV_ICACHE
+ bool
+
config SIFIVE_L2
bool "SiFive L2 cache controller"
depends on CPU_SIFIVE
diff --git a/arch/riscv/include/asm/cache.h b/arch/riscv/include/asm/cache.h
index c787f890017e..8c3cde669c30 100644
--- a/arch/riscv/include/asm/cache.h
+++ b/arch/riscv/include/asm/cache.h
@@ -21,7 +21,7 @@ static inline void thead_local_flush_icache_all(void)
static inline void local_flush_icache_all(void)
{
-#ifdef CONFIG_HAS_CACHE
+#ifdef CONFIG_RISCV_ICACHE
switch(riscv_vendor_id()) {
case THEAD_VENDOR_ID:
thead_local_flush_icache_all();
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/6] treewide: retire CONFIG_HAS_CACHE
2025-03-13 6:45 [PATCH 1/6] arch: move promptless options to end of Kconfig file Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 2/6] RISC-V: rename HAS_CACHE to RISCV_ICACHE Ahmad Fatoum
@ 2025-03-13 6:45 ` Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 4/6] arch: move hidden arch options to arch/Kconfig Ahmad Fatoum
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2025-03-13 6:45 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
The option serves no purpose any longer as all cache maintenance is
hidden behind generic APIs like the DMA streaming API.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/Kconfig | 1 -
arch/kvx/Kconfig | 1 -
arch/openrisc/Kconfig | 1 -
arch/powerpc/Kconfig | 1 -
common/Kconfig | 8 --------
drivers/net/Kconfig | 1 -
6 files changed, 13 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3d8f2eeca713..f5f9f3828782 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -3,7 +3,6 @@
config ARM
bool
select HAS_KALLSYMS
- select HAS_CACHE
select HAVE_IMAGE_COMPRESSION
select HAVE_ARCH_KASAN
select ARCH_HAS_SJLJ
diff --git a/arch/kvx/Kconfig b/arch/kvx/Kconfig
index 2e6432f897d8..5f325ca28358 100644
--- a/arch/kvx/Kconfig
+++ b/arch/kvx/Kconfig
@@ -14,7 +14,6 @@ config KVX
select FITIMAGE
select GENERIC_FIND_NEXT_BIT
select ARCH_HAS_SJLJ
- select HAS_CACHE
select HAS_DMA
select LIBFDT
select MFD_SYSCON
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 6b64b299b391..d79743962a42 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -3,7 +3,6 @@
config OPENRISC
bool
select OFTREE
- select HAS_CACHE
select HAVE_CONFIGURABLE_MEMORY_LAYOUT
select GENERIC_FIND_NEXT_BIT
select ARCH_HAS_SJLJ
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 6346594173ac..4e282bc3ac80 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -5,7 +5,6 @@ config PPC
select HAVE_CONFIGURABLE_TEXT_BASE
select HAS_KALLSYMS
select HAS_MODULES
- select HAS_CACHE
select GENERIC_FIND_NEXT_BIT
select OFTREE
select ARCH_HAS_SJLJ
diff --git a/common/Kconfig b/common/Kconfig
index 8a051a29e76c..6e5fba33ea4a 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -27,14 +27,6 @@ config HAS_KALLSYMS
config HAS_MODULES
bool
-config HAS_CACHE
- bool
- help
- This allows you to run "make ARCH=sandbox allyesconfig".
-
- Drivers that depend on a cache implementation can depend on this
- config, so that you don't get a compilation error.
-
config HAS_DMA
bool
help
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 5c436a05ccc5..7cad80c0a4b6 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -188,7 +188,6 @@ config DRIVER_NET_ENC28J60_WRITEVERIFY
config DRIVER_NET_ETHOC
bool "OpenCores ethernet MAC driver"
depends on OPENRISC
- depends on HAS_CACHE
select PHYLIB
help
This option enables support for the OpenCores 10/100 Mbps
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/6] arch: move hidden arch options to arch/Kconfig
2025-03-13 6:45 [PATCH 1/6] arch: move promptless options to end of Kconfig file Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 2/6] RISC-V: rename HAS_CACHE to RISCV_ICACHE Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 3/6] treewide: retire CONFIG_HAS_CACHE Ahmad Fatoum
@ 2025-03-13 6:45 ` Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 5/6] arch: move PHYS_ADDR_T_64BIT definition " Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 6/6] x86: make phys_addr_t 64-bit on x86_64 Ahmad Fatoum
4 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2025-03-13 6:45 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
We have a number of Kconfig symbols that are exclusively selected from
architecture Kconfig files, but are defined all over.
Move the definition of these symbols into arch/Kconfig, where they
are supposed to be.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/Kconfig | 42 +++++++++++++++++++++++++++++++++++++++++
common/Kconfig | 21 ---------------------
common/Kconfig.debug_ll | 3 ---
lib/Kconfig | 12 ------------
lib/Kconfig.ubsan | 2 --
lib/kasan/Kconfig | 3 ---
6 files changed, 42 insertions(+), 41 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 21175b90a076..b1200184678f 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -62,5 +62,47 @@ config ARCH_DMA_DEFAULT_COHERENT
config ARCH_HAS_ASAN_FIBER_API
bool
+config ARCH_HAS_STACK_DUMP
+ bool
+
+config ARCH_HAS_DATA_ABORT_MASK
+ bool
+
+config ARCH_HAS_ZERO_PAGE
+ bool
+
+config HAVE_EFFICIENT_UNALIGNED_ACCESS
+ bool
+
config HAVE_ARCH_BOARD_GENERIC_DT
bool
+
+config HAVE_MOD_ARCH_SPECIFIC
+ bool
+ help
+ The arch uses struct mod_arch_specific to store data. Many arches
+ just need a simple module loader without arch specific data - those
+ should not enable this.
+
+config ARCH_HAS_SJLJ
+ bool
+ help
+ Architecture has support implemented for setjmp()/longjmp()/initjmp()
+
+config ARCH_DMA_ADDR_T_64BIT
+ bool
+
+config ARCH_USE_SYM_ANNOTATIONS
+ bool
+ help
+ This is selected by architectures that exclusively use the new SYM_
+ macros in their assembly code and not the deprecated ENTRY/PROC.
+
+config HAS_DEBUG_LL
+ bool
+
+config HAVE_ARCH_KASAN
+ bool
+
+config ARCH_HAS_UBSAN_SANITIZE_ALL
+ bool
diff --git a/common/Kconfig b/common/Kconfig
index 6e5fba33ea4a..de66f0461cf1 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -35,11 +35,6 @@ config HAS_DMA
Drivers that depend on a DMA implementation can depend on this
config, so that you don't get a compilation error.
-config ARCH_HAS_SJLJ
- bool
- help
- Architecture has support implemented for setjmp()/longjmp()/initjmp()
-
config GENERIC_GPIO
bool
@@ -84,9 +79,6 @@ config MENUTREE
select GLOB
select GLOB_SORT
-config ARCH_DMA_ADDR_T_64BIT
- bool
-
config BAREBOX_UPDATE_IMX_NAND_FCB
bool
depends on ARCH_IMX7 || ARCH_IMX6 || ARCH_IMX28
@@ -359,13 +351,6 @@ config MODULES
As modules can't be signed, loading external modules is not
recommended for secure systems.
-config HAVE_MOD_ARCH_SPECIFIC
- bool
- help
- The arch uses struct mod_arch_specific to store data. Many arches
- just need a simple module loader without arch specific data - those
- should not enable this.
-
config KALLSYMS
depends on HAS_KALLSYMS
bool "kallsyms"
@@ -1359,9 +1344,3 @@ source "common/boards/Kconfig"
config DDR_SPD
bool
select CRC_ITU_T
-
-config ARCH_USE_SYM_ANNOTATIONS
- bool
- help
- This is selected by architectures that exclusively use the new SYM_
- macros in their assembly code and not the deprecated ENTRY/PROC.
diff --git a/common/Kconfig.debug_ll b/common/Kconfig.debug_ll
index 1f9255b1a45b..8c49f5b72882 100644
--- a/common/Kconfig.debug_ll
+++ b/common/Kconfig.debug_ll
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
-config HAS_DEBUG_LL
- bool
-
config DEBUG_LL
bool
depends on HAS_DEBUG_LL
diff --git a/lib/Kconfig b/lib/Kconfig
index 40c7b2cb5d65..8e1d8086fbb6 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -213,18 +213,6 @@ config BLOBGEN
select BASE64
bool "include blob encode/decode support"
-config ARCH_HAS_STACK_DUMP
- bool
-
-config ARCH_HAS_DATA_ABORT_MASK
- bool
-
-config ARCH_HAS_ZERO_PAGE
- bool
-
-config HAVE_EFFICIENT_UNALIGNED_ACCESS
- bool
-
config GENERIC_ALLOCATOR
bool
help
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index c04ff3cbb6fd..063563536be1 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
-config ARCH_HAS_UBSAN_SANITIZE_ALL
- bool
config UBSAN
bool "Undefined behaviour sanity checker"
diff --git a/lib/kasan/Kconfig b/lib/kasan/Kconfig
index 895a62d88439..532412953ba5 100644
--- a/lib/kasan/Kconfig
+++ b/lib/kasan/Kconfig
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
-config HAVE_ARCH_KASAN
- bool
-
config CC_HAS_KASAN_GENERIC
def_bool $(cc-option, -fsanitize=kernel-address)
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/6] arch: move PHYS_ADDR_T_64BIT definition to arch/Kconfig
2025-03-13 6:45 [PATCH 1/6] arch: move promptless options to end of Kconfig file Ahmad Fatoum
` (2 preceding siblings ...)
2025-03-13 6:45 ` [PATCH 4/6] arch: move hidden arch options to arch/Kconfig Ahmad Fatoum
@ 2025-03-13 6:45 ` Ahmad Fatoum
2025-03-13 6:45 ` [PATCH 6/6] x86: make phys_addr_t 64-bit on x86_64 Ahmad Fatoum
4 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2025-03-13 6:45 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
Currently, every architecture with 64-bit support defines its own
PHYS_ADDR_T_64BIT symbol, except for x86.
Sync with what's done for ARCH_DMA_ADDR_T_64BIT and move
PHYS_ADDR_T_64BIT into arch/Kconfig as well.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/Kconfig | 4 ++++
arch/arm/cpu/Kconfig | 3 ---
arch/kvx/Kconfig | 3 ---
arch/mips/Kconfig | 3 ---
arch/riscv/Kconfig | 3 ---
arch/sandbox/Kconfig | 3 ---
6 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index b1200184678f..dc5d1e454df5 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -89,6 +89,10 @@ config ARCH_HAS_SJLJ
help
Architecture has support implemented for setjmp()/longjmp()/initjmp()
+
+config PHYS_ADDR_T_64BIT
+ bool
+
config ARCH_DMA_ADDR_T_64BIT
bool
diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index 84fe770b6da8..e61bcadc8c35 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -2,9 +2,6 @@
comment "Processor Type"
-config PHYS_ADDR_T_64BIT
- bool
-
config CPU_32
bool
select HAS_MODULES
diff --git a/arch/kvx/Kconfig b/arch/kvx/Kconfig
index 5f325ca28358..9b733cd79201 100644
--- a/arch/kvx/Kconfig
+++ b/arch/kvx/Kconfig
@@ -23,9 +23,6 @@ config KVX
select RESET_SOURCE
default y
-config PHYS_ADDR_T_64BIT
- bool
-
config 64BIT
bool
select ARCH_DMA_ADDR_T_64BIT
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 769949a91085..43c493978c8f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -36,9 +36,6 @@ config GENERIC_LINKER_SCRIPT
bool
default y
-config PHYS_ADDR_T_64BIT
- bool
-
config ARCH_TEXT_BASE
hex
default 0xa0800000
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index be2146b3facb..4d56e55b533f 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -59,9 +59,6 @@ config CPU_SUPPORTS_32BIT_KERNEL
config CPU_SUPPORTS_64BIT_KERNEL
bool
-config PHYS_ADDR_T_64BIT
- bool
-
config 32BIT
bool
depends on CPU_SUPPORTS_32BIT_KERNEL
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index c1a51d4f021d..7c86511a2c61 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -32,9 +32,6 @@ config ARCH_TEXT_BASE
menu "Sandbox specific settings"
-config PHYS_ADDR_T_64BIT
- bool
-
config CC_IS_64BIT
def_bool $(success,$(srctree)/scripts/gcc-64bitptr.sh $(CC))
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 6/6] x86: make phys_addr_t 64-bit on x86_64
2025-03-13 6:45 [PATCH 1/6] arch: move promptless options to end of Kconfig file Ahmad Fatoum
` (3 preceding siblings ...)
2025-03-13 6:45 ` [PATCH 5/6] arch: move PHYS_ADDR_T_64BIT definition " Ahmad Fatoum
@ 2025-03-13 6:45 ` Ahmad Fatoum
4 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2025-03-13 6:45 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
sizeof(phys_addr_t) depends on whether CONFIG_PHYS_ADDR_T_64BIT is
enabled, which so far was selected for all 64-bit platforms except
x86_64.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/x86/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cea8e25b81f0..b453890f022b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,6 +28,7 @@ menu "ARCH specific settings"
config 64BIT
def_bool y if X86_EFI
select ARCH_DMA_ADDR_T_64BIT
+ select PHYS_ADDR_T_64BIT
help
Say yes to build a 64-bit binary - formerly known as x86_64
Say no to build a 32-bit binary - formerly known as i386.
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread