summaryrefslogtreecommitdiff
path: root/drivers/mmc/sandbox_mmc.c
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2017-12-14 11:47:14 +0100
committerJaehoon Chung <jh80.chung@samsung.com>2018-01-12 18:11:04 +0900
commit49f89252ed4abf7f3899731f914f6b67462ea690 (patch)
treef2ad0d2643d235589094160a05d2a8420c767ff1 /drivers/mmc/sandbox_mmc.c
parentc9d3f34e77dc53798f9757d31aeb020b8fee460c (diff)
downloadu-boot-49f89252ed4abf7f3899731f914f6b67462ea690.tar.gz
dm: mmc: sandbox: Update SD card emulation
The SDcard initialization procedure does a few more things than it did earlier: * switch the bus width even for 1-bit bus width * check that speed has been properly set (in resp[4] of SD_CMD_SWITCH_FUNC) Update the SD simulator to handle those requests gracefully. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc/sandbox_mmc.c')
-rw-r--r--drivers/mmc/sandbox_mmc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c
index fdb29a5505..8a5d256c11 100644
--- a/drivers/mmc/sandbox_mmc.c
+++ b/drivers/mmc/sandbox_mmc.c
@@ -48,9 +48,12 @@ static int sandbox_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
cmd->response[1] = 10 << 16; /* 1 << block_len */
break;
case SD_CMD_SWITCH_FUNC: {
+ if (!data)
+ break;
u32 *resp = (u32 *)data->dest;
-
resp[7] = cpu_to_be32(SD_HIGHSPEED_BUSY);
+ if ((cmd->cmdarg & 0xF) == UHS_SDR12_BUS_SPEED)
+ resp[4] = (cmd->cmdarg & 0xF) << 24;
break;
}
case MMC_CMD_READ_SINGLE_BLOCK: