summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAdrian Negreanu <adrian.negreanu@nxp.com>2019-02-11 16:07:37 +0200
committerAdrian Negreanu <adrian.negreanu@nxp.com>2019-03-18 13:54:10 +0200
commit6dee2d916a3f2a406c211707f3d93e9d238a4b41 (patch)
tree37324f6e74ae5cd8d91aa5ce8ea236e6844aee78 /common
parent4792d8967d3c631d055c133303bb6385b822a3ca (diff)
env variable to specify androidboot.storage_type
The boota command boots an Android already written to mmc/emmc. It calls get_boot_device() to figure out where to look for Android; but when a board is booted over serial, get_boot_device() returns an invalid boot mode. Explicitly setting the storage_type will enable boota on a board booted over serial. FB: ucmd setenv storage_type emmc FB: ucmd boota Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/image-android.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/common/image-android.c b/common/image-android.c
index 1646e5051a..145e87e72f 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -147,24 +147,32 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
}
- int bootdev = get_boot_device();
- if (bootdev == SD1_BOOT || bootdev == SD2_BOOT ||
- bootdev == SD3_BOOT || bootdev == SD4_BOOT) {
+ char *storage_type = env_get("storage_type");
+ if (storage_type) {
sprintf(newbootargs,
- " androidboot.storage_type=sd");
- } else if (bootdev == MMC1_BOOT || bootdev == MMC2_BOOT ||
- bootdev == MMC3_BOOT || bootdev == MMC4_BOOT) {
- sprintf(newbootargs,
- " androidboot.storage_type=emmc");
- } else if (bootdev == NAND_BOOT) {
- sprintf(newbootargs,
- " androidboot.storage_type=nand");
- } else
- printf("boot device type is incorrect.\n");
- strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
- if (bootloader_gpt_overlay()) {
- sprintf(newbootargs, " gpt");
+ " androidboot.storage_type=%s",
+ storage_type);
strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
+ } else {
+ int bootdev = get_boot_device();
+ if (bootdev == SD1_BOOT || bootdev == SD2_BOOT ||
+ bootdev == SD3_BOOT || bootdev == SD4_BOOT) {
+ sprintf(newbootargs,
+ " androidboot.storage_type=sd");
+ } else if (bootdev == MMC1_BOOT || bootdev == MMC2_BOOT ||
+ bootdev == MMC3_BOOT || bootdev == MMC4_BOOT) {
+ sprintf(newbootargs,
+ " androidboot.storage_type=emmc");
+ } else if (bootdev == NAND_BOOT) {
+ sprintf(newbootargs,
+ " androidboot.storage_type=nand");
+ } else
+ printf("boot device type is incorrect.\n");
+ strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
+ if (bootloader_gpt_overlay()) {
+ sprintf(newbootargs, " gpt");
+ strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
+ }
}
/* boot metric variables */