Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 918F0606A32C for ; Wed, 2 Dec 2026 21:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SQNb0WK8; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PRrQQCC3 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=WxburAESXyLDCUOrR1aJyzZE7b5DIa7YARTsSa6jgaA=; b=SQNb0WK8A5fANdUEB/fb9H1GSF b1wgSOeVcn3sh/G4+eBb1MUdeAaMbCBRARJnK4lrUZsk6rG442qieXM9J09h+39bTleZmcqXMgZBk OagUff9ulfcsnRuT3ZPbfgD6hYJiYzgg59lEyVc31+Sp79qrdpI2VswKmSfEOmpo2hWCefkTR6tXo dypI6UxPHr/5qwgnmFBojHE8t/lZMdiB805rE+1Uo13XMxAn9lk4MjQpvL1YL4B1eu+eSrcZTNaKu bbrY11Kx09PTHtIt/Aw1Oty9XlqFdm93Sw8H5LT+geomdAffHwJo6iHQIbdSJxWx9ySDXISZepMZ7 qwFb1uIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYrna-0000000Couv-1sFf; Wed, 02 Dec 2026 21:23:34 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYrnZ-0000000Couj-18VM for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 21:23:33 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4916743302; Wed, 2 Dec 2026 21:23:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9B3C1F000C1; Wed, 2 Dec 2026 21:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796246612; bh=WxburAESXyLDCUOrR1aJyzZE7b5DIa7YARTsSa6jgaA=; h=From:Date:Subject:To:Cc; b=PRrQQCC3HqcGOR93ibpnkGGAEPrKI1A3BkG4T5xenN4dyf3ggSShSEa6aqIsmnD00 UbL82jjwERF8QnZUFnAJhqPc//yhhi5vzkP/Nn5CT2slZ/MkaM2Xrt/9QPCnB6807h nWn/ziyj3jEdxiPh3DaejGWRBq9aCOr/Gy7vKf/L4nGEMt+tpx4bZj8Ec9FYZKlmGG cYuHcex6k4KN4YCGP4DIZao2eUetWvOHcGbHEpjfceCCklo5R5ZPHBFm+YxivoP99i ElLZMIw9kafssrsn52mrS42WXivkE9/Ur5aOPhfhjh4tIStHRQFtpfrFEf2dzh4cGm JJqFjqJR2k35g== From: Linus Walleij Date: Wed, 02 Dec 2026 22:23:28 +0100 Subject: [PATCH v2] ARM: bcm: Send the BCMBCA CFE wakeup SGI directly X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-bcmbca-smp-gicv2-v2-1-da89fbb5dbb8@kernel.org> X-B4-Tracking: v=1; b=H4sIAAAAAAAA/33NSw6CMBCA4as0s2YMHeUhK+9hWJRhKBPlkdY0G sLdjRzA7b/4/g2iBJUIjdkgSNKoywyNocwAj272gtpDY4ByKi3lhB1PHTuM04peOREW56Ir+wt XxANkBtYgg74P8t5mBkaNryV8jkOyv/oHSxYtVjVxTteaXMW3h4RZnqcleGj3ff8CeQZA97EAA AA= X-Change-ID: 20261202-bcmbca-smp-gicv2-535b6d4c72cf To: Ho Jie Feng , Marc Zyngier , Florian Fainelli , Broadcom internal kernel review list , William Zhang , Anand Gore , Kursad Oney , =?utf-8?q?Rafa=C5=82_Mi=C5=82ecki?= Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij X-Mailer: b4 0.16.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, 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=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The GICv2 driver learns a CPU's target bit when that CPU starts. Before then, its provisional target mask can address multiple CPU interfaces. CFE wakes the secondary when an interrupt arrives, so use an explicit target for this first SGI. Map the Cortex-A7 GIC distributor using the CPU node's interrupt parent in DeviceTree. Use the core ID from MPIDR affinity level 0 as the target bit in the integrated Cortex-A7 GIC. Keep the barrier that completes the CFE mailbox write before sending SGI 0 to that target. Suggested-by: Marc Zyngier Link: https://lore.kernel.org/linux-arm-kernel/20261123142203.3860616-3-hjf3108@gmail.com/ Fixes: db4d1458f203 ("ARM: bcm: Add CFE SMP support for BCMBCA") Tested-by: Ho Jie Feng Signed-off-by: Linus Walleij --- An LLM assisted in authoring the patch. --- Changes in v2: - Remove the CPU1-only wakeup restriction. - Collect Jie's Tested-by. - Derive the SGI target from MPIDR affinity level 0. Should mean not difference since BCMBCA doesn't use the cluster bits, but better safe than sorry. - Link to v1: https://patch.msgid.link/20261202-bcmbca-smp-gicv2-v1-1-782c02982a7c@kernel.org --- arch/arm/mach-bcm/board_bcmbca.c | 46 ++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-bcm/board_bcmbca.c b/arch/arm/mach-bcm/board_bcmbca.c index 248b8bd77645..e85dd48f3cca 100644 --- a/arch/arm/mach-bcm/board_bcmbca.c +++ b/arch/arm/mach-bcm/board_bcmbca.c @@ -1,10 +1,15 @@ // SPDX-License-Identifier: GPL-2.0-only // Copyright (C) 2024 Linus Walleij +#include #include +#include #include +#include +#include #include +#include #include #include #include @@ -29,15 +34,19 @@ static void __init bcmbca_map_io(void) } #ifdef CONFIG_SMP +#define BCMBCA_GIC_CPU_IFS 8 +#define BCMBCA_SGIR_TARGET_SHIFT 16 +#define BCMBCA_WAKEUP_SGI 0 + static int bcmbca_boot_secondary(unsigned int cpu, struct task_struct *idle) { - struct device_node *np; - void __iomem *mailbox; + unsigned int gic_cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 0); + struct device_node *np, *gic_node; + void __iomem *mailbox, *gic_dist; u32 release_addr; int ret; - /* CFE has already powered up CPU1 and left it waiting in WFI. */ - if (cpu_logical_map(cpu) != 1) + if (gic_cpu >= BCMBCA_GIC_CPU_IFS) return -EINVAL; np = of_get_cpu_node(cpu, NULL); @@ -45,15 +54,30 @@ static int bcmbca_boot_secondary(unsigned int cpu, struct task_struct *idle) return -ENODEV; ret = of_property_read_u32(np, "cpu-release-addr", &release_addr); - of_node_put(np); if (ret) { + of_node_put(np); pr_err("CPU%u: missing or invalid cpu-release-addr property\n", cpu); return ret; } + gic_node = of_irq_find_parent(np); + of_node_put(np); + if (!of_device_is_compatible(gic_node, "arm,cortex-a7-gic") || + !of_device_is_available(gic_node)) { + of_node_put(gic_node); + return -ENODEV; + } + + gic_dist = of_iomap(gic_node, 0); + of_node_put(gic_node); + if (!gic_dist) + return -ENOMEM; + mailbox = ioremap(release_addr, sizeof(u32)); - if (!mailbox) + if (!mailbox) { + iounmap(gic_dist); return -ENOMEM; + } /* * The CFE stub reads GPIO GeneralPurpose after an interrupt and @@ -62,8 +86,16 @@ static int bcmbca_boot_secondary(unsigned int cpu, struct task_struct *idle) */ writel(__pa_symbol(secondary_startup_arm) & ~1, mailbox); dsb(sy); - arch_send_wakeup_ipi_mask(cpumask_of(cpu)); + + /* + * The integrated Cortex-A7 GIC uses the hardware core ID as its + * target bit. Linux has yet to discover the secondary's GIC target. + * Use SGI 0, the same interrupt as the ARM GICv2 wakeup IPI. + */ + writel_relaxed(BIT(BCMBCA_SGIR_TARGET_SHIFT + gic_cpu) | BCMBCA_WAKEUP_SGI, + gic_dist + GIC_DIST_SOFTINT); iounmap(mailbox); + iounmap(gic_dist); return 0; } --- base-commit: 21f8531821461fa0c05e4605c01d8d56d28b514e change-id: 20261202-bcmbca-smp-gicv2-535b6d4c72cf Best regards, -- Linus Walleij