summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudhakar Rajashekhara <sudhakar.raj@ti.com>2010-09-25 14:59:52 +0530
committerSudhakar Rajashekhara <sudhakar.raj@ti.com>2010-09-25 14:59:52 +0530
commit978955ff4a9771e888b3e99039513fc5f671c419 (patch)
tree25e9b50d5eab5d921b5ccb73848eb03dd22b5a61
parent3ef075ec7c7cb1b046719ca495de97bd72e6a5d4 (diff)
da850/omapl138: Correct "mmc rescan" implementation
Earlier "mmc rescan" command from U-Boot prompt would always return ZERO, hence it was not possible to use this command to know whether the MMC/SD card is present in the slot or not. This patch corrects this issue. In the process, modify the bootargs to include a check to find whether the MMC/SD card is present or not. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
-rw-r--r--common/cmd_mmc.c4
-rw-r--r--drivers/mmc/mmc.c3
-rw-r--r--include/configs/da850evm.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 0e3393b5f4..1d7521c324 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -153,9 +153,9 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (!mmc)
return 1;
- mmc_init(mmc);
+ rc = mmc_init(mmc);
- return 0;
+ return rc;
}
case 0:
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 346e6478e0..c0aa683a4d 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -32,6 +32,7 @@
#include <linux/list.h>
#include <mmc.h>
#include <div64.h>
+#include <asm-generic/errno.h>
static struct list_head mmc_devices;
static int cur_dev_num = -1;
@@ -879,7 +880,7 @@ int mmc_init(struct mmc *mmc)
if (err) {
printf("Card did not respond to voltage select!\n");
- return UNUSABLE_ERR;
+ return ENODEV;
}
}
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 812bad8f41..73ef2c4e80 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -218,7 +218,7 @@
#define CONFIG_CMDLINE_TAG
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_BOOTARGS "mem=32M console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait ip=off"
-#define CONFIG_BOOTCOMMAND "if fatload mmc 0 0xc0600000 boot.scr; then source 0xc0600000; else if fatload mmc 0 0xc0700000 uImage; then bootm c0700000; else sf probe 0; sf read 0xc0700000 0x80000 0x220000; bootm 0xc0700000; fi; fi"
+#define CONFIG_BOOTCOMMAND "if mmc rescan 0; then if fatload mmc 0 0xc0600000 boot.scr; then source 0xc0600000; else fatload mmc 0 0xc0700000 uImage; bootm c0700000; fi; else sf probe 0; sf read 0xc0700000 0x80000 0x220000; bootm 0xc0700000; fi"
#define CONFIG_BOOTDELAY 3
/*
* U-Boot commands