From eb90adf89f932e1c88e15e965bc71b5a78f17bf0 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 4 Feb 2022 16:53:41 +0800 Subject: [PATCH] remove old nix files --- default.nix | 162 ---------------------------------------------------- shell.nix | 35 ------------ zynq-rs.nix | 8 --- 3 files changed, 205 deletions(-) delete mode 100644 default.nix delete mode 100644 shell.nix delete mode 100644 zynq-rs.nix diff --git a/default.nix b/default.nix deleted file mode 100644 index bfb67e2..0000000 --- a/default.nix +++ /dev/null @@ -1,162 +0,0 @@ -let - zynq-rs = (import ./zynq-rs.nix); - pkgs = import { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; }; - rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; }); - cargo-xbuild = (import zynq-rs).cargo-xbuild; - mkbootimage = import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; }; - artiqpkgs = import { inherit pkgs; }; - vivado = import { inherit pkgs; }; - # FSBL configuration supplied by Vivado 2020.1 for these boards: - fsblTargets = ["zc702" "zc706" "zed"]; - sat_variants = [ - # kasli-soc satellite variants - "satellite" - # zc706 satellite variants - "nist_clock_satellite" "nist_qc2_satellite" "acpki_nist_clock_satellite" "acpki_nist_qc2_satellite" - "nist_clock_satellite_100mhz" "nist_qc2_satellite_100mhz" "acpki_nist_clock_satellite_100mhz" "acpki_nist_qc2_satellite_100mhz" - ]; - build = { target, variant, json ? null }: let - szl = (import zynq-rs)."${target}-szl"; - fsbl = import "${zynq-rs}/nix/fsbl.nix" { - inherit pkgs; - board = target; - }; - fwtype = if builtins.elem variant sat_variants then "satman" else "runtime"; - - firmware = rustPlatform.buildRustPackage rec { - # note: due to fetchCargoTarball, cargoSha256 depends on package name - name = "firmware"; - - src = ./src; - cargoSha256 = "sha256-uCqCeqXbTjTDEoZERPDb3kX+CTfzSJ/jGlrFxuKO8HQ="; - - nativeBuildInputs = [ - pkgs.gnumake - (pkgs.python3.withPackages(ps: (with artiqpkgs; [ ps.jsonschema migen migen-axi misoc artiq ]))) - cargo-xbuild - pkgs.llvmPackages_9.llvm - pkgs.llvmPackages_9.clang-unwrapped - ]; - buildPhase = '' - export XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library" - export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include" - export CARGO_HOME=$(mktemp -d cargo-home.XXX) - make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${fwtype} - ''; - - installPhase = '' - mkdir -p $out $out/nix-support - cp ../build/${fwtype}.bin $out/${fwtype}.bin - cp ../build/firmware/armv7-none-eabihf/release/${fwtype} $out/${fwtype}.elf - echo file binary-dist $out/${fwtype}.bin >> $out/nix-support/hydra-build-products - echo file binary-dist $out/${fwtype}.elf >> $out/nix-support/hydra-build-products - ''; - - doCheck = false; - dontFixup = true; - }; - gateware = pkgs.runCommand "${target}-${variant}-gateware" - { - nativeBuildInputs = [ - (pkgs.python3.withPackages(ps: (with artiqpkgs; [ ps.jsonschema migen migen-axi misoc artiq ]))) - vivado - ]; - } - '' - python ${./src/gateware}/${target}.py -g build ${if json == null then "-V ${variant}" else json} - mkdir -p $out $out/nix-support - cp build/top.bit $out - echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products - ''; - - # SZL startup - jtag = pkgs.runCommand "${target}-${variant}-jtag" {} - '' - mkdir $out - ln -s ${szl}/szl.elf $out - ln -s ${firmware}/${fwtype}.bin $out - ln -s ${gateware}/top.bit $out - ''; - sd = pkgs.runCommand "${target}-${variant}-sd" - { - buildInputs = [ mkbootimage ]; - } - '' - # Do not use "long" paths in boot.bif, because embedded developers - # can't write software (mkbootimage will segfault). - bifdir=`mktemp -d` - cd $bifdir - ln -s ${szl}/szl.elf szl.elf - ln -s ${firmware}/${fwtype}.elf ${fwtype}.elf - ln -s ${gateware}/top.bit top.bit - cat > boot.bif << EOF - the_ROM_image: - { - [bootloader]szl.elf - top.bit - ${fwtype}.elf - } - EOF - mkdir $out $out/nix-support - mkbootimage boot.bif $out/boot.bin - echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products - ''; - - # FSBL startup - fsbl-sd = pkgs.runCommand "${target}-${variant}-fsbl-sd" - { - buildInputs = [ mkbootimage ]; - } - '' - bifdir=`mktemp -d` - cd $bifdir - ln -s ${fsbl}/fsbl.elf fsbl.elf - ln -s ${gateware}/top.bit top.bit - ln -s ${firmware}/${fwtype}.elf ${fwtype}.elf - cat > boot.bif << EOF - the_ROM_image: - { - [bootloader]fsbl.elf - top.bit - ${fwtype}.elf - } - EOF - mkdir $out $out/nix-support - mkbootimage boot.bif $out/boot.bin - echo file binary-dist $out/boot.bin >> $out/nix-support/hydra-build-products - ''; - in { - "${target}-${variant}-firmware" = firmware; - "${target}-${variant}-gateware" = gateware; - "${target}-${variant}-jtag" = jtag; - "${target}-${variant}-sd" = sd; - } // ( - if builtins.elem target fsblTargets - then { - "${target}-${variant}-fsbl-sd" = fsbl-sd; - } - else {} - ); -in - ( - (build { target = "zc706"; variant = "nist_clock"; }) // - (build { target = "zc706"; variant = "nist_clock_master"; }) // - (build { target = "zc706"; variant = "nist_clock_satellite"; }) // - (build { target = "zc706"; variant = "nist_clock_satellite_100mhz"; }) // - (build { target = "zc706"; variant = "nist_qc2"; }) // - (build { target = "zc706"; variant = "nist_qc2_master"; }) // - (build { target = "zc706"; variant = "nist_qc2_satellite"; }) // - (build { target = "zc706"; variant = "nist_qc2_satellite_100mhz"; }) // - (build { target = "zc706"; variant = "acpki_nist_clock"; }) // - (build { target = "zc706"; variant = "acpki_nist_clock_master"; }) // - (build { target = "zc706"; variant = "acpki_nist_clock_satellite"; }) // - (build { target = "zc706"; variant = "acpki_nist_clock_satellite_100mhz"; }) // - (build { target = "zc706"; variant = "acpki_nist_qc2"; }) // - (build { target = "zc706"; variant = "acpki_nist_qc2_master"; }) // - (build { target = "zc706"; variant = "acpki_nist_qc2_satellite"; }) // - (build { target = "zc706"; variant = "acpki_nist_qc2_satellite_100mhz"; }) // - (build { target = "kasli_soc"; variant = "demo"; json = ./demo.json; }) // - (build { target = "kasli_soc"; variant = "master"; json = ./kasli-soc-master.json; }) // - (build { target = "kasli_soc"; variant = "satellite"; json = ./kasli-soc-satellite.json; }) // - { inherit zynq-rs; } - ) diff --git a/shell.nix b/shell.nix deleted file mode 100644 index cb95c25..0000000 --- a/shell.nix +++ /dev/null @@ -1,35 +0,0 @@ -let - zynq-rs = (import ./zynq-rs.nix); - pkgs = import { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; }; - rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; }); - cargo-xbuild = (import zynq-rs).cargo-xbuild; - artiq-fast = ; - artiqpkgs = import "${artiq-fast}/default.nix" { inherit pkgs; }; - vivado = import "${artiq-fast}/vivado.nix" { inherit pkgs; }; -in - pkgs.stdenv.mkDerivation { - name = "artiq-zynq-env"; - buildInputs = [ - pkgs.gnumake - rustPlatform.rust.rustc - rustPlatform.rust.cargo - pkgs.llvmPackages_9.llvm - pkgs.llvmPackages_9.clang-unwrapped - pkgs.cacert - cargo-xbuild - - pkgs.openocd - pkgs.openssh pkgs.rsync - - (pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc artiq artiq-netboot ps.jsonschema ps.pyftdi ]))) - vivado - artiqpkgs.binutils-arm - - (import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; }) - ]; - - XARGO_RUST_SRC = "${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library"; - CLANG_EXTRA_INCLUDE_DIR = "${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include"; - OPENOCD_ZYNQ = "${zynq-rs}/openocd"; - SZL = "${(import zynq-rs).szl}"; - } diff --git a/zynq-rs.nix b/zynq-rs.nix deleted file mode 100644 index d62c6b0..0000000 --- a/zynq-rs.nix +++ /dev/null @@ -1,8 +0,0 @@ -let - pkgs = import {}; -in - pkgs.fetchgit { - url = "https://git.m-labs.hk/M-Labs/zynq-rs.git"; - rev = "57d8d8fbc7087863305721bcb8fdbdd13d65bd65"; - sha256 = "0gnbaxgingrxrxi2sjd592r1630ld4ckrz4r8ajx8zp7q3bb43jj"; - }