scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Add support for Raspberry Pi 4 in device tree mode

Open markafarrell opened this issue 7 months ago • 2 comments

Add support for Raspberry Pi 4 in device tree mode

Add support for running flatcar on Raspberry Pi 4 in device tree mode

Fixes 1750

How to use

  1. Follow instructions as per https://www.flatcar.org/docs/latest/installing/bare-metal/raspberry-pi/
  2. Enable device tree mode in UEFI
virt-fw-vars \
    --input RPI_EFI.fd \
    --output RPI_EFI.fd \
    --set-json <(cat <<EOF
{
    "version": 2,
    "variables": [
        {
            "name": "RamLimitTo3GB",
            "guid": "cd7cc258-31db-22e6-9f22-63b0b8eed6b5",
            "data": "00000000"
        },
        {
            "name": "SystemTableMode",
            "guid": "cd7cc258-31db-22e6-9f22-63b0b8eed6b5",
            "data": "01000000"
        }
    ]
}
EOF
)
  1. Add pcie-32bit-dma overlay
curl -L \
    https://github.com/raspberrypi/firmware/raw/refs/heads/master/boot/overlays/pcie-32bit-dma.dtbo \
    --output /tmp/efipartition/overlays/pcie-32bit-dma.dtbo
echo "dtoverlay=pcie-32bit-dma" >> config.txt
  1. Add rpi-poe overlay
curl -L \
    https://github.com/raspberrypi/firmware/raw/refs/heads/master/boot/overlays/rpi-poe.dtbo \
    --output /tmp/efipartition/overlays/rpi-poe.dtbo
echo "dtoverlay=rpi-poe >> config.txt
  1. Set acpi=off kernel parameter in butane configuration
kernel_arguments:
  should_exist:
<snip>
    - acpi=off

Testing done

[Describe the testing you have done before submitting this PR. Please include both the commands you issued as well as the output you got.]

  • [ ] Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • [ ] Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

markafarrell avatar May 20 '25 00:05 markafarrell

Thank you for this. I'm not overly familiar with the Pi's DT overlays, but the changes look reasonable. I need to run this in CI to see what kind of impact this has on the kernel image size. We're extremely tight on space for the time being, but I'm working to resolve that. We've also had some issues with GHA, so I'm running this on our internal CI instead. I've rebased it so that we can see the change against 6.12.29.

chewi avatar May 22 '25 17:05 chewi