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: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 87bea67c5e71
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 20eb2d27b98e
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Apr 6, 2019

  1. Copy the full SHA
    35beeb6 View commit details
  2. applet.memory.onfi: unconditionally reset all targets.

    Not doing this caused incorrect Read ID result.
    whitequark committed Apr 6, 2019
    Copy the full SHA
    20eb2d2 View commit details
Showing with 8 additions and 4 deletions.
  1. +8 −4 software/glasgow/applet/memory/onfi/__init__.py
12 changes: 8 additions & 4 deletions software/glasgow/applet/memory/onfi/__init__.py
Original file line number Diff line number Diff line change
@@ -327,9 +327,7 @@ async def _do_read(self, command, address=[], wait=False, length=0):

async def reset(self):
self._log("reset")
await self._do(command=0xff)
await self.lower.flush()
await asyncio.sleep(0.001) # tRST=1000us
await self._do(command=0xff, wait=True)

async def _read_id(self, address, length):
self._log("read ID addr=%#04x", address)
@@ -466,6 +464,12 @@ async def run(self, device, args):
iface = await device.demultiplexer.claim_interface(self, self.mux_interface, args)
onfi_iface = ONFIInterface(iface, self.logger)

# Reset every target, to make sure all of them are in a defined state and aren't driving
# the shared data bus.
for chip in range(len(args.pin_set_ce)):
await onfi_iface.select(chip)
await onfi_iface.reset()

available_ce = range(1, 1 + len(args.pin_set_ce))
if args.chip not in available_ce:
raise GlasgowAppletError("cannot select chip {}; available select signals are {}"
@@ -554,7 +558,7 @@ async def interact(self, device, args, onfi_iface):
# First four bytes of Read ID are often used as-is in data recovery software,
# so print these for convenience as well.
signature = await onfi_iface.read_signature()
self.logger.info("ID signature %s",
self.logger.info("ID signature: %s",
" ".join("{:02x}".format(byte) for byte in signature))

onfi_param = None