Skip to content

Commit 1f25504

Browse files
committed
[bsp]修复qemu-vexpress-a9 SD卡不能多块读写的BUG
1 parent b07bd6c commit 1f25504

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

bsp/qemu-vexpress-a9/drivers/drv_sdio.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,11 @@ static void mmc_request_send(struct rt_mmcsd_host *host, struct rt_mmcsd_req *re
312312
{
313313
struct sdhci_t *sdhci = (struct sdhci_t *)host->private_data;
314314
struct sdhci_cmd_t cmd;
315+
struct sdhci_cmd_t stop;
315316
struct sdhci_data_t dat;
316317

317318
rt_memset(&cmd, 0, sizeof(struct sdhci_cmd_t));
319+
rt_memset(&stop, 0, sizeof(struct sdhci_cmd_t));
318320
rt_memset(&dat, 0, sizeof(struct sdhci_data_t));
319321

320322
cmd.cmdidx = req->cmd->cmd_code;
@@ -343,6 +345,7 @@ static void mmc_request_send(struct rt_mmcsd_host *host, struct rt_mmcsd_req *re
343345
}
344346

345347
dbg_log(DBG_INFO, "cmdarg:%d\n", cmd.cmdarg);
348+
dbg_log(DBG_INFO, "cmdidx:%d\n", cmd.cmdidx);
346349

347350
dbg_log(DBG_INFO, "[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x\n", cmd.response[0], cmd.response[1], cmd.response[2], cmd.response[3]);
348351
req->cmd->resp[3] = cmd.response[3];
@@ -352,6 +355,22 @@ static void mmc_request_send(struct rt_mmcsd_host *host, struct rt_mmcsd_req *re
352355

353356
if(req->cmd->err)
354357
dbg_log(DBG_ERROR, "transfer cmd err \n");
358+
359+
if (req->stop)
360+
{
361+
stop.cmdidx = req->stop->cmd_code;
362+
stop.cmdarg = req->stop->arg;
363+
if (req->stop->flags & RESP_MASK)
364+
{
365+
stop.resptype = PL180_RSP_PRESENT;
366+
if (resp_type(req->stop) == RESP_R2)
367+
stop.resptype |= PL180_RSP_136BIT;
368+
}
369+
else
370+
stop.resptype = 0;
371+
372+
req->stop->err = sdhci_pl180_transfer(sdhci, &stop, RT_NULL);
373+
}
355374

356375
mmcsd_req_complete(host);
357376
}

0 commit comments

Comments
 (0)