From 8502a2a6b5dfc364ade9350b9c6b135932037c26 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 22 Mar 2024 08:46:57 +0300 Subject: [PATCH 1/2] rkbin: make passthru attributes use full paths, fix license, fix BL31_RK3568 path --- pkgs/by-name/rk/rkbin/package.nix | 12 +++++++----- pkgs/misc/uboot/default.nix | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/rk/rkbin/package.nix b/pkgs/by-name/rk/rkbin/package.nix index f0d320dfef95..9ccff94a4e4b 100644 --- a/pkgs/by-name/rk/rkbin/package.nix +++ b/pkgs/by-name/rk/rkbin/package.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchFromGitHub +, rkbin }: stdenv.mkDerivation { @@ -19,15 +20,16 @@ stdenv.mkDerivation { mv bin doc $out/ ''; - BL31_RK3568 = "bin/rk35/rk3568_ddr_1056MHz_v1.21.bin"; - ROCKCHIP_TPL_RK3568 = "bin/rk35/rk3568_ddr_1056MHz_v1.21.bin"; - - ROCKCHIP_TPL_RK3588 = "bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin"; + passthru = { + BL31_RK3568 = "${rkbin}/bin/rk35/rk3568_bl31_v1.44.elf"; + TPL_RK3568 = "${rkbin}/bin/rk35/rk3568_ddr_1056MHz_v1.21.bin"; + TPL_RK3588 = "${rkbin}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin"; + }; meta = with lib; { description = "Rockchip proprietary bootloader blobs"; homepage = "https://github.com/rockchip-linux/rkbin"; - license = licenses.unfree; + license = licenses.unfreeRedistributable; maintainers = with maintainers; [ thefossguy ]; platforms = [ "aarch64-linux" ]; }; diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 484bcf08988e..8247ec24f547 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -377,7 +377,7 @@ in { defconfig = "orangepi-5-rk3588s_defconfig"; extraMeta.platforms = ["aarch64-linux"]; BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = "${rkbin}/${rkbin.ROCKCHIP_TPL_RK3588}"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" ]; }; @@ -529,7 +529,7 @@ in { defconfig = "rock5b-rk3588_defconfig"; extraMeta.platforms = ["aarch64-linux"]; BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = "${rkbin}/${rkbin.ROCKCHIP_TPL_RK3588}"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" "u-boot-rockchip-spi.bin" ]; }; From 1db686b48bf47119f5782a62efd9b905d911e17c Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 22 Mar 2024 08:49:10 +0300 Subject: [PATCH 2/2] ubootOrangePi5: also build the SPI image --- pkgs/misc/uboot/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 8247ec24f547..8063c663d3f7 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -378,7 +378,13 @@ in { extraMeta.platforms = ["aarch64-linux"]; BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; ROCKCHIP_TPL = rkbin.TPL_RK3588; - filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" ]; + + # FIXME: applied upstream, remove in 2024.04 + extraConfig = '' + CONFIG_ROCKCHIP_SPI_IMAGE=y + ''; + + filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" "u-boot-rockchip-spi.bin" ]; }; ubootOrangePiPc = buildUBoot {