cores/spi_flash/S7SPIFlash: make cs_n optional in pads (when driven externally)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 14 Aug 2019 05:35:45 +0000 (07:35 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 14 Aug 2019 05:35:45 +0000 (07:35 +0200)
litex/soc/cores/spi_flash.py

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