mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 12:01:31 +00:00
fastboot: mmc: Add CONFIG_FASTBOOT_MMC_USER_SUPPORT
Split userdata and boot partition support for eMMC update and correct the description (update is supported). The new configuration CONFIG_FASTBOOT_MMC_USER_SUPPORT allows to activate support of userdata partition update, based on target name=CONFIG_FASTBOOT_MMC_USER_NAME This patch also removes the unnecessary dependency with ARCH_MEDIATEK and EFI_PARTITION. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
parent
a362ce214f
commit
7596696bc5
5 changed files with 26 additions and 8 deletions
|
@ -29,6 +29,7 @@ CONFIG_FASTBOOT_BUF_SIZE=0x1e00000
|
||||||
CONFIG_FASTBOOT_FLASH=y
|
CONFIG_FASTBOOT_FLASH=y
|
||||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
||||||
CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
|
CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
|
||||||
|
CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
|
||||||
CONFIG_DM_MMC=y
|
CONFIG_DM_MMC=y
|
||||||
CONFIG_MMC_HS200_SUPPORT=y
|
CONFIG_MMC_HS200_SUPPORT=y
|
||||||
CONFIG_MMC_MTK=y
|
CONFIG_MMC_MTK=y
|
||||||
|
|
|
@ -25,6 +25,7 @@ CONFIG_FASTBOOT_BUF_SIZE=0x1E00000
|
||||||
CONFIG_FASTBOOT_FLASH=y
|
CONFIG_FASTBOOT_FLASH=y
|
||||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
||||||
CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
|
CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
|
||||||
|
CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
|
||||||
CONFIG_DM_MMC=y
|
CONFIG_DM_MMC=y
|
||||||
CONFIG_MMC_HS200_SUPPORT=y
|
CONFIG_MMC_HS200_SUPPORT=y
|
||||||
CONFIG_MMC_MTK=y
|
CONFIG_MMC_MTK=y
|
||||||
|
|
|
@ -53,6 +53,7 @@ CONFIG_FASTBOOT_BUF_SIZE=0x4000000
|
||||||
CONFIG_FASTBOOT_FLASH=y
|
CONFIG_FASTBOOT_FLASH=y
|
||||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
||||||
CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
|
CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
|
||||||
|
CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
|
||||||
# CONFIG_INPUT is not set
|
# CONFIG_INPUT is not set
|
||||||
CONFIG_DM_MMC=y
|
CONFIG_DM_MMC=y
|
||||||
# CONFIG_MMC_QUIRKS is not set
|
# CONFIG_MMC_QUIRKS is not set
|
||||||
|
|
|
@ -124,14 +124,26 @@ config FASTBOOT_MMC_BOOT1_NAME
|
||||||
defined here.
|
defined here.
|
||||||
The default target name for updating EMMC_BOOT1 is "mmc0boot0".
|
The default target name for updating EMMC_BOOT1 is "mmc0boot0".
|
||||||
|
|
||||||
|
config FASTBOOT_MMC_USER_SUPPORT
|
||||||
|
bool "Enable eMMC userdata partition flash/erase"
|
||||||
|
depends on FASTBOOT_FLASH_MMC
|
||||||
|
help
|
||||||
|
Define this to enable the support "flash" and "erase" command on
|
||||||
|
eMMC userdata. The "flash" command only update the MBR and GPT
|
||||||
|
header when CONFIG_EFI_PARTITION is supported.
|
||||||
|
The "erase" command erase all the userdata.
|
||||||
|
This occurs when the specified "partition name" on the
|
||||||
|
fastboot command line matches the value CONFIG_FASTBOOT_MMC_USER_NAME.
|
||||||
|
|
||||||
config FASTBOOT_MMC_USER_NAME
|
config FASTBOOT_MMC_USER_NAME
|
||||||
string "Target name for erasing EMMC_USER"
|
string "Target name for updating EMMC_USER"
|
||||||
depends on FASTBOOT_FLASH_MMC && EFI_PARTITION && ARCH_MEDIATEK
|
depends on FASTBOOT_MMC_USER_SUPPORT
|
||||||
default "mmc0"
|
default "mmc0"
|
||||||
help
|
help
|
||||||
The fastboot "erase" command supports erasing EMMC_USER. This occurs
|
The fastboot "flash" and "erase" command supports EMMC_USER.
|
||||||
when the specified "EMMC_USER name" on the "fastboot erase" commands
|
This occurs when the specified "EMMC_USER name" on the
|
||||||
match the value defined here.
|
"fastboot flash" and the "fastboot erase" commands match the value
|
||||||
|
defined here.
|
||||||
The default target name for erasing EMMC_USER is "mmc0".
|
The default target name for erasing EMMC_USER is "mmc0".
|
||||||
|
|
||||||
config FASTBOOT_GPT_NAME
|
config FASTBOOT_GPT_NAME
|
||||||
|
|
|
@ -174,7 +174,8 @@ static void write_raw_image(struct blk_desc *dev_desc,
|
||||||
fastboot_okay(NULL, response);
|
fastboot_okay(NULL, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT
|
#if defined(CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT) || \
|
||||||
|
defined(CONFIG_FASTBOOT_MMC_USER_SUPPORT)
|
||||||
static int fb_mmc_erase_mmc_hwpart(struct blk_desc *dev_desc)
|
static int fb_mmc_erase_mmc_hwpart(struct blk_desc *dev_desc)
|
||||||
{
|
{
|
||||||
lbaint_t blks;
|
lbaint_t blks;
|
||||||
|
@ -193,7 +194,9 @@ static int fb_mmc_erase_mmc_hwpart(struct blk_desc *dev_desc)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT
|
||||||
static void fb_mmc_boot1_ops(struct blk_desc *dev_desc, void *buffer,
|
static void fb_mmc_boot1_ops(struct blk_desc *dev_desc, void *buffer,
|
||||||
u32 buff_sz, char *response)
|
u32 buff_sz, char *response)
|
||||||
{
|
{
|
||||||
|
@ -473,7 +476,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_NAME
|
#ifndef CONFIG_FASTBOOT_MMC_USER_SUPPORT
|
||||||
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
|
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
|
||||||
#else
|
#else
|
||||||
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0 ||
|
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0 ||
|
||||||
|
@ -603,7 +606,7 @@ void fastboot_mmc_erase(const char *cmd, char *response)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FASTBOOT_MMC_USER_NAME
|
#ifdef CONFIG_FASTBOOT_MMC_USER_SUPPORT
|
||||||
if (strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
|
if (strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
|
||||||
/* erase EMMC userdata */
|
/* erase EMMC userdata */
|
||||||
if (fb_mmc_erase_mmc_hwpart(dev_desc))
|
if (fb_mmc_erase_mmc_hwpart(dev_desc))
|
||||||
|
|
Loading…
Add table
Reference in a new issue