PERFORCE change 106919 for review

Warner Losh imp at FreeBSD.org
Fri Sep 29 15:34:13 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=106919

Change 106919 by imp at imp_lighthouse on 2006/09/29 22:34:05

	Kill lots of debug
	When there's a clock, set the ENable bit, not the DISable bit
	(the hardware continues to kinda work when you do this!)
	tweak interrupt disabling
	
	# we now get OCR!

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/at91_mci.c#13 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/at91_mci.c#13 (text+ko) ====

@@ -284,7 +284,7 @@
 		WR4(sc, MCI_CR, MCI_CR_MCIDIS);
 		clkdiv = 0;
 	} else {
-		WR4(sc, MCI_CR, MCI_CR_MCIDIS);
+		WR4(sc, MCI_CR, MCI_CR_MCIEN);
 		if ((at91_master_clock % (ios->clock * 2)) == 0)
 			clkdiv = ((at91_master_clock / ios->clock) / 2) - 1;
 		else
@@ -342,6 +342,7 @@
 		cmdr |= MCI_CMDR_OPDCMD;
 	if (!cmd->data) {
 		at91_mci_pdc_disable(sc);
+		printf("CMDR %x ARGR %x\n", cmdr, cmd->arg);
 		WR4(sc, MCI_ARGR, cmd->arg);
 		WR4(sc, MCI_CMDR, cmdr);
 		WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_CMDRDY);
@@ -358,21 +359,16 @@
 	req = sc->req;
 	// assert locked
 	if (!(sc->flags & CMD_STARTED)) {
-		printf("Starting command %d of request %p\n", req->cmd->opcode,
-		    req);
 		sc->flags |= CMD_STARTED;
 		at91_mci_start_cmd(sc, req->cmd);
 		return;
 	}
 	if (!(sc->flags & STOP_STARTED) && req->stop) {
-		printf("Starting command %d of request %p\n", req->stop->opcode,
-		    req);
 		sc->flags |= STOP_STARTED;
 		at91_mci_start_cmd(sc, req->stop);
 		return;
 	}
 	/* We must be done -- bad idea to do this while locked? */
-	printf("Finished request %p\n", req);
 	sc->req = NULL;
 	sc->curcmd = NULL;
 	req->done(req->done_data);
@@ -383,7 +379,6 @@
 {
 	struct at91_mci_softc *sc = device_get_softc(brdev);
 
-	printf("queuing request %p\n", req);
 	AT91_MCI_LOCK(sc);
 	// XXX do we want to be able to queue up multiple commands?
 	// XXX sounds like a good idea, but all protocols are sync, so
@@ -443,7 +438,6 @@
 	AT91_MCI_LOCK(sc);
 	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_ERROR) {
 		if ((sr & MCI_SR_RCRCE) && (cmd->opcode == MMC_SEND_OP_COND || 
@@ -497,7 +491,8 @@
 		}
 	}
 	if (done) {
-		if (cmd != NULL) {
+		WR4(sc, MCI_IDR, 0xffffffff);
+		if (cmd != NULL && (cmd->flags & MMC_RSP_PRESENT)) {
 			for (i = 0; i < ((cmd->flags & MMC_RSP_136) ? 4 : 1);
 			     i++) {
 				cmd->resp[i] = RD4(sc, MCI_RSPR + i * 4);


More information about the p4-projects mailing list