Skip to content

Add Raspberry Pi Compute Module 5 (BCM2712) target - #1005

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:cm5_bcm2712
Open

dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:cm5_bcm2712

Conversation

@dgarske

@dgarske dgarske commented Nov 25, 2026

Copy link
Copy Markdown
Member

Adds TARGET=cm5 for the Raspberry Pi Compute Module 5 (BCM2712, Cortex-A76) with the same feature set as the CM4 port: signed RAM boot, eMMC A/B disk boot, Linux FIT boot, RAUC A/B and FIPS 140-3.

What it adds

  • hal/cm5.c, hal/cm5.h, hal/cm5.ld, hal/cm5.its - HAL (debug PL011, 40-bit identity MMU, watchdog, optional RAM log ring), linker script and FIT source
  • config/examples/cm5.config, cm5_emmc.config, cm5_emmc_linux.config, cm5_emmc_rauc.config
  • test-app/app_cm5.c, tools/unit-tests/unit-cm5-sdhci.c, six CI build jobs, a CM5 section in docs/Targets.md

Touches shared code

  • hal/rpi_common.c, hal/rpi_common.h - the SoC-independent Raspberry Pi code moved out of hal/cm4.c unchanged (firmware DTB capture and bootargs, RAUC slot arbiter, FIPS heap and RNG200 seed, SDHCI glue, timer). The CM4 keeps its CM4_* option names, mapped in hal/cm4.h.
  • src/boot_aarch64_start.S - the CM4 startup path also serves TARGET_cm5; cm4_fw_dtb is now rpi_fw_dtb.
  • src/sdhci.c - two opt-in options, both off for existing targets. SDHCI_TC_OVER_DATA_TIMEOUT treats Transfer Complete with Data Timeout Error as a completed transfer, as the SDHCI specification defines, and waits for DAT0 before the next command. SDHCI_WRITE_SINGLE_BLOCK issues one CMD24 per block. The BCM2712 controller raises Data Timeout Error at the write CRC status with polled PIO, which stops a multi-block write. Covered by unit-sdhci-write-tc-timeout.

Testing

Validated on a CM5 (4 GB, eMMC) on the CM5 IO board: signed RAM boot and refusal of a corrupted image, eMMC A/B version selection, rollback refusal and failover, Linux 6.18 FIT boot, RAUC slot order, try-counter writeback and failover, and a sealed FIPS 140-3 boot. The console was read from the RAM log ring (CM5_LOG_RING); output on the physical debug UART has not been checked yet.

CM4 regression on hardware with cm4_emmc_rauc.config: verified FIT boot into Linux through RAUC slot A.

CM5 Lite (microSD) and SDMA transfers are not validated. Multi-block eMMC writes on the BCM2712 controller are not supported; the cause of the late CRC status is not understood.

@dgarske dgarske self-assigned this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant