summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* env: Move env_set_hex() to env.hSimon Glass2019-08-111-0/+1
| | | | | | | | Move env_set_hex() over to the new header file along with env_set_addr() which uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* usb: gadget: f_dfu.c: fix memory leakRalph Siemsen2019-08-081-0/+1
| | | | | | | | | | | | dfu_prepare_function() allocates N+1 descriptor header structures, the last one being the "DFU Functional Descriptor". dfu_unbind() handles de-allocation, but fails to free the final one (eg. "DFU Functional Descriptor"), leading to memory leak. Fixed by incrementing counter, as in dfu_prepare_function(). Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
* usb, ohci, pci: add DM support for PCI-based OHCI USB controllerHeiko Schocher2019-08-083-0/+60
| | | | | | | add new DM based PCI driver ohci-pci for PCI-based OHCI USB support. Signed-off-by: Heiko Schocher <hs@denx.de>
* usb, ohci: add warning if none on pci foundHeiko Schocher2019-08-081-1/+4
| | | | Signed-off-by: Heiko Schocher <hs@denx.de>
* usb, ohci-hcd: set OHCI_USE_NPS if DM_PCIHeiko Schocher2019-08-081-2/+3
| | | | | | set OHCI_USE_NPS if DM_PCI is enabled. Signed-off-by: Heiko Schocher <hs@denx.de>
* usb, ohci: fix ohci swap register accessHeiko Schocher2019-08-081-2/+2
| | | | | | | | | | commit 57faca19a82f ("drivers: USB: OHCI: allow compilation for 64-bit targets") broke ohci support for the mpc85xx based socrates board, as it removed volatile keyword from ohci_readl/writel. Fix this so usb works again on socrates board. Signed-off-by: Heiko Schocher <hs@denx.de>
* usb, ohci-hdc: fix warning 'ohci_pci_ids' defined but not usedHeiko Schocher2019-08-081-0/+2
| | | | | | | | var ohci_pci_ids is only used if DM_USB is not enabled. So define this varaible only if !CONFIG_IS_ENABLED(DM_USB) Signed-off-by: Heiko Schocher <hs@denx.de>
* usb: musb-new: Add support for da8xx-musbAdam Ford2019-08-083-0/+359
| | | | | | | With the recently added phy driver, this patch will enable the musb driver on the da8xx to operate in host mode. Signed-off-by: Adam Ford <aford173@gmail.com>
* rockchip: xhci: Remove RK3399 supportMark Kettenis2019-07-191-2/+0
| | | | | | | | Remove RK3399 compatible strings as this driver is no longer used on that SoC. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* usb: xhci-dwc3: Add USB2 PHY configurationMark Kettenis2019-07-191-0/+20
| | | | | | | | Configure USB2 PHY register based on "phy_type" property and handle all the quirks that are relevant for Rockchip RK3399 SoCs. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* usb: dwc3-of-simple: Add support for RK3399Mark Kettenis2019-07-192-0/+2
| | | | | | | | Add compatible string for RK3399 and enable it by default on Rockchip platforms with USB3 support. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGETDerald D. Woods2019-07-131-2/+6
| | | | | | | | | | | | | | | | | | | | | This commit addresses the following warning, when _NOT_ USB_MUSB_HOST: [...] CC drivers/usb/gadget/f_mass_storage.o CC drivers/usb/musb-new/omap2430.o CC drivers/usb/gadget/f_fastboot.o CC env/common.o CC env/env.o /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c: In function ‘omap2430_musb_probe’: /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:239:6: warning: assignment to ‘int’ from ‘struct musb *’ makes integer from pointer without a cast [-Wint-conversion] ret = musb_register(&platdata->plat, ^ LD drivers/usb/host/built-in.o CC drivers/usb/gadget/f_sdp.o CC fs/ext4/ext4fs.o [...] Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
* usb: dwc3: Use UCLASS_NOP instead of UCLASS_MISC for the DWC3 generic glueJean-Jacques Hiblot2019-07-051-1/+1
| | | | | | | | | 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>
* usb: dwc3-generic: remove dm_scan_fdt_dev() from the remove() callbackJean-Jacques Hiblot2019-07-051-1/+1
| | | | | | There is simply no reason to do that here. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* usb: ehci-mx6: Fix bus enumeration for DM caseMarek Vasut2019-07-051-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge tag 'u-boot-imx-20190628' of ↵Tom Rini2019-06-281-6/+47
|\ | | | | | | | | | | | | | | | | | | | | 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
| * usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDPFrieder Schrempf2019-06-271-6/+47
| | | | | | | | | | | | | | | | | | | | | | 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>
* | usb: dwc2: allow peripheral mode for OTG configurationPatrick Delaunay2019-06-191-1/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | usb: dwc2: correctly handle binding for g-tx-fifo-sizePatrick Delaunay2019-06-191-1/+13
|/ | | | | | | 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>
* usb: ehci: adopt 32 bit address for CONFIG_PPCYinbo Zhu2019-05-231-1/+9
| | | | | | | | 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>
* usb: ohci: ohci-da8xx: Cleanup Error handling and fix flagsAdam Ford2019-05-091-4/+5
| | | | | | | | | 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>
* usb: dwc3: Add Meson G12A USB GlueNeil Armstrong2019-05-093-0/+465
| | | | | | | | | | | | | | | | | | | | | 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>
* usb: ohci: ohci-da8xx: Enable da850-ohci driver with DM supportAdam Ford2019-05-052-1/+142
| | | | | | | | | 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>
* usb: musb_hcd: remove unnecessary ifdefs for dm* SoCsBartosz Golaszewski2019-05-041-6/+0
| | | | | | | | 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>
* Merge git://git.denx.de/u-boot-usbTom Rini2019-05-031-2/+0
|\ | | | | | | - DaVinci updates
| * usb: ohci: Re-enable commented out delayAdam Ford2019-05-031-2/+0
| | | | | | | | | | | | | | 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>
* | Merge tag 'rockchip-for-2019.07' of git://git.denx.de/u-boot-rockchipTom Rini2019-05-011-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | 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.
| * rockchip: use 'arch-rockchip' as header file pathKever Yang2019-05-011-1/+1
| | | | | | | | | | | | | | | | 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>
* | Convert CONFIG_USB_EHCI_MX5 to KconfigLukasz Majewski2019-04-251-0/+7
| | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_USB_EHCI_MX5 Signed-off-by: Lukasz Majewski <lukma@denx.de>
* | USB: DM: Convert i.MX5 ehci code to driver modelLukasz Majewski2019-04-251-0/+103
|/ | | | | | | | 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>
* usb: dwc2: fix gadget disconnectFabrice Gasnier2019-04-212-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* stm32mp1: add stusb1600 support for DK1 and DK2 boardPatrick Delaunay2019-04-211-2/+6
| | | | | | | | | | | | | | | 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>
* usb: dwc2: add support for STM32MP1Patrick Delaunay2019-04-212-2/+53
| | | | | | | | | | 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>
* usb: dwc2_udc_otg: Add tx_fifo_sz array supportPatrice Chotard2019-04-211-2/+12
| | | | | | | | | | | | | | | | | | | | | 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>
* usb: dwc2_udc_otg: Read MAX_HW_ENDPOINT from HWCFG4 registerPatrick Delaunay2019-04-213-9/+20
| | | | | | | | | | 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>
* usb: dwc2: Add function for session B checkPatrick Delaunay2019-04-211-0/+9
| | | | | | | | 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>
* usb: dwc2: Add force-b-session-valid supportPatrick Delaunay2019-04-212-2/+15
| | | | | | | Handle "force-b-session-valid" property from DT. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* usb: dwc2: force reset assert before to probe the driverPatrick Delaunay2019-04-211-1/+6
| | | | | | | 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>
* usb: dwc2: convert driver to DM_USB_GADGETPatrick Delaunay2019-04-211-2/+290
| | | | | | | | | | | 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>
* usb: dwc2: remove unused variable regs_otgPatrick Delaunay2019-04-211-3/+0
| | | | | | | Remove the global regs_otg variable. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* usb: Select USB_MUSB_DSPS with USB_MUSB_TIAlex Kiernan2019-04-191-0/+1
| | | | | | | | | | | | | | | | 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>
* configs: Migrate USB_MUSB_DISABLE_BULK_COMBINE_SPLIT to KconfigAlex Kiernan2019-04-191-0/+9
| | | | | | | | | | 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>
* configs: move CONFIG_USB_EHCI_VF to KconfigMarcel Ziswiler2019-04-131-0/+7
| | | | | | | | 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>
* usb: ehci-mx6: Use common code to extract dr_modeAdam Ford2019-04-091-14/+15
| | | | | | | | 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>
* usb: host: Print device name when scanningIsmael Luceno Cortes2019-04-091-8/+4
| | | | | | | | | | | | | | | | | | 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>
* usb: udc-uclass: Fixed problem when no alias is defined in DTJean-Jacques Hiblot2019-03-161-2/+5
| | | | | | | | | | | | 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>
* Kconfig: tegra: Migrate USB_EHCI_TEGRAPeter Robinson2019-02-201-0/+6
| | | | | | | | | | | | | | | | 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>
* usb: ehci-mx6: Make regulator DM_REGULATOR dependentAbel Vesa2019-02-151-1/+6
| | | | | | | | | 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>
* usb: ether: call _usb_eth_halt() if initialization failsJean-Jacques Hiblot2019-02-011-1/+4
| | | | | | | | | | | | 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>
* spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFUAndrew F. Davis2019-01-261-1/+1
| | | | | | | | | | 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>