Skip to content

Commit 5317124

Browse files
xiaoguangwulijinxia
authored andcommitted
DM USB: xHCI: add support for USB 3.0 devices
This patch is used to add support for USB 3.0 devices. Currently USB 3.0 disk is supported and tested successfully. Change-Id: I3fbfbe9c28bc4b14af0417104f8fa822f9758908 Tracked-On: Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com> Reviewed-by: Liang Yang <liang3.yang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent 8317dea commit 5317124

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

devicemodel/hw/pci/xhci.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,6 @@ pci_xhci_native_usb_dev_conn_cb(void *hci_data, void *dev_data)
500500
UPRINTF(LDBG, "%04x:%04x %d-%d connecting.\r\n",
501501
native_vid, native_pid, native_bus, native_port);
502502

503-
/* FIXME: will support usb3 in future */
504-
if (xdev->native_assign_ports[native_bus] &&
505-
usb_native_is_ss_port(native_bus)) {
506-
UPRINTF(LDBG, "%04x:%04x %d-%d be ignored due to superspeed"
507-
" device hasn't support yet\r\n", native_vid,
508-
native_pid, native_bus, native_port);
509-
goto errout;
510-
}
511-
512503
if (!xdev->native_assign_ports[native_bus] ||
513504
!xdev->native_assign_ports[native_bus][native_port]) {
514505
UPRINTF(LDBG, "%04x:%04x %d-%d doesn't belong to this vm, bye."
@@ -783,7 +774,6 @@ pci_xhci_port_chg(struct pci_xhci_vdev *xdev, int port, int conn)
783774
return -1;
784775
}
785776

786-
/* TODO: add USB 3.0 port state */
787777
if (conn == 0) {
788778
reg->portsc &= ~XHCI_PS_CCS;
789779
reg->portsc |= (XHCI_PS_CSC |

devicemodel/hw/platform/usb_pmapper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,9 @@ usb_dev_init(void *pdata, char *opt)
762762
if (port == 0)
763763
goto errout;
764764

765-
switch (desc.bcdUSB) { /* TODO: implemnt USB3.0 */
765+
switch (desc.bcdUSB) {
766766
case 0x300:
767-
ver = 2; break;
767+
ver = 3; break;
768768
case 0x200:
769769
case 0x110:
770770
ver = 2; break;

devicemodel/include/usb_core.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434
#include <stdbool.h>
3535
#include "types.h"
3636

37-
#define USB_MAX_XFER_BLOCKS 256
37+
/* FIXME:
38+
* There are some huge data requests which need more than 256 TRBs in a single
39+
* transfer, so it is neccessary to expand it.
40+
* But this is not final solution, this size should be dynamically changed
41+
* according to the native xhci driver's adjust of trb segements.
42+
* By default, the native xhci driver use two segments which contain 2 * 256
43+
* trbs, so 1024 is enough currently.
44+
*/
45+
#define USB_MAX_XFER_BLOCKS 1024
3846

3947
#define USB_XFER_OUT 0
4048
#define USB_XFER_IN 1

0 commit comments

Comments
 (0)