diff options
author | sam <sam@FreeBSD.org> | 2009-06-22 22:46:37 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-06-22 22:46:37 +0000 |
commit | b7d1149459cc21d615939ae97cdddf07c991c783 (patch) | |
tree | 69cf6e39c064976fc1e18191af115d86e2472e76 | |
parent | 74f8982f2fa2661fafb8f5d1c357893c78e53293 (diff) | |
download | FreeBSD-src-b7d1149459cc21d615939ae97cdddf07c991c783.zip FreeBSD-src-b7d1149459cc21d615939ae97cdddf07c991c783.tar.gz |
o remove hack to write UUE+RTOIE in the uart's IER; force them with hints
o honor hints for the rclk
-rw-r--r-- | sys/arm/conf/AVILA.hints | 2 | ||||
-rw-r--r-- | sys/arm/conf/CAMBRIA.hints | 1 | ||||
-rw-r--r-- | sys/arm/xscale/ixp425/uart_bus_ixp425.c | 28 |
3 files changed, 10 insertions, 21 deletions
diff --git a/sys/arm/conf/AVILA.hints b/sys/arm/conf/AVILA.hints index 5b8a73b..67483ef 100644 --- a/sys/arm/conf/AVILA.hints +++ b/sys/arm/conf/AVILA.hints @@ -9,10 +9,12 @@ hint.uart.0.at="ixp0" hint.uart.0.addr=0xc8000000 hint.uart.0.irq=15 hint.uart.0.flags=0x10 +hint.uart.0.ier_rxbits=0x5d # NB: need UUE+RTOIE # USART0 is unit 1 hint.uart.1.at="ixp0" hint.uart.1.addr=0xc8001000 hint.uart.1.irq=13 +hint.uart.1.ier_rxbits=0x5d # NB: need UUE+RTOIE # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" diff --git a/sys/arm/conf/CAMBRIA.hints b/sys/arm/conf/CAMBRIA.hints index af56f58..9d8ccb1 100644 --- a/sys/arm/conf/CAMBRIA.hints +++ b/sys/arm/conf/CAMBRIA.hints @@ -9,6 +9,7 @@ hint.uart.0.at="ixp0" hint.uart.0.addr=0xc8000000 hint.uart.0.irq=15 hint.uart.0.flags=0x10 +hint.uart.0.ier_rxbits=0x5d # NB: need UUE+RTOIE # NB: no UART1 on ixp436 diff --git a/sys/arm/xscale/ixp425/uart_bus_ixp425.c b/sys/arm/xscale/ixp425/uart_bus_ixp425.c index 2204f44..c3f16b8 100644 --- a/sys/arm/xscale/ixp425/uart_bus_ixp425.c +++ b/sys/arm/xscale/ixp425/uart_bus_ixp425.c @@ -68,29 +68,15 @@ static int uart_ixp425_probe(device_t dev) { struct uart_softc *sc; + int unit = device_get_unit(dev); + u_int rclk; sc = device_get_softc(dev); sc->sc_class = &uart_ns8250_class; - sc->sc_rrid = 0; - sc->sc_rtype = SYS_RES_MEMORY; - sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid, - 0, ~0, uart_getrange(sc->sc_class), RF_ACTIVE); - if (sc->sc_rres == NULL) { - return (ENXIO); - } - sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); - sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); - /* - * XXX set UART Unit Enable (0x40) AND - * receiver timeout int enable (0x10). - * The first turns on the UART. The second is necessary to get - * interrupts when the FIFO has data but is not full. Note that - * uart_ns8250 carefully avoids touching these bits so we can - * just set them here and proceed. But this is fragile... - */ - bus_space_write_4(sc->sc_bas.bst, sc->sc_bas.bsh, IXP425_UART_IER, - IXP425_UART_IER_UUE | IXP425_UART_IER_RTOIE); - bus_release_resource(dev, sc->sc_rtype, sc->sc_rrid, sc->sc_rres); + if (resource_int_value("uart", unit, "rclk", &rclk)) + rclk = IXP425_UART_FREQ; + if (bootverbose) + device_printf(dev, "rclk %u\n", rclk); - return uart_bus_probe(dev, 0, IXP425_UART_FREQ, 0, 0); + return uart_bus_probe(dev, 0, rclk, 0, 0); } |