Configure arm linux toolchain #54

Merged
sb10q merged 1 commits from fsagbuya/nix-servo:linux-toolchain into master 2024-08-17 17:37:24 +08:00
1 changed files with 20 additions and 5 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