Skip to content

Commit c9c7f87

Browse files
m-bytemaass-hamburg
authored andcommitted
openocd/jtagspi: Allow users to specify additional init commands
This change makes it possible to e.g. use flahs chips that would not be correctly detected by OpenOCD. All that has to be done is to add `init_commands=["jtagspi set 0 \"name\" {size} {pagesize} {read_cmd} 0 {pprg_cmd} {mass_erase_cmd} {sector_size} {sector_erase_cmd}"]`. Signed-off-by: Matthias Breithaupt <[email protected]>
1 parent 30b52e7 commit c9c7f87

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

litex/build/openocd.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ def load_bitstream(self, bitstream):
2727
])
2828
self.call(["openocd", "-f", config, "-c", script])
2929

30-
def flash(self, address, data, set_qe=False):
30+
def flash(self, address, data, set_qe=False, init_commands=[]):
3131
config = self.find_config()
3232
flash_proxy = self.find_flash_proxy()
3333
script = "; ".join([
3434
"init",
35-
"jtagspi_init 0 {{{}}}".format(flash_proxy),
35+
"jtagspi_init 0 {{{}}}".format(flash_proxy)
36+
] + init_commands + [
3637
"jtagspi set_qe 0 1" if set_qe else "",
3738
"jtagspi_program {{{}}} 0x{:x}".format(data, address),
3839
"fpga_program",

0 commit comments

Comments
 (0)