diff options
author | Uwe Stuehler <uwe@cvs.openbsd.org> | 2007-03-18 22:07:17 +0000 |
---|---|---|
committer | Uwe Stuehler <uwe@cvs.openbsd.org> | 2007-03-18 22:07:17 +0000 |
commit | e268707a89acd6ed5d023571c38e975d443c15aa (patch) | |
tree | 40b9e7131e57d65c6dc955ab86c79195ee88e9cd /sys/dev/sdmmc/sdmmc_mem.c | |
parent | e3d3b3ebff93641bc3eb25dccc541e9ee0f42e98 (diff) |
DHC automatically sends a CMD12 after multiple-block transfers, but other
controllers don't. Put in a temporary hack for pxammc on Zaurus.
Diffstat (limited to 'sys/dev/sdmmc/sdmmc_mem.c')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_mem.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c index 3ec17a1a5c3..a6354363de6 100644 --- a/sys/dev/sdmmc/sdmmc_mem.c +++ b/sys/dev/sdmmc/sdmmc_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_mem.c,v 1.6 2006/11/29 14:16:43 uwe Exp $ */ +/* $OpenBSD: sdmmc_mem.c,v 1.7 2007/03/18 22:07:16 uwe Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -410,6 +410,19 @@ sdmmc_mem_read_block(struct sdmmc_function *sf, int blkno, u_char *data, if (error != 0) goto err; + /* XXX sdhc(4) does not need this */ +#ifdef __zaurus__ + if (cmd.c_opcode == MMC_READ_BLOCK_MULTIPLE) { + bzero(&cmd, sizeof cmd); + cmd.c_opcode = MMC_STOP_TRANSMISSION; + cmd.c_arg = MMC_ARG_RCA(sf->rca); + cmd.c_flags = SCF_CMD_AC | SCF_RSP_R1B; + error = sdmmc_mmc_command(sc, &cmd); + if (error != 0) + goto err; + } +#endif + do { bzero(&cmd, sizeof cmd); cmd.c_opcode = MMC_SEND_STATUS; @@ -452,6 +465,18 @@ sdmmc_mem_write_block(struct sdmmc_function *sf, int blkno, u_char *data, if (error != 0) goto err; + /* XXX sdhc(4) does not need this */ +#ifdef __zaurus__ + if (cmd.c_opcode == MMC_WRITE_BLOCK_MULTIPLE) { + bzero(&cmd, sizeof cmd); + cmd.c_opcode = MMC_STOP_TRANSMISSION; + cmd.c_flags = SCF_CMD_AC | SCF_RSP_R1B; + error = sdmmc_mmc_command(sc, &cmd); + if (error != 0) + goto err; + } +#endif + do { bzero(&cmd, sizeof cmd); cmd.c_opcode = MMC_SEND_STATUS; |