summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* sunxi: musb: Remove unused sunxi_musb_exit methodHans de Goede2015-06-171-34/+0
| | | | | | | | | Remove the unused sunxi_musb_exit method, there is no code in u-boot calling the exit method, and our implementation was broken as it did not disable the clocks and asserted reset. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: musb: Do not fully reset the controler from sunxi_musb_disableHans de Goede2015-06-171-21/+31
| | | | | | | | | | | | | | Fully resetting the controller is a too big hammer, and the musb_core will then afterwards fail to communicate with any endpoints other then 0 as too much state was cleared. Instead report vbus low for 200ms which will effectively end the current session without needing to do a full reset. This fixes usb mass-storage devices no longer working after a "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-06-154-2/+81
|\
| * usb: f_mass_storage: sleep_thread: decrease the interval for check ctrlc()Inha Song2015-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This change decreases the interval of calls to: - display busy indicator - check ctrlc() - check cable connection By this change, breaking the UMS command is more easy on Odroid XU3. Signed-off-by: Inha Song <ideal.song@samsung.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
| * samsung: usb: phy: Support for DWC3 PHYLukasz Majewski2015-06-082-0/+79
| | | | | | | | | | | | | | | | | | | | | | New files, namely samsung_usb_phy.c and samsung-usb-phy-uboot.h have been added to u-boot to provide proper PHY handling at Exynos5 SoCs. This code is used thereafter in the board_usb_init() call. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Marek Vasut <marex@denx.de>
| * drivers: usb: fsl: Return if USB_MAX_CONTROLLER_COUNT is incorrectNikhil Badola2015-06-071-1/+1
| | | | | | | | | | | | | | Return if USB_MAX_CONTROLLER_COUNT hence the index of the controller to be initialised is incorrect Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
* | dm: usb: tegra: Drop legacy USB codeSimon Glass2015-06-101-150/+0
| | | | | | | | | | | | Drop the code that doesn't use driver model for USB. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Implement usb_detect_change() for driver modelSimon Glass2015-06-101-0/+43
| | | | | | | | | | | | Support this function with driver model also (CONFIG_DM_USB). Signed-off-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2015-06-081-0/+8
|\ \ | |/ |/|
| * usb: ehci-vf: Add weak function for board specific initialisationSanchayan Maity2015-06-081-0/+8
| | | | | | | | | | | | | | Add a weak function board_ehci_hcd_init which can be used by the board file for board specific initialisation. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-uniphierTom Rini2015-05-303-13/+8
|\ \
| * | ARM: UniPhier: update the vendor name of UniPhier in KconfigMasahiro Yamada2015-05-311-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The business for UniPhier Soc family has been transferred from Panasonic Corporation to Socionext Inc. Update the SoC select menu in Kconfig. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
| * | ARM: UniPhier: replace <asm/io.h> with <linux/io.h>Masahiro Yamada2015-05-312-7/+4
| |/ | | | | | | | | | | | | In the Linux coding style, it is recommended to include <linux/io.h> rather than <asm/io.h>. Follow this trend. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* | usb: dwc2: Add support for v3 snpsid valuePeter Griffin2015-05-292-1/+3
| | | | | | | | | | | | | | | | This has been tested to the extent that I can enumerate a asix usb networking adapter and boot a kernel over usb on the 96boards hikey u-boot port I'm currently doing. Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
* | ci_udc: Update the ci_udc driver to support bulk transfersSiva Durga Prasad Paladugu2015-05-292-19/+117
|/ | | | | | | | | Update the ci_udc driver to support bulk transfer and also added capability of having multiple dtds if requested data is more than 16K. These changes are tested for both the DFU and lthor. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
* usb: ohci: Add support for interrupt queuesHans de Goede2015-05-141-0/+132
| | | | | | | | Add support for interrupt queues to the ohci hcd code, bringing it inline with the ehci and musb-new(host) code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de>
* usb: ohci: Add an ohci_alloc_urb() functionHans de Goede2015-05-141-8/+23
| | | | | | | | Add an ohci_alloc_urb() function, this is a preparation patch for adding interrupt queue support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de>
* usb: ohci: Do not reuse ed for interrupt endpoints of different devicesHans de Goede2015-05-142-1/+38
| | | | | | | | | | | | | | | | | | | When submitting interrupt packets to an endpoint we only link in the ed once to avoid some races surrounding unlinking of periodic endpoints, but we share one ohci_device struct / one set of ed-s for all devices, which means that if we have an interrupt endpoint at endpoint 1 with one device, and a non interrupt endpoint 1 with another device we end up with the same ed linked into both the periodic and async lists, which is not good (tm). This commit switches over to using separate ohci_device structs, and thus separate ed-s for devices with interrupt endpoints, fixing this. This fixes e.g. matching a usb storage device and keyboard on the same usb-1 hub not working. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de>
* sunxi: ohci: Add ohci usb host controller supportHans de Goede2015-05-142-0/+105
| | | | | | | | | | | | | This commit adds support for the OHCI companion controller, which makes usb-1 devices directly plugged into to usb root port work. Note for now this switches usb-keyboard support for sunxi back from int-queue support to the old interrupt polling method. Adding int-queue support to the ohci code and switching back to int-queue support is in the works. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* sunxi: ehci: Convert to the driver-modelHans de Goede2015-05-141-29/+64
| | | | | | | | Convert sunxi-boards which use the sunxi-ehci code to the driver-model. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* usb: ohci: Add dm supportHans de Goede2015-05-142-0/+91
| | | | | | | Add driver-model support to the ohci code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de>
* usb: ohci: Skip unnecessary mdelay(1) calls in various placesHans de Goede2015-05-141-9/+20
| | | | | | | | | | | | | | | | | For some reason the ohci code is full with: #ifdef DEBUG pkt_print(...) #else mdelay(1); #endif AFAICT there is no reason for the mdelay(1) calls. This commit disables them when building the ohci code for new driver-model using boards. It leaves the mdelay(1) calls in place when building for older boards, so as to avoid causing any regressions there. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usb: ohci: Remove unnecessary delays from hc_start and power power-on pathsHans de Goede2015-05-141-4/+0
| | | | | | | | | | | | The usb spec says that we must wait a minimum amount of time after port power on (exact time is in the hub descriptor), this is something which we must not only do for root ports but also for external hub ports, which is why the common usb_hub code already waits a full second after powering up ports. Having a separate wait for just the root hub in the ohci-hcd code only leads to doing the waiting twice for the root ports, so drop the wait from the ohci-hcd code. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usb: ohci: Do not resubmit and leak urbs for interrupt packetsHans de Goede2015-05-141-39/+2
| | | | | | | | | | | The u-boot usb code uses polling for all endpoints, including interrupt endpoints, so urbs should never be automatically resubmitted. This also fixes a leak of the urb, as submit_int_msg() did not check if an already re-submitted urb exists before creating a new one. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* dm: usb: Do not scan companion buses if no devices where handed overHans de Goede2015-05-141-8/+34
| | | | | | | | | | | | USB scanning is slow, and there is no need to scan the companion buses if no usb devices where handed over to the companinon controllers by any of the main controllers. This saves e.g. 2 seconds when booting a A10 OLinuxIno Lime with no USB-1 devices plugged into the root usb ports. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Add support for companion controllersHans de Goede2015-05-141-5/+28
| | | | | | | | | | | | | | USB companion controllers must be scanned after the main controller has been scanned, so that any devices which the main controller which to hand over to the companion have actually been handed over before we scan the companion. As there are no guarantees that this will magically happen in the right order, split the scanning of the buses in 2 phases, first main controllers, and then companion controllers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Move printing of usb scan status to usb_scan_bus()Hans de Goede2015-05-141-13/+9
| | | | | | | | | | Move printing of usb scan status to usb_scan_bus(). This is a preparation patch for adding companion controller support to the usb uclass. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Add support for interrupt queues to the dm usb codeHans de Goede2015-05-142-0/+62
| | | | | | | | | | | | | | | Interrupt endpoints typically are polled for a long time by the usb controller before they return anything, so calls to submit_int_msg() can take a long time to complete this. To avoid this the u-boot code has the an interrupt queue mechanism / API, add support for this to the driver-model usb code and implement it for the dm ehci code. See the added doc comments for more details. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Prefix ehci interrupt-queue functions with _ehci_Hans de Goede2015-05-141-9/+28
| | | | | | | | This is a preparation patch for adding interrupt-queue support to the ehci dm code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* usb: Stop reset procedure when a dev is handed over to a companion hcdHans de Goede2015-05-141-1/+2
| | | | | | | | | | Short circuit the retry loop in legacy_hub_port_reset() by returning an error from usb_control_msg() when a device was handed over to a companion by the ehci code. This avoids trying to reset low / fullspeed devices 5 times needlessly. Also do not print an error when a device has been handed over. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usb: Fix handover of full-speed devices from ehci to companionHans de Goede2015-05-141-3/+13
| | | | | | | | When after a reset the port status connection bit is still set and the enable bit is not then we're dealing with a full-speed device and should hand it over to the companion controller. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* dm: usb: exynos: Drop legacy USB codeSimon Glass2015-05-062-225/+0
| | | | | | Drop the code that doesn't use driver model for USB. Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: ohci: Don't log an error on interrupt packet timeoutHans de Goede2015-05-061-1/+2
| | | | | | | Interrupts transfers timing out is normal, so do not log an error for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Add proper cache flushing / invalidating for non cache coherent cpusHans de Goede2015-05-062-5/+84
| | | | | | | | Add proper cache flushing / invalidating for non cache coherent cpus, for now only enable this for new (driver-model) usb code to avoid regressions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Marek Vasut <marex@denx.de>
* usb: ohci: Fix ctrl in messages with a data-len of 0Hans de Goede2015-05-061-1/+1
| | | | | | | Fix taken from the Linux kernel ohci driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Move static func and var declarations from ohci.h to ohci-hcd.cHans de Goede2015-05-062-93/+86
| | | | | | | Non static function and variable declarations do not belong in a .h file. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Remove unnecessary phcca variableHans de Goede2015-05-061-6/+3
| | | | | | | This is a preparation patch for adding driver-model support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Move the td array struct to inside the ohci_dev structHans de Goede2015-05-062-20/+9
| | | | | | | This is a preparation patch for adding driver-model support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Move the ohci_dev struct to inside the main ohci structHans de Goede2015-05-062-23/+19
| | | | | | | | | | | This is a preparation patch for adding driver-model support. Note we do keep ohci_dev as a separate struct so that we can later add support for interrupt-queues which requires allocating a separate ohci_dev per interrupt-queue. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Pass around a pointer to ohci_t rather then accessing global varsHans de Goede2015-05-061-60/+64
| | | | | | | This is a preparation patch for adding driver-model support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* usb: ohci: Remove unused devgone global variableHans de Goede2015-05-061-8/+0
| | | | | | | | devgone is never assigned a value, so the one comparisson reading it will never be true, and devgone can be completely removed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Marek Vasut <marex@denx.de>
* dm: usb: Set desc_before_addr from ehci dm codeHans de Goede2015-05-051-0/+3
| | | | | | | Without this usb-1 device descriptors do not get read properly. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Fix finding of first upstream usb-2 hub in the ehci dm codeHans de Goede2015-05-051-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | The ehci driver model code for finding the first upstream usb-2 hub before this commit has a number of issues: 1) "if (!ttdev->speed != USB_SPEED_HIGH)" does not work because the '!' takes presedence over the '!=' this should simply be "if (ttdev->speed == USB_SPEED_HIGH)" 2) It makes ttdev point to the first upstream usb-2 hub, but ttdev should point to the last usb-1 device before the first usb-2 hub (when going upstream from the device), as ttdev is used to find the port of the first usb-2 hub to which the the last usb-1 device is connected. 3) parent_devnum however should be set to the devnum of the first usb-2 hub, so we need to keep pointers around to both usb_device structs. To complicate things further during enumeration usb_device.dev will point to the parent udevice, where as during normal use it will point to the actual udevice, we must handle both cases correctly. This commit fixes all this making usb-1 devices attached to usb-2 hubs, including usb-1 devices attached to usb-1 hubs attached to usb-2 hubs, work. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Use usb_get_bus in dm ehci codeHans de Goede2015-05-051-8/+1
| | | | | | | Use usb_get_bus in dm ehci code rather then re-implementing it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Copy over usb_device values from usb_scan_device() to final usb_deviceHans de Goede2015-05-051-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we copy over a number of usb_device values stored in the on stack struct usb_device probed in usb_scan_device() to the final driver-model managed struct usb_device in usb_child_pre_probe() through usb_device_platdata, and then call usb_select_config() to fill in the rest. There are 3 problems with this approach: 1) It does not fill in enough fields before calling usb_select_config(), specifically it does not fill in ep0's maxpacketsize causing a div by zero exception in the ehci driver. 2) It unnecessarily redoes a number of usb requests making usb probing slower 3) Calling usb_select_config() a second time fails on some usb-1 devices plugged into usb-2 hubs, causing u-boot to not recognize these devices. This commit fixes these issues by removing (*) the usb_select_config() call from usb_child_pre_probe(), and instead of copying over things field by field through usb_device_platdata, store a pointer to the in stack usb_device (which is still valid when usb_child_pre_probe() gets called) and copy over the entire struct. *) Except for devices which are explictly instantiated through device-tree rather then discovered through usb_scan_device() such as emulated usb devices in the sandbox. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Make usb_get_bus easier to use for callersHans de Goede2015-05-051-13/+4
| | | | | | | | | | | Make usb_get_bus easier to use for callers, by directly returning the bus rather then returning it via a pass-by-ref argument. This also removes the error checking from the current callers, as we already have an assert() for bus not being NULL in usb_get_bus(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Do not use bus->seq before device_probe(bus)Hans de Goede2015-05-051-2/+1
| | | | | | | | | Do not use bus->seq before device_probe(bus), as bus->seq is not set until after the device_probe() call. This fixes u-boot printing: "USB-1: " for each bus it scans. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-mpc85xxTom Rini2015-05-051-0/+10
|\
OpenPOWER on IntegriCloud