Commit 18863a8
usb: dwc3: Add support for Apple DWC3
As mad as it sounds, the dwc3 controller present on the Apple M1 must be
reset and reinitialized whenever a device is unplugged from the root
port or when the PHY mode is changed.
This is required for at least the following reasons:
- The USB2 D+/D- lines are connected through a stateful eUSB2 repeater
which in turn is controlled by a variant of the TI TPS6598x USB PD
chip. When the USB PD controller detects a hotplug event it resets
the eUSB2 repeater. Afterwards, no new device is recognized before
the DWC3 core and PHY are reset as well because the eUSB2 repeater
and the PHY/dwc3 block disagree about the current state.
- It's possible to completely break the dwc3 controller by switching
it to device mode and unplugging the cable at just the wrong time.
If this happens dwc3 behaves as if no device is connected.
CORESOFTRESET will also never clear after it has been set. The only
workaround is to trigger a hard reset of the entire dwc3 core with
its external reset line.
- Whenever the PHY mode is changed (to e.g. transition to DisplayPort
alternate mode or USB4) dwc3 has to be shutdown and reinitialized.
Otherwise the Type-C port will not be useable until the entire SoC
has been reset.
All of this can be easily worked around by respecting transitions to
USB_ROLE_NONE and making sure the external reset line is asserted when
switching roles.
Signed-off-by: Sven Peter <sven@svenpeter.dev>1 parent 54f791e commit 18863a8
3 files changed
Lines changed: 67 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
178 | | - | |
| 181 | + | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| |||
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
209 | 230 | | |
210 | | - | |
| 231 | + | |
| 232 | + | |
211 | 233 | | |
212 | | - | |
| 234 | + | |
213 | 235 | | |
214 | 236 | | |
215 | 237 | | |
| |||
1633 | 1655 | | |
1634 | 1656 | | |
1635 | 1657 | | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1636 | 1670 | | |
1637 | 1671 | | |
1638 | 1672 | | |
| |||
2218 | 2252 | | |
2219 | 2253 | | |
2220 | 2254 | | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
2221 | 2271 | | |
2222 | 2272 | | |
2223 | 2273 | | |
| |||
2357 | 2407 | | |
2358 | 2408 | | |
2359 | 2409 | | |
2360 | | - | |
2361 | 2410 | | |
2362 | 2411 | | |
2363 | 2412 | | |
| |||
2384 | 2433 | | |
2385 | 2434 | | |
2386 | 2435 | | |
| 2436 | + | |
2387 | 2437 | | |
2388 | 2438 | | |
2389 | 2439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
| 1156 | + | |
1156 | 1157 | | |
1157 | 1158 | | |
1158 | 1159 | | |
| |||
1387 | 1388 | | |
1388 | 1389 | | |
1389 | 1390 | | |
| 1391 | + | |
| 1392 | + | |
1390 | 1393 | | |
1391 | 1394 | | |
1392 | 1395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
| |||
492 | 495 | | |
493 | 496 | | |
494 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
495 | 502 | | |
496 | 503 | | |
497 | 504 | | |
| |||
502 | 509 | | |
503 | 510 | | |
504 | 511 | | |
505 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
506 | 515 | | |
507 | 516 | | |
508 | 517 | | |
| |||
0 commit comments