diff options
author | Ben Wolsieffer <benwolsieffer@gmail.com> | 2018-12-30 18:44:03 -0500 |
---|---|---|
committer | Ben Wolsieffer <benwolsieffer@gmail.com> | 2019-01-18 17:53:21 -0500 |
commit | e245086709ebc3b8cef01ffc4f35748a55839cf2 (patch) | |
tree | c78ace17766579432a9ffb85107ae63f76d97ed2 /pkgs/misc/uboot | |
parent | bb72c0668d9481da8a11bce3f69fbfff5f89252e (diff) |
uboot: add RockPro64, fix Rock64 build
Switch the Rock64 build from a newer, less maintained U-Boot tree, to an older
but more maintained and featureful version.
Diffstat (limited to 'pkgs/misc/uboot')
-rw-r--r-- | pkgs/misc/uboot/default.nix | 24 | ||||
-rw-r--r-- | pkgs/misc/uboot/rock64.nix | 14 | ||||
-rw-r--r-- | pkgs/misc/uboot/rockpro64.nix | 37 |
3 files changed, 58 insertions, 17 deletions
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index ac77df8d7cd2..44d2bfc4400e 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchpatch, bc, bison, dtc, flex, openssl, python2, swig +{ stdenv, lib, fetchurl, fetchpatch, bc, bison, dtc, flex, openssl, python2, swig , armTrustedFirmwareAllwinner , buildPackages }: @@ -14,7 +14,7 @@ let stdenv.mkDerivation (rec { name = "uboot-${defconfig}-${version}"; - version = "2018.09"; + version = args.version or "2018.09"; src = fetchurl { url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"; @@ -23,10 +23,6 @@ let patches = [ (fetchpatch { - url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-07.patch; - sha256 = "096zqrlr8m9lxjma0iv7y6x78qswfs3q1w2irjkbmcvniz1azbs8"; - }) - (fetchpatch { url = https://github.com/dezgeg/u-boot/commit/extlinux-path-length-2018-03.patch; sha256 = "07jafdnxvqv8lz256qy29agjc2k1zj5ad4k28r1w5qkhwj4ixmf8"; }) @@ -36,7 +32,15 @@ let patchShebangs tools ''; - nativeBuildInputs = [ bc bison dtc flex openssl python2 swig ]; + nativeBuildInputs = [ + bc + bison + dtc + flex + openssl + (buildPackages.python2.withPackages (p: [ p.libfdt ])) + swig + ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; hardeningDisable = [ "all" ]; @@ -58,7 +62,7 @@ let runHook preInstall mkdir -p ${installDir} - cp ${stdenv.lib.concatStringsSep " " filesToInstall} ${installDir} + cp ${lib.concatStringsSep " " filesToInstall} ${installDir} runHook postInstall ''; @@ -68,7 +72,7 @@ let dontStrip = true; - meta = with stdenv.lib; { + meta = with lib; { homepage = http://www.denx.de/wiki/U-Boot/; description = "Boot loader for embedded systems"; license = licenses.gpl2; @@ -84,7 +88,7 @@ in rec { installDir = "$out/bin"; hardeningDisable = []; dontStrip = false; - extraMeta.platforms = stdenv.lib.platforms.linux; + extraMeta.platforms = lib.platforms.linux; extraMakeFlags = [ "HOST_TOOLS_ALL=y" "CROSS_BUILD_TOOLS=1" "NO_SDL=1" "tools" ]; postConfigure = '' sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config diff --git a/pkgs/misc/uboot/rock64.nix b/pkgs/misc/uboot/rock64.nix index 623c6015534a..2037036f53d7 100644 --- a/pkgs/misc/uboot/rock64.nix +++ b/pkgs/misc/uboot/rock64.nix @@ -2,25 +2,25 @@ rkbin = fetchFromGitHub { owner = "ayufan-rock64"; repo = "rkbin"; - rev = "d8b90685b3d93c358936babdd854f1018bc6d35e"; - sha256 = "0wrh3xa968sdp0j9n692jnv3071ymab719zc56vllba0aaabiaxr"; + rev = "af17d09dee19b41f4f01e1722eaf6911fb296245"; + sha256 = "189f7h6wj2yrcc5ga103jnyysykf9j3j9p1vcy7791bxwxqxnggf"; }; in buildUBoot rec { name = "uboot-${defconfig}-${version}"; - version = "2018.01"; + version = "2017.09"; src = fetchFromGitHub { owner = "ayufan-rock64"; repo = "linux-u-boot"; - rev = "19e31fac0dee3c4f6b2ea4371e4321f79db0f495"; - sha256 = "1vmv7q9yafsc0zivd0qdfmf930dvhzkf4a3j6apxxgx9g10wgwrg"; + rev = "d646df03ace3bd191e24361944ce1c7ef3c8744c"; + sha256 = "0gclcd034qfhfbabrdqmky08i0hlwmn63n0zg6mndplms5qpcx75"; }; extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "u-boot.itb" "all" ]; - # So close to being blob free... But U-Boot TPL causes the kernel to hang + # Close to being blob free, but the U-Boot TPL causes the kernel to hang after a few minutes postBuild = '' - ./tools/mkimage -n rk3328 -T rksd -d ${rkbin}/rk33/rk3328_ddr_786MHz_v1.06.bin idbloader.img + ./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 dd if=u-boot.itb of=idbloader.img seek=448 conv=notrunc ''; diff --git a/pkgs/misc/uboot/rockpro64.nix b/pkgs/misc/uboot/rockpro64.nix new file mode 100644 index 000000000000..f885fc37a228 --- /dev/null +++ b/pkgs/misc/uboot/rockpro64.nix @@ -0,0 +1,37 @@ +{ lib, buildUBoot, fetchFromGitHub }: let + rkbin = fetchFromGitHub { + owner = "ayufan-rock64"; + repo = "rkbin"; + rev = "af17d09dee19b41f4f01e1722eaf6911fb296245"; + sha256 = "189f7h6wj2yrcc5ga103jnyysykf9j3j9p1vcy7791bxwxqxnggf"; + }; +in buildUBoot rec { + name = "uboot-${defconfig}-${version}"; + version = "2017.09"; + + src = fetchFromGitHub { + owner = "ayufan-rock64"; + repo = "linux-u-boot"; + rev = "d646df03ace3bd191e24361944ce1c7ef3c8744c"; + sha256 = "0gclcd034qfhfbabrdqmky08i0hlwmn63n0zg6mndplms5qpcx75"; + }; + + # Upstream ATF hangs in SPL + extraMakeFlags = [ "BL31=${rkbin}/rk33/rk3399_bl31_v1.17.elf" "u-boot.itb" "all" ]; + + postBuild = '' + ./tools/mkimage -n rk3399 -T rksd -d ${rkbin}/rk33/rk3399_ddr_933MHz_v1.13.bin idbloader.img + cat spl/u-boot-spl.bin >> idbloader.img + dd if=u-boot.itb of=idbloader.img seek=448 conv=notrunc + ''; + + defconfig = "rockpro64-rk3399_defconfig"; + filesToInstall = [ "spl/u-boot-spl.bin" "u-boot.itb" "idbloader.img"]; + + extraMeta = with lib; { + maintainers = [ maintainers.lopsided98 ]; + platforms = ["aarch64-linux"]; + # Because of the TPL and ATF (BL31) blobs + license = licenses.unfreeRedistributableFirmware; + }; +} |