Date: Sat, 18 Aug 2007 12:32:24 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 125296 for review Message-ID: <200708181232.l7ICWObU018394@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125296 Change 125296 by gonzo@gonzo_jeeves on 2007/08/18 12:32:03 o Give TX intr enable/disable functions proper names: use enable/disable instead of start/stop o Speed up serial console by using RX/TX FIFOs. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips32/adm5120/uart_dev_adm5120.c#2 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips32/adm5120/uart_dev_adm5120.c#2 (text+ko) ==== @@ -185,7 +185,7 @@ * Disable TX interrupt. uart should be locked */ static __inline void -adm5120_uart_stop_tx(struct uart_softc *sc) +adm5120_uart_disable_txintr(struct uart_softc *sc) { uint8_t cr; @@ -198,7 +198,7 @@ * Enable TX interrupt. uart should be locked */ static __inline void -adm5120_uart_start_tx(struct uart_softc *sc) +adm5120_uart_enable_txintr(struct uart_softc *sc) { uint8_t cr; @@ -221,12 +221,12 @@ /* TODO: set parameters 115200, 8N1 */ } - sc->sc_rxfifosz = 1; - sc->sc_txfifosz = 1; + sc->sc_rxfifosz = 16; + sc->sc_txfifosz = 16; (void)adm5120_uart_bus_getsig(sc); -#if 0 +#if 1 /* Enable FIFO */ uart_setreg(bas, UART_LCR_H_REG, uart_getreg(bas, UART_LCR_H_REG) | UART_LCR_H_FEN); @@ -334,7 +334,7 @@ if (fr & UART_FR_TX_FIFO_EMPTY) { if (ir & UART_IR_TX_INT) { - adm5120_uart_stop_tx(sc); + adm5120_uart_disable_txintr(sc); ipend |= SER_INT_TXIDLE; } } @@ -438,15 +438,15 @@ bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - while (uart_getreg(bas, UART_FR_REG) & UART_FR_TX_FIFO_FULL) - ; - uart_setreg(bas, UART_DR_REG, sc->sc_txbuf[0]); - uart_barrier(bas); - sc->sc_txbusy = 1; + for (int i = 0; i < sc->sc_txdatasz; i++) { + if (uart_getreg(bas, UART_FR_REG) & UART_FR_TX_FIFO_FULL) + break; + uart_setreg(bas, UART_DR_REG, sc->sc_txbuf[i]); + } /* Enable TX interrupt */ - adm5120_uart_start_tx(sc); + adm5120_uart_enable_txintr(sc); uart_unlock(sc->sc_hwmtx); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708181232.l7ICWObU018394>