diff --git a/litex_boards/platforms/ecpix5.py b/litex_boards/platforms/ecpix5.py index 7f47db3..7e7e51b 100644 --- a/litex_boards/platforms/ecpix5.py +++ b/litex_boards/platforms/ecpix5.py @@ -6,7 +6,7 @@ from litex.build.generic_platform import * from litex.build.lattice import LatticePlatform -from litex.build.lattice.programmer import OpenOCDJTAGProgrammer +from litex.build.openfpgaloader import OpenFPGALoader # IOs ---------------------------------------------------------------------------------------------- @@ -152,7 +152,7 @@ class Platform(LatticePlatform): LatticePlatform.__init__(self, f"LFE5UM5G-{device}-8BG554I", _io, _connectors, toolchain=toolchain, **kwargs) def create_programmer(self): - return OpenOCDJTAGProgrammer("openocd_ecpix5.cfg") + return OpenFPGALoader("ecpix5") def do_finalize(self, fragment): LatticePlatform.do_finalize(self, fragment) diff --git a/litex_boards/targets/ecpix5.py b/litex_boards/targets/ecpix5.py index 1e2dc8b..d904402 100755 --- a/litex_boards/targets/ecpix5.py +++ b/litex_boards/targets/ecpix5.py @@ -134,6 +134,7 @@ def main(): parser = argparse.ArgumentParser(description="LiteX SoC on ECPIX-5") parser.add_argument("--build", action="store_true", help="Build bitstream") parser.add_argument("--load", action="store_true", help="Load bitstream") + parser.add_argument("--flash", action="store_true", help="Flash bitstream to SPI Flash") parser.add_argument("--device", default="85F", help="ECP5 device (default: 85F)") parser.add_argument("--sys-clk-freq", default=75e6, help="System clock frequency (default: 75MHz)") parser.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support") @@ -156,7 +157,11 @@ def main(): if args.load: prog = soc.platform.create_programmer() - prog.load_bitstream(os.path.join(builder.gateware_dir, soc.build_name + ".svf")) + prog.load_bitstream(os.path.join(builder.gateware_dir, soc.build_name + ".bit")) + + if args.flash: + prog = soc.platform.create_programmer() + prog.flash(None, os.path.join(builder.gateware_dir, soc.build_name + ".bit")) if __name__ == "__main__": main()