summaryrefslogtreecommitdiff
path: root/drivers/usb/musb
AgeCommit message (Collapse)Author
2017-05-15omap4: Drop redundant CONFIG_OMAP4430 symbolTom Rini
While there are a few different OMAP4 SoCs, today we always set CONFIG_OMAP4430 and CONFIG_OMAP44XX. Convert the few test of CONFIG_OMAP4430 to CONFIG_OMAP44XX. Cc: Marek Vasut <marex@denx.de> Cc: Paul Kocialkowski <contact@paulk.fr> Signed-off-by: Tom Rini <trini@konsulko.com>
2017-05-15omap3: Drop CONFIG_OMAP3_EVM, switch to CONFIG_TARGET_OMAP3_EVM when neededTom Rini
We make use of CONFIG_OMAP3_EVM today to know when to do a specific tweak in MUSB. This can be tested on via CONFIG_TARGET_OMAP3_EVM instead, so switch there so we can drop the now unused symbol CONFIG_OMAP3_EVM. In investigating what to do about the symbol usage we see that the cairo board defines the same function, but never called it (as it does not define CONFIG_OMAP3_EVM) and was just returning anyhow, so drop that function from that board. Cc: "Albert ARIBAUD (3ADEV)" <albert.aribaud@3adev.fr> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-25usb: musb: avoid out of bound access in udc_setup_epHeinrich Schuchardt
For id = 15 an out of bound access occurs in udc_setup_ep(). Increase the size of epinfo[] from 30 to 32 to encompass ids 0..15. The problem was highlighted by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-04-05Blackfin: RemoveTom Rini
The architecture is currently unmaintained, remove. Cc: Benjamin Matthews <mben12@gmail.com> Cc: Chong Huang <chuang@ucrobotics.com> Cc: Dimitar Penev <dpn@switchfin.org> Cc: Haitao Zhang <hzhang@ucrobotics.com> Cc: I-SYST Micromodule <support@i-syst.com> Cc: M.Hasewinkel (MHA) <info@ssv-embedded.de> Cc: Marek Vasut <marex@denx.de> Cc: Martin Strubel <strubel@section5.ch> Cc: Peter Meerwald <devel@bct-electronic.com> Cc: Sonic Zhang <sonic.adi@gmail.com> Cc: Valentin Yakovenkov <yakovenkov@niistt.ru> Cc: Wojtek Skulski <info@skutek.com> Cc: Wojtek Skulski <skulski@pas.rochester.edu> Signed-off-by: Tom Rini <trini@konsulko.com>
2016-05-02Fix spelling of "occurred".Vagrant Cascadian
Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-01-19Add more SPDX-License-Identifier tagsTom Rini
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>
2015-08-05usb: musb-new: CONFIG_MUSB prefix replacement with CONFIG_USB_MUSBPaul Kocialkowski
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>
2014-11-20include: move various macros to include/linux/kernel.hMasahiro Yamada
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>
2014-03-10usb: create common header virtual root hub descriptorsStephen Warren
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>
2014-02-20blackfin: Add <asm/clock.h> to numerous driversTom Rini
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>
2013-10-31drivers: usb: convert makefiles to Kbuild styleMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-10-20usb: udc: add udc.h include fileTroy Kisky
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>
2013-10-20usb: add enum usb_init_type parameter to usb_lowlevel_initTroy Kisky
This parameter will later be used to verify OTG ports. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-10usb: Prevent using reserved registers on DM36x usbAndrew Murray
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>
2013-10-07usb: Fix error handling in musb_hcd.cAndrew Murray
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>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-06-26usb: musb: Use ARRAY_SIZE at appropriate placesAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2013-06-10ARM: OMAP4+: Cleanup header filesLokesh Vutla
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>
2012-11-19usb: use linux/usb/ch9.h instead of usbdescriptors.hIlya Yanok
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>
2012-10-23USB: musb_udc: Make musb_peri_rx_ep check for MUSB_RXCSR_RXPKTRDYPankaj Bharadiya
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>
2012-10-15usb: lowlevel interface change to support multiple controllersLucas Stach
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>
2012-09-02Merge branch 'master' of git://git.denx.de/u-boot-usbWolfgang Denk
* '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>
2012-09-01MUSB driver: Timeout is never detected as the while loop does not endMatej Frančeškin
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>?
2012-09-01da8xx/hawkboard: Add support for ohci host controllerSughosh Ganu
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>
2012-07-18ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignmentTom Rini
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>
2012-03-18usb: musb: fix printf warningMike Frysinger
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>
2012-03-03USB: move keyboard polling into kbd driveramartin@nvidia.com
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>
2011-12-09drivers/usb/musb/musb_udc.c: Fix GCC 4.6 warningAnatolij Gustschin
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>
2011-11-23drivers/usb/musb/musb_hcd.c: Fix GCC 4.6 warningAnatolij Gustschin
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>
2011-11-03arm, usb, davinci: make USBPHY_CTL register configurableHeiko Schocher
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>
2011-11-03usb, davinci: add enable_vbus() weak functionHeiko Schocher
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>
2011-08-03DaVinci: rename gpio_defs.h to gpio.hLaurence Withers
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>
2011-06-25musb: process control messages after roothub accepted itCliff Cai
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>
2011-04-02usb: musb: blackfin: check anomaly workarounds at runtime tooMike Frysinger
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>
2011-04-02usb: musb: blackfin: make clkin configurableMike Frysinger
Not everyone has a 24MHz clkin to the USB, so let board porters override. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-17Switch from archive libraries to partial linkingSebastien Carlier
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>
2010-10-22usb: musb: constify a bitMike Frysinger
These ep and root hub structures need not be writable. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-13usb: musb: only write CLRDATATOG when appropriateBryan Wu
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>
2010-09-20usb: musb: stub out MUSB_TXCSR_MODE for Blackfin partsMike Frysinger
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>
2010-09-11usb: musb: set target address for non-multipoint devicesBryan Wu
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>
2010-09-11usb: musb: setup TXCOUNT for Blackfin musbBryan Wu
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>
2010-08-12musb: am35x: Workaround for fifo read issueAjay Kumar Gupta
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>
2010-08-12musb: MSC host support for AM35xAjay Kumar Gupta
Tested MSC Host on AM3517EVM. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
2010-08-05ARMV7: Restructure omap3 musb driver to allow code sharing between OMAP3 and ↵Steve Sakoman
OMAP4 Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-07-15musb: fix compilation warningAjay Kumar Gupta
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>
2010-06-30musb: Program extvbus for OMAP3EVM Rev >= EAjay Kumar Gupta
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>
2010-06-30musb: Add Phy programming for using external VbusAjay Kumar Gupta
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>
2010-06-30musb: Use name based initialization for musb_configAjay Kumar Gupta
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>
2010-03-12Prepare v2010.03-rc1Wolfgang Denk
Coding style cleanup, update CHANGELOG. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-02-03musb: Add host support for DM365 EVMPrathap Srinivas
Add support for musb host on DM365 EVM. Signed-off-by: Prathap Srinivas <msprathap@ti.com>