Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1785777pxk; Tue, 1 Sep 2020 07:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjHgy6RWheYV+eQ8GlOgU4V4EngMG6vdNlG8IJHw0IRDE5ELeME0T57lFyzOuNh7DsVJet X-Received: by 2002:a17:906:54e:: with SMTP id k14mr1743737eja.59.1598971640600; Tue, 01 Sep 2020 07:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598971640; cv=none; d=google.com; s=arc-20160816; b=GKKe28s8/rwp5F9Uq2tJqv/BCy87U+ub6B4MIlNErgMsKAiUACSYz8J4vlMHdjYa9S qK6diBKRDkenMkWmzEjHmbw/ZMdedz01zkAr/poDsJi8z++N996ZiLHGw7eqjI+fiQOO gWZtBxEt152DGU9/1yo3v2nROtleA4Ajm2GHOgpUhJaXUxUj5kTGEt4Wzv1fOwquR+XC XxrQ2awYh3cUD7USCaZAjFlJg1KFDSgzr+3RUAYQ5ZBH5V5G0iJDTNiw16JWf6+ZQphV P1ExcUJtr/dfEmlhn6ntKdS4SryRp7GMnt39d+2wNZFDMZHIVovsy4g1yWKfdOwWVyQe DDMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JE5gGYxj+GLi3vd5N0JhpWY5OdFHiZvUymMALkbNmBU=; b=YyO4zSNh/ngIgfm4nRGBY+EE2qUM977evi/5j0Jm7zkGFvYszUIXMXL07S65bRS9bJ PrhvsTPfVfG6h+sg7/zoeudYDV/NtKX1GplOmI15HF6yXhi2/ZzbZ3F0Afy5bxVibDVp DFDj0KiIpMpHulvNk4GuaNZ+urz9xGuI2SymPf49hOYl93Em0vpqUtnr9PGZ4fRjN0QO WKyV1Ga8MDfnUz0tdw6TXCNG5RtjH1OIV4CvXEMRnMtEaUefB19rYExpuDJQ1joJxkuZ kwUwaAqGz/jmJMxdg9aN2xoYnnkodPlh4Nl0hef5jCJ7A4FThjBLpJBZyzmxek+UFiO/ Rnrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=of29RUxb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si774114ejk.113.2020.09.01.07.46.57; Tue, 01 Sep 2020 07:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=of29RUxb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728379AbgIAOnu (ORCPT + 99 others); Tue, 1 Sep 2020 10:43:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:57126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728604AbgIAOng (ORCPT ); Tue, 1 Sep 2020 10:43:36 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C45E21D7D; Tue, 1 Sep 2020 14:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598971415; bh=WYho98u1Z3uUEjOuiK+CeonKhHJ+0ZsBT08SZ6m+SF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=of29RUxba+qmDgefy0G9TjNDK9JvvbXNVxokTjv9+gvqNoz9AvC8zrQcmRG3qfR27 GShKqppTb0YEYRhAsgTLe22OXkMsMFvJasxijkL95O9hWkEoibdhfL59OlYq3gBHST hyZ1k/Ro1VZkfvLKN7r+JBvvUgTiBtK01j2WaZbM= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kD7VV-008IQP-L0; Tue, 01 Sep 2020 15:43:33 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Will Deacon , Catalin Marinas , Russell King , Thomas Gleixner , Jason Cooper , Sumit Garg , Valentin Schneider , Florian Fainelli , Gregory Clement , Andrew Lunn , Saravana Kannan , kernel-team@android.com, Valentin Schneider Subject: [PATCH v3 05/16] irqchip/gic-v3: Describe the SGI range Date: Tue, 1 Sep 2020 15:43:13 +0100 Message-Id: <20200901144324.1071694-6-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200901144324.1071694-1-maz@kernel.org> References: <20200901144324.1071694-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, linux@arm.linux.org.uk, tglx@linutronix.de, jason@lakedaemon.net, sumit.garg@linaro.org, Valentin.Schneider@arm.com, f.fainelli@gmail.com, gregory.clement@bootlin.com, andrew@lunn.ch, saravanak@google.com, kernel-team@android.com, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we are about to start making use of SGIs in a more conventional way, let's describe it is the GICv3 list of interrupt types. Reviewed-by: Valentin Schneider Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 850842f27bee..f7c99a302d01 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -112,6 +112,7 @@ static DEFINE_PER_CPU(bool, has_rss); #define DEFAULT_PMR_VALUE 0xf0 enum gic_intid_range { + SGI_RANGE, PPI_RANGE, SPI_RANGE, EPPI_RANGE, @@ -123,6 +124,8 @@ enum gic_intid_range { static enum gic_intid_range __get_intid_range(irq_hw_number_t hwirq) { switch (hwirq) { + case 0 ... 15: + return SGI_RANGE; case 16 ... 31: return PPI_RANGE; case 32 ... 1019: @@ -148,15 +151,22 @@ static inline unsigned int gic_irq(struct irq_data *d) return d->hwirq; } -static inline int gic_irq_in_rdist(struct irq_data *d) +static inline bool gic_irq_in_rdist(struct irq_data *d) { - enum gic_intid_range range = get_intid_range(d); - return range == PPI_RANGE || range == EPPI_RANGE; + switch (get_intid_range(d)) { + case SGI_RANGE: + case PPI_RANGE: + case EPPI_RANGE: + return true; + default: + return false; + } } static inline void __iomem *gic_dist_base(struct irq_data *d) { switch (get_intid_range(d)) { + case SGI_RANGE: case PPI_RANGE: case EPPI_RANGE: /* SGI+PPI -> SGI_base for this CPU */ @@ -253,6 +263,7 @@ static void gic_enable_redist(bool enable) static u32 convert_offset_index(struct irq_data *d, u32 offset, u32 *index) { switch (get_intid_range(d)) { + case SGI_RANGE: case PPI_RANGE: case SPI_RANGE: *index = d->hwirq; @@ -1277,6 +1288,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, chip = &gic_eoimode1_chip; switch (__get_intid_range(hw)) { + case SGI_RANGE: case PPI_RANGE: case EPPI_RANGE: irq_set_percpu_devid(irq); -- 2.27.0