Skip to contentSkip to conversation

ARM: bcm: Enable CFE SMP on BCMBCA

PATCH Applied Linus Walleij 4 participants 10 messages Nov 5 – Nov 10

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

v5 cover ARM: bcm: Enable CFE SMP on BCMBCA

When booted through CFE and mainline U-Boot, the XG6846B has no PSCI provider. CFE powers up CPU1 and leaves it waiting in a holding pen.

Add a BCMBCA CFE SMP method selected by enable-method = "brcm,bca-smp". It uses a GPIO mailbox and a wakeup IPI, with PSCI retaining priority. On the XG6846B, preserve the holding pen and disable the board's inherited PSCI setup.
Tested on the XG6846B with both CPUs coming online.

These patches were authored with the assistance of an LLM.

---
Changes in v5:
- Rebased on v7.4-rc1
- Revert to the earlier CPU1-only release address after review, keeping cpu-release-addr required for CPU1 in the binding.
- Link to v4: https://patch.msgid.link/20261025-genexis-xg6846-smp-v7-3-rc1-v4-0-b352ab54f46b@kernel.org

Changes in v4:
- Require cpu-release-addr for brcm,bca-smp and provide a dummy release
address for CPU0, which is already online.
- Link to v3: https://patch.msgid.link/20261021-genexis-xg6846-smp-v7-3-rc1-v3-0-7c871f1755db@kernel.org

Changes in v3:
- Use BCMBCA naming for the CFE SMP implementation.
- Add the brcm,bca-smp binding and select CFE SMP through the CPU
enable-method, retaining PSCI priority.
- Squash the holding-pen reservation fix into the CFE bring-up DTS patch.
- Boot tested successfully on the XG6846B.
- Link to v2: https://patch.msgid.link/20261017-genexis-xg6846-smp-v7-3-rc1-v2-0-bf6b4b374b6e@kernel.org

Changes in v2:
- Read the CFE mailbox address from CPU1's cpu-release-addr property,
as suggested by William Zhang.
- Link to v1: https://patch.msgid.link/20261012-genexis-xg6846-smp-v7-3-rc1-v1-0-a51d4afde4a7@kernel.org

---
Linus Walleij (3):
dt-bindings: arm: cpus: Add brcm,bca-smp enable method
ARM: bcm: Add CFE SMP support for BCMBCA
ARM: dts: broadcom: Use CFE CPU bring-up on the XG6846B

 Documentation/devicetree/bindings/arm/cpus.yaml    | 46 ++++++++++++++++++
 .../boot/dts/broadcom/bcm6846-genexis-xg6846b.dts  | 16 ++++++-
 arch/arm/mach-bcm/Makefile                         |  2 +-
 arch/arm/mach-bcm/board_bcmbca.c                   | 56 ++++++++++++++++++++++
 4 files changed, 118 insertions(+), 2 deletions(-)

---
base-commit: ae43fb24a3dda77622157d3574d1ff71aaad20a5
change-id: 20261011-genexis-xg6846-smp-v7-3-rc1-b470f0e20475

Best regards,

Signature · 1 line
Linus Walleij <[email protected]>
#1 lore raw

PATCH v5 1/3 dt-bindings: arm: cpus: Add brcm,bca-smp enable method

BCMBCA systems booted through CFE can release a secondary CPU by writing its ARM-state entry address to a 32-bit MMIO mailbox and sending a wakeup interrupt.

Document brcm,bca-smp and its single-cell cpu-release-addr property. Require the mailbox address on CPU1, which CFE leaves in a holding pen. CPU0 is already running and does not need a release address. Add a Cortex-A7 example with the mailbox address only on CPU1.

---
 Documentation/devicetree/bindings/arm/cpus.yaml | 46 +++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
Documentation/devicetree/bindings/arm/cpus.yaml +46 -0
index 96136b70dacd..b83c7785f656 100644
@@ -263,6 +263,7 @@ properties:
           - amlogic,meson8b-smp
           - arm,realview-smp
           - aspeed,ast2600-smp
+          - brcm,bca-smp
           - brcm,bcm11351-cpu-method
           - brcm,bcm23550
           - brcm,bcm2836-smp
@@ -479,6 +480,30 @@ allOf:
     then:
       required:
         - secondary-boot-reg
+  - if:
+      properties:
+        enable-method:
+          const: brcm,bca-smp
+      required:
+        - enable-method
+    then:
+      properties:
+        cpu-release-addr:
+          $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
+            before sending the interrupt. CPU0 is already running.
+      if:
+        properties:
+          reg:
+            items:
+              - items:
+                  - const: 1
+      then:
+        required:
+          - cpu-release-addr
   - if:
       properties:
         enable-method:
@@ -720,4 +745,25 @@ examples:
         cpu-release-addr = <0 0x20000000>;
       };
     };
+  - |
+    // Example 5 (Broadcom BCMBCA with CFE):
+    cpus {
+      #size-cells = <0>;
+      #address-cells = <1>;
+
+      cpu@0 {
+        device_type = "cpu";
+        compatible = "arm,cortex-a7";
+        reg = <0>;
+        enable-method = "brcm,bca-smp";
+      };
+
+      cpu@1 {
+        device_type = "cpu";
+        compatible = "arm,cortex-a7";
+        reg = <1>;
+        enable-method = "brcm,bca-smp";
+        cpu-release-addr = <0xff800568>;
+      };
+    };
 ...
Signature · 1 line
2.56.0
maintainer Reviewed-by on v5 1/3
#2 lore raw

Re: [PATCH v5 1/3] dt-bindings: arm: cpus: Add brcm,bca-smp enable method

Quoted 9 lines · Linus Walleij

BCMBCA systems booted through CFE can release a secondary CPU by writing its ARM-state entry address to a 32-bit MMIO mailbox and sending a wakeup interrupt.

Document brcm,bca-smp and its single-cell cpu-release-addr property. Require the mailbox address on CPU1, which CFE leaves in a holding pen. CPU0 is already running and does not need a release address. Add a Cortex-A7 example with the mailbox address only on CPU1.

Quoted 7 lines
---
 Documentation/devicetree/bindings/arm/cpus.yaml | 46 +++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
maintainer Applied
#3 lore raw

Re: [PATCH v5 1/3] dt-bindings: arm: cpus: Add brcm,bca-smp enable method

In reply to Linus Walleij

From: Florian Fainelli <[email protected]>

Quoted 9 lines · Linus Walleij

BCMBCA systems booted through CFE can release a secondary CPU by writing its ARM-state entry address to a 32-bit MMIO mailbox and sending a wakeup interrupt.

Document brcm,bca-smp and its single-cell cpu-release-addr property. Require the mailbox address on CPU1, which CFE leaves in a holding pen. CPU0 is already running and does not need a release address. Add a Cortex-A7 example with the mailbox address only on CPU1.

Quoted 4 lines

---

Applied to https://github.com/Broadcom/stblinux/commits/soc/next, thanks! --
Florian

#4 lore raw

PATCH v5 2/3 ARM: bcm: Add CFE SMP support for BCMBCA

In reply to Linus Walleij

The XG6846B CFE bootloader powers up CPU1 and leaves it in a holding pen waiting for an interrupt. After waking, the stub reads the GPIO GeneralPurpose register at 0xff800568 and branches to the stored address in ARM state. The vendor kernel uses this mailbox and a wakeup IPI.

Implement the brcm,bca-smp CPU enable-method for BCMBCA systems booted through CFE.
Read the mailbox address from the secondary CPU's cpu-release-addr property. Map it as device memory, write secondary_startup_arm and complete the write before sending the wakeup IPI. CPU1 is already running, so no power or reset sequence is needed. Using the ARM entry also supports kernels built in Thumb-2 mode. Clear any Thumb function pointer tag before programming this ARM entry address.

Register the operations with CPU_METHOD_OF_DECLARE() so the CPU nodes select CFE bring-up explicitly. Build the BCMBCA machine description independently of DEBUG_BCMBCA, keeping the debug UART mapping conditional. The generic ARM startup code retains PSCI priority.

---
 arch/arm/mach-bcm/Makefile       |  2 +-
 arch/arm/mach-bcm/board_bcmbca.c | 56 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 1 deletion(-)
arch/arm/mach-bcm/Makefile +1 -1
index 6baedf4c6304..fcc4e0174adc 100644
@@ -58,6 +58,6 @@ endif
 
 # BCMBCA
 ifeq ($(CONFIG_ARCH_BCMBCA),y)
-obj-$(CONFIG_DEBUG_BCMBCA)	+= board_bcmbca.o
+obj-y				+= board_bcmbca.o
 obj-$(CONFIG_SMP)		+= bcm63xx_smp.o bcm63xx_pmb.o
 endif
arch/arm/mach-bcm/board_bcmbca.c +56 -0

77 lines not on this page · raw message

Signature · 1 line
2.56.0
maintainer Applied
#5 lore raw

Re: [PATCH v5 2/3] ARM: bcm: Add CFE SMP support for BCMBCA

From: Florian Fainelli <[email protected]>

Quoted 19 lines · Linus Walleij

The XG6846B CFE bootloader powers up CPU1 and leaves it in a holding pen waiting for an interrupt. After waking, the stub reads the GPIO GeneralPurpose register at 0xff800568 and branches to the stored address in ARM state. The vendor kernel uses this mailbox and a wakeup IPI.

Implement the brcm,bca-smp CPU enable-method for BCMBCA systems booted through CFE.
Read the mailbox address from the secondary CPU's cpu-release-addr property. Map it as device memory, write secondary_startup_arm and complete the write before sending the wakeup IPI. CPU1 is already running, so no power or reset sequence is needed. Using the ARM entry also supports kernels built in Thumb-2 mode. Clear any Thumb function pointer tag before programming this ARM entry address.

Register the operations with CPU_METHOD_OF_DECLARE() so the CPU nodes select CFE bring-up explicitly. Build the BCMBCA machine description independently of DEBUG_BCMBCA, keeping the debug UART mapping conditional. The generic ARM startup code retains PSCI priority.

Quoted 4 lines

---

Applied to https://github.com/Broadcom/stblinux/commits/soc/next, thanks! --
Florian

#6 lore raw

PATCH v5 3/3 ARM: dts: broadcom: Use CFE CPU bring-up on the XG6846B

In reply to Linus Walleij

The XG6846B boots through CFE, which parks CPU1 in a holding pen and does not provide PSCI. Starting Linux from CFE does not install a PSCI implementation either. The working PSCI interface in newer GenXOS firmware belongs to a different boot stack.

Disable the inherited PSCI node on this board so Linux does not issue SMCs to an interface that is absent. Set the CPUs' enable-method to brcm,bca-smp to select the BCMBCA CFE SMP operations. Describe the CFE mailbox only in CPU1's cpu-release-addr property, since CPU0 is already running. Keep both CPU nodes enabled and leave the SoC's PSCI defaults available to other boards.

Also remove no-map from the secondary-boot reservation. Its overlap with ARM's initial page tables otherwise causes the reservation to be rejected, leaving CFE's holding pen unprotected.

---
 arch/arm/boot/dts/broadcom/bcm6846-genexis-xg6846b.dts | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
arch/arm/boot/dts/broadcom/bcm6846-genexis-xg6846b.dts +15 -1
index a3616fb7b3a8..45d4df523110 100644
@@ -34,7 +34,7 @@ reserved-memory {
 		ranges;
 
 		secondary-boot@0 {
-			no-map;
+			/* Includes the kernel's initial page tables. */
 			reg = <0x00000000 0x00008000>;
 		};
 		pmc3-firmware@8000 {
@@ -56,6 +56,20 @@ button-restart {
 	};
 };
 
+/* CFE parks CPU1 in its holding pen and does not provide PSCI. */
+&{/psci} {
+	status = "disabled";
+};
+
+&CA7_0 {
+	enable-method = "brcm,bca-smp";
+};
+
+&CA7_1 {
+	enable-method = "brcm,bca-smp";
+	cpu-release-addr = <0xff800568>;
+};
+
 &gpio0 {
 	status = "okay";
 };
Signature · 1 line
2.56.0
#7 lore raw

Re: [PATCH v5 3/3] ARM: dts: broadcom: Use CFE CPU bring-up on the XG6846B

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] ARM: dts: broadcom: xg6846b partial no-map removal breaks lowmem setup --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ARM: dts: broadcom: xg6846b partial no-map removal breaks lowmem setup --

commit 59829f1abd4c733fd749211767c1df938a47fd66
Author: Linus Walleij <[email protected]>

ARM: dts: broadcom: Use CFE CPU bring-up on the XG6846B

This commit disables the inherited PSCI node on the XG6846B board and configures the CPUs to use the brcm,bca-smp enable-method with CFE's holding pen release address on CPU1. It also removes no-map from the secondary-boot reserved-memory node so the reservation does not fail when overlapping the kernel's initial page tables.

arch/arm/boot/dts/broadcom/bcm6846-genexis-xg6846b.dts reserved-memory { · line 40

Quoted 13 lines
arch/arm/boot/dts/broadcom/bcm6846-genexis-xg6846b.dts +1 -1
index a3616fb7b3a8d..45d4df5231109 100644
@@ -34,7 +34,7 @@ reserved-memory {
 		ranges;
 
 		secondary-boot@0 {
-			no-map;
+			/* Includes the kernel's initial page tables. */
 			reg = <0x00000000 0x00008000>;
 		};
 		pmc3-firmware@8000 {

[Severity: High]
As reported by Sashiko on v3 [1], does removing no-map from secondary-boot@0 while leaving no-map on the adjacent pmc3-firmware@8000 node cause an early boot crash when booting a multiplatform kernel where TEXT_OFFSET is above 0x00108000 (such as multi_v7_defconfig, where CONFIG_ARCH_BCMBCA=y and CONFIG_ARCH_MESON=y set TEXT_OFFSET to 0x00208000)?

On bcm6846_defconfig (TEXT_OFFSET = 0x00008000), arm_memblock_init() reserves [KERNEL_START, KERNEL_END) starting at physical 0x00008000 before scanning reserved-memory. When early_init_dt_reserve_memory() processes pmc3-firmware@8000 with nomap set, memblock_is_region_reserved(0x8000, 0x100000) is true, so the reservation is rejected with -EBUSY and memblock_mark_nomap() is never called.

However, when TEXT_OFFSET is 0x00208000, the kernel image and initial page tables sit at physical 0x00204000 and above. During early_init_fdt_scan_reserved_mem(), secondary-boot@0 ([0x00000000, 0x00008000)) is reserved without MEMBLOCK_NOMAP, while pmc3-firmware@8000 ([0x00008000, 0x00108000)) does not overlap the kernel reservation and succeeds in calling memblock_mark_nomap(). This leaves [0x00000000, 0x00008000) as the first mappable memblock.memory region ahead of the MEMBLOCK_NOMAP region at [0x00008000, 0x00108000).

In arch/arm/mm/mmu.c:adjust_lowmem_bounds(), the second loop then checks whether the end of that first usable range is aligned to PMD_SIZE:

	for_each_mem_range(i, &block_start, &block_end) {
		if (block_start < lowmem_limit) {
			if (!memblock_limit) {
				if (!IS_ALIGNED(block_start, PMD_SIZE))
					memblock_limit = block_start;
				else if (!IS_ALIGNED(block_end, PMD_SIZE))
					memblock_limit = lowmem_limit;
			}

Because block_end is 0x8000, memblock_limit is set to 0x8000, rounded down to PMD_SIZE (0), and passed to memblock_set_current_limit(0).

Subsequently, in paging_init(), prepare_page_table() computes end from memblock.memory.regions[0]:

	end = memblock.memory.regions[0].base + memblock.memory.regions[0].size;
	if (end >= arm_lowmem_limit)
		end = arm_lowmem_limit;

	for (addr = __phys_to_virt(end);
	     addr < VMALLOC_START; addr += PMD_SIZE)
		pmd_clear(pmd_off_k(addr));

With end == 0x8000, prepare_page_table() clears all kernel PMDs from __phys_to_virt(0x8000) up to VMALLOC_START, unmapping the running kernel, and map_lowmem() then underflows map.length = end - start when advancing start to kernel_sec_end while end remains 0x8000.

[1] https://lore.kernel.org/r/[email protected]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20261105-genexis-xg6846-smp-v7-3-rc1-v5-0-4103df2588d3@kernel.org?part=3
#8 lore raw

Re: [PATCH v5 3/3] ARM: dts: broadcom: Use CFE CPU bring-up on the XG6846B

Quoted 1 line · On Thu, Nov 5, 2026 at 2:55 PM <[email protected]> wrote:

- [High] ARM: dts: broadcom: xg6846b partial no-map removal breaks lowmem setup

Hi parrot-Sashiko.

I have already stated why this is a non-issue.

Yours,
Linus Walleij

maintainer Applied
#9 lore raw

Re: [PATCH v5 3/3] ARM: dts: broadcom: Use CFE CPU bring-up on the XG6846B

In reply to Linus Walleij

From: Florian Fainelli <[email protected]>

Quoted 12 lines · Linus Walleij

The XG6846B boots through CFE, which parks CPU1 in a holding pen and does not provide PSCI. Starting Linux from CFE does not install a PSCI implementation either. The working PSCI interface in newer GenXOS firmware belongs to a different boot stack.

Disable the inherited PSCI node on this board so Linux does not issue SMCs to an interface that is absent. Set the CPUs' enable-method to brcm,bca-smp to select the BCMBCA CFE SMP operations. Describe the CFE mailbox only in CPU1's cpu-release-addr property, since CPU0 is already running. Keep both CPU nodes enabled and leave the SoC's PSCI defaults available to other boards.

Quoted 7 lines

Also remove no-map from the secondary-boot reservation. Its overlap with ARM's initial page tables otherwise causes the reservation to be rejected, leaving CFE's holding pen unprotected.

---

Applied to https://github.com/Broadcom/stblinux/commits/soc/next, thanks! --
Florian