From: Florent Kermarrec Date: Sun, 22 Mar 2015 09:56:56 +0000 (+0100) Subject: liteusb: make oe_n optional on ft2232h phy X-Git-Tag: 24jan2021_ls180~2447 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c77562f44b5abae4dbee361784bc070ed5af9419;p=litex.git liteusb: make oe_n optional on ft2232h phy --- diff --git a/misoclib/com/liteusb/phy/ft2232h.py b/misoclib/com/liteusb/phy/ft2232h.py index 6f5461b0..05b9cedd 100644 --- a/misoclib/com/liteusb/phy/ft2232h.py +++ b/misoclib/com/liteusb/phy/ft2232h.py @@ -3,7 +3,7 @@ from migen.flow.actor import * from migen.actorlib.fifo import AsyncFIFO from migen.fhdl.specials import * -from liteusb.ftdi.std import * +from misoclib.com.liteusb.common import * class FtdiPHY(Module): def __init__(self, pads, fifo_depth=32, read_time=16, write_time=16): @@ -100,7 +100,12 @@ class FtdiPHY(Module): data_r = Signal(dw) data_oe = Signal() - pads.oe_n.reset = 1 + if hasattr(pads, "oe_n"): + pads_oe_n = pads.oe_n + else: + pads_oe_n = Signal() + + pads_oe_n.reset = 1 pads.rd_n.reset = 1 pads.wr_n.reset = 1 @@ -108,14 +113,14 @@ class FtdiPHY(Module): If(fsm.ongoing("READ"), data_oe.eq(0), - pads.oe_n.eq(0), + pads_oe_n.eq(0), pads.rd_n.eq(~wants_read), pads.wr_n.eq(1) ).Elif(fsm.ongoing("WRITE"), data_oe.eq(1), - pads.oe_n.eq(1), + pads_oe_n.eq(1), pads.rd_n.eq(1), pads.wr_n.eq(~wants_write), @@ -124,7 +129,7 @@ class FtdiPHY(Module): ).Else( data_oe.eq(1), - pads.oe_n.eq(~fsm.ongoing("WTR")), + pads_oe_n.eq(~fsm.ongoing("WTR")), pads.rd_n.eq(1), pads.wr_n.eq(1) ),