usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
/**
|
|
|
|
* debug.h - DesignWare USB3 DRD Controller Debug Header
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
|
|
|
|
*
|
|
|
|
* Authors: Felipe Balbi <balbi@ti.com>,
|
|
|
|
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
*
|
2013-06-30 18:15:11 +07:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 of
|
|
|
|
* the License as published by the Free Software Foundation.
|
usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
*
|
2013-06-30 18:15:11 +07:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
*/
|
|
|
|
|
2014-08-20 04:37:22 +07:00
|
|
|
#ifndef __DWC3_DEBUG_H
|
|
|
|
#define __DWC3_DEBUG_H
|
|
|
|
|
usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
#include "core.h"
|
|
|
|
|
2014-08-20 04:37:22 +07:00
|
|
|
/**
|
|
|
|
* dwc3_gadget_ep_cmd_string - returns endpoint command string
|
|
|
|
* @cmd: command code
|
|
|
|
*/
|
|
|
|
static inline const char *
|
|
|
|
dwc3_gadget_ep_cmd_string(u8 cmd)
|
|
|
|
{
|
|
|
|
switch (cmd) {
|
|
|
|
case DWC3_DEPCMD_DEPSTARTCFG:
|
|
|
|
return "Start New Configuration";
|
|
|
|
case DWC3_DEPCMD_ENDTRANSFER:
|
|
|
|
return "End Transfer";
|
|
|
|
case DWC3_DEPCMD_UPDATETRANSFER:
|
|
|
|
return "Update Transfer";
|
|
|
|
case DWC3_DEPCMD_STARTTRANSFER:
|
|
|
|
return "Start Transfer";
|
|
|
|
case DWC3_DEPCMD_CLEARSTALL:
|
|
|
|
return "Clear Stall";
|
|
|
|
case DWC3_DEPCMD_SETSTALL:
|
|
|
|
return "Set Stall";
|
|
|
|
case DWC3_DEPCMD_GETEPSTATE:
|
|
|
|
return "Get Endpoint State";
|
|
|
|
case DWC3_DEPCMD_SETTRANSFRESOURCE:
|
|
|
|
return "Set Endpoint Transfer Resource";
|
|
|
|
case DWC3_DEPCMD_SETEPCONFIG:
|
|
|
|
return "Set Endpoint Configuration";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN command";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* dwc3_gadget_generic_cmd_string - returns generic command string
|
|
|
|
* @cmd: command code
|
|
|
|
*/
|
|
|
|
static inline const char *
|
|
|
|
dwc3_gadget_generic_cmd_string(u8 cmd)
|
|
|
|
{
|
|
|
|
switch (cmd) {
|
|
|
|
case DWC3_DGCMD_SET_LMP:
|
|
|
|
return "Set LMP";
|
|
|
|
case DWC3_DGCMD_SET_PERIODIC_PAR:
|
|
|
|
return "Set Periodic Parameters";
|
|
|
|
case DWC3_DGCMD_XMIT_FUNCTION:
|
|
|
|
return "Transmit Function Wake Device Notification";
|
|
|
|
case DWC3_DGCMD_SET_SCRATCHPAD_ADDR_LO:
|
|
|
|
return "Set Scratchpad Buffer Array Address Lo";
|
|
|
|
case DWC3_DGCMD_SET_SCRATCHPAD_ADDR_HI:
|
|
|
|
return "Set Scratchpad Buffer Array Address Hi";
|
|
|
|
case DWC3_DGCMD_SELECTED_FIFO_FLUSH:
|
|
|
|
return "Selected FIFO Flush";
|
|
|
|
case DWC3_DGCMD_ALL_FIFO_FLUSH:
|
|
|
|
return "All FIFO Flush";
|
|
|
|
case DWC3_DGCMD_SET_ENDPOINT_NRDY:
|
|
|
|
return "Set Endpoint NRDY";
|
|
|
|
case DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK:
|
|
|
|
return "Run SoC Bus Loopback Test";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* dwc3_gadget_link_string - returns link name
|
|
|
|
* @link_state: link state code
|
|
|
|
*/
|
|
|
|
static inline const char *
|
|
|
|
dwc3_gadget_link_string(enum dwc3_link_state link_state)
|
|
|
|
{
|
|
|
|
switch (link_state) {
|
|
|
|
case DWC3_LINK_STATE_U0:
|
|
|
|
return "U0";
|
|
|
|
case DWC3_LINK_STATE_U1:
|
|
|
|
return "U1";
|
|
|
|
case DWC3_LINK_STATE_U2:
|
|
|
|
return "U2";
|
|
|
|
case DWC3_LINK_STATE_U3:
|
|
|
|
return "U3";
|
|
|
|
case DWC3_LINK_STATE_SS_DIS:
|
|
|
|
return "SS.Disabled";
|
|
|
|
case DWC3_LINK_STATE_RX_DET:
|
|
|
|
return "RX.Detect";
|
|
|
|
case DWC3_LINK_STATE_SS_INACT:
|
|
|
|
return "SS.Inactive";
|
|
|
|
case DWC3_LINK_STATE_POLL:
|
|
|
|
return "Polling";
|
|
|
|
case DWC3_LINK_STATE_RECOV:
|
|
|
|
return "Recovery";
|
|
|
|
case DWC3_LINK_STATE_HRESET:
|
|
|
|
return "Hot Reset";
|
|
|
|
case DWC3_LINK_STATE_CMPLY:
|
|
|
|
return "Compliance";
|
|
|
|
case DWC3_LINK_STATE_LPBK:
|
|
|
|
return "Loopback";
|
|
|
|
case DWC3_LINK_STATE_RESET:
|
|
|
|
return "Reset";
|
|
|
|
case DWC3_LINK_STATE_RESUME:
|
|
|
|
return "Resume";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN link state\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-26 17:22:21 +07:00
|
|
|
static inline const char *dwc3_ep0_state_string(enum dwc3_ep0_state state)
|
|
|
|
{
|
|
|
|
switch (state) {
|
|
|
|
case EP0_UNCONNECTED:
|
|
|
|
return "Unconnected";
|
|
|
|
case EP0_SETUP_PHASE:
|
|
|
|
return "Setup Phase";
|
|
|
|
case EP0_DATA_PHASE:
|
|
|
|
return "Data Phase";
|
|
|
|
case EP0_STATUS_PHASE:
|
|
|
|
return "Status Phase";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-20 04:37:22 +07:00
|
|
|
/**
|
|
|
|
* dwc3_gadget_event_string - returns event name
|
|
|
|
* @event: the event code
|
|
|
|
*/
|
2016-05-23 15:10:08 +07:00
|
|
|
static inline const char *
|
|
|
|
dwc3_gadget_event_string(const struct dwc3_event_devt *event)
|
2014-08-20 04:37:22 +07:00
|
|
|
{
|
2016-05-23 15:10:08 +07:00
|
|
|
static char str[256];
|
|
|
|
enum dwc3_link_state state = event->event_info & DWC3_LINK_STATE_MASK;
|
|
|
|
|
|
|
|
switch (event->type) {
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_DISCONNECT:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Disconnect: [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_RESET:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Reset [%s]", dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_CONNECT_DONE:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Connection Done [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Link Change [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_WAKEUP:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "WakeUp [%s]", dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_EOPF:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "End-Of-Frame [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_SOF:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Start-Of-Frame [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_ERRATIC_ERROR:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Erratic Error [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_CMD_CMPL:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Command Complete [%s]",
|
|
|
|
dwc3_gadget_link_string(state));
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEVICE_EVENT_OVERFLOW:
|
2016-05-23 15:10:08 +07:00
|
|
|
sprintf(str, "Overflow [%s]", dwc3_gadget_link_string(state));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
sprintf(str, "UNKNOWN");
|
2014-08-20 04:37:22 +07:00
|
|
|
}
|
|
|
|
|
2016-05-23 15:10:08 +07:00
|
|
|
return str;
|
2014-08-20 04:37:22 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* dwc3_ep_event_string - returns event name
|
|
|
|
* @event: then event code
|
|
|
|
*/
|
2016-05-23 15:10:08 +07:00
|
|
|
static inline const char *
|
2016-09-26 17:23:34 +07:00
|
|
|
dwc3_ep_event_string(const struct dwc3_event_depevt *event, u32 ep0state)
|
2014-08-20 04:37:22 +07:00
|
|
|
{
|
2016-05-23 15:10:08 +07:00
|
|
|
u8 epnum = event->endpoint_number;
|
|
|
|
static char str[256];
|
2016-09-26 17:23:34 +07:00
|
|
|
size_t len;
|
2016-05-23 15:10:08 +07:00
|
|
|
int status;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = sprintf(str, "ep%d%s: ", epnum >> 1,
|
2016-08-24 18:32:39 +07:00
|
|
|
(epnum & 1) ? "in" : "out");
|
2016-05-23 15:10:08 +07:00
|
|
|
if (ret < 0)
|
|
|
|
return "UNKNOWN";
|
|
|
|
|
|
|
|
switch (event->endpoint_event) {
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEPEVT_XFERCOMPLETE:
|
2016-05-23 15:10:08 +07:00
|
|
|
strcat(str, "Transfer Complete");
|
2016-09-26 17:23:34 +07:00
|
|
|
len = strlen(str);
|
|
|
|
|
|
|
|
if (epnum <= 1)
|
|
|
|
sprintf(str + len, " [%s]", dwc3_ep0_state_string(ep0state));
|
2016-05-23 15:10:08 +07:00
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEPEVT_XFERINPROGRESS:
|
2016-05-23 15:10:08 +07:00
|
|
|
strcat(str, "Transfer In-Progress");
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEPEVT_XFERNOTREADY:
|
2016-05-23 15:10:08 +07:00
|
|
|
strcat(str, "Transfer Not Ready");
|
|
|
|
status = event->status & DEPEVT_STATUS_TRANSFER_ACTIVE;
|
|
|
|
strcat(str, status ? " (Active)" : " (Not Active)");
|
2016-09-26 16:54:04 +07:00
|
|
|
|
|
|
|
/* Control Endpoints */
|
|
|
|
if (epnum <= 1) {
|
|
|
|
int phase = DEPEVT_STATUS_CONTROL_PHASE(event->status);
|
|
|
|
|
|
|
|
switch (phase) {
|
|
|
|
case DEPEVT_STATUS_CONTROL_DATA:
|
|
|
|
strcat(str, " [Data Phase]");
|
|
|
|
break;
|
|
|
|
case DEPEVT_STATUS_CONTROL_STATUS:
|
|
|
|
strcat(str, " [Status Phase]");
|
|
|
|
}
|
|
|
|
}
|
2016-05-23 15:10:08 +07:00
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEPEVT_RXTXFIFOEVT:
|
2016-05-23 15:10:08 +07:00
|
|
|
strcat(str, "FIFO");
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEPEVT_STREAMEVT:
|
2016-05-23 15:10:08 +07:00
|
|
|
status = event->status;
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
case DEPEVT_STREAMEVT_FOUND:
|
|
|
|
sprintf(str + ret, " Stream %d Found",
|
|
|
|
event->parameters);
|
|
|
|
break;
|
|
|
|
case DEPEVT_STREAMEVT_NOTFOUND:
|
|
|
|
default:
|
|
|
|
strcat(str, " Stream Not Found");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2014-08-20 04:37:22 +07:00
|
|
|
case DWC3_DEPEVT_EPCMDCMPLT:
|
2016-05-23 15:10:08 +07:00
|
|
|
strcat(str, "Endpoint Command Complete");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
sprintf(str, "UNKNOWN");
|
2014-08-20 04:37:22 +07:00
|
|
|
}
|
|
|
|
|
2016-05-23 15:10:08 +07:00
|
|
|
return str;
|
2014-08-20 04:37:22 +07:00
|
|
|
}
|
|
|
|
|
2014-08-20 04:49:20 +07:00
|
|
|
/**
|
|
|
|
* dwc3_gadget_event_type_string - return event name
|
|
|
|
* @event: the event code
|
|
|
|
*/
|
|
|
|
static inline const char *dwc3_gadget_event_type_string(u8 event)
|
|
|
|
{
|
|
|
|
switch (event) {
|
|
|
|
case DWC3_DEVICE_EVENT_DISCONNECT:
|
|
|
|
return "Disconnect";
|
|
|
|
case DWC3_DEVICE_EVENT_RESET:
|
|
|
|
return "Reset";
|
|
|
|
case DWC3_DEVICE_EVENT_CONNECT_DONE:
|
|
|
|
return "Connect Done";
|
|
|
|
case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE:
|
|
|
|
return "Link Status Change";
|
|
|
|
case DWC3_DEVICE_EVENT_WAKEUP:
|
|
|
|
return "Wake-Up";
|
|
|
|
case DWC3_DEVICE_EVENT_HIBER_REQ:
|
|
|
|
return "Hibernation";
|
|
|
|
case DWC3_DEVICE_EVENT_EOPF:
|
|
|
|
return "End of Periodic Frame";
|
|
|
|
case DWC3_DEVICE_EVENT_SOF:
|
|
|
|
return "Start of Frame";
|
|
|
|
case DWC3_DEVICE_EVENT_ERRATIC_ERROR:
|
|
|
|
return "Erratic Error";
|
|
|
|
case DWC3_DEVICE_EVENT_CMD_CMPL:
|
|
|
|
return "Command Complete";
|
|
|
|
case DWC3_DEVICE_EVENT_OVERFLOW:
|
|
|
|
return "Overflow";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-26 17:23:34 +07:00
|
|
|
static inline const char *dwc3_decode_event(u32 event, u32 ep0state)
|
2016-05-23 15:10:08 +07:00
|
|
|
{
|
|
|
|
const union dwc3_event evt = (union dwc3_event) event;
|
|
|
|
|
|
|
|
if (evt.type.is_devspec)
|
|
|
|
return dwc3_gadget_event_string(&evt.devt);
|
|
|
|
else
|
2016-09-26 17:23:34 +07:00
|
|
|
return dwc3_ep_event_string(&evt.depevt, ep0state);
|
2016-05-23 15:10:08 +07:00
|
|
|
}
|
|
|
|
|
2016-05-23 18:02:33 +07:00
|
|
|
static inline const char *dwc3_ep_cmd_status_string(int status)
|
|
|
|
{
|
|
|
|
switch (status) {
|
|
|
|
case -ETIMEDOUT:
|
|
|
|
return "Timed Out";
|
|
|
|
case 0:
|
|
|
|
return "Successful";
|
|
|
|
case DEPEVT_TRANSFER_NO_RESOURCE:
|
|
|
|
return "No Resource";
|
|
|
|
case DEPEVT_TRANSFER_BUS_EXPIRY:
|
|
|
|
return "Bus Expiry";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-23 18:16:19 +07:00
|
|
|
static inline const char *dwc3_gadget_generic_cmd_status_string(int status)
|
|
|
|
{
|
|
|
|
switch (status) {
|
|
|
|
case -ETIMEDOUT:
|
|
|
|
return "Timed Out";
|
|
|
|
case 0:
|
|
|
|
return "Successful";
|
|
|
|
case 1:
|
|
|
|
return "Error";
|
|
|
|
default:
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-30 18:12:34 +07:00
|
|
|
|
usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
2016-04-12 18:10:18 +07:00
|
|
|
extern void dwc3_debugfs_init(struct dwc3 *);
|
usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
extern void dwc3_debugfs_exit(struct dwc3 *);
|
|
|
|
#else
|
2016-04-12 18:10:18 +07:00
|
|
|
static inline void dwc3_debugfs_init(struct dwc3 *d)
|
|
|
|
{ }
|
usb: Introduce DesignWare USB3 DRD Driver
The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.
Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.
The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.
More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.
While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.
[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-19 22:10:58 +07:00
|
|
|
static inline void dwc3_debugfs_exit(struct dwc3 *d)
|
|
|
|
{ }
|
|
|
|
#endif
|
2014-08-20 04:37:22 +07:00
|
|
|
#endif /* __DWC3_DEBUG_H */
|