build/openocd: Fix tap name for zynq_7000

zynq_7000 have a special tap name fpr PL defined in openocd
config file.

Just hardcode it here.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
This commit is contained in:
Jiaxun Yang 2024-03-05 21:42:59 +00:00
parent 35dd87499c
commit 18720e29cc
1 changed files with 9 additions and 2 deletions

View File

@ -40,6 +40,12 @@ class OpenOCD(GenericProgrammer):
])
self.call(["openocd", "-f", config, "-c", script])
def get_tap_name(self, config):
cfg_str = open(config).read()
if "zynq_7000" in cfg_str:
return "zynq_pl.bs"
return "$_CHIPNAME.tap"
def get_ir(self, chain, config):
cfg_str = open(config).read()
# Lattice ECP5.
@ -98,6 +104,7 @@ class OpenOCD(GenericProgrammer):
- TX valid : bit 9
"""
config = self.find_config()
tap_name = self.get_tap_name(config)
ir = self.get_ir(chain, config)
endstate = self.get_endstate(config)
cfg = """
@ -186,8 +193,8 @@ proc jtagstream_serve {tap port} {
script = "; ".join([
"init",
"poll off",
"irscan $_CHIPNAME.tap {:d}".format(ir),
"jtagstream_serve $_CHIPNAME.tap {:d}".format(port),
"irscan {} {:d}".format(tap_name, ir),
"jtagstream_serve {} {:d}".format(tap_name, port),
"exit",
])
self.call(["openocd", "-f", config, "-f", "stream.cfg", "-c", script])