build/openfpgaloader/flash: Add external parameter to allow flashing external SPI Flash when available.

This commit is contained in:
Florent Kermarrec 2021-09-17 14:37:14 +02:00
parent 24f0432253
commit 8ccb1a91c9

View file

@ -25,8 +25,10 @@ class OpenFPGALoader(GenericProgrammer):
self.cmd += ["--bitstream", bitstream_file]
self.call(self.cmd)
def flash(self, address, data_file):
def flash(self, address, data_file, external=False):
self.cmd += ["--write-flash", "--bitstream", data_file]
if external:
self.cmd += ["--external-flash"]
if address:
self.cmd.append("--offset")
self.cmd.append(address)