Skip to content

Commit

Permalink
applet.interface.qspi_controller: pull up IO0/IO1 also.
Browse files Browse the repository at this point in the history
This prevents reading 50/60 Hz noise from devices that do not drive
their outputs (e.g. a QSPI flash that boots in QPI mode).
  • Loading branch information
whitequark committed Dec 22, 2024
1 parent 41ae999 commit a477a87
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions software/glasgow/applet/interface/qspi_controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,16 @@ def build(self, target, args):

async def run(self, device, args):
iface = await device.demultiplexer.claim_interface(self, self.mux_interface, args,
# Pull IO2 and IO3 high, since on QSPI flashes these correspond to WP# and HOLD#,
# and will interfere with operation in SPI mode. For other devices this is benign.
pull_high={args.pin_set_io[2], args.pin_set_io[3]})
pull_high={
# Pull IO2 and IO3 high, since on QSPI flashes these correspond to WP# and HOLD#,
# and will interfere with operation in SPI mode. For other devices this is benign.
args.pin_set_io[2], args.pin_set_io[3],
# Also pull IO0 and IO1 high. This prevents noise from changing bus state when
# the device is not selected (which should be benign but could cause issues with
# non-compliant devices). In addition, pulling IO1 up prevents reading garbage data
# from devices that do not drive it when selected.
args.pin_set_io[0], args.pin_set_io[1],
})
qspi_iface = QSPIControllerInterface(iface, self.logger)
return qspi_iface

Expand Down

0 comments on commit a477a87

Please sign in to comment.