aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Scott <michael.scott@linaro.org>2015-01-26 11:54:51 -0800
committerMichael Scott <michael.scott@linaro.org>2015-01-26 16:10:48 -0800
commit92dcbd98601cfee0ddd4d1b98f19433cd8d7c6cb (patch)
treec5ccd46934c3483a71e9a8cb7bb70a207d0536c8
parent35871dc795ce5e0a1cca8edb1075509c1a4f0a06 (diff)
fastboot: add handling for partition aliases via environment settings
On devices where GPT limitations prevent user-friendly partition names such as boot, system and cache, implement checks for aliases when accessing partitions by name. Change-Id: I3776d1054a0540e434e88e48d2c7f07c18da1ebe Signed-off-by: Michael Scott <michael.scott@linaro.org>
-rw-r--r--common/fb_mmc.c12
-rw-r--r--include/configs/jetson-tk1.h8
2 files changed, 20 insertions, 0 deletions
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index fb06d8a557..2bee3ff35c 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -78,6 +78,18 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer,
ret = get_partition_info_efi_by_name(dev_desc, cmd, &info);
if (ret) {
+ char env_alias_name[25 + 32 + 1]; /* strlen("fastboot_partition_alias_") + 32(part_name) + 1 */
+ char *aliased_part_name;
+
+ /* check for alias */
+ strcpy(env_alias_name, "fastboot_partition_alias_");
+ strcat(env_alias_name, cmd);
+ aliased_part_name = getenv(env_alias_name);
+ if (aliased_part_name != NULL)
+ ret = get_partition_info_efi_by_name(dev_desc, aliased_part_name, &info);
+ }
+
+ if (ret) {
error("cannot find partition: '%s'\n", cmd);
fastboot_fail("cannot find partition");
return;
diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h
index bf522b6990..f4b802d6f7 100644
--- a/include/configs/jetson-tk1.h
+++ b/include/configs/jetson-tk1.h
@@ -113,6 +113,14 @@
#define CONFIG_FASTBOOT_FLASH
#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0
#define BOARD_EXTRA_ENV_SETTINGS \
+ "fastboot_partition_alias_boot=LNX\0" \
+ "fastboot_partition_alias_recovery=SOS\0" \
+ "fastboot_partition_alias_system=APP\0" \
+ "fastboot_partition_alias_cache=CAC\0" \
+ "fastboot_partition_alias_misc=MSC\0" \
+ "fastboot_partition_alias_factory=FCT\0" \
+ "fastboot_partition_alias_userdata=UDA\0" \
+ "fastboot_partition_alias_vendor=VNR\0" \
"bootargs_append=" \
"init=init console=ttyS0,115200n8 " \
"lp0_vec=2064@0xf46ff000 mem=1862M@2048M vpr=151M@3945M tsec=32M@3913M " \