mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-25 07:41:40 +02:00
Fix flashing of eMMC user area with Fastboot
'gpt' and 'mmc0' fastboot partitions have been treated as the same device, but it is wrong. Fill disk_partition structure with eMMC user partition info to properly flash data. Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Marek Vasut <marex@denx.de> Cc: Sean Anderson <sean.anderson@seco.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
This commit is contained in:
parent
389b676536
commit
55a202f64b
@ -512,7 +512,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
|
|||||||
u32 download_bytes, char *response)
|
u32 download_bytes, char *response)
|
||||||
{
|
{
|
||||||
struct blk_desc *dev_desc;
|
struct blk_desc *dev_desc;
|
||||||
struct disk_partition info;
|
struct disk_partition info = {0};
|
||||||
|
|
||||||
#ifdef CONFIG_FASTBOOT_MMC_BOOT_SUPPORT
|
#ifdef CONFIG_FASTBOOT_MMC_BOOT_SUPPORT
|
||||||
if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT1_NAME) == 0) {
|
if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT1_NAME) == 0) {
|
||||||
@ -532,12 +532,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(EFI_PARTITION)
|
#if CONFIG_IS_ENABLED(EFI_PARTITION)
|
||||||
#ifndef CONFIG_FASTBOOT_MMC_USER_SUPPORT
|
|
||||||
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
|
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
|
||||||
#else
|
|
||||||
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0 ||
|
|
||||||
strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
|
|
||||||
#endif
|
|
||||||
dev_desc = fastboot_mmc_get_dev(response);
|
dev_desc = fastboot_mmc_get_dev(response);
|
||||||
if (!dev_desc)
|
if (!dev_desc)
|
||||||
return;
|
return;
|
||||||
@ -599,7 +594,20 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fastboot_mmc_get_part_info(cmd, &dev_desc, &info, response) < 0)
|
#if CONFIG_IS_ENABLED(FASTBOOT_MMC_USER_SUPPORT)
|
||||||
|
if (strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
|
||||||
|
dev_desc = fastboot_mmc_get_dev(response);
|
||||||
|
if (!dev_desc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
strlcpy((char *)&info.name, cmd, sizeof(info.name));
|
||||||
|
info.size = dev_desc->lba;
|
||||||
|
info.blksz = dev_desc->blksz;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!info.name[0] &&
|
||||||
|
fastboot_mmc_get_part_info(cmd, &dev_desc, &info, response) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (is_sparse_image(download_buffer)) {
|
if (is_sparse_image(download_buffer)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user