Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e1fb23ddbd94
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 46f6594e1ae8
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 26, 2019

  1. applet.jtag: pulse TRST# and reset TAPs when run.

    Almost all circumstances make this sensible. The rare applet that
    needs to, specifically, not reset the test chain when run, can opt
    out of this explicitly.
    
    Before this commit, the jtag-mips applet would crash at startup.
    whitequark committed Feb 26, 2019
    Copy the full SHA
    da71e22 View commit details
  2. Copy the full SHA
    46f6594 View commit details
11 changes: 6 additions & 5 deletions software/glasgow/applet/jtag/__init__.py
Original file line number Diff line number Diff line change
@@ -662,9 +662,13 @@ def build(self, target, args):
period_cyc=target.sys_clk_freq // (args.frequency * 1000),
))

async def run(self, device, args):
async def run(self, device, args, reset=True):
iface = await device.demultiplexer.claim_interface(self, self.mux_interface, args)
return JTAGInterface(iface, self.logger)
jtag_iface = JTAGInterface(iface, self.logger)
if reset:
await jtag_iface.pulse_trst()
await jtag_iface.test_reset()
return jtag_iface

@classmethod
def add_interact_arguments(cls, parser):
@@ -719,9 +723,6 @@ def add_interact_arguments(cls, parser):
help="select TAP #INDEX for communication (default: %(default)s)")

async def interact(self, device, args, jtag_iface):
await jtag_iface.pulse_trst()
await jtag_iface.test_reset()

if args.operation in ("scan", "enumerate-ir"):
dr_value = await jtag_iface.scan_dr(max_length=args.max_dr_length)
if dr_value is None:
2 changes: 0 additions & 2 deletions software/glasgow/applet/jtag_arc/__init__.py
Original file line number Diff line number Diff line change
@@ -127,8 +127,6 @@ def add_run_arguments(cls, parser, access):

async def run(self, device, args):
jtag_iface = await super().run(device, args)
await jtag_iface.test_reset()

tap_iface = await jtag_iface.select_tap(args.tap_index)
if not tap_iface:
raise GlasgowAppletError("cannot select TAP #%d" % args.tap_index)
4 changes: 2 additions & 2 deletions software/glasgow/applet/jtag_mips/__init__.py
Original file line number Diff line number Diff line change
@@ -163,6 +163,8 @@ async def _probe(self):
self._check_state("probe", "Probe")

await self._read_impcode()
self._logger.info("found CPU with IMPCODE=%#10x", self._impcode.to_int())

await self._scan_address_length()

self.bits = 64 if self._impcode.MIPS32_64 else 32
@@ -823,8 +825,6 @@ def add_run_arguments(cls, parser, access):

async def run(self, device, args):
jtag_iface = await super().run(device, args)
await jtag_iface.pulse_trst()

tap_iface = await jtag_iface.select_tap(args.tap_index)
if not tap_iface:
raise GlasgowAppletError("cannot select TAP #%d" % args.tap_index)
4 changes: 2 additions & 2 deletions software/glasgow/arch/mips/ejtag.py
Original file line number Diff line number Diff line change
@@ -46,11 +46,11 @@
DR_IMPCODE = Bitfield("DR_IMPCODE", 4, [
("MIPS32_64", 1),
("TypeInfo", 10),
("Type", 2),
("Type", 3),
("NoDMA", 1),
(None, 1),
("MIPS16", 1),
(None, 3),
(None, 4),
("ASID_Size", 2),
(None, 1),
("DINT_sup", 1),