From owner-p4-projects@FreeBSD.ORG Thu Sep 28 21:36:54 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 C9E7816A4A0; Thu, 28 Sep 2006 21:36:54 +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 9AB8716A494 for ; Thu, 28 Sep 2006 21:36:54 +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 618DB43D49 for ; Thu, 28 Sep 2006 21:36:54 +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 k8SLast6058153 for ; Thu, 28 Sep 2006 21:36:54 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8SLasoo058150 for perforce@freebsd.org; Thu, 28 Sep 2006 21:36:54 GMT (envelope-from imp@freebsd.org) Date: Thu, 28 Sep 2006 21:36:54 GMT Message-Id: <200609282136.k8SLasoo058150@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 106850 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: Thu, 28 Sep 2006 21:36:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=106850 Change 106850 by imp@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); }