1
0
Fork 0

configure loading of bitstream at boot time

This commit is contained in:
Florian Agbuya 2024-03-21 18:33:23 +08:00
parent bb61f0f9eb
commit bda5ec0523
1 changed files with 15 additions and 1 deletions

View File

@ -116,6 +116,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
'';
});
gnu-platform = "arm-none-eabi";
binutils-pkg = { zlib, extraConfigureFlags ? [] }: pkgs.stdenv.mkDerivation rec {
@ -295,7 +308,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";
});