Hi Bin, sorry for the late reply but I was off for easter. On Fri, 2020-04-03 at 13:54 +0800, Bin Meng wrote: > Hi Nicolas, > This is probably caused by the required structure setup by U-Boot is > viewed as buggy by the xHCI controller, hence there is no response to > the first "enable slot" command.
Yes, that's my impression too. That said I can't seem to find the faulty config. Since I wasn't all that clear on my previous mail, this is a VIA805 chip, directly soldered on the board and interfaced with trough RPi4's PCIe bus (the PCIe bus isn't exposed, so it's the only user). The Linux version of this works fine, and is already supported upstream. > Could you please compare all the data structures, with the one set up > by the Linux kernel? I've attached some logs comparing u-boot's and Linux's view of the registers. I dumped them before and after calling the 'enable slot' command. I left all the debuging information just in case it's helpful and also attached some patches to show my changes. Note that I thoughfully compared them myself. The only odd thing I found was "USBSTS: 0x10" (Port Detect Change is set), which isn't the case in Linux. I tried to clear it at different places (before and after changing the individual port status), without effect. That's all. If the data I sent is a little bit too dense, please tell me and I'll remove all the less important stuff :). Regards, Nicolas
[ 8.764830] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges: [ 8.775111] brcm-pcie fd500000.pcie: No bus range found for /scb/pcie@7d500000, using [bus 00-ff] [ 8.791685] brcm-pcie fd500000.pcie: MEM 0x0600000000..0x0603ffffff -> 0x00f8000000 [ 8.805042] brcm-pcie fd500000.pcie: IB MEM 0x0000000000..0x00bfffffff -> 0x0000000000 [ 8.867783] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC) [ 8.875862] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00 [ 8.882702] pci_bus 0000:00: root bus resource [bus 00-ff] [ 8.893595] pci_bus 0000:00: root bus resource [mem 0x600000000-0x603ffffff] (bus address [0xf8000000-0xfbffffff]) [ 8.905107] probe:pci_scan_child_bus_extend: pci_bus 0000:00: scanning bus [ 8.912665] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400 [ 8.919467] pci 0000:00:00.0: PME# supported from D0 D3hot [ 8.925688] pci:pci_pme_active: pci 0000:00:00.0: PME# disabled [ 8.936010] probe:pci_scan_child_bus_extend: pci_bus 0000:00: fixups for bus [ 8.943491] probe:pci_scan_bridge_extend: pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0 [ 8.953362] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 8.962120] probe:pci_scan_bridge_extend: pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1 [ 8.968690] raspberrypi-clk raspberrypi-clk: CPU frequency range: min 600000000, max 1500000000 [ 8.972081] probe:pci_scan_child_bus_extend: pci_bus 0000:01: scanning bus [ 8.988099] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330 [ 8.994591] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit] [ 9.002104] pci 0000:01:00.0: PME# supported from D0 D3cold [ 9.008205] pci:pci_pme_active: pci 0000:01:00.0: PME# disabled [ 9.029244] probe:pci_scan_child_bus_extend: pci_bus 0000:01: fixups for bus [ 9.037199] probe:pci_scan_child_bus_extend: pci_bus 0000:01: bus scan returning with max=01 [ 9.045944] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01 [ 9.052744] probe:pci_scan_child_bus_extend: pci_bus 0000:00: bus scan returning with max=01 [ 9.061428] pci 0000:00:00.0: BAR 14: assigned [mem 0x600000000-0x6000fffff] [ 9.068689] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit] [ 9.076400] pci 0000:00:00.0: PCI bridge to [bus 01] [ 9.081518] pci 0000:00:00.0: bridge window [mem 0x600000000-0x6000fffff] [ 9.089020] pcieport 0000:00:00.0: enabling device (0000 -> 0002) [ 9.095340] pci:__pci_set_master: pcieport 0000:00:00.0: enabling bus mastering [ 9.103071] pcieport 0000:00:00.0: PME: Signaling with IRQ 41 [ 9.109558] pcieport 0000:00:00.0: AER: enabled with IRQ 41 [ 9.115694] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x0 (reading 0x271114e4) [ 9.125886] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x4 (reading 0x100006) [ 9.135882] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x8 (reading 0x6040010) [ 9.145948] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0xc (reading 0x10000) [ 9.155870] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x10 (reading 0x0) [ 9.165505] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x14 (reading 0x0) [ 9.175111] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x18 (reading 0x10100) [ 9.185084] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x1c (reading 0x0) [ 9.194718] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x20 (reading 0xf800f800) [ 9.204959] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x24 (reading 0x1fff1) [ 9.214921] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x28 (reading 0x0) [ 9.214930] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x2c (reading 0x0) [ 9.214937] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x30 (reading 0x0) [ 9.214945] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x34 (reading 0x48) [ 9.214953] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x38 (reading 0x0) [ 9.214968] pci:pci_save_state: pcieport 0000:00:00.0: saving config space at offset 0x3c (reading 0x20129) [ 9.248118] pci 0000:01:00.0: enabling device (0000 -> 0002) [ 9.289217] pci 0000:01:00.0: quirk_usb_early_handoff+0x0/0x888 took 40120 usecs [ 9.297139] pci:__pci_set_master: xhci_hcd 0000:01:00.0: enabling bus mastering [ 9.304624] xhci_hcd 0000:01:00.0: xHCI Host Controller [ 9.310060] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1 [ 9.317636] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: QUIRK: Resetting on resume [ 9.325721] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Halt the HC [ 9.332753] xhci_hcd:xhci_gen_setup: xhci_hcd 0000:01:00.0: Resetting HCD [ 9.339664] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Reset the HC [ 9.346876] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Wait for controller to be ready for doorbell rings [ 9.357094] xhci_hcd:xhci_gen_setup: xhci_hcd 0000:01:00.0: Reset complete [ 9.364119] xhci_hcd:xhci_gen_setup: xhci_hcd 0000:01:00.0: Enabling 64-bit DMA addresses. [ 9.372546] xhci_hcd:xhci_gen_setup: xhci_hcd 0000:01:00.0: Calling HCD init [ 9.379736] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: xhci_init [ 9.386303] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: xHCI doesn't need link TRB QUIRK [ 9.394937] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Supported page size register = 0x1 [ 9.403735] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Supported page size of 4K [ 9.411759] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: HCD page size set to 4K [ 9.419608] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // xHC can handle at most 32 device slots. [ 9.429138] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Setting Max device slots reg = 0x20. [ 9.438470] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Device context base array address = 0x3303f000 (DMA), (____ptrval____) (virt) [ 9.438511] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Allocated command ring at (____ptrval____) [ 9.438516] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: First segment DMA is 0x33040000 [ 9.438550] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Setting command ring address to 0x0000000033040001 [ 9.438611] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Doorbell array is located at offset 0x100 from cap regs base addr [ 9.438615] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Allocating event ring [ 9.438650] xhci_hcd:xhci_check_trb_in_td_math: xhci_hcd 0000:01:00.0: TRB math tests passed. [ 9.438697] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Write ERST size = 1 to ir_set 0 (some bits preserved) [ 9.438701] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Set ERST entries to point to event ring. [ 9.438704] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Set ERST base address for ir_set 0 = 0x33043000 [ 9.438745] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Write event ring dequeue pointer, preserving EHB bit [ 9.438749] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Wrote ERST address to ir_set 0. [ 9.438762] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Allocating 31 scratchpad buffers [ 9.439174] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Ext Cap (____ptrval____), port offset = 1, count = 1, revision = 0x2 [ 9.439214] xhci_hcd:xhci_add_in_port: xhci_hcd 0000:01:00.0: PSIV:3 PSIE:2 PLT:0 PFD:0 LP:0 PSIM:480 [ 9.439222] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Ext Cap (____ptrval____), port offset = 2, count = 4, revision = 0x3 [ 9.439230] xhci_hcd:xhci_add_in_port: xhci_hcd 0000:01:00.0: PSIV:4 PSIE:3 PLT:0 PFD:1 LP:0 PSIM:5 [ 9.439233] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Found 1 USB 2.0 ports and 4 USB 3.0 ports. [ 9.439272] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Finished xhci_init [ 9.439280] xhci_hcd:xhci_gen_setup: xhci_hcd 0000:01:00.0: Called HCD init [ 9.439285] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000000000000890 [ 9.439333] pci:pci_set_mwi: xhci_hcd 0000:01:00.0: enabling Mem-Wr-Inval [ 9.439370] usbcore:usb_add_hcd: xhci_hcd 0000:01:00.0: supports USB remote wakeup [ 9.439379] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: xhci_run [ 9.439387] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Failed to enable MSI-X [ 9.439721] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: ERST deq = 64'h33042000 [ 9.439728] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Set the interrupt modulation register [ 9.439761] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Enable interrupts, cmd = 0x4. [ 9.439767] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Enabling event ring interrupter (____ptrval____) by writing 0x2 to irq_pending [ 9.439770] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Finished xhci_run for USB2 roothub [ 9.440092] usbcore:usb_get_langid: usb usb1: default language 0x0409 [ 9.732270] usbcore:usb_new_device: usb usb1: udev 1, busnum 1, minor = 0 [ 9.732591] usbcore:usb_probe_device: usb usb1: usb_probe_device [ 9.745340] usbcore:usb_choose_configuration: usb usb1: configuration #1 chosen from 1 choice [ 9.745355] xhci_hcd:xhci_check_args: xHCI xhci_add_endpoint called for root hub [ 9.745363] xhci_hcd:xhci_check_args: xHCI xhci_check_bandwidth called for root hub [ 9.771523] usbcore:usb_set_configuration: usb usb1: adding 1-0:1.0 (config #1, interface 0) [ 9.781068] usbcore:usb_probe_interface: hub 1-0:1.0: usb_probe_interface [ 9.788366] usbcore:usb_probe_interface: hub 1-0:1.0: usb_probe_interface - got id [ 9.801099] hub 1-0:1.0: USB hub found [ 9.801182] hub 1-0:1.0: 1 port detected [ 9.816551] usbcore:hub_configure: hub 1-0:1.0: standalone hub [ 9.823054] usbcore:hub_configure: hub 1-0:1.0: individual port power switching [ 9.838209] usbcore:hub_configure: hub 1-0:1.0: individual port over-current protection [ 9.838213] usbcore:hub_configure: hub 1-0:1.0: Single TT [ 9.838219] usbcore:hub_configure: hub 1-0:1.0: TT requires at most 8 FS bit times (666 ns) [ 9.838223] usbcore:hub_configure: hub 1-0:1.0: power on to power good time: 20ms [ 9.838274] usbcore:hub_configure: hub 1-0:1.0: local power source is good [ 9.852547] usbcore:hub_power_on: hub 1-0:1.0: enabling power on all ports [ 9.867518] xhci_hcd:xhci_set_port_power: xhci_hcd 0000:01:00.0: set port power 1-1 ON, portsc: 0x400202e1 [ 9.953721] xhci_hcd 0000:01:00.0: xHCI Host Controller [ 9.961718] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2 [ 9.969669] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed [ 9.976745] usbcore:usb_add_hcd: xhci_hcd 0000:01:00.0: supports USB remote wakeup [ 9.985137] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: // Turn on HC, cmd = 0x5. [ 9.993803] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Finished xhci_run for USB3 roothub [ 9.993820] xhci_hcd:handle_port_status: xhci_hcd 0000:01:00.0: Port change event, 1-1, id 1, portsc: 0x400202e1 [ 10.013554] xhci_hcd:handle_port_status: xhci_hcd 0000:01:00.0: handle_port_status: starting port polling. [ 10.023440] usbcore:usb_parse_endpoint: usb usb2: skipped 1 descriptor after endpoint [ 10.032138] usbcore:usb_get_langid: usb usb2: default language 0x0409 [ 10.039393] usbcore:usb_new_device: usb usb2: udev 1, busnum 2, minor = 128 [ 10.047474] usbcore:usb_probe_device: usb usb2: usb_probe_device [ 10.054020] usbcore:usb_choose_configuration: usb usb2: configuration #1 chosen from 1 choice [ 10.054074] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 1-1 read: 0x400202e1, return 0x10101 [ 10.063319] xhci_hcd:xhci_check_args: xHCI xhci_add_endpoint called for root hub [ 10.074691] usbcore:hub_activate: usb usb1-port1: status 0101 change 0001 [ 10.082079] xhci_hcd:xhci_check_args: xHCI xhci_check_bandwidth called for root hub [ 10.089707] xhci_hcd:xhci_clear_port_change_bit: xhci_hcd 0000:01:00.0: clear port1 connect change, portsc: 0x400002e1 [ 10.098217] usbcore:usb_set_configuration: usb usb2: adding 2-0:1.0 (config #1, interface 0) [ 10.119169] usbcore:usb_probe_interface: hub 2-0:1.0: usb_probe_interface [ 10.126644] usbcore:usb_probe_interface: hub 2-0:1.0: usb_probe_interface - got id [ 10.135008] hub 2-0:1.0: USB hub found [ 10.139542] hub 2-0:1.0: 4 ports detected [ 10.143661] usbcore:hub_configure: hub 2-0:1.0: standalone hub [ 10.149601] usbcore:hub_configure: hub 2-0:1.0: individual port power switching [ 10.157058] usbcore:hub_configure: hub 2-0:1.0: individual port over-current protection [ 10.165241] usbcore:hub_configure: hub 2-0:1.0: TT requires at most 8 FS bit times (666 ns) [ 10.173751] usbcore:hub_configure: hub 2-0:1.0: power on to power good time: 20ms [ 10.181429] usbcore:hub_configure: hub 2-0:1.0: local power source is good [ 10.188605] usbcore:link_peers_report: usb usb2-port1: peered to usb1-port1 [ 10.195810] usbcore:hub_power_on: hub 2-0:1.0: enabling power on all ports [ 10.202883] xhci_hcd:xhci_set_port_power: xhci_hcd 0000:01:00.0: set port power 2-1 ON, portsc: 0x2a0 [ 10.212429] xhci_hcd:xhci_set_port_power: xhci_hcd 0000:01:00.0: set port power 2-2 ON, portsc: 0x2a0 [ 10.213653] usbcore:hub_event: hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000 [ 10.221859] xhci_hcd:xhci_hub_status_data: xhci_hcd 0000:01:00.0: xhci_hub_status_data: stopping port polling. [ 10.222031] xhci_hcd:xhci_set_port_power: xhci_hcd 0000:01:00.0: set port power 2-3 ON, portsc: 0x2a0 [ 10.248738] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 1-1 read: 0x400002e1, return 0x101 [ 10.259236] xhci_hcd:xhci_set_port_power: xhci_hcd 0000:01:00.0: set port power 2-4 ON, portsc: 0x2a0 [ 10.260697] usbcore:hub_port_connect_change: usb usb1-port1: status 0101, change 0000, 12 Mb/s ------------------------------------------------------------------------------------------------------ [ 10.318801] First xhci_alloc_dev() call, before ringing doorbell for the first TRB_ENABLE_SLOT command HCCR------- [ 10.322845] CAPBASE: 0x1000020 [ 10.322849] HCSPARAMS1: 0x5000420 [ 10.330220] HCSPARAMS2: 0xfc000031 [ 10.332907] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 10.334462] HCSPARAMS3: 0xe70004 [ 10.348012] HCCPARAMS: 0x2841eb [ 10.348015] DBOFF: 0x100 [ 10.348028] RTSOFF: 0x200 [ 10.358775] HCOR------- [ 10.358805] USBCMD: 0x5 [ 10.358808] USBSTS: 0x0 [ 10.358812] PAGESIZE: 0x1 [ 10.358815] DNCTRL: 0x2 [ 10.358819] CRCR: 0x0 [ 10.358827] DCBAAP: 0x3303f000 [ 10.358830] CONFIG: 0x20 [ 10.358831] PORTREG 0 -- [ 10.358834] PORTSC: 0x400002e1 [ 10.358840] PORTPMSC: 0x0 [ 10.358843] PORTLI: 0x0 [ 10.358844] PORTREG 1 -- [ 10.358847] PORTSC: 0x2a0 [ 10.358850] PORTPMSC: 0x0 [ 10.358853] PORTLI: 0x0 [ 10.358855] PORTREG 2 -- [ 10.358858] PORTSC: 0x2a0 [ 10.358861] PORTPMSC: 0x0 [ 10.358864] PORTLI: 0x0 [ 10.358865] PORTREG 3 -- [ 10.358867] PORTSC: 0x2a0 [ 10.358870] PORTPMSC: 0x0 [ 10.358873] PORTLI: 0x0 [ 10.358874] PORTREG 4 -- [ 10.358877] PORTSC: 0x0 [ 10.358880] PORTPMSC: 0x0 [ 10.358883] PORTLI: 0x0 [ 10.358884] RUNREGS--- [ 10.358887] MFINDEX: 0x0 [ 10.358888] INTR_REG 0 -- [ 10.358891] IRQ_PENDING: 0x2 [ 10.358895] IRQ_CONTROL: 0xa0 [ 10.358896] ERST_SIZE: 0x1 [ 10.358902] ERST_BASE: 0x33043000 [ 10.358906] ERST_DEQUEUE: 0x33042010 [ 10.358907] INTR_REG 1 -- [ 10.358910] IRQ_PENDING: 0x0 [ 10.358913] IRQ_CONTROL: 0xfa0 [ 10.358915] ERST_SIZE: 0x0 [ 10.358919] ERST_BASE: 0x0 [ 10.358923] ERST_DEQUEUE: 0x0 [ 10.358924] INTR_REG 2 -- [ 10.358927] IRQ_PENDING: 0x0 [ 10.358931] IRQ_CONTROL: 0xfa0 [ 10.358933] ERST_SIZE: 0x0 [ 10.358937] ERST_BASE: 0x0 [ 10.358940] ERST_DEQUEUE: 0x0 [ 10.358942] INTR_REG 3 -- [ 10.358944] IRQ_PENDING: 0x0 [ 10.358947] IRQ_CONTROL: 0xfa0 [ 10.358950] ERST_SIZE: 0x0 [ 10.358954] ERST_BASE: 0x0 [ 10.358958] ERST_DEQUEUE: 0x0 [ 10.358959] INTR_REG 4 -- [ 10.358960] IRQ_PENDING: 0x0 [ 10.358963] IRQ_CONTROL: 0x0 [ 10.358966] ERST_SIZE: 0x0 [ 10.358970] ERST_BASE: 0x0 [ 10.358974] ERST_DEQUEUE: 0x0 [ 10.358975] INTR_REG 5 -- [ 10.358977] IRQ_PENDING: 0x0 [ 10.358980] IRQ_CONTROL: 0x0 [ 10.358983] ERST_SIZE: 0x0 [ 10.358989] ERST_BASE: 0x0 [ 10.358992] ERST_DEQUEUE: 0x0 [ 10.358993] INTR_REG 6 -- [ 10.358996] IRQ_PENDING: 0x0 [ 10.358999] IRQ_CONTROL: 0x0 [ 10.359002] ERST_SIZE: 0x0 [ 10.359006] ERST_BASE: 0x0 [ 10.359010] ERST_DEQUEUE: 0x0 [ 10.359011] INTR_REG 7 -- [ 10.359014] IRQ_PENDING: 0x1000a [ 10.359017] IRQ_CONTROL: 0x0 [ 10.359020] ERST_SIZE: 0x0 [ 10.359022] ERST_BASE: 0x0 [ 10.359026] ERST_DEQUEUE: 0x0 [ 10.359027] INTR_REG 8 -- [ 10.359030] IRQ_PENDING: 0x0 [ 10.359034] IRQ_CONTROL: 0x0 [ 10.359037] ERST_SIZE: 0xa0 [ 10.359040] ERST_BASE: 0x0 [ 10.359044] ERST_DEQUEUE: 0x0 [ 10.359045] INTR_REG 9 -- [ 10.359050] IRQ_PENDING: 0x0 [ 10.359053] IRQ_CONTROL: 0x0 [ 10.359056] ERST_SIZE: 0x0 [ 10.359059] ERST_BASE: 0x0 [ 10.359064] ERST_DEQUEUE: 0x0 [ 10.359066] INTR_REG 10 -- [ 10.359069] IRQ_PENDING: 0x0 [ 10.359071] IRQ_CONTROL: 0x0 [ 10.359074] ERST_SIZE: 0x0 [ 10.359079] ERST_BASE: 0x0 [ 10.359082] ERST_DEQUEUE: 0x0 [ 10.359083] INTR_REG 11 -- [ 10.359086] IRQ_PENDING: 0x0 [ 10.359089] IRQ_CONTROL: 0x0 [ 10.359094] ERST_SIZE: 0x0 [ 10.359098] ERST_BASE: 0x0 [ 10.359101] ERST_DEQUEUE: 0x0 [ 10.359102] INTR_REG 12 -- [ 10.359105] IRQ_PENDING: 0x0 [ 10.359109] IRQ_CONTROL: 0x0 [ 10.359112] ERST_SIZE: 0x0 [ 10.359116] ERST_BASE: 0x0 [ 10.359119] ERST_DEQUEUE: 0x0 [ 10.359122] INTR_REG 13 -- [ 10.359125] IRQ_PENDING: 0x0 [ 10.359128] IRQ_CONTROL: 0x0 [ 10.359131] ERST_SIZE: 0x0 [ 10.359134] ERST_BASE: 0x0 [ 10.359139] ERST_DEQUEUE: 0x0 [ 10.359140] INTR_REG 14 -- [ 10.359143] IRQ_PENDING: 0x0 [ 10.359146] IRQ_CONTROL: 0x0 [ 10.359149] ERST_SIZE: 0x0 [ 10.359152] ERST_BASE: 0x0 [ 10.359157] ERST_DEQUEUE: 0x0 [ 10.359158] INTR_REG 15 -- [ 10.359160] IRQ_PENDING: 0x0 [ 10.359162] IRQ_CONTROL: 0x0 [ 10.359168] ERST_SIZE: 0x0 [ 10.359171] ERST_BASE: 0x0 [ 10.359175] ERST_DEQUEUE: 0x0 [ 10.359177] INTR_REG 16 -- [ 10.359180] IRQ_PENDING: 0x400002e1 [ 10.359183] IRQ_CONTROL: 0x0 [ 10.359186] ERST_SIZE: 0x0 [ 10.359190] ERST_BASE: 0x2a0 [ 10.359197] ERST_DEQUEUE: 0x0 [ 10.359199] INTR_REG 17 -- [ 10.359202] IRQ_PENDING: 0x2a0 [ 10.359204] IRQ_CONTROL: 0x0 [ 10.359207] ERST_SIZE: 0x0 [ 10.359213] ERST_BASE: 0x2a0 [ 10.359217] ERST_DEQUEUE: 0x0 [ 10.359218] INTR_REG 18 -- [ 10.359221] IRQ_PENDING: 0x2a0 [ 10.359224] IRQ_CONTROL: 0x0 [ 10.359227] ERST_SIZE: 0x0 [ 10.359231] ERST_BASE: 0x0 [ 10.359235] ERST_DEQUEUE: 0x0 [ 10.359236] INTR_REG 19 -- [ 10.359238] IRQ_PENDING: 0x0 [ 10.359242] IRQ_CONTROL: 0x0 [ 10.359245] ERST_SIZE: 0x0 [ 10.359248] ERST_BASE: 0x0 [ 10.359252] ERST_DEQUEUE: 0x0 ------------------------------------------------------------------------------------------------------ [ 10.359270] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 10.373711] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 2-1 read: 0x2a0, return 0x2a0 [ 10.379598] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 2-2 read: 0x2a0, return 0x2a0 [ 10.385597] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 2-3 read: 0x2a0, return 0x2a0 [ 10.390757] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 2-4 read: 0x2a0, return 0x2a0 [ 10.390788] usbcore:hub_event: hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000 [ 10.390844] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: set port remote wake mask, actual port 0 status = 0xe0002a0 [ 10.390893] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: set port remote wake mask, actual port 1 status = 0xe0002a0 [ 10.390941] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: set port remote wake mask, actual port 2 status = 0xe0002a0 [ 10.390990] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: set port remote wake mask, actual port 3 status = 0xe0002a0 [ 10.391001] usbcore:hub_suspend: hub 2-0:1.0: hub_suspend [ 10.391021] usbcore:hcd_bus_suspend: usb usb2: bus auto-suspend, wakeup 1 [ 10.391064] xhci_hcd:xhci_hub_status_data: xhci_hcd 0000:01:00.0: xhci_hub_status_data: stopping port polling. ------------------------------------------------------------------------------------------------------ [ 10.374982] TRB_ENABLE_SLOT successfully complete. HCCR------- [ 10.380841] CAPBASE: 0x1000020 [ 10.386630] HCSPARAMS1: 0x5000420 [ 10.397264] HCSPARAMS2: 0xfc000031 [ 10.415835] HCSPARAMS3: 0xe70004 [ 10.525174] HCCPARAMS: 0x2841eb [ 10.540247] DBOFF: 0x100 [ 10.639810] RTSOFF: 0x200 [ 10.645666] HCOR------- [ 10.645696] USBCMD: 0x5 [ 10.651733] USBSTS: 0x0 [ 10.657835] PAGESIZE: 0x1 [ 11.017206] DNCTRL: 0x2 [ 11.029673] CRCR: 0x8 [ 11.032842] DCBAAP: 0x3303f000 [ 11.036786] CONFIG: 0x20 [ 11.045702] PORTREG 0 -- [ 11.049024] PORTSC: 0x400002e1 [ 11.055619] PORTPMSC: 0x0 [ 11.059249] PORTLI: 0x0 [ 11.062451] PORTREG 1 -- [ 11.066018] PORTSC: 0xa0002a0 [ 11.069540] PORTPMSC: 0x0 [ 11.073019] PORTLI: 0x0 [ 11.076265] PORTREG 2 -- [ 11.079571] PORTSC: 0xa0002a0 [ 11.083383] PORTPMSC: 0x0 [ 11.086873] PORTLI: 0x0 [ 11.086881] PORTREG 3 -- [ 11.093378] PORTSC: 0xa0002a0 [ 11.103381] PORTPMSC: 0x0 [ 11.106301] PORTLI: 0x0 [ 11.116559] PORTREG 4 -- [ 11.119968] PORTSC: 0x0 [ 11.123258] PORTPMSC: 0x0 [ 11.131903] PORTLI: 0x0 [ 11.135132] RUNREGS--- [ 11.139761] MFINDEX: 0x0 [ 11.142835] INTR_REG 0 -- [ 11.146206] IRQ_PENDING: 0x2 [ 11.150005] IRQ_CONTROL: 0xa0 [ 11.153894] ERST_SIZE: 0x1 [ 11.157502] ERST_BASE: 0x33043000 [ 11.161768] ERST_DEQUEUE: 0x33042020 [ 11.166271] INTR_REG 1 -- [ 11.166303] IRQ_PENDING: 0x0 [ 11.173524] IRQ_CONTROL: 0xfa0 [ 11.173559] ERST_SIZE: 0x0 [ 11.173566] ERST_BASE: 0x0 [ 11.173570] ERST_DEQUEUE: 0x0 [ 11.173572] INTR_REG 2 -- [ 11.173576] IRQ_PENDING: 0x0 [ 11.173583] IRQ_CONTROL: 0xfa0 [ 11.173586] ERST_SIZE: 0x0 [ 11.173645] ERST_BASE: 0x0 [ 11.173649] ERST_DEQUEUE: 0x0 [ 11.173651] INTR_REG 3 -- [ 11.173653] IRQ_PENDING: 0x0 [ 11.173657] IRQ_CONTROL: 0xfa0 [ 11.173660] ERST_SIZE: 0x0 [ 11.173664] ERST_BASE: 0x0 [ 11.173668] ERST_DEQUEUE: 0x0 [ 11.173670] INTR_REG 4 -- [ 11.173673] IRQ_PENDING: 0x0 [ 11.173677] IRQ_CONTROL: 0x0 [ 11.173679] ERST_SIZE: 0x0 [ 11.173686] ERST_BASE: 0x0 [ 11.173690] ERST_DEQUEUE: 0x0 [ 11.173691] INTR_REG 5 -- [ 11.173694] IRQ_PENDING: 0x0 [ 11.173697] IRQ_CONTROL: 0x0 [ 11.173702] ERST_SIZE: 0x0 [ 11.173706] ERST_BASE: 0x0 [ 11.173723] ERST_DEQUEUE: 0x0 [ 11.173724] INTR_REG 6 -- [ 11.173755] IRQ_PENDING: 0x0 [ 11.173760] IRQ_CONTROL: 0x0 [ 11.173763] ERST_SIZE: 0x0 [ 11.173768] ERST_BASE: 0x0 [ 11.173776] ERST_DEQUEUE: 0x0 [ 11.173777] INTR_REG 7 -- [ 11.173781] IRQ_PENDING: 0x1000a [ 11.173784] IRQ_CONTROL: 0x0 [ 11.173787] ERST_SIZE: 0x0 [ 11.173791] ERST_BASE: 0x0 [ 11.173795] ERST_DEQUEUE: 0x0 [ 11.173796] INTR_REG 8 -- [ 11.173799] IRQ_PENDING: 0x0 [ 11.173805] IRQ_CONTROL: 0x0 [ 11.173808] ERST_SIZE: 0xa0 [ 11.173812] ERST_BASE: 0x0 [ 11.173815] ERST_DEQUEUE: 0x0 [ 11.173818] INTR_REG 9 -- [ 11.173820] IRQ_PENDING: 0x0 [ 11.173823] IRQ_CONTROL: 0x0 [ 11.173827] ERST_SIZE: 0x0 [ 11.173833] ERST_BASE: 0x0 [ 11.173838] ERST_DEQUEUE: 0x0 [ 11.173839] INTR_REG 10 -- [ 11.173842] IRQ_PENDING: 0x0 [ 11.173845] IRQ_CONTROL: 0x0 [ 11.173850] ERST_SIZE: 0x0 [ 11.173855] ERST_BASE: 0x0 [ 11.173858] ERST_DEQUEUE: 0x0 [ 11.173859] INTR_REG 11 -- [ 11.173866] IRQ_PENDING: 0x0 [ 11.173869] IRQ_CONTROL: 0x0 [ 11.173872] ERST_SIZE: 0x0 [ 11.173879] ERST_BASE: 0x0 [ 11.173884] ERST_DEQUEUE: 0x0 [ 11.173885] INTR_REG 12 -- [ 11.173889] IRQ_PENDING: 0x0 [ 11.173894] IRQ_CONTROL: 0x0 [ 11.173897] ERST_SIZE: 0x0 [ 11.173901] ERST_BASE: 0x0 [ 11.173905] ERST_DEQUEUE: 0x0 [ 11.173907] INTR_REG 13 -- [ 11.173910] IRQ_PENDING: 0x0 [ 11.173912] IRQ_CONTROL: 0x0 [ 11.173915] ERST_SIZE: 0x0 [ 11.173918] ERST_BASE: 0x0 [ 11.173923] ERST_DEQUEUE: 0x0 [ 11.173924] INTR_REG 14 -- [ 11.173927] IRQ_PENDING: 0x0 [ 11.173930] IRQ_CONTROL: 0x0 [ 11.173933] ERST_SIZE: 0x0 [ 11.173939] ERST_BASE: 0x0 [ 11.173943] ERST_DEQUEUE: 0x0 [ 11.173945] INTR_REG 15 -- [ 11.173949] IRQ_PENDING: 0x0 [ 11.173952] IRQ_CONTROL: 0x0 [ 11.173955] ERST_SIZE: 0x0 [ 11.173960] ERST_BASE: 0x0 [ 11.173967] ERST_DEQUEUE: 0x0 [ 11.173968] INTR_REG 16 -- [ 11.173972] IRQ_PENDING: 0x400002e1 [ 11.173975] IRQ_CONTROL: 0x0 [ 11.173979] ERST_SIZE: 0x0 [ 11.173983] ERST_BASE: 0xa0002a0 [ 11.173987] ERST_DEQUEUE: 0x0 [ 11.173988] INTR_REG 17 -- [ 11.173992] IRQ_PENDING: 0xa0002a0 [ 11.173995] IRQ_CONTROL: 0x0 [ 11.173998] ERST_SIZE: 0x0 [ 11.174002] ERST_BASE: 0xa0002a0 [ 11.174004] ERST_DEQUEUE: 0x0 [ 11.174006] INTR_REG 18 -- [ 11.174010] IRQ_PENDING: 0xa0002a0 [ 11.174013] IRQ_CONTROL: 0x0 [ 11.174016] ERST_SIZE: 0x0 [ 11.174022] ERST_BASE: 0x0 [ 11.174028] ERST_DEQUEUE: 0x0 [ 11.174029] INTR_REG 19 -- [ 11.174032] IRQ_PENDING: 0x0 [ 11.174034] IRQ_CONTROL: 0x0 [ 11.174037] ERST_SIZE: 0x0 [ 11.174042] ERST_BASE: 0x0 [ 11.174046] ERST_DEQUEUE: 0x0 ------------------------------------------------------------------------------------------------------ [ 11.174119] xhci_hcd:xhci_alloc_virt_device: xhci_hcd 0000:01:00.0: Slot 1 output ctx = 0x33001000 (dma) [ 11.174136] xhci_hcd:xhci_alloc_virt_device: xhci_hcd 0000:01:00.0: Slot 1 input ctx = 0x33002000 (dma) [ 11.174180] xhci_hcd:xhci_alloc_virt_device: xhci_hcd 0000:01:00.0: Set slot id 1 dcbaa entry 000000002f3c98f6 to 0x33001000 [ 11.174312] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: set port reset, actual port 0 status = 0x40000331 [ 11.184767] xhci_hcd:handle_port_status: xhci_hcd 0000:01:00.0: Port change event, 1-1, id 1, portsc: 0x40200e03 [ 11.570105] xhci_hcd:handle_port_status: xhci_hcd 0000:01:00.0: handle_port_status: starting port polling. [ 11.580043] xhci_hcd:xhci_hub_control: xhci_hcd 0000:01:00.0: Get port status 1-1 read: 0x40200e03, return 0x100503 [ 11.580145] xhci_hcd:xhci_clear_port_change_bit: xhci_hcd 0000:01:00.0: clear port1 reset change, portsc: 0x40000e03 [ 11.637867] usb 1-1: new high-speed USB device number 2 using xhci_hcd [ 11.637898] xhci_hcd:xhci_setup_addressable_virt_dev: xhci_hcd 0000:01:00.0: Set root hub portnum to 1 [ 11.637902] xhci_hcd:xhci_setup_addressable_virt_dev: xhci_hcd 0000:01:00.0: Set fake root hub portnum to 1 [ 11.637908] xhci_hcd:xhci_setup_addressable_virt_dev: xhci_hcd 0000:01:00.0: udev->tt = 00000000dfbb6633 [ 11.637912] xhci_hcd:xhci_setup_addressable_virt_dev: xhci_hcd 0000:01:00.0: udev->ttport = 0x0 [ 11.637927] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 11.638256] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Successful setup address command [ 11.638293] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Op regs DCBAA ptr = 0x0000003303f000 [ 11.638299] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Slot ID 1 dcbaa entry @000000002f3c98f6 = 0x00000033001000 [ 11.638303] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Output Context DMA address = 0x33001000 [ 11.638312] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Internal device address = 1 [ 11.717522] xhci_hcd:process_ctrl_td: xhci_hcd 0000:01:00.0: Waiting for status stage event [ 11.717587] usbcore:usb_get_langid: usb 1-1: default language 0x0409 [ 11.771127] xhci_hcd:process_ctrl_td: xhci_hcd 0000:01:00.0: Waiting for status stage event [ 11.780948] usbcore:usb_new_device: usb 1-1: udev 2, busnum 1, minor = 1 [ 11.788689] usbcore:usb_probe_device: usb 1-1: usb_probe_device [ 11.788700] usbcore:usb_choose_configuration: usb 1-1: configuration #1 chosen from 1 choice [ 11.788842] xhci_hcd:xhci_add_endpoint: xhci_hcd 0000:01:00.0: add ep 0x81, slot id 1, new drop flags = 0x0, new add flags = 0x8 [ 11.816796] xhci_hcd:xhci_check_bandwidth: xhci_hcd 0000:01:00.0: xhci_check_bandwidth called for udev 0000000021c29eb5 [ 11.816813] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 11.835768] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Successful Endpoint Configure command [ 11.835804] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 11.835888] xhci_hcd:handle_tx_event: xhci_hcd 0000:01:00.0: Stopped on No-op or Link TRB for slot 1 ep 2 [ 11.835904] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 11.837094] usbcore:usb_set_configuration: usb 1-1: adding 1-1:1.0 (config #1, interface 0) [ 11.837651] xhci_hcd:xhci_hub_status_data: xhci_hcd 0000:01:00.0: xhci_hub_status_data: stopping port polling. [ 11.891524] usbcore:usb_probe_interface: hub 1-1:1.0: usb_probe_interface [ 11.891530] usbcore:usb_probe_interface: hub 1-1:1.0: usb_probe_interface - got id [ 11.891543] hub 1-1:1.0: USB hub found [ 11.891764] xhci_hcd:process_ctrl_td: xhci_hcd 0000:01:00.0: Waiting for status stage event [ 11.907309] hub 1-1:1.0: 4 ports detected [ 11.907320] usbcore:hub_configure: hub 1-1:1.0: standalone hub [ 11.907323] usbcore:hub_configure: hub 1-1:1.0: ganged power switching [ 11.907327] usbcore:hub_configure: hub 1-1:1.0: global over-current protection [ 11.907331] usbcore:hub_configure: hub 1-1:1.0: Single TT [ 11.907336] usbcore:hub_configure: hub 1-1:1.0: TT requires at most 32 FS bit times (2664 ns) [ 11.907339] usbcore:hub_configure: hub 1-1:1.0: Port indicators are supported [ 11.907342] usbcore:hub_configure: hub 1-1:1.0: power on to power good time: 100ms [ 11.921003] usbcore:hub_configure: hub 1-1:1.0: local power source is good [ 11.986625] usbcore:hub_configure: hub 1-1:1.0: no over-current condition exists [ 11.986776] xhci_hcd:xhci_update_hub_device: xhci_hcd 0000:01:00.0: xHCI version 100 needs hub TT think time and number of ports [ 12.007321] xhci_hcd:xhci_update_hub_device: xhci_hcd 0000:01:00.0: Set up configure endpoint for hub device. [ 12.007335] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 12.018106] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Successful Endpoint Configure command [ 12.018121] usbcore:hub_power_on: hub 1-1:1.0: enabling power on all ports [ 12.151458] usbcore:hub_event: hub 1-1:1.0: state 7 ports 4 chg 0000 evt 0000 [ 12.159435] usbcore:hub_suspend: hub 1-1:1.0: hub_suspend [ 12.165656] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Cancel URB 0000000021a67753, dev 1, ep 0x81, starting at offset 0x33005000 [ 12.178477] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 12.186416] xhci_hcd:handle_tx_event: xhci_hcd 0000:01:00.0: Stopped on Transfer TRB for slot 1 ep 2 [ 12.196234] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Removing canceled TD starting at 0x33005000 (dma). [ 12.206400] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Finding endpoint context [ 12.214267] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Cycle state = 0x1 [ 12.221518] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: New dequeue segment = 000000000edef43d (virtual) [ 12.231504] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: New dequeue pointer = 0x33005010 (DMA) [ 12.240611] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Set TR Deq Ptr cmd, new deq seg = 000000000edef43d (0x33005000 dma), new deq ptr = 00000000a0465747 (0x33005010 dma), new cycle = 1 [ 12.257934] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 12.265088] xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:01:00.0: Successful Set TR Deq Ptr cmd, deq = @33005010 [ 12.276001] xhci_hcd:xhci_ring_cmd_db: xhci_hcd 0000:01:00.0: // Ding dong! [ 12.283602] xhci_hcd:handle_tx_event: xhci_hcd 0000:01:00.0: Stopped on No-op or Link TRB for slot 1 ep 0 [ 12.293952] xhci_hcd:xhci_set_link_state: xhci_hcd 0000:01:00.0: Set port 1-1 link state, portsc: 0x40000e03, write 0x40010e61 [ 12.334485] usbcore:usb_port_suspend: usb 1-1: usb auto-suspend, wakeup 1 [ 12.365946] usbcore:hub_suspend: hub 1-0:1.0: hub_suspend [ 12.371524] usbcore:hcd_bus_suspend: usb usb1: bus auto-suspend, wakeup 1 [ 12.378500] xhci_hcd:xhci_hub_status_data: xhci_hcd 0000:01:00.0: xhci_hub_status_data: stopping port polling.
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index fe38275363e0..52c6129a8efe 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -38,6 +38,52 @@ static unsigned long long quirks; module_param(quirks, ullong, S_IRUGO); MODULE_PARM_DESC(quirks, "Bit flags for quirks to be enabled as default"); +void xhci_dump_registers(struct xhci_hcd *xhci) +{ + struct xhci_run_regs *run_regs = xhci->run_regs; + struct xhci_cap_regs *hccr = xhci->cap_regs; + struct xhci_op_regs *hcor = xhci->op_regs; + int i; + + printk("\nHCCR-------\n"); + printk("\tCAPBASE: 0x%x\n", readl(&hccr->hc_capbase)); + printk("\tHCSPARAMS1: 0x%x\n", readl(&hccr->hcs_params1)); + printk("\tHCSPARAMS2: 0x%x\n", readl(&hccr->hcs_params2)); + printk("\tHCSPARAMS3: 0x%x\n", readl(&hccr->hcs_params3)); + printk("\tHCCPARAMS: 0x%x\n", readl(&hccr->hcc_params)); + printk("\tDBOFF: 0x%x\n", readl(&hccr->db_off)); + printk("\tRTSOFF: 0x%x\n", readl(&hccr->run_regs_off)); + printk("HCOR-------\n"); + printk("\tUSBCMD: 0x%x\n", readl(&hcor->command)); + printk("\tUSBSTS: 0x%x\n", readl(&hcor->status)); + printk("\tPAGESIZE: 0x%x\n", readl(&hcor->page_size)); + printk("\tDNCTRL: 0x%x\n", readl(&hcor->dev_notification)); + printk("\tCRCR: 0x%llx\n", xhci_read_64(xhci, &hcor->cmd_ring)); + printk("\tDCBAAP: 0x%llx\n", xhci_read_64(xhci, &hcor->dcbaa_ptr)); + printk("\tCONFIG: 0x%x\n", readl(&hcor->config_reg)); + printk("PORTREG 0 --\n"); + printk("\tPORTSC: 0x%x\n", readl(&hcor->port_status_base)); + printk("\tPORTPMSC: 0x%x\n", readl(&hcor->port_power_base)); + printk("\tPORTLI: 0x%x\n", readl(&hcor->port_link_base)); + for (i = 1; i < 5; i++) { + printk("PORTREG %d --\n", i); + printk("\tPORTSC: 0x%x\n", readl(&hcor->reserved6[(i*4)])); + printk("\tPORTPMSC: 0x%x\n", readl(&hcor->reserved6[i*4+1])); + printk("\tPORTLI: 0x%x\n", readl(&hcor->reserved6[i*4+2])); + } + printk("RUNREGS---\n"); + printk("\tMFINDEX: 0x%x\n", readl(&run_regs->microframe_index)); + for (i = 0; i < 20; i++) { + printk("\tINTR_REG %d --\n", i); + printk("\t\tIRQ_PENDING: 0x%x\n", readl(&run_regs->ir_set[i].irq_pending)); + printk("\t\tIRQ_CONTROL: 0x%x\n", readl(&run_regs->ir_set[i].irq_control)); + printk("\t\tERST_SIZE: 0x%x\n", readl(&run_regs->ir_set[i].erst_size)); + printk("\t\tERST_BASE: 0x%llx\n", xhci_read_64(xhci, &run_regs->ir_set[i].erst_base)); + printk("\t\tERST_DEQUEUE: 0x%llx\n", xhci_read_64(xhci, &run_regs->ir_set[i].erst_dequeue)); + } +} + + static bool td_on_ring(struct xhci_td *td, struct xhci_ring *ring) { struct xhci_segment *seg = ring->first_seg; @@ -3949,11 +3995,11 @@ static int xhci_reserve_host_control_ep_resources(struct xhci_hcd *xhci) return 0; } - /* * Returns 0 if the xHC ran out of device slots, the Enable Slot command * timed out, or allocating memory failed. Returns 1 on success. */ +int first = 1; int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) { struct xhci_hcd *xhci = hcd_to_xhci(hcd); @@ -3975,10 +4021,15 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) xhci_free_command(xhci, command); return 0; } + if (first) + xhci_dump_registers(xhci); xhci_ring_cmd_db(xhci); spin_unlock_irqrestore(&xhci->lock, flags); wait_for_completion(command->completion); + if (first) + xhci_dump_registers(xhci); + first = 0; slot_id = command->slot_id; if (!slot_id || command->status != COMP_SUCCESS) {
U-Boot> pci start pci_uclass_pre_probe, bus=0/pcie@7d500000, parent=scb decode_regions: len=7, cells_per_record=7 decode_regions: region 0, pci_addr=f8000000, addr=600000000, size=4000000, space_code=2 - type=0, pos=0 pci_uclass_post_probe: probing bus 0 pci_bind_bus_devices: bus 0/pcie@7d500000: found device 0, function 0: find ret=-19 pci_find_and_bind_driver: Searching for driver: vendor=14e4, device=2711 pci_find_and_bind_driver: No match found: bound generic driver instead pci_auto_config_devices: start PCI Autoconfig: Bus Memory region: [f8000000-fbffffff], Physical Memory [600000000-603ffffffx] pci_auto_config_devices: device pci_0:0.0 PCI Autoconfig: Found P2P bridge, device 0 dm_pci_hose_probe_bus pci_get_bus_max: ret=0 dm_pci_hose_probe_bus: bus = 1/pci_0:0.0 pci_uclass_pre_probe, bus=1/pci_0:0.0, parent=pcie@7d500000 pci_uclass_post_probe: probing bus 1 pci_bind_bus_devices: bus 1/pci_0:0.0: found device 0, function 0: find ret=-19 pci_find_and_bind_driver: Searching for driver: vendor=1106, device=3483 pci_find_and_bind_driver: Match found: xhci_pci pci_auto_config_devices: start pci_auto_config_devices: device xhci_pci PCI Autoconfig: BAR 0, Mem, size=0x1000, address=0xf8000000 bus_lower=0xf8001000 pci_auto_config_devices: done pci_get_bus_max: ret=1 pci_auto_config_devices: done Scanning PCI devices on bus 0 BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 00.00.00 0x14e4 0x2711 Bridge device 0x04 U-Boot> usb start starting USB... Bus xhci_pci: XHCI-PCI init hccr 0000000600000000 and hcor 0000000600000020 hc_length 32 PCIE CMD: 0x100006 xhci_register: dev='xhci_pci', ctrl=000000003db40600, hccr=0000000600000000, hcor=0000000600000020 // Halt the HC: 0000000600000020 // Reset the HC Register 5000420 NbrPorts 5 Starting the controller USB XHCI 1.00 scanning bus xhci_pci for devices... xhci_alloc_device: dev='xhci_pci', udev=000000003db22400 set address 1 usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_REQ_SET_ADDRESS scrlen = 0 req->length = 0 Len is 0 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 0x12 xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_DT_DEVICE request scrlen = 18 req->length = 18 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0x9 xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_DT_CONFIG config scrlen = 25 req->length = 9 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0x1F xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_DT_CONFIG config scrlen = 25 req->length = 31 get_conf_no 0 Result 25, wLength 31 if 0, ep 0 ##EP epmaxpacketin[1] = 8 set configuration 1 usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 scrlen = 0 req->length = 0 Len is 0 new device strings: Mfr=1, Product=2, SerialNumber=0 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x300 index 0x0 length 0xFF xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_DT_STRING config scrlen = 4 req->length = 255 USB device number 1 default language ID 0x409 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x301 index 0x409 length 0xFF xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_DT_STRING config scrlen = 14 req->length = 255 usb_control_msg: request: 0x6, requesttype: 0x80, value 0x302 index 0x409 length 0xFF xhci_submit_control_msg: dev='xhci_pci', udev=000000003db22400, udev->dev='xhci_pci', portnr=0 USB_DT_STRING config scrlen = 42 req->length = 255 Manufacturer U-Boot Product XHCI Host Controller SerialNumber usb_hub_post_probe usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2A00 index 0x0 length 0x4 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 USB_DT_HUB config scrlen = 8 req->length = 4 usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2A00 index 0x0 length 0xC xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 USB_DT_HUB config scrlen = 8 req->length = 12 5 ports detected individual port power switching standalone hub individual port over-current protection TT requires at most 8 FS bit times (666 ns) power on to power good time: 20ms hub controller current requirement: 0mA port 1 is removable port 2 is removable port 3 is removable port 4 is removable port 5 is removable usb_control_msg: request: 0x0, requesttype: 0xA0, value 0x0 index 0x0 length 0x4 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 2 req->length = 4 get_hub_status returned status 1, change 905 local power source is lost (inactive) no over-current condition exists xhci_update_hub_device: dev='xhci_pci', udev=000000003dbca440 enabling power on all ports usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x1 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 0 req->length = 0 Len is 0 port 1 returns 0 usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x2 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 0 req->length = 0 Len is 0 port 2 returns 0 usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x3 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 0 req->length = 0 Len is 0 port 3 returns 0 usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x4 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 0 req->length = 0 Len is 0 port 4 returns 0 usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x5 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 0 req->length = 0 Len is 0 port 5 returns 0 pgood_delay=20ms devnum=1 poweron: query_delay=100 connect_timeout=1100 usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 4 req->length = 4 Port 1 Status 101 Change 1 devnum=1 port=1: USB dev found usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 4 req->length = 4 portstatus 101, change 1, 12 Mb/s usb_control_msg: request: 0x1, requesttype: 0x23, value 0x10 index 0x1 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 clear port connect change, actual port 1 status = 0x400002e1 scrlen = 0 req->length = 0 Len is 0 usb_hub_port_reset: resetting 'usb_hub' port 1... usb_control_msg: request: 0x3, requesttype: 0x23, value 0x4 index 0x1 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 scrlen = 0 req->length = 0 Len is 0 usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 SPEED = HIGHSPEED scrlen = 4 req->length = 4 portstatus 503, change 10, 480 Mb/s STAT_C_CONNECTION = 0 STAT_CONNECTION = 1 USB_PORT_STAT_ENABLE 1 usb_control_msg: request: 0x1, requesttype: 0x23, value 0x14 index 0x1 length 0x0 xhci_submit_control_msg: dev='xhci_pci', udev=000000003dbca440, udev->dev='usb_hub', portnr=0 clear port reset change, actual port 1 status = 0x40000e03 scrlen = 0 req->length = 0 Len is 0 xhci_alloc_device: dev='xhci_pci', udev=000000003db214c0 -------------------------------------------------------------------------------- Before call to TRB_ENABLE_SLOT HCCR------- CAPBASE: 0x1000020 HCSPARAMS1: 0x5000420 HCSPARAMS2: 0xfc000031 HCSPARAMS3: 0xe70004 HCCPARAMS: 0x2841eb DBOFF: 0x100 RTSOFF: 0x200 HCOR------- USBCMD: 0x1 USBSTS: 0x10 PAGESIZE: 0x1 DNCTRL: 0x0 CRCR: 0x0 DCBAAP: 0x3db40f40 CONFIG: 0x20 PORTREG 0 -- PORTSC: 0x40000e03 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 1 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 2 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 3 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 4 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 RUNREGS--- MFINDEX: 0x2473 INTR_REG 0 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x1 ERST_BASE: 0x3db42100 ERST_DEQUEUE: 0x3db41cc0 INTR_REG 1 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0xfa0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 2 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0xfa0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 3 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0xfa0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 4 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 5 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 6 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 7 -- IRQ_PENDING: 0x1000a IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 8 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0xa0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 9 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 10 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 11 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 12 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 13 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 14 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 15 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 16 -- IRQ_PENDING: 0x40000e03 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x2a0 ERST_DEQUEUE: 0x0 INTR_REG 17 -- IRQ_PENDING: 0x2a0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x2a0 ERST_DEQUEUE: 0x0 INTR_REG 18 -- IRQ_PENDING: 0x2a0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 19 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 -------------------------------------------------------------------------------- EP STATE RUNNING. XHCI timeout on event type 33... cannot recover. -------------------------------------------------------------------------------- After call to TRB_ENABLE_SLOT HCCR------- CAPBASE: 0x1000020 HCSPARAMS1: 0x5000420 HCSPARAMS2: 0xfc000031 HCSPARAMS3: 0xe70004 HCCPARAMS: 0x2841eb DBOFF: 0x100 RTSOFF: 0x200 HCOR------- USBCMD: 0x1 USBSTS: 0x10 PAGESIZE: 0x1 DNCTRL: 0x0 CRCR: 0x0 DCBAAP: 0x3db40f40 CONFIG: 0x20 PORTREG 0 -- PORTSC: 0x40000e03 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 1 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 2 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 3 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 PORTREG 4 -- PORTSC: 0x2a0 PORTPMSC: 0x0 PORTLI: 0x0 RUNREGS--- MFINDEX: 0x1eb2 INTR_REG 0 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x1 ERST_BASE: 0x3db42100 ERST_DEQUEUE: 0x3db41cc0 INTR_REG 1 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0xfa0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 2 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0xfa0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 3 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0xfa0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 4 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 5 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 6 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 7 -- IRQ_PENDING: 0x1000a IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 8 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0xa0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 9 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 10 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 11 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 12 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 13 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 14 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 15 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 16 -- IRQ_PENDING: 0x40000e03 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x2a0 ERST_DEQUEUE: 0x0 INTR_REG 17 -- IRQ_PENDING: 0x2a0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x2a0 ERST_DEQUEUE: 0x0 INTR_REG 18 -- IRQ_PENDING: 0x2a0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 INTR_REG 19 -- IRQ_PENDING: 0x0 IRQ_CONTROL: 0x0 ERST_SIZE: 0x0 ERST_BASE: 0x0 ERST_DEQUEUE: 0x0 -------------------------------------------------------------------------------- BUG at drivers/usb/host/xhci-ring.c:475/xhci_wait_for_event()! BUG! resetting ...
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index c1f60da541..62638e19ff 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -11,6 +11,8 @@ #include <usb.h> #include <usb/xhci.h> +void xhci_dump_registers(struct xhci_ctrl *ctrl); + static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr, struct xhci_hcor **ret_hcor) { diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 3cd6c8a0dc..2a5f9e4d25 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -471,6 +471,7 @@ union xhci_trb *xhci_wait_for_event(struct xhci_ctrl *ctrl, trb_type expected) return NULL; printf("XHCI timeout on event type %d... cannot recover.\n", expected); + xhci_dump_registers(ctrl); BUG(); } diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 40dee2e6d9..d1a1c86adc 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -695,6 +695,47 @@ static int xhci_address_device(struct usb_device *udev, int root_portnr) return 0; } +void xhci_dump_registers(struct xhci_ctrl *ctrl) +{ + struct xhci_run_regs *run_regs = ctrl->run_regs; + struct xhci_hccr *hccr = ctrl->hccr; + struct xhci_hcor *hcor = ctrl->hcor; + int i; + + printf("\nHCCR-------\n"); + printf("\tCAPBASE: 0x%x\n", xhci_readl(&hccr->cr_capbase)); + printf("\tHCSPARAMS1: 0x%x\n", xhci_readl(&hccr->cr_hcsparams1)); + printf("\tHCSPARAMS2: 0x%x\n", xhci_readl(&hccr->cr_hcsparams2)); + printf("\tHCSPARAMS3: 0x%x\n", xhci_readl(&hccr->cr_hcsparams3)); + printf("\tHCCPARAMS: 0x%x\n", xhci_readl(&hccr->cr_hccparams)); + printf("\tDBOFF: 0x%x\n", xhci_readl(&hccr->cr_dboff)); + printf("\tRTSOFF: 0x%x\n", xhci_readl(&hccr->cr_rtsoff)); + printf("HCOR-------\n"); + printf("\tUSBCMD: 0x%x\n", xhci_readl(&hcor->or_usbcmd)); + printf("\tUSBSTS: 0x%x\n", xhci_readl(&hcor->or_usbsts)); + printf("\tPAGESIZE: 0x%x\n", xhci_readl(&hcor->or_pagesize)); + printf("\tDNCTRL: 0x%x\n", xhci_readl(&hcor->or_dnctrl)); + printf("\tCRCR: 0x%llx\n", xhci_readq(&hcor->or_crcr)); + printf("\tDCBAAP: 0x%llx\n", xhci_readq(&hcor->or_dcbaap)); + printf("\tCONFIG: 0x%x\n", xhci_readl(&hcor->or_config)); + for (i = 0; i < 5; i++) { + printf("PORTREG %d --\n", i); + printf("\tPORTSC: 0x%x\n", xhci_readl(&hcor->portregs[i].or_portsc)); + printf("\tPORTPMSC: 0x%x\n", xhci_readl(&hcor->portregs[i].or_portpmsc)); + printf("\tPORTLI: 0x%x\n", xhci_readl(&hcor->portregs[i].or_portli)); + } + printf("RUNREGS---\n"); + printf("\tMFINDEX: 0x%x\n", xhci_readl(&run_regs->microframe_index)); + for (i = 0; i < 20; i++) { + printf("\tINTR_REG %d --\n", i); + printf("\t\tIRQ_PENDING: 0x%x\n", xhci_readl(&run_regs->ir_set[i].irq_pending)); + printf("\t\tIRQ_CONTROL: 0x%x\n", xhci_readl(&run_regs->ir_set[i].irq_control)); + printf("\t\tERST_SIZE: 0x%x\n", xhci_readl(&run_regs->ir_set[i].erst_size)); + printf("\t\tERST_BASE: 0x%llx\n", xhci_readq(&run_regs->ir_set[i].erst_base)); + printf("\t\tERST_DEQUEUE: 0x%llx\n", xhci_readq(&run_regs->ir_set[i].erst_dequeue)); + } +} + /** * Issue Enable slot command to the controller to allocate * device slot and assign the slot id. It fails if the xHC @@ -720,6 +761,8 @@ static int _xhci_alloc_device(struct usb_device *udev) return 0; } + xhci_dump_registers(ctrl); + xhci_queue_command(ctrl, NULL, 0, 0, TRB_ENABLE_SLOT); event = xhci_wait_for_event(ctrl, TRB_COMPLETION); BUG_ON(GET_COMP_CODE(le32_to_cpu(event->event_cmd.status))
signature.asc
Description: This is a digitally signed message part