summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Wolsieffer <benwolsieffer@gmail.com>2018-02-23 20:29:24 -0500
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-03-18 18:53:12 +0200
commit6f5a0bded2ae20759003d8be9548b5358c8aefcd (patch)
treef7ed60f98a84c7eda35e553c8adea6ffd1863cd5
parent5804547243010ec8e341e98e8acbc5c96263682e (diff)
downloadnixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.tar
nixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.tar.gz
nixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.tar.bz2
nixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.tar.lz
nixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.tar.xz
nixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.tar.zst
nixpkgs-6f5a0bded2ae20759003d8be9548b5358c8aefcd.zip
uboot: add Rock64 support
The bootloader is currently non-functional because it lacks the ARM Trusted
Firmware image (bl31.elf).
-rw-r--r--pkgs/misc/uboot/rock64.nix26
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/misc/uboot/rock64.nix b/pkgs/misc/uboot/rock64.nix
new file mode 100644
index 00000000000..b6dd99ac6a6
--- /dev/null
+++ b/pkgs/misc/uboot/rock64.nix
@@ -0,0 +1,26 @@
+{ buildUBoot, fetchFromGitHub }: buildUBoot rec {
+  name = "uboot-${defconfig}-${version}";
+  version = "2018.01";
+
+  src = fetchFromGitHub {
+    owner = "ayufan-rock64";
+    repo = "linux-u-boot";
+    rev = "19e31fac0dee3c4f6b2ea4371e4321f79db0f495";
+    sha256 = "1vmv7q9yafsc0zivd0qdfmf930dvhzkf4a3j6apxxgx9g10wgwrg";
+  };
+
+  extraMakeFlags = [ "u-boot.itb" "all" ];
+  postBuild = ''
+    ./tools/mkimage -n rk3328 -T rksd -d tpl/u-boot-tpl.bin idbloader.img
+    cat spl/u-boot-spl.bin >> idbloader.img
+    dd if=u-boot.itb of=idbloader.img seek=448 conv=notrunc
+  '';
+
+  defconfig = "rock64-rk3328_defconfig";
+  filesToInstall = [ "spl/u-boot-spl.bin" "tpl/u-boot-tpl.bin" "u-boot.itb" "idbloader.img"];
+
+  extraMeta = {
+    maintainers = [ lib.maintainers.lopsided98 ];
+    platforms = ["aarch64-linux"];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 27ed3cb0bcf..f709ca6e67f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -13882,6 +13882,8 @@ with pkgs;
 
   ubootGuruplug = callPackage ../misc/uboot/guruplug.nix { };
 
+  ubootRock64 = callPackage ../misc/uboot/rock64.nix { };
+
   uclibc = callPackage ../os-specific/linux/uclibc { };
 
   uclibcCross = lowPrio (callPackage ../os-specific/linux/uclibc {