Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Bischoff <Sascha.Bischoff@arm.com>
To: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Vladimir Murzin <Vladimir.Murzin@arm.com>
Cc: "maz@kernel.org" <maz@kernel.org>,
	Joey Gouly <Joey.Gouly@arm.com>,
	Mark Rutland <Mark.Rutland@arm.com>, nd <nd@arm.com>
Subject: Re: [BOOTWRAPPER PATCH v2 1/2] Introduce --with-gic option
Date: Thu, 28 May 2026 15:06:07 +0000	[thread overview]
Message-ID: <a39930aac3543e2866a5a0f8e8a9e98ee94a0026.camel@arm.com> (raw)
In-Reply-To: <20260324125906.67012-2-vladimir.murzin@arm.com>

Hi Vladimir,

Sorry for taking so long to get to this!

On Tue, 2026-03-24 at 12:59 +0000, Vladimir Murzin wrote:
> We are about adding support for another GIC version, so introduce a

nit: We are about to add support

> new --with-gic option to select the desired GIC version at configure
> time. The default remains v2, preserving existing behavior. 
> Howevere,
nit: However

Aside from these nits, this looks good to me, so:
Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com>

Thanks,
Sascha

> 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}"


  reply	other threads:[~2026-05-28 15:07 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 ` [BOOTWRAPPER PATCH v2 1/2] Introduce --with-gic option Vladimir Murzin
2026-05-28 15:06   ` Sascha Bischoff [this message]
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=a39930aac3543e2866a5a0f8e8a9e98ee94a0026.camel@arm.com \
    --to=sascha.bischoff@arm.com \
    --cc=Joey.Gouly@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Vladimir.Murzin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=nd@arm.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