From owner-svn-src-all@FreeBSD.ORG Sat Apr 7 23:47:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16296106566C; Sat, 7 Apr 2012 23:47:09 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC17C8FC16; Sat, 7 Apr 2012 23:47:08 +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 q37Nl8LI083547; Sat, 7 Apr 2012 23:47:08 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q37Nl80r083544; Sat, 7 Apr 2012 23:47:08 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201204072347.q37Nl80r083544@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 7 Apr 2012 23:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234004 - in head/sys: arm/xscale/pxa conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 07 Apr 2012 23:47:09 -0000 Author: stas Date: Sat Apr 7 23:47:08 2012 New Revision: 234004 URL: http://svn.freebsd.org/changeset/base/234004 Log: - Add new ARM kernel option QEMU_WORKAROUNDS which can be used in the code which needs to implement some specific behaviour when being run under QEMU. - Make PXA UART probe code to work under QEMU gumstix, which doesn't emulate all the ports properly. Modified: head/sys/arm/xscale/pxa/uart_bus_pxa.c head/sys/conf/options.arm Modified: head/sys/arm/xscale/pxa/uart_bus_pxa.c ============================================================================== --- head/sys/arm/xscale/pxa/uart_bus_pxa.c Sat Apr 7 22:28:50 2012 (r234003) +++ head/sys/arm/xscale/pxa/uart_bus_pxa.c Sat Apr 7 23:47:08 2012 (r234004) @@ -72,12 +72,28 @@ uart_pxa_probe(device_t dev) bus_space_handle_t base; struct uart_softc *sc; - /* Check to see if the enable bit's on. */ base = (bus_space_handle_t)pxa_get_base(dev); +#ifdef QEMU_WORKAROUNDS + /* + * QEMU really exposes only the first uart unless + * you specify several of them in the configuration. + * Otherwise all the rest of UARTs stay unconnected, + * which causes problems in the ns16550 attach routine. + * Unfortunately, even if you provide qemu with 4 uarts + * on the command line, it has a bug where it segfaults + * trying to enable bluetooth on the HWUART. So we just + * allow the FFUART to be attached. + * Also, don't check the UUE (UART Unit Enable) bit, as + * the gumstix bootloader doesn't set it. + */ + if (base != PXA2X0_FFUART_BASE) + return (ENXIO); +#else + /* Check to see if the enable bit's on. */ if ((bus_space_read_4(obio_tag, base, (REG_IER << 2)) & PXA_UART_UUE) == 0) return (ENXIO); - +#endif sc = device_get_softc(dev); sc->sc_class = &uart_ns8250_class; Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sat Apr 7 22:28:50 2012 (r234003) +++ head/sys/conf/options.arm Sat Apr 7 23:47:08 2012 (r234004) @@ -23,6 +23,7 @@ KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LOADERRAMADDR opt_global.h PHYSADDR opt_global.h +QEMU_WORKAROUNDS opt_global.h SKYEYE_WORKAROUNDS opt_global.h SOC_MV_DISCOVERY opt_global.h SOC_MV_KIRKWOOD opt_global.h