xhci: support ehci companions and add more portsc bits

This commit is contained in:
Matheus
2026-05-14 14:44:01 -03:00
parent 04a13539dd
commit bce059a183
3 changed files with 43 additions and 2 deletions
+1
View File
@@ -22,6 +22,7 @@
#define PCI_CONFIG_REVISION 0x8
#define PCI_CONFIG_PROGIF 0x9
#define PCI_PROGIF_STORAGE_SATA_AHCI 0x1
#define PCI_PROGIF_USB_EHCI 0x20
#define PCI_PROGIF_USB_XHCI 0x30
#define PCI_CONFIG_SUBCLASS 0xa
#define PCI_SUBCLASS_STORAGE_NVM 0x8
+7 -1
View File
@@ -200,10 +200,16 @@ _Static_assert(sizeof(xhci_input_ctx_t) == XHCI_CONTEXT_SIZE, "xHCI input contro
#define XHCI_PORTSC_PP (1 << 9) // port power
#define XHCI_PORTSC_CSC (1 << 17) // connect status change
#define XHCI_PORTSC_PEC (1 << 18) // port enabled change
#define XHCI_PORTSC_WRC (1 << 19) // warm reset change
#define XHCI_PORTSC_OCC (1 << 20) // over current change
#define XHCI_PORTSC_PRC (1 << 21) // port reset change
#define XHCI_PORTSC_PLC (1 << 22) // port link state change
#define XHCI_PORTSC_CEC (1 << 23) // config error change
#define XHCI_PORTSC_CAS (1 << 24) // cold attach status
#define XHCI_PORTSC_DR (1 << 30) // device removable
#define XHCI_PORTSC_WPR (1u << 31) // warm port reset
#define XHCI_PORTSC_CHANGE_BITS (XHCI_PORTSC_CSC | XHCI_PORTSC_PEC | XHCI_PORTSC_OCC | XHCI_PORTSC_PRC)
#define XHCI_PORTSC_CHANGE_BITS (XHCI_PORTSC_CSC | XHCI_PORTSC_PEC | XHCI_PORTSC_WRC | XHCI_PORTSC_OCC | XHCI_PORTSC_PRC | XHCI_PORTSC_PLC | XHCI_PORTSC_CEC)
#define XHCI_PORTSC_PRESERVE_BITS XHCI_PORTSC_PP
#define XHCI_TRB_DW2_TR_LEN(LEN) (uint32_t)((LEN) & 0x1ffff)