aboutsummaryrefslogtreecommitdiff
path: root/sys/pc98/cbus/sio.c
diff options
context:
space:
mode:
authorKATO Takenori <kato@FreeBSD.org>1997-12-29 16:08:48 +0000
committerKATO Takenori <kato@FreeBSD.org>1997-12-29 16:08:48 +0000
commitb8c15aa548a05aa1455b38f31c73451066586c70 (patch)
treeff527cdb354f9cf5ff302a7b3571d5f56bedf7be /sys/pc98/cbus/sio.c
parent3e9646dfee7b911a2f6005581a9022386d5e04c2 (diff)
downloadsrc-b8c15aa548a05aa1455b38f31c73451066586c70.tar.gz
src-b8c15aa548a05aa1455b38f31c73451066586c70.zip
Sync with sys/i386/isa/sio.c revision up to 1.193.
Notes
Notes: svn path=/head/; revision=32089
Diffstat (limited to 'sys/pc98/cbus/sio.c')
-rw-r--r--sys/pc98/cbus/sio.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index bcf4d2135fdf..96c45a62c8eb 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.44 1997/12/06 13:24:54 bde Exp $
+ * $Id: sio.c,v 1.45 1997/12/16 17:40:39 eivind Exp $
*/
#include "opt_comconsole.h"
@@ -2585,10 +2585,10 @@ comparam(tp, t)
s = spltty();
#ifdef PC98
if(IS_8251(com->pc98_if_type)){
- if(divisor == 0){
- com_int_TxRx_disable( com );
+ if(divisor == 0)
com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
- }
+ else
+ com_tiocm_bis( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
} else {
#endif
if (divisor == 0)
@@ -2880,6 +2880,7 @@ comstart(tp)
}
enable_intr();
if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) {
+ ttwwakeup(tp);
#ifdef PC98
/* if(IS_8251(com->pc98_if_type))
com_int_Tx_enable(com); */
@@ -3361,10 +3362,11 @@ void
siocnprobe(cp)
struct consdev *cp;
{
+ speed_t boot_speed;
+ u_char cfcr;
struct isa_device *dvp;
int s;
struct siocnstate sp;
- speed_t boot_speed;
/*
* Find our first enabled console, if any. If it is a high-level
@@ -3392,6 +3394,24 @@ siocnprobe(cp)
if (boot_speed)
comdefaultrate = boot_speed;
}
+
+ /*
+ * Initialize the divisor latch. We can't rely on
+ * siocnopen() to do this the first time, since it
+ * avoids writing to the latch if the latch appears
+ * to have the correct value. Also, if we didn't
+ * just read the speed from the hardware, then we
+ * need to set the speed in hardware so that
+ * switching it later is null.
+ */
+ cfcr = inb(siocniobase + com_cfcr);
+ outb(siocniobase + com_cfcr, CFCR_DLAB | cfcr);
+ outb(siocniobase + com_dlbl,
+ COMBRD(comdefaultrate) & 0xff);
+ outb(siocniobase + com_dlbh,
+ (u_int) COMBRD(comdefaultrate) >> 8);
+ outb(siocniobase + com_cfcr, cfcr);
+
siocnopen(&sp);
splx(s);
if (!COM_LLCONSOLE(dvp)) {