-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: machine -> machine-generic, add machine-cm3 (#8)
Add a custom target for the CM3 image, which requires a custom bootloader, and a hardcoded DTB name.
- Loading branch information
Showing
4 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Machine config, specifically for raspberry cm3 | ||
{ config | ||
, modulesPath | ||
, pkgs | ||
, lib | ||
, ... | ||
}: | ||
|
||
let | ||
ubootRaspberryPiGeneric = pkgs.buildUBoot { | ||
defconfig = "rpi_arm64_defconfig"; | ||
extraMeta.platforms = [ "aarch64-linux" ]; | ||
filesToInstall = [ "u-boot.bin" ]; | ||
}; | ||
|
||
in | ||
{ | ||
imports = [ ./configuration.nix ]; | ||
|
||
sdImage.populateFirmwareCommands = '' | ||
rm firmware/u-boot-rpi3.bin | ||
# Overwrite firmware/u-boot-rpi3.bin with the generic one | ||
cp ${ubootRaspberryPiGeneric}/u-boot.bin firmware/u-boot-rpi3.bin | ||
# Add the .dtb for our board | ||
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2710-rpi-cm3.dtb firmware/ | ||
''; | ||
|
||
# u-boot doesn't know the proper device tree name, so cannot pick from FTDIR | ||
# on its own. | ||
hardware.deviceTree.name = "broadcom/bcm2837-rpi-cm3-io3.dtb"; | ||
} |
This file contains 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
This file contains 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