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 <m.breithaupt@vogl-electronic.com>
This commit is contained in:
parent
41b346d141
commit
e29dc39377
|
@ -27,12 +27,13 @@ class OpenOCD(GenericProgrammer):
|
||||||
])
|
])
|
||||||
self.call(["openocd", "-f", config, "-c", script])
|
self.call(["openocd", "-f", config, "-c", script])
|
||||||
|
|
||||||
def flash(self, address, data, set_qe=False):
|
def flash(self, address, data, set_qe=False, init_commands=[]):
|
||||||
config = self.find_config()
|
config = self.find_config()
|
||||||
flash_proxy = self.find_flash_proxy()
|
flash_proxy = self.find_flash_proxy()
|
||||||
script = "; ".join([
|
script = "; ".join([
|
||||||
"init",
|
"init",
|
||||||
"jtagspi_init 0 {{{}}}".format(flash_proxy),
|
"jtagspi_init 0 {{{}}}".format(flash_proxy)
|
||||||
|
] + init_commands + [
|
||||||
"jtagspi set_qe 0 1" if set_qe else "",
|
"jtagspi set_qe 0 1" if set_qe else "",
|
||||||
"jtagspi_program {{{}}} 0x{:x}".format(data, address),
|
"jtagspi_program {{{}}} 0x{:x}".format(data, address),
|
||||||
"fpga_program",
|
"fpga_program",
|
||||||
|
|
Loading…
Reference in New Issue