summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-04-01 00:44:20 +0000
committerian <ian@FreeBSD.org>2013-04-01 00:44:20 +0000
commit5b38501da66ed672b34922190744d3b78ac38915 (patch)
tree7e8822165fb7859a3446e9b064f7645e377504e3 /sys/mips
parent720da1df6b6f787228bb96d6f4ea9475a9918504 (diff)
downloadFreeBSD-src-5b38501da66ed672b34922190744d3b78ac38915.zip
FreeBSD-src-5b38501da66ed672b34922190744d3b78ac38915.tar.gz
Fix low-level uart drivers that set their fifo sizes in the softc too late.
uart(4) allocates send and receiver buffers in attach() before it calls the low-level driver's attach routine. Many low-level drivers set the fifo sizes in their attach routine, which is too late. Other drivers set them in the probe() routine, so that they're available when uart(4) allocates buffers. This fixes the ones that were setting the values too late by moving the code to probe().
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/adm5120/uart_dev_adm5120.c6
-rw-r--r--sys/mips/rt305x/uart_dev_rt305x.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/mips/adm5120/uart_dev_adm5120.c b/sys/mips/adm5120/uart_dev_adm5120.c
index 8775389..9f2dc02 100644
--- a/sys/mips/adm5120/uart_dev_adm5120.c
+++ b/sys/mips/adm5120/uart_dev_adm5120.c
@@ -221,9 +221,6 @@ adm5120_uart_bus_attach(struct uart_softc *sc)
/* TODO: set parameters 115200, 8N1 */
}
- sc->sc_rxfifosz = 16;
- sc->sc_txfifosz = 16;
-
(void)adm5120_uart_bus_getsig(sc);
#if 1
@@ -367,6 +364,9 @@ adm5120_uart_bus_probe(struct uart_softc *sc)
if (error)
return (error);
+ sc->sc_rxfifosz = 16;
+ sc->sc_txfifosz = 16;
+
ch = sc->sc_bas.chan + 'A';
snprintf(buf, sizeof(buf), "adm5120_uart, channel %c", ch);
diff --git a/sys/mips/rt305x/uart_dev_rt305x.c b/sys/mips/rt305x/uart_dev_rt305x.c
index 677c0c6..94d0386 100644
--- a/sys/mips/rt305x/uart_dev_rt305x.c
+++ b/sys/mips/rt305x/uart_dev_rt305x.c
@@ -272,9 +272,6 @@ rt305x_uart_bus_attach(struct uart_softc *sc)
rt305x_uart_init(bas, 115200, 8, 1, 0);
}
- sc->sc_rxfifosz = 16;
- sc->sc_txfifosz = 16;
-
(void)rt305x_uart_bus_getsig(sc);
/* Enable FIFO */
@@ -438,6 +435,9 @@ rt305x_uart_bus_probe(struct uart_softc *sc)
if (error)
return (error);
+ sc->sc_rxfifosz = 16;
+ sc->sc_txfifosz = 16;
+
snprintf(buf, sizeof(buf), "rt305x_uart");
device_set_desc_copy(sc->sc_dev, buf);
OpenPOWER on IntegriCloud