diff --git a/flake.nix b/flake.nix index 3d0229b..72cad64 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,8 @@ buildInputs = with pkgs; [ qemu ]; # Here we tell the run script where to find the system NIXOS_SYSTEM_TOPLEVEL = toplevel; - OPENSBI = syspkgs.opensbi; + OPENSBI = syspkgs.opensbi-uboot; + #OPENSBI = syspkgs.opensbi; }; }; } diff --git a/overlay.nix b/overlay.nix index fba77b1..54b05ab 100644 --- a/overlay.nix +++ b/overlay.nix @@ -20,4 +20,19 @@ final: prev: }); qemu = prev.qemu.override { rutabagaSupport = false; }; + + uboot-custom = prev.ubootQemuRiscv64Smode.override { + extraConfig = '' + CONFIG_CMD_QFW=y + ''; + }; + + opensbi-uboot = prev.opensbi.overrideAttrs (old: { + makeFlags = old.makeFlags ++ [ + # Build OpenSBI without compressed instructions + "PLATFORM_RISCV_ISA=rv64gv" + # Check with: riscv64-unknown-elf-objdump -d -M no-aliases rotate + "FW_PAYLOAD_PATH=${final.uboot-custom}/u-boot.bin" + ]; + }); }