From 1727d3017553a370e7c3e871f57bed2c9f9e3751 Mon Sep 17 00:00:00 2001 From: Kanken6174 Date: Fri, 13 Dec 2024 20:16:41 +0100 Subject: [PATCH] simple flash fix for the efinix T20 MIPI DK --- litex_boards/targets/efinix_trion_t20_mipi_dev_kit.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litex_boards/targets/efinix_trion_t20_mipi_dev_kit.py b/litex_boards/targets/efinix_trion_t20_mipi_dev_kit.py index 92133db..344e7e1 100755 --- a/litex_boards/targets/efinix_trion_t20_mipi_dev_kit.py +++ b/litex_boards/targets/efinix_trion_t20_mipi_dev_kit.py @@ -77,6 +77,7 @@ class BaseSoC(SoCCore): def main(): from litex.build.parser import LiteXArgumentParser parser = LiteXArgumentParser(platform=efinix_trion_t20_mipi_dev_kit.Platform, description="LiteX SoC on Efinix Trion T20 MIPI Dev Kit.") + parser.add_target_argument("--flash", action="store_true", help="Flash bitstream.") parser.add_target_argument("--sys-clk-freq", default=100e6, type=float, help="System clock frequency.") parser.add_target_argument("--with-spi-flash", action="store_true", help="Enable SPI Flash (MMAPed).") args = parser.parse_args() @@ -93,5 +94,10 @@ def main(): prog = soc.platform.create_programmer() prog.load_bitstream(builder.get_bitstream_filename(mode="sram")) + if args.flash: + from litex.build.openfpgaloader import OpenFPGALoader + prog = OpenFPGALoader("trion_t120_bga576") + prog.flash(0, builder.get_bitstream_filename(mode="flash", ext=".hex")) # FIXME + if __name__ == "__main__": main()