From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Felix Singer <felixsinger@posteo.net>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 08/13] arch: maintain Linux kernel and mkimage ARCH mapping in Kconfig
Date: Sun, 12 Jan 2025 09:34:27 +0100 [thread overview]
Message-ID: <20250112083432.320215-9-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250112083432.320215-1-a.fatoum@pengutronix.de>
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@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
next prev parent reply other threads:[~2025-01-12 8:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-12 8:34 [PATCH 00/13] images: add barebox FIT image target Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 01/13] ARM: dts: add device trees for the QEMU Virt machine Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 02/13] treewide: collect the name of all board device trees Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 03/13] kbuild: collect available device trees in dtbs-list Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 04/13] scripts: add new scripts_dtc target Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 05/13] kbuild: restrict dtbs target to enabled DTs by default Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 06/13] kbuild: improve make help description Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 07/13] kbuild: allow dependency on any file in images/ Ahmad Fatoum
2025-01-12 8:34 ` Ahmad Fatoum [this message]
2025-01-12 8:34 ` [PATCH 09/13] arch: make BOARD_GENERIC_DT a user-selectable option across archs Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 10/13] images: add barebox FIT image target Ahmad Fatoum
2025-01-17 8:32 ` Sascha Hauer
2025-01-17 9:03 ` Ahmad Fatoum
2025-01-20 7:19 ` Sascha Hauer
2025-01-12 8:34 ` [PATCH 11/13] MAKEALL: rename target in symbols to more appropiate defconfig Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 12/13] MAKEALL: add support for building arbitrary targets Ahmad Fatoum
2025-01-12 8:34 ` [PATCH 13/13] ci: container: add python3-libfdt dependency for barebox.fit Ahmad Fatoum
2025-01-14 8:18 ` [PATCH 00/13] images: add barebox FIT image target Sascha Hauer
2025-01-21 8:07 ` (subset) " Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250112083432.320215-9-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=felixsinger@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox