Merge branch 'master' into migen_update_35203d6

pull/63/head
mwojcik 2021-08-03 15:19:23 +08:00
commit 954e562801
7 changed files with 60 additions and 84 deletions

View File

@ -6,7 +6,7 @@ let
mkdir -p $out/fake-conda; mkdir -p $out/fake-conda;
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files. # work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${bscan_spi_bitstreams} workaround-conda cp --no-preserve=mode,ownership -L -R ${bscan_spi_bitstreams} workaround-conda
pushd workaround-conda pushd workaround-conda
tar cf $out/src.tar . tar cf $out/src.tar .
popd popd

View File

@ -2,7 +2,8 @@
with pkgs; with pkgs;
let let
artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0"; artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0";
pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = artiq6; }; artiq7 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "7.0";
pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = artiq7; };
boards = [ boards = [
{ target = "kasli"; variant = "tester"; } { target = "kasli"; variant = "tester"; }
@ -35,7 +36,7 @@ let
libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; }; libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; };
artiq = callPackage ./pkgs/artiq.nix { inherit pythonDeps binutils-or1k binutils-arm llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; }; artiq = callPackage ./pkgs/artiq.nix { inherit pythonDeps binutils-or1k binutils-arm llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; };
artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; }); artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; });
openocd = callPackage ./pkgs/openocd.nix { autoreconfHook = pkgs.autoreconfHook269 or pkgs.autoreconfHook; }; openocd = callPackage ./pkgs/openocd.nix { };
}; };
condaNoarch = { condaNoarch = {
@ -76,7 +77,7 @@ let
}; };
conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix { conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix {
inherit pkgs; inherit pkgs;
inherit (mainPackages.openocd) bscan_spi_bitstreams; bscan_spi_bitstreams = "${mainPackages.openocd}/share/bscan-spi-bitstreams";
}; };
conda-artiq = import ./conda/artiq.nix { inherit pkgs; }; conda-artiq = import ./conda/artiq.nix { inherit pkgs; };
conda-asyncserial = import ./conda/build.nix { inherit pkgs; } { conda-asyncserial = import ./conda/build.nix { inherit pkgs; } {

View File

@ -0,0 +1,24 @@
diff --git a/src/flash/nor/spi.c b/src/flash/nor/spi.c
index af72ffc4..e5c9a9bd 100644
--- a/src/flash/nor/spi.c
+++ b/src/flash/nor/spi.c
@@ -90,8 +90,8 @@ const struct flash_device flash_devices[] = {
FLASH_ID("mac 25r6435f", 0x03, 0x00, 0x02, 0xd8, 0xc7, 0x001728c2, 0x100, 0x10000, 0x800000),
FLASH_ID("micron n25q064", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0017ba20, 0x100, 0x10000, 0x800000),
FLASH_ID("micron n25q128", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0018ba20, 0x100, 0x10000, 0x1000000),
- FLASH_ID("micron n25q256 3v", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0019ba20, 0x100, 0x10000, 0x2000000),
- FLASH_ID("micron n25q256 1.8v", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0019bb20, 0x100, 0x10000, 0x2000000),
+ FLASH_ID("micron n25q256 3v", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0019ba20, 0x100, 0x10000, 0x2000000),
+ FLASH_ID("micron n25q256 1.8v", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0019bb20, 0x100, 0x10000, 0x2000000),
FLASH_ID("micron mt25ql512", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0020ba20, 0x100, 0x10000, 0x4000000),
FLASH_ID("micron mt25ql01", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0021ba20, 0x100, 0x10000, 0x8000000),
FLASH_ID("micron mt25ql02", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0022ba20, 0x100, 0x10000, 0x10000000),
@@ -124,7 +124,7 @@ const struct flash_device flash_devices[] = {
FLASH_ID("issi is25lp064", 0x03, 0x00, 0x02, 0xd8, 0xc7, 0x0017609d, 0x100, 0x10000, 0x800000),
FLASH_ID("issi is25lp128d", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0018609d, 0x100, 0x10000, 0x1000000),
FLASH_ID("issi is25wp128d", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0018709d, 0x100, 0x10000, 0x1000000),
- FLASH_ID("issi is25lp256d", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0019609d, 0x100, 0x10000, 0x2000000),
+ FLASH_ID("issi is25lp256d", 0x03, 0xeb, 0x02, 0xd8, 0xc7, 0x0019609d, 0x100, 0x10000, 0x2000000),
FLASH_ID("issi is25wp256d", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x0019709d, 0x100, 0x10000, 0x2000000),
FLASH_ID("issi is25lp512m", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x001a609d, 0x100, 0x10000, 0x4000000),
FLASH_ID("issi is25wp512m", 0x13, 0xec, 0x12, 0xdc, 0xc7, 0x001a709d, 0x100, 0x10000, 0x4000000),

View File

@ -1,74 +1,26 @@
{ stdenv, lib, fetchFromGitHub, autoreconfHook, libftdi, libusb1, pkgconfig, hidapi }: { stdenv, buildEnv, lib, fetchFromGitHub, openocd }:
let
stdenv.mkDerivation rec { bscan_spi_bitstreams-pkg = stdenv.mkDerivation {
pname = "openocd-mlabs"; name = "bscan_spi_bitstreams";
version = "0.10.0"; src = fetchFromGitHub {
src = fetchFromGitHub {
owner = "m-labs";
repo = "openocd";
fetchSubmodules = true;
rev = "c383a57adcff332b2c5cf8d55a84626285b42c2c";
sha256 = "0xlj9cs72acx3zqagvr7f1c0v6lnqhl8fgrlhgmhmvk5n9knk492";
};
bscan_spi_bitstreams = fetchFromGitHub {
owner = "quartiq"; owner = "quartiq";
repo = "bscan_spi_bitstreams"; repo = "bscan_spi_bitstreams";
rev = "01d8f819f15baf9a8cc5d96945a51e4d267ff564"; rev = "01d8f819f15baf9a8cc5d96945a51e4d267ff564";
sha256 = "1zqv47kzgvbn4c8cr019a6wcja7gn5h1z4kvw5bhpc72fyhagal9"; sha256 = "1zqv47kzgvbn4c8cr019a6wcja7gn5h1z4kvw5bhpc72fyhagal9";
}; };
phases = ["installPhase"];
nativeBuildInputs = [ pkgconfig ]; installPhase =
buildInputs = [ autoreconfHook libftdi libusb1 hidapi ]; ''
mkdir -p $out/share/bscan-spi-bitstreams
configureFlags = [ cp $src/*.bit $out/share/bscan-spi-bitstreams
"--enable-jtag_vpi"
"--enable-usb_blaster_libftdi"
"--enable-amtjtagaccel"
"--enable-gw16012"
"--enable-presto_libftdi"
"--enable-openjtag_ftdi"
"--enable-oocd_trace"
"--enable-buspirate"
"--enable-sysfsgpio"
"--enable-remote-bitbang"
"--disable-werror"
];
NIX_CFLAGS_COMPILE = [
"-Wno-implicit-fallthrough"
"-Wno-format-truncation"
"-Wno-format-overflow"
"-Wno-error=tautological-compare"
];
postInstall = ''
mkdir -p "$out/etc/udev/rules.d"
rules="$out/share/openocd/contrib/60-openocd.rules"
if [ ! -f "$rules" ]; then
echo "$rules is missing, must update the Nix file."
exit 1
fi
ln -s "$rules" "$out/etc/udev/rules.d/"
mkdir -p "$out/share/bscan-spi-bitstreams"
cp ${bscan_spi_bitstreams}/*.bit "$out/share/bscan-spi-bitstreams"
'';
meta = with lib; {
description = "Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing";
longDescription = ''
OpenOCD provides on-chip programming and debugging support with a layered
architecture of JTAG interface and TAP support, debug target support
(e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.). Several
network interfaces are available for interactiving with OpenOCD: HTTP,
telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
"remote target" for source-level debugging of embedded systems using the
GNU GDB program.
''; '';
homepage = http://openocd.sourceforge.net/;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ sb0 ];
platforms = platforms.linux;
}; };
} # https://docs.lambdaconcept.com/screamer/troubleshooting.html#error-contents-differ
openocd-fixed = openocd.overrideAttrs(oa: {
patches = oa.patches or [] ++ [ ./openocd-jtagspi.diff ];
});
in
buildEnv {
name = "openocd-bscanspi";
paths = [ openocd-fixed bscan_spi_bitstreams-pkg ];
}

View File

@ -86,21 +86,21 @@ rec {
misoc = python3Packages.buildPythonPackage { misoc = python3Packages.buildPythonPackage {
pname = "misoc"; pname = "misoc";
version = if misoc-new then "unstable-2021-02-15" else "unstable-2020-05-29"; version = if misoc-new then "unstable-2021-07-29" else "unstable-2021-02-15";
src = if misoc-new src = if misoc-new
then (fetchFromGitHub { then (fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "misoc"; repo = "misoc";
rev = "d84551418042cea0891ea743442e20684b51e77a"; rev = "f048d1fbfd48c93542d2f1e591139f95c7c9cde6";
sha256 = "1id5qjr9dl4r3vi6jdn7dfpnr2wb08nrm3nfscn18clbbdxybyjn"; sha256 = "1ny0d0q6mnjsxq746q4chn2grfac8brs4w60k9fxk2h5abvfgij8";
fetchSubmodules = true; fetchSubmodules = true;
}) })
else (fetchFromGitHub { else (fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "misoc"; repo = "misoc";
rev = "7e5fe8d38835175202dad2c51d37b20b76fd9e16"; rev = "d84551418042cea0891ea743442e20684b51e77a";
sha256 = "0i8bppz7x2s45lx9n49c0r87pqps09z35yzc17amvx21qsplahxn"; sha256 = "1id5qjr9dl4r3vi6jdn7dfpnr2wb08nrm3nfscn18clbbdxybyjn";
fetchSubmodules = true; fetchSubmodules = true;
}); });

View File

@ -45,7 +45,6 @@ in
export SZL=${szlEnv} export SZL=${szlEnv}
pushd ${<artiq-zynq>} pushd ${<artiq-zynq>}
export NIX_SSHOPTS="-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_rsa" export NIX_SSHOPTS="-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_rsa"
ssh $NIX_SSHOPTS rpi-4 "nix-store -r ${<nixpkgs>} --add-root openocd-pkgs --indirect && nix-env -e openocd && nix-env -iA openocd -f openocd-pkgs && rm openocd-pkgs"
bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -o "$NIX_SSHOPTS" -d ${artiq-zynq.zc706-nist_qc2-jtag} bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -o "$NIX_SSHOPTS" -d ${artiq-zynq.zc706-nist_qc2-jtag}
popd popd

View File

@ -65,7 +65,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-21.05", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-6 1", "emailresponsible": false } "artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-6 1", "emailresponsible": false }
} }
@ -82,7 +82,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-21.05", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false }, "sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false } "artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }
@ -100,7 +100,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-21.05", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"a6p": { "type": "boolean", "value": "true" }, "a6p": { "type": "boolean", "value": "true" },
"artiq-board-generated": { "type": "sysbuild", "value": "artiq:board-generated:generated-nix", "emailresponsible": false } "artiq-board-generated": { "type": "sysbuild", "value": "artiq:board-generated:generated-nix", "emailresponsible": false }
@ -119,7 +119,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-21.05", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-5 1", "emailresponsible": false } "artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git release-5 1", "emailresponsible": false }
} }
@ -136,7 +136,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-21.05", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false }, "sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
"a6p": { "type": "boolean", "value": "false" }, "a6p": { "type": "boolean", "value": "false" },
@ -220,7 +220,7 @@
"emailoverride": "", "emailoverride": "",
"keepnr": 10, "keepnr": 10,
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-20.09", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs nixos-21.05", "emailresponsible": false },
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }, "artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false },
"artiq-zynq": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/artiq-zynq.git release-6", "emailresponsible": false }, "artiq-zynq": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/artiq-zynq.git release-6", "emailresponsible": false },