about summary refs log tree commit diff
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-03-22 08:38:37 +0300
committerGitHub <noreply@github.com>2024-03-22 08:38:37 +0300
commit0ebdaea977ea7874b04b8b735963002eb29d71b0 (patch)
tree39572b1bd3841a78ae717a3f92fd7a86b9050e97
parent653a2b578019f8a3ea2cea549a71e06f5d017ec8 (diff)
parenta84741ba54dffd5fb19633bcf8af0b84470d3258 (diff)
downloadnixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.tar
nixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.tar.gz
nixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.tar.bz2
nixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.tar.lz
nixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.tar.xz
nixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.tar.zst
nixlib-0ebdaea977ea7874b04b8b735963002eb29d71b0.zip
Merge pull request #297946 from K900/cherrypick-rk3588
Cherrypick #292667 (RK3588 uboot support) to master
-rw-r--r--maintainers/maintainer-list.nix7
-rw-r--r--pkgs/by-name/rk/rkbin/package.nix34
-rw-r--r--pkgs/misc/arm-trusted-firmware/default.nix21
-rw-r--r--pkgs/misc/uboot/default.nix18
-rw-r--r--pkgs/top-level/all-packages.nix3
5 files changed, 82 insertions, 1 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 82d04668e41c..76a3aa384981 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -19356,6 +19356,13 @@
     githubId = 42933;
     name = "Andrew Childs";
   };
+  thefossguy = {
+    name = "Pratham Patel";
+    email = "prathampatel@thefossguy.com";
+    matrix = "@thefossguy:matrix.org";
+    github = "thefossguy";
+    githubId = 44400303;
+  };
   thehedgeh0g = {
     name = "The Hedgehog";
     email = "hedgehog@mrhedgehog.xyz";
diff --git a/pkgs/by-name/rk/rkbin/package.nix b/pkgs/by-name/rk/rkbin/package.nix
new file mode 100644
index 000000000000..f0d320dfef95
--- /dev/null
+++ b/pkgs/by-name/rk/rkbin/package.nix
@@ -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" ];
+  };
+}
diff --git a/pkgs/misc/arm-trusted-firmware/default.nix b/pkgs/misc/arm-trusted-firmware/default.nix
index f3025572429e..6fb9aea3bfeb 100644
--- a/pkgs/misc/arm-trusted-firmware/default.nix
+++ b/pkgs/misc/arm-trusted-firmware/default.nix
@@ -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";
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 3ae82fde4fa9..484bcf08988e 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -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" ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2813b09e1f10..9992f36f040d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -27155,6 +27155,7 @@ with pkgs;
     armTrustedFirmwareQemu
     armTrustedFirmwareRK3328
     armTrustedFirmwareRK3399
+    armTrustedFirmwareRK3588
     armTrustedFirmwareS905
     ;
 
@@ -28360,6 +28361,7 @@ with pkgs;
     ubootOlimexA64Olinuxino
     ubootOlimexA64Teres1
     ubootOrangePi3
+    ubootOrangePi5
     ubootOrangePiPc
     ubootOrangePiZeroPlus2H5
     ubootOrangePiZero
@@ -28380,6 +28382,7 @@ with pkgs;
     ubootRaspberryPi4_32bit
     ubootRaspberryPi4_64bit
     ubootRaspberryPiZero
+    ubootRock5ModelB
     ubootRock64
     ubootRock64v2
     ubootRockPi4