From: Vladimir Murzin <vladimir.murzin@arm•com>
To: linux-arm-kernel@lists•infradead.org
Cc: vladimir.murzin@arm•com, mark.rutland@arm•com, maz@kernel•org,
joey.gouly@arm•com, Sascha.Bischoff@arm•com
Subject: [BOOTWRAPPER PATCH v2 1/2] Introduce --with-gic option
Date: Tue, 24 Mar 2026 12:59:05 +0000 [thread overview]
Message-ID: <20260324125906.67012-2-vladimir.murzin@arm.com> (raw)
In-Reply-To: <20260324125906.67012-1-vladimir.murzin@arm.com>
We are about adding support for another GIC version, so introduce a
new --with-gic option to select the desired GIC version at configure
time. The default remains v2, preserving existing behavior. Howevere,
for GICv3, we replace the previous --enable-gicv3 option with
--with-gic=v3 which is backward-incompatible change (yet I hope we can
live with that).
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm•com>
---
Makefile.am | 8 +++++---
common/{gic.c => gic-v2.c} | 0
configure.ac | 23 ++++++++++++++++-------
3 files changed, 21 insertions(+), 10 deletions(-)
rename common/{gic.c => gic-v2.c} (100%)
diff --git a/Makefile.am b/Makefile.am
index 0178e5d..2710494 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -87,15 +87,17 @@ GIC_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNE
GIC_RDIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,gic-v3')
DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE)
DEFINES += -DGIC_RDIST_BASE=$(GIC_RDIST_BASE)
-COMMON_OBJ += gic-v3.o
-else
+endif
+
+if GICV2
GIC_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,cortex-a15-gic')
GIC_CPU_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,cortex-a15-gic')
DEFINES += -DGIC_CPU_BASE=$(GIC_CPU_BASE)
DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE)
-COMMON_OBJ += gic.o
endif
+COMMON_OBJ += gic-$(GIC_VERSION).o
+
if KERNEL_32
MBOX_OFFSET := 0x7ff8
TEXT_LIMIT := 0x3000
diff --git a/common/gic.c b/common/gic-v2.c
similarity index 100%
rename from common/gic.c
rename to common/gic-v2.c
diff --git a/configure.ac b/configure.ac
index 42858df..6f486c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,12 +139,21 @@ AC_ARG_WITH([xen-cmdline],
[X_CMDLINE=$withval])
AC_SUBST([XEN_CMDLINE], [$X_CMDLINE])
-# Allow a user to pass --enable-gicv3
-AC_ARG_ENABLE([gicv3],
- AS_HELP_STRING([--enable-gicv3], [enable GICv3 instead of GICv2]),
- [USE_GICV3=$enableval])
-AM_CONDITIONAL([GICV3], [test "x$USE_GICV3" = "xyes"])
-AS_IF([test "x$USE_GICV3" = "xyes"], [], [USE_GICV3=no])
+
+AC_ARG_WITH([gic],
+ AS_HELP_STRING([--with-gic={v2|v3}], [select GIC version]),
+ [GIC_VERSION=$withval],
+ [GIC_VERSION=v2])
+
+AS_CASE([$GIC_VERSION],
+ [v2|v3], [],
+ [AC_MSG_ERROR([Invalid GIC version: $GIC_VERSION (use v2 or v3)])])
+
+AC_SUBST([GIC_VERSION], [$GIC_VERSION])
+
+AM_CONDITIONAL([GICV2], [test "x$GIC_VERSION" = "xv2"])
+AM_CONDITIONAL([GICV3], [test "x$GIC_VERSION" = "xv3"])
+
# Ensure that we have all the needed programs
AC_PROG_CC
@@ -174,7 +183,7 @@ echo " Device tree compiler: ${DTC}"
echo " Linux kernel command line: ${CMDLINE}"
echo " Embedded initrd: ${FILESYSTEM:-NONE}"
echo " Use PSCI? ${USE_PSCI}"
-echo " Use GICv3? ${USE_GICV3}"
+echo " GIC version: ${GIC_VERSION}"
echo " Boot-wrapper execution state: AArch${BOOTWRAPPER_ES}"
echo " Kernel execution state: AArch${KERNEL_ES}"
echo " Xen image ${XEN_IMAGE:-NONE}"
--
2.34.1
next prev parent reply other threads:[~2026-03-24 12:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 12:59 [BOOTWRAPPER PATCH v2 0/2] Support GICv5 Vladimir Murzin
2026-03-24 12:59 ` Vladimir Murzin [this message]
2026-05-28 15:06 ` [BOOTWRAPPER PATCH v2 1/2] Introduce --with-gic option Sascha Bischoff
2026-05-29 9:47 ` Vladimir Murzin
2026-03-24 12:59 ` [BOOTWRAPPER PATCH v2 2/2] Add support for GICv5 Vladimir Murzin
2026-05-28 15:10 ` Sascha Bischoff
2026-05-29 9:48 ` Vladimir Murzin
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=20260324125906.67012-2-vladimir.murzin@arm.com \
--to=vladimir.murzin@arm$(echo .)com \
--cc=Sascha.Bischoff@arm$(echo .)com \
--cc=joey.gouly@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=mark.rutland@arm$(echo .)com \
--cc=maz@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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