Merge pull request #292667 from thefossguy/rk3588-init

Initial RK3588 support in nixpkgs
This commit is contained in:
Florian Klink 2024-03-20 13:12:50 +02:00 committed by GitHub
commit 24ff2807a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,34 @@
{ stdenv
, lib
, fetchFromGitHub
}:
stdenv.mkDerivation {
pname = "rkbin";
version = "unstable-2024.02.22";
src = fetchFromGitHub {
owner = "rockchip-linux";
repo = "rkbin";
rev = "a2a0b89b6c8c612dca5ed9ed8a68db8a07f68bc0";
hash = "sha256-U/jeUsV7bhqMw3BljmO6SI07NCDAd/+sEp3dZnyXeeA=";
};
installPhase = ''
mkdir $out
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";
meta = with lib; {
description = "Rockchip proprietary bootloader blobs";
homepage = "https://github.com/rockchip-linux/rkbin";
license = licenses.unfree;
maintainers = with maintainers; [ thefossguy ];
platforms = [ "aarch64-linux" ];
};
}

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, openssl, pkgsCross, buildPackages
{ lib, stdenv, fetchFromGitHub, fetchFromGitLab, openssl, pkgsCross, buildPackages
# Warning: this blob (hdcp.bin) runs on the main CPU (not the GPU) at
# privilege level EL3, which is above both the kernel and the
@ -151,6 +151,25 @@ in {
platformCanUseHDCPBlob = true;
};
armTrustedFirmwareRK3588 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "rk3588";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"];
platformCanUseHDCPBlob = true;
# TODO: remove this once the following get merged:
# 1: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/21840
# 2: https://review.trustedfirmware.org/c/ci/tf-a-ci-scripts/+/21833
src = fetchFromGitLab {
domain = "gitlab.collabora.com";
owner = "hardware-enablement/rockchip-3588";
repo = "trusted-firmware-a";
rev = "002d8e85ce5f4f06ebc2c2c52b4923a514bfa701";
hash = "sha256-1XOG7ILIgWa3uXUmAh9WTfSGLD/76OsmWrUhIxm/zTg=";
};
};
armTrustedFirmwareS905 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "gxbb";

View File

@ -13,6 +13,7 @@
, meson-tools
, ncurses
, openssl
, rkbin
, swig
, which
, python3
@ -21,6 +22,7 @@
, armTrustedFirmwareAllwinnerH616
, armTrustedFirmwareRK3328
, armTrustedFirmwareRK3399
, armTrustedFirmwareRK3588
, armTrustedFirmwareS905
, buildPackages
}:
@ -371,6 +373,14 @@ in {
filesToInstall = ["u-boot-sunxi-with-spl.bin"];
};
ubootOrangePi5 = buildUBoot {
defconfig = "orangepi-5-rk3588s_defconfig";
extraMeta.platforms = ["aarch64-linux"];
BL31 = "${armTrustedFirmwareRK3588}/bl31.elf";
ROCKCHIP_TPL = "${rkbin}/${rkbin.ROCKCHIP_TPL_RK3588}";
filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" ];
};
ubootOrangePiPc = buildUBoot {
defconfig = "orangepi_pc_defconfig";
extraMeta.platforms = ["armv7l-linux"];
@ -515,6 +525,14 @@ in {
filesToInstall = ["u-boot.bin"];
};
ubootRock5ModelB = buildUBoot {
defconfig = "rock5b-rk3588_defconfig";
extraMeta.platforms = ["aarch64-linux"];
BL31 = "${armTrustedFirmwareRK3588}/bl31.elf";
ROCKCHIP_TPL = "${rkbin}/${rkbin.ROCKCHIP_TPL_RK3588}";
filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" "u-boot-rockchip-spi.bin" ];
};
ubootRock64 = buildUBoot {
defconfig = "rock64-rk3328_defconfig";
extraMeta.platforms = [ "aarch64-linux" ];

View File

@ -27190,6 +27190,7 @@ with pkgs;
armTrustedFirmwareQemu
armTrustedFirmwareRK3328
armTrustedFirmwareRK3399
armTrustedFirmwareRK3588
armTrustedFirmwareS905
;
@ -28397,6 +28398,7 @@ with pkgs;
ubootOlimexA64Olinuxino
ubootOlimexA64Teres1
ubootOrangePi3
ubootOrangePi5
ubootOrangePiPc
ubootOrangePiZeroPlus2H5
ubootOrangePiZero
@ -28417,6 +28419,7 @@ with pkgs;
ubootRaspberryPi4_32bit
ubootRaspberryPi4_64bit
ubootRaspberryPiZero
ubootRock5ModelB
ubootRock64
ubootRock64v2
ubootRockPi4