summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2020-04-01usb: ehci-mx6: Fix bus enumeration for iMX7 SoCsIgor Opaniuk
This fixes the issues with calculation of controller indexes in ehci_usb_bind() for iMX7, as USB controllers on iMX7 SoCs aren't placed next to each other, and their addresses incremented by 0x10000. Example of USB nodes for iMX7S/D: usbotg1: usb@30b10000 { compatible = "fsl,imx7d-usb", "fsl,imx27-usb"; reg = <0x30b10000 0x200>; ^^^^^^^^^^ .... usbotg2: usb@30b20000 { compatible = "fsl,imx7d-usb", "fsl,imx27-usb"; reg = <0x30b20000 0x200>; ^^^^^^^^^^ .... usbh: usb@30b30000 { compatible = "fsl,imx7d-usb", "fsl,imx27-usb"; reg = <0x30b30000 0x200>; ^^^^^^^^^^ .... Which was leading to usb enumeration issues: Colibri iMX7 # usb start starting USB... Bus usb@30b10000: USB EHCI 1.00 Bus usb@30b20000: probe failed, error -22 scanning bus usb@30b10000 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Fixes: 501547cec1("usb: ehci-mx6: Fix bus enumeration for DM case") Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> (cherry picked from commit 1198a104d37b10064cd90f36d472787d549eda02)
2019-07-05usb: dwc3: Use UCLASS_NOP instead of UCLASS_MISC for the DWC3 generic glueJean-Jacques Hiblot
dwc3-generic has been broken since MISC uclass has been modified to scan DT sub-nodes after bind. Fixing it by a using the no-op uclass. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-05usb: dwc3-generic: remove dm_scan_fdt_dev() from the remove() callbackJean-Jacques Hiblot
There is simply no reason to do that here. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-07-05usb: ehci-mx6: Fix bus enumeration for DM caseMarek Vasut
The EHCI iMX6 driver is only partly converted to DT probing and still uses a tremendous amount of hard-coded addresses. Worse, the driver uses hard-coded SoC-model-specific base addresses, which are derived from values protected by SoC-specific macros, hence the driver is also compiled for a specific SoC model. Even worse, the driver depends on specific sequential indexing of the controllers, from which it derives offsets in the PHY and ANATOP register sets. However, when the driver is probed from DT, the indexing is not correct. In fact, each controller has index 0. This patch derives the index for DT probing case from the controller base addresses, which is not the way this should be done, however it is the least intrusive approach, favorable this close to release. The necessary steps to convert this driver fully to DT probing are described inside the patch, however this should be done in the next release and depends on iMX clock driver patches. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Abel Vesa <abel.vesa@nxp.com> Cc: Adam Ford <aford173@gmail.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: Ludwig Zenz <lzenz@dh-electronics.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Vagrant Cascadian <vagrant@debian.org>
2019-06-28Merge tag 'u-boot-imx-20190628' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx Fixes for 2019.07 - menlo board - allow SDB on Sabre - HAB for mx6sl - apalis board
2019-06-27usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDPFrieder Schrempf
Add support for loading u-boot FIT images over the USB SDP protocol in the SPL Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> [Various build fixes] Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Tested-by: Fabio Estevam <festevam@gmail.com> Tested-by: Lukasz Majewski <lukma@denx.de>
2019-06-19usb: dwc2: allow peripheral mode for OTG configurationPatrick Delaunay
Allow device mode in DWC2 driver when device tree select the dr_mode "peripheral" or "otg". The device mode is not allowed when dr_mode = "host" in device tree. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Marek Vasut <marex@denx.de>
2019-06-19usb: dwc2: correctly handle binding for g-tx-fifo-sizePatrick Delaunay
Manage g-tx-fifo-size as a array as specify in the binding. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Marek Vasut <marex@denx.de>
2019-05-23usb: ehci: adopt 32 bit address for CONFIG_PPCYinbo Zhu
adopt 32 bit addr in fsl_esdhc for CONFIG_PPC. So adopt 32 bit address for CONFIG_PPC. Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com> Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-05-09usb: ohci: ohci-da8xx: Cleanup Error handling and fix flagsAdam Ford
Per feedback from Marek, he suggested better handling and to enable DM_FLAG_OS_PREPARE, this patch re-orders some of the error checking, and errors returns the error code right away and also sets DM_FLAG_OS_PREPARE. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-05-09usb: dwc3: Add Meson G12A USB GlueNeil Armstrong
Adds support for Amlogic G12A USB Control Glue HW. The Amlogic G12A SoC Family embeds 2 USB Controllers : - a DWC3 IP configured as Host for USB2 and USB3 - a DWC2 IP configured as Peripheral USB2 Only A glue connects these both controllers to 2 USB2 PHYs, and optionnally to an USB3+PCIE Combo PHY shared with the PCIE controller. The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY. This driver sets the OTG capable port as Host mode by default, the switch to Device mode is to be done in a separate patch. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Marek Vasut <marex@denx.de>
2019-05-05usb: ohci: ohci-da8xx: Enable da850-ohci driver with DM supportAdam Ford
This patch reuses some former code for the hawkboard, combines it with some some similar DM_USB compatible code for the OHCI driver, and enables the use of the da850's OHCI controller with DM_USB compatibility. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-05-04usb: musb_hcd: remove unnecessary ifdefs for dm* SoCsBartosz Golaszewski
The support for DaVinci DM* SoCs has been dropped. The ifdefs in the musb_hcd driver are no longer needed. Remove them. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Marek Vasut <marex@denx.de>
2019-05-03Merge git://git.denx.de/u-boot-usbTom Rini
- DaVinci updates
2019-05-03usb: ohci: Re-enable commented out delayAdam Ford
There is a delay function that was commented out. This patch re-enables it, because it will be needed for da850 ohci support. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-05-01Merge tag 'rockchip-for-2019.07' of git://git.denx.de/u-boot-rockchipTom Rini
Improvements and new features: - improved SPI driver for better read throughput - refactors initialisation of debug UART init - restructures header file paths - adds pinctrl improvements Adds Kever as a co-custodian.
2019-05-01rockchip: use 'arch-rockchip' as header file pathKever Yang
Rockchip use 'arch-rockchip' instead of arch-$(SOC) as common header file path, so that we can get the correct path directly. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-04-25Convert CONFIG_USB_EHCI_MX5 to KconfigLukasz Majewski
This converts the following to Kconfig: CONFIG_USB_EHCI_MX5 Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-04-25USB: DM: Convert i.MX5 ehci code to driver modelLukasz Majewski
This commit converts i.MX5's EHCI USB host driver to driver model (DM_USB). It is a straightforward conversion (to reuse as much code as possible), based on ehci-mx6.c code. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: fix gadget disconnectFabrice Gasnier
This fixes a disconnect issue detected with fastboot command, when using dwc2 driver. - On u-boot side: uboot>$ fastboot 0 - On USB host PC side, few seconds after PC>$ fastboot reboot # Get stuck, uboot target never reboots By enabling DEBUG_ISR logs, the bus suspend interrupt is seen before the PC command has been issued. When the USB bus suspend occurs, there's a HACK that disables the fastboot (composite driver). Here is the call stack upon USB bus suspend: - dwc2_handle_usb_suspend_intr() - dev->driver->disconnect() - composite_disconnect() - reset_config() - f->disable() - fastboot_disable() - usb_ep_disable(f_fb->out_ep); - usb_ep_disable(f_fb->in_ep); .. other disable calls. When the resume interrupt happens, everything has been disabled, then nothing happens. fastboot command gets stuck on HOST side. Remove original HACK, that disconnects the composite driver upon USB bus suspend. Implement disconnect detection instead: - check GINTSTS OTG interrupt - read GOTGINT register - check GOTGINT, SesEndDet bit (e.g. session end) This is inspired by what is implemented currently in Linux dwc2 driver. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: Marek Vasut <marex@denx.de>
2019-04-21stm32mp1: add stusb1600 support for DK1 and DK2 boardPatrick Delaunay
The DK1 and DK2 boards use the USB Type-C controller STUSB1600. This patch updates: - the device tree to add the I2C node in the DT - the board stm32mp1 to probe this I2C device and use this controller to check cable detection. - the DWC2 driver to support a new dt property "u-boot,force-b-session-valid" which forces B session and device mode; it is a workaround because the VBUS sensing and ID detection isn't available with stusb1600. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: add support for STM32MP1Patrick Delaunay
Add compatible "st,stm32mp1-hsotg" and associated driver data to manage the usb33d-supply and the ST specific register for VBus sensing. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> # Conflicts: # drivers/usb/gadget/dwc2_udc_otg.c Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2_udc_otg: Add tx_fifo_sz array supportPatrice Chotard
All TX fifo size can be different, add tx_fifo_sz_array[] into dwc2_plat_otg_data to be able to set them. tx_fifo_sz_array[] is 17 Bytes long and can contains max 16 tx fifo size (synopsys IP supports max 16 IN endpoints). First entry of tx_fifo_sz_array[] is the number of valid fifo size the array contains. In case of tx_fifo_sz_array[] doesn't contains the same number of element than max hardware endpoint, display a warning message. Compatibility with board which doesn't use tx_fifo_sz_array[] (Rockchip rk322x/rk3128/rv1108/rk3288/rk3036) is kept. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2_udc_otg: Read MAX_HW_ENDPOINT from HWCFG4 registerPatrick Delaunay
Some DWC2 ip variant doesn't use 16 hardware endpoint as hardcoded in the driver. Bits INEps [29:26] of HWCFG4 register allows to get this information. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: Add function for session B checkPatrick Delaunay
Add a new function to check the session B validity, to be use to check cable connection. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: Add force-b-session-valid supportPatrick Delaunay
Handle "force-b-session-valid" property from DT. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: force reset assert before to probe the driverPatrick Delaunay
Reset the hardware to be sure of the device state. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: convert driver to DM_USB_GADGETPatrick Delaunay
Minimal conversion to driver model by using the uclass UCLASS_USB_GADGET_GENERIC based on: - reset uclass - clock uclass - generic uclass. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-21usb: dwc2: remove unused variable regs_otgPatrick Delaunay
Remove the global regs_otg variable. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-19usb: Select USB_MUSB_DSPS with USB_MUSB_TIAlex Kiernan
USB_MUSB_TI requires USB_MUSB_DSPS, failing at link time if it's not selected: drivers/usb/musb-new/built-in.o: In function `ti_musb_host_ofdata_to_platdata': drivers/usb/musb-new/ti-musb.c:193: undefined reference to `musb_dsps_ops' or if OF_CONTROL is not selected: arch/arm/mach-omap2/built-in.o:(.data.usb0+0x24): undefined reference to `musb_dsps_ops' Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-04-19configs: Migrate USB_MUSB_DISABLE_BULK_COMBINE_SPLIT to KconfigAlex Kiernan
Migrate support for disable MUSB bulk split/combine to Kconfig Green Travis build: https://travis-ci.org/akiernan/u-boot/builds/519101867 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-04-13configs: move CONFIG_USB_EHCI_VF to KconfigMarcel Ziswiler
Move CONFIG_USB_EHCI_VF to drivers/usb/host/Kconfig and update the one and only user thereof being colibri_vf. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-04-09usb: ehci-mx6: Use common code to extract dr_modeAdam Ford
There exists code in drivers/common/common.c to read the dr_mode from the device tree. This patch converts this driver to use that function to initialize the driver. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-04-09usb: host: Print device name when scanningIsmael Luceno Cortes
Drop the counter, it has no meaning other than being the order in which the interface is found; the name assigned to the USB host controller interface is a better indicator. Example of the original output: > USB0: USB EHCI 1.10 > scanning bus 0 for devices... 2 USB Device(s) found > scanning usb for storage devices... 1 Storage Device(s) found Patched output: > Bus usb@ee080100: USB EHCI 1.10 > scanning bus usb@ee080100 for devices... 2 USB Device(s) found > scanning usb for storage devices... 1 Storage Device(s) found Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
2019-03-16usb: udc-uclass: Fixed problem when no alias is defined in DTJean-Jacques Hiblot
commit 801f1fa442 "dm: usb: udc: Use SEQ_ALIAS to index the USB gadget ports" changed the way the udevice if found. It uses the alias to find a udevice for a given USB port number. In the commit log it was stated that if no alias is provided, the bind order will be used instead. However it doesn't work. Fixing this by adding a call to uclass_get_device() if uclass_get_device_by_seq() fails. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Vignesh R <vigneshr@ti.com>
2019-02-20Kconfig: tegra: Migrate USB_EHCI_TEGRAPeter Robinson
Migrate USB_EHCI_TEGRA from headers to Kconfig Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Marek Vasut <marex@denx.de> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Peter.Chubb@data61.csiro.au Cc: Lucas Stach <dev@lynxeye.de> Cc: Stefan Agner <stefan.agner@toradex.com> Cc: Alban Bedel <alban.bedel@avionic-design.de> Cc: Allen Martin <amartin@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-02-15usb: ehci-mx6: Make regulator DM_REGULATOR dependentAbel Vesa
Do the regulator related work only if the build has the DM_REGULATOR. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-02-01usb: ether: call _usb_eth_halt() if initialization failsJean-Jacques Hiblot
If the host does not respond in time, the initialization fails. However the usb ether driver will still be registered. This will make usb_gadget_probe_driver() fail the next time the initialization is attempted because it cannot find an available UDC. Fixing this by calling _usb_eth_halt() when the init fails. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Acked-by: Lukasz Majewski <lukma@denx.de>
2019-01-26spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFUAndrew F. Davis
The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT to allow for cleaner use in code. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Lukasz Majewski <lukma@denx.de>
2019-01-24Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini
2019-01-24net: remove CONFIG_MCAST_TFTPChris Packham
No mainline board enables CONFIG_MCAST_TFTP and there have been compilation issues with the code for some time. Additionally, it has a potential buffer underrun issue (reported as a side note in CVE-2018-18439). Remove the multicast TFTP code but keep the driver API for the future addition of IPv6. Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Signed-off-by: Chris Packham <judge.packham@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-01-18usb: host: Drop [e-o]hci-sunxi driversJagan Teki
Now Allwinner platform is all set to use Generic USB controller drivers, so remove the legacy sunxi drivers. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-01-18sunxi: usb: Switch to Generic host controllersJagan Teki
Onc of key blocker for using USB Generic host controller drivers in Allwinner are CLK and RESET drivers, now these available for USB usage. So switch sunxi USB use EHCI and OHCI Generic controllers. Enabling USB is wisely a board choise, So Enable USB_OHCI_HCD where it already have USB_EHCI_HCD Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-01-18musb-new: sunxi: Use CLK and RESET supportJagan Teki
Now clock and reset drivers are available for respective SoC's so use clk and reset ops on musb driver. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Marek Vasut <marex@denx.de>
2019-01-10dm: usb: gadget: Fix boot breakage on sunxi platformsJean-Jacques Hiblot
Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for USB gadget devices") The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared even for platforms that do not enable DM_USB_GADGET. Otherwise the driver for their usb peripheral controller fails to bind. Reported-by: Priit Laes <plaes@plaes.org> Reported-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Priit Laes <plaes@plaes.org> Acked-by: Jagan Teki <jagan@openedev.com>
2019-01-10Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as CONFIG_SPL_USB_GADGETJean-Jacques Hiblot
The SPL option for USB gadget should be named after the option for u-boot (CONFIG_USB_GADGET) Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-01-10dm: usb: udc: Use SEQ_ALIAS to index the USB gadget portsJean-Jacques Hiblot
dfu, fastbot and other usb gadget commands take the USB port index as a parameter. Currently this index is assigned in the order of the driver bindings. Changing this behavior using the SEQ_ALIAS feature. This option assign to the device a SEQ number based on its alias (if it exists) To use it we must set the DM_UC_FLAG_SEQ_ALIAS flag and follow the existing naming convention: use "usb" for the name of the gadget UCLASS_DRIVER (same as for the UCLASS_USB). If no alias is provided, then the index falls back to the order in which the bindings took place. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reported-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-01-09usb: xhci-mem: Fix scratchpad array issueYe Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Marek Vasut <marex@denx.de>
2018-12-14usb: musb-new: sunxi: Fix null pointer accessStefan Mavrodiev
When the device is in peripheral mode there is no struct usb_bus_priv allocated pointer, as the uclass driver ("usb_dev_generic") doesn't call per_device_auto_alloc_size. This results in writing to the internal SDRAM at priv->desc_before_addr = true; Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
2018-12-14usb: composite: Fix max packet size for USB3.0Siva Durga Prasad Paladugu
For USB3.0, the max packetsize for GET_DESCRIPTOR should be sent as exponent value for 2. This means for 512, max packet size should be filled with 9(2^9=512). Also, fill the USB version field with 3.0 if speed is negotiated to Superspeed. This fixes the issue of DFU gadget download failure with superspeed. Without this patch, the max packet size is overflowed to zero as the bMaxPacketsize is of u8 and hence host is not able to detect this device. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>