Source-Changes-HG archive

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

[src/trunk]: src/sys * Add a new hwflag, COM_HW_NO_TXPRELOAD, which tells com...



details:   https://anonhg.NetBSD.org/src/rev/1c5042fe2450
branches:  trunk
changeset: 525537:1c5042fe2450
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Apr 12 19:32:30 2002 +0000

description:
* Add a new hwflag, COM_HW_NO_TXPRELOAD, which tells comstart() to
  not pre-load the chip's Tx buffer, but instead waits for the Tx Ready
  interrupt to transmit the first chunk of data.
* On the IOP310, set COM_HW_NO_TXPRELOAD, rather than COM_HW_TXFIFO_DISABLE.

This solves the "UART hangs" problem on the Npwr in a nicer way (i.e. we
get to use the FIFO, whee).  The COM_HW_NO_TXPRELOAD happens to match the
Linux 16550 driver's Tx algorithm, and the "UART hang" was never observed
on the Npwr running Linux.

Eventually, we might want to eliminate the COM_HW_NO_TXPRELOAD, and simply
always use its algorithm.  But it should be tested on more 16x50 variants
before we do that.

Kudos to Valeriy Ushakov <uwe%netbsd.org@localhost> for pointing out this solution
(which also happens to fix the stray UART interrupt issue on the Krups
Javastation), and to Allen Briggs <briggs%netbsd.org@localhost> for experimenting
with various methods of fixing this.

diffstat:

 sys/arch/evbarm/iq80310/com_obio.c |  6 ++----
 sys/dev/ic/com.c                   |  6 +++---
 sys/dev/ic/comvar.h                |  3 ++-
 3 files changed, 7 insertions(+), 8 deletions(-)

diffs (64 lines):

diff -r 68827bd29019 -r 1c5042fe2450 sys/arch/evbarm/iq80310/com_obio.c
--- a/sys/arch/evbarm/iq80310/com_obio.c        Fri Apr 12 19:12:31 2002 +0000
+++ b/sys/arch/evbarm/iq80310/com_obio.c        Fri Apr 12 19:32:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_obio.c,v 1.3 2002/04/12 03:01:57 briggs Exp $      */
+/*     $NetBSD: com_obio.c,v 1.4 2002/04/12 19:32:31 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -84,9 +84,7 @@
        sc->sc_iot = oba->oba_st;
        sc->sc_iobase = oba->oba_addr;
        sc->sc_frequency = COM_FREQ;
-#if defined(IOP310_TEAMASA_NPWR)
-       sc->sc_hwflags |= COM_HW_TXFIFO_DISABLE;
-#endif
+       sc->sc_hwflags = COM_HW_NO_TXPRELOAD;
        error = bus_space_map(sc->sc_iot, oba->oba_addr, 8, 0, &sc->sc_ioh);
 
        if (error) {
diff -r 68827bd29019 -r 1c5042fe2450 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Fri Apr 12 19:12:31 2002 +0000
+++ b/sys/dev/ic/com.c  Fri Apr 12 19:32:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com.c,v 1.194 2002/03/17 19:40:57 atatat Exp $ */
+/*     $NetBSD: com.c,v 1.195 2002/04/12 19:32:30 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.194 2002/03/17 19:40:57 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.195 2002/04/12 19:32:30 thorpej Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -1725,7 +1725,7 @@
        }
 
        /* Output the first chunk of the contiguous buffer. */
-       {
+       if (!ISSET(sc->sc_hwflags, COM_HW_NO_TXPRELOAD)) {
                int n;
 
                n = sc->sc_tbc;
diff -r 68827bd29019 -r 1c5042fe2450 sys/dev/ic/comvar.h
--- a/sys/dev/ic/comvar.h       Fri Apr 12 19:12:31 2002 +0000
+++ b/sys/dev/ic/comvar.h       Fri Apr 12 19:32:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: comvar.h,v 1.42 2001/08/27 14:27:01 enami Exp $        */
+/*     $NetBSD: comvar.h,v 1.43 2002/04/12 19:32:30 thorpej Exp $      */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -63,6 +63,7 @@
 #define        COM_HW_CONSOLE  0x40
 #define        COM_HW_KGDB     0x80
 #define        COM_HW_TXFIFO_DISABLE   0x100
+#define        COM_HW_NO_TXPRELOAD     0x200
 
 /* Buffer size for character buffer */
 #define        COM_RING_SIZE   2048



Home | Main Index | Thread Index | Old Index