From 468b916a4f9498c02026af31d89c68e0e6ae9385 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 5 Feb 2021 09:43:32 +0100 Subject: [PATCH] tools/litex_term: add --jtag-config parameter to select OpenOCD JTAG configuration file. --- litex/tools/litex_term.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/litex/tools/litex_term.py b/litex/tools/litex_term.py index 7505fd2e5..d8a2eae9f 100755 --- a/litex/tools/litex_term.py +++ b/litex/tools/litex_term.py @@ -126,7 +126,7 @@ class CrossoverUART: from litex.build.openocd import OpenOCD class JTAGUART: - def __init__(self, config="openocd_xc7_ft2232.cfg", port=20000): # FIXME: add command line arguments + def __init__(self, config="openocd_xc7_ft2232.cfg", port=20000): self.config = config self.port = port @@ -499,6 +499,7 @@ def _get_args(): parser.add_argument("--kernel", default=None, help="Kernel image") parser.add_argument("--kernel-adr", default="0x40000000", help="Kernel address") parser.add_argument("--images", default=None, help="JSON description of the images to load to memory") + parser.add_argument("--jtag-config", default="openocd_xc7_ft2232.cfg", help="OpenOCD JTAG configuration file with jtag_uart") return parser.parse_args() def main(): @@ -508,9 +509,10 @@ def main(): if sys.platform == "win32": if args.port in ["crossover", "jtag_uart"]: raise NotImplementedError - bridge_cls = {"crossover": CrossoverUART, "jtag_uart": JTAGUART}.get(args.port, None) + bridge_cls = {"crossover": CrossoverUART, "jtag_uart": JTAGUART}.get(args.port, None) + bridge_kwargs = {"jtag_uart": {"config": args.jtag_config}}.get(args.port, {}) if bridge_cls is not None: - bridge = bridge_cls() + bridge = bridge_cls(**bridge_kwargs) bridge.open() port = os.ttyname(bridge.name) else: