summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/f_fastboot.c
Commit message (Collapse)AuthorAgeLines
* MA-7373 - [brillo]: store slot meta data in a raw partition, no file system.fang hui2015-12-24-4/+4
| | | | | | | | | | | | Partition name change from slotmeta to misc. Read/write raw data on partition misc, not use ext4 file system. Store meta in bootloader_message.slot_suffix, as defined in bootable/recovery/bootloader.h The first 4 bytes of boot_ctl are defined as magic number. Signed-off-by: fang hui <b31070@freescale.com>
* MA-7251 - [evk_6ul]: Support boot conctrol for brillofang hui2015-11-13-24/+119
| | | | | | | | | brillo need bootlader support boot control. bootlader can choose which slot(partition) to boot based on it's tactic. The commit support boot control for evk6ul Signed-off-by: fang hui <b31070@freescale.com>
* MA-7157 Check the error log in fastboot flashzhang sanshan2015-11-06-0/+2
| | | | | | | | The fastboot.exe will get var partition-type:* firstly when "fastboot flash * *". The uboot did not support get var partition-type: default. This patch mask info the error when gat cat partition-type. Signed-off-by: zhang sanshan <b51434@freescale.com>
* MA-6928 Bootargs cannot be setzhang sanshan2015-07-28-20/+0
| | | | | | | | | The bootargs is not set correctly. The final bootargs consist of uboot's bootargs and bootimg's bootargs. This patch set bootimg's bootargs as final bootargs if uboot's bootargs is not set. And take uboot's bootargs as final bootargs if uboot's bootargs is set. Signed-off-by: zhang sanshan <b51434@freescale.com>
* MA-6924 [Android_MX6_MX7] fastboot: 'fastboot reboot-bootloader' do not workzhang sanshan2015-07-27-6/+6
| | | | | | | | 'fastboot reboot-bootloader' is took as 'fastboot reboot' in V2015.04. The length of fastboot command is decided by the length of cmd_dispatch_info's cmd. So need put reboot-bootloader in front of reboot. Signed-off-by: zhang sanshan <b51434@freescale.com>
* MLK-11228-3 android: Add "data" partition in fastbootYe.Li2015-07-13-6/+13
| | | | | | | | | Enable fastboot command "fastboot flash data" Custom may need to update data partition in fastboot mode. This patch enable flash data partition in emmc\sd. Signed-off-by: Zhang Sanshan <b51434@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com>
* MLK-11228-2 android: Add fastboot command "reboot-bootloader" supportYe.Li2015-07-13-3/+17
| | | | | | | | | enable fastboot command: "fastboot reboot-bootloader" After type this command, the board will reboot to bootloader mode. Set ANDROID_FASTBOOT_BOOT flag in SNVS_LPGPR before reboot. Signed-off-by: Zhang Sanshan <b51434@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com>
* MLK-11228-1 android: Integrate community fastboot with FSL i.MX fastbootYe.Li2015-07-13-1/+1745
| | | | | | | | | | | | | | | | | | | | | 1. Replace the UDC driver with community's USB gadget d_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. Change the booti command to boota, due to the booti has been used for ARM64 image boot. 5. Modify boota implementation to load ramdisk and fdt to their loading addresses specified in boot.img header, while bootm won't do it for android image. 6. Modify the android image HAB implementation. Authenticate the boot.img on the "load_addr" for both SD and NAND. 7. Enable 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. 8. Use community's way to combine cmdline in boot.img and u-boot environment, not overwrite the cmdline in boot.img Signed-off-by: Ye.Li <B37916@freescale.com>
* usb: gadget: fastboot: Set the Serial Number for Fastboot GadgetDileep Katta2015-02-25-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-25-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-25-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-25-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-25-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>
* fastboot: add support for continue commandRob Herring2014-12-18-0/+14
| | | | | | | | | | | | The fastboot continue command is defined to exit fastboot and continue autoboot. This commit implements the continue command and the exiting of fastboot only. Subsequent u-boot commands can be processed after exiting fastboot. Autoboot should implement a boot script such as "fastboot; mmc read <...>; bootm" to fully implement the fastboot continue function. Signed-off-by: Rob Herring <robh@kernel.org> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [TestHW: Exynos4412-Trats2]
* usb: gadget: fastboot: terminate commands with NULLEric Nelson2014-10-06-1/+8
| | | | | | | | | | | Without NULL termination, various commands will read past the end of input. In particular, this was noticed with error() calls in cb_getvar and simple_strtoul() in cb_download. Since the download callback happens elsewhere, the 4k buffer should always be sufficient to handle command arguments. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
* usb: gadget: fastboot: explicitly set radix of maximum download sizeEric Nelson2014-10-06-1/+1
| | | | | | | | | | | | The processing of the max-download-size variable requires a radix specifier, or the fastboot host tool will interpret it as an octal number. See function get_target_sparse_limit() in file fastboot/fastboot.c in the AOSP: https://android.googlesource.com/platform/system/core/+/master Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
* usb: gadget: fastboot: add max-download-size variableEric Nelson2014-10-06-1/+2
| | | | | | | | | | | | Current Android Fastboot seems to use 'max-download-size' instead of 'downloadsize' variable to indicate the maximum size of sparse segments. See function get_target_sparse_limit() in file fastboot/fastboot.c in the AOSP: https://android.googlesource.com/platform/system/core/+/master Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
* usb: gadget: fastboot: improve download progress barBo Shen2014-10-06-5/+9
| | | | | | | | | | | | When download is ongoing, if the actual size of one transfer is not the same as BYTES_PER_DOT, which will cause the dot won't print anymore. Then it will let the user thinking it is stuck, actually it is transfering without dot printed. So, improve the method to show the progress bar (print dot). Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Marek Vasut <marex@denx.de>
* usb/gadget: fastboot: minor cleanupSteve Rae2014-09-24-5/+10
| | | | | | | | | | - update static function - additional debugging statements - update "fastboot command" information - add missing include file - update spelling Signed-off-by: Steve Rae <srae@broadcom.com>
* usb/gadget: fastboot: add support for flash commandSteve Rae2014-09-24-0/+31
| | | | | | | | - implement 'fastboot flash' for eMMC devices Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Marek Vasut <marex@denx.de>
* usb: fastboot: fix potential buffer overflowJeroen Hofstee2014-06-25-4/+7
| | | | | | | | | | | cb_getvar tries to prevent overflowing the response buffer by using strncat. But strncat takes the number of data bytes copied as a limit not the total buffer length so it can still overflow. Pass the correct value instead. cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cc: Rob Herring <robh@kernel.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* usb/gadget: add the fastboot gadgetSebastian Siewior2014-05-08-0/+513
This patch contains an implementation of the fastboot protocol on the device side and documentation. This is based on USB download gadget infrastructure. The fastboot function implements the getvar, reboot, download and reboot commands. What is missing is the flash handling i.e. writting the image to media. v3 (Rob Herring): This is based on http://patchwork.ozlabs.org/patch/126798/ with the following changes: - Rebase to current mainline and updates for current gadget API - Use SPDX identifiers for licenses - Traced the history and added missing copyright to cmd_fastboot.c - Use load_addr/load_size for transfer buffer - Allow vendor strings to be optional - Set vendor/product ID from config defines - Allow Ctrl-C to exit fastboot mode v4: - Major re-write to use the USB download gadget. Consolidated function code to a single file. - Moved globals into single struct. - Use puts and putc as appropriate. - Added CONFIG_USB_FASTBOOT_BUF_ADDR and CONFIG_USB_FASTBOOT_BUF_SIZE to set the fastboot transfer buffer. v5: - Add CONFIG option documentation to README - Rebase using new downloader registration Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rob Herring <robh@kernel.org>