diff options
author | stas <stas@FreeBSD.org> | 2012-04-07 23:47:08 +0000 |
---|---|---|
committer | stas <stas@FreeBSD.org> | 2012-04-07 23:47:08 +0000 |
commit | 857374ab0ed8f963b64279316ea006bb3dcb3277 (patch) | |
tree | e6d6bae184a64ca34fef41fc95d5caaaffaecaef /sys/arm/xscale | |
parent | 07f16a905d18f1cd138abc999c10c0cbf62a72cc (diff) | |
download | FreeBSD-src-857374ab0ed8f963b64279316ea006bb3dcb3277.zip FreeBSD-src-857374ab0ed8f963b64279316ea006bb3dcb3277.tar.gz |
- 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.
Diffstat (limited to 'sys/arm/xscale')
-rw-r--r-- | sys/arm/xscale/pxa/uart_bus_pxa.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/arm/xscale/pxa/uart_bus_pxa.c b/sys/arm/xscale/pxa/uart_bus_pxa.c index eab7883..c5df619 100644 --- a/sys/arm/xscale/pxa/uart_bus_pxa.c +++ b/sys/arm/xscale/pxa/uart_bus_pxa.c @@ -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; |