bootpart-u-boot-rpi-aarch64: cleanup

didn't try booting this; not super educated on all the different components here
This commit is contained in:
2025-06-22 09:24:09 +00:00
parent 4dc007460d
commit e2b432f759
3 changed files with 21 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
# MAME arcade cabinet # MAME arcade cabinet
# Raspberry Pi 400: # Raspberry Pi 400:
# - quad-core Cortex-A72 @ 1.8 GHz (ARMv8-A 64) # - quad-core Cortex-A72 @ 1.8 GHz (ARMv8-A 64; BCM2711)
# - 4GiB RAM # - 4GiB RAM
{ ... }: { ... }:
{ {

View File

@@ -1,10 +1,11 @@
{ stdenv {
, ubootRaspberryPi4_64bit stdenv,
, raspberrypifw ubootRaspberryPi4_64bit,
, raspberrypi-armstubs raspberrypifw,
raspberrypi-armstubs,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation {
pname = "bootpart-u-boot-rpi-aarch64"; pname = "bootpart-u-boot-rpi-aarch64";
version = "1"; version = "1";
@@ -12,11 +13,8 @@ stdenv.mkDerivation rec {
ubootRaspberryPi4_64bit ubootRaspberryPi4_64bit
raspberrypifw # for bootcode.bin, *.dat, *.elf, *.dtb raspberrypifw # for bootcode.bin, *.dat, *.elf, *.dtb
raspberrypi-armstubs # for armstub* raspberrypi-armstubs # for armstub*
]; ];
src = ./config.txt;
dontUnpack = true; dontUnpack = true;
installPhase = '' installPhase = ''
@@ -31,10 +29,9 @@ stdenv.mkDerivation rec {
cp -R ${raspberrypifw}/share/raspberrypi/boot/*.elf "$out"/ cp -R ${raspberrypifw}/share/raspberrypi/boot/*.elf "$out"/
cp -R ${raspberrypifw}/share/raspberrypi/boot/overlays "$out"/ cp -R ${raspberrypifw}/share/raspberrypi/boot/overlays "$out"/
cp ${raspberrypi-armstubs}/* "$out"/ cp ${raspberrypi-armstubs}/* "$out"/
cp ${src} "$out"/config.txt cp ${./config.txt} "$out"/config.txt
''; '';
meta = { meta = {
description = "unmanaged files to place in /boot on a raspberry pi system"; description = "unmanaged files to place in /boot on a raspberry pi system";
platforms = [ "aarch64-linux" ]; platforms = [ "aarch64-linux" ];

View File

@@ -1,18 +1,20 @@
{ buildUBoot, fetchurl }: # N.B.: this package will likely boot all of these Raspberry Pi variants:
# - rpi 4
# - rpi 400
# - rpi cm4 (Compute Module 4)
# all variants share the same BCM2711 chipset (4x Cortex-A72).
# no other models use that chipset.
#
# this package is probably *not* enough to boot rpi on its own.
# i believe the process is for a rpi-specific firmware file to be placed in /boot,
# which then trampolines into u-boot (this package),
# which then boots the NixOS kernel.
{ buildUBoot }:
(buildUBoot { (buildUBoot {
# nixos-22.05 is on 2022.01 at time of writing, which lacks rpi-4 dtb.
# TODO: remove this version/src override once upstream bumps u-boot version.
version = "2022.04";
src = fetchurl {
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2022.04.tar.bz2";
hash = "sha256-aOBlQTkmd44nbsOr0ouzL6gquqSmiY1XDB9I+9sIvNA=";
};
defconfig = "rpi_4_defconfig"; defconfig = "rpi_4_defconfig";
extraMeta.platforms = [ "aarch64-linux" ]; extraMeta.platforms = [ "aarch64-linux" ];
extraConfig = '' extraConfig = ''
# TODO: this can be removed in 2022.04
CONFIG_DEFAULT_DEVICE_TREE="bcm2711-rpi-4-b"
# enable some builtin commands to aid in debugging, while we're here # enable some builtin commands to aid in debugging, while we're here
CONFIG_CMD_CONFIG=y CONFIG_CMD_CONFIG=y
CONFIG_CMD_EFIDEBUG=y CONFIG_CMD_EFIDEBUG=y
@@ -33,7 +35,7 @@
''; '';
extraPatches = [ extraPatches = [
# enable booting from > 2 TiB drives # enable booting from > 2 TiB drives
./01-skip-lba-check.patch # ./01-skip-lba-check.patch
# ./03-verbose-log.patch # ./03-verbose-log.patch
]; ];
}) })