Three questions first, details below:
- Is there a documented reason for [c]Address Device[/c] to complete with Success while the slot stays in Default state and no device address is assigned?
- Doorbell is written, EP context is Running, ring and dequeue pointer match, yet a No-Op TRB never produces a Transfer Event. What else gates endpoint scheduling?
- CRCR reads back as 0x00000008 (only CRR set, pointer 0). Is pointer readback just unimplemented, or did my write not take effect?
Windows KMDF driver, direct MMIO access to the xHCI controller, system usbxhci unloaded. On the very same machine, port and cable, Ubuntu's xhci_hcd enumerates the device fine (sends GET_DESCRIPTOR 1.4 ms after the port reset, gets the 18-byte device descriptor back in 80 us). So hardware and cable are fine.
- Controller: Intel Sunrise Point-LP, PCI 8086:a0ed
- HCSPARAMS1 = 0x08001040 (MaxSlots 64, MaxPorts 16)
- HCSPARAMS2 = 0x14200054 (34 scratchpad buffers, ERST max 5)
- HCCPARAMS1 = 0x20007FC1 (CSZ=0, 32-byte contexts)
- Device: Apple iPhone (A6, CPID 8950) in DFU mode, 05ac:1227, high speed, zero endpoints
- Init: RS=0, wait HCH=1, HCRST, 1 ms delay (Intel), wait CNR=0
- DCBAAP and CONFIG written, both read back correctly
- ERST one segment, ERSTSZ=1, ERDP with EHB handling; events arrive
- 34 scratchpad buffers allocated as one contiguous block, array at DCBAA[0]
- Port reset: PORTSC written as PP|PRC to clear stale PRC, then PP|PR. Result PED=1, SPD=3, PLS=0
- Enable Slot -> cc=1 (slot 1); Disable Slot -> cc=1; Address Device -> cc=1
- Reset Endpoint (DCI 1) works; Set TR Dequeue Pointer works
1) Address Device reports Success but the slot is not addressed
Input context (32-byte contexts):
Code: Select all
ICC dword1 = 0x00000003 A0=slot, A1=EP0
SLOT dword0 = 0x08300000 route 0, speed 3 (HS), ctx entries 1
dword1 = 0x00010000 root hub port 1, num ports 0
dword2 = 0
dword3 = 0
EP0 dword0 = 0x00000000 EP state 0, interval 0
dword1 = 0x00400026 CErr 3, type 4 (control), MPS 64
dword2 = 0x72300001 TR dequeue lo, DCS=1
dword3 = 0
dword4 = 0x00000008 average TRB length
Code: Select all
slot dword3 = 0x09000000 -> Slot State = 1 (Default), Device Address = 0
2) No Transfer Event for EP0, ever
A No-Op TRB with IOC at ring index 0, doorbell[slot]=1: no event within 300 ms. After Reset Endpoint + Set TR Dequeue the output EP0 context reads EP state=1 (Running), dequeue = ring base | DCS=1, and a following No-Op still produces nothing.
3) Control transfer never completes normally
Code: Select all
Setup TRB: TRT=IN, IDT=1, CH=1, setup bytes 80 06 0100 0000 0040
Data TRB: DIR_IN, CH=1, len 64
Status TRB: IOC, DIR=0
- BSR=0 (slot addressed to address 1): completion code 4 (USB Transaction Error)
- BSR=1 (no SET_ADDRESS, device stays at address 0): no event at all
Ruled out
- Scratchpads: 34 allocated as one contiguous block (was 2, fixed)
- EP context layout: MPS in ep_info2 (dword1 bits 31:16), interval = 0 (it was accidentally 64 because I had put MPS into dword0)
- PORTSC write mask: only PLS/PP/LWS written, never PED as 1
- HCRST without halting first: now RS=0 + wait HCH=1 before HCRST
- Event parsing: all events queued, never discarded; command completions validated against the command TRB physical address
- Control data buffer: dedicated non-cached contiguous buffer, not a stack buffer
- A minimal working xHCI implementation that does not rely on usbxhci or xhci_hcd
- Any erratum for Sunrise Point-LP that affects endpoint scheduling
- Or just: which register/field am I still missing during init?