From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6531DC433ED for ; Mon, 10 May 2021 12:13:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1D40613EE for ; Mon, 10 May 2021 12:13:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1D40613EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=E9xegb/3nUvjZFA3HTHW9QTSX/hOUGaRGLQXZciFg18=; b=Xm6BCwSNw0TBPoigoFOJwtRSGH LqjKJ9uIvW463/I5ICT5/ATdUyaJw5EmfsJONtntREWnBe4mkFoEOgJPHP4ViP39K4The32N/wEMr fNz+2ZrDo3B8hzbAk+EsZhh1IGJG4EMC7i/kKFapXeR6BMuqTmPAQomFbgtJj0dEUK6iABa9ZoV8s gQvjViwG4OYnmYkiPkWdPoIfwOV7iKi7nzxOKOyKo9Q5PNBscdeAjyRnjHSW8upi9Ewv2APaUPB53 dtfP7xeQnD3r9lQUZ2shFyXIDaO8lNJ3+RQRryKGNe8KUKiY9JM2fKLM64VFFxeeiM5m1fQfnQr88 sOz9xU4Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg4lw-00EDAK-0F; Mon, 10 May 2021 12:12:28 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg4hx-00ECP1-8U for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 12:08:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Vp2IehB1eF3l/LtDexZsDLDSIHmJ8fXqhWCmTIC42SA=; b=Ved/UxUjgdEOupXzOjR9k0/BGJ vakibX4vTPPeIINeV78L5urmVNAAaCj0gFkHtW/tIWekQPvOrXAxmi/u1Q8qG6IRnFtvt5D3+FXbg 7rf5DASI8Anpm0qtPfvZKuWxuz4kuWALbMc2+O65zKLVRE3qEsmpLBmP36XoGQTf5kSO9mFhYeNeN 4pSTjMfcOlgSn9jyOXsnGWzcLLZ7emJsqes4U5Vt/M/z/61JFnB+DrsT8Y9D5+TecfZa6rGEwOeSd zgoU+hkOBUOMQEmdpa3ZVTKgFN2NwrtRrffQCpVUeCku6/f7szq1viuB/eK+JHZNpXDSB1/AGWKPu trda4+eg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg4hu-008fhO-DJ for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 12:08:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B7CC2168F; Mon, 10 May 2021 05:08:17 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F23D53F73B; Mon, 10 May 2021 05:08:16 -0700 (PDT) From: Andre Przywara To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, Jaxson Han Subject: [aarch64 boot-wrapper PATCH 6/6] configure: Autodetect GICv3 Date: Mon, 10 May 2021 13:07:26 +0100 Message-Id: <20210510120726.5242-7-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20210510120726.5242-1-andre.przywara@arm.com> References: <20210510120726.5242-1-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_050818_583716_3D10EF19 X-CRM114-Status: GOOD ( 12.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently the user has to specify the GIC architecture version (v2 or v3) on the ./configure command line, even though this is actually redundant information, since the DTB can carry only one GIC type. Unconditionally query for the two GIC compatible strings in the provided DTB, then choose the GIC type automatically depending on which string is found. This saves the user from specifying the GIC type on the configure command line, and avoids errors when the wrong type was accidentally named. Signed-off-by: Andre Przywara --- Makefile.am | 21 ++++++++------------- configure.ac | 8 -------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Makefile.am b/Makefile.am index b8c0a49..9b3c0ad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,19 +58,14 @@ PSCI_NODE := CPU_NODES := endif -if GICV3 -GIC_DIST_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,gic-v3') -GIC_RDIST_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 1 'arm,gic-v3') -DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE) -DEFINES += -DGIC_RDIST_BASE=$(GIC_RDIST_BASE) -GIC := gic-v3.o -else -GIC_DIST_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,cortex-a15-gic') -GIC_CPU_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 1 'arm,cortex-a15-gic') -DEFINES += -DGIC_CPU_BASE=$(GIC_CPU_BASE) -DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE) -GIC := gic.o -endif +GICV3_DIST_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,gic-v3' 2> /dev/null) +GIC_RDIST_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 1 'arm,gic-v3' 2> /dev/null) +GICV2_DIST_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 0 'arm,cortex-a15-gic' 2> /dev/null) +GIC_CPU_BASE := $(shell perl -I $(top_srcdir) $(top_srcdir)/findbase.pl $(KERNEL_DTB) 1 'arm,cortex-a15-gic' 2> /dev/null) +DEFINES += $(if $(GICV3_DIST_BASE), -DGIC_DIST_BASE=$(GICV3_DIST_BASE), -DGIC_DIST_BASE=$(GICV2_DIST_BASE)) +DEFINES += $(if $(GIC_RDIST_BASE), -DGIC_RDIST_BASE=$(GIC_RDIST_BASE), ) +DEFINES += $(if $(GIC_CPU_BASE), -DGIC_CPU_BASE=$(GIC_CPU_BASE), ) +GIC := $(if $(GICV3_DIST_BASE), gic-v3.o, gic.o) if KERNEL_32 MBOX_OFFSET := 0x7ff8 diff --git a/configure.ac b/configure.ac index 9e3b722..ed3e094 100644 --- a/configure.ac +++ b/configure.ac @@ -111,13 +111,6 @@ 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]) - # Ensure that we have all the needed programs AC_PROG_CC AC_PROG_CPP @@ -144,7 +137,6 @@ echo " Device tree blob: ${KERN_DTB}" echo " Linux kernel command line: ${CMDLINE}" echo " Embedded initrd: ${FILESYSTEM:-NONE}" echo " Use PSCI? ${USE_PSCI}" -echo " Use GICv3? ${USE_GICV3}" echo " Boot-wrapper execution state: AArch${BOOTWRAPPER_ES}" echo " Kernel execution state: AArch${KERNEL_ES}" echo " Xen image ${XEN_IMAGE:-NONE}" -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel