From 0552d8126be3f2ea9f03098afb5cb77049c8d606 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 11 Oct 2025 19:02:45 -0400 Subject: kern: usb: Poll USBSTS.CNR after reset The host needs to wait for the controller to be ready by polling the CNR bit as per section 4.2 of the spec Signed-off-by: Ian Moffett --- src/sys/include/io/usb/xhciregs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sys/include') diff --git a/src/sys/include/io/usb/xhciregs.h b/src/sys/include/io/usb/xhciregs.h index ebaf5d7..85a8630 100644 --- a/src/sys/include/io/usb/xhciregs.h +++ b/src/sys/include/io/usb/xhciregs.h @@ -77,6 +77,12 @@ struct __packed xhci_opregs { */ #define USBCMD_HCRST BIT(1) /* Host controller reset */ +/* + * USB status register bits + * + * See section 5.4.2 of the xHCI spec + */ +#define USBSTS_CNR BIT(11) /* Controller not ready */ /* * Macros to get various register spaces -- cgit v1.2.3