@@ -1,11 +1,20 @@
11{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig
2+, armTrustedFirmwareAllwinner
23, hostPlatform, buildPackages
34}:
45
56let
7+ # Various changes for 64-bit sunxi boards, (hopefully) destined for 2018.05
8+ sunxiPatch = fetchpatch {
9+ name = "sunxi.patch";
10+ url = "https://github.com/u-boot/u-boot/compare/v2018.03...dezgeg:2018-03-sunxi.patch";
11+ sha256 = "1pqn7c6c06hfygwpcgaraqvqxcjhz99j0rx5psfhj8igy0qvk2dq";
12+ };
13+
614 buildUBoot = { filesToInstall
715 , installDir ? "$out"
816 , defconfig
17+ , extraPatches ? []
918 , extraMakeFlags ? []
1019 , extraMeta ? {}
1120 , ... } @ args:
@@ -36,7 +45,7 @@ let
3645 url = https://github.com/dezgeg/u-boot/commit/extlinux-path-length-2018-03.patch;
3746 sha256 = "07jafdnxvqv8lz256qy29agjc2k1zj5ad4k28r1w5qkhwj4ixmf8";
3847 })
39− ];
48+ ] ++ extraPatches;
4049
4150 postPatch = ''
4251 patchShebangs tools
@@ -200,6 +209,14 @@ in rec {
200209 filesToInstall = ["u-boot.bin"];
201210 };
202211
212+ ubootSopine = buildUBoot rec {
213+ extraPatches = [sunxiPatch];
214+ defconfig = "sopine_baseboard_defconfig";
215+ extraMeta.platforms = ["aarch64-linux"];
216+ BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin";
217+ filesToInstall = ["u-boot-sunxi-with-spl.bin"];
218+ };
219+
203220 ubootUtilite = buildUBoot rec {
204221 defconfig = "cm_fx6_defconfig";
205222 extraMeta.platforms = ["armv7l-linux"];