summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
...
| * arm: mx6: usb: kconfig: add USB_EHCI_MX6 kconfig optionNikita Kiryanov2015-08-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Add USB_EHCI_MX6 option to menuconfig and use it when migrating cm-fx6 usb config to defconfig. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
* | ARM: Tegra210: Add support to common Tegra source/config filesTom Warren2015-07-281-1/+30
| | | | | | | | | | | | | | | | | | | | | | Derived from Tegra124, modified as appropriate during T210 board bringup. Cleaned up debug statements to conserve string space, too. This also adds misc 64-bit changes from Thierry Reding/Stephen Warren. Signed-off-by: Tom Warren <twarren@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini2015-07-251-20/+97
|\ \
| * | sunxi: musb: Stop treating not having a vbus-det gpio as an errorHans de Goede2015-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some boards the otg is wired up in host-only mode in this case we have no vbus-det gpio. Stop logging an error from sunxi_usb_phy_vbus_detect() in this case, and stop treating sunxi_usb_phy_vbus_detect() returning a negative errno, as if a charger is plugged into the otg port. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * | sunxi: musb: Improve output during probingHans de Goede2015-07-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we return an error the usb core will print an error-message, so in this case do not print anything. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Ian Campbell <ian.campbell@citrix.com>
| * | sunxi: musb: Use device-model for musb host modeHans de Goede2015-07-251-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify the sunxi musb glue to use the device-model for musb host mode. This allows using musb in host mode together with other host drivers such as ehci / ohci, which is esp. useful on boards which use the musb controller in host-only mode, these boards have e.g. an usb-a receptacle or an usb to sata converter attached to the musb controller. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * | sunxi: musb: Move musb config and platdata to the sunxi-musb glueHans de Goede2015-07-251-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the musb config and platdata to the sunxi-musb glue, which is where it really belongs. This is preparation patch for adding device-model support for the sunxi-musb-host code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * | sunxi: musb: Add id pin supportHans de Goede2015-07-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When in host mode check if there is a host cable inserted into the otg port by checking the id pin. If there is no host cable return an error to make usb_lowlevel_init() exit early, rather then waiting for 1 second for a device which will never show up. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
| * | sunxi: musb: Move vbus check to sunxi_musb_enableHans de Goede2015-07-251-10/+9
| | | | | | | | | | | | | | | | | | | | | This way it can be re-checked on "usb reset". Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | | Merge git://git.denx.de/u-boot-usbTom Rini2015-07-2414-285/+345
|\ \ \ | |/ / |/| |
| * | usb: ci_udc: fix request allocation when endpoints are disabledRob Herring2015-07-241-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ci_udc driver request allocation assumes that the endpoint descriptor pointer is set to retrieve the endpoint number, but that is only true when the endpoint is enabled. This results in a NULL ptr dereference which for me happens to return 0 value. This causes the EP0 request struct to be returned for other endpoints. Some gadget drivers like fastboot and USB MS work fine, but ethernet does not. Really, the ci_udc driver is the oddball here doing this EP0 special case handling Stephen added. All the other drivers alloc/free functions are pretty much the same with the only variation being the size of the private struct. This could all be consolidated to a common function. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Marek Vasut <marex@denx.de> Acked-by: Stephen Warren <swarren@nvidia.com>
| * | ci_udc: fix 64-bit compile warningsStephen Warren2015-07-231-9/+10
| | | | | | | | | | | | | | | | | | | | | This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more. Signed-off-by: Stephen Warren <swarren@nvidia.com>
| * | usb: ehci-marvell: Drop wrl accessor functionStefan Roese2015-07-221-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | This patch removes the wrl accessor function from the Marvell EHCI driver by replacing it with the writel function. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Marek Vasut <marex@denx.de>
| * | usb: CONFIG_USB_FASTBOOT prefix replacement for consistencyPaul Kocialkowski2015-07-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FASTBOOT is defined both by CONFIG_USB_FUNCTION_FASTBOOT AND CONFIG_CMD_FASTBOOT, so it doesn't make much sense to have a CONFIG_USB_FASTBOOT prefix for fastboot-specific options, especially given that other config options for fastboot use the CONFIG_FASTBOOT prefix. This replaces the CONFIG_USB_FASTBOOT prefix with CONFIG_FASTBOOT, for consistency. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
| * | implement Fastboot via USB OTG on bcm28155_ap boardsJiandong Zheng2015-07-221-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Jiandong Zheng <jdzheng@broadcom.com> Signed-off-by: Steve Rae <srae@broadcom.com>
| * | usb: gadget: bcm_udc_otg filesJiandong Zheng2015-07-222-0/+73
| | | | | | | | | | | | | | | | | | | | | Add the required files for the Broadcom UDC OTG interface. Signed-off-by: Jiandong Zheng <jdzheng@broadcom.com> Signed-off-by: Steve Rae <srae@broadcom.com>
| * | usb: gadget: fastboot: Dequeue the previous IN request for the current requestPaul Kocialkowski2015-07-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent versions of the fastboot tool will query the partition type before doing an operation on a partition (such as erase, flash, etc). It will then submit the operation as soon as the response for the partition type is received. Usually, the MUSB controller will see that the partition type request return status was read by the host at the very same time as the actual operation request is submitted by the host. However, the operation will be read first (int_rx is handled first in musb_interrupt) and after it is completed, the fastboot USB gadget driver will send another return status. Hence, this happens before the musb gadget framework has had a chance to handle the previous acknowledgement that the host read the return status and dequeue the request. The host will then usually empty the FIFO by the time musb_interrupt gets around handling the return status acknowledgement (for the previous request, this is still on the same musb_interrupt call), so no other interrupt is generated and the most recent return status acknowledgement remains unaccounted for. It will then be used as a response for the next command, and the proper response for it will be delayed to the next command, and so on. Dequeuing the previous IN request in the fastboot code ensures that no previous return status remains. It is acceptable to do it since there is no callback to it anyways. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
| * | usb: gadget: fastboot: Request status and length check in rx handlerPaul Kocialkowski2015-07-221-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids handling requests that have an error status or no data. In particular, this avoids showing unnecessary error messages when the USB gadget gets disconnected (e.g. with fastboot continue) and the fastboot USB gadget driver sends an error back to the host (that has disconnected already). Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
| * | usb: gadget: Weak board_usb_init/cleanup definitions in USB download gadget codePaul Kocialkowski2015-07-221-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Weak versions of board_usb_init and board_usb_cleanup are defined in common USB host code, but it is also used for USB device gadgets, so we also need a weak definition of it when there is no USB host enabled. Both weak definitions do not conflict. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
| * | usb: Fastboot function config for better consistency with other functionsPaul Kocialkowski2015-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB download gadget functions such as thor and dfu have a separate config option for the USB gadget part of the code, independent from the command part. This switches the fastboot USB gadget to the same scheme, for better consistency. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
| * | usb: USB download gadget and functions config options coherent namingPaul Kocialkowski2015-07-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a coherent scheme for naming USB download gadget and functions config options. The download USB gadget config option is moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other gadgets and each function's config option is moved to a CONFIG_USB_FUNCTION_ prefix. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
| * | drivers: usb: fsl: Remove LS102XA immap inclusionNikhil Badola2015-07-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove LS102XA immap header inclusion from xhci fsl driver. It removes redefinition warnings when built for platforms other than LS102XA Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
| * | drivers: usb: fsl: Implement Erratum A-009116 for XHCI controllerNikhil Badola2015-07-222-0/+9
| | | | | | | | | | | | | | | | | | | | | This adjusts (micro)frame length to appropriate value thus avoiding USB devices to time out over a longer run Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
| * | drivers: usb: fsl: Remove warnings for 64-bit architecturesNikhil Badola2015-07-221-4/+4
| | | | | | | | | | | | | | | | | | | | | Replace uint32_t with uintptr_t to remove compilation warnings for 64-bit architectures. Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
| * | usb: fsl: Add XHCI driver supportRamneek Mehresh2015-07-222-0/+110
| | | | | | | | | | | | | | | | | | Add xhci driver support for all FSL socs Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
| * | usb: xhci: keystone: Remove common dwc3 drv functions callsRamneek Mehresh2015-07-221-88/+0
| | | | | | | | | | | | | | | | | | | | | Remove all redundant dwc3 driver function calls that are defined by dwc3 driver Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
| * | usb: xhci: omap: Remove common dwc3 drv functions callsRamneek Mehresh2015-07-222-78/+0
| | | | | | | | | | | | | | | | | | | | | Remove all redundant dwc3 driver function calls that are defined by dwc3 driver Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
| * | usb: xhci: exynos: Remove common dwc3 drv functions callsRamneek Mehresh2015-07-221-78/+0
| | | | | | | | | | | | | | | | | | | | | Remove all redundant dwc3 driver function calls that are defined by dwc3 driver Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
| * | usb: dwc3: Add DWC3 controller driver supportRamneek Mehresh2015-07-222-0/+92
| |/ | | | | | | | | | | Add support for DWC3 XHCI controller driver Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
* | linux_compat: remove cpu_relax() defineMasahiro Yamada2015-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro cpu_relax() is defined by several headers in different ways. arch/{arm,avr32,mips}/include/asm/processor.h defines it as follows: #define cpu_relax() barrier() On the other hand, include/linux/compat.h defines it as follows: #define cpu_relax() do {} while (0) If both headers are included from the same source file, the warning warning: "cpu_relax" redefined [enabled by default] is displayed. It effectively makes it impossible to include <linux/compat.h> from some sources. Drop the latter. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* | dm: usb: eth: Add driver-model support to the asix driverSimon Glass2015-07-211-21/+216
| | | | | | | | | | | | | | | | This USB Ethernet driver is quite widely use. Allow it to work with CONFIG_DM_ETH enabled. Most of the code remains common but there is a new packet receive flow which is handled specially. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Add driver-model support to ehci-pciSimon Glass2015-07-211-20/+77
| | | | | | | | | | | | | | | | | | Support driver model in this driver. This uses the normal USB driver search mechanism. Any EHCI controllers will be set up as they are found during usb_init(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* | dm: usb: Adjust the USB_DEVICE() macro namingSimon Glass2015-07-212-4/+4
| | | | | | | | | | | | | | | | | | In Linux USB_DEVICE() is used to declare a USB device by vendor/device ID. We should follow the same convention in U-Boot. Rename the existing USB_DEVICE() macro to U_BOOT_USB_DEVICE() and bring in the USB_DEVICE() macro from Linux for use in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: usb: eth: Support driver model with USB EthernetSimon Glass2015-07-211-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | At present USB Ethernet does not work with CONFIG_DM_ETH. Add driver model support to this feature, so that it can work alongside other Ethernet devices with driver model. It was found that quite a bit of code is common in most of the USB Ethernet drivers. Add this code to the common layer to reduce the amount of duplicate code needed in USB Ethernet drivers when CONFIG_DM_ETH is used. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: Update some EHCI driver licenses to use SPDXSimon Glass2015-07-215-68/+5
| | | | | | | | | | | | | | A few drivers still write out the license in full. Fix these. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
* | usb: ehci: Correct a missing hypen in an error messageSimon Glass2015-07-211-1/+1
| | | | | | | | | | | | Add a hyphen to correct the grammar. Signed-off-by: Simon Glass <sjg@chromium.org>
* | musb: Add device-model support to the musb-host u-boot glueHans de Goede2015-07-212-1/+73
| | | | | | | | | | | | | | | | | | Add device-model support to the musb-host u-boot glue, note this only adds device-model support to the musb-core glue code, it does not add support for device-model to any of the SoC specific musb glue code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | musb: Add musb_host_data struct to hold global dataHans de Goede2015-07-212-54/+77
| | | | | | | | | | | | | | | | Add a musb_host_data struct to hold all the global data host related musb data. This is a preparation patch for adding device-model support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | musb: Rename and wrap public functionsHans de Goede2015-07-211-11/+59
| | | | | | | | | | | | | | | | Rename and wrap the usb host API public functions, this is a preparation patch for adding device-model support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | musb: Update usb-compat to work with struct usb_device without a parent ptrHans de Goede2015-07-213-1/+75
| | | | | | | | | | | | | | | | When building with CONFIG_DM_USB=y struct usb_device does not have a parent pointer. This commit adds support to the musb code to deal with this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | musb: Allow musb_platform_enable to return an error codeHans de Goede2015-07-217-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow musb_platform_enable to return an error code and propagate it up to usb_lowlevel_init(). This allows moving the checks for an external vbus being present to be moved from platform_init to platform_enable, so that the user can unplug a charger, plug in a host adapter with a usb-device, do a "usb reset" and have things working. This also allows adding a check for the id-pin to platform_enable, so that it can short circuit the 1s delay in usb_lowlevel_init() when no host cable is plugged in and thus waiting for a device to show up is useless. Note that all the changes to code shared with the kernel are wrapped in the kernel. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Do not assume that first child is always a hubHans de Goede2015-07-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | On some single port (otg) controllers there is no emulated root hub, so the first child (if any) may be one of: UCLASS_MASS_STORAGE, UCLASS_USB_DEV_GENERIC or UCLASS_USB_HUB. All three of these (and in the future others) are suitable for our purposes, remove the check for the device being a hub, and add a check to deal with the fact that there may be no child-dev. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Allow usb host drivers to implement usb_reset_root_portHans de Goede2015-07-211-5/+11
| | | | | | | | | | | | | | | | | | Allow usb uclass host drivers to implement usb_reset_root_port, this is used by single port usb hosts which do not emulate a hub, such as otg controllers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Rename usb_find_child to usb_find_emul_childHans de Goede2015-07-211-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we unbind usb devices from usb_stop() usb_find_child() is only necessary to deal with emulated usb devices. Rename it to make this clear and add a #ifdef to make it a nop in other cases. Note the #ifdef turns usb_find_emul_child() into a nop, rather then not building it and adding another #ifdef to the caller, this is done this way because adding a #ifdef to the caller is somewhat hairy. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Use device_unbind_children to clean up usb devs on stopHans de Goede2015-07-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On an usb stop instead of leaving orphan usb devices behind simply remove them. The result of this commit is best seen in the output of "dm tree" after plugging out an usb hub with 2 devices plugges in and plugging in a keyb. instead, before this commit the output would be: usb [ + ] `-- sunxi-musb usb_hub [ ] |-- usb_hub usb_mass_st [ ] | |-- usb_mass_storage usb_dev_gen [ ] | `-- generic_bus_0_dev_3 usb_dev_gen [ + ] `-- generic_bus_0_dev_1 Notice the non active usb_hub child and its 2 non active children. The first child being non-active as in this example also causes usb_get_dev_index to return NULL when probing the first child, which results in the usb kbd code not binding to the keyboard. With this commit in place the output after swapping and "usb reset" is: usb [ + ] `-- sunxi-musb usb_dev_gen [ + ] `-- generic_bus_0_dev_1 As expected, and usb_get_dev_index works properly and the keyboard works. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | usb: Add an usb_device parameter to usb_reset_root_portHans de Goede2015-07-212-3/+3
| | | | | | | | | | | | | | | | | | | | | | Add an usb_device parameter to usb_reset_root_port so that it knows which root-port it is resetting. This is necessary for proper device-model support for usb_reset_root_port. Also remove a duplicate declaration of usb_reset_root_port() from usb.h . Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | usb: usb_setup_device: Drop unneeded portnr function argumentHans de Goede2015-07-211-1/+1
| | | | | | | | | | | | | | | | Drop the unneeded portnr function argument, the portnr is part of the usb_device struct which is passed via the dev argument. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* | usb: Drop device-model specific copy of usb_legacy_port_resetHans de Goede2015-07-211-29/+0
|/ | | | | | | | | | | | | | | The device-model usb_legacy_port_reset function calls the device-model usb_port_reset function which is a 1 on 1 copy of the non dm usb_legacy_port_reset and this is the only use of usb_port_reset in all of u-boot. Drop both, and alway use the usb_legacy_port_reset() version in common/usb.c . Also while at it make it static as it is only used in common/usb.c . Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* usb: Add EHCI support for Armada 38x (mvebu)Stefan Roese2015-07-101-0/+36
| | | | | | | | | | | This patch adds USB EHCI host support for the common mvebu platform. Including the Armada 38x. Tested on DB-88F6280-GP eval board. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Marek Vasut <marex@denx.de> Cc: Luka Perkov <luka.perkov@sartura.hr>
* usb: ehci: Properly deal with data toggle for interrupt endpointsHans de Goede2015-06-191-7/+19
| | | | | | | | | | | | | Without this we loose every other interrupt packet. We never noticed this because with keyboards the packets which we were loosing would normally be key release packets. But now that we do keyrepeat in software instead of relying on the hid idle functionality, missing a release will result in key repeat triggering. This commit fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
OpenPOWER on IntegriCloud