diff options
author | asami <asami@FreeBSD.org> | 1996-10-09 21:47:16 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1996-10-09 21:47:16 +0000 |
commit | 8c4b57c465eeb8efd16bd3b8416454f8ab6c5185 (patch) | |
tree | 89e1d8c7c7558e413954ce87041b0b6005ce6673 /sys/pc98/cbus | |
parent | 130a49f9b81084ee94f9cf5c2122e5b4a7d1bde9 (diff) | |
download | FreeBSD-src-8c4b57c465eeb8efd16bd3b8416454f8ab6c5185.zip FreeBSD-src-8c4b57c465eeb8efd16bd3b8416454f8ab6c5185.tar.gz |
Another round of updates. Highlights:
(1) Merged i386/i386/sb.h, deleted pc98/pc98/sb.h.
(2) pc98/conf/GENERIC8 looks more like i386/conf/GENERIC now.
(3) Fixed display bug in pc98/boot/biosboot/io.c.
(4) Prepare to merge memory allocation routines:
pc98/i386/locore.s
pc98/i386/machdep.c
pc98/pc98/pc98_machdep.c
pc98/pc98/pc98_machdep.h
(5) Support new board "C-NET(98)":
pc98/pc98/if_ed98.h
pc98/pc98/if_ed.c
(6) Make sure FPU is recognized for non-Intel CPUs:
pc98/pc98/npx.c
(7) Do not expect bss to be zero-allocated:
pc98/pc98/pc98.c
Submitted by: The FreeBSD(98) Development Team
Diffstat (limited to 'sys/pc98/cbus')
-rw-r--r-- | sys/pc98/cbus/cbus.h | 6 | ||||
-rw-r--r-- | sys/pc98/cbus/clock.c | 16 | ||||
-rw-r--r-- | sys/pc98/cbus/pcrtc.c | 16 | ||||
-rw-r--r-- | sys/pc98/cbus/sio.c | 49 |
4 files changed, 59 insertions, 28 deletions
diff --git a/sys/pc98/cbus/cbus.h b/sys/pc98/cbus/cbus.h index edc9033..5d79e74 100644 --- a/sys/pc98/cbus/cbus.h +++ b/sys/pc98/cbus/cbus.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.h 5.7 (Berkeley) 5/9/91 - * $Id: pc98.h,v 1.3 1996/09/10 09:38:21 asami Exp $ + * $Id: pc98.h,v 1.4 1996/09/12 11:09:54 asami Exp $ */ #ifndef _PC98_PC98_PC98_H_ @@ -265,6 +265,8 @@ epson_outsw(u_int port, void *addr, size_t cnt) /* * Obtained from NetBSD/pc98 */ -#define MADDRUNK -1 +#define MADDRUNK -1 +#define IRQUNK 0 +#define DRQUNK -1 #endif /* !_PC98_PC98_PC98_H_ */ diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 6ca472a..d9b34d1 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $ + * $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $ */ /* @@ -46,13 +46,13 @@ /* * modified for PC98 - * $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $ + * $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $ */ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include "opt_cpu.h" @@ -414,16 +414,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include <ddb/ddb.h> + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ #endif /* for PC98 */ static int @@ -768,7 +770,7 @@ startrtclock() if (bootverbose) { printf( "Press a key on the console to abort clock calibration\n"); - while (!cncheckc()) + while (cncheckc() == -1) calibrate_clocks(); } #endif diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 6ca472a..d9b34d1 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $ + * $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $ */ /* @@ -46,13 +46,13 @@ /* * modified for PC98 - * $Id: clock.c,v 1.5 1996/09/07 02:13:39 asami Exp $ + * $Id: clock.c,v 1.6 1996/10/09 19:47:43 bde Exp $ */ /* * Primitive clock interrupt routines. */ -#include "opt_ddb.h" + #include "opt_clock.h" #include "opt_cpu.h" @@ -414,16 +414,18 @@ rtcintr(struct clockframe frame) } } +#include "opt_ddb.h" #ifdef DDB -static void -DDB_printrtc(void) +#include <ddb/ddb.h> + +DB_SHOW_COMMAND(rtc, rtc) { printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); } -#endif +#endif /* DDB */ #endif /* for PC98 */ static int @@ -768,7 +770,7 @@ startrtclock() if (bootverbose) { printf( "Press a key on the console to abort clock calibration\n"); - while (!cncheckc()) + while (cncheckc() == -1) calibrate_clocks(); } #endif diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index aacf54c..bcd8f13 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.6 1996/09/10 09:38:34 asami Exp $ + * $Id: sio.c,v 1.7 1996/09/12 11:09:56 asami Exp $ */ #include "opt_comconsole.h" @@ -875,7 +875,7 @@ sioprobe(dev) * XXX what about the UART bug avoided by waiting in comparam()? * We don't want to to wait long enough to drain at 2 bps. */ - outb(iobase + com_cfcr, CFCR_DLAB); + outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS); outb(iobase + com_dlbl, COMBRD(9600) & 0xff); outb(iobase + com_dlbh, (u_int) COMBRD(9600) >> 8); outb(iobase + com_cfcr, CFCR_8BITS); @@ -1299,7 +1299,6 @@ determined_type: ; dev = makedev(CDEV_MAJOR, 0); cdevsw_add(&dev, &sio_cdevsw, NULL); #ifdef DEVFS - /* devsw, minor, type, uid, gid, perm, fmt, ... */ com->devfs_token_ttyd = devfs_add_devswf(&sio_cdevsw, unit, DV_CHR, UID_ROOT, GID_WHEEL, 0600, "ttyd%n", unit); @@ -2401,6 +2400,8 @@ comparam(tp, t) int cflag; struct com_s *com; int divisor; + u_char dlbh; + u_char dlbl; int error; Port_t iobase; int s; @@ -2562,8 +2563,18 @@ retry: #endif if (divisor != 0) { outb(iobase + com_cfcr, cfcr | CFCR_DLAB); - outb(iobase + com_dlbl, divisor & 0xFF); - outb(iobase + com_dlbh, (u_int) divisor >> 8); + /* + * Only set the divisor registers if they would change, + * since on some 16550 incompatibles (UMC8669F), setting + * them while input is arriving them loses sync until + * data stops arriving. + */ + dlbl = divisor & 0xFF; + if (inb(iobase + com_dlbl) != dlbl) + outb(iobase + com_dlbl, dlbl); + dlbh = (u_int) divisor >> 8; + if (inb(iobase + com_dlbh) != dlbh) + outb(iobase + com_dlbh, dlbh); } outb(iobase + com_cfcr, com->cfcr_image = cfcr); #ifdef PC98 @@ -3035,6 +3046,8 @@ siocnopen(sp) struct siocnstate *sp; { int divisor; + u_char dlbh; + u_char dlbl; Port_t iobase; /* @@ -3047,12 +3060,22 @@ siocnopen(sp) outb(iobase + com_ier, 0); /* spltty() doesn't stop siointr() */ siocntxwait(); sp->cfcr = inb(iobase + com_cfcr); - outb(iobase + com_cfcr, CFCR_DLAB); + outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS); sp->dlbl = inb(iobase + com_dlbl); sp->dlbh = inb(iobase + com_dlbh); + /* + * Only set the divisor registers if they would change, since on + * some 16550 incompatibles (Startech), setting them clears the + * data input register. This also reduces the effects of the + * UMC8669F bug. + */ divisor = ttspeedtab(comdefaultrate, comspeedtab); - outb(iobase + com_dlbl, divisor & 0xFF); - outb(iobase + com_dlbh, (u_int) divisor >> 8); + dlbl = divisor & 0xFF; + if (sp->dlbl != dlbl) + outb(iobase + com_dlbl, dlbl); + dlbh = (u_int) divisor >> 8; + if (sp->dlbh != dlbh) + outb(iobase + com_dlbh, dlbh); outb(iobase + com_cfcr, CFCR_8BITS); sp->mcr = inb(iobase + com_mcr); /* @@ -3074,9 +3097,11 @@ siocnclose(sp) */ siocntxwait(); iobase = siocniobase; - outb(iobase + com_cfcr, CFCR_DLAB); - outb(iobase + com_dlbl, sp->dlbl); - outb(iobase + com_dlbh, sp->dlbh); + outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS); + if (sp->dlbl != inb(iobase + com_dlbl)) + outb(iobase + com_dlbl, sp->dlbl); + if (sp->dlbh != inb(iobase + com_dlbh)) + outb(iobase + com_dlbh, sp->dlbh); outb(iobase + com_cfcr, sp->cfcr); /* * XXX damp oscillations of MCR_DTR and MCR_RTS by not restoring them. @@ -3128,7 +3153,7 @@ siocncheckc(dev) if (inb(iobase + com_lsr) & LSR_RXRDY) c = inb(iobase + com_data); else - c = 0; + c = -1; siocnclose(&sp); splx(s); return (c); |