summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/Kconfig16
-rw-r--r--drivers/usb/cdns3/Kconfig6
-rw-r--r--drivers/usb/dwc3/core.c3
-rw-r--r--drivers/usb/dwc3/dwc3-am62.c2
-rw-r--r--drivers/usb/dwc3/dwc3-generic-sti.c2
-rw-r--r--drivers/usb/dwc3/dwc3-generic.c10
-rw-r--r--drivers/usb/emul/Kconfig1
-rw-r--r--drivers/usb/eth/Kconfig16
-rw-r--r--drivers/usb/gadget/Kconfig25
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c20
-rw-r--r--drivers/usb/gadget/f_acm.c12
-rw-r--r--drivers/usb/gadget/f_mass_storage.c11
-rw-r--r--drivers/usb/gadget/f_sdp.c16
-rw-r--r--drivers/usb/gadget/rcar/common.c65
-rw-r--r--drivers/usb/gadget/rcar/renesas_usb.h1
-rw-r--r--drivers/usb/host/Kconfig44
-rw-r--r--drivers/usb/host/Makefile2
-rw-r--r--drivers/usb/host/ehci-marvell.c4
-rw-r--r--drivers/usb/host/ohci-hcd.c2
-rw-r--r--drivers/usb/host/usb-uclass.c2
-rw-r--r--drivers/usb/host/xhci-mvebu.c1
-rw-r--r--drivers/usb/musb-new/Kconfig16
-rw-r--r--drivers/usb/musb-new/omap2430.c2
-rw-r--r--drivers/usb/tcpm/Kconfig4
-rw-r--r--drivers/usb/tcpm/tcpm.c2
25 files changed, 172 insertions, 113 deletions
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 93c5ee69b25..05ac388ecf2 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -1,7 +1,7 @@
menuconfig USB
bool "USB support"
select BLK
- ---help---
+ help
Universal Serial Bus (USB) is a specification for a serial bus
subsystem which offers higher speeds and more features than the
traditional PC serial port. The bus supplies power to peripherals
@@ -94,7 +94,7 @@ comment "USB peripherals"
config USB_STORAGE
bool "USB Mass Storage support"
- ---help---
+ help
Say Y here if you want to connect USB mass storage devices to your
board's USB port.
@@ -103,7 +103,7 @@ config USB_KEYBOARD
depends on DM_USB
select DM_KEYBOARD
select SYS_STDIO_DEREGISTER
- ---help---
+ help
Say Y here if you want to use a USB keyboard for U-Boot command line
input.
@@ -111,7 +111,7 @@ config USB_ONBOARD_HUB
bool "Onboard USB hub support"
depends on DM_USB
select DEVRES
- ---help---
+ help
Say Y here if you want to support discrete onboard USB hubs that
don't require an additional control bus for initialization, but
need some non-trivial form of initialization, such as enabling a
@@ -163,17 +163,17 @@ choice
prompt "USB keyboard polling"
default SYS_USB_EVENT_POLL_VIA_INT_QUEUE if ARCH_SUNXI
default SYS_USB_EVENT_POLL
- ---help---
+ help
Enable a polling mechanism for USB keyboard.
config SYS_USB_EVENT_POLL
- bool "Interrupt polling"
+ bool "Interrupt polling"
config SYS_USB_EVENT_POLL_VIA_INT_QUEUE
- bool "Poll via interrupt queue"
+ bool "Poll via interrupt queue"
config SYS_USB_EVENT_POLL_VIA_CONTROL_EP
- bool "Poll via control EP"
+ bool "Poll via control EP"
endchoice
diff --git a/drivers/usb/cdns3/Kconfig b/drivers/usb/cdns3/Kconfig
index 7964f3f41d5..ad0ef8ac2ba 100644
--- a/drivers/usb/cdns3/Kconfig
+++ b/drivers/usb/cdns3/Kconfig
@@ -1,5 +1,5 @@
config USB_CDNS3
- tristate "Cadence USB3 Dual-Role Controller"
+ bool "Cadence USB3 Dual-Role Controller"
depends on USB_XHCI_HCD || USB_GADGET
select DEVRES
help
@@ -51,14 +51,14 @@ config SPL_USB_CDNS3_HOST
standard XHCI driver.
config USB_CDNS3_STARFIVE
- tristate "Cadence USB3 support on Starfive platforms"
+ bool "Cadence USB3 support on Starfive platforms"
default y if STARFIVE_JH7110
help
Say 'Y' here if you are building for Starfive platforms
that contain Cadence USB3 controller core. E.g.: JH7110.
config USB_CDNS3_TI
- tristate "Cadence USB3 support on TI platforms"
+ bool "Cadence USB3 support on TI platforms"
default USB_CDNS3
help
Say 'Y' here if you are building for Texas Instruments
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 65c4d1a4e6f..be198041f08 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -106,6 +106,8 @@ done:
if (DWC3_VER_IS_WITHIN(DWC31, ANY, 180A))
mdelay(50);
+ mdelay(100);
+
return 0;
}
@@ -206,7 +208,6 @@ static void dwc3_free_one_event_buffer(struct dwc3 *dwc,
struct dwc3_event_buffer *evt)
{
dma_free_coherent(evt->buf);
- free(evt);
}
/**
diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 99519602eb2..8cb5796b6ad 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -105,7 +105,7 @@ static void dwc3_ti_am62_glue_configure(struct udevice *dev, int index,
writel(reg, usbss + USBSS_MODE_CONTROL);
}
-struct dwc3_glue_ops ti_am62_ops = {
+static const struct dwc3_glue_ops ti_am62_ops = {
.glue_configure = dwc3_ti_am62_glue_configure,
};
diff --git a/drivers/usb/dwc3/dwc3-generic-sti.c b/drivers/usb/dwc3/dwc3-generic-sti.c
index b34f5ceceac..ce195b2553b 100644
--- a/drivers/usb/dwc3/dwc3-generic-sti.c
+++ b/drivers/usb/dwc3/dwc3-generic-sti.c
@@ -114,7 +114,7 @@ static void dwc3_stih407_glue_configure(struct udevice *dev, int index,
setbits_le32(glue_base + CLKRST_CTRL, SW_PIPEW_RESET_N);
};
-struct dwc3_glue_ops stih407_ops = {
+static const struct dwc3_glue_ops stih407_ops = {
.glue_configure = dwc3_stih407_glue_configure,
};
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 22b9ef0b24e..2356b3bc0aa 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -330,7 +330,7 @@ void dwc3_imx8mp_glue_configure(struct udevice *dev, int index,
unmap_physmem(base, MAP_NOCACHE);
}
-struct dwc3_glue_ops imx8mp_ops = {
+static const struct dwc3_glue_ops imx8mp_ops = {
.glue_configure = dwc3_imx8mp_glue_configure,
};
@@ -414,7 +414,7 @@ enum dwc3_omap_utmi_mode {
unmap_physmem(base, MAP_NOCACHE);
}
-struct dwc3_glue_ops ti_ops = {
+static const struct dwc3_glue_ops ti_ops = {
.glue_configure = dwc3_ti_glue_configure,
};
@@ -506,16 +506,16 @@ static int dwc3_flat_dt_get_ctrl_dev(struct udevice *dev, ofnode *node)
return 0;
}
-struct dwc3_glue_ops qcom_ops = {
+static const struct dwc3_glue_ops qcom_ops = {
.glue_configure = dwc3_qcom_glue_configure,
};
-struct dwc3_glue_ops qcom_flat_dt_ops = {
+static const struct dwc3_glue_ops qcom_flat_dt_ops = {
.glue_configure = dwc3_qcom_glue_configure,
.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
};
-struct dwc3_glue_ops rk_ops = {
+static const struct dwc3_glue_ops rk_ops = {
.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
};
diff --git a/drivers/usb/emul/Kconfig b/drivers/usb/emul/Kconfig
index 279f6c6d740..6305f2496c3 100644
--- a/drivers/usb/emul/Kconfig
+++ b/drivers/usb/emul/Kconfig
@@ -2,6 +2,7 @@ config USB_EMUL
bool "Support for USB device emulation"
depends on SANDBOX
select DM_USB
+ select SCSI
select USB_HOST
help
Since sandbox does not have access to a real USB bus, it is possible
diff --git a/drivers/usb/eth/Kconfig b/drivers/usb/eth/Kconfig
index 2f6bfa8e71b..b9b77f46743 100644
--- a/drivers/usb/eth/Kconfig
+++ b/drivers/usb/eth/Kconfig
@@ -1,6 +1,6 @@
menuconfig USB_HOST_ETHER
bool "USB to Ethernet Controller Drivers"
- ---help---
+ help
Say Y here if you would like to enable support for USB Ethernet
adapters.
@@ -9,14 +9,14 @@ if USB_HOST_ETHER
config USB_ETHER_ASIX
bool "ASIX AX8817X (USB 2.0) support"
depends on USB_HOST_ETHER
- ---help---
+ help
Say Y here if you would like to support ASIX AX8817X based USB 2.0
Ethernet Devices.
config USB_ETHER_ASIX88179
bool "ASIX AX88179 (USB 3.0) support"
depends on USB_HOST_ETHER
- ---help---
+ help
Say Y here if you would like to support ASIX AX88179 based USB 3.0
Ethernet Devices.
@@ -24,7 +24,7 @@ config USB_ETHER_LAN75XX
bool "Microchip LAN75XX support"
depends on USB_HOST_ETHER
depends on PHYLIB
- ---help---
+ help
Say Y here if you would like to support Microchip LAN75XX Hi-Speed
USB 2.0 to 10/100/1000 Gigabit Ethernet controller.
Supports 10Base-T/ 100Base-TX/1000Base-T.
@@ -34,7 +34,7 @@ config USB_ETHER_LAN78XX
bool "Microchip LAN78XX support"
depends on USB_HOST_ETHER
depends on PHYLIB
- ---help---
+ help
Say Y here if you would like to support Microchip LAN78XX USB 3.1
Gen 1 to 10/100/1000 Gigabit Ethernet controller.
Supports 10Base-T/ 100Base-TX/1000Base-T.
@@ -43,14 +43,14 @@ config USB_ETHER_LAN78XX
config USB_ETHER_MCS7830
bool "MOSCHIP MCS7830 (7730/7830/7832) suppport"
depends on USB_HOST_ETHER
- ---help---
+ help
Say Y here if you would like to support MOSCHIP MCS7830 based
(7730/7830/7832) USB 2.0 Ethernet Devices.
config USB_ETHER_RTL8152
bool "Realtek RTL8152B/RTL8153 support"
depends on USB_HOST_ETHER
- ---help---
+ help
Say Y here if you would like to support Realtek RTL8152B/RTL8153 base
USB Ethernet Devices. This driver also supports compatible devices
from Samsung, Lenovo, TP-LINK and Nvidia.
@@ -58,7 +58,7 @@ config USB_ETHER_RTL8152
config USB_ETHER_SMSC95XX
bool "SMSC LAN95x support"
depends on USB_HOST_ETHER
- ---help---
+ help
Say Y here if you would like to support SMSC LAN95xx based USB 2.0
Ethernet Devices.
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index baa2eb61ea3..e42d5a43696 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -19,10 +19,10 @@ menuconfig USB_GADGET
select DM_USB
imply CMD_BIND
help
- USB is a master/slave protocol, organized with one master
- host (such as a PC) controlling up to 127 peripheral devices.
- The USB hardware is asymmetric, which makes it easier to set up:
- you can't connect a "to-the-host" connector to a peripheral.
+ USB is a master/slave protocol, organized with one master
+ host (such as a PC) controlling up to 127 peripheral devices.
+ The USB hardware is asymmetric, which makes it easier to set up:
+ you can't connect a "to-the-host" connector to a peripheral.
U-Boot can run in the host, or in the peripheral. In both cases
you need a low level bus controller driver, and some software
@@ -119,6 +119,7 @@ config USB_GADGET_DWC2_OTG
config USB_RENESAS_USBHS
bool "Renesas R-Car USB2.0 HS controller (gadget mode)"
+ depends on DM_USB_GADGET
select USB_GADGET_DUALSPEED
help
The Renesas R-Car USB 2.0 high-speed gadget controller
@@ -163,10 +164,10 @@ config USB_GADGET_VBUS_DRAW
range 2 500
default 2
help
- Some devices need to draw power from USB when they are
- configured, perhaps to operate circuitry or to recharge
- batteries. This is in addition to any local power supply,
- such as an AC adapter or batteries.
+ Some devices need to draw power from USB when they are
+ configured, perhaps to operate circuitry or to recharge
+ batteries. This is in addition to any local power supply,
+ such as an AC adapter or batteries.
Enter the maximum power your device draws through USB, in
milliAmperes. The permitted range of values is 2 - 500 mA;
@@ -232,7 +233,7 @@ endif # USB_GADGET_DOWNLOAD
config USB_ETHER
bool "USB Ethernet Gadget"
- depends on NET || NET_LWIP
+ depends on NET
default y if ARCH_SUNXI && USB_MUSB_GADGET
help
Creates an Ethernet network device through a USB peripheral
@@ -349,9 +350,9 @@ config SPL_DFU_RAM
bool "RAM device"
depends on SPL_DFU && SPL_RAM_SUPPORT
help
- select RAM/DDR memory device for loading binary images
- (u-boot/kernel) to the selected device partition using
- DFU and execute the u-boot/kernel from RAM.
+ select RAM/DDR memory device for loading binary images
+ (u-boot/kernel) to the selected device partition using
+ DFU and execute the u-boot/kernel from RAM.
endchoice
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index f7a92ded6da..0caf8b8b7b4 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -289,10 +289,6 @@ static int usba_ep_disable(struct usb_ep *_ep)
if (!ep->desc) {
spin_unlock_irqrestore(&udc->lock, flags);
- /* REVISIT because this driver disables endpoints in
- * reset_all_endpoints() before calling disconnect(),
- * most gadget drivers would trigger this non-error ...
- */
if (udc->gadget.speed != USB_SPEED_UNKNOWN)
DBG(DBG_ERR, "ep_disable: %s not enabled\n",
ep->ep.name);
@@ -571,20 +567,6 @@ static void reset_all_endpoints(struct usba_udc *udc)
list_del_init(&req->queue);
request_complete(ep, req, -ECONNRESET);
}
-
- /* NOTE: normally, the next call to the gadget driver is in
- * charge of disabling endpoints... usually disconnect().
- * The exception would be entering a high speed test mode.
- *
- * FIXME remove this code ... and retest thoroughly.
- */
- list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
- if (ep->desc) {
- spin_unlock(&udc->lock);
- usba_ep_disable(&ep->ep);
- spin_lock(&udc->lock);
- }
- }
}
static struct usba_ep *get_ep_by_addr(struct usba_udc *udc, u16 wIndex)
@@ -1219,7 +1201,7 @@ static struct usba_ep *usba_udc_pdata(struct usba_platform_data *pdata,
struct usba_ep *eps;
int i;
- eps = malloc(sizeof(struct usba_ep) * pdata->num_ep);
+ eps = calloc(pdata->num_ep, sizeof(struct usba_ep));
if (!eps) {
log_err("failed to alloc eps\n");
return NULL;
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c
index 8f7256069f5..b6c11d97a62 100644
--- a/drivers/usb/gadget/f_acm.c
+++ b/drivers/usb/gadget/f_acm.c
@@ -548,13 +548,11 @@ static int acm_add(struct usb_configuration *c)
status = udc_device_get_by_index(0, &f_acm->udc);
if (status)
- return status;
+ goto err;
status = usb_add_function(c, &f_acm->usb_function);
- if (status) {
- free(f_acm);
- return status;
- }
+ if (status)
+ goto err;
buf_init(&f_acm->rx_buf, 2048);
buf_init(&f_acm->tx_buf, 2048);
@@ -562,6 +560,10 @@ static int acm_add(struct usb_configuration *c)
if (!default_acm_function)
default_acm_function = f_acm;
+ return 0;
+
+err:
+ free(f_acm);
return status;
}
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 71dc58da3f0..87ed25e8bb3 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2275,6 +2275,17 @@ static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
static void fsg_disable(struct usb_function *f)
{
struct fsg_dev *fsg = fsg_from_func(f);
+
+ /* Disable the endpoints */
+ if (fsg->bulk_in_enabled) {
+ usb_ep_disable(fsg->bulk_in);
+ fsg->bulk_in_enabled = 0;
+ }
+ if (fsg->bulk_out_enabled) {
+ usb_ep_disable(fsg->bulk_out);
+ fsg->bulk_out_enabled = 0;
+ }
+
fsg->common->new_fsg = NULL;
raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
}
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index f72e27028b7..cd2c282247a 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -75,6 +75,7 @@ struct hid_report {
#define SDP_HID_PACKET_SIZE_EP1 1024
#define SDP_EXIT 1
+#define SDP_FAIL 2
struct sdp_command {
u16 cmd;
@@ -840,11 +841,14 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image,
#ifdef CONFIG_SPL_LOAD_FIT
if (image_get_magic(header) == FDT_MAGIC) {
struct spl_load_info load;
+ int ret;
debug("Found FIT\n");
spl_load_init(&load, sdp_load_read, header, 1);
- spl_load_simple_fit(spl_image, &load, 0,
- header);
+ ret = spl_load_simple_fit(spl_image, &load, 0,
+ header);
+ if (ret)
+ return SDP_FAIL;
return SDP_EXIT;
}
@@ -852,9 +856,13 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image,
if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER) &&
valid_container_hdr((void *)header)) {
struct spl_load_info load;
+ int ret;
spl_load_init(&load, sdp_load_read, header, 1);
- spl_load_imx_container(spl_image, &load, 0);
+ ret = spl_load_imx_container(spl_image, &load, 0);
+ if (ret)
+ return SDP_FAIL;
+
return SDP_EXIT;
}
@@ -924,6 +932,8 @@ int spl_sdp_handle(struct udevice *udc, struct spl_image_info *spl_image,
if (flag == SDP_EXIT)
return 0;
+ else if (flag == SDP_FAIL)
+ return -EIO;
schedule();
dm_usb_gadget_handle_interrupts(udc);
diff --git a/drivers/usb/gadget/rcar/common.c b/drivers/usb/gadget/rcar/common.c
index 2ba022a3f2c..10548f7a20c 100644
--- a/drivers/usb/gadget/rcar/common.c
+++ b/drivers/usb/gadget/rcar/common.c
@@ -15,6 +15,7 @@
#include <linux/err.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
+#include <reset.h>
#include <usb.h>
#include "common.h"
@@ -91,6 +92,12 @@ void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)
u16 mask = DCFM | DRPD | DPRPU | HSE | USBE;
u16 val = HSE | USBE;
+ /* CNEN bit is required for function operation */
+ if (usbhs_get_dparam(priv, has_cnen)) {
+ mask |= CNEN;
+ val |= CNEN;
+ }
+
/*
* if enable
*
@@ -290,6 +297,9 @@ struct usbhs_priv_otg_data {
void __iomem *base;
void __iomem *phybase;
+ struct clk_bulk clk_bulk;
+ struct reset_ctl_bulk reset_bulk;
+
struct platform_device usbhs_dev;
struct usbhs_priv usbhs_priv;
@@ -355,15 +365,25 @@ static int usbhs_udc_otg_gadget_handle_interrupts(struct udevice *dev)
return 0;
}
-static int usbhs_probe(struct usbhs_priv *priv)
+static int usbhs_probe(struct udevice *dev)
{
+ struct usbhs_priv_otg_data *otg_priv = dev_get_priv(dev);
+ struct usbhs_priv *priv = &otg_priv->usbhs_priv;
+ struct renesas_usbhs_driver_param *plat_param;
int ret;
+ plat_param = (struct renesas_usbhs_driver_param *)dev_get_driver_data(dev);
+
priv->dparam.type = USBHS_TYPE_RCAR_GEN3;
priv->dparam.pio_dma_border = 64;
priv->dparam.pipe_configs = usbhsc_new_pipe;
priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+ if (plat_param) {
+ priv->dparam.has_cnen = plat_param->has_cnen;
+ priv->dparam.cfifo_byte_addr = plat_param->cfifo_byte_addr;
+ }
+
/* call pipe and module init */
ret = usbhs_pipe_probe(priv);
if (ret < 0)
@@ -396,34 +416,41 @@ static int usbhs_udc_otg_probe(struct udevice *dev)
{
struct usbhs_priv_otg_data *priv = dev_get_priv(dev);
struct usb_gadget *gadget;
- struct clk_bulk clk_bulk;
int ret = -EINVAL;
priv->base = dev_read_addr_ptr(dev);
if (!priv->base)
return -EINVAL;
- ret = clk_get_bulk(dev, &clk_bulk);
+ ret = clk_get_bulk(dev, &priv->clk_bulk);
if (ret)
return ret;
- ret = clk_enable_bulk(&clk_bulk);
+ ret = clk_enable_bulk(&priv->clk_bulk);
if (ret)
- return ret;
+ goto err_clk_enable;
+
+ ret = reset_get_bulk(dev, &priv->reset_bulk);
+ if (ret)
+ goto err_clk;
+
+ ret = reset_deassert_bulk(&priv->reset_bulk);
+ if (ret)
+ goto err_reset_deassert;
clrsetbits_le32(priv->base + UGCTRL2, UGCTRL2_USB0SEL_MASK, UGCTRL2_USB0SEL_EHCI);
clrsetbits_le16(priv->base + LPSTS, LPSTS_SUSPM, LPSTS_SUSPM);
ret = generic_setup_phy(dev, &priv->phy, 0, PHY_MODE_USB_OTG, 1);
if (ret)
- goto err_clk;
+ goto err_reset;
priv->phybase = dev_read_addr_ptr(priv->phy.dev);
priv->usbhs_priv.pdev = &priv->usbhs_dev;
priv->usbhs_priv.base = priv->base;
priv->usbhs_dev.dev.driver_data = &priv->usbhs_priv;
- ret = usbhs_probe(&priv->usbhs_priv);
+ ret = usbhs_probe(dev);
if (ret < 0)
goto err_phy;
@@ -439,27 +466,49 @@ static int usbhs_udc_otg_probe(struct udevice *dev)
err_phy:
generic_shutdown_phy(&priv->phy);
+err_reset:
+ reset_assert_bulk(&priv->reset_bulk);
+err_reset_deassert:
+ reset_release_bulk(&priv->reset_bulk);
err_clk:
- clk_disable_bulk(&clk_bulk);
+ clk_disable_bulk(&priv->clk_bulk);
+err_clk_enable:
+ clk_release_bulk(&priv->clk_bulk);
+
return ret;
}
static int usbhs_udc_otg_remove(struct udevice *dev)
{
struct usbhs_priv_otg_data *priv = dev_get_priv(dev);
+ struct usb_gadget *gadget;
usbhs_rcar3_power_ctrl(&priv->usbhs_priv, false);
+ gadget = usbhsg_get_gadget(&priv->usbhs_priv);
+ usb_del_gadget_udc(gadget);
usbhs_mod_remove(&priv->usbhs_priv);
usbhs_fifo_remove(&priv->usbhs_priv);
usbhs_pipe_remove(&priv->usbhs_priv);
generic_shutdown_phy(&priv->phy);
+ reset_assert_bulk(&priv->reset_bulk);
+ reset_release_bulk(&priv->reset_bulk);
+
+ clk_disable_bulk(&priv->clk_bulk);
+ clk_release_bulk(&priv->clk_bulk);
+
return dm_scan_fdt_dev(dev);
}
+static struct renesas_usbhs_driver_param rzg2l_param = {
+ .has_cnen = 1,
+ .cfifo_byte_addr = 1,
+};
+
static const struct udevice_id usbhs_udc_otg_ids[] = {
{ .compatible = "renesas,rcar-gen3-usbhs" },
+ { .compatible = "renesas,rzg2l-usbhs", .data = (unsigned long)&rzg2l_param },
{},
};
diff --git a/drivers/usb/gadget/rcar/renesas_usb.h b/drivers/usb/gadget/rcar/renesas_usb.h
index 8155e3dcaf6..140a70251cf 100644
--- a/drivers/usb/gadget/rcar/renesas_usb.h
+++ b/drivers/usb/gadget/rcar/renesas_usb.h
@@ -111,6 +111,7 @@ struct renesas_usbhs_driver_param {
u32 has_otg:1; /* for controlling PWEN/EXTLP */
u32 has_sudmac:1; /* for SUDMAC */
u32 has_usb_dmac:1; /* for USB-DMAC */
+ u32 has_cnen:1;
u32 cfifo_byte_addr:1; /* CFIFO is byte addressable */
#define USBHS_USB_DMAC_XFER_SIZE 32 /* hardcode the xfer size */
u32 multi_clks:1;
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index d75883e2865..6bbed9cb513 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -24,7 +24,7 @@ config USB_XHCI_HCD
bool "xHCI HCD (USB 3.0) support"
depends on DM && OF_CONTROL
select USB_HOST
- ---help---
+ help
The eXtensible Host Controller Interface (xHCI) is standard for USB 3.0
"SuperSpeed" host controller hardware.
@@ -149,7 +149,7 @@ config USB_EHCI_HCD
select USB_HOST
select EHCI_DESC_BIG_ENDIAN if SYS_BIG_ENDIAN
select EHCI_MMIO_BIG_ENDIAN if SYS_BIG_ENDIAN
- ---help---
+ help
The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
"high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
If your USB host controller supports USB 2.0, you will likely want to
@@ -174,14 +174,14 @@ config USB_EHCI_ATMEL
bool "Support for Atmel on-chip EHCI USB controller"
depends on ARCH_AT91
default y
- ---help---
+ help
Enables support for the on-chip EHCI controller on Atmel chips.
config USB_EHCI_EXYNOS
bool "Support for Samsung Exynos EHCI USB controller"
depends on ARCH_EXYNOS
default y
- ---help---
+ help
Enables support for the on-chip EHCI controller on Samsung Exynos
SoCs.
@@ -191,7 +191,7 @@ config USB_EHCI_MARVELL
default y
select USB_EHCI_IS_TDI if !ARM64
select USB_EHCI_IS_TDI if ALLEYCAT_5
- ---help---
+ help
Enables support for the on-chip EHCI controller on MVEBU SoCs.
config USB_EHCI_MX5
@@ -205,7 +205,7 @@ config USB_EHCI_MX6
depends on ARCH_MX6 || ARCH_MX7ULP || ARCH_IMXRT
select EHCI_HCD_INIT_AFTER_RESET
default y
- ---help---
+ help
Enables support for the on-chip EHCI controller on i.MX6 SoCs.
config USB_EHCI_MX7
@@ -215,7 +215,7 @@ config USB_EHCI_MX7
select PHY if IMX8M || IMX9
select NOP_PHY if IMX8M || IMX9
default y
- ---help---
+ help
Enables support for the on-chip EHCI controller on i.MX7/i.MX8M/i.MX9 SoCs.
config USB_EHCI_MXS
@@ -230,7 +230,7 @@ config USB_EHCI_MXS
config USB_EHCI_NPCM
bool "Support for Nuvoton NPCM on-chip EHCI USB controller"
depends on ARCH_NPCM
- ---help---
+ help
Enables support for the on-chip EHCI controller on
Nuvoton NPCM chips.
@@ -240,7 +240,7 @@ config USB_EHCI_OMAP
select PHY
imply NOP_PHY
default y
- ---help---
+ help
Enables support for the on-chip EHCI controller on OMAP3 and later
SoCs.
@@ -255,7 +255,7 @@ if USB_EHCI_MX6 || USB_EHCI_MX7
config MXC_USB_OTG_HACTIVE
bool "USB Power pin high active"
- ---help---
+ help
Set the USB Power pin polarity to be high active (PWR_POL)
endif
@@ -265,7 +265,7 @@ config USB_EHCI_MSM
depends on DM_USB
select USB_ULPI
select MSM8916_USB_PHY
- ---help---
+ help
Enables support for the on-chip EHCI controller on Qualcomm
Snapdragon SoCs.
@@ -280,7 +280,7 @@ config USB_EHCI_TEGRA
bool "Support for NVIDIA Tegra on-chip EHCI USB controller"
depends on ARCH_TEGRA
select USB_EHCI_IS_TDI
- ---help---
+ help
Enable support for Tegra on-chip EHCI USB controller. If you enable
ULPI and your PHY needs a different reference clock than the standard
24 MHz then you have to define CFG_ULPI_REF_CLK to the appropriate
@@ -291,14 +291,14 @@ config USB_EHCI_ZYNQ
depends on ARCH_ZYNQ
default y
select USB_EHCI_IS_TDI
- ---help---
+ help
Enable support for Zynq on-chip EHCI USB controller
config USB_EHCI_GENERIC
bool "Support for generic EHCI USB controller"
depends on DM_USB
default ARCH_SUNXI
- ---help---
+ help
Enables support for generic EHCI controller.
config EHCI_HCD_INIT_AFTER_RESET
@@ -310,7 +310,7 @@ config USB_EHCI_FSL
select EHCI_HCD_INIT_AFTER_RESET
select SYS_FSL_USB_INTERNAL_UTMI_PHY if MPC85xx && \
!(ARCH_B4860 || ARCH_B4420 || ARCH_P4080 || ARCH_P1020 || ARCH_P2020)
- ---help---
+ help
Enables support for the on-chip EHCI controller on FSL chips.
config SYS_FSL_USB_INTERNAL_UTMI_PHY
@@ -340,7 +340,7 @@ config USB_OHCI_HCD
depends on DM && OF_CONTROL
select USB_HOST
select USB_OHCI_NEW
- ---help---
+ help
The Open Host Controller Interface (OHCI) is a standard for accessing
USB 1.1 host controller hardware. It does more in hardware than Intel's
UHCI specification. If your USB host controller follows the OHCI spec,
@@ -361,7 +361,7 @@ config USB_OHCI_PCI
config USB_OHCI_GENERIC
bool "Support for generic OHCI USB controller"
default ARCH_SUNXI
- ---help---
+ help
Enables support for generic OHCI controller.
config USB_OHCI_DA8XX
@@ -374,7 +374,7 @@ config USB_OHCI_DA8XX
config USB_OHCI_NPCM
bool "Support for Nuvoton NPCM on-chip OHCI USB controller"
depends on ARCH_NPCM
- ---help---
+ help
Enables support for the on-chip OHCI controller on
Nuvoton NPCM chips.
@@ -391,7 +391,7 @@ config SYS_OHCI_SWAP_REG_ACCESS
config USB_UHCI_HCD
bool "UHCI HCD (most Intel and VIA) support"
select USB_HOST
- ---help---
+ help
The Universal Host Controller Interface is a standard by Intel for
accessing the USB hardware in the PC (which is also called the USB
host controller). If your USB host controller conforms to this
@@ -410,7 +410,7 @@ config USB_DWC2
bool "DesignWare USB2 Core support"
depends on DM && OF_CONTROL
select USB_HOST
- ---help---
+ help
The DesignWare USB 2.0 controller is compliant with the
USB-Implementers Forum (USB-IF) USB 2.0 specifications.
Hi-Speed (480 Mbps), Full-Speed (12 Mbps), and Low-Speed (1.5 Mbps)
@@ -421,7 +421,7 @@ if USB_DWC2
config USB_DWC2_BUFFER_SIZE
int "Data buffer size in kB"
default 64
- ---help---
+ help
By default 64 kB buffer is used but if amount of RAM avaialble on
the target is not enough to accommodate allocation of buffer of
that size it is possible to shrink it. Smaller sizes should be fine
@@ -433,7 +433,7 @@ config USB_R8A66597_HCD
bool "Renesas R8A66597 USB Core support"
depends on DM && OF_CONTROL
select USB_HOST
- ---help---
+ help
This enables support for the on-chip Renesas R8A66597 USB 2.0
controller, present in various RZ and SH SoCs.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index ef4ce62a680..9cac53f07c7 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -5,7 +5,7 @@
ifdef CONFIG_$(PHASE_)DM_USB
obj-y += usb-uclass.o
-obj-$(CONFIG_SANDBOX) += usb-sandbox.o
+obj-$(CONFIG_USB_EMUL) += usb-sandbox.o
endif
ifdef CONFIG_$(PHASE_)USB_STORAGE
diff --git a/drivers/usb/host/ehci-marvell.c b/drivers/usb/host/ehci-marvell.c
index 794a4168913..38ee17f063d 100644
--- a/drivers/usb/host/ehci-marvell.c
+++ b/drivers/usb/host/ehci-marvell.c
@@ -222,8 +222,8 @@ static void usb_brg_adrdec_setup(int index)
break;
}
- size = gd->bd->bi_dram[i].size;
- base = gd->bd->bi_dram[i].start;
+ size = gd->dram[i].size;
+ base = gd->dram[i].start;
if ((size) && (attrib))
writel(MVCPU_WIN_CTRL_DATA(size, USB_TARGET_DRAM,
attrib, MVCPU_WIN_ENABLE),
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 1d6711ccec4..3fcf9d53d59 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1750,7 +1750,7 @@ static int hc_reset(ohci_t *ohci)
int timeout = 30;
int smm_timeout = 50; /* 0,5 sec */
- dbg("%s\n", __FUNCTION__);
+ dbg("%s\n", __func__);
#ifdef CONFIG_PCI_EHCI_DEVNO
/*
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 7247245a702..1c74d6fd39a 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -134,7 +134,7 @@ int usb_alloc_device(struct usb_device *udev)
struct udevice *bus = udev->controller_dev;
struct dm_usb_ops *ops = usb_get_ops(bus);
- /* This is only requird by some controllers - current XHCI */
+ /* This is only required by some controllers - currently XHCI */
if (!ops->alloc_device)
return 0;
diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c
index 12dc61aee9d..c294a56b3c9 100644
--- a/drivers/usb/host/xhci-mvebu.c
+++ b/drivers/usb/host/xhci-mvebu.c
@@ -82,6 +82,7 @@ static int xhci_usb_of_to_plat(struct udevice *dev)
static const struct udevice_id xhci_usb_ids[] = {
{ .compatible = "marvell,armada3700-xhci" },
+ { .compatible = "marvell,armada-375-xhci" },
{ .compatible = "marvell,armada-380-xhci" },
{ .compatible = "marvell,armada-8k-xhci" },
{ }
diff --git a/drivers/usb/musb-new/Kconfig b/drivers/usb/musb-new/Kconfig
index f8daaddc657..208e47d8ff5 100644
--- a/drivers/usb/musb-new/Kconfig
+++ b/drivers/usb/musb-new/Kconfig
@@ -23,11 +23,11 @@ config USB_MUSB_GADGET
if USB_MUSB_HOST || USB_MUSB_GADGET
config USB_MUSB_SC5XX
- bool "Analog Devices MUSB support"
- depends on (SC57X || SC58X)
+ bool "Analog Devices MUSB support"
+ depends on (SC57X || SC58X)
help
- Say y here to enable support for the USB controller on
- ADI SC57X/SC58X processors.
+ Say y here to enable support for the USB controller on
+ ADI SC57X/SC58X processors.
config USB_MUSB_DA8XX
bool "Enable DA8xx MUSB Controller"
@@ -48,7 +48,7 @@ config USB_MUSB_TI
silicon IP.
config USB_MUSB_OMAP2PLUS
- tristate "OMAP2430 and onwards"
+ bool "OMAP2430 and onwards"
depends on ARCH_OMAP2PLUS
config USB_MUSB_AM35X
@@ -81,9 +81,9 @@ config USB_MUSB_SUNXI
depends on PHY_SUN4I_USB
select USB_MUSB_PIO_ONLY
default y
- ---help---
- Say y here to enable support for the sunxi OTG / DRC USB controller
- used on almost all sunxi boards.
+ help
+ Say y here to enable support for the sunxi OTG / DRC USB controller
+ used on almost all sunxi boards.
config USB_MUSB_UX500
bool "Enable ST-Ericsson Ux500 USB controller"
diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c
index 7fd6639013a..c8c6bf0c84f 100644
--- a/drivers/usb/musb-new/omap2430.c
+++ b/drivers/usb/musb-new/omap2430.c
@@ -100,7 +100,7 @@ static int omap2430_musb_enable(struct musb *musb)
#ifdef CONFIG_TWL4030_USB
if (twl4030_usb_ulpi_init()) {
serial_printf("ERROR: %s Could not initialize PHY\n",
- __PRETTY_FUNCTION__);
+ __func__);
}
#endif
return 0;
diff --git a/drivers/usb/tcpm/Kconfig b/drivers/usb/tcpm/Kconfig
index 9be4b496e82..b1ea7253720 100644
--- a/drivers/usb/tcpm/Kconfig
+++ b/drivers/usb/tcpm/Kconfig
@@ -1,14 +1,14 @@
# SPDX-License-Identifier: GPL-2.0
config TYPEC_TCPM
- tristate "USB Type-C Port Controller Manager"
+ bool "USB Type-C Port Controller Manager"
depends on DM
help
The Type-C Port Controller Manager provides a USB PD and USB Type-C
state machine for use with Type-C Port Controllers.
config TYPEC_FUSB302
- tristate "Fairchild FUSB302 Type-C chip driver"
+ bool "Fairchild FUSB302 Type-C chip driver"
depends on DM && DM_I2C && TYPEC_TCPM
help
The Fairchild FUSB302 Type-C chip driver that works with
diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c
index 3061b466d7c..d6c0be82333 100644
--- a/drivers/usb/tcpm/tcpm.c
+++ b/drivers/usb/tcpm/tcpm.c
@@ -207,7 +207,7 @@ static int tcpm_pd_transmit(struct udevice *dev,
*/
timeout_us *= 5;
ret = read_poll_timeout(tcpm_transmit_helper, tx_complete,
- !tx_complete, false, timeout_us, dev);
+ tx_complete, false, timeout_us, dev);
if (ret < 0) {
dev_err(dev, "TCPM: PD transmit data failed: %d\n", ret);
return ret;