summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart_bus.h1
-rw-r--r--sys/dev/uart/uart_core.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h
index 4a2d8aa..cc9ce4d 100644
--- a/sys/dev/uart/uart_bus.h
+++ b/sys/dev/uart/uart_bus.h
@@ -80,6 +80,7 @@
#define UART_IOCTL_BREAK 1
#define UART_IOCTL_IFLOW 2
#define UART_IOCTL_OFLOW 3
+#define UART_IOCTL_BAUD 4
/*
* UART class & instance (=softc)
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index 9740cff..ca89c5c 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
@@ -391,6 +391,11 @@ uart_bus_attach(device_t dev)
}
if (sc->sc_sysdev != NULL) {
+ if (sc->sc_sysdev->baudrate == 0) {
+ if (UART_IOCTL(sc, UART_IOCTL_BAUD,
+ (intptr_t)&sc->sc_sysdev->baudrate) != 0)
+ sc->sc_sysdev->baudrate = -1;
+ }
switch (sc->sc_sysdev->type) {
case UART_DEV_CONSOLE:
device_printf(dev, "console");
OpenPOWER on IntegriCloud