svn commit: r188165 - in projects/cambria/sys/arm: conf xscale/ixp425

Sam Leffler sam at FreeBSD.org
Thu Feb 5 10:45:10 PST 2009


Author: sam
Date: Thu Feb  5 18:45:08 2009
New Revision: 188165
URL: http://svn.freebsd.org/changeset/base/188165

Log:
  use uart hint to set UART Unit Enable (0x40) and receiver timeout
  int enable (0x10) instead of hardcoding it in the bus shim

Modified:
  projects/cambria/sys/arm/conf/AVILA.hints
  projects/cambria/sys/arm/conf/CAMBRIA.hints
  projects/cambria/sys/arm/xscale/ixp425/uart_bus_ixp425.c

Modified: projects/cambria/sys/arm/conf/AVILA.hints
==============================================================================
--- projects/cambria/sys/arm/conf/AVILA.hints	Thu Feb  5 18:43:13 2009	(r188164)
+++ projects/cambria/sys/arm/conf/AVILA.hints	Thu Feb  5 18:45:08 2009	(r188165)
@@ -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.0.ier_rxbits=0x5d	# NB: need UUE+RTOIE
 
 # NPE Hardware Queue Manager
 hint.ixpqmgr.0.at="ixp0"

Modified: projects/cambria/sys/arm/conf/CAMBRIA.hints
==============================================================================
--- projects/cambria/sys/arm/conf/CAMBRIA.hints	Thu Feb  5 18:43:13 2009	(r188164)
+++ projects/cambria/sys/arm/conf/CAMBRIA.hints	Thu Feb  5 18:45:08 2009	(r188165)
@@ -9,8 +9,9 @@ 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
+# NB: no UART1 on ixp435
 
 # NPE Hardware Queue Manager
 hint.ixpqmgr.0.at="ixp0"

Modified: projects/cambria/sys/arm/xscale/ixp425/uart_bus_ixp425.c
==============================================================================
--- projects/cambria/sys/arm/xscale/ixp425/uart_bus_ixp425.c	Thu Feb  5 18:43:13 2009	(r188164)
+++ projects/cambria/sys/arm/xscale/ixp425/uart_bus_ixp425.c	Thu Feb  5 18:45:08 2009	(r188165)
@@ -68,29 +68,13 @@ static int
 uart_ixp425_probe(device_t dev)
 {
 	struct uart_softc *sc;
+	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);
-
-	return uart_bus_probe(dev, 0, IXP425_UART_FREQ, 0, 0);
+	if (resource_int_value("uart", device_get_unit(dev), "rclk", &rclk))
+		rclk = IXP425_UART_FREQ;
+	if (bootverbose)
+		device_printf(dev, "rclk %u\n", rclk);
+	return uart_bus_probe(dev, 0, rclk, 0, 0);
 }


More information about the svn-src-projects mailing list