@@ -21,22 +21,28 @@ menu "USB-OTG"
2121 FIFOS: RX (for all IN packets), Non-periodic TX (for Bulk and Control OUT packets), and Periodic TX
2222 (for Interrupt and Isochronous OUT packets). This configuration option allows biasing the FIFO sizes
2323 towards a particular use case, which may be necessary for devices that have endpoints with large MPS.
24- The MPS limits for each biasing are listed below:
24+
25+ The FIFO allocation formulas (where D = otg_dfifo_depth, Total = Total available FIFO size in lines):
2526
2627 Balanced:
27- - IN (all transfer types), 408 bytes
28- - OUT non-periodic (Bulk/Control), 192 bytes (i.e., 3 x 64 byte packets)
29- - OUT periodic (Interrupt/Isochronous), 192 bytes
28+ - IN (RX FIFO) = Total - D/4 - D/8
29+ - OUT non-periodic (Non-periodic TX FIFO) = D/4
30+ - OUT periodic (Periodic TX FIFO) = D/8
3031
3132 Bias IN:
32- - IN (all transfer types), 600 bytes
33- - OUT non-periodic (Bulk/Control), 64 bytes (i.e., 1 x 64 byte packets)
34- - OUT periodic (Interrupt/Isochronous), 128 bytes
33+ - IN (RX FIFO) = Total - D/16 - D/8
34+ - OUT non-periodic (Non-periodic TX FIFO) = D/16
35+ - OUT periodic (Periodic TX FIFO) = D/8
3536
3637 Bias Periodic OUT:
37- - IN (all transfer types), 128 bytes
38- - OUT non-periodic (Bulk/Control), 64 bytes (i.e., 1 x 64 byte packets)
39- - OUT periodic (Interrupt/Isochronous), 600 bytes
38+ - IN (RX FIFO) = D/8 + 2 (2 extra lines for status information)
39+ - OUT non-periodic (Non-periodic TX FIFO) = D/16
40+ - OUT periodic (Periodic TX FIFO) = Total - D/16 - (D/8 + 2)
41+
42+ Note:
43+ - Each line = 4 bytes. To convert FIFO size: bytes = lines × 4
44+ - D (otg_dfifo_depth) is typically 256 for FS PHY, 1024 for HS PHY (chip-dependent)
45+ - Total is slightly less than D due to controller overhead
4046
4147 config USB_HOST_HW_BUFFER_BIAS_BALANCED
4248 bool "Balanced"
0 commit comments