From eb0a4b2a4d463166c33050cae5681b016dcc8b74 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 23 Sep 2023 19:28:35 -0400 Subject: [PATCH] Document xHCI port registers --- src/hulk/usb/xhci.d | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/hulk/usb/xhci.d b/src/hulk/usb/xhci.d index a99896c..a367c1f 100644 --- a/src/hulk/usb/xhci.d +++ b/src/hulk/usb/xhci.d @@ -203,12 +203,54 @@ struct XHCI /** * Located at offset 0x400 from start of Operational Registers. + * + * There is one set of these registers for each port of the root hub. */ struct PortRegisters { + /** + * Port Status and Control + * + * 0 Current Connect Status + * 1 Port Enabled/Disabled + * 2 reserved + * 3 Over-current active + * 4 Port Reset + * 8:5 Port Link State + * 9 Port Power + * 13:10 Port Speed + * 15:14 Port Indicator Control + * 16 Port Link State Write Strobe + * 17 Connect Status Change + * 18 Port Enable/Disable Change + * 19 Warm Port Reset Change + * 20 Over-current Change + * 21 Port Reset Change + * 22 Port Link State Change + * 23 Port Config Error Change + * 24 Cold Attach Status + * 25 Wake on Connect Enable + * 26 Wake on Disconnect Enable + * 27 Wake on Over-current Enable + * 29:28 reserved + * 30 Device Removable + * 31 Warm Port Reset + */ uint portsc; + + /** + * Port Power Management Status and Control + */ uint portpmsc; + + /** + * Port Link Info + */ uint portli; + + /** + * Port Hardware LPM Control (xHCI v1.1+) + */ uint porthlpmc; } static assert(PortRegisters.sizeof == 0x10u);