Module Name: src
Committed By: jmcneill
Date: Tue Sep 3 15:32:55 UTC 2013
Modified Files:
src/sys/dev/ic: com.c comreg.h comvar.h
Log Message:
no EFR on tl16c750, use AFE bit on MCR reg instead for flow control
To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 src/sys/dev/ic/com.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/comreg.h
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ic/comvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.314 src/sys/dev/ic/com.c:1.315
--- src/sys/dev/ic/com.c:1.314 Sun Sep 1 04:58:15 2013
+++ src/sys/dev/ic/com.c Tue Sep 3 15:32:55 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.314 2013/09/01 04:58:15 kiyohara Exp $ */
+/* $NetBSD: com.c,v 1.315 2013/09/03 15:32:55 jmcneill Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.314 2013/09/01 04:58:15 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.315 2013/09/03 15:32:55 jmcneill Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@@ -505,7 +505,7 @@ com_attach_subr(struct com_softc *sc)
ISSET(iir2, IIR_64B_FIFO)) {
/* It is TL16C750. */
sc->sc_fifolen = 64;
- SET(sc->sc_hwflags, COM_HW_FLOW);
+ SET(sc->sc_hwflags, COM_HW_AFE);
} else
CSR_WRITE_1(regsp, COM_REG_FIFO, fcr);
@@ -1358,7 +1358,11 @@ comparam(struct tty *tp, struct termios
sc->sc_mcr_dtr = MCR_DTR;
sc->sc_mcr_rts = MCR_RTS;
sc->sc_msr_cts = MSR_CTS;
- sc->sc_efr = EFR_AUTORTS | EFR_AUTOCTS;
+ if (ISSET(sc->sc_hwflags, COM_HW_AFE)) {
+ SET(sc->sc_mcr, MCR_AFE);
+ } else {
+ sc->sc_efr = EFR_AUTORTS | EFR_AUTOCTS;
+ }
} else if (ISSET(t->c_cflag, MDMBUF)) {
/*
* For DTR/DCD flow control, make sure we don't toggle DTR for
@@ -1367,7 +1371,11 @@ comparam(struct tty *tp, struct termios
sc->sc_mcr_dtr = 0;
sc->sc_mcr_rts = MCR_DTR;
sc->sc_msr_cts = MSR_DCD;
- sc->sc_efr = 0;
+ if (ISSET(sc->sc_hwflags, COM_HW_AFE)) {
+ CLR(sc->sc_mcr, MCR_AFE);
+ } else {
+ sc->sc_efr = 0;
+ }
} else {
/*
* If no flow control, then always set RTS. This will make
@@ -1377,7 +1385,11 @@ comparam(struct tty *tp, struct termios
sc->sc_mcr_dtr = MCR_DTR | MCR_RTS;
sc->sc_mcr_rts = 0;
sc->sc_msr_cts = 0;
- sc->sc_efr = 0;
+ if (ISSET(sc->sc_hwflags, COM_HW_AFE)) {
+ CLR(sc->sc_mcr, MCR_AFE);
+ } else {
+ sc->sc_efr = 0;
+ }
if (ISSET(sc->sc_mcr, MCR_DTR))
SET(sc->sc_mcr, MCR_RTS);
else
Index: src/sys/dev/ic/comreg.h
diff -u src/sys/dev/ic/comreg.h:1.20 src/sys/dev/ic/comreg.h:1.21
--- src/sys/dev/ic/comreg.h:1.20 Sun Sep 1 04:58:15 2013
+++ src/sys/dev/ic/comreg.h Tue Sep 3 15:32:55 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: comreg.h,v 1.20 2013/09/01 04:58:15 kiyohara Exp $ */
+/* $NetBSD: comreg.h,v 1.21 2013/09/03 15:32:55 jmcneill Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -111,6 +111,7 @@
#define MCR_PRESCALE 0x80 /* 16650/16950: Baud rate prescaler select */
#define MCR_TCR_TLR 0x40 /* OMAP: enables access to the TCR & TLR regs */
#define MCR_XONENABLE 0x20 /* OMAP XON_EN */
+#define MCR_AFE 0x20 /* tl16c750: Flow Control Enable */
#define MCR_LOOPBACK 0x10 /* Loop test: echos from TX to RX */
#define MCR_IENABLE 0x08 /* Out2: enables UART interrupts */
#define MCR_DRS 0x04 /* Out1: resets some internal modems */
Index: src/sys/dev/ic/comvar.h
diff -u src/sys/dev/ic/comvar.h:1.76 src/sys/dev/ic/comvar.h:1.77
--- src/sys/dev/ic/comvar.h:1.76 Sun Sep 1 04:51:24 2013
+++ src/sys/dev/ic/comvar.h Tue Sep 3 15:32:55 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: comvar.h,v 1.76 2013/09/01 04:51:24 kiyohara Exp $ */
+/* $NetBSD: comvar.h,v 1.77 2013/09/03 15:32:55 jmcneill Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -69,6 +69,7 @@ int com_is_console(bus_space_tag_t, bus_
#define COM_HW_KGDB 0x80
#define COM_HW_TXFIFO_DISABLE 0x100
#define COM_HW_NO_TXPRELOAD 0x200
+#define COM_HW_AFE 0x400
/* Buffer size for character buffer */
#ifndef COM_RING_SIZE