36#define XHCI_USB_CMD_INTE (1<<2)
37#define XHCI_USB_CMD_HSEE (1<<3)
39#define XHCI_USB_STS_HCH (1<<0)
40#define XHCI_USB_STS_HSE (1<<2)
41#define XHCI_USB_STS_EINT (1<<3)
42#define XHCI_USB_STS_PCD (1<<4)
43#define XHCI_USB_STS_SSS (1<<8)
44#define XHCI_USB_STS_RSS (1<<9)
45#define XHCI_USB_STS_SRE (1<<10)
46#define XHCI_USB_STS_CNR (1<<11)
47#define XHCI_USB_STS_HCE (1<<12)
49#define XHCI_USB_CFG_MXSLOT_ENABLE 0xFF
50#define XHCI_USB_CFG_U3_EN (1<<8)
51#define XHCI_USB_CFG_CINFO_EN (1 << 9)
53#define XHCI_USB_CCR_RCS (1<<0)
54#define XHCI_USB_CCR_CS (1<<1)
55#define XHCI_USB_CCR_CA (1<<2)
56#define XHCI_USB_CCR_CRR (1<<3)
58#define XHCI_USB_CCR_PTR_LO 0xFFFFFFC0
59#define XCHI_USB_CCR_PTR 0xFFFFFFFFFFFFFFC0
61#define XHCI_PORTSC_CCS (1<<0)
62#define XHCI_PORTSC_PED (1<<1)
63#define XHCI_PORTSC_OCA (1<<3)
64#define XHCI_PORTSC_PR (1<<4)
65#define XHCI_PORTSC_PP (1<<9)
66#define XHCI_PORTSC_CSC (1<<17)
67#define XHCI_PORTSC_PEC (1<<18)
68#define XHCI_PORTSC_PRC (1<<21)
69#define XHCI_PORTSC_WPR (1<<31)
71#define XHCI_INT_ERDP_BUSY (1<<3)
74#define XHCI_TRB_SIZE 16
75#define XHCI_EVENT_RING_SEG_TBL_ENTRY_SIZE 16
77#define XHCI_TRB_ENT 0x200000000
78#define XHCI_TRB_ISP 0x400000000
79#define XHCI_TRB_IOC 0x2000000000
80#define XHCI_TRB_IDT 0x4000000000
81#define XHCI_TRB_TRT(x) ((uint64_t)x << 48)
82#define XHCI_TRB_DIR_IN ((uint64_t)1 << 48)
84#define XHCI_DOORBELL_ENDPOINT_0 1
85#define XHCI_DOORBELL_ENDPOINT_1 2
88#define USB_SPEED_RESERVED 0
89#define USB_FULL_SPEED 1
90#define USB_LOW_SPEED 2
91#define USB_HIGH_SPEED 3
92#define USB_SUPER_SPEED 4
93#define USB_SUPER_SPEED_PLUS 5
struct _xhci_slot_ XHCISlot
struct _endp_ XHCIEndpoint
void(* endpoint_callback)(void *dev, void *slot, void *Endp)
Definition xhci.h:95
struct _xhci_noop_trb_ xhci_noop_cmd_trb_t
struct _xhci_event_trb_ xhci_event_trb_t
struct _xhci_link_trb_ xhci_link_trb_t
struct _xhci_op_regs_ xhci_op_regs_t
struct _xhci_data_trb_ xhci_data_trb_t
struct _xhci_ex_cap_protocol_ xhci_ex_cap_protocol_t
struct _xhci_setup_trb_t_ xhci_setup_trb_t
struct _xhci_status_trb_ xhci_status_trb_t
struct _xhci_runtime_regs_ xhci_runtime_regs_t
struct _xhci_erst_ xhci_erst_t
struct _xhci_ex_cap_ xhci_ext_cap_t
struct _xhci_trb_ xhci_trb_t
struct _xhci_intr_reg_ xhci_interrupter_reg_t
struct _xhci_input_ctx_ XHCIInputContext
struct _xhci_doorbell_ xhci_doorbell_regs_t
struct _xhci_cap_regs_ xhci_cap_regs_t
struct _xhci_port_reg_ xhci_port_regs_t
void(* endpoint_callback)(void *dev, void *slot, void *Endp)
Definition xhci.h:143
struct _xhci_intr_reg_ xhci_interrupter_reg_t
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
endpoint_callback callback
Definition xhci.h:197
uint8_t ep_type
Definition xhci.h:195
unsigned cmd_ring_max
Definition xhci.h:190
uint8_t interval
Definition xhci.h:187
unsigned cmd_ring_index
Definition xhci.h:189
uint8_t max_packet_sz
Definition xhci.h:188
xhci_trb_t * cmd_ring
Definition xhci.h:184
uint8_t endpoint_num
Definition xhci.h:185
uint32_t offset
Definition xhci.h:193
unsigned cmd_ring_cycle
Definition xhci.h:191
uint32_t dc_offset
Definition xhci.h:194
uint8_t endpoint_type
Definition xhci.h:186
uint8_t dci
Definition xhci.h:192
uint8_t dir
Definition xhci.h:196
uint32_t cap_hccparams2
Definition xhci.h:107
uint32_t cap_hcsparams3
Definition xhci.h:104
uint16_t hci_version
Definition xhci.h:101
uint32_t cap_hcsparams1
Definition xhci.h:102
uint32_t cap_dboff
Definition xhci.h:106
uint32_t cap_hcsparams2
Definition xhci.h:103
uint8_t reserved
Definition xhci.h:100
uint8_t cap_caplen_version
Definition xhci.h:99
uint32_t cap_hccparams1
Definition xhci.h:105
uint32_t evaluateNextTRB
Definition xhci.h:279
uint32_t immediate_data
Definition xhci.h:284
uint64_t dataBuffer
Definition xhci.h:274
uint32_t direction
Definition xhci.h:287
uint32_t trb_type
Definition xhci.h:286
uint32_t transferLength
Definition xhci.h:275
uint32_t no_snoop
Definition xhci.h:281
uint32_t interrupterTarget
Definition xhci.h:277
uint32_t rsvdZ2
Definition xhci.h:288
uint32_t interrupt_on_short_packet
Definition xhci.h:280
uint32_t cycleBit
Definition xhci.h:278
uint32_t rsvdZ
Definition xhci.h:285
uint32_t size
Definition xhci.h:276
uint32_t chain_bit
Definition xhci.h:282
uint32_t ioc
Definition xhci.h:283
unsigned doorbell[256]
Definition xhci.h:149
uint32_t rerserved
Definition xhci.h:332
uint32_t ring_seg_size
Definition xhci.h:331
uint32_t event_ring_seg_hi
Definition xhci.h:330
uint32_t event_ring_segment_lo
Definition xhci.h:329
uint32_t rsvd3
Definition xhci.h:230
uint32_t trbType
Definition xhci.h:229
uint32_t completionCode
Definition xhci.h:226
uint32_t rsvd2
Definition xhci.h:228
uint32_t rsvd
Definition xhci.h:225
uint64_t ptr
Definition xhci.h:224
uint32_t cycleBit
Definition xhci.h:227
uint32_t rsvd
Definition xhci.h:167
uint32_t rsvd2
Definition xhci.h:169
uint32_t controller_os_sem
Definition xhci.h:168
uint32_t next
Definition xhci.h:165
uint32_t controller_bios_semaphore
Definition xhci.h:166
uint32_t id
Definition xhci.h:164
uint32_t port_cap_field2
Definition xhci.h:313
uint32_t port_cap_field
Definition xhci.h:312
xhci_ext_cap_t base
Definition xhci.h:310
unsigned char name[4]
Definition xhci.h:311
unsigned evtRngSegTabSz
Definition xhci.h:130
unsigned res
Definition xhci.h:131
unsigned intr_mod
Definition xhci.h:129
unsigned evtRngDeqPtrHi
Definition xhci.h:135
unsigned evtRngSegBaseHi
Definition xhci.h:133
unsigned intr_man
Definition xhci.h:128
unsigned evtRngDeqPtrLo
Definition xhci.h:134
unsigned evtRngSegBaseLo
Definition xhci.h:132
uint32_t chain_bit
Definition xhci.h:242
uint64_t segment_ptr
Definition xhci.h:236
uint32_t rsvd
Definition xhci.h:237
uint32_t cycle_bit
Definition xhci.h:239
uint32_t rsvd2
Definition xhci.h:241
uint32_t interrupter_target
Definition xhci.h:238
uint32_t rsvd4
Definition xhci.h:246
uint32_t rsvd3
Definition xhci.h:244
uint32_t ioc
Definition xhci.h:243
uint32_t trb_type
Definition xhci.h:245
uint32_t toggle_cycle
Definition xhci.h:240
uint32_t rsvdZ[3]
Definition xhci.h:319
uint32_t rsvdZ3
Definition xhci.h:323
uint32_t rsvdZ2
Definition xhci.h:321
uint32_t trb_type
Definition xhci.h:322
uint32_t cycleBit
Definition xhci.h:320
uint32_t op_pad1[2]
Definition xhci.h:116
uint32_t op_dnctrl
Definition xhci.h:117
uint32_t op_dcbaap_hi
Definition xhci.h:121
uint64_t op_crcr
Definition xhci.h:118
uint32_t op_usbcmd
Definition xhci.h:113
uint32_t op_usbsts
Definition xhci.h:114
uint32_t op_config
Definition xhci.h:122
uint32_t op_pagesize
Definition xhci.h:115
uint32_t op_pad2[4]
Definition xhci.h:119
uint32_t op_dcbaap_lo
Definition xhci.h:120
uint32_t port_hardware_LMP_ctl
Definition xhci.h:178
uint32_t port_sc
Definition xhci.h:175
uint32_t port_link_info
Definition xhci.h:177
uint32_t port_pmsc
Definition xhci.h:176
char res[28]
Definition xhci.h:142
unsigned micro_frame_index
Definition xhci.h:141
xhci_interrupter_reg_t intr_reg[]
Definition xhci.h:143
uint32_t immediateData
Definition xhci.h:263
uint32_t rsvdZ4
Definition xhci.h:267
uint32_t interrupterTarget
Definition xhci.h:259
uint32_t ioc
Definition xhci.h:262
uint32_t rsvdZ
Definition xhci.h:258
uint32_t bmRequestType
Definition xhci.h:252
uint32_t rsvdZ3
Definition xhci.h:264
uint32_t bRequest
Definition xhci.h:253
uint32_t wIndex
Definition xhci.h:255
uint32_t trbType
Definition xhci.h:265
uint32_t transferType
Definition xhci.h:266
uint32_t wValue
Definition xhci.h:254
uint32_t trbTransferLength
Definition xhci.h:257
uint32_t cycleBit
Definition xhci.h:260
uint32_t wLength
Definition xhci.h:256
uint32_t rsvdZ2
Definition xhci.h:261
uint8_t classC
Definition xhci.h:209
unsigned cmd_ring_max
Definition xhci.h:214
uint64_t descriptor_buff
Definition xhci.h:216
list_t * endpoints
Definition xhci.h:218
xhci_trb_t * cmd_ring
Definition xhci.h:212
uint8_t port_speed
Definition xhci.h:205
uint8_t subClassC
Definition xhci.h:210
uint8_t root_hub_port_num
Definition xhci.h:204
uint64_t output_context_phys
Definition xhci.h:208
uint64_t cmd_ring_base
Definition xhci.h:206
uint64_t input_context_phys
Definition xhci.h:207
uint8_t prot
Definition xhci.h:211
unsigned cmd_ring_cycle
Definition xhci.h:215
unsigned cmd_ring_index
Definition xhci.h:213
uint16_t interface_val
Definition xhci.h:217
uint8_t slot_id
Definition xhci.h:203
uint32_t rsvdZ
Definition xhci.h:294
uint32_t rsvdZ4
Definition xhci.h:304
uint32_t interrupter_target
Definition xhci.h:295
uint32_t trb_type
Definition xhci.h:302
uint32_t cycle_bit
Definition xhci.h:296
uint32_t ioc
Definition xhci.h:300
uint32_t evaluateNextTRB
Definition xhci.h:297
uint32_t chainBit
Definition xhci.h:299
uint32_t direction
Definition xhci.h:303
uint32_t rsvdZ2
Definition xhci.h:298
uint32_t rsvdZ0[2]
Definition xhci.h:293
uint32_t rsvdZ3
Definition xhci.h:301
uint32_t trb_param_1
Definition xhci.h:155
uint32_t trb_control
Definition xhci.h:158
uint32_t trb_param_2
Definition xhci.h:156
uint32_t trb_status
Definition xhci.h:157