From owner-svn-src-all@FreeBSD.ORG Tue Oct 30 01:52:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2EDB18E; Tue, 30 Oct 2012 01:52:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C83FC8FC0A; Tue, 30 Oct 2012 01:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U1qnBA088922; Tue, 30 Oct 2012 01:52:49 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U1qnM9088920; Tue, 30 Oct 2012 01:52:49 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201210300152.q9U1qnM9088920@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 30 Oct 2012 01:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242333 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 01:52:50 -0000 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);