cores/spi_flash/S7SPIFlash: make cs_n optional in pads (when driven externally)

This commit is contained in:
Florent Kermarrec 2019-08-14 07:35:45 +02:00
parent 383c05e239
commit 6d5fddc160
1 changed files with 2 additions and 2 deletions

View File

@ -337,9 +337,9 @@ class S7SPIFlash(Module, AutoCSR):
pads.vpp.reset = 1 pads.vpp.reset = 1
if hasattr(pads, "hold"): if hasattr(pads, "hold"):
pads.hold.reset = 1 pads.hold.reset = 1
if hasattr(pads, "cs_n"):
self.comb += pads.cs_n.eq(spi.pads.cs_n)
self.comb += [ self.comb += [
pads.cs_n.eq(spi.pads.cs_n),
pads.mosi.eq(spi.pads.mosi), pads.mosi.eq(spi.pads.mosi),
spi.pads.miso.eq(pads.miso) spi.pads.miso.eq(pads.miso)
] ]