arch/arm32: restore the 32-bit Raspberry Pi 4 platform - #307
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The 32-bit rpi4 platform was dropped when the tree moved to rpi4_64 —
arch/arm32/Kconfignow only carriesVIRT32. But the tree is still written for it:Those
|| RPI4clauses have been pointing at a symbol that does not exist. Only the arch symbol and its wiring were missing.What
config RPI4inarch/arm32/Kconfig(select GIC_V2, asVIRT32andRPI4_64do)TARGET = rpi4in the top Makefile,dtb-$(CONFIG_RPI4)indts/Makefilearch/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 — henceLOCAL_INTC_PHYS, which the arm64mach/io.hdoes not need.dts/rpi4.dtsandconfigs/rpi4_defconfig, mirroring their rpi4_64 counterparts with the 32-bit values:KERNEL_VADDR0xc00000000xffff800000000000IO_MAPPING_BASE0xe00000000xffff9000000000000x010000000x010000000x01008000/0x80000x01080000/0x80000Notes
bcm2711-rpi-4-b.dtbgives for/soc/serial@7e215040).bcm283x_mu.cnever 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.i2c1andrpisensearestatus = "disabled"andCONFIG_I2Cis 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.rpi_4_32b_defconfigand the shared uEnv bootcmd ininclude/configs/rpi.hwere 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.itband SO3 reaches user space. The 64-bit chain is unaffected — both were rebuilt and booted from the same card.