[PATCH 5/5] kvx: add support for Coolidge V1/V2 march selection

jvetter at kalrayinc.com jvetter at kalrayinc.com
Mon Jun 17 06:43:29 PDT 2024


From: Yann Sionneau <ysionneau at kalrayinc.com>

There is a new version of the MPPA Coolidge chip. Version 2 has some
slight changes in terms of functionality, instructions, etc. So, allow
the system to be built for Coolidge V1 or Coolidge V2.

Signed-off-by: Yann Sionneau <ysionneau at kalrayinc.com>
Signed-off-by: Julian Vetter <jvetter at kalrayinc.com>
Reviewed-by: Yann Sionneau <ysionneau at kalrayinc.com>
Reviewed-by: Jonathan Borne <jborne at kalrayinc.com>
---
 arch/kvx/Kconfig           | 11 +++++++++++
 arch/kvx/Makefile          |  7 +++++--
 arch/kvx/cpu/barebox.lds.S |  1 -
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/kvx/Kconfig b/arch/kvx/Kconfig
index 2dea8cff82..2e6432f897 100644
--- a/arch/kvx/Kconfig
+++ b/arch/kvx/Kconfig
@@ -37,6 +37,17 @@ config ARCH_TEXT_BASE
 	hex
 	default 0x110000000
 
+choice
+	prompt "KVX CPU variant"
+
+config ARCH_COOLIDGE_V1
+	bool "Coolidge V1 (KV3-1)"
+
+config ARCH_COOLIDGE_V2
+	bool "Coolidge V2 (KV3-2)"
+
+endchoice
+
 menu "Board configuration"
 
 config BUILTIN_DTB
diff --git a/arch/kvx/Makefile b/arch/kvx/Makefile
index 9431c9fe18..f47f6d6eca 100644
--- a/arch/kvx/Makefile
+++ b/arch/kvx/Makefile
@@ -15,8 +15,11 @@ DEFAULT_CFLAGS += -DTEXT_BASE=$(CONFIG_TEXT_BASE)
 
 LIBGCC_PATH = $(dir $(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name))
 
-KBUILD_CFLAGS += $(DEFAULT_CFLAGS)
-KBUILD_AFLAGS += $(DEFAULT_CFLAGS)
+KVX_BUILD_FLAGS-y = $(DEFAULT_CFLAGS)
+KVX_BUILD_FLAGS-$(CONFIG_ARCH_COOLIDGE_V1) += -march=kv3-1
+KVX_BUILD_FLAGS-$(CONFIG_ARCH_COOLIDGE_V2) += -march=kv3-2
+KBUILD_CFLAGS += $(KVX_BUILD_FLAGS-y)
+KBUILD_AFLAGS += $(KVX_BUILD_FLAGS-y)
 
 KBUILD_LDFLAGS += -m elf64kvx
 
diff --git a/arch/kvx/cpu/barebox.lds.S b/arch/kvx/cpu/barebox.lds.S
index a22998190f..1edaeae188 100644
--- a/arch/kvx/cpu/barebox.lds.S
+++ b/arch/kvx/cpu/barebox.lds.S
@@ -8,7 +8,6 @@
 #include <asm/barebox.lds.h>
 
 OUTPUT_FORMAT("elf64-kvx")
-OUTPUT_ARCH("kvx:kv3-1:64")
 
 SECTIONS
 {
-- 
2.34.1








More information about the barebox mailing list