在dwc3_host_init函数的最后调用platform_device_add(xhci)添加platform device(xhci-hcd),用于匹配xHCI driver(xHCI driver platform_driver usb_xhci_driver = { .probe = xhci_plat_probe, .remove = xhci_plat_remove, .driver = { .name = "xhci-hcd usb_xhci_driver); } 1)在xhci_plat_init中调用platform_driver_register(&usb_xhci_driver)注册platform driver("xhci-hcd ") 2)首先根据name="xhci-hcd"匹配到platform device后,执行xhci_plat_probe 3)在xhci_plat_probe中,进行xHCI的初始化,最后添加到usb
xhci-hcd.0.auto: xHCI Host Controller [ 2.815608@3] xhci-hcd xhci-hcd.0.auto: new USB bus registered , assigned bus number 1 [ 2.823704@3] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220f664 hci version 0x100 quirks 0x02010010 [ 2.832219@3] xhci-hcd xhci-hcd.0.auto: irq 26, io mem 0xff500000 [ 2.839052 @3] hub 1-0:1.0: USB hub found [ 2.842123@3] hub 1-0:1.0: 1 port detected [ 2.846403@3] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller [ 2.851750@3] xhci-hcd xhci-hcd.0.auto: new USB bus registered
: Product: xHCI Host Controller [ 0.513304] usb usb1: Manufacturer: Linux 3.10.0-327.el7.x86_64 xhci-hcd : Product: xHCI Host Controller [ 0.518702] usb usb2: Manufacturer: Linux 3.10.0-327.el7.x86_64 xhci-hcd
xhci-hcd.0.auto: xHCI Host Controller [ 4.238621] xhci-hcd xhci-hcd.0.auto: new USB bus registered , assigned bus number 1 [ 4.246499] xhci-hcd xhci-hcd.0.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x22010810 [ 4.255215] xhci-hcd xhci-hcd.0.auto: irq 52, io mem 0xfe200000 [ 4.261263] xhci-hcd.0.auto: xHCI Host Controller [ 4.304528] xhci-hcd xhci-hcd.0.auto: new USB bus registered , assigned bus number 2 [ 4.312182] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed [
124 Level xilinx-vphy 60: 0 0 0 0 GICv2 97 Level xhci-hcd
124 Level xilinx-vphy 64: 0 0 0 0 GICv2 97 Level xhci-hcd
xhci指向了usb作为主机模式时的数据结构,使用platform_device表示,主机模式的驱动是platform_driver,两个会通过设备名称xhci-hcd匹配,具体在分析主机驱动时说明。
2EPs () usb-storage host9 |__usb2 1d6b:0002:0404 09 2.00 480MBit/s 0mA 1IF (Linux 4.4.302+ xhci-hcd
intel_ish jbd2 migrate net power ras rpm skb task vsyscall xhci-hcd