forked from M-Labs/nix-servo
Compare commits
2 Commits
b7578e175a
...
e149095e81
Author | SHA1 | Date |
---|---|---|
Florian Agbuya | e149095e81 | |
Florian Agbuya | f06638a39a |
|
@ -22,8 +22,8 @@ MAP_SIZE = 0x1000
|
|||
MAP_MASK = 0xFFF
|
||||
PAGESIZE = 0x1000
|
||||
|
||||
LINIEN_OFFSET = 0x0
|
||||
# LINIEN_OFFSET = 0x300000
|
||||
# LINIEN_OFFSET = 0x0
|
||||
LINIEN_OFFSET = 0x300000
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# FRONT PANEL LEDS REGISTER ADDRESSES
|
||||
|
|
29
flake.nix
29
flake.nix
|
@ -180,6 +180,28 @@
|
|||
'';
|
||||
};
|
||||
|
||||
fast-servo-config = { config, pkgs, lib, ... }: {
|
||||
environment.systemPackages = [
|
||||
linien-server
|
||||
(pkgs.python3.withPackages(ps: [ ps.spidev ps.smbus2 ]))
|
||||
];
|
||||
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
|
||||
|
||||
# Run device init scripts
|
||||
mkdir -p /opt/pyfastservo
|
||||
cp ${./fast-servo/pyfastservo}/* /opt/pyfastservo
|
||||
python3 /opt/pyfastservo/initialize.py
|
||||
'';
|
||||
};
|
||||
|
||||
mkbootimage = pkgs.stdenv.mkDerivation {
|
||||
pname = "mkbootimage";
|
||||
version = "2.3dev";
|
||||
|
@ -208,10 +230,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;
|
||||
});
|
||||
|
@ -387,7 +406,7 @@
|
|||
BASE=$(realpath $(dirname $0))
|
||||
|
||||
qemu-img convert -O qcow2 -f raw -o preallocation=metadata $BASE/sd-image.img $IMGDIR/sd-sparse.qcow2
|
||||
qemu-img create -F qcow2 -f qcow2 -b $IMGDIR/sd-sparse.qcow2 $IMGDIR/sd-overlay.qcow2 1G
|
||||
qemu-img create -F qcow2 -f qcow2 -b $IMGDIR/sd-sparse.qcow2 $IMGDIR/sd-overlay.qcow2 2G
|
||||
|
||||
# Some command arguments are based from samples in Xilinx QEMU User Documentation
|
||||
# See: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/821854273/Running+Bare+Metal+Applications+on+QEMU
|
||||
|
|
Loading…
Reference in New Issue