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>
This commit is contained in:
Adrian Negreanu 2019-02-11 16:07:37 +02:00
parent 8915891b77
commit 15ecd669ac
1 changed files with 24 additions and 16 deletions

View File

@ -147,6 +147,13 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline)); strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
} }
char *storage_type = env_get("storage_type");
if (storage_type) {
sprintf(newbootargs,
" androidboot.storage_type=%s",
storage_type);
strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
} else {
int bootdev = get_boot_device(); int bootdev = get_boot_device();
if (bootdev == SD1_BOOT || bootdev == SD2_BOOT || if (bootdev == SD1_BOOT || bootdev == SD2_BOOT ||
bootdev == SD3_BOOT || bootdev == SD4_BOOT) { bootdev == SD3_BOOT || bootdev == SD4_BOOT) {
@ -166,6 +173,7 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
sprintf(newbootargs, " gpt"); sprintf(newbootargs, " gpt");
strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline)); strncat(commandline, newbootargs, sizeof(commandline) - strlen(commandline));
} }
}
/* boot metric variables */ /* boot metric variables */
metrics.ble_1 = get_timer(0); metrics.ble_1 = get_timer(0);