2024-01-01 04:43:55 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildUBoot
|
|
|
|
, buildPackages
|
|
|
|
, opensbi
|
|
|
|
}:
|
2023-04-16 22:43:32 +02:00
|
|
|
|
2023-06-08 04:53:58 +02:00
|
|
|
buildUBoot rec {
|
2024-01-21 21:00:14 +01:00
|
|
|
version = "2024.01";
|
2023-04-16 22:43:32 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-01 04:43:55 +01:00
|
|
|
owner = "u-boot";
|
2023-04-16 22:43:32 +02:00
|
|
|
repo = "u-boot";
|
2024-01-01 04:43:55 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-21 21:00:14 +01:00
|
|
|
hash = "sha256-0Da7Czy9cpQ+D5EICc3/QSZhAdCBsmeMvBgykYhAQFw=";
|
2023-04-16 22:43:32 +02:00
|
|
|
};
|
|
|
|
|
2024-01-01 04:43:55 +01:00
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
2023-04-16 22:43:32 +02:00
|
|
|
defconfig = "starfive_visionfive2_defconfig";
|
2024-01-01 04:43:55 +01:00
|
|
|
|
2023-04-16 22:43:32 +02:00
|
|
|
filesToInstall = [
|
2024-01-01 04:43:55 +01:00
|
|
|
"spl/u-boot-spl.bin.normal.out"
|
|
|
|
"u-boot.itb"
|
2023-04-16 22:43:32 +02:00
|
|
|
];
|
|
|
|
}
|