osmo-e1-hardware/firmware/ice40-riscv/icE1usb
Sylvain Munaut 2de84f804e icE1usb fw: Better flow regulation mechanism
* FIFO target level :

   - The '8 * 16' makes no sense as the FIFO was 128 so this
     is the "full" case and could never be that high.

   - We tighten up the margin around 5 * 16 which is the "target"
     level for the FIFO

 * FIFO size :

   We also increase the FIFO size to 256 frames. This doesn't
   actually affect latency since the target level is the same,
   but it allows more leeway to recover without data loss in
   case something goes wrong.

 * Ticks :

   We don't bother using ticks ... the current algo wasn't
   working (or rather not doing anything all that useful),
   because the difference between USB clock and E1 clock is
   tiny and measured over 1 ms, it's not meaningful.

   So for the time being we just sent the nominal rate biased
   with the FIFO level to keep it on target and this seems
   to work fine.

   It'd be nice to have a good long term estimate of the rate
   to minimize the jitter, but it doesn't seem to be strictly
   required for operation for now.

 * Misc cleanup :

   Just do all in one function instead of splitting the check
   if BD needs refill and the actual refill.

This gets rid of sporadic 'TX FIFO Overflow' conditions
by properly handling the case where we have a bit too much
data.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ibd3bc9080961cc56093e43ab9a824840e84c24d2
2022-01-09 19:19:14 +01:00
..
.gitignore fw/icE1usb: Import firmware for the icE1usb and icE1usb-proto boards 2020-09-14 10:56:49 +02:00
Makefile icE1usb fw: Use #define's in descriptors for interface/endpoints ID 2022-01-09 17:21:04 +01:00
config.h fw/icE1usb: Import firmware for the icE1usb and icE1usb-proto boards 2020-09-14 10:56:49 +02:00
e1.c icE1usb fw: Better flow regulation mechanism 2022-01-09 19:19:14 +01:00
e1.h icE1usb fw: Add multi-port support for e1.{c,h} 2022-01-09 17:21:04 +01:00
e1_hw.h icE1usb fw: Put E1 IP core register related #defines in e1_hw.h 2020-12-27 14:09:02 +01:00
fw_app.c icE1usb fw: Add multi-port support in USB code 2022-01-09 19:18:08 +01:00
ice1usb_proto.h icE1usb firmware: Detect A-bit in TS0; report via USB + LED 2022-01-02 12:42:35 +01:00
misc.c icE1usb fw: Expose the ticks from multiple E1 ports in misc.{c,h} 2022-01-09 17:21:04 +01:00
misc.h icE1usb fw: Expose the ticks from multiple E1 ports in misc.{c,h} 2022-01-09 17:21:04 +01:00
usb_desc_app.c icE1usb fw: Add multi-port support in USB code 2022-01-09 19:18:08 +01:00
usb_desc_ids.h icE1usb fw: Add multi-port support in USB code 2022-01-09 19:18:08 +01:00
usb_e1.c icE1usb fw: Better flow regulation mechanism 2022-01-09 19:19:14 +01:00
usb_e1.h icE1usb fw: Add multi-port support in USB code 2022-01-09 19:18:08 +01:00
usb_str_app.txt icE1usb fw: Add multi-port support in USB code 2022-01-09 19:18:08 +01:00