targets/nexys4ddr: make sdcard reset conditional
authorGabriel Somlo <gsomlo@gmail.com>
Thu, 19 Mar 2020 22:20:30 +0000 (18:20 -0400)
committerGabriel Somlo <gsomlo@gmail.com>
Fri, 20 Mar 2020 01:51:44 +0000 (21:51 -0400)
litex/boards/targets/nexys4ddr.py

index 7c1da7c12584007a5ed056bb01bd5308a8471b04..bae5b1f17528054b33127e9fedfb5a7b22c67df5 100755 (executable)
@@ -87,7 +87,8 @@ class BaseSoC(SoCCore):
 
     def add_sdcard(self):
         sdcard_pads = self.platform.request("sdcard")
-        self.comb += sdcard_pads.rst.eq(0)
+        if hasattr(sdcard_pads, "rst"):
+            self.comb += sdcard_pads.rst.eq(0)
         self.submodules.sdclk = SDClockerS7(sys_clk_freq=self.sys_clk_freq)
         self.submodules.sdphy = SDPHY(sdcard_pads, self.platform.device)
         self.submodules.sdcore = SDCore(self.sdphy)