2017-11-03 18:28:30 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
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 23:10:58 +08:00
|
|
|
/**
|
|
|
|
* dwc3-omap.c - OMAP Specific Glue layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
|
|
|
|
*
|
|
|
|
* Authors: Felipe Balbi <balbi@ti.com>,
|
|
|
|
* Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
*/
|
|
|
|
|
2011-09-05 18:37:28 +08:00
|
|
|
#include <linux/module.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 23:10:58 +08:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/slab.h>
|
2016-12-13 03:37:52 +08:00
|
|
|
#include <linux/irq.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 23:10:58 +08:00
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/platform_device.h>
|
2011-09-02 03:26:25 +08:00
|
|
|
#include <linux/platform_data/dwc3-omap.h>
|
2013-01-25 11:00:47 +08:00
|
|
|
#include <linux/pm_runtime.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 23:10:58 +08:00
|
|
|
#include <linux/dma-mapping.h>
|
|
|
|
#include <linux/ioport.h>
|
|
|
|
#include <linux/io.h>
|
2012-01-25 17:07:03 +08:00
|
|
|
#include <linux/of.h>
|
2013-01-25 11:00:46 +08:00
|
|
|
#include <linux/of_platform.h>
|
2013-07-08 08:54:43 +08:00
|
|
|
#include <linux/extcon.h>
|
|
|
|
#include <linux/regulator/consumer.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 23:10:58 +08:00
|
|
|
|
2012-07-19 18:56:07 +08:00
|
|
|
#include <linux/usb/otg.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 23:10:58 +08:00
|
|
|
/*
|
|
|
|
* All these registers belong to OMAP's Wrapper around the
|
|
|
|
* DesignWare USB3 Core.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define USBOTGSS_REVISION 0x0000
|
|
|
|
#define USBOTGSS_SYSCONFIG 0x0010
|
|
|
|
#define USBOTGSS_IRQ_EOI 0x0020
|
2013-06-12 17:23:46 +08:00
|
|
|
#define USBOTGSS_EOI_OFFSET 0x0008
|
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 23:10:58 +08:00
|
|
|
#define USBOTGSS_IRQSTATUS_RAW_0 0x0024
|
|
|
|
#define USBOTGSS_IRQSTATUS_0 0x0028
|
|
|
|
#define USBOTGSS_IRQENABLE_SET_0 0x002c
|
|
|
|
#define USBOTGSS_IRQENABLE_CLR_0 0x0030
|
2013-06-12 17:23:46 +08:00
|
|
|
#define USBOTGSS_IRQ0_OFFSET 0x0004
|
2013-06-12 17:23:47 +08:00
|
|
|
#define USBOTGSS_IRQSTATUS_RAW_1 0x0030
|
|
|
|
#define USBOTGSS_IRQSTATUS_1 0x0034
|
|
|
|
#define USBOTGSS_IRQENABLE_SET_1 0x0038
|
|
|
|
#define USBOTGSS_IRQENABLE_CLR_1 0x003c
|
|
|
|
#define USBOTGSS_IRQSTATUS_RAW_2 0x0040
|
|
|
|
#define USBOTGSS_IRQSTATUS_2 0x0044
|
|
|
|
#define USBOTGSS_IRQENABLE_SET_2 0x0048
|
|
|
|
#define USBOTGSS_IRQENABLE_CLR_2 0x004c
|
|
|
|
#define USBOTGSS_IRQSTATUS_RAW_3 0x0050
|
|
|
|
#define USBOTGSS_IRQSTATUS_3 0x0054
|
|
|
|
#define USBOTGSS_IRQENABLE_SET_3 0x0058
|
|
|
|
#define USBOTGSS_IRQENABLE_CLR_3 0x005c
|
2013-06-12 17:23:46 +08:00
|
|
|
#define USBOTGSS_IRQSTATUS_EOI_MISC 0x0030
|
|
|
|
#define USBOTGSS_IRQSTATUS_RAW_MISC 0x0034
|
|
|
|
#define USBOTGSS_IRQSTATUS_MISC 0x0038
|
|
|
|
#define USBOTGSS_IRQENABLE_SET_MISC 0x003c
|
|
|
|
#define USBOTGSS_IRQENABLE_CLR_MISC 0x0040
|
|
|
|
#define USBOTGSS_IRQMISC_OFFSET 0x03fc
|
2015-03-25 04:08:49 +08:00
|
|
|
#define USBOTGSS_UTMI_OTG_STATUS 0x0080
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL 0x0084
|
2013-06-12 17:23:46 +08:00
|
|
|
#define USBOTGSS_UTMI_OTG_OFFSET 0x0480
|
|
|
|
#define USBOTGSS_TXFIFO_DEPTH 0x0508
|
|
|
|
#define USBOTGSS_RXFIFO_DEPTH 0x050c
|
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 23:10:58 +08:00
|
|
|
#define USBOTGSS_MMRAM_OFFSET 0x0100
|
|
|
|
#define USBOTGSS_FLADJ 0x0104
|
|
|
|
#define USBOTGSS_DEBUG_CFG 0x0108
|
|
|
|
#define USBOTGSS_DEBUG_DATA 0x010c
|
2013-06-12 17:23:46 +08:00
|
|
|
#define USBOTGSS_DEV_EBC_EN 0x0110
|
|
|
|
#define USBOTGSS_DEBUG_OFFSET 0x0600
|
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 23:10:58 +08:00
|
|
|
|
|
|
|
/* SYSCONFIG REGISTER */
|
2017-03-30 14:46:40 +08:00
|
|
|
#define USBOTGSS_SYSCONFIG_DMADISABLE BIT(16)
|
2011-09-06 15:56:51 +08: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 23:10:58 +08:00
|
|
|
/* IRQ_EOI REGISTER */
|
2017-03-30 14:46:40 +08:00
|
|
|
#define USBOTGSS_IRQ_EOI_LINE_NUMBER BIT(0)
|
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 23:10:58 +08:00
|
|
|
|
|
|
|
/* IRQS0 BITS */
|
2017-03-30 14:46:40 +08:00
|
|
|
#define USBOTGSS_IRQO_COREIRQ_ST BIT(0)
|
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 23:10:58 +08:00
|
|
|
|
2013-06-12 17:23:47 +08:00
|
|
|
/* IRQMISC BITS */
|
2017-03-30 14:46:40 +08:00
|
|
|
#define USBOTGSS_IRQMISC_DMADISABLECLR BIT(17)
|
|
|
|
#define USBOTGSS_IRQMISC_OEVT BIT(16)
|
|
|
|
#define USBOTGSS_IRQMISC_DRVVBUS_RISE BIT(13)
|
|
|
|
#define USBOTGSS_IRQMISC_CHRGVBUS_RISE BIT(12)
|
|
|
|
#define USBOTGSS_IRQMISC_DISCHRGVBUS_RISE BIT(11)
|
|
|
|
#define USBOTGSS_IRQMISC_IDPULLUP_RISE BIT(8)
|
|
|
|
#define USBOTGSS_IRQMISC_DRVVBUS_FALL BIT(5)
|
|
|
|
#define USBOTGSS_IRQMISC_CHRGVBUS_FALL BIT(4)
|
|
|
|
#define USBOTGSS_IRQMISC_DISCHRGVBUS_FALL BIT(3)
|
|
|
|
#define USBOTGSS_IRQMISC_IDPULLUP_FALL BIT(0)
|
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 23:10:58 +08:00
|
|
|
|
|
|
|
/* UTMI_OTG_STATUS REGISTER */
|
2017-03-30 14:46:40 +08:00
|
|
|
#define USBOTGSS_UTMI_OTG_STATUS_DRVVBUS BIT(5)
|
|
|
|
#define USBOTGSS_UTMI_OTG_STATUS_CHRGVBUS BIT(4)
|
|
|
|
#define USBOTGSS_UTMI_OTG_STATUS_DISCHRGVBUS BIT(3)
|
|
|
|
#define USBOTGSS_UTMI_OTG_STATUS_IDPULLUP BIT(0)
|
2015-03-25 04:08:49 +08:00
|
|
|
|
|
|
|
/* UTMI_OTG_CTRL REGISTER */
|
2017-03-30 14:46:40 +08:00
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_SW_MODE BIT(31)
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_POWERPRESENT BIT(9)
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_TXBITSTUFFENABLE BIT(8)
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_IDDIG BIT(4)
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_SESSEND BIT(3)
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_SESSVALID BIT(2)
|
|
|
|
#define USBOTGSS_UTMI_OTG_CTRL_VBUSVALID BIT(1)
|
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 23:10:58 +08:00
|
|
|
|
|
|
|
struct dwc3_omap {
|
|
|
|
struct device *dev;
|
|
|
|
|
|
|
|
int irq;
|
|
|
|
void __iomem *base;
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
u32 utmi_otg_ctrl;
|
2013-06-12 17:23:45 +08:00
|
|
|
u32 utmi_otg_offset;
|
|
|
|
u32 irqmisc_offset;
|
|
|
|
u32 irq_eoi_offset;
|
|
|
|
u32 debug_offset;
|
|
|
|
u32 irq0_offset;
|
2013-02-11 17:12:02 +08:00
|
|
|
|
2015-07-01 12:11:30 +08:00
|
|
|
struct extcon_dev *edev;
|
2013-07-08 08:54:43 +08:00
|
|
|
struct notifier_block vbus_nb;
|
|
|
|
struct notifier_block id_nb;
|
|
|
|
|
|
|
|
struct regulator *vbus_reg;
|
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 23:10:58 +08:00
|
|
|
};
|
|
|
|
|
2013-07-08 08:54:43 +08:00
|
|
|
enum omap_dwc3_vbus_id_status {
|
|
|
|
OMAP_DWC3_ID_FLOAT,
|
|
|
|
OMAP_DWC3_ID_GROUND,
|
|
|
|
OMAP_DWC3_VBUS_OFF,
|
|
|
|
OMAP_DWC3_VBUS_VALID,
|
|
|
|
};
|
2013-01-25 11:00:49 +08:00
|
|
|
|
2012-04-24 19:18:38 +08:00
|
|
|
static inline u32 dwc3_omap_readl(void __iomem *base, u32 offset)
|
|
|
|
{
|
|
|
|
return readl(base + offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dwc3_omap_writel(void __iomem *base, u32 offset, u32 value)
|
|
|
|
{
|
|
|
|
writel(value, base + offset);
|
|
|
|
}
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
static u32 dwc3_omap_read_utmi_ctrl(struct dwc3_omap *omap)
|
2013-06-12 17:23:47 +08:00
|
|
|
{
|
2015-03-25 04:08:49 +08:00
|
|
|
return dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_CTRL +
|
2013-06-12 17:23:47 +08:00
|
|
|
omap->utmi_otg_offset);
|
|
|
|
}
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
static void dwc3_omap_write_utmi_ctrl(struct dwc3_omap *omap, u32 value)
|
2013-06-12 17:23:47 +08:00
|
|
|
{
|
2015-03-25 04:08:49 +08:00
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_CTRL +
|
2013-06-12 17:23:47 +08:00
|
|
|
omap->utmi_otg_offset, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static u32 dwc3_omap_read_irq0_status(struct dwc3_omap *omap)
|
|
|
|
{
|
2016-05-11 22:36:42 +08:00
|
|
|
return dwc3_omap_readl(omap->base, USBOTGSS_IRQSTATUS_RAW_0 -
|
2013-06-12 17:23:47 +08:00
|
|
|
omap->irq0_offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dwc3_omap_write_irq0_status(struct dwc3_omap *omap, u32 value)
|
|
|
|
{
|
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_IRQSTATUS_0 -
|
|
|
|
omap->irq0_offset, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static u32 dwc3_omap_read_irqmisc_status(struct dwc3_omap *omap)
|
|
|
|
{
|
2016-05-11 22:36:42 +08:00
|
|
|
return dwc3_omap_readl(omap->base, USBOTGSS_IRQSTATUS_RAW_MISC +
|
2013-06-12 17:23:47 +08:00
|
|
|
omap->irqmisc_offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dwc3_omap_write_irqmisc_status(struct dwc3_omap *omap, u32 value)
|
|
|
|
{
|
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_IRQSTATUS_MISC +
|
|
|
|
omap->irqmisc_offset, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dwc3_omap_write_irqmisc_set(struct dwc3_omap *omap, u32 value)
|
|
|
|
{
|
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_SET_MISC +
|
|
|
|
omap->irqmisc_offset, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dwc3_omap_write_irq0_set(struct dwc3_omap *omap, u32 value)
|
|
|
|
{
|
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_SET_0 -
|
|
|
|
omap->irq0_offset, value);
|
|
|
|
}
|
|
|
|
|
2015-02-13 12:43:24 +08:00
|
|
|
static void dwc3_omap_write_irqmisc_clr(struct dwc3_omap *omap, u32 value)
|
|
|
|
{
|
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_MISC +
|
|
|
|
omap->irqmisc_offset, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dwc3_omap_write_irq0_clr(struct dwc3_omap *omap, u32 value)
|
|
|
|
{
|
|
|
|
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_0 -
|
|
|
|
omap->irq0_offset, value);
|
|
|
|
}
|
|
|
|
|
2013-07-08 08:54:43 +08:00
|
|
|
static void dwc3_omap_set_mailbox(struct dwc3_omap *omap,
|
|
|
|
enum omap_dwc3_vbus_id_status status)
|
2013-01-25 11:00:49 +08:00
|
|
|
{
|
2013-07-08 08:54:43 +08:00
|
|
|
int ret;
|
|
|
|
u32 val;
|
2013-03-07 21:21:44 +08:00
|
|
|
|
2013-01-25 11:00:49 +08:00
|
|
|
switch (status) {
|
|
|
|
case OMAP_DWC3_ID_GROUND:
|
2013-07-08 08:54:43 +08:00
|
|
|
if (omap->vbus_reg) {
|
|
|
|
ret = regulator_enable(omap->vbus_reg);
|
|
|
|
if (ret) {
|
2015-07-01 01:46:07 +08:00
|
|
|
dev_err(omap->dev, "regulator enable failed\n");
|
2013-07-08 08:54:43 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
val = dwc3_omap_read_utmi_ctrl(omap);
|
2016-05-11 22:36:45 +08:00
|
|
|
val &= ~USBOTGSS_UTMI_OTG_CTRL_IDDIG;
|
2015-03-25 04:08:49 +08:00
|
|
|
dwc3_omap_write_utmi_ctrl(omap, val);
|
2013-01-25 11:00:49 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAP_DWC3_VBUS_VALID:
|
2015-03-25 04:08:49 +08:00
|
|
|
val = dwc3_omap_read_utmi_ctrl(omap);
|
|
|
|
val &= ~USBOTGSS_UTMI_OTG_CTRL_SESSEND;
|
2016-05-11 22:36:45 +08:00
|
|
|
val |= USBOTGSS_UTMI_OTG_CTRL_VBUSVALID
|
2016-05-11 22:36:44 +08:00
|
|
|
| USBOTGSS_UTMI_OTG_CTRL_SESSVALID;
|
2015-03-25 04:08:49 +08:00
|
|
|
dwc3_omap_write_utmi_ctrl(omap, val);
|
2013-01-25 11:00:49 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAP_DWC3_ID_FLOAT:
|
2013-07-08 08:54:43 +08:00
|
|
|
if (omap->vbus_reg)
|
|
|
|
regulator_disable(omap->vbus_reg);
|
2016-05-11 22:36:45 +08:00
|
|
|
val = dwc3_omap_read_utmi_ctrl(omap);
|
|
|
|
val |= USBOTGSS_UTMI_OTG_CTRL_IDDIG;
|
|
|
|
dwc3_omap_write_utmi_ctrl(omap, val);
|
2017-02-15 19:38:22 +08:00
|
|
|
break;
|
2013-07-08 08:54:43 +08:00
|
|
|
|
2013-01-25 11:00:49 +08:00
|
|
|
case OMAP_DWC3_VBUS_OFF:
|
2015-03-25 04:08:49 +08:00
|
|
|
val = dwc3_omap_read_utmi_ctrl(omap);
|
|
|
|
val &= ~(USBOTGSS_UTMI_OTG_CTRL_SESSVALID
|
2016-05-11 22:36:44 +08:00
|
|
|
| USBOTGSS_UTMI_OTG_CTRL_VBUSVALID);
|
2016-05-11 22:36:45 +08:00
|
|
|
val |= USBOTGSS_UTMI_OTG_CTRL_SESSEND;
|
2015-03-25 04:08:49 +08:00
|
|
|
dwc3_omap_write_utmi_ctrl(omap, val);
|
2013-01-25 11:00:49 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2015-07-01 01:46:07 +08:00
|
|
|
dev_WARN(omap->dev, "invalid state\n");
|
2013-01-25 11:00:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-11 22:36:42 +08:00
|
|
|
static void dwc3_omap_enable_irqs(struct dwc3_omap *omap);
|
|
|
|
static void dwc3_omap_disable_irqs(struct dwc3_omap *omap);
|
|
|
|
|
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 23:10:58 +08:00
|
|
|
static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
|
2016-05-11 22:36:42 +08:00
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = _omap;
|
|
|
|
|
|
|
|
if (dwc3_omap_read_irqmisc_status(omap) ||
|
|
|
|
dwc3_omap_read_irq0_status(omap)) {
|
|
|
|
/* mask irqs */
|
|
|
|
dwc3_omap_disable_irqs(omap);
|
|
|
|
return IRQ_WAKE_THREAD;
|
|
|
|
}
|
|
|
|
|
|
|
|
return IRQ_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static irqreturn_t dwc3_omap_interrupt_thread(int irq, void *_omap)
|
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 23:10:58 +08:00
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = _omap;
|
|
|
|
u32 reg;
|
|
|
|
|
2016-05-11 22:36:42 +08:00
|
|
|
/* clear irq status flags */
|
2013-06-12 17:23:47 +08:00
|
|
|
reg = dwc3_omap_read_irqmisc_status(omap);
|
|
|
|
dwc3_omap_write_irqmisc_status(omap, reg);
|
|
|
|
|
|
|
|
reg = dwc3_omap_read_irq0_status(omap);
|
|
|
|
dwc3_omap_write_irq0_status(omap, reg);
|
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 23:10:58 +08:00
|
|
|
|
2016-05-11 22:36:42 +08:00
|
|
|
/* unmask irqs */
|
|
|
|
dwc3_omap_enable_irqs(omap);
|
|
|
|
|
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 23:10:58 +08:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
2013-02-11 17:03:59 +08:00
|
|
|
static void dwc3_omap_enable_irqs(struct dwc3_omap *omap)
|
|
|
|
{
|
|
|
|
u32 reg;
|
|
|
|
|
|
|
|
/* enable all IRQs */
|
|
|
|
reg = USBOTGSS_IRQO_COREIRQ_ST;
|
2013-06-12 17:23:47 +08:00
|
|
|
dwc3_omap_write_irq0_set(omap, reg);
|
|
|
|
|
|
|
|
reg = (USBOTGSS_IRQMISC_OEVT |
|
|
|
|
USBOTGSS_IRQMISC_DRVVBUS_RISE |
|
|
|
|
USBOTGSS_IRQMISC_CHRGVBUS_RISE |
|
|
|
|
USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
|
|
|
|
USBOTGSS_IRQMISC_IDPULLUP_RISE |
|
|
|
|
USBOTGSS_IRQMISC_DRVVBUS_FALL |
|
|
|
|
USBOTGSS_IRQMISC_CHRGVBUS_FALL |
|
|
|
|
USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
|
|
|
|
USBOTGSS_IRQMISC_IDPULLUP_FALL);
|
|
|
|
|
|
|
|
dwc3_omap_write_irqmisc_set(omap, reg);
|
2013-02-11 17:03:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void dwc3_omap_disable_irqs(struct dwc3_omap *omap)
|
|
|
|
{
|
2015-02-13 12:43:24 +08:00
|
|
|
u32 reg;
|
|
|
|
|
2013-02-11 17:03:59 +08:00
|
|
|
/* disable all IRQs */
|
2015-02-13 12:43:24 +08:00
|
|
|
reg = USBOTGSS_IRQO_COREIRQ_ST;
|
|
|
|
dwc3_omap_write_irq0_clr(omap, reg);
|
|
|
|
|
|
|
|
reg = (USBOTGSS_IRQMISC_OEVT |
|
|
|
|
USBOTGSS_IRQMISC_DRVVBUS_RISE |
|
|
|
|
USBOTGSS_IRQMISC_CHRGVBUS_RISE |
|
|
|
|
USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
|
|
|
|
USBOTGSS_IRQMISC_IDPULLUP_RISE |
|
|
|
|
USBOTGSS_IRQMISC_DRVVBUS_FALL |
|
|
|
|
USBOTGSS_IRQMISC_CHRGVBUS_FALL |
|
|
|
|
USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
|
|
|
|
USBOTGSS_IRQMISC_IDPULLUP_FALL);
|
|
|
|
|
|
|
|
dwc3_omap_write_irqmisc_clr(omap, reg);
|
2013-02-11 17:03:59 +08:00
|
|
|
}
|
|
|
|
|
2013-07-08 08:54:43 +08:00
|
|
|
static int dwc3_omap_id_notifier(struct notifier_block *nb,
|
|
|
|
unsigned long event, void *ptr)
|
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = container_of(nb, struct dwc3_omap, id_nb);
|
|
|
|
|
|
|
|
if (event)
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
|
|
|
|
else
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT);
|
|
|
|
|
|
|
|
return NOTIFY_DONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dwc3_omap_vbus_notifier(struct notifier_block *nb,
|
|
|
|
unsigned long event, void *ptr)
|
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = container_of(nb, struct dwc3_omap, vbus_nb);
|
|
|
|
|
|
|
|
if (event)
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
|
|
|
|
else
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF);
|
|
|
|
|
|
|
|
return NOTIFY_DONE;
|
|
|
|
}
|
|
|
|
|
2014-07-16 21:07:06 +08:00
|
|
|
static void dwc3_omap_map_offset(struct dwc3_omap *omap)
|
|
|
|
{
|
|
|
|
struct device_node *node = omap->dev->of_node;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Differentiate between OMAP5 and AM437x.
|
|
|
|
*
|
|
|
|
* For OMAP5(ES2.0) and AM437x wrapper revision is same, even
|
|
|
|
* though there are changes in wrapper register offsets.
|
|
|
|
*
|
|
|
|
* Using dt compatible to differentiate AM437x.
|
|
|
|
*/
|
|
|
|
if (of_device_is_compatible(node, "ti,am437x-dwc3")) {
|
|
|
|
omap->irq_eoi_offset = USBOTGSS_EOI_OFFSET;
|
|
|
|
omap->irq0_offset = USBOTGSS_IRQ0_OFFSET;
|
|
|
|
omap->irqmisc_offset = USBOTGSS_IRQMISC_OFFSET;
|
|
|
|
omap->utmi_otg_offset = USBOTGSS_UTMI_OTG_OFFSET;
|
|
|
|
omap->debug_offset = USBOTGSS_DEBUG_OFFSET;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-16 21:07:07 +08:00
|
|
|
static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap)
|
|
|
|
{
|
|
|
|
u32 reg;
|
|
|
|
struct device_node *node = omap->dev->of_node;
|
2017-02-27 18:52:46 +08:00
|
|
|
u32 utmi_mode = 0;
|
2014-07-16 21:07:07 +08:00
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
reg = dwc3_omap_read_utmi_ctrl(omap);
|
2014-07-16 21:07:07 +08:00
|
|
|
|
|
|
|
of_property_read_u32(node, "utmi-mode", &utmi_mode);
|
|
|
|
|
|
|
|
switch (utmi_mode) {
|
|
|
|
case DWC3_OMAP_UTMI_MODE_SW:
|
2015-03-25 04:08:49 +08:00
|
|
|
reg |= USBOTGSS_UTMI_OTG_CTRL_SW_MODE;
|
2014-07-16 21:07:07 +08:00
|
|
|
break;
|
|
|
|
case DWC3_OMAP_UTMI_MODE_HW:
|
2015-03-25 04:08:49 +08:00
|
|
|
reg &= ~USBOTGSS_UTMI_OTG_CTRL_SW_MODE;
|
2014-07-16 21:07:07 +08:00
|
|
|
break;
|
|
|
|
default:
|
2015-07-01 01:46:07 +08:00
|
|
|
dev_WARN(omap->dev, "UNKNOWN utmi mode %d\n", utmi_mode);
|
2014-07-16 21:07:07 +08:00
|
|
|
}
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
dwc3_omap_write_utmi_ctrl(omap, reg);
|
2014-07-16 21:07:07 +08:00
|
|
|
}
|
|
|
|
|
2014-07-16 21:07:08 +08:00
|
|
|
static int dwc3_omap_extcon_register(struct dwc3_omap *omap)
|
|
|
|
{
|
2014-07-31 23:30:51 +08:00
|
|
|
int ret;
|
2014-07-16 21:07:08 +08:00
|
|
|
struct device_node *node = omap->dev->of_node;
|
|
|
|
struct extcon_dev *edev;
|
|
|
|
|
|
|
|
if (of_property_read_bool(node, "extcon")) {
|
|
|
|
edev = extcon_get_edev_by_phandle(omap->dev, 0);
|
|
|
|
if (IS_ERR(edev)) {
|
|
|
|
dev_vdbg(omap->dev, "couldn't get extcon device\n");
|
|
|
|
return -EPROBE_DEFER;
|
|
|
|
}
|
|
|
|
|
|
|
|
omap->vbus_nb.notifier_call = dwc3_omap_vbus_notifier;
|
2017-01-16 20:36:57 +08:00
|
|
|
ret = devm_extcon_register_notifier(omap->dev, edev,
|
|
|
|
EXTCON_USB, &omap->vbus_nb);
|
2014-07-16 21:07:08 +08:00
|
|
|
if (ret < 0)
|
|
|
|
dev_vdbg(omap->dev, "failed to register notifier for USB\n");
|
|
|
|
|
|
|
|
omap->id_nb.notifier_call = dwc3_omap_id_notifier;
|
2017-01-16 20:36:57 +08:00
|
|
|
ret = devm_extcon_register_notifier(omap->dev, edev,
|
|
|
|
EXTCON_USB_HOST, &omap->id_nb);
|
2014-07-16 21:07:08 +08:00
|
|
|
if (ret < 0)
|
|
|
|
dev_vdbg(omap->dev, "failed to register notifier for USB-HOST\n");
|
|
|
|
|
2017-01-16 20:36:57 +08:00
|
|
|
if (extcon_get_state(edev, EXTCON_USB) == true)
|
2014-07-16 21:07:08 +08:00
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
|
2017-01-16 20:36:57 +08:00
|
|
|
if (extcon_get_state(edev, EXTCON_USB_HOST) == true)
|
2014-07-16 21:07:08 +08:00
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
|
2015-07-01 12:11:30 +08:00
|
|
|
|
|
|
|
omap->edev = edev;
|
2014-07-16 21:07:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-11-20 02:21:48 +08:00
|
|
|
static int dwc3_omap_probe(struct platform_device *pdev)
|
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 23:10:58 +08:00
|
|
|
{
|
2012-01-25 17:07:03 +08:00
|
|
|
struct device_node *node = pdev->dev.of_node;
|
|
|
|
|
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 23:10:58 +08:00
|
|
|
struct dwc3_omap *omap;
|
|
|
|
struct resource *res;
|
2012-02-15 17:27:55 +08:00
|
|
|
struct device *dev = &pdev->dev;
|
2013-07-08 08:54:43 +08:00
|
|
|
struct regulator *vbus_reg = NULL;
|
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 23:10:58 +08:00
|
|
|
|
2014-05-15 20:53:32 +08:00
|
|
|
int ret;
|
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 23:10:58 +08:00
|
|
|
int irq;
|
|
|
|
|
|
|
|
u32 reg;
|
|
|
|
|
|
|
|
void __iomem *base;
|
|
|
|
|
2013-02-26 22:33:28 +08:00
|
|
|
if (!node) {
|
|
|
|
dev_err(dev, "device node not found\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2012-02-15 17:27:55 +08:00
|
|
|
omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
|
2014-07-17 11:45:11 +08:00
|
|
|
if (!omap)
|
2012-02-15 17:27:55 +08:00
|
|
|
return -ENOMEM;
|
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 23:10:58 +08:00
|
|
|
|
|
|
|
platform_set_drvdata(pdev, omap);
|
|
|
|
|
2013-02-26 22:33:27 +08:00
|
|
|
irq = platform_get_irq(pdev, 0);
|
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 23:10:58 +08:00
|
|
|
if (irq < 0) {
|
2017-08-08 12:25:34 +08:00
|
|
|
dev_err(dev, "missing IRQ resource: %d\n", irq);
|
|
|
|
return irq;
|
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 23:10:58 +08:00
|
|
|
}
|
|
|
|
|
2013-02-26 22:33:27 +08:00
|
|
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
2013-07-12 20:33:35 +08:00
|
|
|
base = devm_ioremap_resource(dev, res);
|
|
|
|
if (IS_ERR(base))
|
|
|
|
return PTR_ERR(base);
|
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 23:10:58 +08:00
|
|
|
|
2013-07-08 08:54:43 +08:00
|
|
|
if (of_property_read_bool(node, "vbus-supply")) {
|
|
|
|
vbus_reg = devm_regulator_get(dev, "vbus");
|
|
|
|
if (IS_ERR(vbus_reg)) {
|
|
|
|
dev_err(dev, "vbus init failed\n");
|
|
|
|
return PTR_ERR(vbus_reg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-15 17:27:55 +08:00
|
|
|
omap->dev = dev;
|
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 23:10:58 +08:00
|
|
|
omap->irq = irq;
|
|
|
|
omap->base = base;
|
2013-07-08 08:54:43 +08:00
|
|
|
omap->vbus_reg = vbus_reg;
|
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 23:10:58 +08:00
|
|
|
|
2013-01-25 11:00:47 +08:00
|
|
|
pm_runtime_enable(dev);
|
|
|
|
ret = pm_runtime_get_sync(dev);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(dev, "get_sync failed with err %d\n", ret);
|
2016-04-11 22:12:33 +08:00
|
|
|
goto err1;
|
2013-01-25 11:00:47 +08:00
|
|
|
}
|
|
|
|
|
2014-07-16 21:07:06 +08:00
|
|
|
dwc3_omap_map_offset(omap);
|
2014-07-16 21:07:07 +08:00
|
|
|
dwc3_omap_set_utmi_mode(omap);
|
2011-09-02 03:26:25 +08: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 23:10:58 +08:00
|
|
|
/* check the DMA Status */
|
2012-04-24 19:18:38 +08:00
|
|
|
reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG);
|
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 23:10:58 +08:00
|
|
|
|
2014-07-16 21:07:08 +08:00
|
|
|
ret = dwc3_omap_extcon_register(omap);
|
|
|
|
if (ret < 0)
|
2016-04-11 22:12:33 +08:00
|
|
|
goto err1;
|
2013-07-08 08:54:43 +08:00
|
|
|
|
2013-02-26 22:33:28 +08:00
|
|
|
ret = of_platform_populate(node, NULL, NULL, dev);
|
|
|
|
if (ret) {
|
|
|
|
dev_err(&pdev->dev, "failed to create dwc3 core\n");
|
2017-01-16 20:36:57 +08:00
|
|
|
goto err1;
|
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 23:10:58 +08:00
|
|
|
}
|
|
|
|
|
2017-07-07 14:22:52 +08:00
|
|
|
ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt,
|
|
|
|
dwc3_omap_interrupt_thread, IRQF_SHARED,
|
|
|
|
"dwc3-omap", omap);
|
|
|
|
if (ret) {
|
|
|
|
dev_err(dev, "failed to request IRQ #%d --> %d\n",
|
|
|
|
omap->irq, ret);
|
|
|
|
goto err1;
|
|
|
|
}
|
2015-08-26 01:07:45 +08:00
|
|
|
dwc3_omap_enable_irqs(omap);
|
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 23:10:58 +08:00
|
|
|
return 0;
|
2013-06-04 00:13:39 +08:00
|
|
|
|
|
|
|
err1:
|
|
|
|
pm_runtime_put_sync(dev);
|
|
|
|
pm_runtime_disable(dev);
|
|
|
|
|
|
|
|
return ret;
|
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 23:10:58 +08:00
|
|
|
}
|
|
|
|
|
2012-11-20 02:26:20 +08:00
|
|
|
static int dwc3_omap_remove(struct platform_device *pdev)
|
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 23:10:58 +08:00
|
|
|
{
|
2013-02-11 17:03:59 +08:00
|
|
|
struct dwc3_omap *omap = platform_get_drvdata(pdev);
|
|
|
|
|
|
|
|
dwc3_omap_disable_irqs(omap);
|
2016-12-13 03:37:52 +08:00
|
|
|
disable_irq(omap->irq);
|
2014-09-03 03:12:26 +08:00
|
|
|
of_platform_depopulate(omap->dev);
|
2013-01-25 11:00:47 +08:00
|
|
|
pm_runtime_put_sync(&pdev->dev);
|
|
|
|
pm_runtime_disable(&pdev->dev);
|
2013-01-25 11:00:45 +08: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 23:10:58 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-02-11 16:31:15 +08:00
|
|
|
static const struct of_device_id of_dwc3_match[] = {
|
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 23:10:58 +08:00
|
|
|
{
|
2013-02-26 22:33:27 +08:00
|
|
|
.compatible = "ti,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 23:10:58 +08:00
|
|
|
},
|
2013-06-12 17:23:46 +08:00
|
|
|
{
|
|
|
|
.compatible = "ti,am437x-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 23:10:58 +08:00
|
|
|
{ },
|
|
|
|
};
|
2013-02-11 16:31:15 +08:00
|
|
|
MODULE_DEVICE_TABLE(of, of_dwc3_match);
|
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 23:10:58 +08:00
|
|
|
|
2013-03-26 09:52:48 +08:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
2013-02-11 17:12:02 +08:00
|
|
|
static int dwc3_omap_suspend(struct device *dev)
|
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = dev_get_drvdata(dev);
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
omap->utmi_otg_ctrl = dwc3_omap_read_utmi_ctrl(omap);
|
2013-12-17 21:17:54 +08:00
|
|
|
dwc3_omap_disable_irqs(omap);
|
2013-02-11 17:12:02 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dwc3_omap_resume(struct device *dev)
|
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = dev_get_drvdata(dev);
|
|
|
|
|
2015-03-25 04:08:49 +08:00
|
|
|
dwc3_omap_write_utmi_ctrl(omap, omap->utmi_otg_ctrl);
|
2013-12-17 21:17:54 +08:00
|
|
|
dwc3_omap_enable_irqs(omap);
|
2013-02-11 17:12:02 +08:00
|
|
|
|
|
|
|
pm_runtime_disable(dev);
|
|
|
|
pm_runtime_set_active(dev);
|
|
|
|
pm_runtime_enable(dev);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-01-22 21:01:42 +08:00
|
|
|
static void dwc3_omap_complete(struct device *dev)
|
|
|
|
{
|
|
|
|
struct dwc3_omap *omap = dev_get_drvdata(dev);
|
|
|
|
|
|
|
|
if (extcon_get_state(omap->edev, EXTCON_USB))
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
|
|
|
|
else
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF);
|
|
|
|
|
|
|
|
if (extcon_get_state(omap->edev, EXTCON_USB_HOST))
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
|
|
|
|
else
|
|
|
|
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT);
|
|
|
|
}
|
|
|
|
|
2013-02-11 17:12:02 +08:00
|
|
|
static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
|
|
|
|
|
|
|
|
SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
|
2018-01-22 21:01:42 +08:00
|
|
|
.complete = dwc3_omap_complete,
|
2013-02-11 17:12:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops)
|
|
|
|
#else
|
|
|
|
#define DEV_PM_OPS NULL
|
2013-03-26 09:52:48 +08:00
|
|
|
#endif /* CONFIG_PM_SLEEP */
|
2013-02-11 17:12:02 +08: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 23:10:58 +08:00
|
|
|
static struct platform_driver dwc3_omap_driver = {
|
|
|
|
.probe = dwc3_omap_probe,
|
2012-11-20 02:21:08 +08:00
|
|
|
.remove = dwc3_omap_remove,
|
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 23:10:58 +08:00
|
|
|
.driver = {
|
|
|
|
.name = "omap-dwc3",
|
2013-02-11 16:31:15 +08:00
|
|
|
.of_match_table = of_dwc3_match,
|
2013-02-11 17:12:02 +08:00
|
|
|
.pm = DEV_PM_OPS,
|
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 23:10:58 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-11-27 20:16:27 +08:00
|
|
|
module_platform_driver(dwc3_omap_driver);
|
|
|
|
|
2011-10-20 01:39:50 +08:00
|
|
|
MODULE_ALIAS("platform:omap-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 23:10:58 +08:00
|
|
|
MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
|
2013-06-30 19:15:11 +08:00
|
|
|
MODULE_LICENSE("GPL v2");
|
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 23:10:58 +08:00
|
|
|
MODULE_DESCRIPTION("DesignWare USB3 OMAP Glue Layer");
|