aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/uart
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2018-07-22 23:32:21 +0000
committerMatt Macy <mmacy@FreeBSD.org>2018-07-22 23:32:21 +0000
commitf30f0f2b4792e63ffa8d07e2e791122bfb20fdbf (patch)
treee4a065e953c3da8f759d1a0314c0e7bdf72c3fac /sys/dev/uart
parent16bb9a49ad6ce45b6f15cc03dff991231c02da49 (diff)
Notes
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart.h1
-rw-r--r--sys/dev/uart/uart_dev_ns8250.c1
-rw-r--r--sys/dev/uart/uart_subr.c9
3 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h
index 73109173bd48..4ef6af3d901b 100644
--- a/sys/dev/uart/uart.h
+++ b/sys/dev/uart/uart.h
@@ -44,6 +44,7 @@ struct uart_bas {
u_int rclk;
u_int regshft;
u_int regiowidth;
+ u_int busy_detect;
};
#define uart_regofs(bas, reg) ((reg) << (bas)->regshft)
diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
index 266530db060f..03792f8f6598 100644
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -469,6 +469,7 @@ ns8250_bus_attach(struct uart_softc *sc)
bas = &sc->sc_bas;
+ ns8250->busy_detect = bas->busy_detect;
ns8250->mcr = uart_getreg(bas, REG_MCR);
ns8250->fcr = FCR_ENABLE;
#ifdef CPU_XBURST
diff --git a/sys/dev/uart/uart_subr.c b/sys/dev/uart/uart_subr.c
index dcdaf9f1929c..2dd10d9f4a2d 100644
--- a/sys/dev/uart/uart_subr.c
+++ b/sys/dev/uart/uart_subr.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#define UART_TAG_RS 7
#define UART_TAG_SB 8
#define UART_TAG_XO 9
+#define UART_TAG_BD 10
static struct uart_class *uart_classes[] = {
&uart_ns8250_class,
@@ -124,6 +125,10 @@ uart_parse_tag(const char **p)
{
int tag;
+ if ((*p)[0] == 'b' && (*p)[1] == 'd') {
+ tag = UART_TAG_BD;
+ goto out;
+ }
if ((*p)[0] == 'b' && (*p)[1] == 'r') {
tag = UART_TAG_BR;
goto out;
@@ -179,6 +184,7 @@ out:
* separated by commas. Each attribute is a tag-value pair with the tag and
* value separated by a colon. Supported tags are:
*
+ * bd = Busy Detect
* br = Baudrate
* ch = Channel
* db = Data bits
@@ -242,6 +248,9 @@ uart_getenv(int devtype, struct uart_devinfo *di, struct uart_class *class)
spec = cp;
for (;;) {
switch (uart_parse_tag(&spec)) {
+ case UART_TAG_BD:
+ di->bas.busy_detect = uart_parse_long(&spec);
+ break;
case UART_TAG_BR:
di->baudrate = uart_parse_long(&spec);
break;