From: Florent Kermarrec Date: Sat, 2 May 2015 14:15:58 +0000 (+0200) Subject: liteusb/frontend/wishbone: use new packetized mode (allow grouping response in a... X-Git-Tag: 24jan2021_ls180~2267 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9ef11620f05a646fe0fb4c8c1a246d42ea51459;p=litex.git liteusb/frontend/wishbone: use new packetized mode (allow grouping response in a single packet) --- diff --git a/misoclib/com/liteusb/frontend/wishbone.py b/misoclib/com/liteusb/frontend/wishbone.py index 8b4d4dc1..c2c00d30 100644 --- a/misoclib/com/liteusb/frontend/wishbone.py +++ b/misoclib/com/liteusb/frontend/wishbone.py @@ -6,9 +6,4 @@ from misoclib.tools.litescope.frontend.wishbone import LiteScopeWishboneBridge class LiteUSBWishboneBridge(LiteScopeWishboneBridge): def __init__(self, port, clk_freq): LiteScopeWishboneBridge.__init__(self, port, clk_freq) - self.comb += [ - port.sink.sop.eq(1), - port.sink.eop.eq(1), - port.sink.length.eq(1), - port.sink.dst.eq(port.tag) - ] + self.comb += port.sink.dst.eq(port.tag) diff --git a/misoclib/com/liteusb/software/ftdi/__init__.py b/misoclib/com/liteusb/software/ftdi/__init__.py index 17e60b40..006868fe 100644 --- a/misoclib/com/liteusb/software/ftdi/__init__.py +++ b/misoclib/com/liteusb/software/ftdi/__init__.py @@ -179,10 +179,15 @@ class UART: self.q = queue.Queue() def get_packet_size(self, buf): - return 10 + payload_size = buf[5] << 24 + payload_size |= buf[6] << 16 + payload_size |= buf[7] << 8 + payload_size |= buf[8] << 0 + return 9 + payload_size def consume(self, buf): - self.q.put(buf[9]) + for value in buf[9:]: + self.q.put(value) def __init__(self, tag): self.tag = tag