dfii: drive ODT and RESET_N
authorSebastien Bourdeauducq <sb@m-labs.hk>
Fri, 8 Aug 2014 13:56:35 +0000 (21:56 +0800)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Fri, 8 Aug 2014 13:56:35 +0000 (21:56 +0800)
misoclib/dfii/__init__.py
software/include/hw/flags.h

index 22a5bcd5e905bcc8d9280d54df84796941e94610..69d45ad0ebabf8884afc69a1f3f9d992b2bbe82d 100644 (file)
@@ -40,7 +40,7 @@ class DFIInjector(Module, AutoCSR):
                self.slave = dfi.Interface(a, ba, d, nphases)
                self.master = dfi.Interface(a, ba, d, nphases)
                
-               self._control = CSRStorage(2) # sel, cke
+               self._control = CSRStorage(4) # sel, cke, odt, reset_n
                
                for n, phase in enumerate(inti.phases):
                        setattr(self.submodules, "pi" + str(n), PhaseInjector(phase))
@@ -53,3 +53,5 @@ class DFIInjector(Module, AutoCSR):
                                inti.connect(self.master)
                        )
                self.comb += [phase.cke.eq(self._control.storage[1]) for phase in inti.phases]
+               self.comb += [phase.odt.eq(self._control.storage[2]) for phase in inti.phases if hasattr(phase, "odt")]
+               self.comb += [phase.reset_n.eq(self._control.storage[3]) for phase in inti.phases if hasattr(phase, "reset_n")]
index 7b0db6eb46b37aa7f349655ffbd39f3eda7ef7de..01682e4c156e88ef99b791a17ea93f419c3a0a6a 100644 (file)
@@ -4,8 +4,10 @@
 #define UART_EV_TX     0x1
 #define UART_EV_RX     0x2
 
-#define DFII_CONTROL_SEL       0x01
-#define DFII_CONTROL_CKE       0x02
+#define DFII_CONTROL_SEL               0x01
+#define DFII_CONTROL_CKE               0x02
+#define DFII_CONTROL_ODT               0x04
+#define DFII_CONTROL_RESET_N   0x08
 
 #define DFII_COMMAND_CS                0x01
 #define DFII_COMMAND_WE                0x02