From 637fba094214ce2e3ea71c1c2e73d1a2ba95bfd1 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 31 Dec 2023 22:43:55 -0500 Subject: [PATCH] starfive visionfive2: use upstream u-boot v2024.01-rc5 --- starfive/visionfive/v2/uboot.nix | 34 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/starfive/visionfive/v2/uboot.nix b/starfive/visionfive/v2/uboot.nix index a149f8b..c9fde3d 100644 --- a/starfive/visionfive/v2/uboot.nix +++ b/starfive/visionfive/v2/uboot.nix @@ -1,20 +1,36 @@ -{ fetchFromGitHub, buildUBoot }: +{ lib +, fetchFromGitHub +, buildUBoot +, buildPackages +, opensbi +}: buildUBoot rec { - version = "5.10.3"; + version = "2024.01-rc5"; src = fetchFromGitHub { - owner = "starfive-tech"; + owner = "u-boot"; repo = "u-boot"; - rev = "refs/tags/JH7110_VF2_6.1_v${version}"; - hash = "sha256-4E/AxPCFCluwJBEf6xGuxAi1hPZK5ZxEs5WlBVVfvYE="; + rev = "refs/tags/v${version}"; + hash = "sha256-QlwgvnSaXh39z9AM7HNF731lRiUkPbN3oQyioQNTYFA="; }; + # workaround for https://github.com/NixOS/nixpkgs/pull/146634 + # uboot: only apply raspberry pi patches to raspberry pi builds + patches = [ ]; + + extraMakeFlags = [ + # workaround for https://github.com/NixOS/nixpkgs/pull/277997 + # buildUBoot: specify absolute path of dtc, fix building u-boot 2023.10+ + "DTC=${lib.getExe buildPackages.dtc}" + + "OPENSBI=${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin" + ]; + defconfig = "starfive_visionfive2_defconfig"; + filesToInstall = [ - "u-boot.bin" - "arch/riscv/dts/starfive_visionfive2.dtb" - "spl/u-boot-spl.bin" - "tools/mkimage" + "spl/u-boot-spl.bin.normal.out" + "u-boot.itb" ]; }