icE1usb fw: Tweak descriptors in preparation for dual port support

In dual port mode we can't have 388 bytes wMaxPacket size, that's
too much reserved bandwidth.

So we dial that back to 292 which is the minimum we can use. We need
4 bytes for header, then 256 byte of nominal transfer size then 32
more byte for potentially one more frame than nominal to compensate
differences between E1 clock and USB clock.

We obviously need to adapt the code filling up the packets to respect
that more restricted size ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I700adeb909e7955db0d15c6e2beade3d38b21e01
diff --git a/firmware/ice40-riscv/icE1usb/usb_desc_app.c b/firmware/ice40-riscv/icE1usb/usb_desc_app.c
index ec01854..663be0b 100644
--- a/firmware/ice40-riscv/icE1usb/usb_desc_app.c
+++ b/firmware/ice40-riscv/icE1usb/usb_desc_app.c
@@ -90,7 +90,7 @@
 				.bEndpointAddress	= USB_EP_E1_INT(0),
 				.bmAttributes		= 0x03,
 				.wMaxPacketSize		= 10,
-				.bInterval		= 3,
+				.bInterval		= 4,	/* every 4 ms */
 			},
 		},
 		.on = {
@@ -110,7 +110,7 @@
 				.bDescriptorType	= USB_DT_EP,
 				.bEndpointAddress	= USB_EP_E1_IN(0),
 				.bmAttributes		= 0x05,
-				.wMaxPacketSize		= 388,
+				.wMaxPacketSize		= 292,
 				.bInterval		= 1,
 			},
 			.ep_data_out = {
@@ -118,7 +118,7 @@
 				.bDescriptorType	= USB_DT_EP,
 				.bEndpointAddress	= USB_EP_E1_OUT(0),
 				.bmAttributes		= 0x05,
-				.wMaxPacketSize		= 388,
+				.wMaxPacketSize		= 292,
 				.bInterval		= 1,
 			},
 			.ep_fb = {
@@ -126,8 +126,8 @@
 				.bDescriptorType	= USB_DT_EP,
 				.bEndpointAddress	= USB_EP_E1_FB(0),
 				.bmAttributes		= 0x11,
-				.wMaxPacketSize		= 8,
-				.bInterval		= 3,
+				.wMaxPacketSize		= 3,
+				.bInterval		= 3,	/* every 2^(3-1) = 4 ms */
 			},
 			.ep_interrupt = {
 				.bLength		= sizeof(struct usb_ep_desc),
@@ -135,7 +135,7 @@
 				.bEndpointAddress	= USB_EP_E1_INT(0),
 				.bmAttributes		= 0x03,
 				.wMaxPacketSize		= 10,
-				.bInterval		= 3,
+				.bInterval		= 4,	/* every 4 ms */
 			},
 		},
 	},