mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
fastboot: add command to select the default emmc hwpart for boot
Add fastboot command oem partconf which executes the command ``mmc partconf <id> <arg> 0`` on the current <id> mmc device to configure the eMMC boot partition with <arg>: boot_ack boot_partition, so the command is: $> fastboot oem partconf:<boot_ack> <boot_partition> The partition_access argument is forced to 0 (userdata) Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> [lukma - Kconfig adjustments after merging this patch]
This commit is contained in:
parent
3acbc7b2aa
commit
b2f6b97b78
4 changed files with 48 additions and 0 deletions
|
@ -42,6 +42,9 @@ static void reboot_recovery(char *, char *);
|
|||
#if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_FORMAT)
|
||||
static void oem_format(char *, char *);
|
||||
#endif
|
||||
#if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_PARTCONF)
|
||||
static void oem_partconf(char *, char *);
|
||||
#endif
|
||||
|
||||
static const struct {
|
||||
const char *command;
|
||||
|
@ -99,6 +102,12 @@ static const struct {
|
|||
.dispatch = oem_format,
|
||||
},
|
||||
#endif
|
||||
#if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_PARTCONF)
|
||||
[FASTBOOT_COMMAND_OEM_PARTCONF] = {
|
||||
.command = "oem partconf",
|
||||
.dispatch = oem_partconf,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -374,3 +383,30 @@ static void oem_format(char *cmd_parameter, char *response)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_PARTCONF)
|
||||
/**
|
||||
* oem_partconf() - Execute the OEM partconf command
|
||||
*
|
||||
* @cmd_parameter: Pointer to command parameter
|
||||
* @response: Pointer to fastboot response buffer
|
||||
*/
|
||||
static void oem_partconf(char *cmd_parameter, char *response)
|
||||
{
|
||||
char cmdbuf[32];
|
||||
|
||||
if (!cmd_parameter) {
|
||||
fastboot_fail("Expected command parameter", response);
|
||||
return;
|
||||
}
|
||||
|
||||
/* execute 'mmc partconfg' command with cmd_parameter arguments*/
|
||||
snprintf(cmdbuf, sizeof(cmdbuf), "mmc partconf %x %s 0",
|
||||
CONFIG_FASTBOOT_FLASH_MMC_DEV, cmd_parameter);
|
||||
printf("Execute: %s\n", cmdbuf);
|
||||
if (run_command(cmdbuf, 0))
|
||||
fastboot_fail("Cannot set oem partconf", response);
|
||||
else
|
||||
fastboot_okay(NULL, response);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue