Skip to contentSkip to conversation

ARM: bcm: support more than two CPUs on BCMBCA

PATCH New Ho Jie Feng 1 participant 3 messages Nov 23

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover ARM: bcm: support more than two CPUs on BCMBCA

This series extends BCMBCA SMP bring-up to SoCs with more than two cores, such as:
- triple-core BCM63178/BCM6855
- quad-core BCM47622/BCM6755

Tested on BCM6755, a quad-core Cortex-A7 BCMBCA SoC.

Ho Jie Feng (2):
dt-bindings: arm: cpus: Require cpu-release-addr on bca-smp
secondaries
ARM: bcm: support more than two CPUs on BCMBCA

 .../devicetree/bindings/arm/cpus.yaml         |  6 +--
 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 +++++++++++++++----
 5 files changed, 76 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/mach-bcm/bcmbca_headsmp.S
 create mode 100644 arch/arm/mach-bcm/bcmbca_smp.h

base-commit: 21f8531821461fa0c05e4605c01d8d56d28b514e

Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/2 dt-bindings: arm: cpus: Require cpu-release-addr on bca-smp secondaries

On BCMBCA SoCs with more than two cores, CFE parks all secondary CPUs on the same mailbox. Extend the brcm,bca-smp schema requirement so cpu-release-addr is required on all secondary CPUs, not just CPU1.

---
 Documentation/devicetree/bindings/arm/cpus.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/arm/cpus.yaml +3 -3
index b83c7785f6..0b7dbc75ae 100644
@@ -492,15 +492,15 @@ allOf:
           $ref: /schemas/types.yaml#/definitions/uint32
           description:
             Physical address of the 32-bit MMIO mailbox read by CFE after
-            a wakeup interrupt. Required on CPU1, which CFE leaves in
-            a holding pen. The kernel writes the ARM-state entry address
+            a wakeup interrupt. Required on secondary CPUs, which CFE leaves
+            in a holding pen. The kernel writes the ARM-state entry address
             before sending the interrupt. CPU0 is already running.
       if:
         properties:
           reg:
             items:
               - items:
-                  - const: 1
+                  - minimum: 1
       then:
         required:
           - cpu-release-addr
Signature · 1 line
2.53.0
#2 lore raw

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

In reply to Ho Jie Feng

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.

---
 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
arch/arm/mach-bcm/Makefile +1 -0
index fcc4e0174a..c3cd2959bc 100644
@@ -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
arch/arm/mach-bcm/bcmbca_headsmp.S new file +26 -0
new file mode 100644
index 0000000000..3d0d0d97be
@@ -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
+
+	b	secondary_startup
+ENDPROC(bcmbca_secondary_startup)
arch/arm/mach-bcm/bcmbca_smp.h new file +9 -0
new file mode 100644
index 0000000000..30055cf766
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __BCMBCA_SMP_H
+#define __BCMBCA_SMP_H
+
+extern int bcmbca_cpu_release;
+
+void bcmbca_secondary_startup(void);
+
+#endif /* __BCMBCA_SMP_H */
arch/arm/mach-bcm/board_bcmbca.c +37 -9

84 lines not on this page · raw message

Signature · 1 line
2.53.0