2023-04-26 07:46:11 +00:00
|
|
|
{
|
|
|
|
pkgs, targetBoard, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
with pkgs; let
|
|
|
|
payload-generator = pkgs.callPackage ./hss-payload-generator.nix {};
|
|
|
|
payload_config = ./uboot.yaml;
|
|
|
|
in
|
|
|
|
buildUBoot rec {
|
|
|
|
pname = "uboot";
|
2023-07-05 07:56:44 +00:00
|
|
|
version = "linux4microchip+fpga-2023.06";
|
2023-04-26 07:46:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "polarfire-soc";
|
|
|
|
repo = "u-boot";
|
2023-07-10 06:12:50 +00:00
|
|
|
# from mpfs-uboot-2022.01 branch
|
2023-07-05 07:56:44 +00:00
|
|
|
rev = "7e19f9dff788025403ac6a34d9acf8736eef32ff";
|
|
|
|
sha256 = "sha256-1qmifjjNxPOUWRgZdQk6Ld5KGQk/PypSRK/ILPSsTLs";
|
2023-04-26 07:46:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraMakeFlags = [
|
|
|
|
"OPENSBI=${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin"
|
|
|
|
];
|
|
|
|
|
2023-07-05 07:56:44 +00:00
|
|
|
patches = [
|
|
|
|
./patches/0001-Boot-environment-for-Microchip-Iciclle-Kit.patch
|
|
|
|
./patches/0002-Riscv-Fix-build-against-binutils-2.38.patch
|
|
|
|
];
|
2023-04-26 07:46:11 +00:00
|
|
|
defconfig = "${targetBoard}_defconfig";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
extraMeta.platforms = ["riscv64-linux"];
|
|
|
|
postBuild = ''
|
|
|
|
${payload-generator}/hss-payload-generator -c ${payload_config} payload.bin
|
|
|
|
'';
|
|
|
|
filesToInstall = [ "payload.bin" ];
|
|
|
|
}
|