svn commit: r188161 - projects/cambria/sys/dev/uart
Sam Leffler
sam at FreeBSD.org
Thu Feb 5 10:39:29 PST 2009
Author: sam
Date: Thu Feb 5 18:39:28 2009
New Revision: 188161
URL: http://svn.freebsd.org/changeset/base/188161
Log:
o add ier_mask hint so xscale hack can be made less of a hack
o print hint overrides with bootverbose
Modified:
projects/cambria/sys/dev/uart/uart_dev_ns8250.c
Modified: projects/cambria/sys/dev/uart/uart_dev_ns8250.c
==============================================================================
--- projects/cambria/sys/dev/uart/uart_dev_ns8250.c Thu Feb 5 18:38:39 2009 (r188160)
+++ projects/cambria/sys/dev/uart/uart_dev_ns8250.c Thu Feb 5 18:39:28 2009 (r188161)
@@ -396,8 +396,8 @@ ns8250_bus_attach(struct uart_softc *sc)
ns8250->mcr = uart_getreg(bas, REG_MCR);
ns8250->fcr = FCR_ENABLE;
- if (!resource_int_value("uart", device_get_unit(sc->sc_dev), "flags",
- &ivar)) {
+ if (resource_int_value("uart", device_get_unit(sc->sc_dev), "flags",
+ &ivar) == 0) {
if (UART_FLAGS_FCR_RX_LOW(ivar))
ns8250->fcr |= FCR_RX_LOW;
else if (UART_FLAGS_FCR_RX_MEDL(ivar))
@@ -406,20 +406,30 @@ ns8250_bus_attach(struct uart_softc *sc)
ns8250->fcr |= FCR_RX_HIGH;
else
ns8250->fcr |= FCR_RX_MEDH;
+ if (bootverbose)
+ device_printf(sc->sc_dev, "fcr 0x%x\n", ns8250->fcr);
} else
ns8250->fcr |= FCR_RX_MEDH;
/* Get IER mask */
- ivar = 0xf0;
- resource_int_value("uart", device_get_unit(sc->sc_dev), "ier_mask",
- &ivar);
- ns8250->ier_mask = (uint8_t)(ivar & 0xff);
+ if (resource_int_value("uart", device_get_unit(sc->sc_dev), "ier_mask",
+ &ivar) == 0) {
+ ns8250->ier_mask = (uint8_t)(ivar & 0xff);
+ if (bootverbose)
+ device_printf(sc->sc_dev, "ier_mask 0x%x\n",
+ ns8250->ier_mask);
+ } else
+ ns8250->ier_mask = 0xf0;
/* Get IER RX interrupt bits */
- ivar = IER_EMSC | IER_ERLS | IER_ERXRDY;
- resource_int_value("uart", device_get_unit(sc->sc_dev), "ier_rxbits",
- &ivar);
- ns8250->ier_rxbits = (uint8_t)(ivar & 0xff);
+ if (resource_int_value("uart", device_get_unit(sc->sc_dev),
+ "ier_rxbits", &ivar) == 0) {
+ ns8250->ier_rxbits = (uint8_t)(ivar & 0xff);
+ if (bootverbose)
+ device_printf(sc->sc_dev, "ier_rxbits 0x%x\n",
+ ns8250->ier_rxbits);
+ } else
+ ns8250->ier_rxbits = IER_EMSC | IER_ERLS | IER_ERXRDY;
uart_setreg(bas, REG_FCR, ns8250->fcr);
uart_barrier(bas);
More information about the svn-src-projects
mailing list