Add bitstream loading and run init scripts at boot time #52

Merged
sb10q merged 2 commits from fsagbuya/nix-servo:fast-servo-init into master 2024-04-24 18:03:18 +08:00
Showing only changes of commit e08897acce - Show all commits

View File

@ -209,8 +209,18 @@
extraModules = [
"${patched-not-os}/zynq_image.nix"
] ++ pkgs.lib.optionals (board == "fast-servo") [
({ config, pkgs, ... }: {
({ config, pkgs, lib, ... }: {
environment.systemPackages = [ linien-server ];
boot.postBootCommands = lib.mkAfter ''
# Program the FPGA
set +x
echo "Flashing bitstream..."
echo 0 > /sys/class/fpga_manager/fpga0/flags
mkdir -p /lib/firmware
cp ${fast-servo-gateware}/gateware.bin /lib/firmware/
echo gateware.bin > /sys/class/fpga_manager/fpga0/firmware
'';
})];
system = "x86_64-linux";
inherit crossSystem;