summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
Commit message (Collapse)AuthorAgeFilesLines
* USB gadget at91: Use dev_add_param_bool for vbus parameterSascha Hauer2013-04-111-16/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget/Kconfig: fix menuEric Bénard2013-03-121-4/+4
| | | | | | | | | by reordering the entry, USB gadget support is now a menu and the USB gadget choices are under this menu and not directly in the driver menu. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2013-03-041-2/+9
|\
| * USB i.MX: Add chipidea gadget supportSascha Hauer2013-02-151-2/+9
| | | | | | | | | | | | | | | | This adds USB gadget support to the i.MX chipidea driver. Basically we have to add a register function to the fsl udc driver and call this from the chipidea driver if device mode is selected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-133-23/+3
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce console none supportJean-Christophe PLAGNIOL-VILLARD2013-01-231-1/+1
| | | | | | | | | | | | this will allow to have no console support Use full for bootstrap as we can save 6.5 KiB (barebox.bin) and 3.8 KiB (zbarebox.bin lzo) on at91sam9263 as example vs console simple As on bootstrap we have often very limited size. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: at91_udc: request and configure vbus pin via gpiolibJean-Christophe PLAGNIOL-VILLARD2013-01-021-0/+7
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* at91: switch to gpiolibJean-Christophe PLAGNIOL-VILLARD2012-12-221-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* at91: use gpio_is_valid to check gpioJean-Christophe PLAGNIOL-VILLARD2012-12-221-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Cleanup Kconfig filesAlexander Shiyan2012-12-081-1/+1
| | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format, removing extraneous lines and spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: add flow control to u_serialRobert Jarzmik2012-10-291-8/+17
| | | | | | | | | | | | | | | | | | | When using the serial console over USB to download files, and when the USB bandwidth is pushed to its limits, the barebox UDC device won't be able to absorb all the traffic. Modify the u_serial gadget so that if there is not enough room in buffers, don't push USB requests down the gadget driver, so that it is saturated, and give it a chance to NAK requests. The previous behaviour was loosing bytes (as kfifo_put is lossy). The fixed behavious is lossless (based on USB NAK protocol). While at it, increase a bit buffer sizes to 8kB to absorb heavy transfers such as a linux kernel image. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-043-3/+3
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-175-17/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: gadget: enable for MXSMarc Kleine-Budde2012-07-251-2/+2
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb gadget: Enable gadget support only when a driver is availableSascha Hauer2012-07-251-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb gadget at91: Use correct includeSascha Hauer2012-07-251-0/+1
| | | | | | include gpio.h instead of mach/gpio.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add static inlines for gpio_request/gpio_freeSascha Hauer2012-07-251-1/+1
| | | | | | | | Some drivers use gpio_request/gpio_free. Currently no architecture has code behind these functions. Provide static inline functions for these and remvoe the at91 specific inline functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sparse'Sascha Hauer2012-07-021-1/+1
|\
| * USB gadget fsl: Put registers into iomem spaceSascha Hauer2012-06-301-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB gadget: Fix dma memory allocationsSascha Hauer2012-06-302-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another variant of: USB gadget fsl: request cacheline aligned buffer The fsl udc driver allocates a buffer for small requests. The driver then calls dma_inv_range later on it. This buffer happens to be not cacheline aligned which means that a dma_inv_range can corrupt other memory around the buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [mkl: use dma_alloc] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB gadget fsl: request cacheline aligned bufferSascha Hauer2012-06-301-2/+3
|/ | | | | | | | | | | | The fsl udc driver allocates a buffer for small requests. The driver then calls dma_inv_range later on it. This buffer happens to be not cacheline aligned which means that a dma_inv_range can corrupt other memory around the buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [mkl: use dma_alloc] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: add empty complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+2
| | | | | | | | | | for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo, reset, true, usb, version for mach-imx and mach-mxs: dump_clocks for u_serial: mycdev Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'next'Sascha Hauer2012-04-051-0/+1
|\
| * Select POLLER option for fsl_udcAlexander Shiyan2012-04-021-0/+1
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | USB gadget pxa: Fix compiler warningSascha Hauer2012-04-051-1/+1
| | | | | | | | | | | | | | | | Fixes: drivers/usb/gadget/pxa27x_udc.c:1263:13: warning: 'pxa27x_change_interface' defined but not used [-Wunused-function] Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | pxa27x_udc: Fix compilation warning.Marek Belisko2012-03-231-2/+2
|/ | | | | | | | Fix following: drivers/usb/gadget/pxa27x_udc.c:1482:1: warning: initialization from incompatible pointer type Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-1/+1
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget: fix poller NPE in early pollingRobert Jarzmik2012-01-231-9/+10
| | | | | | | | | | | | | The timings of the poller calling have changed, digging out a latent bug in pxa27x udc controller. The polling routine is called before the probe function is called, and the driver internal are not initialized at that time. This triggers a NULL pointer exception. Fix it by moving poller registration after driver probe. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* u_serial: add setbrg to be able to use loadb & coEric Bénard2012-01-051-0/+5
| | | | | Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial gadget: enable/disable on requestEric Bénard2012-01-044-19/+60
| | | | | | | | | | | | | | - add a usbserial command to enable/disable the serial gadget - allow dfu and usbserial to cohexist in the same barebox - add a timeout in u_serial so that we don't get locked if the user enable usbserial from a UART console but doesn't consume the data on the usbserial port created on the PC - remove debug or verbose printf - tested on i.MX25 & i.MX35 & usb-a926x Signed-off-by: Eric Bénard <eric@eukrea.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dfu: fill bwPollTimeout and better handle detachEric Bénard2012-01-041-1/+8
| | | | | | | | | | | | | | | | | - bwPollTimeout is set to 10 ms, from the DFU spec, this is the minimum time, in milliseconds, that the host should wait before sending a subsequent DFU_GETSTATUS request. Without this, I get 25 seconds value and dfu-util waits twice 25s during download - when in IDLE and receiving DETACH, first return 0 to make dfu-util happy, then use a dfudetach variable to exit dfu (without an USB reset as per the comment on line 425) and return to runtime mode. - tested on i.MX25 & i.MX35 & usb-a926x Signed-off-by: Eric Bénard <eric@eukrea.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fsl_udc: update and fixEric Bénard2012-01-041-9/+36
| | | | | | | | | | | - this patch sync fsl_udc.c with linux's driver, - add a poller on usb_gadget_poll to get serial gadget working, - return -EIO in usb_gadget_poll when udc is stopped (do detect cable disonnection) - tested on i.MX25 & i.MX35 Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* at91_udc: update vbus param only if updatedJean-Christophe PLAGNIOL-VILLARD2012-01-022-2/+16
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget: add special treatment for PXA cpusRobert Jarzmik2011-12-211-1/+8
| | | | | | | As PXA cpus suffer from a silicon bug which prevents them from being compound devices, forbid use_acm=1 for PXAs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* at91: add udc usb device controller supportJean-Christophe PLAGNIOL-VILLARD2011-12-144-0/+1700
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget: make serial gadget resistant to cable unplugRobert Jarzmik2011-12-051-6/+18
| | | | | | | | | | | | | | As USB can have its cable plugged out anytime, make the serial gadget reliable in case of unplugging : - unregister the gadget_serial provided console - don't stay forever in the read loop if connection was cut This behaviour relies on correct implementation of usb_gadget_poll(), which should return an error if the USB cable was removed. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget: add USB serial connect and disconnectRobert Jarzmik2011-12-051-1/+4
| | | | | | | | | | | | | The serial gadget can only work if the serial function is properly connected on USB trigger (ie. on SET_CONFIGURATION or SET_INTERFACE USB message triggering set_alt() in composite.c). Make this connection and handle also the disconnection in f_serial. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget: use generic usb_gadget_poll() in u_serialRobert Jarzmik2011-12-051-3/+2
| | | | | | | | | Use the generic gadget polling function instead of the specific fsl function. This is a fix from a leftover in gadget development. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb/gadget: add pxa27x_udc driverRobert Jarzmik2011-12-054-0/+1925
| | | | | | | | | Adapt mainline kernel pxa27x_udc driver to barebox : - remove function header comments as they are in mainline - test it with serial gadget Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/cp: add verbose mode which displays progress barHubert Feurstein2011-11-221-1/+1
| | | | | Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: pass size to dma_free_coherentSascha Hauer2011-08-011-1/+1
| | | | | | We'll need it later once we remap dma memory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fsl_udc: switch to resourceJean-Christophe PLAGNIOL-VILLARD2011-07-301-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Fix error handling with malloc, memalign etc. Introduce xmemalign().Krzysztof Halasa2011-01-073-11/+2
| | | | | | | | | | | | | | The idea is to panic() when there is no memory available for normal operation. Exception: code which can consume arbitrary amount of RAM (example: files allocated in ramfs) must report error instead of panic(). This patch also fixes code which didn't check for NULL from malloc() etc. Usage: malloc(), memalign() return NULL when out of RAM. xmalloc(), xmemalign() always return non-NULL or panic(). Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fsl_udc: fix warningEric Bénard2010-10-211-1/+2
| | | | | | | | | | | | this patch fix the following warning : drivers/usb/gadget/fsl_udc.c: In function 'done': drivers/usb/gadget/fsl_udc.c:566: warning: passing argument 1 of 'dma_inv_range' makes integer from pointer without a cast arch/arm/include/asm/mmu.h:24: note: expected 'long unsigned int' but argument is of type 'void *' drivers/usb/gadget/fsl_udc.c:566: warning: passing argument 2 of 'dma_inv_range' makes integer from pointer without a cast arch/arm/include/asm/mmu.h:24: note: expected 'long unsigned int' but argument is of type 'void *' Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* epautoconf: fix compile errorEric Bénard2010-10-141-0/+1
| | | | | | | | | | | | | | this patch fix the following error : CC drivers/usb/gadget/epautoconf.o drivers/usb/gadget/epautoconf.c:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned' drivers/usb/gadget/epautoconf.c: In function 'ep_matches': drivers/usb/gadget/epautoconf.c:168: error: 'epnum' undeclared (first use in this function) drivers/usb/gadget/epautoconf.c:168: error: (Each undeclared identifier is reported only once drivers/usb/gadget/epautoconf.c:168: error: for each function it appears in.) drivers/usb/gadget/epautoconf.c: In function 'usb_ep_autoconfig_reset': drivers/usb/gadget/epautoconf.c:304: error: 'epnum' undeclared (first use in this function) Signed-off-by: Eric Bénard <eric@eukrea.com>
* fsl_udc: make it work with MMU onSascha Hauer2010-05-031-5/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pass arguments to dma_* as unsigned long as the kernel doesSascha Hauer2010-03-301-1/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>