summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* drivers: usb: convert makefiles to Kbuild styleMasahiro Yamada2013-10-317-224/+69
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* powerpc/usb:Differentiate USB controller base addressramneek mehresh2013-10-242-4/+15
| | | | | | | | Introduce different macros for storing addresses of multiple USB controllers. This is required for successful initialization and usage of multiple USB controllers inside u-boot Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
* usb: rename board_usb_init_type to usb_init_typeTroy Kisky2013-10-221-2/+2
| | | | | | | | | commit bba679144d25b91bcd7befff5a96728a30875f54 "usb: rename board_usb_init_type to usb_init_type" missed xhci-omap.c So, fix that patch here, and fix a checkpatch warning. WARNING: Avoid unnecessary line continuations Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: udc: add udc.h include fileTroy Kisky2013-10-205-1/+6
| | | | | | | 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: gadget: mv_udc: split mv_udc.h fileTroy Kisky2013-10-202-0/+121
| | | | | | | | | | Move defines only needed by mv_udc.c to a file in the same directory. This allows usbtty to compile for mv_udc, but it still doesn't link. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: optimize ep_enableTroy Kisky2013-10-201-2/+2
| | | | | | Only get head if not ep0. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: optimize bounceTroy Kisky2013-10-201-21/+16
| | | | | | | | | | | Only perform one copy, either in the bounce routine for IN transfers, or the debounce rtn for OUT transfer. On out transfers, only copy the number of bytes received from the bounce buffer Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: fix full speed connectionsTroy Kisky2013-10-201-14/+34
| | | | | | | Set maximum packet length in queue header to wMaxPacketSize of endpoint. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: ehci-mx6: add support for otg portTroy Kisky2013-10-201-40/+91
| | | | | | | | | | | | | | | | | | Previously, only host1 was supported using an index of 0. Now, otg has index 0, host1 is 1, host2 is 2, host3 is 3. Since OTG requires usbmode to be set after reset, I added CONFIG_EHCI_HCD_INIT_AFTER_RESET to nitrogen6x.h and mx6qsabreauto.h. I also added a weak function board_ehci_power to handle turning power on/off for otg. Type is type of device connected (USB stick vs Host.) Init is type of device desired. Only power up port if type == init == USB_INIT_HOST. Only return error if type != init. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNTTroy Kisky2013-10-201-4/+0
| | | | | | | | i.mx6 has 1 otg controller, and 3 host ports. So, CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1 even though only 1 device mode controller is supported. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init.Troy Kisky2013-10-2019-25/+46
| | | | | | | This paramter will later be used to initialize OTG ports in host or device mode. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: add enum usb_init_type parameter to usb_lowlevel_initTroy Kisky2013-10-2010-10/+10
| | | | | | This parameter will later be used to verify OTG ports. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: am437x: Add support for am437x xhci USB hostDan Murphy2013-10-201-0/+23
| | | | | | | | | Add the support for the am437x xhci usb host. The xHCI host on AM437 is connected to a usb2 phy so need to add support to enable those clocks. Signed-off-by: Dan Murphy <dmurphy@ti.com>
* usb: dra7xx: Add support for dra7xx xhci USB hostDan Murphy2013-10-202-6/+45
| | | | | | | | | | | Add the support for the dra7xx xhci usb host. dra7xx does not contain an EHCI controller so the headers can be removed from the board file. The xHCI host on dra7xx is connected to a usb2 phy so need to add support to enable those clocks. Signed-off-by: Dan Murphy <dmurphy@ti.com>
* usb: omap: Move the usb phy code to the usb/phy directoryDan Murphy2013-10-203-169/+200
| | | | | | | | | | | Moving the usb/phy code from xhci-omap to the usb/phy directory and moving the associated phy code over to the new file. Newer TI processors adding xHCI support will have different PHY configurations so therefore abstracting this code away will prevent messing around with the xhci-omap file itself. Signed-off-by: Dan Murphy <dmurphy@ti.com>
* usb: omap5: Update the board_usb_init apiDan Murphy2013-10-201-3/+4
| | | | | | | | | | Recent patches declares board_usb_init function prototype for a new usb architecture. Turning on the OMAP_XHCI defines cause a redefinition compiler failure. So update the board_usb_init to the latest prototype. Signed-off-by: Dan Murphy <dmurphy@ti.com>
* usb: omap: Move the xhci-omap header file to common locationDan Murphy2013-10-201-1/+1
| | | | | | | Moving the xhci-omap header to a more global location so that other code can reference this code. Signed-off-by: Dan Murphy <dmurphy@ti.com>
* usb:g_dnl: Support for TIZEN's THOR function in generic download codeLukasz Majewski2013-10-201-2/+8
| | | | | | | Support of "thor" function in generic download code (g_dnl.c). Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* usb:g_dnl:f_thor: USB download function to support TIZEN's THOR protocolLukasz Majewski2013-10-203-0/+1128
| | | | | | | Implementation of USB download function which supports THOR protocol. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* usb:g_dnl: Add name parameter to g_dnl_bind_fixup functionLukasz Majewski2013-10-201-2/+2
| | | | | | | | | New parameter, namely *name has been added to g_dnl_bind_fixup(). It is necessary (for compatibility reasons) to assign new USB idProduct and idVendor for different usb functions. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* usb:g_dnl: Replace static usb_configuration structure with dynamically ↵Lukasz Majewski2013-10-201-8/+16
| | | | | | | | | | allocated one When the usb_configuration structure is declared as static, it is very hard to assure, that relevant fields (as e.g. config->interfaces[]) are cleared out before new call to g_dnl related functions. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
* usb:udc:s3c: Reduce dcache invalidate range for UDC receive bufferLukasz Majewski2013-10-201-1/+2
| | | | | | | | | The s3c udc driver sends data in a max packet size. Therefore the dcache invalidate range shall be equal to max packet, not the entire DMA_BUFFER_SIZE. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* usb:smsx95xx LED activity for USB net driverSuriyan Ramasami2013-10-201-0/+14
| | | | | | | Add LED activity for SMSX95XX USB Ether driver. Signed-off-by: “Suriyan Ramasami" <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* usb: new board-specific USB init interfaceMateusz Zalega2013-10-204-19/+10
| | | | | | | | | | | | | | This commit unifies board-specific USB initialization implementations under one symbol (usb_board_init), declaration of which is available in usb.h. New API allows selective initialization of USB controllers whenever needed. Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de> Cc: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: mv_udc: clear desc upon ep_disableTroy Kisky2013-10-201-0/+3
| | | | | | | desc is set at ep_enable, so for symmetry, clear it at ep_disable. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: zero transfer descriptor memory on probeTroy Kisky2013-10-201-0/+1
| | | | | | Since we flush the TD, we may as well set it to a known value. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: flush item before headTroy Kisky2013-10-201-3/+2
| | | | | | | | Make sure the transfer descriptor is flushed before the queue is updated so that the controller will not see old information. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: set is_dualspeed = 1Troy Kisky2013-10-201-0/+1
| | | | | | This controller support full and high speed. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: mv_udc: fix typo in error messageTroy Kisky2013-10-201-2/+2
| | | | | | Change 'nfo=' to 'info=' Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: ether: return error from rx_submit if no requestTroy Kisky2013-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | This prevents a crash if tftpboot is given a bad filename. rx_req will be released by eth_reset_config which is called by eth_disconnect, which is called using the .disconnect member of usb_gadget_driver by mv_pullup in mv_udc which is called using the .pullup member of usb_gadget_ops by usb_gadget_disconnect which is called by usb_eth_halt which is called using the .halt member of eth_device by eth_halt which is called by TftpHandler when TFTP_ERR_FILE_NOT_FOUND or TFTP_ERR_ACCESS_DENIED occurs I trigger this with the following commands setenv ipaddr 10.0.0.2 && setenv netmask 255.255.255.0 && setenv serverip 10.0.0.1 setenv usbnet_devaddr 00:11:22:33:44:55 && setenv usbnet_hostaddr 00:aa:bb:cc:dd:ee setenv ethprime usb_ether && setenv ethact usb_ether && setenv ncip 10.0.0.1 tftpboot 10800000 10.0.0.1:missing_file Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* usb: gadget: ether set wMaxPacketSizeTroy Kisky2013-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | | set wMaxPacketSize for full speed descriptors fs_source_desc, fs_sink_desc to 64. Full-speed bulk endpoint can have a maximum packet size of 8, 16, 32, or 64 bytes, so choice 64. The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize set to 512. That is the only legal value for high speed bulk endpoints. Strictly speaking, this patch is not needed because usb_ep_autoconfig will call ep_matches which will override wMaxPacketSize for BULK endpoints only with the size associated with the endpoint setup by the udc driver. But if you want to rely on this, you may as well combine the full speed descriptor with the high speed descriptor to minimize confusion. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* OMAP5: USB: Add OMAP xHCI file and headerDan Murphy2013-10-202-0/+327
| | | | | | | | Add the OMAP file for the xHCI Host controller This code will initilialize the proper components within the OMAP5 to enable the xHCI host controller. Signed-off-by: Dan Murphy <dmurphy@ti.com>
* exynos: usb: Switch USB VBUS GPIOs to be device tree configuredJulius Werner2013-10-202-0/+22
| | | | | | | | | | | | | | | | | Some Exynos boards, such as the SMDK5250, control USB port power through a GPIO pin. For now this had been hardcoded in the exynos5-dt board file, but not all boards use the same pin, requiring local changes to support different boards. This patch moves the GPIO initialization into the USB host controller drivers which they belong to, and uses the samsung,vbus-gpio parameter in the device tree to configure it. Signed-off-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Simon Glass <sjg@chromium.org> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Marek Vasut <marex@denx.de>
* USB: XHCI: Add xHCI host controller support for Exynos5Vivek Gautam2013-10-202-0/+317
| | | | | | | | | | | | | This adds driver layer for xHCI controller in Samsung's exynos5 soc. This interacts with xHCI host controller stack. Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Julius Werner <jwerner@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Dan Murphy <dmurphy@ti.com> Cc: Marek Vasut <marex@denx.de>
* USB: xHCI: Add stack support for xHCIVivek Gautam2013-10-205-0/+3947
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds stack layer for eXtensible Host Controller Interface which facilitates use of USB 3.0 in host mode. Adapting xHCI host controller driver in linux-kernel by Sarah Sharp to needs in u-boot. Initial porting from Linux kernel version 3.4, with following top commit history of drivers/usb/host/xhci* : cf84055 xHCI: Cleanup isoc transfer ring when TD length mismatch found This adds the basic xHCI host controller driver with bare minimum features: - Control/Bulk transfer support has been added with required infrastructure for necessary xHC data structures. - Stream protocol hasn't been supported yet. - No support for quirky devices has been added. Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com> Signed-off-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Simon Glass <sjg@chromium.org> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Dan Murphy <dmurphy@ti.com> Cc: Marek Vasut <marex@denx.de>
* usb: Move 'bmRequestType' USB device request macros from EHCI headerVivek Gautam2013-10-201-16/+0
| | | | | | | | | | | | | | Macros defining bmRequestType field of USB device request, given in table 9.2 USB 2.0 spec, are rather generic macros which can be further used by other Host controller stacks. So moving them to usb_defs header. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Julius Werner <jwerner@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Dan Murphy <dmurphy@ti.com> Cc: Marek Vasut <marex@denx.de>
* Coding Style cleanup: drop some excessive empty linesWolfgang Denk2013-10-141-5/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Coding Style cleanup: remove trailing empty linesWolfgang Denk2013-10-141-1/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Coding Style cleanup: remove trailing white spaceWolfgang Denk2013-10-143-3/+3
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* usb: Prevent using reserved registers on DM36x usbAndrew Murray2013-10-101-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>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-10-081-5/+5
|\
| * usb: Fix error handling in musb_hcd.cAndrew Murray2013-10-071-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>
* | usb: ehci: Fix test mode for connected portsJulius Werner2013-09-271-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EHCI controller has some very specific requirements for the USB 2.0 port test modes, which were not closely followed in the initial test mode commit. It demands that the host controller is completely shut down (all ports suspended, Run/Stop bit unset) when activating test mode, and will not work on an already enumerated port. This patch fixes that by introducing a new ehci_shutdown() function that closely follows the procedure listed in EHCI 4.14. Also, when we have such a function anyway, we might as well also use it in usb_lowlevel_stop() to make the normal host controller shutdown cleaner. Signed-off-by: Julius Werner <jwerner@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* | USB: gadget: atmel: disconnect before unbindBo Shen2013-09-241-1/+2
| | | | | | | | | | | | When unbind the gadget driver, need call disconnect first. Signed-off-by: Bo Shen <voice.shen@atmel.com>
* | usb:g_dnl:dfu: Download gadget and DFU function code clean upLukasz Majewski2013-09-242-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | The download gadget code and DFU function lacks of proper declarations for the case when a target board wants to use only one of available usb functions. Moreover the relevant declarations have been moved to consistent localization (like <dfu.h>). Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* | usb:gadget:Remove redundant #includes for USB composite gadget and its functionsLukasz Majewski2013-09-241-1/+0
| | | | | | | | | | | | | | | | | | | | Only the <linux/usb/gadget.h> requires error.h include. Hence, several includes of error.h at USB gadget functions are not needed. Moreover unnecessary malloc.h includes were also removed. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* | usb:g_dnl:ums: Conditional compilation for mass storage function ↵Lukasz Majewski2013-09-242-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (f_mass_storage) The mass storage composite function is now compiled in only when CONFIG_USB_GADGET_MASS_STORAGE is defined. Such change provides binary size reduction for boards which use USB download gadget (like am335x_evm) with DFU, but don't use UMS. For example at am335x_evm board reduction is more than 2KiB for text and around 120B for data. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* | USB: gadget: add atmel usba udc driverBo Shen2013-09-243-0/+1632
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add atmel usba udc driver support, porting from Linux kernel The original code in Linux Kernel information is as following commit e01ee9f509a927158f670408b41127d4166db1c7 Author: Jingoo Han <jg1.han@samsung.com> Date: Tue Jul 30 17:00:51 2013 +0900 usb: gadget: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Bo Shen <voice.shen@atmel.com>
* | usb: gadget: config: fix unaligned access issuesTroy Kisky2013-09-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | As seen with codesourcery compiler 2010q1, the buf pointer in usb_request structure is not aligned on 4 bytes boundary causing data aborts in eth_setup -> conf_buf -> usb_gadget_config_buf. Make it as align access to fix this issue. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> [voice.shen@atmel.com: add commit message] Signed-off-by: Bo Shen <voice.shen@atmel.com>
* | usb: gadget: Fix data aborts during USB ethernet bootJoel Fernandes2013-09-241-2/+3
|/ | | | | | | | | | | | | | As seen on GCC 4.6 Linaro compiler, control_req buffer is not aligned on 4 byte boundaray causing data aborts in eth_setup -> conf_buf during dhcp boot over usb_ether. Fix the issue my aligning control_req buffer using DEFINE_CACHE_ALIGN_BUFFER. Tested on am335x_evm platform (beaglebone). Applies on 2013.10-rc1 branch. Cc: Tom Rini <trini@ti.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Joel Fernandes <joelf@ti.com>
OpenPOWER on IntegriCloud