summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2018-11-18 03:25:08 +0100
committerMarek Vasut <marex@denx.de>2018-12-04 09:21:06 +0100
commitcf345760bdf7b8f7514dc7d02defe0fc1b9fd52c (patch)
tree88c402ea2238f6b2536730e609fc9b04161fad7b /drivers/mmc
parentd452f27b3ea806fd99aee4b73a723318032c1d5c (diff)
mmc: Do not issue CMD 6 on SD 1.00 and SD 1.01
According to SD Specifications Part 1 Physical Layer Simplified Specification Version 6.00 August 29, 2018, section 4.3.10 (Switch Function Command) and section 5.6 (SCR register), SD cards version 1.00 and 1.01 do not support the SD CMD 6. Currently, U-Boot will issue CMD 6 unconditionally in sd_set_card_speed() while configuring the bus for selected frequency. This will make SD cards version 1.00 and 1.01 time out and thus fail detection altogether. Fix this by not sending CMD 6 on such cards. Tested on Matsushita Electric Industrial Co., Ltd. Japan RP-SD008B / Victor 8MB SD card, CU-SD008, which is correctly detected with this patch as: Device: sd@ee160000 Manufacturer ID: 1 OEM: 5041 Name: S008B Bus Speed: 25000000 Mode : SD Legacy Rd Block Len: 512 SD version 1.0 High Capacity: No Capacity: 6.5 MiB Bus Width: 4-bit Erase Group Size: 512 Bytes Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d6b9cdc992..f5c821e308 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1289,6 +1289,10 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
int speed;
+ /* SD version 1.00 and 1.01 does not support CMD 6 */
+ if (mmc->version == SD_VERSION_1_0)
+ return 0;
+
switch (mode) {
case SD_LEGACY:
speed = UHS_SDR12_BUS_SPEED;