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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58A8FC433F5 for ; Wed, 1 Dec 2021 13:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=5aKNyUHD6bQH4vH6hbBYMbKM3Ufa4xPdIG1/fJjEhQQ=; b=1r8jtbETMwO5T+ CWmpLfpEwKsaxPH0AXXddrnzRWbgCrYkGe4EQfER7rg6ghnQwzV4teRTUFf4QziPJ/E4ppJukq8By PQbT8gA5B/yQWVx1y50r2dfgMwToGTFgmM94YsYpnfZU+HSzeLNcTe8B7z7pENTxWsrg+l+TkUj1m CogzopNRtPytYOD9K1XjbQU4xX3ox/ssWAeb5SOAb0qY/cviTYOeeB8kx6G1tXYkTlXDsz9JDHH5M jWZqhcGgID2596Wyp/z5MztCE1GwToL9k1p6ctlId9onHlQK2HVP5AJXUcW0GFaztbsfU3D5TCpiW fpEdEBEb/ryVGXtmve0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1msQ0m-008u5Y-7O; Wed, 01 Dec 2021 13:51:04 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1msPzC-008tKQ-Bp for linux-arm-kernel@lists.infradead.org; Wed, 01 Dec 2021 13:49:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 86B8DCE1ECC; Wed, 1 Dec 2021 13:49:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A5B2C56747; Wed, 1 Dec 2021 13:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638366561; bh=Zl6H58qcgfUeyieN66WwDm5TyO/4vzr6D5P7MU2G3sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dngii+ec800kMxYsbxUDZBlY+OVtxnnAgOasyF7nt27wqx4w8etMYgms8qRE22emJ 4ylaEjz37AOpBUAh9KpN/C1a0Who4kLrAQFPLJdpN6txUBxpb573v3ESudG0hK+fCY Mt04kIOUrwLyXfG1xdxr2VsHuQ2OfzffLxOyMwULGeNke9hGMr5fM/OOEYdMkpubBa mFRynxBpoaPMeYFSiBp/r4uzMSWHigumZLZ3jrWO0iG01jICCL0Tv03DIae0SOx30j 5ICk4SgGnYv1l0pIL/2w8i49DEkV5wNbvlUqQmwXNpmvvmF0Y+7fETPAtg3XExaoet 5Fx9ifCP6zWUQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1msPz5-0098G7-Cd; Wed, 01 Dec 2021 13:49:19 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Rutland , Will Deacon , Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Thomas Gleixner , Dougall , kernel-team@android.com Subject: [PATCH v2 3/8] irqchip/apple-aic: Add cpumasks for E and P cores Date: Wed, 1 Dec 2021 13:49:04 +0000 Message-Id: <20211201134909.390490-4-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211201134909.390490-1-maz@kernel.org> References: <20211201134909.390490-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, will@kernel.org, marcan@marcan.st, sven@svenpeter.dev, alyssa@rosenzweig.io, robh+dt@kernel.org, tglx@linutronix.de, dougallj@gmail.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211201_054926_635238_CA093912 X-CRM114-Status: GOOD ( 17.90 ) 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: , 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 In order to be able to tell the core IRQ code about the affinity of the PMU interrupt in later patches, compute the cpumasks of the P and E cores at boot time. This relies on the affinity scheme used by the vendor, which seems to work for the couple of SoCs that are out in the wild. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-apple-aic.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c index 3759dc36cc8f..30ca80ccda8b 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -177,6 +177,8 @@ struct aic_irq_chip { void __iomem *base; struct irq_domain *hw_domain; struct irq_domain *ipi_domain; + struct cpumask ecore_mask; + struct cpumask pcore_mask; int nr_hw; int ipi_hwirq; }; @@ -200,6 +202,11 @@ static void aic_ic_write(struct aic_irq_chip *ic, u32 reg, u32 val) writel_relaxed(val, ic->base + reg); } +static bool __is_pcore(u64 mpidr) +{ + return MPIDR_AFFINITY_LEVEL(mpidr, 2) == 1; +} + /* * IRQ irqchip */ @@ -833,6 +840,13 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p return -ENODEV; } + for_each_possible_cpu(i) { + if (__is_pcore(cpu_logical_map(i))) + cpumask_set_cpu(i, &irqc->pcore_mask); + else + cpumask_set_cpu(i, &irqc->ecore_mask); + } + set_handle_irq(aic_handle_irq); set_handle_fiq(aic_handle_fiq); -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel