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>
This commit is contained in:
Xiaoguang Wu 2018-07-11 14:40:42 +08:00 committed by lijinxia
parent 8317dea64c
commit 531712405e
3 changed files with 11 additions and 13 deletions

View File

@ -500,15 +500,6 @@ pci_xhci_native_usb_dev_conn_cb(void *hci_data, void *dev_data)
UPRINTF(LDBG, "%04x:%04x %d-%d connecting.\r\n",
native_vid, native_pid, native_bus, native_port);
/* FIXME: will support usb3 in future */
if (xdev->native_assign_ports[native_bus] &&
usb_native_is_ss_port(native_bus)) {
UPRINTF(LDBG, "%04x:%04x %d-%d be ignored due to superspeed"
" device hasn't support yet\r\n", native_vid,
native_pid, native_bus, native_port);
goto errout;
}
if (!xdev->native_assign_ports[native_bus] ||
!xdev->native_assign_ports[native_bus][native_port]) {
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)
return -1;
}
/* TODO: add USB 3.0 port state */
if (conn == 0) {
reg->portsc &= ~XHCI_PS_CCS;
reg->portsc |= (XHCI_PS_CSC |

View File

@ -762,9 +762,9 @@ usb_dev_init(void *pdata, char *opt)
if (port == 0)
goto errout;
switch (desc.bcdUSB) { /* TODO: implemnt USB3.0 */
switch (desc.bcdUSB) {
case 0x300:
ver = 2; break;
ver = 3; break;
case 0x200:
case 0x110:
ver = 2; break;

View File

@ -34,7 +34,15 @@
#include <stdbool.h>
#include "types.h"
#define USB_MAX_XFER_BLOCKS 256
/* FIXME:
* There are some huge data requests which need more than 256 TRBs in a single
* transfer, so it is neccessary to expand it.
* But this is not final solution, this size should be dynamically changed
* according to the native xhci driver's adjust of trb segements.
* By default, the native xhci driver use two segments which contain 2 * 256
* trbs, so 1024 is enough currently.
*/
#define USB_MAX_XFER_BLOCKS 1024
#define USB_XFER_OUT 0
#define USB_XFER_IN 1