forked from M-Labs/nix-servo
Compare commits
No commits in common. "d9a2d60b50425ad8e21e2395970aaf91de8ca0e3" and "0d3f87c5bc0cd6657bf4b7dd9e2185a7158d817b" have entirely different histories.
d9a2d60b50
...
0d3f87c5bc
25
flake.nix
25
flake.nix
|
@ -27,19 +27,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
crossSystem = {
|
|
||||||
system = "armv7l-linux";
|
|
||||||
linux-kernel = {
|
|
||||||
name = "zynq";
|
|
||||||
baseConfig = "multi_v7_defconfig";
|
|
||||||
target = "uImage";
|
|
||||||
installTarget = "uImage";
|
|
||||||
autoModules = false;
|
|
||||||
DTB = true;
|
|
||||||
makeFlags = [ "LOADADDR=0x8000" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
crosspkgs-overlay = (self: super: {
|
crosspkgs-overlay = (self: super: {
|
||||||
pkgsCross = super.pkgsCross // {
|
pkgsCross = super.pkgsCross // {
|
||||||
zynq-baremetal = import super.path {
|
zynq-baremetal = import super.path {
|
||||||
|
@ -51,10 +38,6 @@
|
||||||
gcc.fpu = "vfpv3";
|
gcc.fpu = "vfpv3";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
zynq-armv7l-linux = import super.path {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
inherit crossSystem;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -149,7 +132,7 @@
|
||||||
"${patched-not-os}/zynq_image.nix"
|
"${patched-not-os}/zynq_image.nix"
|
||||||
];
|
];
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
inherit crossSystem;
|
crossSystem.system = "armv7l-linux";
|
||||||
});
|
});
|
||||||
|
|
||||||
fast-servo-gateware = pkgs.stdenv.mkDerivation rec {
|
fast-servo-gateware = pkgs.stdenv.mkDerivation rec {
|
||||||
|
@ -251,7 +234,9 @@
|
||||||
dontFixup = true;
|
dontFixup = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
u-boot = (pkgs.pkgsCross.zynq-armv7l-linux.buildUBoot {
|
u-boot = let
|
||||||
|
fast-servo-dts = fast-servo/fast-servo.dts;
|
||||||
|
in (pkgs.pkgsCross.armv7l-hf-multiplatform.buildUBoot {
|
||||||
defconfig = "xilinx_zynq_virt_defconfig";
|
defconfig = "xilinx_zynq_virt_defconfig";
|
||||||
patches = [] ++ pkgs.lib.optional (board == "fast-servo") ./fast-servo/u-boot.patch;
|
patches = [] ++ pkgs.lib.optional (board == "fast-servo") ./fast-servo/u-boot.patch;
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
@ -274,7 +259,7 @@
|
||||||
filesToInstall = [ "u-boot.elf" ];
|
filesToInstall = [ "u-boot.elf" ];
|
||||||
}).overrideAttrs (oldAttrs: {
|
}).overrideAttrs (oldAttrs: {
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
cp ${fast-servo/fast-servo.dts} $sourceRoot/arch/arm/dts/zynq-fast-servo.dts
|
cp ${fast-servo-dts} $sourceRoot/arch/arm/dts/zynq-fast-servo.dts
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/dts
|
mkdir -p $out/dts
|
||||||
|
|
|
@ -151,10 +151,10 @@ index c61f9d6..fbdf0fd 100644
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
diff --git a/zynq_image.nix b/zynq_image.nix
|
diff --git a/zynq_image.nix b/zynq_image.nix
|
||||||
index 3fa23ab..9d1621e 100644
|
index 3fa23ab..e2e3871 100644
|
||||||
--- a/zynq_image.nix
|
--- a/zynq_image.nix
|
||||||
+++ b/zynq_image.nix
|
+++ b/zynq_image.nix
|
||||||
@@ -1,66 +1,89 @@
|
@@ -1,66 +1,102 @@
|
||||||
-{ config, pkgs, ... }:
|
-{ config, pkgs, ... }:
|
||||||
+{ lib, config, pkgs, ... }:
|
+{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
@ -163,7 +163,22 @@ index 3fa23ab..9d1621e 100644
|
||||||
- # dont use overlays for the qemu, it causes a lot of wasted time on recompiles
|
- # dont use overlays for the qemu, it causes a lot of wasted time on recompiles
|
||||||
- x86pkgs = import pkgs.path { system = "x86_64-linux"; };
|
- x86pkgs = import pkgs.path { system = "x86_64-linux"; };
|
||||||
- customKernel = pkgs.linux.override {
|
- customKernel = pkgs.linux.override {
|
||||||
+ customKernel = (pkgs.linux.override {
|
+ crosspkgs = import pkgs.path {
|
||||||
|
+ system = "x86_64-linux";
|
||||||
|
+ crossSystem = {
|
||||||
|
+ system = "armv7l-linux";
|
||||||
|
+ linux-kernel = {
|
||||||
|
+ name = "zynq";
|
||||||
|
+ baseConfig = "multi_v7_defconfig";
|
||||||
|
+ target = "uImage";
|
||||||
|
+ installTarget = "uImage";
|
||||||
|
+ autoModules = false;
|
||||||
|
+ DTB = true;
|
||||||
|
+ makeFlags = [ "LOADADDR=0x8000" ];
|
||||||
|
+ };
|
||||||
|
+ };
|
||||||
|
+ };
|
||||||
|
+ customKernel = (crosspkgs.linux.override {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
OVERLAY_FS y
|
OVERLAY_FS y
|
||||||
+ MEDIA_SUPPORT n
|
+ MEDIA_SUPPORT n
|
||||||
|
@ -180,15 +195,14 @@ index 3fa23ab..9d1621e 100644
|
||||||
+ OF_OVERLAY y
|
+ OF_OVERLAY y
|
||||||
'';
|
'';
|
||||||
- };
|
- };
|
||||||
|
- customKernelPackages = pkgs.linuxPackagesFor customKernel;
|
||||||
+ }).overrideAttrs (oa: {
|
+ }).overrideAttrs (oa: {
|
||||||
+ postInstall = ''
|
+ postInstall = ''
|
||||||
+ if [ -e arch/arm/boot/uImage ]; then
|
+ cp arch/arm/boot/uImage $out
|
||||||
+ cp arch/arm/boot/uImage $out
|
|
||||||
+ fi
|
|
||||||
+ ${oa.postInstall}
|
+ ${oa.postInstall}
|
||||||
+ '';
|
+ '';
|
||||||
+ });
|
+ });
|
||||||
customKernelPackages = pkgs.linuxPackagesFor customKernel;
|
+ customKernelPackages = crosspkgs.linuxPackagesFor customKernel;
|
||||||
in {
|
in {
|
||||||
imports = [ ./arm32-cross-fixes.nix ];
|
imports = [ ./arm32-cross-fixes.nix ];
|
||||||
boot.kernelPackages = customKernelPackages;
|
boot.kernelPackages = customKernelPackages;
|
||||||
|
@ -239,12 +253,12 @@ index 3fa23ab..9d1621e 100644
|
||||||
- chmod +x qemu-script
|
- chmod +x qemu-script
|
||||||
- patchShebangs qemu-script
|
- patchShebangs qemu-script
|
||||||
- ls -ltrh
|
- ls -ltrh
|
||||||
- '';
|
'';
|
||||||
- system.build.rpi_image_tar = pkgs.runCommand "dist.tar" {} ''
|
- system.build.rpi_image_tar = pkgs.runCommand "dist.tar" {} ''
|
||||||
- mkdir -p $out/nix-support
|
- mkdir -p $out/nix-support
|
||||||
- tar -cvf $out/dist.tar ${config.system.build.rpi_image}
|
- tar -cvf $out/dist.tar ${config.system.build.rpi_image}
|
||||||
- echo "file binary-dist $out/dist.tar" >> $out/nix-support/hydra-build-products
|
- echo "file binary-dist $out/dist.tar" >> $out/nix-support/hydra-build-products
|
||||||
'';
|
- '';
|
||||||
- environment.systemPackages = [ pkgs.strace ];
|
- environment.systemPackages = [ pkgs.strace ];
|
||||||
- environment.etc."service/getty/run".source = pkgs.writeShellScript "getty" ''
|
- environment.etc."service/getty/run".source = pkgs.writeShellScript "getty" ''
|
||||||
- agetty ttyPS0 115200
|
- agetty ttyPS0 115200
|
||||||
|
|
|
@ -1062,13 +1062,13 @@ index 0000000..59aa585
|
||||||
++
|
++
|
||||||
+ #endif /*_LINUX_FPGA_MGR_H */
|
+ #endif /*_LINUX_FPGA_MGR_H */
|
||||||
diff --git a/zynq_image.nix b/zynq_image.nix
|
diff --git a/zynq_image.nix b/zynq_image.nix
|
||||||
index 9d1621e..012e50c 100644
|
index e2e3871..2decd54 100644
|
||||||
--- a/zynq_image.nix
|
--- a/zynq_image.nix
|
||||||
+++ b/zynq_image.nix
|
+++ b/zynq_image.nix
|
||||||
@@ -3,6 +3,16 @@
|
@@ -18,6 +18,16 @@ let
|
||||||
with lib;
|
};
|
||||||
let
|
};
|
||||||
customKernel = (pkgs.linux.override {
|
customKernel = (crosspkgs.linux.override {
|
||||||
+ kernelPatches = [
|
+ kernelPatches = [
|
||||||
+ ({
|
+ ({
|
||||||
+ name = "xilinx-configfs-overlays";
|
+ name = "xilinx-configfs-overlays";
|
||||||
|
@ -1082,7 +1082,7 @@ index 9d1621e..012e50c 100644
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
OVERLAY_FS y
|
OVERLAY_FS y
|
||||||
MEDIA_SUPPORT n
|
MEDIA_SUPPORT n
|
||||||
@@ -17,6 +27,7 @@ let
|
@@ -32,6 +42,7 @@ let
|
||||||
OF_FPGA_REGION y
|
OF_FPGA_REGION y
|
||||||
FPGA_MGR_ZYNQ_FPGA y
|
FPGA_MGR_ZYNQ_FPGA y
|
||||||
OF_OVERLAY y
|
OF_OVERLAY y
|
||||||
|
|
Loading…
Reference in New Issue