From df993402533209f7fcd2d734fac1b01397bf834f Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 24 Sep 2021 21:12:53 +0000 Subject: [PATCH] Attempt to build for versa ecp5 --- flake.nix | 2 ++ nix/ecp5.nix | 38 ++++++++++++++++++++++++++++++++++++++ nix/litex.toml | 12 ++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 nix/ecp5.nix diff --git a/flake.nix b/flake.nix index aa008ffc..22e64705 100644 --- 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 index 00000000..b3d8196f --- /dev/null +++ b/nix/ecp5.nix @@ -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"; +} diff --git a/nix/litex.toml b/nix/litex.toml index 4c3684ca..89317f02 100644 --- a/nix/litex.toml +++ b/nix/litex.toml @@ -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" -- 2.30.2