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: { crosspkgs-overlay = (self: super: {
pkgsCross = super.pkgsCross // { pkgsCross = super.pkgsCross // {
zynq-baremetal = import super.path { zynq-baremetal = import super.path {
@ -38,6 +51,10 @@
gcc.fpu = "vfpv3"; 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" "${patched-not-os}/zynq_image.nix"
]; ];
system = "x86_64-linux"; system = "x86_64-linux";
crossSystem.system = "armv7l-linux"; inherit crossSystem;
}); });
fast-servo-gateware = pkgs.stdenv.mkDerivation rec { fast-servo-gateware = pkgs.stdenv.mkDerivation rec {
@ -234,9 +251,7 @@
dontFixup = true; dontFixup = true;
}; };
u-boot = let u-boot = (pkgs.pkgsCross.zynq-armv7l-linux.buildUBoot {
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 = ''
@ -259,7 +274,7 @@
filesToInstall = [ "u-boot.elf" ]; filesToInstall = [ "u-boot.elf" ];
}).overrideAttrs (oldAttrs: { }).overrideAttrs (oldAttrs: {
postUnpack = '' 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 = '' postInstall = ''
mkdir -p $out/dts mkdir -p $out/dts