summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
Commit message (Collapse)AuthorAgeLines
* MA-9763 Include init.${ro.hardware}.${ro.boot.soc_type}.rc based uboot's ↵rel_imx_4.9.x_1.0.0_gaimx_v2017.03_4.9.11_1.0.0_gaguoyin.chen2017-09-14-0/+28
| | | | | | | | | | | soc_type Append androidboot.soc_type based on the imx soc type, only add imx6/7 support. Change-Id: I3ae18bff42b434eb77728a7db70dd3baf6d7e0a6 Signed-off-by: guoyin.chen <guoyin.chen@nxp.com> Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
* MA-9387 [Android] fastboot: fastboot gpt.img for sd card in androidzhang sanshan2017-07-19-4/+36
| | | | | | | | | we set gpt image in the last lba for sd boot. complete the gpt header, gpt entry and protective MBR according the last lba gpt rule. Change-Id: Icc356a66f82ad359c0243245ab9fdfaea3bccd4f Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9822 Device has to be booted manually to recovery mode to apply the OTA ↵zhang sanshan2017-07-11-4/+4
| | | | | | | | | | | | update when booting from NAND uboot can't get the correct misc info. nand_info[0] is the info of mtd in v2016 or more older version. nand_info[0] hold the pointer of mtd info in v2017. Change-Id: I6b336efeafeed1e0f4e3224f738e72b83f1e09df Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9789 [fastboot]System doesn't enter fastboot mode automatically while ↵zhang sanshan2017-07-10-1/+1
| | | | | | | | | there is no valid gpt partition add command "fastboot 0" Change-Id: Ibad6dcab5213d815ac968034aeef5ff5a0be3b1b Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9409-3 Add base board support for android and android things.zhang sanshan2017-07-10-27/+35
| | | | | | | | | | | | | | | | | | * add board support for android and android things. mx6ul_nxpu_iopb, pico-6ul, pico-imx7d, aquila-6ul reorganize the Kconfig, and fix the redefine issue. * add android configure into configure-while * add a common file mx_android_common.h it will be included by android and android things. defconfig only include ANDROID_THINGS_SUPPORT or ANDROID_SUPPORT * move partition_table_valid into f_fastboot.c. it's a common code. * add invalidate_dcache_range in fixed order. It will have salt invalid issue if we do not add it in order * add display for pico-7d. Change-Id: I6f8a4876c2f8bbd098034d1e3f53033109300bca Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9409-2 fix some issue for android and android thingszhang sanshan2017-07-10-33/+276
| | | | | | | | | | | | | * Add CONFIG_SYSTEM_RAMDISK_SUPPORT to support system's ramdisk * Normal boot: cmdline to bypass ramdisk in boot.img, but use Recovery boot: Use the ramdisk in boot.img * commandline is larger than 512, system can't bootup sometime for commandline issue. * support fastboot getvar. * Support "fastboot erase" command for emmc device. TODO: uboot community have api to operate flash, we can unify this part * support "fastboot flash" even on damaged gpt Change-Id: I080c25d6569d6cab56ff025601cd3b8df21cf3dd
* MA-9409-1 enable avb on android things.zhang sanshan2017-07-10-10/+259
| | | | | | | | | Fix issue for API changed from v2017. porting below patch from v2016. commit 44834fd12f60a090e3d10ab6f84a75460894d49d Change-Id: Ifaf0b86dd29648f9150646f00f54502676df9013 Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9702-2 [Android] Enable booti for android arm64.sanshan zhang2017-07-10-6/+32
| | | | | | | | | | | | boot_addr_start for booti should be the addr of Image rather than boot.img, so need read Image into hdr->kernel_addr. change the offset for bootloader. booti do not call android_image_get_kernel to init android env. booti can't load boot.img, so it can't init android env. init android env through android_image_get_kernel. Change-Id: Ifb990ee9c5710ce7bd5fa9a0d4221dcb0e52d341 Signed-off-by: sanshan zhang <sanshan.zhang@nxp.com>
* MA-9382 [Android]uboot: fix compiler issue and command line issue.zhang sanshan2017-06-21-4/+6
| | | | | | | | Fix compile error when enable CONFIG_NAND_BOOT. Fix data abort issue in uboot. Change-Id: If41a7fafa40a2c851882c723a201ac5cdf31284f Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9376 [Android IMX] uboot: enable lock&unlockzhang sanshan2017-06-21-47/+756
| | | | | | | | | | | | | | | | Fix compile error for api change. Porting below patches from v2015.o4: MA-7875 Enable CAAM for i.MX6 MA-7875-1 Support fastboot lock&unlock in u-boot MA-7875-2 Support fastboot lock/unlock in i.MX6 platform MA-7875-3 Support fastboot lock/unlock in i.MX6UL MA-8425 fastboot: return OKAY in fastboot erase MA-8418 fix return value check for get_device_and_partition MA-8622 - [brillo] fix uboot compile warnings and code style warnings Change-Id: I2370c3e5851cc1f92aaa93c200e6c079f7929af2 Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MA-9375 [Android IMX] uboot: enable BCB and bootctrlzhang sanshan2017-06-21-124/+1053
| | | | | | | | | * Add API to read\write MISC partition. * get the boot mode from BCB command when boot up. * get the boot up tactics from bootctrl. Change-Id: Icbba6340e10983dddc1b04804ecc012a3a3c57d0 Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
* MLK-14627 android: Fix cache unaligned warningYe Li2017-04-06-3/+36
| | | | | | | | The sparse image writing and boot image reading may have cache unaligned problem. The u-boot v2017 will print warning at runtime. This patch fixes the unaligned problem. Signed-off-by: Ye Li <ye.li@nxp.com>
* MA-9263-3 [Android] Partition: enable GPT partition on imx devicesSanshan Zhang2017-04-05-12/+71
| | | | | | | | | | | | | 1. pass androidboot.storage_type to android, 'init' use it to parse different init.freescale.storage.rc. 2. store new ptable with gpt partition. 3. we use the last LBA as backup gpt table, there is many warning log when boot, change print to debug Change-Id: I84070735e9d4c2741b0e240bc1c61b357dabc5b8 Signed-off-by: Sanshan Zhang <sanshan.zhang@nxp.com> (cherry picked from commit da0ce2787256a323371641b0764266d386d767a5) Signed-off-by: Ye Li <ye.li@nxp.com>
* MLK-12527-2 android: Add FSL android fastboot supportYe Li2017-04-05-0/+1766
| | | | | | | | | | | | | | | | | | | | | | Integrate the FSL android fastboot features into community's fastboot. 1. Use USB gadget g_dnl driver 2. Integrate the FSL SD/SATA/NAND flash operations, since the GPT and EFI partitions are not support by i.MX. 3. Add FDT support to community's android image. 4. Add a new boot command "boota" for android image boot. The boota implements to load ramdisk and fdt to their loading addresses specified in boot.img header, while bootm won't do it for android image. 5. Support the authentication of boot.img at the "load_addr" for both SD and NAND. 6. We use new configuration CONFIG_FSL_FASTBOOT for Freescale's fastboot with relevant header file "fsl_fastboot.h". While disabling the configuration, the community fastboot is used. 7. Overwrite the cmdline in boot.img by using bootargs saved in local environment. 8. Add recovery and reboot-bootloader support. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 23d63ff185929fff5e392efc853d69b606ba081a)
* usb: gadget: f_dfu: set serial number if serial# is validFelipe Balbi2017-02-26-0/+5
| | | | | | | With this patch, USB Command Verifier is happy with our DFU implementation on Chapter 9 tests. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* usb: gadget: g_dnl: fix g_dnl_set_serialnumber()Felipe Balbi2017-02-26-2/+1
| | | | | | | | | | | | | instead of only copying if strlen(s) is less than 32 characters, let's just copy at most 31 characters regardless of the size of serial#. This will guarantee that we always have a serial number if serial# environment variable is set to anything. Note that without a proper serial number, USB Command Verifier fails our test of Device Descriptor since we will claim to have a serial number without really providing one when requested. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* usb: gadget: f_dfu: write req->actual bytesFelipe Balbi2017-02-26-1/+1
| | | | | | | | | If last packet is short, we shouldn't write req->length bytes to non-volatile media, we should write only what's available to us, which is held in req->actual. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* usb: gadget: dfu: add result for handle_getstatus()Patrick Delaunay2017-02-26-22/+13
| | | | | | | | harmonize result with other handle_XXX() functions: return int for size remove the define RET_STAT_LEN : no more necessary Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
* usb: gadget: dfu: correct size for USB_REQ_DFU_GETSTATE resultPatrick Delaunay2017-02-26-11/+11
| | | | | | | | | | | | | | | return the correct size for DFU_GETSTATE result (1 byte in DFU 1.1 spec) to avoid issue in USB protocol and the variable "value" is propagated to req->lenght as all the in the other request with answer - DFU_GETSTATUS - DFU_DNLOAD - DFU_UPLOAD Then the buffer is correctly treated in USB driver NB: it was the only request witch directly change "req->actual" Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
* usb: gadget: dfu: add functional descriptor in descriptor setPatrick Delaunay2017-02-26-1/+9
| | | | | | | | | | | The "DFU descriptor set" must contain the "DFU functional descriptor" but it is missing today in U-Boot code (cf: DFU spec 1.1, chapter 4.2 DFU Mode Descriptor Set) This patch only allocate buffer and copy DFU functional descriptor after interfaces. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
* drivers: usb: gadget: ether: Fix compiler warningLokesh Vutla2017-01-17-0/+2
| | | | | | | | | | | Latest gcc 6.2 compiler is throwing the below warning for am335x_baltos_defconfig drivers/usb/gadget/ether.c:501:17: warning: 'mdlm_detail_desc' defined but not used [-Wunused-const-variable=] static const u8 mdlm_detail_desc[] = { Guard mdlm_detail_desc with CONFIG_USB_ETH_SUBSET to avoid the warning Reported-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* usb: dwc2-otg: remove unused variableMasahiro Yamada2017-01-17-2/+0
| | | | | | | | | | | GCC 6.1 complains about this. drivers/usb/gadget/dwc2_udc_otg.c:72:19: warning: 'driver_desc' defined but not used [-Wunused-const-variable=] static const char driver_desc[] = DRIVER_DESC; ^~~~~~~~~~~ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* drivers: usb: gadget: ether/rndis: convert driver to adopt device driver modelMugunthan V N2017-01-09-15/+174
| | | | | | Adopt usb ether gadget and rndis driver to adopt driver model Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
* usb: gadget: remove unused shortname variableAndre Przywara2016-12-04-1/+0
| | | | | | | | | | | The shortname variable isn't referenced anywhere in the code, so just remove it. Pointed out by a GCC 6.2 default warning option. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
* drivers: usb: gadget: ether: prepare driver for driver model migrationMugunthan V N2016-12-02-21/+52
| | | | | | | prepare driver for driver model migration Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* drivers: usb: gadget: ether: use net device priv to pass usb ether privMugunthan V N2016-12-02-25/+21
| | | | | | | | | Use net device priv to pass usb ether priv and use it in net device ops callback. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* drivers: usb: gadget: ether: consolidate global devices to single structMugunthan V N2016-12-02-27/+26
| | | | | | | | | | Consolidate the net device, usb eth device and gadget device struct to single struct and a single global variable so that the same can be passed as priv of ethernet driver. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* drivers: usb: gadget: ether: adopt to usb driver modelMugunthan V N2016-12-02-0/+36
| | | | | | | | Convert usb ether gadget to adopt usb driver model Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* drivers: usb: gadget: ether: access network_started using local variableMugunthan V N2016-12-02-5/+5
| | | | | | | | | network_started of struct eth_dev can be accessed using local variable dev and no reason to access it with the global struct. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* spl: add USB Gadget config optionStefan Agner2016-11-28-1/+2
| | | | | | | | | Introduce USB Gadget config option. This allows to combine Makefile entries for SPL_USBETH_SUPPORT and SPL_DFU_SUPPORT. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Ravi Babu <ravibabu@ti.com>
* spl: dfu: move DFU Kconfig to SPL KconfigStefan Agner2016-11-28-2/+6
| | | | | | | | | | | | | | | | The DFU Kconfig menu entries should be part of the SPL Kconfig file. Also avoid using the top level Makefile by moving the config dependent build artifacts to the driver/ and driver/usb/gadget/ Makfiles. With that, DFU can be built again in SPL if CONFIG_SPL_DFU_SUPPORT is enabled. Fixes: 6ad6102246d8 ("usb:gadget: Disallow DFU in SPL for now") Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
* usb:gadget: Disallow DFU in SPL for nowTom Rini2016-09-27-0/+2
| | | | | | | | | | Previously, DFU was not built in for SPL and often disabled via the board config.h file, in the SPL build. By moving DFU to Kconfig we now need to move this logic to the Makefile to continue to allow boards to fit within their SPL size limit (until gcc 6 is more widespread and unused strings will be discarded). Signed-off-by: Tom Rini <trini@konsulko.com>
* Move ENOTSUPP defines to include/linux/errno.hMasahiro Yamada2016-09-23-2/+0
| | | | | | Collect a couple of duplicated defines into a single place. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada2016-09-23-12/+12
| | | | | | | | | | | Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have the same content. (both just wrap <asm-generic/errno.h>) Replace all include directives for <asm/errno.h> with <linux/errno.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Fixup include/clk.] Signed-off-by: Tom Rini <trini@konsulko.com>
* fastboot: implement KconfigSteve Rae2016-08-20-0/+5
| | | | | | implement Kconfig for the 'fastboot' feature set Signed-off-by: Steve Rae <steve.rae@raedomain.com>
* usb: dwc2 : invalidate dcache before starting DMAXu Ziyuan2016-07-25-0/+3
| | | | | | | | | | | | Invalidate dcache before starting the DMA to ensure coherency. In case there are any dirty lines from the DMA buffer in the cache, subsequent cache-line replacements may corrupt the buffer in memory while the DMA is still going on. Cache-line replacement can happen if the CPU tries to bring some other memory locations into the cache while the DMA is going on. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
* usb: dwc2-otg: adjust fifo size via platform dataXu Ziyuan2016-07-25-9/+19
| | | | | | | | The total FIFO size of some SoCs may be different from the existen, this patch supports fifo size setting from platform data. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
* fastboot: sparse: resync common/image-sparse.c (part 2)Steve Rae2016-06-27-12/+19
| | | | | | | | | | | | | | | | - update fastboot_okay() and fastboot_fail() This file originally came from upstream code. While retaining the storage abstraction feature, this is the second set of the changes required to resync with the cmd_flash_mmc_sparse_img() in the file aboot.c from https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1 Signed-off-by: Steve Rae <srae@broadcom.com>
* fastboot: sparse: remove session-id logicSteve Rae2016-06-27-14/+2
| | | | | | | This "session-id" alogrithm is not required, and currently corrupts the stored image whenever more the one "session" is required. Signed-off-by: Steve Rae <srae@broadcom.com>
* usb: dwc2_udc_otg: support 8-bit interfaceSteve Rae2016-06-13-0/+14
| | | | | | | Define CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8 to allow the physical interface to be 8-bit (rather than 16-bit). Signed-off-by: Steve Rae <srae@broadcom.com>
* usb: gadget: dfu: discard dead codePeng Fan2016-05-06-9/+1
| | | | | | | | | | | | | | Reported by Coverity: Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this statement: (f_dfu->strings + --i).s = .... If calloc failed, i is still 0 and no need to call free, so discard the dead code. Signed-off-by: Peng Fan <van.freenix@gmail.com> Cc: "Łukasz Majewski" <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* Fix spelling of "occurred".Vagrant Cascadian2016-05-02-1/+1
| | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* usb: s3c-otg: Fix remaining bytes in debug messagesRoger Quadros2016-04-25-2/+2
| | | | | | | | | | Remaining bytes means bytes that are not yet transferred and not the bytes that were transferred in the last transfer. Reported-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Tested-by: Steve Rae <srae@broadcom.com> [Test HW: bcm28155_ap board]
* usb: s3c-otg: Fix short packet for request size > ep.maxpacketRoger Quadros2016-04-25-1/+1
| | | | | | | | | | | | | | Request size can be greater than ep.packet and still end in a short packet. We need to tackle this case as end of transfer (if short_not_ok is not set) as indicated in USB 2.0 Specification [1], else we get stuck up on certain protocols like fastboot. [1] - USB2.0 Specification, Section 5.3.2 Pipes Reported-by: Steve Rae <steve.rae@broadcom.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Tested-by: Steve Rae <steve.rae@broadcom.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com>
* fastboot: Clean up bulk-out logicRoger Quadros2016-04-25-27/+23
| | | | | | | | Just use ep->maxpacket to get the maxpacket size and simplify the bulk-out maxpacket alignment. Signed-off-by: Roger Quadros <rogerq@ti.com> Tested-by: Steve Rae <srae@broadcom.com>
* fastboot: Enable the respective speed endpoints at runtimeRoger Quadros2016-04-25-7/+17
| | | | | | | | | | In a dual speed configuration we need to check at runtime if we want to enable the Full-Speed or High-Speed endpoint. Signed-off-by: Roger Quadros <rogerq@ti.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Steve Rae <srae@broadcom.com> [Test HW: bcm235xx board]
* fastboot: Fix wMaxPacketSize for High-Speed IN endpointRoger Quadros2016-04-25-9/+27
| | | | | | | | | | | | | | wMaxPacketSize for IN endpoing in High-Speed must be 512 and not 64. While fixing that we do some clean ups like - use cpu_to_le16(decimal_length) instead of hexadecimal length. - No need to initialize bInterval to 0. Static variables are 0 initialized. - Move descriptor setting from fastboot_add to to fastboot_bind. - check for dual speed configuration before setting the high speed descriptors. Signed-off-by: Roger Quadros <rogerq@ti.com> Tested-by: Steve Rae <srae@broadcom.com> Tested-by: Steve Rae <srae@broadcom.com> [Test HW: bcm235xx board]
* usb: gadget Move: CONFIG_G_DNL_* to KconfigSam Protsenko2016-04-20-1/+14
| | | | | | And also reformat defconfigs using "make savedefconfig" rule. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
* usb: gadget: Move CONFIG_USB_GADGET_DOWNLOAD to KconfigSam Protsenko2016-04-20-0/+6
| | | | | | | While at it, remove obsolete CONFIG_USBDOWNLOAD_GADGET option from some config headers. This is also probably fixes am335x_baltos board. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
* usb: gadget: Move CONFIG_USB_GADGET_DUALSPEED to KconfigSam Protsenko2016-04-20-0/+27
| | | | | | | | | | | | | | | | | | | | | | Move CONFIG_USB_GADGET_DUALSPEED option to Kconfig and make all UDC controllers select USB_GADGET_DUALSPEED: - add next options to Kconfig selecting USB_GADGET_DUALSPEED: - USB_GADGET_ATMEL_USBA - USB_GADGET_DWC2_OTG - USB_DWC3 - CI_UDC - make USB_MUSB_GADGET select USB_GADGET_DUALSPEED While at it, make some related fixes: - remove DUALSPEED from configs that don't enable gadget support: - kwb.h - tseries.h - add missing USB_GADGET option to next configs: - novena_defconfig - pcm051_rev*_defconfig - xfi3_defconfig Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>