Browse Source

MA-6860-1 refine fastboot in uboot

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>
imx_v2015.04_3.14.38_6ul7d_beta l5.1.1_2.0.0_7d-beta
Zhang Sanshan 5 years ago
parent
commit
b026e66a5b
8 changed files with 23 additions and 10 deletions
  1. +4
    -2
      common/cmd_fastboot.c
  2. +9
    -4
      drivers/fastboot/fastboot.c
  3. +2
    -1
      include/configs/mx6sabreandroid_common.h
  4. +2
    -1
      include/configs/mx6slevkandroid.h
  5. +2
    -1
      include/configs/mx6sxsabreautoandroid.h
  6. +2
    -1
      include/configs/mx6sxsabresdandroid.h
  7. +1
    -0
      include/configs/mx7dsabresdandroid.h
  8. +1
    -0
      include/fastboot.h

+ 4
- 2
common/cmd_fastboot.c View File

@ -723,8 +723,10 @@ static void process_flash_sata(const char *cmdbuf, char *response)
#if defined(CONFIG_FASTBOOT_STORAGE_MMC)
static int is_sparse_partition(struct fastboot_ptentry *ptn)
{
if (ptn && !strncmp(ptn->name,
FASTBOOT_PARTITION_SYSTEM, strlen(FASTBOOT_PARTITION_SYSTEM))) {
if (ptn && (!strncmp(ptn->name,
FASTBOOT_PARTITION_SYSTEM, strlen(FASTBOOT_PARTITION_SYSTEM))
|| !strncmp(ptn->name,
FASTBOOT_PARTITION_DATA, strlen(FASTBOOT_PARTITION_DATA)))) {
printf("support sparse flash partition for %s\n", ptn->name);
return 1;
} else


+ 9
- 4
drivers/fastboot/fastboot.c View File

@ -65,7 +65,8 @@ enum {
PTN_KERNEL_INDEX,
PTN_URAMDISK_INDEX,
PTN_SYSTEM_INDEX,
PTN_RECOVERY_INDEX
PTN_RECOVERY_INDEX,
PTN_DATA_INDEX
};
struct fastboot_device_info fastboot_devinfo;
@ -823,7 +824,7 @@ static int _fastboot_parts_load_from_ptable(void)
struct mmc *mmc;
block_dev_desc_t *dev_desc;
struct fastboot_ptentry ptable[PTN_RECOVERY_INDEX + 1];
struct fastboot_ptentry ptable[PTN_DATA_INDEX + 1];
/* sata case in env */
if (fastboot_devinfo.type == DEV_SATA) {
@ -870,7 +871,7 @@ static int _fastboot_parts_load_from_ptable(void)
}
memset((char *)ptable, 0,
sizeof(struct fastboot_ptentry) * (PTN_RECOVERY_INDEX + 1));
sizeof(struct fastboot_ptentry) * (PTN_DATA_INDEX + 1));
/* MBR */
strcpy(ptable[PTN_MBR_INDEX].name, "mbr");
ptable[PTN_MBR_INDEX].start = ANDROID_MBR_OFFSET / dev_desc->blksz;
@ -895,8 +896,12 @@ static int _fastboot_parts_load_from_ptable(void)
CONFIG_ANDROID_SYSTEM_PARTITION_MMC,
user_partition,
FASTBOOT_PARTITION_SYSTEM, dev_desc, ptable);
_fastboot_parts_add_ptable_entry(PTN_DATA_INDEX,
CONFIG_ANDROID_DATA_PARTITION_MMC,
user_partition,
FASTBOOT_PARTITION_DATA, dev_desc, ptable);
for (i = 0; i <= PTN_RECOVERY_INDEX; i++)
for (i = 0; i <= PTN_DATA_INDEX; i++)
fastboot_flash_add_ptn(&ptable[i]);
return 0;


+ 2
- 1
include/configs/mx6sabreandroid_common.h View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2014 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright (C) 2013-2015 Freescale Semiconductor, Inc. All Rights Reserved.
*
* SPDX-License-Identifier: GPL-2.0+
*/
@ -46,6 +46,7 @@
#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5
#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_DATA_PARTITION_MMC 4
#undef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_BOOTCOMMAND


+ 2
- 1
include/configs/mx6slevkandroid.h View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2013-2014 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright (C) 2013-2015 Freescale Semiconductor, Inc. All Rights Reserved.
*
* SPDX-License-Identifier: GPL-2.0+
*/
@ -49,6 +49,7 @@
#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5
#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_DATA_PARTITION_MMC 4
/*keyboard mapping*/
#define CONFIG_VOL_DOWN_KEY KEY_BACK


+ 2
- 1
include/configs/mx6sxsabreautoandroid.h View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 Freescale Semiconductor, Inc.
* Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
@ -45,6 +45,7 @@
#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5
#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_DATA_PARTITION_MMC 4
#undef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_BOOTCOMMAND


+ 2
- 1
include/configs/mx6sxsabresdandroid.h View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 Freescale Semiconductor, Inc.
* Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
@ -41,6 +41,7 @@
#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5
#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_DATA_PARTITION_MMC 4
#undef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_BOOTCOMMAND


+ 1
- 0
include/configs/mx7dsabresdandroid.h View File

@ -43,6 +43,7 @@
#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5
#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_DATA_PARTITION_MMC 4
#undef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_BOOTCOMMAND


+ 1
- 0
include/fastboot.h View File

@ -138,6 +138,7 @@
#define FASTBOOT_PARTITION_RECOVERY "recovery"
#define FASTBOOT_PARTITION_SYSTEM "system"
#define FASTBOOT_PARTITION_BOOTLOADER "bootloader"
#define FASTBOOT_PARTITION_DATA "data"
enum {
DEV_SATA,


Loading…
Cancel
Save