Add bitstream to Nix

This commit is contained in:
Rodrigo Arias 2024-07-08 13:32:29 +02:00
parent 4d246ad00e
commit 1f0ac64631
5 changed files with 34 additions and 0 deletions

View File

@ -832,3 +832,26 @@ Fran has created another bitstream with two consoles enabled
(`ox_u55c_a234c132.bit`), let see if I manage to boot with it. (`ox_u55c_a234c132.bit`), let see if I manage to boot with it.
First I will need to enable the consoles on the DTS. First I will need to enable the consoles on the DTS.
It doesn't seem to produce any output in the UART. I cannot see OpenSBI while
loading it on each baud rate:
Type [C-a] [C-h] to see available commands
Terminal ready
*** baud: 57600 ***
*** baud: 38400 ***
*** baud: 19200 ***
*** baud: 9600 ***
[...]
*** baud: 230400 ***
*** baud: 460800 ***
Let's keep the bitstream files in a repository, so I can carefully track them
with git too.

View File

@ -107,6 +107,7 @@
INITRD = build.initialRamdisk; INITRD = build.initialRamdisk;
ROOTFS = build.sdImage; ROOTFS = build.sdImage;
UBOOT_ENV = syspkgs.uboot-env; UBOOT_ENV = syspkgs.uboot-env;
BITSTREAM = syspkgs.bitstream;
shellHook = '' shellHook = ''
echo "Here are the current system pieces:" echo "Here are the current system pieces:"
echo " TOPLEVEL = $TOPLEVEL" echo " TOPLEVEL = $TOPLEVEL"
@ -115,6 +116,7 @@
echo " INITRD = $INITRD" echo " INITRD = $INITRD"
echo " ROOTFS = $ROOTFS" echo " ROOTFS = $ROOTFS"
echo " UBOOT_ENV = $UBOOT_ENV" echo " UBOOT_ENV = $UBOOT_ENV"
echo " BITSTREAM = $BITSTREAM"
''; '';
}; };

View File

@ -21,6 +21,7 @@ if [ -n "$ROOTFS" ]; then
else else
echo "Skipping rootfs" echo "Skipping rootfs"
fi fi
rsync "$BITSTREAM" "$dst/bitstream.bit"
rsync "$UBOOT_ENV" "$dst/uboot.env" rsync "$UBOOT_ENV" "$dst/uboot.env"
echo "Now go to $dst and run ./boot.sh" echo "Now go to $dst and run ./boot.sh"

View File

@ -177,6 +177,9 @@
nativeBuildInputs = [ prev.buildPackages.dtc ]; nativeBuildInputs = [ prev.buildPackages.dtc ];
} "dtc -O dtb -o $out $dtsFile"; } "dtc -O dtb -o $out $dtsFile";
bitstream = "${final.bitstreams}/lagarto-3-ox/gold.bit";
#bitstream = "${final.bitstreams}/lagarto-3-ox/ox_u55c_a234c132_two_uarts.bit";
uboot = prev.ubootQemuRiscv64Smode.override { uboot = prev.ubootQemuRiscv64Smode.override {
filesToInstall = [ "u-boot.bin" "u-boot-nodtb.bin" ]; filesToInstall = [ "u-boot.bin" "u-boot-nodtb.bin" ];
#version = "2023.07.02-print-cpu-probe"; #version = "2023.07.02-print-cpu-probe";

View File

@ -36,4 +36,9 @@ final: prev:
cp unalign_check $out/bin/ cp unalign_check $out/bin/
''; '';
}; };
bitstreams = builtins.fetchGit {
url = "git@bscpm03.bsc.es:rarias/bitstreams.git";
rev = "57876cea158d8a4a63f7d35d715000092609d88c";
};
} }