Attempt to build for versa ecp5
authorLas Safin <me@las.rs>
Fri, 24 Sep 2021 21:12:53 +0000 (21:12 +0000)
committerLas Safin <me@las.rs>
Fri, 24 Sep 2021 21:12:53 +0000 (21:12 +0000)
flake.nix
nix/ecp5.nix [new file with mode: 0644]
nix/litex.toml

index aa008ffc03fa7ff02cdf3eabda25f3e6a7ab851e..22e6470553916845f8d703518e50c53ba4b133cf 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -57,6 +57,7 @@
 
         libresoc-pre-litex = final.callPackage (import ./nix/pre-litex.nix { version = getv self; }) {};
         libresoc-ls180 = final.callPackage (import ./nix/ls180.nix { version = getv self; }) {};
+        libresoc-ecp5 = final.callPackage (import ./nix/ecp5.nix { version = getv self; }) {};
         libresoc-pinmux = final.callPackage (import ./nix/pinmux.nix { version = getv self; }) {};
       };
 
@@ -65,6 +66,7 @@
         pre-litex = nixpkgsFor.${system}.libresoc-pre-litex;
         pinmux = nixpkgsFor.${system}.libresoc-pinmux;
         ls180 = nixpkgsFor.${system}.libresoc-ls180;
+        ecp5 = nixpkgsFor.${system}.libresoc-ecp5;
         openpower-isa = nixpkgsFor.${system}.python3Packages.libresoc-openpower-isa;
         debugNixpkgs = nixpkgsFor.${system};
       });
diff --git a/nix/ecp5.nix b/nix/ecp5.nix
new file mode 100644 (file)
index 0000000..b3d8196
--- /dev/null
@@ -0,0 +1,38 @@
+{ version }:
+
+{ stdenv, python3Packages, yosys, libresoc-pre-litex, libresoc-pinmux, pkgsCross }:
+
+stdenv.mkDerivation {
+  pname = "libresoc-versa-ecp5";
+  inherit version;
+
+  src = ../src/soc/litex/florent;
+
+  nativeBuildInputs =
+    (with python3Packages; [
+    python libresoc-soc litex-boards litex litedram liteeth liteiclink litescope litesdcard
+    ])
+    ++ [ pkgsCross.powernv.buildPackages.gcc ];
+
+  postPatch = ''
+    patchShebangs --build .
+  '';
+
+  configurePhase = "true";
+
+  buildPhase = ''
+    runHook preBuild
+    export PINMUX="$(mktemp -d)"
+    ln -s ${libresoc-pinmux} "$PINMUX/ls180"
+    cp ${libresoc-pre-litex} libresoc/libresoc.v
+    ./versa_ecp5.py --sys-clk-freq=55e6 --build
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    runHook postInstall
+  '';
+
+  fixupPhase = "true";
+}
index 4c3684caa7c054575679899c5744bfdb1b0c57c1..89317f020719fa9ef5e4f25b9ee200a698e64f24 100644 (file)
@@ -75,3 +75,15 @@ github_user = "litex-hub"
 github_repo = "pythondata-cpu-serv"
 git_revision = "915cdf793395ab48cc52c0225660eb6eeff41133"
 github_archive_nix_hash = "1ndkjhh7r521cc9g63pmjvgvv9sa3s8n2mkdli91nr7ns3q3lxmk"
+
+[litevideo]
+github_user = "enjoy-digital"
+github_repo = "litevideo"
+git_revision = "41f30143075ece3fff5c33a332ed067d1837cbb3"
+github_archive_nix_hash = "06vw4rn8xby8is13275bmkrxlwp3wlznbdqfay78a5m8bp73kypy"
+
+[valentyusb-hw_cdc_eptri]
+github_user = "litex-hub"
+github_repo = "valentyusb"
+git_revision = "a0526ad053c394306ad7a585a7ddd463831ad09d"
+github_archive_nix_hash = "0nad2x5j5rnjyciwm0abxhzng8nrv06ri8g9qdi39zk8n9zy7cmf"