From 0d5e144210a3a2b2d486de88c26bff0fcb1e0b33 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Wed, 6 May 2015 11:15:46 +0300 Subject: [PATCH 1/4] platforms: Add ARMv7 (hard float) multiplatform Based on the 'multi_v7_defconfig' that supports numerous boards. --- pkgs/top-level/platforms.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index fc0fe23d4fb1..7127d6bc79d1 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -483,4 +483,22 @@ rec { float = "hard"; }; }; + + armv7l-hf-multiplatform = { + name = "armv7l-hf-multiplatform"; + kernelMajor = "2.6"; + kernelHeadersBaseConfig = "multi_v7_defconfig"; + kernelBaseConfig = "multi_v7_defconfig"; + kernelArch = "arm"; + kernelAutoModules = false; + kernelExtraConfig = ""; + kernelTarget = "zImage"; + kernelDTB = true; + uboot = null; + gcc = { + arch = "armv7-a"; + fpu = "vfpv3-d16"; + float = "hard"; + }; + }; } From a7c4aba8968dfa85a147f60398d266441bc2b5ae Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Wed, 6 May 2015 11:15:13 +0300 Subject: [PATCH 2/4] ARM: Assume armv7l-hf-multiplatform instead of beaglebone Several places in the tree associate the ARMv7 system with the beaglebone platform. Change them to point to armv7l-hf-multiplatform as it supports several boards (including the beaglebone as well) --- pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix index 9cc5d4700878..520bdd208e36 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix @@ -34,7 +34,7 @@ let }; }; - beagleboneCrossSystem = { + armv7l-hf-multiplatform-crossSystem = { crossSystem = rec { config = "armv7l-unknown-linux-gnueabi"; bigEndian = false; @@ -43,7 +43,7 @@ let fpu = "vfpv3-d16"; withTLS = true; libc = "glibc"; - platform = pkgsNoParams.platforms.beaglebone; + platform = pkgsNoParams.platforms.armv7l-hf-multiplatform; openssl.system = "linux-generic32"; inherit (platform) gcc; }; @@ -52,7 +52,7 @@ let selectedCrossSystem = if toolsArch == "armv5tel" then sheevaplugCrossSystem else if toolsArch == "armv6l" then raspberrypiCrossSystem else - if toolsArch == "armv7l" then beagleboneCrossSystem else null; + if toolsArch == "armv7l" then armv7l-hf-multiplatform-crossSystem else null; pkgs = pkgsFun ({inherit system;} // selectedCrossSystem); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 65c55adbf2d7..ca4177f380d4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -72,7 +72,7 @@ let platforms = (import ./platforms.nix); in if system == "armv6l-linux" then platforms.raspberrypi - else if system == "armv7l-linux" then platforms.beaglebone + else if system == "armv7l-linux" then platforms.armv7l-hf-multiplatform else if system == "armv5tel-linux" then platforms.sheevaplug else if system == "mips64el-linux" then platforms.fuloong2f_n32 else if system == "x86_64-linux" then platforms.pc64 From a6aa673849fa8716e88237c0bda39df394b3cfc8 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Thu, 7 May 2015 06:00:49 +0300 Subject: [PATCH 3/4] ARMv7 platforms: switch header config to multi_v7_defconfig Otherwise they wouldn't be able to share a binary cache since glibc et al would get a different hash due to different linux-headers package. --- pkgs/top-level/platforms.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index 7127d6bc79d1..47d7d5993f1c 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -217,7 +217,7 @@ rec { raspberrypi2 = { name = "raspberrypi2"; kernelMajor = "3.14"; - kernelHeadersBaseConfig = "kirkwood_defconfig"; + kernelHeadersBaseConfig = "multi_v7_defconfig"; kernelBaseConfig = "bcm2709_defconfig"; kernelArch = "arm"; kernelDTB = true; @@ -470,7 +470,7 @@ rec { beaglebone = { name = "beaglebone"; kernelMajor = "2.6"; - kernelHeadersBaseConfig = "omap2plus_defconfig"; + kernelHeadersBaseConfig = "multi_v7_defconfig"; kernelBaseConfig = "omap2plus_defconfig"; kernelArch = "arm"; kernelAutoModules = false; From 9fc72c8ab8dc1e9c9eab9d091068b11f7de9184f Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Wed, 6 May 2015 11:40:53 +0300 Subject: [PATCH 4/4] kernel: Install DTBs into a subdirectory This avoids the pollution of the top-level kernel output directory and also simplifies the boot entry generator script I will be using on ARM. --- pkgs/os-specific/linux/kernel/manual-config.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index c57082c93305..963e10a59645 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -125,7 +125,8 @@ let mkdir -p $out/lib/firmware '') + (if (platform ? kernelDTB && platform.kernelDTB) then '' make $makeFlags "''${makeFlagsArray[@]}" dtbs - cp $buildRoot/arch/$karch/boot/dts/*dtb $out + mkdir -p $out/dtbs + cp $buildRoot/arch/$karch/boot/dts/*.dtb $out/dtbs '' else "") + (if isModular then '' make modules_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}"