Commit 6e9e34aeddd645b25ae4efff55305688d7778e0b

Authored by Peter Chen
Committed by Li Jun
1 parent 89e86c47e3

usb: chipidea: add system interface for ttctrl.ttha

In chipidea IP RTL, there is a very limited design for siTD, the detail
like below:
There is no Max Packet Size at siTD, so it uses one constant for both
Max Packet Size for packet and the packet size for the last transaction
when considering schedule.
If the ttctrl.ttha does not match against Hub Address field in siTD,
this constant is 188 bytes, else this constant is 1023 bytes.

If the ttctrl.ttha is non-zero value, RTL will use 188 as this constant,
so it will lose the data if the packet size is larger than 188 bytes, eg,
if we playback a wav which format is 48khz, 16 bits, 2 channels, the
packet size will be 192bytes, but the controller will only send 188 bytes
for this packet, the noise will be heared using USB audio card.
The use case is single transaction, but higher frame rate.

If the ttctr.ttha is zero value, we can send 1023 bytes within one
transaction, but the controller will not accept the coming tranaction
if it considers the schedule time is less than 1023 bytes. So the
limitation is we can't schedule as many as transactions within frame.
If the total bytes is already 256 bytes for previous transactions within
frame, it can't accept another transaction. The use case is multiple
transactions, but less frame rate.

Signed-off-by: Peter Chen <>
Signed-off-by: Peter Chen <>
(cherry picked from commit 5e07ea7f812f2216263da2acd4f5e677de97fd62)

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -661,6 +661,9 @@
661 661 }
662 662 }
663 663  
  664 + if (of_find_property(dev->of_node, "non-zero-ttctrl-ttha", NULL))
  665 + platdata->flags |= CI_HDRC_SET_NON_ZERO_TTHA;
  666 +
664 667 if (of_find_property(dev->of_node, "ahb-burst-config", NULL)) {
665 668 ret = of_property_read_u32(dev->of_node, "ahb-burst-config",
666 669 &platdata->ahb_burst_config);