From owner-freebsd-arm@FreeBSD.ORG Tue Jun 18 19:10:00 2013 Return-Path: Delivered-To: freebsd-arm@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AA01EE3E for ; Tue, 18 Jun 2013 19:10:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8C28A1E43 for ; Tue, 18 Jun 2013 19:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r5IJA0MM060899 for ; Tue, 18 Jun 2013 19:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r5IJA0Xu060898; Tue, 18 Jun 2013 19:10:00 GMT (envelope-from gnats) Resent-Date: Tue, 18 Jun 2013 19:10:00 GMT Resent-Message-Id: <201306181910.r5IJA0Xu060898@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-arm@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Luiz Otavio O Souza Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E1D8465A for ; Tue, 18 Jun 2013 19:00:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id D4D001D91 for ; Tue, 18 Jun 2013 19:00:00 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r5IJ003N073337 for ; Tue, 18 Jun 2013 19:00:00 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r5IJ004T073335; Tue, 18 Jun 2013 19:00:00 GMT (envelope-from nobody) Message-Id: <201306181900.r5IJ004T073335@oldred.freebsd.org> Date: Tue, 18 Jun 2013 19:00:00 GMT From: Luiz Otavio O Souza To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: arm/179688: [patch] [rpi] serial console eats some characters at moutroot prompt X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 19:10:00 -0000 >Number: 179688 >Category: arm >Synopsis: [patch] [rpi] serial console eats some characters at moutroot prompt >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-arm >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 18 19:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Luiz Otavio O Souza >Release: -head r251700 >Organization: >Environment: FreeBSD raspberry-pi 10.0-CURRENT FreeBSD 10.0-CURRENT #11 r251700M: Tue Jun 18 13:06:54 BRT 2013 root@devel:/data/rpi/rpi/obj/arm.armv6/data/rpi/rpi/src/sys/RPI-B arm >Description: While at mountroot prompt the rpi uart driver eats some characters, making very hard to type something right. ray@ suggested to not enable the uart interrupts in uart_bus_attach() routine for the console device and that seems to also works fine for rpi. >How-To-Repeat: Boot a kernel from BOOTP (or boot a kernel from SD card without a valid root partition) and try to type at mountroot prompt. You need to keep the keys pressed for a while to see some output. >Fix: Apply the attached patch. It is a copy from the workaround used on uart_dev_imx.c. Patch attached with submission follows: Index: dev/uart/uart_dev_pl011.c =================================================================== --- dev/uart/uart_dev_pl011.c (revision 251700) +++ dev/uart/uart_dev_pl011.c (working copy) @@ -273,8 +273,13 @@ struct uart_bas *bas; bas = &sc->sc_bas; - /* Enable RX & TX interrupts */ - __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + /* XXX workaround to have working console on manut prompt */ + if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE){ + /* Don't enable interrupts */ + } else { + /* Enable RX & TX interrupts */ + __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + } /* Clear RX & TX interrupts */ __uart_setreg(bas, UART_ICR, IMSC_MASK_ALL); >Release-Note: >Audit-Trail: >Unformatted: