PERFORCE change 106850 for review
Warner Losh
imp at FreeBSD.org
Thu Sep 28 14:36:55 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=106850
Change 106850 by imp at imp_lighthouse on 2006/09/28 21:36:31
Expand the ISR to be nearly complete.
Affected files ...
.. //depot/projects/arm/src/sys/arm/at91/at91_mci.c#10 edit
Differences ...
==== //depot/projects/arm/src/sys/arm/at91/at91_mci.c#10 (text+ko) ====
@@ -463,17 +463,14 @@
{
struct at91_mci_softc *sc = (struct at91_mci_softc*)arg;
uint32_t sr;
- int i;
+ int i, done = 0;
struct mmc_command *cmd;
AT91_MCI_LOCK(sc);
- sr = RD4(sc, MCI_SR);
+ sr = RD4(sc, MCI_SR) & RD4(sc, MCI_IMR);
printf("i 0x%x\n", sr);
WR4(sc, MCI_IDR, 0xffffffff);
cmd = sc->curcmd;
- if (sr & MCI_SR_CMDRDY && cmd != NULL)
- for (i = 0; i < 4; i++)
- cmd->resp[i] = RD4(sc, MCI_RSPR + (i << 2));
if (sr & MCI_SR_ERROR) {
if ((sr & MCI_SR_RCRCE) && (cmd->opcode == MMC_SEND_OP_COND ||
cmd->opcode == ACMD_SD_SEND_OP_COND))
@@ -486,9 +483,50 @@
cmd->error = MMC_ERR_FIFO;
else
cmd->error = MMC_ERR_FAILED;
- } else
- cmd->error = MMC_ERR_NONE;
-
- at91_mci_start(sc);
+ done = 1;
+ } else {
+ if (sr & MCI_SR_TXBUFE) {
+ printf("TXBUFE\n");
+// at91_mci_xmit_done(sc);
+ }
+ if (sr & MCI_SR_RXBUFF) {
+ printf("RXBUFF\n");
+ WR4(sc, MCI_IER, MCI_SR_CMDRDY);
+ }
+ if (sr & MCI_SR_ENDTX) {
+ printf("ENDTX\n");
+ }
+ if (sr & MCI_SR_ENDRX) {
+ printf("ENDRX\n");
+// at91_mci_read_done(sc);
+ }
+ if (sr & MCI_SR_NOTBUSY) {
+ printf("NOTBUSY\n");
+ WR4(sc, MCI_IER, MCI_SR_CMDRDY);
+ }
+ if (sr & MCI_SR_DTIP) {
+ printf("Data transfer in progress\n");
+ }
+ if (sr & MCI_SR_BLKE) {
+ printf("Block transfer end\n");
+ }
+ if (sr & MCI_SR_TXRDY) {
+ printf("Ready to transmit\n");
+ }
+ if (sr & MCI_SR_RXRDY) {
+ printf("Ready to receive\n");
+ }
+ if (sr & MCI_SR_CMDRDY) {
+ printf("Command ready\n");
+ done = 1;
+ cmd->error = MMC_ERR_NONE;
+ }
+ }
+ if (done) {
+ if (cmd != NULL)
+ for (i = 0; i < 4; i++)
+ cmd->resp[i] = RD4(sc, MCI_RSPR + (i << 2));
+ at91_mci_start(sc);
+ }
AT91_MCI_UNLOCK(sc);
}
More information about the p4-projects
mailing list