forked from M-Labs/nix-servo
configure loading of bitstream at boot time
This commit is contained in:
parent
64d83bc50d
commit
7a49e80c5a
16
flake.nix
16
flake.nix
|
@ -130,6 +130,19 @@
|
|||
environment.systemPackages = [ linien-server ];
|
||||
});
|
||||
|
||||
fast-servo-init = ({ config, pkgs, lib, ... }: {
|
||||
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
|
||||
'';
|
||||
});
|
||||
|
||||
fast-servo-gateware = pkgs.stdenv.mkDerivation rec {
|
||||
name = "fast-servo-gateware";
|
||||
inherit (pkgs.python3Packages.linien-common) src;
|
||||
|
@ -195,7 +208,8 @@
|
|||
inherit nixpkgs;
|
||||
extraModules = [
|
||||
"${patched-not-os}/zynq_image.nix"
|
||||
] ++ pkgs.lib.optional (board == "fast-servo") fast-servo-extrapkg;
|
||||
] ++ pkgs.lib.optional (board == "fast-servo") fast-servo-extrapkg
|
||||
++ pkgs.lib.optional (board == "fast-servo") fast-servo-init;
|
||||
system = "x86_64-linux";
|
||||
crossSystem.system = "armv7l-linux";
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue