2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-18 01:54:34 +00:00

sd-image: fix raspberry pi 0 boot

Raspberry Pi 0 was stuck at rainbow image on hdmi
output and was not booting.

Both dtbs are needed _and_ the enable_uart=1. Any
of them missing leaves RPI0 stuck at the rainbow
image.
This commit is contained in:
Michal Kazior 2024-11-12 10:46:47 +01:00
parent d40ed47baa
commit b5a3634ea1

View File

@ -17,6 +17,10 @@
sdImage = {
populateFirmwareCommands = let
configTxt = pkgs.writeText "config.txt" ''
# u-boot refuses to start (gets stuck at rainbow polygon) without this,
# at least on Raspberry Pi 0.
enable_uart=1
# Prevent the firmware from smashing the framebuffer setup done by the mainline kernel
# when attempting to show low-voltage or overtemperature warnings.
avoid_warnings=1
@ -28,7 +32,7 @@
kernel=u-boot-rpi1.bin
'';
in ''
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/firmware/)
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf *.dtb $NIX_BUILD_TOP/firmware/)
cp ${pkgs.ubootRaspberryPiZero}/u-boot.bin firmware/u-boot-rpi0.bin
cp ${pkgs.ubootRaspberryPi}/u-boot.bin firmware/u-boot-rpi1.bin
cp ${configTxt} firmware/config.txt