Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) ===============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) Synopsys DesignWare Core SuperSpeed USB 3.0 Controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ===============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) :Author: Felipe Balbi <felipe.balbi@linux.intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) :Date: April 2017
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) The *Synopsys DesignWare Core SuperSpeed USB 3.0 Controller*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) (hereinafter referred to as *DWC3*) is a USB SuperSpeed compliant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) controller which can be configured in one of 4 ways:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 	1. Peripheral-only configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 	2. Host-only configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	3. Dual-Role configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 	4. Hub configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) Linux currently supports several versions of this controller. In all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) likelyhood, the version in your SoC is already supported. At the time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) of this writing, known tested versions range from 2.02a to 3.10a. As a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) rule of thumb, anything above 2.02a should work reliably well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) Currently, we have many known users for this driver. In alphabetical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) order:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	1. Cavium
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	2. Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	3. Qualcomm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	4. Rockchip
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	5. ST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	6. Samsung
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	7. Texas Instruments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	8. Xilinx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) Summary of Features
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) ======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) For details about features supported by your version of DWC3, consult
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) your IP team and/or *Synopsys DesignWare Core SuperSpeed USB 3.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) Controller Databook*. Following is a list of features supported by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) driver at the time of this writing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	1. Up to 16 bidirectional endpoints (including the control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	   pipe - ep0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	2. Flexible endpoint configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	3. Simultaneous IN and OUT transfer support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	4. Scatter-list support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	5. Up to 256 TRBs [#trb]_ per endpoint
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	6. Support for all transfer types (*Control*, *Bulk*,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	   *Interrupt*, and *Isochronous*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	7. SuperSpeed Bulk Streams
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	8. Link Power Management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	9. Trace Events for debugging
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	10. DebugFS [#debugfs]_ interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) These features have all been exercised with many of the **in-tree**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) gadget drivers. We have verified both *ConfigFS* [#configfs]_ and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) legacy gadget drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) Driver Design
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) The DWC3 driver sits on the *drivers/usb/dwc3/* directory. All files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) related to this driver are in this one directory. This makes it easy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) for new-comers to read the code and understand how it behaves.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) Because of DWC3's configuration flexibility, the driver is a little
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) complex in some places but it should be rather straightforward to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) understand.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) The biggest part of the driver refers to the Gadget API.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) Known Limitations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) Like any other HW, DWC3 has its own set of limitations. To avoid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) constant questions about such problems, we decided to document them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) here and have a single location to where we could point users.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) OUT Transfer Size Requirements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) ---------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) According to Synopsys Databook, all OUT transfer TRBs [#trb]_ must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) have their *size* field set to a value which is integer divisible by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) the endpoint's *wMaxPacketSize*. This means that *e.g.* in order to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) receive a Mass Storage *CBW* [#cbw]_, req->length must either be set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) to a value that's divisible by *wMaxPacketSize* (1024 on SuperSpeed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 512 on HighSpeed, etc), or DWC3 driver must add a Chained TRB pointing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) to a throw-away buffer for the remaining length. Without this, OUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) transfers will **NOT** start.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) Note that as of this writing, this won't be a problem because DWC3 is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) fully capable of appending a chained TRB for the remaining length and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) completely hide this detail from the gadget driver. It's still worth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) mentioning because this seems to be the largest source of queries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) about DWC3 and *non-working transfers*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) TRB Ring Size Limitation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) -------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) We, currently, have a hard limit of 256 TRBs [#trb]_ per endpoint,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) with the last TRB being a Link TRB [#link_trb]_ pointing back to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) first. This limit is arbitrary but it has the benefit of adding up to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) exactly 4096 bytes, or 1 Page.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) DWC3 driver will try its best to cope with more than 255 requests and,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) for the most part, it should work normally. However this is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) something that has been exercised very frequently. If you experience
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) any problems, see section **Reporting Bugs** below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) Reporting Bugs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) Whenever you encounter a problem with DWC3, first and foremost you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) should make sure that:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	1. You're running latest tag from `Linus' tree`_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	2. You can reproduce the error without any out-of-tree changes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	   to DWC3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	3. You have checked that it's not a fault on the host machine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) After all these are verified, then here's how to capture enough
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) information so we can be of any help to you.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) Required Information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) DWC3 relies exclusively on Trace Events for debugging. Everything is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) exposed there, with some extra bits being exposed to DebugFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) [#debugfs]_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) In order to capture DWC3's Trace Events you should run the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) commands **before** plugging the USB cable to a host machine:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) .. code-block:: sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		 # mkdir -p /d
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		 # mkdir -p /t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		 # mount -t debugfs none /d
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		 # mount -t tracefs none /t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		 # echo 81920 > /t/buffer_size_kb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		 # echo 1 > /t/events/dwc3/enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) After this is done, you can connect your USB cable and reproduce the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) problem. As soon as the fault is reproduced, make a copy of files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) ``trace`` and ``regdump``, like so:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) .. code-block:: sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		# cp /t/trace /root/trace.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		# cat /d/*dwc3*/regdump > /root/regdump.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) Make sure to compress ``trace.txt`` and ``regdump.txt`` in a tarball
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) and email it to `me`_ with `linux-usb`_ in Cc. If you want to be extra
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) sure that I'll help you, write your subject line in the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) format:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	**[BUG REPORT] usb: dwc3: Bug while doing XYZ**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) On the email body, make sure to detail what you doing, which gadget
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) driver you were using, how to reproduce the problem, what SoC you're
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) using, which OS (and its version) was running on the Host machine.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) With all this information, we should be able to understand what's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) going on and be helpful to you.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) Debugging
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) First and foremost a disclaimer::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)   DISCLAIMER: The information available on DebugFS and/or TraceFS can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)   change at any time at any Major Linux Kernel Release. If writing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)   scripts, do **NOT** assume information to be available in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)   current format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) With that out of the way, let's carry on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) If you're willing to debug your own problem, you deserve a round of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) applause :-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) Anyway, there isn't much to say here other than Trace Events will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) really helpful in figuring out issues with DWC3. Also, access to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) Synopsys Databook will be **really** valuable in this case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) A USB Sniffer can be helpful at times but it's not entirely required,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) there's a lot that can be understood without looking at the wire.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) Feel free to email `me`_ and Cc `linux-usb`_ if you need any help.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) ``DebugFS``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) ``DebugFS`` is very good for gathering snapshots of what's going on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) with DWC3 and/or any endpoint.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) On DWC3's ``DebugFS`` directory, you will find the following files and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) directories:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) ``ep[0..15]{in,out}/``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) ``link_state``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) ``regdump``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) ``testmode``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) ``link_state``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) ``````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) When read, ``link_state`` will print out one of ``U0``, ``U1``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) ``U2``, ``U3``, ``SS.Disabled``, ``RX.Detect``, ``SS.Inactive``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) ``Polling``, ``Recovery``, ``Hot Reset``, ``Compliance``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) ``Loopback``, ``Reset``, ``Resume`` or ``UNKNOWN link state``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) This file can also be written to in order to force link to one of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) states above.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) ``regdump``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) `````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) File name is self-explanatory. When read, ``regdump`` will print out a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) register dump of DWC3. Note that this file can be grepped to find the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) information you want.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) ``testmode``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) ``````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) When read, ``testmode`` will print out a name of one of the specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) USB 2.0 Testmodes (``test_j``, ``test_k``, ``test_se0_nak``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) ``test_packet``, ``test_force_enable``) or the string ``no test`` in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) case no tests are currently being executed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) In order to start any of these test modes, the same strings can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) written to the file and DWC3 will enter the requested test mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) ``ep[0..15]{in,out}``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) ``````````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) For each endpoint we expose one directory following the naming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) convention ``ep$num$dir`` *(ep0in, ep0out, ep1in, ...)*. Inside each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) of these directories you will find the following files:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) ``descriptor_fetch_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) ``event_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) ``rx_fifo_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) ``rx_info_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) ``rx_request_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) ``transfer_type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) ``trb_ring``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) ``tx_fifo_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) ``tx_request_queue``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) With access to Synopsys Databook, you can decode the information on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) ``transfer_type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) ~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) When read, ``transfer_type`` will print out one of ``control``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) ``bulk``, ``interrupt`` or ``isochronous`` depending on what the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) endpoint descriptor says. If the endpoint hasn't been enabled yet, it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) will print ``--``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) ``trb_ring``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) ~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) When read, ``trb_ring`` will print out details about all TRBs on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) ring. It will also tell you where our enqueue and dequeue pointers are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) located in the ring:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) .. code-block:: sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)    
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 		buffer_addr,size,type,ioc,isp_imi,csp,chn,lst,hwo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 		000000002c75c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 		000000002c75c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 		000000002c784000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 		000000002c784000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 		000000002c784000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		000000002c784000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 		000000002c75c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 		000000002c75c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 		000000002c780000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 		000000002c784000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 		000000002c788000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 		000000002c78c000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 		000000002c790000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 		000000002c754000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 		000000002c758000,481,normal,1,0,1,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 		000000002c75c000,512,normal,1,0,1,0,0,1        D
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0       E 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) 		0000000000000000,0,UNKNOWN,0,0,0,0,0,0         
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 		00000000381ab000,0,link,0,0,0,0,0,1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) Trace Events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) DWC3 also provides several trace events which help us gathering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) information about the behavior of the driver during runtime.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) In order to use these events, you must enable ``CONFIG_FTRACE`` in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) your kernel config.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) For details about how enable DWC3 events, see section **Reporting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) Bugs**.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) The following subsections will give details about each Event Class and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) each Event defined by DWC3.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) MMIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) ```````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) It is sometimes useful to look at every MMIO access when looking for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) bugs. Because of that, DWC3 offers two Trace Events (one for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) dwc3_readl() and one for dwc3_writel()). ``TP_printk`` follows::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555)   TP_printk("addr %p value %08x", __entry->base + __entry->offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)   		__entry->value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) Interrupt Events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) ````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) Every IRQ event can be logged and decoded into a human readable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) string. Because every event will be different, we don't give an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) example other than the ``TP_printk`` format used::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565)   TP_printk("event (%08x): %s", __entry->event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566)   		dwc3_decode_event(__entry->event, __entry->ep0state))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) Control Request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) `````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) Every USB Control Request can be logged to the trace buffer. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) output format is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574)   TP_printk("%s", dwc3_decode_ctrl(__entry->bRequestType,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575)   				__entry->bRequest, __entry->wValue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576)   				__entry->wIndex, __entry->wLength)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)   )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) Note that Standard Control Requests will be decoded into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) human-readable strings with their respective arguments. Class and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) Vendor requests will be printed out a sequence of 8 bytes in hex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) Lifetime of a ``struct usb_request``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) ```````````````````````````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) The entire lifetime of a ``struct usb_request`` can be tracked on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) trace buffer. We have one event for each of allocation, free,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) queueing, dequeueing, and giveback. Output format is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591)   TP_printk("%s: req %p length %u/%u %s%s%s ==> %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592)   	__get_str(name), __entry->req, __entry->actual, __entry->length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593)   	__entry->zero ? "Z" : "z",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594)   	__entry->short_not_ok ? "S" : "s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595)   	__entry->no_interrupt ? "i" : "I",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596)   	__entry->status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)   )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) Generic Commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) ````````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) We can log and decode every Generic Command with its completion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) code. Format is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605)   TP_printk("cmd '%s' [%x] param %08x --> status: %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)   	dwc3_gadget_generic_cmd_string(__entry->cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)   	__entry->cmd, __entry->param,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608)   	dwc3_gadget_generic_cmd_status_string(__entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)   )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) Endpoint Commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) ````````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) Endpoints commands can also be logged together with completion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) code. Format is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617)   TP_printk("%s: cmd '%s' [%d] params %08x %08x %08x --> status: %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618)   	__get_str(name), dwc3_gadget_ep_cmd_string(__entry->cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619)   	__entry->cmd, __entry->param0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620)   	__entry->param1, __entry->param2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621)   	dwc3_ep_cmd_status_string(__entry->cmd_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622)   )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) Lifetime of a ``TRB``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) ``````````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) A ``TRB`` Lifetime is simple. We are either preparing a ``TRB`` or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) completing it. With these two events, we can see how a ``TRB`` changes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) over time. Format is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631)   TP_printk("%s: %d/%d trb %p buf %08x%08x size %s%d ctrl %08x (%c%c%c%c:%c%c:%s)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632)   	__get_str(name), __entry->queued, __entry->allocated,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633)   	__entry->trb, __entry->bph, __entry->bpl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634)   	({char *s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635)   	int pcm = ((__entry->size >> 24) & 3) + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636)   	switch (__entry->type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637)   	case USB_ENDPOINT_XFER_INT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638)   	case USB_ENDPOINT_XFER_ISOC:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639)   		switch (pcm) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640)   		case 1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641)   			s = "1x ";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642)   			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643)   		case 2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644)   			s = "2x ";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645)   			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646)   		case 3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647)   			s = "3x ";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648)   			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649)   		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650)   	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651)   		s = "";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652)   	} s; }),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653)   	DWC3_TRB_SIZE_LENGTH(__entry->size), __entry->ctrl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654)   	__entry->ctrl & DWC3_TRB_CTRL_HWO ? 'H' : 'h',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655)   	__entry->ctrl & DWC3_TRB_CTRL_LST ? 'L' : 'l',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656)   	__entry->ctrl & DWC3_TRB_CTRL_CHN ? 'C' : 'c',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657)   	__entry->ctrl & DWC3_TRB_CTRL_CSP ? 'S' : 's',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658)   	__entry->ctrl & DWC3_TRB_CTRL_ISP_IMI ? 'S' : 's',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659)   	__entry->ctrl & DWC3_TRB_CTRL_IOC ? 'C' : 'c',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660)       dwc3_trb_type_string(DWC3_TRBCTL_TYPE(__entry->ctrl))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661)   )  
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) Lifetime of an Endpoint
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) ```````````````````````
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) And endpoint's lifetime is summarized with enable and disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) operations, both of which can be traced. Format is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)   TP_printk("%s: mps %d/%d streams %d burst %d ring %d/%d flags %c:%c%c%c%c%c:%c:%c",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670)   	__get_str(name), __entry->maxpacket,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671)   	__entry->maxpacket_limit, __entry->max_streams,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672)   	__entry->maxburst, __entry->trb_enqueue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673)   	__entry->trb_dequeue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674)   	__entry->flags & DWC3_EP_ENABLED ? 'E' : 'e',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675)   	__entry->flags & DWC3_EP_STALL ? 'S' : 's',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676)   	__entry->flags & DWC3_EP_WEDGE ? 'W' : 'w',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677)   	__entry->flags & DWC3_EP_TRANSFER_STARTED ? 'B' : 'b',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678)   	__entry->flags & DWC3_EP_PENDING_REQUEST ? 'P' : 'p',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679)   	__entry->flags & DWC3_EP_END_TRANSFER_PENDING ? 'E' : 'e',
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680)   	__entry->direction ? '<' : '>'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681)   )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) Structures, Methods and Definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) ====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) .. kernel-doc:: drivers/usb/dwc3/core.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688)    :doc: main data structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689)    :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) .. kernel-doc:: drivers/usb/dwc3/gadget.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692)    :doc: gadget-only helpers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693)    :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) .. kernel-doc:: drivers/usb/dwc3/gadget.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696)    :doc: gadget-side implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697)    :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) .. kernel-doc:: drivers/usb/dwc3/core.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700)    :doc: core driver (probe, PM, etc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701)    :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702)    
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) .. [#trb] Transfer Request Block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) .. [#link_trb] Transfer Request Block pointing to another Transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) 	       Request Block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) .. [#debugfs] The Debug File System
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) .. [#configfs] The Config File System
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) .. [#cbw] Command Block Wrapper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) .. _Linus' tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) .. _me: felipe.balbi@linux.intel.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) .. _linux-usb: linux-usb@vger.kernel.org