1
0
Fork 0

Compare commits

..

3 Commits

3 changed files with 35 additions and 34 deletions

View File

@ -27,6 +27,19 @@
];
};
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: {
pkgsCross = super.pkgsCross // {
zynq-baremetal = import super.path {
@ -38,6 +51,10 @@
gcc.fpu = "vfpv3";
};
};
zynq-armv7l-linux = import super.path {
system = "x86_64-linux";
inherit crossSystem;
};
};
});
@ -132,7 +149,7 @@
"${patched-not-os}/zynq_image.nix"
];
system = "x86_64-linux";
crossSystem.system = "armv7l-linux";
inherit crossSystem;
});
fast-servo-gateware = pkgs.stdenv.mkDerivation rec {
@ -234,9 +251,7 @@
dontFixup = true;
};
u-boot = let
fast-servo-dts = fast-servo/fast-servo.dts;
in (pkgs.pkgsCross.armv7l-hf-multiplatform.buildUBoot {
u-boot = (pkgs.pkgsCross.zynq-armv7l-linux.buildUBoot {
defconfig = "xilinx_zynq_virt_defconfig";
patches = [] ++ pkgs.lib.optional (board == "fast-servo") ./fast-servo/u-boot.patch;
preConfigure = ''
@ -259,7 +274,7 @@
filesToInstall = [ "u-boot.elf" ];
}).overrideAttrs (oldAttrs: {
postUnpack = ''
cp ${fast-servo-dts} $sourceRoot/arch/arm/dts/zynq-fast-servo.dts
cp ${fast-servo/fast-servo.dts} $sourceRoot/arch/arm/dts/zynq-fast-servo.dts
'';
postInstall = ''
mkdir -p $out/dts

View File

@ -151,10 +151,10 @@ index c61f9d6..fbdf0fd 100644
};
}
diff --git a/zynq_image.nix b/zynq_image.nix
index 3fa23ab..e2e3871 100644
index 3fa23ab..9d1621e 100644
--- a/zynq_image.nix
+++ b/zynq_image.nix
@@ -1,66 +1,102 @@
@@ -1,66 +1,89 @@
-{ config, pkgs, ... }:
+{ lib, config, pkgs, ... }:
@ -163,22 +163,7 @@ index 3fa23ab..e2e3871 100644
- # dont use overlays for the qemu, it causes a lot of wasted time on recompiles
- x86pkgs = import pkgs.path { system = "x86_64-linux"; };
- 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 {
+ customKernel = (pkgs.linux.override {
extraConfig = ''
OVERLAY_FS y
+ MEDIA_SUPPORT n
@ -195,14 +180,15 @@ index 3fa23ab..e2e3871 100644
+ OF_OVERLAY y
'';
- };
- customKernelPackages = pkgs.linuxPackagesFor customKernel;
+ }).overrideAttrs (oa: {
+ postInstall = ''
+ if [ -e arch/arm/boot/uImage ]; then
+ cp arch/arm/boot/uImage $out
+ fi
+ ${oa.postInstall}
+ '';
+ });
+ customKernelPackages = crosspkgs.linuxPackagesFor customKernel;
customKernelPackages = pkgs.linuxPackagesFor customKernel;
in {
imports = [ ./arm32-cross-fixes.nix ];
boot.kernelPackages = customKernelPackages;
@ -253,12 +239,12 @@ index 3fa23ab..e2e3871 100644
- chmod +x qemu-script
- patchShebangs qemu-script
- ls -ltrh
'';
- '';
- system.build.rpi_image_tar = pkgs.runCommand "dist.tar" {} ''
- mkdir -p $out/nix-support
- tar -cvf $out/dist.tar ${config.system.build.rpi_image}
- echo "file binary-dist $out/dist.tar" >> $out/nix-support/hydra-build-products
- '';
'';
- environment.systemPackages = [ pkgs.strace ];
- environment.etc."service/getty/run".source = pkgs.writeShellScript "getty" ''
- agetty ttyPS0 115200

View File

@ -1062,13 +1062,13 @@ index 0000000..59aa585
++
+ #endif /*_LINUX_FPGA_MGR_H */
diff --git a/zynq_image.nix b/zynq_image.nix
index e2e3871..2decd54 100644
index 9d1621e..012e50c 100644
--- a/zynq_image.nix
+++ b/zynq_image.nix
@@ -18,6 +18,16 @@ let
};
};
customKernel = (crosspkgs.linux.override {
@@ -3,6 +3,16 @@
with lib;
let
customKernel = (pkgs.linux.override {
+ kernelPatches = [
+ ({
+ name = "xilinx-configfs-overlays";
@ -1082,7 +1082,7 @@ index e2e3871..2decd54 100644
extraConfig = ''
OVERLAY_FS y
MEDIA_SUPPORT n
@@ -32,6 +42,7 @@ let
@@ -17,6 +27,7 @@ let
OF_FPGA_REGION y
FPGA_MGR_ZYNQ_FPGA y
OF_OVERLAY y