summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
Commit message (Collapse)AuthorAgeFilesLines
* usb: udc: Fix warnings on 64-bit buildsMichal Simek2015-11-031-1/+1
| | | | | | | | | | | | | Cast u32 bit value to 64bit before recasting to 64bit pointer to avoid pointer from integer cast size mismatch warnings. Warning log: +../drivers/usb/gadget/udc/udc-core.c: In function ‘usb_gadget_unmap_request’: +../drivers/usb/gadget/udc/udc-core.c:68:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* usb: lthor: Specify correct parameter for sizeof typeMichal Simek2015-11-031-1/+1
| | | | | | | | | | | | This patch removes this warning: CC drivers/usb/gadget/f_thor.o drivers/usb/gadget/f_thor.c: In function ‘thor_tx_data’: drivers/usb/gadget/f_thor.c:572:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=] debug("%s: dev->in_req->length:%d to_cpy:%d\n", __func__, ^ Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* fastboot: Implement OEM format only when we have MMC supportMaxime Ripard2015-10-201-1/+1
| | | | | | | | | | | | | | The current fastboot support assumes that CONFIG_FASTBOOT_FLASH implies that we have an MMC in our system, which might not be the case if we have some other storage device. Change the configuration option protecting that call to FASTBOOT_FLASH_MMC_DEV, that makes much more sense. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usb: ci_udc: fix emissions of ZLPsStephen Warren2015-09-121-10/+8
| | | | | | | | | | | | | | | | | | | Commit 6a132416359e "ci_udc: Update the ci_udc driver to support bulk transfers" caused the value of "len" to change without updating subsquent users of that variable in ci_ep_submit_next_request(). This caused the code that detects when to emit ZLPs (Zero Length Packets) never to trigger, which in turn caused host timeouts when a ZLP was required, which in turn broke tests/dfu/, even despite the assertion in that commit's description that "These changes are tested for both the DFU and lthor." Fix this by modifying the added dtd iteration code not to modify "len", but rather to keep state in a separate variable. Rename the variables while we're at it so they describe their purpose better. Fixes: 6a132416359e ("ci_udc: Update the ci_udc driver to support bulk transfers") Cc: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* usb: gadget: ci_udc: implement usb_ep_ops dequeue callbackPeng Fan2015-09-121-0/+26
| | | | | | | | | | | | | | | | | Implement endpoint dequeue callback function. Without this function, uboot will hang when executing fastboot comamnd. See following flow: "fastboot_tx_write_str->fastboot_tx_write->usb_ep_dequeue->ep->ops->dequeue" without implement ci_udc dequeue function, ep->ops->dequeue is NULL, then uboot will hang. Tested on mx6qsabresd board with fastboot enabled. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Cc: "Łukasz Majewski" <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* usb: gadget: don't leak configs when unbindingStephen Warren2015-09-112-2/+1
| | | | | | | | | | | | | | | | By the time g_dnl_unbind() is run, cdev->config has been set to NULL, so the free() there does nothing, and the config struct is leaked. Equally, struct usb_gadget contains a linked list of config structs, so the code should iterate over them all and free each one, rather than freeing one particular config struct. composite_unbind() already iterates over the list of config structs, and unlinks each from the linked list. Fix this loop to free() each struct as it's unlinked and otherwise forgotten. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com>
* Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h headerSimon Glass2015-09-112-0/+2
| | | | | | | Now that we have a new header file for cache-aligned allocation, we should move the stack-based allocation macro there also. Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: gadget: at91_udc: add at91_udc into U-BootHeiko Schocher2015-09-113-517/+103
| | | | | | | add U-Boot specific changes to the at91_udc linux driver, so it works with U-Boot. Signed-off-by: Heiko Schocher <hs@denx.de>
* usb: gadget: at91_udc: port linux driver at91_udcHeiko Schocher2015-09-112-0/+2211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | port at91_udc driver from linux: original commit Message: commit c94e289f195e0e13cf34d27f9338d28221a85751 Author: Arnd Bergmann <arnd@arndb.de> Date: Sat Apr 11 00:14:21 2015 +0200 usb: gadget: remove incorrect __init/__exit annotations A recent change introduced a link error for the composite printer gadget driver: `printer_unbind' referenced in section `.ref.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o Evidently the unbind function should not be marked __exit here, because it is called through a callback pointer that is not necessarily discarded, __composite_unbind() is indeed called from the error path of composite_bind(), which can never work for a built-in driver. Looking at the surrounding code, I found the same problem in all other composite gadget drivers in both the bind and unbind functions, as well as the udc platform driver 'remove' functions. Those will break if anyone uses the 'unbind' sysfs attribute to detach a device from a built-in driver. This patch removes the incorrect annotations from all the gadget drivers. Signed-off-by: Heiko Schocher <hs@denx.de>
* usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZESiva Durga Prasad Paladugu2015-09-071-1/+1
| | | | | | | | | | Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket as the descriptors data depend on the number of descriptors and this 64 bytes were not enough and the buffer might overflow which results in memalign failures later. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* f_thor: Dont perform reset at the end of thorSiva Durga Prasad Paladugu2015-09-072-0/+10
| | | | | | | | | | | | | Dont perform reset at the end of thor download if configured to do reset off. Reset may not be required in all cases and hence provided an option to do so. The case would be to download the images to DDR instead of flash device. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* usb: pxa27x_udc: clean-up include file orderMarcel Ziswiler2015-08-241-3/+2
| | | | | | | Cleaning up order of include files by sorting them alphabetically keeping in mind to leave common.h on top. Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
* usb: gadget: ether: populate _reset_ callbackKishon Vijay Abraham I2015-08-191-0/+1
| | | | | | | | | | | populate _reset_ callback to the USB ethernet gadget since UDC core expects every gadget driver to have the reset callback. This shouldn't be needed once the ethernet gadget driver is adapted to use the composite driver. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: ether: Perform board initialization from ethernet gadget driverKishon Vijay Abraham I2015-08-191-0/+4
| | | | | | | | | | | Ethernet gadget driver can be used both by both SPL and u-boot. Since usb_eth_init() is the entry point for ethernet gadget driver, perform board initialization there. Also perform the cleanup in usb_eth_halt. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: musb-new: CONFIG_MUSB prefix replacement with CONFIG_USB_MUSBPaul Kocialkowski2015-08-051-1/+1
| | | | | | | | | 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>
* usb: ci_udc: fix request allocation when endpoints are disabledRob Herring2015-07-241-4/+8
| | | | | | | | | | | | | | | | | | The ci_udc driver request allocation assumes that the endpoint descriptor pointer is set to retrieve the endpoint number, but that is only true when the endpoint is enabled. This results in a NULL ptr dereference which for me happens to return 0 value. This causes the EP0 request struct to be returned for other endpoints. Some gadget drivers like fastboot and USB MS work fine, but ethernet does not. Really, the ci_udc driver is the oddball here doing this EP0 special case handling Stephen added. All the other drivers alloc/free functions are pretty much the same with the only variation being the size of the private struct. This could all be consolidated to a common function. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Marek Vasut <marex@denx.de> Acked-by: Stephen Warren <swarren@nvidia.com>
* ci_udc: fix 64-bit compile warningsStephen Warren2015-07-231-9/+10
| | | | | | | This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* usb: CONFIG_USB_FASTBOOT prefix replacement for consistencyPaul Kocialkowski2015-07-221-4/+4
| | | | | | | | | | FASTBOOT is defined both by CONFIG_USB_FUNCTION_FASTBOOT AND CONFIG_CMD_FASTBOOT, so it doesn't make much sense to have a CONFIG_USB_FASTBOOT prefix for fastboot-specific options, especially given that other config options for fastboot use the CONFIG_FASTBOOT prefix. This replaces the CONFIG_USB_FASTBOOT prefix with CONFIG_FASTBOOT, for consistency. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* implement Fastboot via USB OTG on bcm28155_ap boardsJiandong Zheng2015-07-221-0/+1
| | | | | Signed-off-by: Jiandong Zheng <jdzheng@broadcom.com> Signed-off-by: Steve Rae <srae@broadcom.com>
* usb: gadget: bcm_udc_otg filesJiandong Zheng2015-07-222-0/+73
| | | | | | | Add the required files for the Broadcom UDC OTG interface. Signed-off-by: Jiandong Zheng <jdzheng@broadcom.com> Signed-off-by: Steve Rae <srae@broadcom.com>
* usb: gadget: fastboot: Dequeue the previous IN request for the current requestPaul Kocialkowski2015-07-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent versions of the fastboot tool will query the partition type before doing an operation on a partition (such as erase, flash, etc). It will then submit the operation as soon as the response for the partition type is received. Usually, the MUSB controller will see that the partition type request return status was read by the host at the very same time as the actual operation request is submitted by the host. However, the operation will be read first (int_rx is handled first in musb_interrupt) and after it is completed, the fastboot USB gadget driver will send another return status. Hence, this happens before the musb gadget framework has had a chance to handle the previous acknowledgement that the host read the return status and dequeue the request. The host will then usually empty the FIFO by the time musb_interrupt gets around handling the return status acknowledgement (for the previous request, this is still on the same musb_interrupt call), so no other interrupt is generated and the most recent return status acknowledgement remains unaccounted for. It will then be used as a response for the next command, and the proper response for it will be delayed to the next command, and so on. Dequeuing the previous IN request in the fastboot code ensures that no previous return status remains. It is acceptable to do it since there is no callback to it anyways. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* usb: gadget: fastboot: Request status and length check in rx handlerPaul Kocialkowski2015-07-221-5/+6
| | | | | | | | | This avoids handling requests that have an error status or no data. In particular, this avoids showing unnecessary error messages when the USB gadget gets disconnected (e.g. with fastboot continue) and the fastboot USB gadget driver sends an error back to the host (that has disconnected already). Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* usb: gadget: Weak board_usb_init/cleanup definitions in USB download gadget codePaul Kocialkowski2015-07-221-0/+13
| | | | | | | | | | | | Weak versions of board_usb_init and board_usb_cleanup are defined in common USB host code, but it is also used for USB device gadgets, so we also need a weak definition of it when there is no USB host enabled. Both weak definitions do not conflict. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
* usb: Fastboot function config for better consistency with other functionsPaul Kocialkowski2015-07-221-1/+1
| | | | | | | | | | | | USB download gadget functions such as thor and dfu have a separate config option for the USB gadget part of the code, independent from the command part. This switches the fastboot USB gadget to the same scheme, for better consistency. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
* usb: USB download gadget and functions config options coherent namingPaul Kocialkowski2015-07-221-4/+4
| | | | | | | | | | | | This introduces a coherent scheme for naming USB download gadget and functions config options. The download USB gadget config option is moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other gadgets and each function's config option is moved to a CONFIG_USB_FUNCTION_ prefix. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Test HW: Odroid_XU3 (Exynos5422), trats (Exynos4210)
* usb: f_mass_storage: sleep_thread: decrease the interval for check ctrlc()Inha Song2015-06-081-1/+1
| | | | | | | | | | | | | This change decreases the interval of calls to: - display busy indicator - check ctrlc() - check cable connection By this change, breaking the UMS command is more easy on Odroid XU3. Signed-off-by: Inha Song <ideal.song@samsung.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* ci_udc: Update the ci_udc driver to support bulk transfersSiva Durga Prasad Paladugu2015-05-292-19/+117
| | | | | | | | | Update the ci_udc driver to support bulk transfer and also added capability of having multiple dtds if requested data is more than 16K. These changes are tested for both the DFU and lthor. Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
* net: cosmetic: Fix var naming net <-> eth driversJoe Hershberger2015-04-181-2/+3
| | | | | | | | | | | | | | | Update the naming convention used in the network stack functions and variables that Ethernet drivers use to interact with it. This cleans up the temporary hacks that were added to this interface along with the DM support. This patch has a few remaining checkpatch.pl failures that would be out of the scope of this patch to fix (drivers that are in gross violation of checkpatch.pl). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: cosmetic: Name ethaddr variables consistentlyJoe Hershberger2015-04-181-4/+4
| | | | | | | | Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: usb: Allow setting up a USB controller as a device/gadgetSimon Glass2015-04-181-0/+4
| | | | | | | | | | | | Some controllers support OTG (on-the-go) where they can operate as either host or device. The gadget layer in U-Boot supports this. While this layer does not interact with driver model, we can provide a function which sets up the controller in the correct way. This way the code at least builds (although it likely will not work). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* fastboot: add support for reboot-bootloader commandAlexey Firago2015-04-141-0/+13
| | | | | | | | | | | | | | | | | | The "fastboot reboot-bootloader" command is defined to re-enter into fastboot mode after rebooting into bootloader. This command is usually used after updating bootloader via fastboot. This commit implements only a generic side of the command - setting of the reset flag and then resetting. Setting of the reset flag is implemented using __weak fb_set_reboot_flag() function. The actual setting and checking of the reset flag should be implemented by a boot script and/or board/SoC specific code. Signed-off-by: Alexey Firago <alexey_firago@mentor.com> Tested-by: Steve Rae <srae@broadcom.com> [Test HW: bcm28155_ap board]
* usb: gadget: thor: Claim EP after allocating it in thor gadgetMarek Szyprowski2015-04-141-0/+3
| | | | | | | Storing thor device struct as an EP private data. It is necessary for DWC3 operation. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
* usb: dwc3: gadget: add common endpoint configuration for dwc3 udc driverMarek Szyprowski2015-04-142-1/+31
| | | | | | | | | This patch adds code to select standard, commonly used usb endpoint configuration (ep1in-bulk, ep2out-bulk, ep3in-int) to dwc3 driver. This ensures compatibility with old userspace and windows drivers, which expects hardcoded endpoint numbers. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
* usb: composite: Add .reset callback to usb_gadget_driver structureLukasz Majewski2015-04-141-0/+1
| | | | | | | DWC3 UDC driver requires presence of .reset callback in a composite driver. This setting is similar to the one nowadays present in linux kernel. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: modify usb_gadget_handle_interrupts to take controller indexKishon Vijay Abraham I2015-04-148-14/+14
| | | | | | | | | | | | | | Since we support multiple dwc3 controllers to be existent at the same time, in order to handle the interrupts of a particular dwc3 controller usb_gadget_handle_interrutps should take controller index as an argument. Hence the API of usb_gadget_handle_interrupts is modified to take controller index as an argument and made the corresponding changes to all the usb_gadget_handle_interrupts calls. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: defer setting maxpacket till ->setup()Kishon Vijay Abraham I2015-04-142-2/+4
| | | | | | | | | | | | Taken from linux kernel with commit commit 765f5b830e547229bb752e7b232ee83e2b3d49d5 Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu Jun 23 14:26:11 2011 +0200 usb: gadget: defer setting maxpacket till ->setup() Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: dwc3: Makefile: Make dwc3 driver compile in u-bootKishon Vijay Abraham I2015-04-141-1/+1
| | | | | | | | Now that the entire dwc3 driver is adapted to compile with uboot build, modify the Makefiles so that the dwc3 driver can be built. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: udc: make udc-core compile in u-boot buildKishon Vijay Abraham I2015-04-141-309/+26
| | | | | | | | | | Make udc-core compile in u-boot by removing all linux specific stuff and having only the bare minimal udc-core required for usb gadget drivers. Also modified the file header to a format that is generally being used in u-boot. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: udc: add udc-core from linux kernel to u-bootKishon Vijay Abraham I2015-04-142-0/+641
| | | | | | | | | | | | | | Added udc-core.c from linux kernel 3.19-rc1 (97bf6af1f9) to u-boot. This will be adapted to work with u-boot in the following patches. Adding support for udc will help to seamlessly port dwc3 driver from linux kernel to u-boot (since dwc3 uses udc-core) and it'll also help to add support for multiple gadget controllers to be functional at the same time. All other gadget drivers can also be adapted to use udc-core. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: mass-storage: Build warning fixes for 64-bitThierry Reding2015-04-141-1/+1
| | | | | | | | | | | Fix a printf format mismatch warning seen on 64-bit builds. Cc: Łukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: ci_udc: fix warnings on 64-bit buildsRob Herring2015-04-141-21/+21
| | | | | | | | | | Change addresses to unsigned long to be compatible with 64-bit builds. Regardless of fixing warnings, the device is still only 32-bit capable. Signed-off-by: Rob Herring <robh@kernel.org> Cc: "Łukasz Majewski" <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* net: Add ethernet FCS length macro in net.hBin Meng2015-03-242-2/+0
| | | | | | | | | Some ethernet drivers use their own version of ethernet FCS length macro which is really common. We define ETH_FCS_LEN in net.h and replace those custom versions in various places. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* usb: gadget: fastboot: Set the Serial Number for Fastboot GadgetDileep Katta2015-02-251-0/+5
| | | | | | | | | | | | Configure the serial number using the serial# environment variable during the fastboot bind. This enables "fastboot devices" to return the serial number for the attached devices. Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Acked-by: Steve Rae <srae@broadcom.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* fastboot: OUT transaction length must be aligned to wMaxPacketSizeDileep Katta2015-02-251-5/+22
| | | | | | | | | | | | | | | OUT transactions must be aligned to wMaxPacketSize for each transfer, or else transfer will not complete successfully. This patch modifies rx_bytes_expected to return a transfer length that is aligned to wMaxPacketSize. Note that the value of wMaxPacketSize and ep->maxpacket may not be the same value, and it is the value of wMaxPacketSize that should be used for alignment. wMaxPacketSize is passed depending on the speed of connection. Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: fastboot: Add fastboot eraseDileep Katta2015-02-251-0/+25
| | | | | | | | | | | | Adds the fastboot erase functionality, to erase a partition specified by name. The erase is performed based on erase group size, to avoid erasing other partitions. The start address and the size is aligned to the erase group size for this. Currently only supports erasing from eMMC. Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* fastboot: add support for "oem format" commandRob Herring2015-02-251-0/+11
| | | | | | | | | | | Add "oem format" command to write partition table. This relies on the env variable partitions to contain the list of partitions as required by the gpt command. Note that this does not erase any data other than the partition table. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Steve Rae <srae@broadcom.com>
* fastboot: add "fastboot oem" command supportMichael Scott2015-02-251-0/+15
| | | | | | | | | Add code stub to handle "fastboot oem __" command. As unlock is a common fastboot command, distinguish that it is not implemented. Signed-off-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Steve Rae <srae@broadcom.com>
* usb: gadget: pxa25x_udc: fix use-before-initialized bugAlex Sadovsky2015-01-181-2/+2
| | | | | | | | | | | Fix use-before-initialized bug in pxa25x_udc driver. Function usb_gadget_register_driver calls udc_disable, and udc_disable calls pullup_off that uses dev->mach->udc_command. But dev->mach is initialized in usb_gadget_register_driver after calling udc_disable. This patch fixes the order of initialization. Signed-off-by: Alex Sadovsky <Nable.MainInbox@googlemail.com>
* usb: gadget: f_dfu: Add get_alt function to pass the USB compliance testStefan Roese2015-01-181-0/+8
| | | | | | | | | | | | | | | | | | | | Without this function the USB compliance test (USB 2.0 Command Verifier) will fail in the "Interface Descriptor Test" with this error message: FAIL (1.2.51) A successful GetInterface request must return the alternate setting set by a prior call to SetInterface. Lets add this function to read back the value so that the DFU device fully passes the USB compliance test. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Roger Meier <r.meier@siemens.com> Cc: Samuel Egli <samuel.egli@siemens.com> Cc: Enrico Leto <enrico.leto@siemens.com> Acked-by: Heiko Schocher <hs@denx.de> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* usb: gadget: composite: Fix NULL pointer crash in USB compliance testStefan Roese2015-01-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the DXR2 board (AM335x using MUSB) the USB compliance test suite (USB 2.0 Command Verifier) will cause the board to crash and reset upon the "BOS Descriptor Test - Addressed state". Here the output from the DRX2 while running this test: GADGET DRIVER: usb_dnl_dfu musb-hdrc: peripheral reset irq lost! composite_setup (776) data abort pc : [<87f693ac>] lr : [<87f6911c>] sp : 86f33a58 ip : 00000000 fp : 86f3bbac r10: 00000f00 r9 : 86f33ef4 r8 : 86f37da8 r7 : 00000005 r6 : 86f33a90 r5 : 00000000 r4 : 86f37e30 r3 : 00000000 r2 : 00000000 r1 : 87f9c888 r0 : 00000016 Flags: Nzcv IRQs off FIQs on Mode SVC_32 Resetting CPU ... resetting ... By adding the case statement for USB_DT_BOS and therefore not running into the default case (jump to unkown label) this crash is fixed. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Roger Meier <r.meier@siemens.com> Cc: Samuel Egli <samuel.egli@siemens.com> Cc: Enrico Leto <enrico.leto@siemens.com> Acked-by: Heiko Schocher <hs@denx.de> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
OpenPOWER on IntegriCloud