summaryrefslogtreecommitdiffstats
path: root/common/fb_mmc.c
Commit message (Collapse)AuthorAgeFilesLines
* mmc: Use lldiv() for 64-bit division in write_raw_image()Siarhei Siamashka2015-11-121-1/+2
| | | | | | | | | | | | | This fixes compilation problems when using a hardfloat toolchain on ARM, which manifest themselves as "libgcc.a(_udivmoddi4.o) uses VFP register arguments, u-boot does not". These problems have been reported in the U-Boot mailing list: http://lists.denx.de/pipermail/u-boot/2015-October/230314.html http://lists.denx.de/pipermail/u-boot/2015-October/231908.html Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* sparse: Rename the file and headerMaxime Ripard2015-11-121-1/+1
| | | | | | | | | | | | The Android sparse image format is currently supported through a file called aboot, which isn't really such a great name, since the sparse image format is only used for transferring data with fastboot. Rename the file and header to a file called "sparse", which also makes it consistent with the header defining the image structures. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: Implement flashing session counterMaxime Ripard2015-11-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fastboot flash command that writes an image to a partition works in several steps: 1 - Retrieve the maximum size the device can download through the "max-download-size" variable 2 - Retrieve the partition type through the "partition-type:%s" variable, that indicates whether or not the partition needs to be erased (even though the fastboot client has minimal support for that) 3a - If the image is smaller than what the device can handle, send the image and flash it. 3b - If the image is larger than what the device can handle, create a sparse image, and split it in several chunks that would fit. Send the chunk, flash it, repeat until we have no more data to send. However, in the 3b case, the subsequent transfers have no particular identifiers, the protocol just assumes that you would resume the writes where you left it. While doing so works well, it also means that flashing two subsequent images on the same partition (for example because the user made a mistake) would not work withouth flashing another partition or rebooting the board, which is not really intuitive. Since we have always the same pattern, we can however maintain a counter that will be reset every time the client will retrieve max-download-size, and incremented after each buffer will be flashed, that will allow us to tell whether we should simply resume the flashing where we were, or start back at the beginning of the partition. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* sparse: Implement storage abstractionMaxime Ripard2015-11-121-4/+41
| | | | | | | | | | | The current sparse image parser relies heavily on the MMC layer, and doesn't allow any other kind of storage medium to be used. Rework the parser to support any kind of storage medium, as long as there is an implementation for it. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: Move fastboot response functions to fastboot coreMaxime Ripard2015-11-121-28/+17
| | | | | | | | | | The functions and a few define to generate a fastboot message to be sent back to the host were so far duplicated among the users. Move them all to a common place. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: check for alias when looking up partition by nameMichael Scott2015-04-141-2/+24
| | | | | | | | | | | | | | | | | Implement an alias name check for devices where GPT limitations prevent user-friendly partition names such as "boot", "system" and "cache". Or, where the actual partition name doesn't match a standard partition name used commonly with fastboot. To set an alias, add an environment setting as follows: fastboot_partition_alias_<alias partition name>=<actual partition name> Example: fastboot_partition_alias_boot=LNX Signed-off-by: Michael Scott <michael.scott@linaro.org> Acked-by: Steve Rae <srae@broadcom.com> Cc: Steve Rae <srae@broadcom.com> Cc: Lukasz Majewski <l.majewski@samsung.com>
* fastboot: Correct fastboot_fail and fastboot_okay stringsDileep Katta2015-02-251-2/+2
| | | | | | | | | | | If the string is copied without NULL termination using strncpy(), then strncat() on the next line, may concatenate the string after some stale (or random) data, if the response string was not zero-initialized. Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Reviewed-by: Steve Rae <srae@broadcom.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
* usb: gadget: fastboot: Add fastboot eraseDileep Katta2015-02-251-0/+56
| | | | | | | | | | | | 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: handle flash write to GPT partitionsSteve Rae2014-12-181-3/+23
| | | | | | | | | | | Implement a feature to allow fastboot to write the downloaded image to the space reserved for the Protective MBR and the Primary GUID Partition Table. Additionally, prepare and write the Backup GUID Partition Table. Signed-off-by: Steve Rae <srae@broadcom.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [Test HW: Exynos4412 - Trats2]
* usb/gadget: fastboot: implement sparse formatSteve Rae2014-09-241-10/+22
| | | | | | | - add capability to "fastboot flash" with sparse format images Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
* usb/gadget: fastboot: add eMMC support for flash commandSteve Rae2014-09-241-0/+80
- add support for 'fastboot flash' command for eMMC devices Signed-off-by: Steve Rae <srae@broadcom.com>
OpenPOWER on IntegriCloud