summaryrefslogtreecommitdiff
path: root/drivers/usb/musb
Commit message (Collapse)AuthorAgeLines
* Fix spelling of "occurred".Vagrant Cascadian2016-05-02-3/+3
| | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Add more SPDX-License-Identifier tagsTom Rini2016-01-19-25/+1
| | | | | | | | | In a number of places we had wordings of the GPL (or LGPL in a few cases) license text that were split in such a way that it wasn't caught previously. Convert all of these to the correct SPDX-License-Identifier tag. Signed-off-by: Tom Rini <trini@konsulko.com>
* usb: musb-new: CONFIG_MUSB prefix replacement with CONFIG_USB_MUSBPaul Kocialkowski2015-08-05-11/+11
| | | | | | | | | USB-related options are usually prefixed with CONFIG_USB and platform-specific adaptation for the MUSB controller already have a CONFIG_USB_MUSB prefix, so this switches all MUSB-related options to a CONFIG_USB_MUSB prefix, for consistency. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* include: move various macros to include/linux/kernel.hMasahiro Yamada2014-11-20-3/+0
| | | | | | | | | | | | | | | | | | | | | | | U-Boot has imported various utility macros from Linux scattering them to various places without consistency. In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files. Moreover, we are suffering from too cluttered include/common.h. This commit moves various macros that originate in include/linux/kernel.h of Linux to their original position. Note: This commit simply moves the macros; the macros roundup, min, max, min2, max3, ARRAY_SIZE are different from those of Linux at this point. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* usb: create common header virtual root hub descriptorsStephen Warren2014-03-10-92/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication. Note that there were some very minor differences between the descriptors in the various files, such as: - USB 1.0 vs. USB 1.1 - Manufacturer/Device ID - Max packet size - String content I assume these aren't relevant. Cc: Thomas Lange <thomas@corelatus.se> Cc: Shinya Kuribayashi <skuribay@pobox.com> Cc: Gary Jennejohn <garyj@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Eric Millbrandt <emillbrandt@coldhaus.com> Cc: Pierre Aubert <p.aubert@staubli.com> Cc: Stefan Roese <sr@denx.de> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Denis Peter <d.peter@mpl.ch> Cc: Rodolfo Giometti <giometti@linux.it> Cc: Zhang Wei <wei.zhang@freescale.com> Cc: Mateusz Zalega <m.zalega@samsung.com> Cc: Remy Bohmer <linux@bohmer.net> Cc: Markus Klotzbuecher <mk@denx.de> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Gary Jennejohn <garyj@denx.de> Cc: C Nauman <cnauman@diagraph.com> Cc: David Müller <d.mueller@elsoft.ch> Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Thomas Abraham <t-abraham@ti.com> Cc: Tom Rini <trini@ti.com> Cc: Andrew Murray <amurray@embedded-bits.co.uk> Cc: Matej Frančeškin <matej.franceskin@comtrade.com> Cc: Cliff Cai <cliff.cai@analog.com> Cc: Bryan Wu <cooloney@gmail.com> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
* blackfin: Add <asm/clock.h> to numerous driversTom Rini2014-02-20-0/+1
| | | | | | | | | With d6a320d we moved some clock externs out of blackfin_local.h and into clock.h but now need to include <asm/clock.h> in more drivers to avoid warnings. Cc: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Tom Rini <trini@ti.com>
* drivers: usb: convert makefiles to Kbuild styleMasahiro Yamada2013-10-31-29/+7
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* usb: udc: add udc.h include fileTroy Kisky2013-10-20-1/+2
| | | | | | | Move common definitions to udc.h This allows musb_udc.h to be removed as well. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: add enum usb_init_type parameter to usb_lowlevel_initTroy Kisky2013-10-20-1/+1
| | | | | | This parameter will later be used to verify OTG ports. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: Prevent using reserved registers on DM36x usbAndrew Murray2013-10-10-5/+14
| | | | | | | | | | | | | | | | The musb driver defines and uses MUSB_CSR0_H_DIS_PING, however this bit is reserved on the DM36x. Thus this patch ensures that the reserved bit is not accesssed. It has been observed that some USB devices will fail to enumerate with errors such as 'error in inquiry' without this patch. See http://www.ti.com/litv/pdf/sprufh9a for details. Cc: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com> Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk> Acked-by: Marek Vasut <marex@denx.de>
* usb: Fix error handling in musb_hcd.cAndrew Murray2013-10-07-5/+5
| | | | | | | | | | | | | | | The wait_until_[rx|tx]ep_ready functions return a u8 to indicate success containing the value 0, 1 or -1. This patch changes the return type to an int to accommodate the negative return values. These functions are used in the file using calls such as if (!wait_until... Where a -1 is returned it is mishandled and treated as success instead of a CRC error. This patch addresses this. Cc: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com> Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk> Acked-by: Marek Vasut <marex@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-182/+14
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* usb: musb: Use ARRAY_SIZE at appropriate placesAxel Lin2013-06-26-4/+2
| | | | Signed-off-by: Axel Lin <axel.lin@ingics.com>
* ARM: OMAP4+: Cleanup header filesLokesh Vutla2013-06-10-1/+3
| | | | | | | After having the u-boot clean up series, there are many definitions that are unused in header files. Removing all those unused ones. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* usb: use linux/usb/ch9.h instead of usbdescriptors.hIlya Yanok2012-11-20-4/+4
| | | | | | | | | | | | | | | | | | | | | | Linux usb/ch9.h seems to have all the same information (and more) as usbdescriptors.h so use the former instead of the later one. As a consequense of this change USB_SPEED_* values don't correspond directly to EHCI speed encoding anymore, I've added necessary recoding in EHCI driver. Also there is no point to put speed into pipe anymore so it's removed and a bunch of host drivers fixed to look at usb_device->speed instead. Old usbdescriptors.h included is not removed as it seems to be used by old USB device code. This makes usb.h and usbdevice.h incompatible. Fortunately the only place that tries to include both are the old MUSB code and it needs usb.h only for USB_DMA_MINALIGN used in aligned attribute on musb_regs structure but this attribute seems to be unneeded (old MUSB code doesn't support any DMA at all). Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
* USB: musb_udc: Make musb_peri_rx_ep check for MUSB_RXCSR_RXPKTRDYPankaj Bharadiya2012-10-23-1/+10
| | | | | | | | | | | | The endpoint rx count register value will be zero if it is read before receive packet ready bit (PERI_RXCSR:RXPKTRDY) is set. Check for the receive packet ready bit (PERI_RXCSR:RXPKTRDY) before reading endpoint rx count register. Proceed with rx count read and FIFO read only if RXPKTRDY bit is set. Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@ti.com> Signed-off-by: Tom Rini <trini@ti.com>
* usb: lowlevel interface change to support multiple controllersLucas Stach2012-10-15-2/+2
| | | | | | | | | | | Carry an index in the lowlevel usb functions to make specify the respective usb controller. Also pass through an controller struct from lowlevel_init to the creation of the root usb device of this controller. Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Vasut <marex@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-usbWolfgang Denk2012-09-02-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://git.denx.de/u-boot-usb: MUSB driver: Timeout is never detected as the while loop does not end usb: fix ulpi_set_vbus prototype pxa25x: Add UDC registers definitions USB: Fix strict aliasing in ohci-hcd usb: Optimize USB storage read/write ehci: Optimize qTD allocations usb_stor_BBB_transport: Do not delay when not required usb_storage: Remove EHCI constraints usb_storage: Restore non-EHCI support ehci-hcd: Boost transfer speed ehci: cosmetic: Define used constants ehci: Fail for multi-transaction interrupt transfers arm:trats: Enable g_dnl composite USB gadget with embedded DFU function on TRATS arm:trats: Support for USB UDC driver at TRATS board. dfu:cmd: Support for DFU u-boot command dfu: MMC specific routines for DFU operation dfu: DFU backend implementation dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget dfu:usb: Support for g_dnl composite download gadget. ehci: cosmetic: Define the number of qt_buffers Signed-off-by: Wolfgang Denk <wd@denx.de>
| * MUSB driver: Timeout is never detected as the while loop does not endMatej Frančeškin2012-09-01-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeout variable is decremented once more when while condition is not met. Following "if" does not detect correctly that timeout has occurred. Because of this bug the "usb start" command on AM335X-EVM board did not detect correctly that USB device was not attached. timeout = musb_cfg.timeout; while (timeout--) if (readb(&musbr->devctl) & MUSB_DEVCTL_HM) break; /* if musb core is not in host mode, then return */ if (!timeout) return -1; Signed-off-by: Matej Franceskin <Matej.Franceskin@comtrade.com> CC: Marek Vasut <matex@denx.de>?
* | da8xx/hawkboard: Add support for ohci host controllerSughosh Ganu2012-09-01-103/+2
|/ | | | | | | | | | Also enable the ohci port on hawkboard. These additions result in an increased u-boot size -- adjust the same accordingly in the board's config. Move the usb header for da8xx platforms under arch-davinci. Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
* ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignmentTom Rini2012-07-18-1/+1
| | | | | | | | | | | | | | | | | | The USB spec says that 32 bytes is the minimum required alignment. However on some platforms we have a larger minimum requirement for cache coherency. In those cases, use that value rather than the USB spec minimum. We add a cpp check to <usb.h> to define USB_DMA_MINALIGN and make use of it in ehci-hcd.c and musb_core.h. We cannot use MAX() here as we are not allowed to have tests inside of align(...). Signed-off-by: Tom Rini <trini@ti.com> [marek.vasut]: introduce some crazy macro voodoo Signed-off-by: Marek Vasut <marex@denx.de> [ilya.yanok]: moved external buffer fixes to separate patch, we use {ALLOC,DEFINE}_ALIGN_BUFFER macros with alignment of USB_DMA_MINALIGN for qh_list, qh and qtd structures to make sure they are proper aligned for both controller and cache operations. Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
* usb: musb: fix printf warningMike Frysinger2012-03-19-1/+1
| | | | | | | | musb_hcd.c: In function 'musb_submit_rh_msg': musb_hcd.c:827:2: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* USB: move keyboard polling into kbd driveramartin@nvidia.com2012-03-03-28/+0
| | | | | | | | | This moves keyboard polling logic from USB HCD drivers into USB keyboard driver. Remove usb_event_poll() as keyboard polling was the only user of this API. With this patch USB keyboard works with EHCI controllers again. Tested on a tegra2 seaboard. Signed-off-by: Allen Martin <amartin@nvidia.com>
* drivers/usb/musb/musb_udc.c: Fix GCC 4.6 warningAnatolij Gustschin2011-12-09-5/+3
| | | | | | | | | | | | | | | | Fix: musb_udc.c: In function 'musb_peri_softconnect': musb_udc.c:166:14: warning: variable 'intrtx' set but not used [-Wunused-but-set-variable] musb_udc.c:166:6: warning: variable 'intrrx' set but not used [-Wunused-but-set-variable] musb_udc.c:165:5: warning: variable 'intrusb' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Remy Bohmer <linux@bohmer.net> Acked-by: Remy Bohmer <linux@bohmer.net> Acked-by: Marek Vasut <marek.vasut@gmail.com>
* drivers/usb/musb/musb_hcd.c: Fix GCC 4.6 warningAnatolij Gustschin2011-11-23-2/+1
| | | | | | | | | Fix: musb_hcd.c: In function 'submit_control_msg': musb_hcd.c:851:6: warning: variable 'csr' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* arm, usb, davinci: make USBPHY_CTL register configurableHeiko Schocher2011-11-03-1/+5
| | | | | | | | | | | Define CONFIG_DV_USBPHY_CTL for setting the USB PHY control register. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Remy Bohmer <linux@bohmer.net> cc: Sandeep Paulraj <s-paulraj@ti.com> cc: Remy Bohmer <linux@bohmer.net> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* usb, davinci: add enable_vbus() weak functionHeiko Schocher2011-11-03-2/+12
| | | | | | | | Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Remy Bohmer <linux@bohmer.net> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* DaVinci: rename gpio_defs.h to gpio.hLaurence Withers2011-08-03-1/+1
| | | | | | | | | In preparation for a generic GPIO driver for the DA8xx processors, rename <asm/arch/gpio_defs.h> to <asm/arch/gpio.h> and fix up all files which include it. Signed-off-by: Laurence Withers <lwithers@guralp.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* musb: process control messages after roothub accepted itCliff Cai2011-06-25-2/+5
| | | | | | | | | | When dealing with non-multipoint devices, if the software root hub code accepted the message, then we still need to process it normally. So only return quickly when the root hub skipped the message or is otherwise in an error state. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb: musb: blackfin: check anomaly workarounds at runtime tooMike Frysinger2011-04-02-3/+26
| | | | | | | | The anomaly workarounds we need for older silicon might break things if used on newer versions where the anomalies don't exist. So check the silicon rev at runtime too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb: musb: blackfin: make clkin configurableMike Frysinger2011-04-02-1/+6
| | | | | | Not everyone has a 24MHz clkin to the USB, so let board porters override. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Switch from archive libraries to partial linkingSebastien Carlier2010-11-17-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
* usb: musb: constify a bitMike Frysinger2010-10-22-19/+21
| | | | | | These ep and root hub structures need not be writable. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb: musb: only write CLRDATATOG when appropriateBryan Wu2010-10-13-7/+16
| | | | | | | | | | This is a change similar to what is already in the Linux driver. We should only program the CLRDATATOG bit when the current mode indicates that it is needed. Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb: musb: stub out MUSB_TXCSR_MODE for Blackfin partsMike Frysinger2010-09-20-0/+2
| | | | | | | The MUSB_TXCSR_MODE register setting isn't supported on Blackfin musb parts, so stub it out to 0. This matches Linux behavior. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb: musb: set target address for non-multipoint devicesBryan Wu2010-09-11-0/+7
| | | | | | Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb: musb: setup TXCOUNT for Blackfin musbBryan Wu2010-09-11-0/+5
| | | | | | | | | The Blackfin implementation of musb has a TXCOUNT register that needs to be programmed when transmitting data. Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* musb: am35x: Workaround for fifo read issueAjay Kumar Gupta2010-08-12-0/+38
| | | | | | | AM35x supports only 32bit read operations so we need to have workaround for 8bit and 16bit read operations. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
* musb: MSC host support for AM35xAjay Kumar Gupta2010-08-12-0/+215
| | | | | | Tested MSC Host on AM3517EVM. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
* ARMV7: Restructure omap3 musb driver to allow code sharing between OMAP3 and ↵Steve Sakoman2010-08-05-1/+18
| | | | | | | OMAP4 Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* musb: fix compilation warningAjay Kumar Gupta2010-07-15-1/+1
| | | | | | | | | | | Fixes below compilation warning omap3.c: In function 'musb_platform_init': omap3.c:123: warning: implicit declaration of function 'omap3_evm_need_extvbus' Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* musb: Program extvbus for OMAP3EVM Rev >= EAjay Kumar Gupta2010-06-30-0/+7
| | | | | | | | OMAP3EVM Rev >=E uses external Vbus supply so setting 'extvbus' to '1' for OMAP3EVM Rev >=E runtime based on EVM revision. CC: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
* musb: Add Phy programming for using external VbusAjay Kumar Gupta2010-06-30-1/+36
| | | | | | | | | | | | | | | | MUSB PHY on OMAP3EVM Rev >= E uses external Vbus supply to support 500mA of power.We need to program MUSB PHY to use external Vbus for this purpose. Adding 'extvbus' member in musb_config structure which should be set by all the boards where MUSB interface is using external Vbus supply. Also added ULPI bus control register read/write abstraction for Blackfin processor as it doesn't have ULPI registers. CC: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* musb: Use name based initialization for musb_configAjay Kumar Gupta2010-06-30-9/+9
| | | | | | | | | | | Changed musb_config initialization for omap3.c, davinci.c and da8xx.c using name of structure fields. This would cause the uninitialized field to be null by default and thus would help in avoiding to init some flags required to be set only for a few selected platforms. CC: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
* Prepare v2010.03-rc1v2010.03-rc1Wolfgang Denk2010-03-12-2/+0
| | | | | | Coding style cleanup, update CHANGELOG. Signed-off-by: Wolfgang Denk <wd@denx.de>
* musb: Add host support for DM365 EVMPrathap Srinivas2010-02-03-2/+20
| | | | | | Add support for musb host on DM365 EVM. Signed-off-by: Prathap Srinivas <msprathap@ti.com>
* usb: musb: fix Blackfin DMA register paddingCliff Cai2010-02-03-1/+1
| | | | | | | | | The conversion from offsets to C structs lost a little padding in the DMA register map. Accessing endpoints other than ep0 with DMA would fail as the addresses wouldn't be adjusted correctly. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* PCIe, USB: Replace 'end point' references with 'endpoint'Peter Tyser2010-01-17-1/+1
| | | | | | | | | When referring to PCIe and USB 'endpoint' is the standard naming convention. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Remy Bohmer <linux@bohmer.net>
* usb: musb: add virtual root hub control supportBryan Wu2010-01-12-2/+482
| | | | | | | | | For MUSB devices that do not support multipoint (hubs), we have to emulate a root hub so that we can support core operations like resetting ports. Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* omap3: fix compile warningSanjeev Premi2010-01-09-0/+3
| | | | | | | | | | | This patch fixes this warning during compile: omap3.c: In function 'musb_platform_init': omap3.c:126: warning: label 'end' defined but not used Problem reported by: Dirk Behme[dirk.behme@googlemail.com] Signed-off-by: Sanjeev Premi <premi@ti.com>