From 5804547243010ec8e341e98e8acbc5c96263682e Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Fri, 23 Feb 2018 17:50:24 -0500 Subject: uboot: 2017.11 -> 2018.03, cross fixes --- pkgs/misc/uboot/default.nix | 77 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 1bfcea1057e9..9e07c22fe2ab 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -1,10 +1,9 @@ -{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2 -, hostPlatform +{ stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig +, hostPlatform, buildPackages }: let - buildUBoot = { targetPlatforms - , filesToInstall + buildUBoot = { filesToInstall , installDir ? "$out" , defconfig , extraMakeFlags ? [] @@ -13,18 +12,14 @@ let stdenv.mkDerivation (rec { name = "uboot-${defconfig}-${version}"; - version = "2017.11"; + version = "2018.03"; src = fetchurl { url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"; - sha256 = "01bcsah5imy6m3fbjwhqywxg0pfk5fl8ks9ylb7kv3zmrb9qy0ba"; + sha256 = "1z9x635l5164c5hnf7qs19w7j3qghbkgs7rpn673dm898i9pfx3y"; }; patches = [ - (fetchpatch { - url = https://github.com/dezgeg/u-boot/commit/cbsize-2017-11.patch; - sha256 = "08rqsrj78aif8vaxlpwiwwv1jwf0diihbj0h88hc0mlp0kmyqxwm"; - }) (fetchpatch { url = https://github.com/dezgeg/u-boot/commit/rpi-2017-11-patch1.patch; sha256 = "067yq55vv1slv4xy346px7h329pi14abdn04chg6s1s6hmf6c1x9"; @@ -34,8 +29,8 @@ let sha256 = "0bbw0q027xvzvdxxvpzjajg4rm30a8mb7z74b6ma9q0l7y7bi0c4"; }) (fetchpatch { - url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch; - sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v"; + url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch; + sha256 = "1rhhlhrwhv7ic1n5i720jfh2cxwrkssrkvinllyjy3j9k9bpzcqd"; }) ]; @@ -43,14 +38,22 @@ let patchShebangs tools ''; - nativeBuildInputs = [ bc dtc openssl python2 ]; + nativeBuildInputs = [ bc dtc openssl python2 swig ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; hardeningDisable = [ "all" ]; - makeFlags = [ "DTC=dtc" ] ++ extraMakeFlags; + makeFlags = [ + "DTC=dtc" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ] ++ extraMakeFlags; configurePhase = '' + runHook preConfigure + make ${defconfig} + + runHook postConfigure ''; installPhase = '' @@ -65,21 +68,13 @@ let enableParallelBuilding = true; dontStrip = true; - crossAttrs = { - makeFlags = [ - "ARCH=${hostPlatform.platform.kernelArch}" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; - }; - meta = with stdenv.lib; { homepage = http://www.denx.de/wiki/U-Boot/; description = "Boot loader for embedded systems"; license = licenses.gpl2; maintainers = [ maintainers.dezgeg ]; - platforms = targetPlatforms; } // extraMeta; - } // args); + } // removeAttrs args [ "extraMeta" ]); in rec { inherit buildUBoot; @@ -88,10 +83,14 @@ in rec { defconfig = "allnoconfig"; installDir = "$out/bin"; buildFlags = "tools NO_SDL=1"; + hardeningDisable = []; dontStrip = false; - targetPlatforms = stdenv.lib.platforms.linux; + extraMeta.platforms = stdenv.lib.platforms.linux; # build tools/kwboot extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ]; + postConfigure = '' + sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config + ''; filesToInstall = [ "tools/dumpimage" "tools/fdtgrep" @@ -103,86 +102,86 @@ in rec { ubootA20OlinuxinoLime = buildUBoot rec { defconfig = "A20-OLinuXino-Lime_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-sunxi-with-spl.bin"]; }; ubootBananaPi = buildUBoot rec { defconfig = "Bananapi_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-sunxi-with-spl.bin"]; }; ubootBeagleboneBlack = buildUBoot rec { defconfig = "am335x_boneblack_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["MLO" "u-boot.img"]; }; # http://git.denx.de/?p=u-boot.git;a=blob;f=board/solidrun/clearfog/README;hb=refs/heads/master ubootClearfog = buildUBoot rec { defconfig = "clearfog_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-spl.kwb"]; }; ubootJetsonTK1 = buildUBoot rec { defconfig = "jetson-tk1_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"]; }; ubootOdroidXU3 = buildUBoot rec { defconfig = "odroid-xu3_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-dtb.bin"]; }; ubootOrangePiPc = buildUBoot rec { defconfig = "orangepi_pc_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-sunxi-with-spl.bin"]; }; ubootPcduino3Nano = buildUBoot rec { defconfig = "Linksprite_pcDuino3_Nano_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-sunxi-with-spl.bin"]; }; ubootQemuArm = buildUBoot rec { defconfig = "qemu_arm_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot.bin"]; }; ubootRaspberryPi = buildUBoot rec { defconfig = "rpi_defconfig"; - targetPlatforms = ["armv6l-linux"]; + extraMeta.platforms = ["armv6l-linux"]; filesToInstall = ["u-boot.bin"]; }; ubootRaspberryPi2 = buildUBoot rec { defconfig = "rpi_2_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot.bin"]; }; ubootRaspberryPi3_32bit = buildUBoot rec { defconfig = "rpi_3_32b_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot.bin"]; }; ubootRaspberryPi3_64bit = buildUBoot rec { defconfig = "rpi_3_defconfig"; - targetPlatforms = ["aarch64-linux"]; + extraMeta.platforms = ["aarch64-linux"]; filesToInstall = ["u-boot.bin"]; }; ubootUtilite = buildUBoot rec { defconfig = "cm_fx6_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot-with-nand-spl.imx"]; buildFlags = "u-boot-with-nand-spl.imx"; postConfigure = '' @@ -196,7 +195,7 @@ in rec { ubootWandboard = buildUBoot rec { defconfig = "wandboard_defconfig"; - targetPlatforms = ["armv7l-linux"]; + extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot.img" "SPL"]; }; } -- cgit 1.4.1 From 6f5a0bded2ae20759003d8be9548b5358c8aefcd Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Fri, 23 Feb 2018 20:29:24 -0500 Subject: uboot: add Rock64 support The bootloader is currently non-functional because it lacks the ARM Trusted Firmware image (bl31.elf). --- pkgs/misc/uboot/rock64.nix | 26 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/misc/uboot/rock64.nix (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/rock64.nix b/pkgs/misc/uboot/rock64.nix new file mode 100644 index 000000000000..b6dd99ac6a6d --- /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 27ed3cb0bcfd..f709ca6e67f5 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 { -- cgit 1.4.1 From 0ab76c5a4ed28baba3e0bfcdf25a89b78c44e0d8 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Fri, 23 Feb 2018 21:46:39 -0500 Subject: arm-trusted-firmware: init ARM trusted firmware is required as part of the boot process on some ARMv8-A boards. Currently, only the RK3328 is supported in nixpkgs. This makes the Rock64 u-boot image bootable. --- pkgs/misc/arm-trusted-firmware/default.nix | 63 ++++++++++++++++++++++++++++++ pkgs/misc/uboot/rock64.nix | 4 +- pkgs/top-level/all-packages.nix | 5 +++ 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 pkgs/misc/arm-trusted-firmware/default.nix (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/arm-trusted-firmware/default.nix b/pkgs/misc/arm-trusted-firmware/default.nix new file mode 100644 index 000000000000..fdaf109ebffe --- /dev/null +++ b/pkgs/misc/arm-trusted-firmware/default.nix @@ -0,0 +1,63 @@ +{ stdenv, fetchFromGitHub, buildPackages }: + +let + buildArmTrustedFirmware = { targetPlatforms + , filesToInstall + , installDir ? "$out" + , platform + , extraMakeFlags ? [] + , extraMeta ? {} + , ... } @ args: + stdenv.mkDerivation (rec { + + name = "arm-trusted-firmware-${platform}-${version}"; + version = "1.4"; + + src = fetchFromGitHub { + owner = "ARM-software"; + repo = "arm-trusted-firmware"; + rev = "b762fc7481c66b64eb98b6ff694d569e66253973"; + sha256 = "15m10dfgqkgw6rmzgfg1xzp1si9d5jwzyrcb7cp3y9ckj6mvp3i3"; + }; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + makeFlags = [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + "PLAT=${platform}" + ] ++ extraMakeFlags; + + installPhase = '' + runHook preInstall + + mkdir -p ${installDir} + cp ${stdenv.lib.concatStringsSep " " filesToInstall} ${installDir} + + runHook postInstall + ''; + + hardeningDisable = [ "all" ]; + dontStrip = true; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + homepage = https://github.com/ARM-software/arm-trusted-firmware; + description = "A reference implementation of secure world software for ARMv8-A"; + license = licenses.bsd3; + maintainers = [ maintainers.lopsided98 ]; + # TODO: Fix when #34444 is merged + # platforms = targetPlatforms; + } // extraMeta; + } // builtins.removeAttrs args [ "extraMeta" ]); + +in rec { + inherit buildArmTrustedFirmware; + + armTrustedFirmwareRK3328 = buildArmTrustedFirmware rec { + extraMakeFlags = [ "bl31" ]; + platform = "rk3328"; + targetPlatforms = ["aarch64-linux"]; + filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"]; + }; +} diff --git a/pkgs/misc/uboot/rock64.nix b/pkgs/misc/uboot/rock64.nix index b6dd99ac6a6d..8c3af2a35a46 100644 --- a/pkgs/misc/uboot/rock64.nix +++ b/pkgs/misc/uboot/rock64.nix @@ -1,4 +1,4 @@ -{ buildUBoot, fetchFromGitHub }: buildUBoot rec { +{ lib, buildUBoot, fetchFromGitHub, armTrustedFirmwareRK3328 }: buildUBoot rec { name = "uboot-${defconfig}-${version}"; version = "2018.01"; @@ -9,7 +9,7 @@ sha256 = "1vmv7q9yafsc0zivd0qdfmf930dvhzkf4a3j6apxxgx9g10wgwrg"; }; - extraMakeFlags = [ "u-boot.itb" "all" ]; + extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f709ca6e67f5..fe8c1eeae61c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12874,6 +12874,11 @@ with pkgs; alsaOss = callPackage ../os-specific/linux/alsa-oss { }; alsaTools = callPackage ../os-specific/linux/alsa-tools { }; + inherit (callPackage ../misc/arm-trusted-firmware {}) + buildArmTrustedFirmware + armTrustedFirmwareRK3328 + ; + microcodeAmd = callPackage ../os-specific/linux/microcode/amd.nix { }; microcodeIntel = callPackage ../os-specific/linux/microcode/intel.nix { }; -- cgit 1.4.1 From 1f4bb8c61d71f2ac12f1cc6cf50aaa590df40a45 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sat, 3 Mar 2018 21:17:13 -0500 Subject: uboot: add patch to increase maximum path length in extlinux.conf This fixes problems with cross compiled kernels failing to boot. --- pkgs/misc/uboot/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 9e07c22fe2ab..800c00572821 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -32,6 +32,10 @@ let url = https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch; sha256 = "1rhhlhrwhv7ic1n5i720jfh2cxwrkssrkvinllyjy3j9k9bpzcqd"; }) + (fetchpatch { + url = https://github.com/dezgeg/u-boot/commit/extlinux-path-length-2018-03.patch; + sha256 = "07jafdnxvqv8lz256qy29agjc2k1zj5ad4k28r1w5qkhwj4ixmf8"; + }) ]; postPatch = '' -- cgit 1.4.1 From ba3e470651cbfeff1ad28fae1d1d5dcad6fb020b Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sat, 3 Mar 2018 21:18:05 -0500 Subject: uboot: rock64: use binary blob for TPL This stops the kernel from crashing immediately after boot. --- pkgs/misc/uboot/rock64.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/rock64.nix b/pkgs/misc/uboot/rock64.nix index 8c3af2a35a46..623c6015534a 100644 --- a/pkgs/misc/uboot/rock64.nix +++ b/pkgs/misc/uboot/rock64.nix @@ -1,4 +1,11 @@ -{ lib, buildUBoot, fetchFromGitHub, armTrustedFirmwareRK3328 }: buildUBoot rec { +{ lib, buildUBoot, fetchFromGitHub, armTrustedFirmwareRK3328 }: let + rkbin = fetchFromGitHub { + owner = "ayufan-rock64"; + repo = "rkbin"; + rev = "d8b90685b3d93c358936babdd854f1018bc6d35e"; + sha256 = "0wrh3xa968sdp0j9n692jnv3071ymab719zc56vllba0aaabiaxr"; + }; +in buildUBoot rec { name = "uboot-${defconfig}-${version}"; version = "2018.01"; @@ -10,8 +17,10 @@ }; extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "u-boot.itb" "all" ]; + + # So close to being blob free... But U-Boot TPL causes the kernel to hang postBuild = '' - ./tools/mkimage -n rk3328 -T rksd -d tpl/u-boot-tpl.bin idbloader.img + ./tools/mkimage -n rk3328 -T rksd -d ${rkbin}/rk33/rk3328_ddr_786MHz_v1.06.bin idbloader.img cat spl/u-boot-spl.bin >> idbloader.img dd if=u-boot.itb of=idbloader.img seek=448 conv=notrunc ''; @@ -19,8 +28,10 @@ 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 ]; + extraMeta = with lib; { + maintainers = [ maintainers.lopsided98 ]; platforms = ["aarch64-linux"]; + # Because of the TPL blob + license = licenses.unfreeRedistributableFirmware; }; } -- cgit 1.4.1 From 01020b3263629be5a8697aa781dcb267df8de0a0 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Fri, 23 Feb 2018 23:47:27 -0500 Subject: uboot: sheevplug and guruplug: use mainline U-Boot These derivations have not seen any updates since they were created in 2010, and some of their sources have disappeared. There are upstream configs for these boards, so these are now used, and they build correctly. I have no way of testing them, and I don't if anyone even uses either board with Nix anymore. --- pkgs/misc/uboot/default.nix | 12 +++ pkgs/misc/uboot/gas220.patch | 18 ---- pkgs/misc/uboot/guruplug-file-systems.patch | 48 ---------- pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch | 106 ----------------------- pkgs/misc/uboot/guruplug.nix | 57 ------------ pkgs/misc/uboot/sheevaplug.nix | 61 ------------- pkgs/top-level/all-packages.nix | 6 +- 7 files changed, 14 insertions(+), 294 deletions(-) delete mode 100644 pkgs/misc/uboot/gas220.patch delete mode 100644 pkgs/misc/uboot/guruplug-file-systems.patch delete mode 100644 pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch delete mode 100644 pkgs/misc/uboot/guruplug.nix delete mode 100644 pkgs/misc/uboot/sheevaplug.nix (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 800c00572821..9da52e494371 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -129,6 +129,12 @@ in rec { filesToInstall = ["u-boot-spl.kwb"]; }; + ubootGuruplug = buildUBoot rec { + defconfig = "guruplug_defconfig"; + extraMeta.platforms = ["armv5tel-linux"]; + filesToInstall = ["u-boot.bin"]; + }; + ubootJetsonTK1 = buildUBoot rec { defconfig = "jetson-tk1_defconfig"; extraMeta.platforms = ["armv7l-linux"]; @@ -183,6 +189,12 @@ in rec { filesToInstall = ["u-boot.bin"]; }; + ubootSheevaplug = buildUBoot rec { + defconfig = "sheevaplug_defconfig"; + extraMeta.platforms = ["armv5tel-linux"]; + filesToInstall = ["u-boot.bin"]; + }; + ubootUtilite = buildUBoot rec { defconfig = "cm_fx6_defconfig"; extraMeta.platforms = ["armv7l-linux"]; diff --git a/pkgs/misc/uboot/gas220.patch b/pkgs/misc/uboot/gas220.patch deleted file mode 100644 index c5a91b0f3d00..000000000000 --- a/pkgs/misc/uboot/gas220.patch +++ /dev/null @@ -1,18 +0,0 @@ -Patch to allow assembling with binutils 2.20. It worked without this patch in 2.19.1 -diff --git a/board/mv_feroceon/USP/jump.S b/board/mv_feroceon/USP/jump.S -index 4b6b9ee..58037fc 100644 ---- a/board/mv_feroceon/USP/jump.S -+++ b/board/mv_feroceon/USP/jump.S -@@ -29,9 +29,11 @@ disclaimer. - #include "sys/mvCpuIfRegs.h" - - --jumpStart: - - .section ".reset_vector_sect",#alloc, #execinstr -+ -+jumpStart: -+ - #if defined(MV_88F6082) || defined(MV_88F6183) || defined(DB_88F5181_OLD) || defined(DB_FPGA) || \ - defined(MV88F6281) || defined(MV88F6192) || defined(MV88F6180) || defined(MV_88F6183L) || \ - defined(MV88F6190) diff --git a/pkgs/misc/uboot/guruplug-file-systems.patch b/pkgs/misc/uboot/guruplug-file-systems.patch deleted file mode 100644 index 30dc1994303d..000000000000 --- a/pkgs/misc/uboot/guruplug-file-systems.patch +++ /dev/null @@ -1,48 +0,0 @@ -Add support for the various file systems as found in `sheevaplug.h'. -As for the SheevaPlug, the increase in size means that the environment -must be pushed further away. - -In addition, increase the malloc area size to allow compilation of UbiFS. - ---- u-boot/include/configs/guruplug.h 1970-01-01 01:00:01.000000000 +0100 -+++ u-boot/include/configs/guruplug.h 2010-09-29 18:59:52.000000000 +0200 -@@ -123,8 +123,8 @@ - * it has to be rounded to sector size - */ - #define CONFIG_ENV_SIZE 0x20000 /* 128k */ --#define CONFIG_ENV_ADDR 0x40000 --#define CONFIG_ENV_OFFSET 0x40000 /* env starts here */ -+#define CONFIG_ENV_ADDR 0x60000 -+#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ - - /* - * Default environment variables -@@ -145,7 +145,7 @@ - /* - * Size of malloc() pool - */ --#define CONFIG_SYS_MALLOC_LEN (1024 * 128) /* 128kB for malloc() */ -+#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* 1 MiB for malloc() */ - /* size in bytes reserved for initial data */ - #define CONFIG_SYS_GBL_DATA_SIZE 128 - -@@ -195,4 +195,18 @@ - - #define CONFIG_SYS_ALT_MEMTEST - -+/* -+ * File system -+ */ -+#define CONFIG_CMD_EXT2 -+#define CONFIG_CMD_FAT -+#define CONFIG_CMD_JFFS2 -+#define CONFIG_CMD_UBI -+#define CONFIG_CMD_UBIFS -+#define CONFIG_RBTREE -+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -+#define CONFIG_MTD_PARTITIONS -+#define CONFIG_CMD_MTDPARTS -+#define CONFIG_LZO -+ - #endif /* _CONFIG_GURUPLUG_H */ - diff --git a/pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch b/pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch deleted file mode 100644 index 4f32dd89031f..000000000000 --- a/pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch +++ /dev/null @@ -1,106 +0,0 @@ -The GuruPlug's microSD card reader is a USB mass storage device that -has two logical units (LUNs), i.e., two "SCSI disks". This patch -adds multi-LUN support to the USB MSD driver. - -See the thread at . - ---- u-boot/common/usb_storage.c 1970-01-01 01:00:01.000000000 +0100 -+++ u-boot/common/usb_storage.c 2010-10-02 00:38:15.000000000 +0200 -@@ -204,6 +204,22 @@ int usb_stor_info(void) - return 1; - } - -+static unsigned int usb_get_max_lun(struct us_data *us) -+{ -+ int len; -+ unsigned char result; -+ len = usb_control_msg(us->pusb_dev, -+ usb_rcvctrlpipe(us->pusb_dev, 0), -+ US_BBB_GET_MAX_LUN, -+ USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, -+ 0, us->ifnum, -+ &result, sizeof(result), -+ USB_CNTL_TIMEOUT * 5); -+ USB_STOR_PRINTF("Get Max LUN -> len = %i, result = %i\n", -+ len, (int) result); -+ return (len > 0) ? result : 0; -+} -+ - /******************************************************************************* - * scan the usb and reports device info - * to the user if mode = 1 -@@ -241,13 +257,21 @@ int usb_stor_scan(int mode) - break; /* no more devices avaiable */ - - if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) { -- /* ok, it is a storage devices -- * get info and fill it in -- */ -- if (usb_stor_get_info(dev, &usb_stor[usb_max_devs], -- &usb_dev_desc[usb_max_devs]) == 1) -+ /* OK, it's a storage device. Iterate over its LUNs -+ * and populate `usb_dev_desc'. */ -+ int lun, max_lun, start = usb_max_devs; -+ -+ max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); -+ for (lun = 0; -+ lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; -+ lun++) { -+ usb_dev_desc[usb_max_devs].lun = lun; -+ if (usb_stor_get_info(dev, &usb_stor[start], -+ &usb_dev_desc[usb_max_devs]) == 1) { - usb_max_devs++; - } -+ } -+ } - /* if storage device */ - if (usb_max_devs == USB_MAX_STOR_DEV) { - printf("max USB Storage Device reached: %d stopping\n", -@@ -882,6 +906,7 @@ static int usb_inquiry(ccb *srb, struct - do { - memset(&srb->cmd[0], 0, 12); - srb->cmd[0] = SCSI_INQUIRY; -+ srb->cmd[1] = srb->lun << 5; - srb->cmd[4] = 36; - srb->datalen = 36; - srb->cmdlen = 12; -@@ -905,6 +930,7 @@ static int usb_request_sense(ccb *srb, s - ptr = (char *)srb->pdata; - memset(&srb->cmd[0], 0, 12); - srb->cmd[0] = SCSI_REQ_SENSE; -+ srb->cmd[1] = srb->lun << 5; - srb->cmd[4] = 18; - srb->datalen = 18; - srb->pdata = &srb->sense_buf[0]; -@@ -924,6 +950,7 @@ static int usb_test_unit_ready(ccb *srb, - do { - memset(&srb->cmd[0], 0, 12); - srb->cmd[0] = SCSI_TST_U_RDY; -+ srb->cmd[1] = srb->lun << 5; - srb->datalen = 0; - srb->cmdlen = 12; - if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD) -@@ -943,6 +970,7 @@ static int usb_read_capacity(ccb *srb, s - do { - memset(&srb->cmd[0], 0, 12); - srb->cmd[0] = SCSI_RD_CAPAC; -+ srb->cmd[1] = srb->lun << 5; - srb->datalen = 8; - srb->cmdlen = 12; - if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD) -@@ -957,6 +985,7 @@ static int usb_read_10(ccb *srb, struct - { - memset(&srb->cmd[0], 0, 12); - srb->cmd[0] = SCSI_READ10; -+ srb->cmd[1] = srb->lun << 5; - srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff; - srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff; - srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff; -@@ -973,6 +1002,7 @@ static int usb_write_10(ccb *srb, struct - { - memset(&srb->cmd[0], 0, 12); - srb->cmd[0] = SCSI_WRITE10; -+ srb->cmd[1] = srb->lun << 5; - srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff; - srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff; - srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff; diff --git a/pkgs/misc/uboot/guruplug.nix b/pkgs/misc/uboot/guruplug.nix deleted file mode 100644 index 9f24f1da86a4..000000000000 --- a/pkgs/misc/uboot/guruplug.nix +++ /dev/null @@ -1,57 +0,0 @@ -{stdenv, fetchgit, unzip}: - -# Marvell's branch of U-Boot for the GuruPlug. - -let - # Aug 2010 revision of the `testing' branch of Marvell's U-Boot repository. - # See - # - # for details. - rev = "f106056095049c2c748c2a2797e5353295240e04"; -in -stdenv.mkDerivation { - name = "uboot-guruplug-0.0-pre-${stdenv.lib.strings.substring 0 7 rev}"; - - src = fetchgit { - url = "git://git.denx.de/u-boot-marvell.git"; - sha256 = "18gwyj16vml7aja9cyan51jwfcysy4cs062z7wmgdc0l9bha6iw7"; - inherit rev; - }; - - patches = - [ ./guruplug-file-systems.patch ./guruplug-usb-msd-multi-lun.patch ]; - - enableParallelBuilding = true; - - # Remove the cross compiler prefix. - configurePhase = '' - make mrproper - make guruplug_config - sed -i /CROSS_COMPILE/d include/config.mk - ''; - - buildPhase = '' - unset src - if test -z "$crossConfig"; then - make all u-boot.kwb - else - make all u-boot.kwb ARCH=arm CROSS_COMPILE=$crossConfig- - fi - ''; - - nativeBuildInputs = [ unzip ]; - - dontStrip = true; - - installPhase = '' - mkdir -p $out - cp -v u-boot u-boot.{kwb,map} $out - - mkdir -p $out/bin - cp tools/{envcrc,mkimage} $out/bin - ''; - - meta = { - platforms = [ "armv5tel-linux" ]; - }; -} diff --git a/pkgs/misc/uboot/sheevaplug.nix b/pkgs/misc/uboot/sheevaplug.nix deleted file mode 100644 index 53d811d1a44e..000000000000 --- a/pkgs/misc/uboot/sheevaplug.nix +++ /dev/null @@ -1,61 +0,0 @@ -{stdenv, fetchurl, unzip}: - -# We should enable this check once we have the cross target system information -# assert stdenv.system == "armv5tel-linux" || crossConfig == "armv5tel-linux"; - -# All this file is made for the Marvell Sheevaplug - -stdenv.mkDerivation { - name = "uboot-sheevaplug-3.4.27"; - - src = fetchurl { - url = "ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2"; - sha256 = "19vp4rlikz7h72pqsjhgz7nmgjy4c6vabvxkw67wni70vy5ddy8s"; - }; - - srcAddon = fetchurl { - url = "http://www.plugcomputer.org/405/us/plug-basic/uboot/u-boot-3.4.27.zip"; - sha256 = "1wqxznpdb6d2kx58gral4q0mg5ddxyrv7az8c6v29nr3cd9yrfsg"; - }; - - postUnpack = '' - mv u-boot-1.1.4 u-boot-3.4.27 - unzip -o $srcAddon - sourceRoot=u-boot-3.4.27 - ''; - - patches = [ ./gas220.patch ]; - - # Remove the cross compiler prefix, and add reiserfs support - configurePhase = '' - make mrproper - make rd88f6281Sheevaplug_config NBOOT=1 LE=1 - sed -i /CROSS_COMPILE/d include/config.mk - ''; - - buildPhase = '' - unset src - if test -z "$crossConfig"; then - make clean all - else - make clean all ARCH=arm CROSS_COMPILE=$crossConfig- - fi - ''; - - nativeBuildInputs = [ unzip ]; - - dontStrip = true; - - installPhase = '' - mkdir -p $out - cp u-boot-rd88f6281Sheevaplug_400db_nand.bin $out - cp u-boot u-boot.map $out - - mkdir -p $out/bin - cp tools/{envcrc,mkimage} $out/bin - ''; - - meta = { - platforms = [ "armv5tel-linux" ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fe8c1eeae61c..a545fa53a1cd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13867,6 +13867,7 @@ with pkgs; ubootBananaPi ubootBeagleboneBlack ubootClearfog + ubootGuruplug ubootJetsonTK1 ubootOdroidXU3 ubootOrangePiPc @@ -13876,17 +13877,14 @@ with pkgs; ubootRaspberryPi2 ubootRaspberryPi3_32bit ubootRaspberryPi3_64bit + ubootSheevaplug ubootUtilite ubootWandboard ; # Non-upstream U-Boots: - ubootSheevaplug = callPackage ../misc/uboot/sheevaplug.nix { }; - ubootNanonote = callPackage ../misc/uboot/nanonote.nix { }; - ubootGuruplug = callPackage ../misc/uboot/guruplug.nix { }; - ubootRock64 = callPackage ../misc/uboot/rock64.nix { }; uclibc = callPackage ../os-specific/linux/uclibc { }; -- cgit 1.4.1 From 28fd7d9594fa0ed1a1b80a9652b5ab065a29e077 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Tue, 6 Mar 2018 00:04:10 -0500 Subject: uboot: fix cross-build of ubootTools --- pkgs/misc/uboot/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 9da52e494371..dbb2bbef1a4e 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -86,12 +86,11 @@ in rec { ubootTools = buildUBoot rec { defconfig = "allnoconfig"; installDir = "$out/bin"; - buildFlags = "tools NO_SDL=1"; hardeningDisable = []; dontStrip = false; extraMeta.platforms = stdenv.lib.platforms.linux; # build tools/kwboot - extraMakeFlags = [ "CONFIG_KIRKWOOD=y" ]; + extraMakeFlags = [ "CONFIG_KIRKWOOD=y" "CROSS_BUILD_TOOLS=1" "NO_SDL=1" "tools" ]; postConfigure = '' sed -i '/CONFIG_SYS_TEXT_BASE/c\CONFIG_SYS_TEXT_BASE=0x00000000' .config ''; -- cgit 1.4.1 From 6b069c656abf9704662317dc0173f18cdf4dfc91 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Thu, 15 Mar 2018 09:03:39 +0200 Subject: U-Boot: Add AArch64 QEMU build See https://github.com/u-boot/u-boot/blob/master/doc/README.qemu-arm on how to use it. --- pkgs/misc/uboot/default.nix | 6 ++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 7 insertions(+) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index dbb2bbef1a4e..b56ca2693570 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -158,6 +158,12 @@ in rec { filesToInstall = ["u-boot-sunxi-with-spl.bin"]; }; + ubootQemuAarch64 = buildUBoot rec { + defconfig = "qemu_arm64_defconfig"; + extraMeta.platforms = ["aarch64-linux"]; + filesToInstall = ["u-boot.bin"]; + }; + ubootQemuArm = buildUBoot rec { defconfig = "qemu_arm_defconfig"; extraMeta.platforms = ["armv7l-linux"]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a545fa53a1cd..9d85ad39c9ae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13872,6 +13872,7 @@ with pkgs; ubootOdroidXU3 ubootOrangePiPc ubootPcduino3Nano + ubootQemuAarch64 ubootQemuArm ubootRaspberryPi ubootRaspberryPi2 -- cgit 1.4.1 From 2ff31f71ae1f10b3d1779b876ac94bf2a9998bd9 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sun, 10 Dec 2017 20:56:36 -0500 Subject: U-Boot: Add SOPINE Baseboard build This build is compatible with PINE A64-LTS. [dezgeg changed the original device tree patch to v4 of the patch series "sunxi: sync H3, H5, A64 DTs from mainline Linux" submitted to the upstream mailing list by Andre Przywara. Also install the u-boot-sunxi-with-spl.bin binary similar to 32-bit boards since it's now being built by the upstream build system.] --- pkgs/misc/uboot/default.nix | 19 ++++++++++++++++++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index b56ca2693570..aac5f5a2c802 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -1,11 +1,20 @@ { stdenv, fetchurl, fetchpatch, bc, dtc, openssl, python2, swig +, armTrustedFirmwareAllwinner , hostPlatform, buildPackages }: let + # Various changes for 64-bit sunxi boards, (hopefully) destined for 2018.05 + sunxiPatch = fetchpatch { + name = "sunxi.patch"; + url = "https://github.com/u-boot/u-boot/compare/v2018.03...dezgeg:2018-03-sunxi.patch"; + sha256 = "1pqn7c6c06hfygwpcgaraqvqxcjhz99j0rx5psfhj8igy0qvk2dq"; + }; + buildUBoot = { filesToInstall , installDir ? "$out" , defconfig + , extraPatches ? [] , extraMakeFlags ? [] , extraMeta ? {} , ... } @ args: @@ -36,7 +45,7 @@ let url = https://github.com/dezgeg/u-boot/commit/extlinux-path-length-2018-03.patch; sha256 = "07jafdnxvqv8lz256qy29agjc2k1zj5ad4k28r1w5qkhwj4ixmf8"; }) - ]; + ] ++ extraPatches; postPatch = '' patchShebangs tools @@ -200,6 +209,14 @@ in rec { filesToInstall = ["u-boot.bin"]; }; + ubootSopine = buildUBoot rec { + extraPatches = [sunxiPatch]; + defconfig = "sopine_baseboard_defconfig"; + extraMeta.platforms = ["aarch64-linux"]; + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + filesToInstall = ["u-boot-sunxi-with-spl.bin"]; + }; + ubootUtilite = buildUBoot rec { defconfig = "cm_fx6_defconfig"; extraMeta.platforms = ["armv7l-linux"]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6e8b403e1799..7c535d63e3ed 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13881,6 +13881,7 @@ with pkgs; ubootRaspberryPi3_32bit ubootRaspberryPi3_64bit ubootSheevaplug + ubootSopine ubootUtilite ubootWandboard ; -- cgit 1.4.1 From 4b77663edfba2c4e15db46c1ba900fa9819e4325 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Fri, 19 Jan 2018 22:14:00 +0200 Subject: U-Boot: Add Pine64 build --- pkgs/misc/uboot/default.nix | 8 ++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 9 insertions(+) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index aac5f5a2c802..4a96deadaea2 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -167,6 +167,14 @@ in rec { filesToInstall = ["u-boot-sunxi-with-spl.bin"]; }; + ubootPine64 = buildUBoot rec { + extraPatches = [sunxiPatch]; + defconfig = "pine64_plus_defconfig"; + extraMeta.platforms = ["aarch64-linux"]; + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + filesToInstall = ["u-boot-sunxi-with-spl.bin"]; + }; + ubootQemuAarch64 = buildUBoot rec { defconfig = "qemu_arm64_defconfig"; extraMeta.platforms = ["aarch64-linux"]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7c535d63e3ed..b84bf64a3ee3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13874,6 +13874,7 @@ with pkgs; ubootOdroidXU3 ubootOrangePiPc ubootPcduino3Nano + ubootPine64 ubootQemuAarch64 ubootQemuArm ubootRaspberryPi -- cgit 1.4.1 From 4fe75d11b2efdd3325ee8eaa4347626f1a950dbd Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Fri, 16 Mar 2018 19:27:01 +0200 Subject: U-Boot: Make ubootJetsonTK1 install even more files --- pkgs/misc/uboot/default.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 4a96deadaea2..807bc48a6428 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -147,6 +147,11 @@ in rec { defconfig = "jetson-tk1_defconfig"; extraMeta.platforms = ["armv7l-linux"]; filesToInstall = ["u-boot" "u-boot.dtb" "u-boot-dtb-tegra.bin" "u-boot-nodtb-tegra.bin"]; + # tegra-uboot-flasher expects this exact directory layout, sigh... + postInstall = '' + mkdir -p $out/spl + cp spl/u-boot-spl $out/spl/ + ''; }; ubootOdroidXU3 = buildUBoot rec { -- cgit 1.4.1 From 50dc85ed6283bb17684597cbf95f9405d5637fea Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 24 Mar 2018 16:07:50 +0200 Subject: U-Boot: Disable parallel build https://hydra.nixos.org/build/71880710 --- pkgs/misc/uboot/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkgs/misc/uboot') diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 807bc48a6428..4cf1748bad44 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -78,7 +78,9 @@ let runHook postInstall ''; - enableParallelBuilding = true; + # make[2]: *** No rule to make target 'lib/efi_loader/helloworld.efi', needed by '__build'. Stop. + enableParallelBuilding = false; + dontStrip = true; meta = with stdenv.lib; { -- cgit 1.4.1