[PATCH 08/13] arch: maintain Linux kernel and mkimage ARCH mapping in Kconfig
Ahmad Fatoum
a.fatoum at pengutronix.de
Sun Jan 12 00:34:27 PST 2025
How barebox calls the architectures it supports differs from both the
names used in the Linux kernel and in mkimage.
For easier interoperability with the two, especially in scripts, add
config options that hold the relevant names.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/Kconfig | 8 ++++++++
arch/arm/Kconfig | 9 +++++++++
arch/mips/Kconfig | 9 +++++++++
arch/openrisc/Kconfig | 4 ++++
arch/powerpc/Kconfig | 8 ++++++++
arch/riscv/Kconfig | 9 +++++++++
arch/sandbox/Kconfig | 4 ++++
arch/x86/Kconfig | 10 ++++++++++
8 files changed, 61 insertions(+)
diff --git a/arch/Kconfig b/arch/Kconfig
index 671e6a0e979d..f6ac75eafd11 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -21,3 +21,11 @@ config ARCH_DMA_DEFAULT_COHERENT
config ARCH_HAS_ASAN_FIBER_API
bool
+
+config ARCH_LINUX_NAME
+ string
+ default "$(SRCARCH)"
+
+config ARCH_MKIMAGE_NAME
+ string
+ default "invalid"
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f2c0f44e7487..df730b96b815 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -16,6 +16,15 @@ config ARM
select USE_COMPRESSED_DTB
default y
+config ARCH_LINUX_NAME
+ string
+ default "arm" if ARM32
+ default "arm64" if ARM64
+
+config ARCH_MKIMAGE_NAME
+ string
+ default ARCH_LINUX_NAME
+
config ARM32
def_bool CPU_32
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 14062dee3471..769949a91085 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -14,6 +14,15 @@ config MIPS
select ELF
default y
+config ARCH_LINUX_NAME
+ string
+ default "mips64" if CPU_SUPPORTS_64BIT_KERNEL
+ default "mips"
+
+config ARCH_MKIMAGE_NAME
+ string
+ default ARCH_LINUX_NAME
+
config SYS_SUPPORTS_BIG_ENDIAN
bool
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 102071686e4f..6b64b299b391 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -10,6 +10,10 @@ config OPENRISC
select HAS_DEBUG_LL
default y
+config ARCH_MKIMAGE_NAME
+ string
+ default "or1k"
+
# not used
config ARCH_TEXT_BASE
hex
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ba875767b2f8..6346594173ac 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -11,6 +11,14 @@ config PPC
select ARCH_HAS_SJLJ
default y
+config ARCH_LINUX_NAME
+ string
+ default "ppc"
+
+config ARCH_MKIMAGE_NAME
+ string
+ default "powerpc"
+
choice
prompt "Processor type"
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 8f2cd089a213..ad724565d7bb 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -18,6 +18,15 @@ config RISCV
select RISCV_TIMER if RISCV_SBI
select HW_HAS_PCI
+config ARCH_LINUX_NAME
+ string
+ default "riscv" if ARCH_RV32I
+ default "riscv64" if ARCH_RV64I
+
+config ARCH_MKIMAGE_NAME
+ string
+ default "riscv"
+
config ARCH_TEXT_BASE
hex
default 0x0
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index d5b37de1843b..0b6cc75098be 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -22,6 +22,10 @@ config SANDBOX
select BAREBOX_CMDLINE
default y
+config ARCH_LINUX_NAME
+ string
+ default "um"
+
config ARCH_TEXT_BASE
hex
default 0x00000000
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index aab0c3c63261..cea8e25b81f0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -9,6 +9,16 @@ config X86
select HAVE_EFI_PAYLOAD
default y
+config ARCH_LINUX_NAME
+ string
+ default "i386" if X86_32
+ default "x86_64" if X86_64
+
+config ARCH_MKIMAGE_NAME
+ string
+ default "x86" if X86_32
+ default "x86_64" if X86_64
+
config ARCH_TEXT_BASE
hex
default 0x0
--
2.39.5
More information about the barebox
mailing list