summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2019-09-14Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
- Assorted bugfixes
2019-09-11usb: ohci-generic: don't probe fail if there is no clk_enable() opsKever Yang
Some clock driver do not have a clk_enable() call back, and we should not treat this as fail in ehci probe like other modules, eg. clk_enabl_bulk() do not return fail if ret value is '-ENOSYS' Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2019-09-11usb: ehci-generic: don't probe fail if there is no clk_enable() opsKever Yang
Some clock driver do not have a clk_enable() call back, and we should not treat this as fail in ehci probe like other modules, eg. clk_enabl_bulk() do not return fail if ret value is '-ENOSYS' Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2019-09-11usb: musb_hcd: fix compilation errorJean-Jacques Hiblot
commit 65c1f9820c8f79f "usb: Add nonblock argument to submit_int_msg" breaks the musb_hcd driver. Fixing it by adding the missing argument Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-09-11dwc2: use the nonblock argument in submit_int_msgMichal Suchanek
An USB 1.1 keyboard connected to dwc2 through a high-speed hub does not report status until it changes. With this patch you can enable keyboard by pressing a key while USB devices are probed. Without a keypress no state is reported and the probe times out. We don't want to wait for a keypress or timeout while polling for keypresses so implement an int_msg nonblock variant that exits early on error. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2019-09-11usb: Add nonblock argument to submit_int_msgMichal Suchanek
This will be used to implement non-blocking keyboard polling in case of errors. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2019-09-10usb: xhci-dwc3: Add support for dis_u2_susphy_quirkNeil Armstrong
This quirk is necessary for the Amlogic GXL SoCs otherwise the Port 2 PHY doesn't get out of suspend and U-Boot resets the board after: XHCI timeout on event type 33... cannot recover. BUG: failure at drivers/usb/host/xhci-ring.c:474/xhci_wait_for_event()! BUG! This quirk is also handled in the dwc3 core code, but until the xhci-dwc3 driver uses the dwc3 core, the quirk must be handled here to fix USB support on the Amlogic libretech-cc and libretech-ac board when a device is only plugged in the OTG port. Cc: Yuri Frolov <crashing.kernel@gmail.com> Cc: Bin Meng <bmeng.cn@gmail.com> Fixes: dc9cdf859e ("usb: dwc3: Add DWC3 controller driver support") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-08-22usb: r8a66597: Add optional DM VBUS regulator supportMarek Vasut
Add DM regulator support for toggling VBUS, this is useful on boards which control the VBUS e.g. through GPIO. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Checkpatch cleanupMarek Vasut
Fix remaining checkpatch complaints in the driver. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Add Kconfig entryMarek Vasut
Add missing Kconfig entry for the R8A66597 driver. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Convert to USB DMMarek Vasut
Convert the R8A66597 USB driver to DM and add support for DT probing. Drop support for legacy non-DM and non-DT probing, since there are no platform using that. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Replace R8A66597_BASE0Marek Vasut
Replace R8A66597_BASE0 with proper SYSCFG0 accesses, no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Remove BE supportMarek Vasut
While the USB controller can work both in LE and BE modes, there is no user for the BE mode, so drop it. If there ever is a user for it, it can be easily re-added back. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Replace IO accessorsMarek Vasut
Replace in{bwl}()/out{bwl}() IO accessors with read{bwl}()/write{bwl}(), to make the driver compile both on SH and ARM. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Make CONFIG_RZA_USB defaultMarek Vasut
No other platforms use this r8a66597 controller but RZ/A1, make RZ/A1 support the default and drop all the other SoC support to remove ifdeffery. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-22usb: r8a66597: Remove CONFIG_SUPERH_ON_CHIP_R8A66597Marek Vasut
Remove CONFIG_SUPERH_ON_CHIP_R8A66597 macro, which is unused. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com>
2019-08-11env: Drop environment.h header file where not neededSimon Glass
This header file is now only used by files that access internal environment features. Drop it from various places where it is not needed. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_get() to env.hSimon Glass
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set() to env.hSimon Glass
Move env_set() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set_hex() to env.hSimon Glass
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>
2019-08-08usb: gadget: f_dfu.c: fix memory leakRalph Siemsen
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>
2019-08-08usb, ohci, pci: add DM support for PCI-based OHCI USB controllerHeiko Schocher
add new DM based PCI driver ohci-pci for PCI-based OHCI USB support. Signed-off-by: Heiko Schocher <hs@denx.de>
2019-08-08usb, ohci: add warning if none on pci foundHeiko Schocher
Signed-off-by: Heiko Schocher <hs@denx.de>
2019-08-08usb, ohci-hcd: set OHCI_USE_NPS if DM_PCIHeiko Schocher
set OHCI_USE_NPS if DM_PCI is enabled. Signed-off-by: Heiko Schocher <hs@denx.de>
2019-08-08usb, ohci: fix ohci swap register accessHeiko Schocher
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>
2019-08-08usb, ohci-hdc: fix warning 'ohci_pci_ids' defined but not usedHeiko Schocher
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>
2019-08-08usb: musb-new: Add support for da8xx-musbAdam Ford
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>
2019-07-19rockchip: xhci: Remove RK3399 supportMark Kettenis
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>
2019-07-19usb: xhci-dwc3: Add USB2 PHY configurationMark Kettenis
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>
2019-07-19usb: dwc3-of-simple: Add support for RK3399Mark Kettenis
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>
2019-07-13usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGETDerald D. Woods
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>
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>