summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2014-09-24cosmetic: replace MIN, MAX with min, maxMasahiro Yamada
The macro MIN, MAX is defined as the aliase of min, max, respectively. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-24kconfig: add blank Kconfig filesMasahiro Yamada
This would be useful to start moving various config options. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2014-09-24usb/gadget: fastboot: minor cleanupSteve Rae
- update static function - additional debugging statements - update "fastboot command" information - add missing include file - update spelling Signed-off-by: Steve Rae <srae@broadcom.com>
2014-09-24usb/gadget: fastboot: add support for flash commandSteve Rae
- implement 'fastboot flash' for eMMC devices Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Marek Vasut <marex@denx.de>
2014-09-18USB: ehci-atmel: use pcr to enable or disable clockBo Shen
If the SoC has pcr, we use pcr (peripheral control register) to enable or disable clock. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-09-18USB: ohci-at91: use pcr to enable or disable clockBo Shen
If the SoC has pcr, we use pcr (peripheral control register) to enable or disable clock. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-09-16net: usb: Add SMSC copyright to smsc95xx driverSimon Glass
This driver was upstreamed without an SMSC copyright, even thought it seems that SMSC was the original author. See the kernel version for a code comparison: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f7ca802bdae2ca41022618391c70c2876d92190 It's not clear who actually moved this code, or whether the kernel was the original source, or somewhere else, but it probably should still have the SMSC copyright. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-16kbuild: force to define __UBOOT__ in all the C sourcesMasahiro Yamada
U-Boot has imported various source files from other projects, mostly Linux. Something like #ifdef __UBOOT__ [ modification for U-Boot ] #else [ original code ] #endif is an often used strategy for clarification of adjusted parts, that is, easier re-sync in future. Instead of defining __UBOOT__ in each source file, passing it from the top Makefile would be easier. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
2014-09-02USB: gadget: s3c: get rid of debug compile warningBo Shen
When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<--- Signed-off-by: Bo Shen <voice.shen@atmel.com>
2014-09-02USB: gadget: atmel: get rid of debug compile warningBo Shen
When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<--- Signed-off-by: Bo Shen <voice.shen@atmel.com>
2014-09-02usb: ci_udc: implement dfu_usb_get_resetStephen Warren
This allows the USB code to determine whether a USB bus reset was issued, which in turn allows the code to differentiate between a detach (return to shell prompt) and a board reset/reboot request. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-09-02udc: dfu: s3c_udc: Provide function to check if USB reset was assertedLukasz Majewski
New dfu_usb_get_reset() method is necessary to distinct two different use cases of dfu-util program. This method checks if the USB bus reset has been really performed after DFU DETACH. Without this function the previous DFU behavior is preserved. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
2014-09-02dfu: Provide means to find difference between dfu-util -e and -RLukasz Majewski
This commit provides distinction between DFU device detach and reset. The -R behavior is preserved with proper handling of the dfu-util's -e switch, which detach the DFU device. By running dfu-util -e; one can force device to finish the execution of dfu command on target and execute some other scripted commands. Moreover, some naming has been changed - the dfu_reset() method now is known as dfu_detach(). New name better reflects the purpose of the code. It was also necessary to increase the number of usb_gadget_handle_interrupts() calls since we also must wait for detection of the USB reset event. Example usage: 1. -e (detach) switch dfu-util -a0 -D file1.bin;dfu-util -a3 -D uImage;dfu-util -e access to u-boot prompt. 2. -R (reset) switch dfu-util -a0 -D file1.bin;dfu-util -R -a3 -D uImage target board reset Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2014-08-28Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
2014-08-25lib, linux: move linux specific defines to linux/compat.hHeiko Schocher
- move linux specific defines from usb and video code into linux/compat.h - move common linux specific defines from include/ubi_uboot.h to linux/compat.h - add for new mtd/ubi/ubifs sync new needed linux specific defines to linux/compat.h Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Marek Vasut <marex@denx.de> Cc: Anatolij Gustschin <agust@denx.de> [trini: Add spin_lock_irqsave/spin_unlock_irqrestore dummies from usb/lin_gadet_compat.h] Signed-off-by: Tom Rini <trini@ti.com>
2014-08-21omap: remove omap5912osk board supportMasahiro Yamada
Emails to the board maintainer "Rishi Bhattacharya <rishi@ti.com>" have been bouncing. Tom suggested to remove this board. Remove also omap1510_udc.c because this is the last board to enable it. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Suggested-by: Tom Rini <trini@ti.com>
2014-08-09omap: clean-up dead configsMasahiro Yamada
The following configs are not defined at all. - CONFIG_OMAP1510 - CONFIG_OMAP_1510P1 - CONFIG_OMAP_SX1 - CONFIG_OMAP3_DMA - CONFIG_OMAP3_ZOOM2 - CONFIG_OMAP_INNOVATOR Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com>
2014-08-09usb: ehci: rmobile: Remove xHCI addressNobuhiro Iwamatsu
echi-rmobile does not support xHCI. This removes xHCI address from address table. And this revise a value of CONFIG_USB_MAX_CONTROLLER_COUNT for lager board and koelsh board. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-08-09usb: ehci: rmobile: Add support R8A7794Nobuhiro Iwamatsu
R8A7794 has same IP of USB controller as R8A7790 and R8A7791. This addes support for R8A7794. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-08-09dfu: allow backend to specify a maximum buffer sizeStephen Warren
CONFIG_SYS_DFU_DATA_BUF_SIZE may be large to allow for FAT/ext layouts to transfer large files. However, this means that individual write operations will take a long time. Allow backends to specify a maximum buffer size, so that each write operation is limited to a smaller data block. This prevents the DFU protocol from timing out when e.g. writing to SPI flash. I would guess that NAND might benefit from setting this value too, but I can't test that. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-08-09dfu: add write error handlingStephen Warren
Fix calls to dfu_write() and dfu_flush() to detect errors in the I/O itself. This could happen due to problems with the storage medium, or simply when trying to write a FAT/ext file that is larger than the buffer dfu_mmc.c maintains for this purpose. Signal the error by switching the DFU state/status. This will be picked up by the DFU client when it sends the next DFU request. Note that errors can't simply be returned from e.g. dnload_request_complete(), since that function has no way to pass errors back to the DFU client; a call to dnload_request_complete() simply means that a USB OUT completed. This error state/status needs to be cleared when the next DFU client connects. While there is a DFU_CLRSTATUS request, no DFU client seems to send this. Hence, clear this when selecting the USB alternate setting on the USB interface. Finally, dfu.c relies on a call to dfu_flush() to clear up the internal state of the write transaction. Now that errors in dfu_write() are detected, dfu_flush() may no longer be called for every transaction. Separate out the cleanup code into a new function, and call it whenever dfu_write() fails, as well as from any call to dfu_flush(). Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-31sunxi: add USB EHCI driverRoman Byshko
The Allwinner aka sunxi SoCs have one or more USB host controllers. This adds a driver for their EHCI. Signed-off-by: Roman Byshko <rbyshko@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-07-22driver/usb: include upper/lower_32_bits() from linux/compat.hLijun Pan
upper_32_bits() and lower_32_bits() have been ported into linux/compat.h. Start use them now in drivers/usb/host/xhci.h. Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
2014-07-09usb: phy: omap_usb_phy: implement usb_phy_power() for AM437xFelipe Balbi
Newer AM437x silicon requires us to explicitly power up the USB2 PHY. By implementing usb_phy_power() we can achieve that. Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-07-09usb: host: xhci: make sure to power up PHYFelipe Balbi
some boards won't work if the PHY isn't explicitly powered up. Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-07-04arm: ep9315: Return back Cirrus Logic EDB9315A board supportSergey Kostanbaev
This patch returns back support for old ep93xx processors family Signed-off-by: Sergey Kostanbaev <sergey.kostanbaev@gmail.com> Cc: albert.u.boot@aribaud.net
2014-07-02usb: ci_udc: use var name ep/ci_ep consistentlyStephen Warren
Almost all of ci_udc.c uses variable name "ep" for a struct usb_ep and "ci_ep" for a struct ci_ep. This is nice and consistent, and helps people know what type a variable is without searching for the declaration. handle_ep_complete() doesn't do this, so fix it to be consistent. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02USB: gadget: atmel: zero out allocated requestsStephen Warren
A UDC's alloc_request method should zero out the newly allocated request. Ensure the Atmel driver does so. This issue was found by code inspection, following the investigation of an intermittent issue with ci_udc, which was tracked down to failing to zero out allocated requests following some of my changes. All other UDC drivers already zero out requests in one way or another. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: don't memalign() struct ci_req allocationsStephen Warren
struct ci_req is a purely software structure, and needs no specific memory alignment. Hence, allocate it with calloc() rather than memalign(). The use of memalign() was left-over from when struct ci_req was going to hold the aligned bounce buffer, but this is now dynamically allocated. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: remove controller.items arrayStephen Warren
There's no need to store an array of QTD pointers in the controller. Since the calculation is so simple, just have ci_get_qtd() perform it at run-time, rather than pre-calculating everything. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: fix items array size/stride calculationStephen Warren
2 QTDs are allocated for each EP. The current allocation scheme aligns the first QTD in each pair, but simply adds the struct size to calculate the second QTD's address. This will result in a non-cache-aligned addresss IF the system's ARCH_DMA_MINALIGN is not 32 bytes (i.e. the size of struct ept_queue_item). Similarly, the original ilist_ent_sz calculation aligned the value to ARCH_DMA_MINALIGN but didn't take the USB HW's 32-byte alignment requirement into account. This doesn't cause a practical issue unless ARCH_DMA_MINALIGN < 32 (which I suspect is quite unlikely), but we may as well fix the code to be explicit, so it's obviously completely correct. The new value of ILIST_ENT_SZ takes all alignment requirements into account, so we can simplify ci_{flush,invalidate}_qtd() by simply using that macro rather than calling roundup(). Similarly, the calculation of controller.items[i] can be simplified, since each QTD is evenly spaced at its individual alignment requirement, rather than each pair being aligned, and entries within the pair being spaced apart only by structure size. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: lift ilist size calculations to global scopeStephen Warren
This will allow functions other than ci_udc_probe() to make use of the constants in a future change. This in turn requires converting the const int variables to #defines, since the initialization of one global const int can't depend on the value of another const int; the compiler thinks it's non-constant if that dependency exists. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: don't assume QTDs are adjacent when transmitting ZLPsStephen Warren
Fix ci_ep_submit_next_request()'s ZLP transmission code to explicitly call ci_get_qtd() to find the address of the other QTD to use. This will allow us to correctly align each QTD individually in the future, which may involve leaving a gap between the QTDs. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: fix ci_flush_{qh,qtd} calls in ci_udc_probe()Stephen Warren
ci_udc_probe() initializes a pair of QHs and QTDs for each EP. After each pair has been initialized, the pair is cache-flushed. The conversion from QH/QTD index [0..2*NUM_END_POINTS) to EP index [0..NUM_ENDPOINTS] is incorrect; it simply subtracts 1 (which yields the QH/QTD index of the first entry in the pair) rather than dividing by two (which scales the range). Fix this. On my system, this avoids cache debug prints due to requests to flush unaligned ranges. This is caused because the flush calls happen before the items[] array entries are initialized for all but EP0. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-25usb: eth: smsc95xx: add LAN9500A device IDIlya Ledvich
Add LAN9500A product ID (0x9e00) in order to support LAN9500A based dongles. Tested on cm_t335. Signed-off-by: Ilya Ledvich <ilya@compulab.co.il> Acked-by: Marek Vasut <marex@denx.de>
2014-06-25usb: fastboot: fix potential buffer overflowJeroen Hofstee
cb_getvar tries to prevent overflowing the response buffer by using strncat. But strncat takes the number of data bytes copied as a limit not the total buffer length so it can still overflow. Pass the correct value instead. cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cc: Rob Herring <robh@kernel.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-25usb: xhci: (likely) fix bracket in if conditionJeroen Hofstee
Because of the brackets the & and && is evaluated before the comparison. This is likely not the intention. Change it to test the first and second condition to both be true. cc: Marek Vasut <marex@denx.de> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-25usb:g_dnl:f_thor: remove memset before memcpyJeroen Hofstee
since ALLOC_CACHE_ALIGN_BUFFER defines a pointer and not a buffer, the memset with sizeof(rqt) likely does something else then intended. Since there is a memcpy directly after it with the full size, drop the memset completely. Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2014-06-25usb:composite: clear the whole common bufferJeroen Hofstee
Since the struct fsg_common is calloced, reset it completely with zero's when reused. While at it, make checkpatch happy. cc: Lukasz Majewski <l.majewski@samsung.com> cc: Piotr Wilczek <p.wilczek@samsung.com> cc: Kyungmin Park <kyungmin.park@samsung.com> cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2014-06-25usb: r8a66597: Fix initilization size of r8a66597 info structureYasuhisa Umano
Initialization of r8a66597 info structure is not enough. Because initilization was used size of pointer. This fixes that use size of r8a6659 info structure. Signed-off-by: Yasuhisa Umano <yasuhisa.umano.zc@renesas.com>
2014-06-25usb: r8a66597: Fix initialization hub that using R8A66597_MAX_ROOT_HUByasuhisa umano
This driver is processed as two USB hub despite one. The number of root hub is defined in R8A66597_MAX_ROOT_HUB. This fixes that register is accessed by using the definition of R8A66597_MAX_ROOT_HUB. Signed-off-by: Yasuhisa Umano <yasuhisa.umano.zc@renesas.com>
2014-06-25usb: cosmetic: double constJeroen Hofstee
For plain array const can be either before or after the type definition. Adding both is simply redundand. Remove the later one. cc: marex@denx.de Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-25usb: ci_udc: fix typo in debug messageStephen Warren
s/ot/to/ Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-25usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDCStephen Warren
ci_udc.c's usb_gadget_unregister_driver() doesn't call driver->unbind() unlike other USB gadget drivers. Fix it to do this. Without this, when ether.c's CDC Ethernet device is torn down, eth_unbind() is never called, so dev->gadget is never set to NULL. For some reason, usb_eth_halt() is called both at the end of the first use of the Ethernet device, and prior to any subsequent use. Since dev->gadget is never cleared, all calls to usb_eth_halt() attempt to stop, disconnect, and clean up the device, resulting in double cleanup, which hangs U-Boot on my Tegra device at least. ci_udc allocates its own singleton EP0 request object, and cleans it up during usb_gadget_unregister_driver(). This appears necessary when using the USB gadget framework in U-Boot, since that does not allocate/free the EP0 request. However, the CDC Ethernet driver *does* allocate and free its own EP0 requests. Consequently, we must protect ci_ep_free_request() against double-freeing the request. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-11usb: ci_udc: terminate ep0 INs with a zlp when requiredStephen Warren
Sometimes, a zero-length packet is required at the end of an IN transaction so that the host knows the device is done sending data. Enhance ci_udc to send a zlp when necessary. See the comments for more details. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-11usb: ci_udc: clean up all allocations in unregisterStephen Warren
usb_gadget_unregister_driver() is called to tear down the USB device mode stack. Fix the driver to stop the USB HW (which causes any attached host to notice the disappearance of the device), and free all allocations (which obviously prevents memory leaks). Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-11usb: ci_udc: fix probe error cleanupStephen Warren
If allocation of the ep0 req fails, clean up all the allocations that were made in ci_udc_probe(). Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-11usb: ci_udc: fix freeing of ep0 reqStephen Warren
ci_ep_alloc_request() avoids allocating multiple request objects for ep0 by keeping a record of the first req allocated for ep0, and always returning that instead of allocating a new req. However, if this req is ever freed, the record of the previous allocation is not cleared, so ci_ep_alloc_request() will keep returning this stale pointer. Fix ci_ep_free_request() to clear the record of the previous allocation. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-11usb: ci_udc: call udc_disconnect() from ci_pullup()Stephen Warren
ci_pullup()'s !is_on path contains a cut/paste copy of udc_disconnect(). Remove the duplication by simply calling udc_disconnect() instead. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-01usb: ci_udc: complete ep0 direction handlingStephen Warren
handle_setup() currently assumes that the response to a Setup transaction will be an OUT transaction, and any subsequent packet (if any) will be an IN transaction. This appears to be valid in many cases; both USB enumeration and Mass Storage work OK with this restriction. However, DFU uses ep0 to transfer data in both directions. This renders the assumption invalid; when sending data from device to host, the Data Stage is an IN transaction, and the Status Stage is an OUT transaction. Enhance handle_setup() to deduce the correct direction for the USB transactions based on Setup transaction data. ep0's request object only needs to be automatically re-queued when the Data Stage completes, in order to implement the Status Stage. Once the Status Stage transaction is complete, there is no need to re-queue the USB request, so don't do that. Don't sent USB request completion callbacks for Status Stage transactions. These were queued by ci_udc itself, and only serve to confuse the USB function code. For example, f_dfu attempts to interpret the 0-length data buffers for Status Stage transactions as DFU packets. These buffers contain stale data from the previous transaction. This causes f_dfu to complain about a sequence number mismatch. Signed-off-by: Stephen Warren <swarren@nvidia.com>