From 936f24f6bdf47e577d3e7d73a330797542596ba8 Mon Sep 17 00:00:00 2001 From: occheung Date: Tue, 11 Jul 2023 20:53:12 -0700 Subject: [PATCH] artiq_flash: support efc --- artiq/frontend/artiq_flash.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 136b58c71..5df4f81d7 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -59,7 +59,7 @@ Prerequisites: help="SSH host to jump through") parser.add_argument("-t", "--target", default="kasli", help="target board, default: %(default)s, one of: " - "kasli kc705") + "kasli kc705 efc") parser.add_argument("-I", "--preinit-command", default=[], action="append", help="add a pre-initialization OpenOCD command. " "Useful for selecting a board when several are connected.") @@ -215,10 +215,16 @@ class ProgrammerXC7(Programmer): Programmer.__init__(self, client, preinit_script) self._proxy = proxy - add_commands(self._board_script, - "source {boardfile}", - boardfile=self._transfer_script("board/{}.cfg".format(board))) - self.add_flash_bank("spi0", "xc7", index=0) + if board != "efc": + add_commands(self._board_script, + "source {boardfile}", + boardfile=self._transfer_script("board/{}.cfg".format(board))) + self.add_flash_bank("spi0", "xc7", index=0) + else: + add_commands(self._board_script, + "source efc.cfg" + ) + self.add_flash_bank("spi0", "xc7", index=0) add_commands(self._script, "xadc_report xc7.tap") @@ -242,6 +248,13 @@ def main(): "storage": ("spi0", 0x440000), "firmware": ("spi0", 0x450000), }, + "efc": { + "programmer": partial(ProgrammerXC7, board="efc", proxy="bscan_spi_xc7a100t.bit"), + "gateware": ("spi0", 0x000000), + "bootloader": ("spi0", 0x400000), + "storage": ("spi0", 0x440000), + "firmware": ("spi0", 0x450000), + }, "kc705": { "programmer": partial(ProgrammerXC7, board="kc705", proxy="bscan_spi_xc7k325t.bit"), "gateware": ("spi0", 0x000000),