Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2012 01:52:49 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242333 - head/sys/dev/uart
Message-ID:  <201210300152.q9U1qnM9088920@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Tue Oct 30 01:52:49 2012
New Revision: 242333
URL: http://svn.freebsd.org/changeset/base/242333

Log:
  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.

Modified:
  head/sys/dev/uart/uart_dev_pl011.c

Modified: head/sys/dev/uart/uart_dev_pl011.c
==============================================================================
--- head/sys/dev/uart/uart_dev_pl011.c	Tue Oct 30 01:29:45 2012	(r242332)
+++ head/sys/dev/uart/uart_dev_pl011.c	Tue Oct 30 01:52:49 2012	(r242333)
@@ -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, in
 }
 
 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 *
 {
 
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210300152.q9U1qnM9088920>