From owner-p4-projects@FreeBSD.ORG Wed Jun 28 19:43:05 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 4048516A50A; Wed, 28 Jun 2006 19:43:05 +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 8527B16A50E for ; Wed, 28 Jun 2006 19:43:04 +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 98AAE44EF2 for ; Wed, 28 Jun 2006 19:24:17 +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 k5SJOHKG041929 for ; Wed, 28 Jun 2006 19:24:17 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5SJOHtj041926 for perforce@freebsd.org; Wed, 28 Jun 2006 19:24:17 GMT (envelope-from imp@freebsd.org) Date: Wed, 28 Jun 2006 19:24:17 GMT Message-Id: <200606281924.k5SJOHtj041926@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 100224 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: Wed, 28 Jun 2006 19:43:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=100224 Change 100224 by imp@imp_lighthouse on 2006/06/28 19:23:33 Enable/disable endtx interrupt as needed. Reset the character timeout by setting STTTO in CR when we get a timeout. We're reading characters now! Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#31 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#31 (text+ko) ==== @@ -394,7 +394,6 @@ /* Set the receive timeout to be 1.5 character times. */ WR4(&sc->sc_bas, USART_RTOR, 12); WR4(&sc->sc_bas, USART_CR, USART_CR_STTTO); - WR4(&sc->sc_bas, USART_IER, USART_CSR_TIMEOUT | USART_CSR_RXBUFF | USART_CSR_ENDRX); } else { @@ -432,6 +431,7 @@ WR4(&sc->sc_bas, PDC_TPR, addr); WR4(&sc->sc_bas, PDC_TCR, sc->sc_txdatasz); WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_TXTEN); + WR4(&sc->sc_bas, USART_IER, USART_CSR_ENDTX); uart_unlock(sc->sc_hwmtx); #else for (int i = 0; i < sc->sc_txdatasz; i++) @@ -502,12 +502,17 @@ bus_dmamap_unload(atsc->dmatag, atsc->tx_map); } uart_lock(sc->sc_hwmtx); - if ((csr & USART_CSR_TXRDY) && sc->sc_txbusy) { - ipend |= SER_INT_TXIDLE; + if (csr & USART_CSR_TXRDY) { + if (sc->sc_txbusy) + ipend |= SER_INT_TXIDLE; WR4(&sc->sc_bas, USART_IDR, USART_CSR_TXRDY); } - if ((csr & USART_CSR_ENDTX) && sc->sc_txbusy) - ipend |= SER_INT_TXIDLE; + if (csr & USART_CSR_ENDTX) { + if (sc->sc_txbusy) + ipend |= SER_INT_TXIDLE; + WR4(&sc->sc_bas, USART_IDR, USART_CSR_ENDTX); + } + /* * Due to the contraints of the DMA engine present in the * atmel chip, I can't just say I have a rx interrupt pending @@ -565,6 +570,7 @@ uart_rx_put(sc, atsc->ping->buffer[i]); WR4(&sc->sc_bas, PDC_RPR, atsc->ping->pa); WR4(&sc->sc_bas, PDC_RCR, sc->sc_rxfifosz); + WR4(&sc->sc_bas, USART_CR, USART_CR_STTTO); WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_RXTEN); ipend |= SER_INT_RXREADY; }