From 45e4413e413a7ffda8ef82fa2bab08427485ee78 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sat, 10 Aug 2024 12:56:37 +0200 Subject: [PATCH] ubootVisionFive2: init (cherry picked from commit 319feec0a2c71f9bba3aa7e1cd53c99cdacd3a53) --- pkgs/misc/uboot/default.nix | 21 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 22 insertions(+) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index ba433461bd19..13320be7065b 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -27,6 +27,7 @@ armTrustedFirmwareRK3568, armTrustedFirmwareRK3588, armTrustedFirmwareS905, + opensbi, buildPackages, }@pkgs: @@ -808,6 +809,26 @@ in # sf probe; sf update $loadaddr 0 80000 }; + ubootVisionFive2 = + let + opensbi_vf2 = opensbi.overrideAttrs (attrs: { + makeFlags = attrs.makeFlags ++ [ + # Matches u-boot documentation: https://docs.u-boot.org/en/latest/board/starfive/visionfive2.html + "FW_TEXT_START=0x40000000" + "FW_OPTIONS=0" + ]; + }); + in + buildUBoot { + defconfig = "starfive_visionfive2_defconfig"; + extraMeta.platforms = [ "riscv64-linux" ]; + OPENSBI = "${opensbi_vf2}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin"; + filesToInstall = [ + "spl/u-boot-spl.bin.normal.out" + "u-boot.itb" + ]; + }; + ubootWandboard = buildUBoot { defconfig = "wandboard_defconfig"; extraMeta.platforms = [ "armv7l-linux" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d50cbd1d4361..3a450f761cef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11575,6 +11575,7 @@ with pkgs; ubootSopine ubootTuringRK1 ubootUtilite + ubootVisionFive2 ubootWandboard ;