Skip to content

arch/arm32: restore the 32-bit Raspberry Pi 4 platform - #307

Merged
daniel-rossier merged 1 commit into
mainfrom
feat/rpi4-32bit-platform
Jul 17, 2026
Merged

arch/arm32: restore the 32-bit Raspberry Pi 4 platform#307
daniel-rossier merged 1 commit into
mainfrom
feat/rpi4-32bit-platform

Conversation

@daniel-rossier

@daniel-rossier daniel-rossier commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Why

The 32-bit rpi4 platform was dropped when the tree moved to rpi4_64 — arch/arm32/Kconfig now only carries VIRT32. But the tree is still written for it:

kernel/Kconfig:48          depends on SMP && (RPI4 || RPI4_64)
devices/serial/Kconfig:12  depends on RPI4 || RPI4_64
devices/i2c/Kconfig:5      depends on RPI4 || RPI4_64     (e09572557)
devices/rpisense/Kconfig:3 depends on RPI4 || RPI4_64     (e09572557)

Those || RPI4 clauses have been pointing at a symbol that does not exist. Only the arch symbol and its wiring were missing.

What

  • config RPI4 in arch/arm32/Kconfig (select GIC_V2, as VIRT32 and RPI4_64 do)
  • TARGET = rpi4 in the top Makefile, dtb-$(CONFIG_RPI4) in dts/Makefile
  • arch/arm32/rpi4/Makefile, platsmp.c, mach/io.h. Unlike arm64, which releases the secondaries through the spin table, the 32-bit path wakes them by writing the entry point into mailbox 3 of the ARM local interrupt controller — hence LOCAL_INTC_PHYS, which the arm64 mach/io.h does not need.
  • dts/rpi4.dts and configs/rpi4_defconfig, mirroring their rpi4_64 counterparts with the 32-bit values:
rpi4 (arm32) rpi4_64 (arm64)
address/size cells 1 2
KERNEL_VADDR 0xc0000000 0xffff800000000000
IO_MAPPING_BASE 0xe0000000 0xffff900000000000
memory base 0x01000000 0x01000000
FIT load / text offset 0x01008000 / 0x8000 0x01080000 / 0x80000

Notes

  • The mini UART node carries its AUX interrupt (SPI 93, the value Broadcom's bcm2711-rpi-4-b.dtb gives for /soc/serial@7e215040). bcm283x_mu.c never reads "interrupts" today, so it is inert — it is simply what the hardware has, and it lines the node up with what rpi4: make Ctrl-C work on the mini UART console #304 does for rpi4_64.
  • i2c1 and rpisense are status = "disabled" and CONFIG_I2C is off, exactly as in the rpi4_64 pair — enabling them is a board-specific choice, since they are CORE drivers and would probe a Sense HAT that may not be fitted.
  • U-Boot needs nothing: rpi_4_32b_defconfig and the shared uEnv bootcmd in include/configs/rpi.h were already in the patch set, left over from when the platform existed.

Test

Booted on a real RPi 4 Model B: U-Boot 2022.04 (armv7) loads rpi4.itb and SO3 reaches user space. The 64-bit chain is unaffected — both were rebuilt and booted from the same card.

The 32-bit rpi4 platform was dropped when the tree moved to rpi4_64: arm32 now
only carries VIRT32. What was left behind is a set of "depends on RPI4" in
devices/ pointing at a symbol that no longer exists — kernel/Kconfig and
devices/serial/Kconfig still spell "RPI4 || RPI4_64", and i2c/rpisense were
lined up the same way in e095725. So the tree is already written for this
platform; only the arch symbol and its wiring were missing.

Restore them:

  - config RPI4 in arch/arm32/Kconfig (select GIC_V2, as VIRT32 and RPI4_64 do)
  - TARGET = rpi4 in the top Makefile, dtb-$(CONFIG_RPI4) in dts/Makefile
  - arch/arm32/rpi4/: Makefile, platsmp.c and mach/io.h. Unlike arm64, which
    releases the secondaries through the spin table, the 32-bit path wakes them
    by writing the entry point into mailbox 3 of the ARM local interrupt
    controller — hence LOCAL_INTC_PHYS, which the arm64 mach/io.h does not need.
  - dts/rpi4.dts and configs/rpi4_defconfig, mirroring their rpi4_64
    counterparts with the 32-bit values: one address/size cell instead of two,
    KERNEL_VADDR 0xc0000000, IO_MAPPING_BASE 0xe0000000, and a memory base of
    0x01000000 (= the 0x01008000 FIT load minus the arm32 0x8000 text offset,
    where the 64-bit chain uses 0x01080000 / 0x80000).

The mini UART node carries its AUX interrupt (SPI 93, the value Broadcom's
bcm2711-rpi-4-b.dtb gives for /soc/serial@7e215040). The driver does not read
"interrupts" today, so it is inert; it is simply what the hardware has.

Booted on a real RPi 4 Model B: U-Boot (armv7) loads the FIT image and SO3
reaches user space.
@daniel-rossier
daniel-rossier merged commit df911d9 into main Jul 17, 2026
6 checks passed
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