Re: [PATCH 2/2] ARM: bcm: support more than two CPUs on BCMBCA

From: Jie Feng

Date: Wed Nov 25 2026 - 22:14:42 EST


Hi William,

On Thu, 26 Nov 2026 at 02:48, William Zhang <william.zhang@xxxxxxxxxxxx> wrote:
>
> Hi Ho Jie,
> On Mon, Nov 23, 2026 at 6:22 AM Ho Jie Feng <hjf3108@xxxxxxxxx> wrote:
> >
> > BCMBCA Cortex-A7 SoCs can have more than two cores, such as the
> > quad-core BCM6755. Extend the CFE SMP support to all secondary CPUs.
> >
> > CFE parks every secondary CPU on the same mailbox, and the wakeup SGI
> > wakes all offline CPUs at once. Hold them in a pen and release them one
> > at a time.
> >
> > Signed-off-by: Ho Jie Feng <hjf3108@xxxxxxxxx>
> > ---
> > arch/arm/mach-bcm/Makefile | 1 +
> > arch/arm/mach-bcm/bcmbca_headsmp.S | 26 +++++++++++++++++
> > arch/arm/mach-bcm/bcmbca_smp.h | 9 ++++++
> > arch/arm/mach-bcm/board_bcmbca.c | 46 ++++++++++++++++++++++++------
> > 4 files changed, 73 insertions(+), 9 deletions(-)
> > create mode 100644 arch/arm/mach-bcm/bcmbca_headsmp.S
> > create mode 100644 arch/arm/mach-bcm/bcmbca_smp.h
> >
> > diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
> > index fcc4e0174a..c3cd2959bc 100644
> > --- a/arch/arm/mach-bcm/Makefile
> > +++ b/arch/arm/mach-bcm/Makefile
> > @@ -60,4 +60,5 @@ endif
> > ifeq ($(CONFIG_ARCH_BCMBCA),y)
> > obj-y += board_bcmbca.o
> > obj-$(CONFIG_SMP) += bcm63xx_smp.o bcm63xx_pmb.o
> > +obj-$(CONFIG_SMP) += bcmbca_headsmp.o
> > endif
> > diff --git a/arch/arm/mach-bcm/bcmbca_headsmp.S b/arch/arm/mach-bcm/bcmbca_headsmp.S
> > new file mode 100644
> > index 0000000000..3d0d0d97be
> > --- /dev/null
> > +++ b/arch/arm/mach-bcm/bcmbca_headsmp.S
> > @@ -0,0 +1,26 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +/*
> > + * All CPUs will wake up on an SGI. Wait in the holding pen until
> > + * bcmbca_cpu_release matches the MPIDR.
> > + *
> > + * Based on arch/arm/mach-versatile/headsmp.S
> > + */
> > +#include <linux/linkage.h>
> > +#include <asm/assembler.h>
> > +
> > + .arm
> > +ENTRY(bcmbca_secondary_startup)
> > + ARM_BE8(setend be)
> > + THUMB( badr r9, 1f )
> > + THUMB( bx r9 )
> > + THUMB( .thumb )
> > + THUMB(1: )
> > + mrc p15, 0, r0, c0, c0, 5
> > + bic r0, #0xff000000
> > + adr_l r6, bcmbca_cpu_release
> > +pen: ldr r7, [r6]
> > + cmp r7, r0
> > + bne pen
> > +
> It is better to invalidate the L1 cache for the secondary cpus
> regardless of whether the bl does that or not.

If I'm not wrong, this will eventually end up in __v7_ca7mp_setup
which calls do_invalidate_l1?
https://elixir.bootlin.com/linux/v7.4-rc1/source/arch/arm/mm/proc-v7.S#L301

Best regards,
Jie Feng