diff options
author | gonzo <gonzo@FreeBSD.org> | 2012-10-30 01:52:49 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2012-10-30 01:52:49 +0000 |
commit | 21d56b1a98d8e96451b4b76cd5344f263292f35c (patch) | |
tree | 8f43e961e44fb1a646f3d8c818a0aa16d59f2148 | |
parent | 757e259dcac3804fa8e9106335f788067a46a4d7 (diff) | |
download | FreeBSD-src-21d56b1a98d8e96451b4b76cd5344f263292f35c.zip FreeBSD-src-21d56b1a98d8e96451b4b76cd5344f263292f35c.tar.gz |
Separate interrupts enable/disable logic from setting port parameters.
Otherwise setting baud rate in TTY mode effectively disables TX/RX
interrupts and renders port unusable.
-rw-r--r-- | sys/dev/uart/uart_dev_pl011.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/uart/uart_dev_pl011.c b/sys/dev/uart/uart_dev_pl011.c index e7e0a15..d71ab11 100644 --- a/sys/dev/uart/uart_dev_pl011.c +++ b/sys/dev/uart/uart_dev_pl011.c @@ -120,16 +120,12 @@ uart_pl011_probe(struct uart_bas *bas) } static void -uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, +uart_pl011_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { uint32_t ctrl, line; uint32_t baud; - /* Mask all interrupts */ - __uart_setreg(bas, UART_IMSC, __uart_getreg(bas, UART_IMSC) & - ~IMSC_MASK_ALL); - /* * Zero all settings to make sure * UART is disabled and not configured @@ -179,6 +175,17 @@ uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, } static void +uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + /* Mask all interrupts */ + __uart_setreg(bas, UART_IMSC, __uart_getreg(bas, UART_IMSC) & + ~IMSC_MASK_ALL); + + uart_pl011_param(bas, baudrate, databits, stopbits, parity); +} + +static void uart_pl011_term(struct uart_bas *bas) { } @@ -358,7 +365,7 @@ uart_pl011_bus_param(struct uart_softc *sc, int baudrate, int databits, { uart_lock(sc->sc_hwmtx); - uart_pl011_init(&sc->sc_bas, baudrate, databits, stopbits, parity); + uart_pl011_param(&sc->sc_bas, baudrate, databits, stopbits, parity); uart_unlock(sc->sc_hwmtx); return (0); |