summaryrefslogtreecommitdiff
path: root/common/cmd_fastboot.c
diff options
context:
space:
mode:
authorSammy He <r62914@freescale.com>2011-01-27 21:57:04 +0800
committerSammy He <r62914@freescale.com>2011-01-28 01:16:58 +0800
commita069e6b2ca7e8f0ad39375ca12bec11bb0d41ba4 (patch)
tree29f6e3d6a7b3c29b679a45e813ac4be87be5ecb0 /common/cmd_fastboot.c
parente5a0219ac0190ec7ed472f515987bcfaee2cfb9c (diff)
downloadu-boot-imx-a069e6b2ca7e8f0ad39375ca12bec11bb0d41ba4.zip
u-boot-imx-a069e6b2ca7e8f0ad39375ca12bec11bb0d41ba4.tar.gz
u-boot-imx-a069e6b2ca7e8f0ad39375ca12bec11bb0d41ba4.tar.bz2
ENGR00138549 Android fastboot: Support eMMC4.4 on imx53_smdrel_imx_2.6.35_11.01.00
Support eMMC4.4 storage on imx53_smd android fastboot, using environment to control it, the command is: > setenv fastboot_dev mmc1 Signed-off-by: Sammy He <r62914@freescale.com>
Diffstat (limited to 'common/cmd_fastboot.c')
-rw-r--r--common/cmd_fastboot.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index cf51b3a..8d49b88 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -98,6 +98,8 @@ static struct cmd_fastboot_interface interface = {
.transfer_buffer_size = 0,
};
+extern struct fastboot_device_info fastboot_devinfo;
+
static unsigned int download_size;
static unsigned int download_bytes;
static unsigned int download_bytes_unpadded;
@@ -106,7 +108,6 @@ static unsigned int continue_booting;
static unsigned int upload_size;
static unsigned int upload_bytes;
static unsigned int upload_error;
-static unsigned int mmc_controller_no;
/* To support the Android-style naming of flash */
#define MAX_PTN 16
@@ -1141,18 +1142,15 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
printf("saveenv to '%s' DONE!\n", ptn->name);
sprintf(response, "OKAY");
} else {
- char *fastboot_env;
char source[32], dest[32];
char length[32], slot_no[32];
unsigned int temp;
/* Normal case */
- fastboot_env = getenv("fastboot_dev");
- if ((fastboot_env == NULL) ||
- strcmp(fastboot_env, "sata")) {
+ if (fastboot_devinfo.type == DEV_MMC)
/* download to mmc */
goto mmc_ops;
- } else {
+ else {
/* downaload to sata */
#ifdef CONFIG_CMD_SATA
char *sata_write[5] = {"sata", "write",
@@ -1189,11 +1187,8 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
strlen(response));
return ret; /* End of sata download */
}
-mmc_ops:
- /* Save the MMC controller number */
- mmc_controller_no =
- CONFIG_FASTBOOT_MMC_NO;
+mmc_ops:
printf("writing to partition '%s'\n", ptn->name);
char *mmc_write[6] = {"mmc", "write",
NULL, NULL, NULL, NULL};
@@ -1205,7 +1200,8 @@ mmc_ops:
mmc_write[4] = dest;
mmc_write[5] = length;
- sprintf(slot_no, "%d", mmc_controller_no);
+ sprintf(slot_no, "%d",
+ fastboot_devinfo.dev_id);
sprintf(source, "0x%x", interface.transfer_buffer);
/* block offset */