summaryrefslogtreecommitdiff
path: root/src/sys/include/io
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-11 18:54:34 -0400
committerIan Moffett <ian@osmora.org>2025-10-11 18:54:34 -0400
commitf07c51164e75ffa25b570e2233713b5a2cfa275a (patch)
treeffab76799d7604783d176b20b1c6e33b93f33c68 /src/sys/include/io
parent306ce899c22efccea03a2ea196f8fa550383b40f (diff)
kern: xhci: Implement controller hard reset
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/io')
-rw-r--r--src/sys/include/io/usb/xhciregs.h14
-rw-r--r--src/sys/include/io/usb/xhcivar.h4
2 files changed, 17 insertions, 1 deletions
diff --git a/src/sys/include/io/usb/xhciregs.h b/src/sys/include/io/usb/xhciregs.h
index f2e572b..f849c54 100644
--- a/src/sys/include/io/usb/xhciregs.h
+++ b/src/sys/include/io/usb/xhciregs.h
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/cdefs.h>
+#include <sys/param.h>
/*
* XHCI capability registers
@@ -69,4 +70,17 @@ struct __packed xhci_opregs {
volatile uint32_t reserved2;
};
+/*
+ * USB command register bits
+ *
+ * See section 5.4.1 of the xHCI spec
+ */
+#define USBCMD_HCRST BIT(1)
+
+/*
+ * Macros to get various register spaces
+ */
+#define XHCI_OPBASE(CAPBASE) \
+ PTR_OFFSET(CAPBASE, (CAPBASE)->caplength)
+
#endif /* !_XHCIREGS_H_ */
diff --git a/src/sys/include/io/usb/xhcivar.h b/src/sys/include/io/usb/xhcivar.h
index 5067063..c0b3a39 100644
--- a/src/sys/include/io/usb/xhcivar.h
+++ b/src/sys/include/io/usb/xhcivar.h
@@ -39,7 +39,9 @@
* @io: I/O space
*/
struct xhci_hcd {
- volatile void *io;
+ struct xhci_capregs *capspace;
};
+#define XHCI_TIMEOUT_MSEC 500
+
#endif /* !_USB_XHCIVAR_H_ */