1
0
Fork 0

configure loading of bitstream at boot time

This commit is contained in:
Florian Agbuya 2024-04-04 17:05:20 +08:00
parent 0ff299aa55
commit f06638a39a
1 changed files with 17 additions and 4 deletions

View File

@ -180,6 +180,22 @@
'';
};
fast-servo-config = { 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
'';
};
mkbootimage = pkgs.stdenv.mkDerivation {
pname = "mkbootimage";
version = "2.3dev";
@ -208,10 +224,7 @@
inherit nixpkgs;
extraModules = [
"${patched-not-os}/zynq_image.nix"
] ++ pkgs.lib.optionals (board == "fast-servo") [
({ config, pkgs, ... }: {
environment.systemPackages = [ linien-server ];
})];
] ++ pkgs.lib.optionals (board == "fast-servo") [ fast-servo-config ];
system = "x86_64-linux";
inherit crossSystem;
});