Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic no EFR on tl16c750, use AFE bit on MCR reg instea...



details:   https://anonhg.NetBSD.org/src/rev/f16e52d907c5
branches:  trunk
changeset: 789695:f16e52d907c5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Sep 03 15:32:55 2013 +0000

description:
no EFR on tl16c750, use AFE bit on MCR reg instead for flow control

diffstat:

 sys/dev/ic/com.c    |  24 ++++++++++++++++++------
 sys/dev/ic/comreg.h |   3 ++-
 sys/dev/ic/comvar.h |   3 ++-
 3 files changed, 22 insertions(+), 8 deletions(-)

diffs (100 lines):

diff -r 74fd1609247e -r f16e52d907c5 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Tue Sep 03 14:54:00 2013 +0000
+++ b/sys/dev/ic/com.c  Tue Sep 03 15:32:55 2013 +0000
@@ -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 @@
                            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 @@
                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 @@
                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 @@
                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
diff -r 74fd1609247e -r f16e52d907c5 sys/dev/ic/comreg.h
--- a/sys/dev/ic/comreg.h       Tue Sep 03 14:54:00 2013 +0000
+++ b/sys/dev/ic/comreg.h       Tue Sep 03 15:32:55 2013 +0000
@@ -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 */
diff -r 74fd1609247e -r f16e52d907c5 sys/dev/ic/comvar.h
--- a/sys/dev/ic/comvar.h       Tue Sep 03 14:54:00 2013 +0000
+++ b/sys/dev/ic/comvar.h       Tue Sep 03 15:32:55 2013 +0000
@@ -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 @@
 #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



Home | Main Index | Thread Index | Old Index