From owner-p4-projects@FreeBSD.ORG Fri Sep 29 22:34:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0405C16A47B; Fri, 29 Sep 2006 22:34:13 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2DA016A407 for ; Fri, 29 Sep 2006 22:34:12 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A91F43D58 for ; Fri, 29 Sep 2006 22:34:10 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8TMYATu060587 for ; Fri, 29 Sep 2006 22:34:10 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8TMY9bo060584 for perforce@freebsd.org; Fri, 29 Sep 2006 22:34:09 GMT (envelope-from imp@freebsd.org) Date: Fri, 29 Sep 2006 22:34:09 GMT Message-Id: <200609292234.k8TMY9bo060584@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106919 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2006 22:34:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=106919 Change 106919 by imp@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);