mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: jvetter@kalrayinc.com
To: barebox@lists.infradead.org
Cc: ysionneau@kalrayinc.com, jborne@kalrayinc.com,
	jhascoet@kalrayinc.com, clement@clement-leger.fr,
	Julian Vetter <jvetter@kalrayinc.com>
Subject: [PATCH 5/5] kvx: add support for Coolidge V1/V2 march selection
Date: Mon, 17 Jun 2024 15:43:29 +0200	[thread overview]
Message-ID: <20240617134329.3671762-6-jvetter@kalrayinc.com> (raw)
In-Reply-To: <20240617134329.3671762-1-jvetter@kalrayinc.com>

From: Yann Sionneau <ysionneau@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@kalrayinc.com>
Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
Reviewed-by: Yann Sionneau <ysionneau@kalrayinc.com>
Reviewed-by: Jonathan Borne <jborne@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








      parent reply	other threads:[~2024-06-17 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 13:43 Update kvx support jvetter
2024-06-17 13:43 ` [PATCH 1/5] kvx: Fix barebox build for kvx jvetter
2024-06-18  6:13   ` Sascha Hauer
2024-06-17 13:43 ` [PATCH 2/5] kvx: Add 'stop' instruction to power down sequence jvetter
2024-06-17 13:43 ` [PATCH 3/5] kvx: robustify i/d cache startup jvetter
2024-06-17 13:43 ` [PATCH 4/5] kvx: handle syscalls gracefully jvetter
2024-06-17 13:43 ` jvetter [this message]

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=20240617134329.3671762-6-jvetter@kalrayinc.com \
    --to=jvetter@kalrayinc.com \
    --cc=barebox@lists.infradead.org \
    --cc=clement@clement-leger.fr \
    --cc=jborne@kalrayinc.com \
    --cc=jhascoet@kalrayinc.com \
    --cc=ysionneau@kalrayinc.com \
    /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