From owner-p4-projects@FreeBSD.ORG Mon Sep 1 13:48:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5816C16A4C1; Mon, 1 Sep 2003 13:48:39 -0700 (PDT) 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 03CB816A4BF for ; Mon, 1 Sep 2003 13:48:39 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57FA443FE1 for ; Mon, 1 Sep 2003 13:48:38 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h81Kmc0U093547 for ; Mon, 1 Sep 2003 13:48:38 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h81KmbRN093544 for perforce@freebsd.org; Mon, 1 Sep 2003 13:48:37 -0700 (PDT) Date: Mon, 1 Sep 2003 13:48:37 -0700 (PDT) Message-Id: <200309012048.h81KmbRN093544@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 37337 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2003 20:48:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=37337 Change 37337 by marcel@marcel_nfs on 2003/09/01 13:47:41 Implement UART_RECEIVE() and change the size of the Rx FIFO from 1 to 3. This latter is not really crucial, because we read characters from the chip until there are no more. But, it's documented to be at least 3 characters. We now have a working console in single-user mode. For some reason getty(8) still waits for DCD. I don't think this is a problem that relates to the z8530 though. Even if we get the signals wrong, the console is forced to be CLOCAL so we don't care if we have DCD or not. At least, that's the idea. Get the signal state in UART_ATTACH() to have a good begin situation though. Affected files ... .. //depot/projects/uart/dev/uart/uart_dev_z8530.c#9 edit Differences ... ==== //depot/projects/uart/dev/uart/uart_dev_z8530.c#9 (text+ko) ==== @@ -299,9 +299,11 @@ z8530->tpc &= ~(TPC_DTR|TPC_RTS); } - sc->sc_rxfifosz = 1; + sc->sc_rxfifosz = 3; sc->sc_txfifosz = 1; + (void)z8530_bus_getsig(sc); + uart_setmreg(bas, WR_IC, IC_BRK | IC_CTS | IC_DCD); uart_barrier(bas); uart_setmreg(bas, WR_IDT, IDT_TIE | IDT_RIA); @@ -409,7 +411,24 @@ static int z8530_bus_receive(struct uart_softc *sc) { - + struct uart_bas *bas; + int xc; + uint8_t bes, src; + + bas = &sc->sc_bas; + bes = uart_getmreg(bas, RR_BES); + while ((bes & BES_RXA) && !uart_rx_full(sc)) { + src = uart_getmreg(bas, RR_SRC); + xc = uart_getreg(bas, REG_DATA); + if (src & SRC_FE) + xc |= UART_STAT_FRAMERR; + if (src & SRC_PE) + xc |= UART_STAT_PARERR; + uart_rx_put(sc, xc); + if (src & (SRC_FE | SRC_PE)) + uart_setreg(bas, REG_CTRL, CR_RSTERR); + bes = uart_getmreg(bas, RR_BES); + } return (0); }