about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2023-11-25 13:46:38 +0100
committerGitHub <noreply@github.com>2023-11-25 13:46:38 +0100
commit1fb123914bf5f632bb3fe00f854a643de36895cf (patch)
tree8e598e46828ffe501a9ffeb9e7e8d9ee2e9d059a
parent6909e461de4ecafbfac42e7a7a9e53da01ebf244 (diff)
parent6568016fa3397dfb07965855f56171a9c55ef7d7 (diff)
downloadnixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.tar
nixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.tar.gz
nixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.tar.bz2
nixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.tar.lz
nixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.tar.xz
nixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.tar.zst
nixlib-1fb123914bf5f632bb3fe00f854a643de36895cf.zip
Merge pull request #191538 from lorenz/rock64-uboot-improvements
u-boot: ROCK64 RAM init improvements
-rw-r--r--pkgs/misc/arm-trusted-firmware/default.nix1
-rw-r--r--pkgs/misc/uboot/default.nix42
-rw-r--r--pkgs/top-level/all-packages.nix1
3 files changed, 20 insertions, 24 deletions
diff --git a/pkgs/misc/arm-trusted-firmware/default.nix b/pkgs/misc/arm-trusted-firmware/default.nix
index 92bd7e0bee5b..444fcebe38fa 100644
--- a/pkgs/misc/arm-trusted-firmware/default.nix
+++ b/pkgs/misc/arm-trusted-firmware/default.nix
@@ -141,7 +141,6 @@ in {
     platform = "rk3328";
     extraMeta.platforms = ["aarch64-linux"];
     filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"];
-    platformCanUseHDCPBlob = true;
   };
 
   armTrustedFirmwareRK3399 = buildArmTrustedFirmware rec {
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 54a5f6be0920..6f32434afaac 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -497,32 +497,28 @@ in {
     filesToInstall = ["u-boot.bin"];
   };
 
-  ubootRock64 = let
-    rkbin = fetchFromGitHub {
-      owner = "ayufan-rock64";
-      repo = "rkbin";
-      rev = "f79a708978232a2b6b06c2e4173c5314559e0d3a";
-      sha256 = "0h7xm4ck3p3380c6bqm5ixrkxwcx6z5vysqdwvfa7gcqx5d6x5zz";
-    };
-  in buildUBoot {
+  ubootRock64 = buildUBoot {
     defconfig = "rock64-rk3328_defconfig";
-    extraMeta = {
-      platforms = [ "aarch64-linux" ];
-      license = lib.licenses.unfreeRedistributableFirmware;
-    };
+    extraMeta.platforms = [ "aarch64-linux" ];
     BL31="${armTrustedFirmwareRK3328}/bl31.elf";
-    filesToInstall = [ "u-boot.itb" "idbloader.img"];
-    # Derive MAC address from cpuid
-    # Submitted upstream: https://patchwork.ozlabs.org/patch/1203686/
-    extraConfig = ''
-      CONFIG_MISC_INIT_R=y
-    '';
-    # Close to being blob free, but the U-Boot TPL causes random memory
-    # corruption
-    postBuild = ''
-      ./tools/mkimage -n rk3328 -T rksd -d ${rkbin}/rk33/rk3328_ddr_786MHz_v1.13.bin idbloader.img
-      cat spl/u-boot-spl.bin >> idbloader.img
+    filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" ];
+  };
+
+  # A special build with much lower memory frequency (666 vs 1600 MT/s) which
+  # makes ROCK64 V2 boards stable. This is necessary because the DDR3 routing
+  # on that revision is marginal and not uncoditionally stable at the specified
+  # frequency. If your ROCK64 is unstable you can try this u-boot variant to
+  # see if it works better for you. The only disadvantage is lowered memory
+  # bandwidth.
+  ubootRock64v2 = buildUBoot {
+    prePatch = ''
+      substituteInPlace arch/arm/dts/rk3328-rock64-u-boot.dtsi \
+        --replace rk3328-sdram-lpddr3-1600.dtsi rk3328-sdram-lpddr3-666.dtsi
     '';
+    defconfig = "rock64-rk3328_defconfig";
+    extraMeta.platforms = [ "aarch64-linux" ];
+    BL31="${armTrustedFirmwareRK3328}/bl31.elf";
+    filesToInstall = [ "u-boot.itb" "idbloader.img" "u-boot-rockchip.bin" ];
   };
 
   ubootRockPro64 = buildUBoot {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index dc84b1ba921d..44e8876d1977 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -28876,6 +28876,7 @@ with pkgs;
     ubootRaspberryPi4_64bit
     ubootRaspberryPiZero
     ubootRock64
+    ubootRock64v2
     ubootRockPi4
     ubootRockPro64
     ubootROCPCRK3399