diff --git a/sys/arch/alpha/alpha/dec_3000_300.c b/sys/arch/alpha/alpha/dec_3000_300.c index a462faf13064..423bd40837a1 100644 --- a/sys/arch/alpha/alpha/dec_3000_300.c +++ b/sys/arch/alpha/alpha/dec_3000_300.c @@ -1,4 +1,4 @@ -/* $NetBSD: dec_3000_300.c,v 1.35 2002/09/06 13:18:43 gehenna Exp $ */ +/* $NetBSD: dec_3000_300.c,v 1.36 2002/09/24 13:30:39 ad Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -33,9 +33,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.35 2002/09/06 13:18:43 gehenna Exp $"); - -#include "opt_new_scc_driver.h" +__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.36 2002/09/24 13:30:39 ad Exp $"); #include #include @@ -50,9 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.35 2002/09/06 13:18:43 gehenna Ex #include #include #include -#ifndef NEW_SCC_DRIVER -#include -#endif #include #include @@ -101,17 +96,6 @@ dec_3000_300_cons_init() ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); -#ifndef NEW_SCC_DRIVER - switch (ctb->ctb_term_type) { - case CTB_GRAPHICS: - alpha_donot_kludge_scc = 1; - return; - case CTB_PRINTERPORT: - return; - default: - goto badconsole; - } -#else switch (ctb->ctb_term_type) { case CTB_GRAPHICS: #if NWSDISPLAY > 0 @@ -150,16 +134,12 @@ dec_3000_300_cons_init() } default: - goto badconsole; + printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type); + printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot); + panic("consinit: unknown console type %lu\n", + ctb->ctb_term_type); + /* NOTREACHED */ } -#endif - return; -badconsole: - printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type); - printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot); - - panic("consinit: unknown console type %lu\n", - ctb->ctb_term_type); } static void diff --git a/sys/arch/alpha/alpha/dec_3000_500.c b/sys/arch/alpha/alpha/dec_3000_500.c index ef3e16bebd34..891e89abed1a 100644 --- a/sys/arch/alpha/alpha/dec_3000_500.c +++ b/sys/arch/alpha/alpha/dec_3000_500.c @@ -1,4 +1,4 @@ -/* $NetBSD: dec_3000_500.c,v 1.34 2002/09/06 13:18:43 gehenna Exp $ */ +/* $NetBSD: dec_3000_500.c,v 1.35 2002/09/24 13:30:39 ad Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -32,9 +32,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.34 2002/09/06 13:18:43 gehenna Exp $"); - -#include "opt_new_scc_driver.h" +__KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.35 2002/09/24 13:30:39 ad Exp $"); #include #include @@ -50,9 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.34 2002/09/06 13:18:43 gehenna Ex #include #include #include -#ifndef NEW_SCC_DRIVER -#include -#endif #include #include @@ -121,18 +116,6 @@ dec_3000_500_cons_init() ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); -#ifndef NEW_SCC_DRIVER - switch (ctb->ctb_term_type) { - case CTB_GRAPHICS: - alpha_donot_kludge_scc = 1; - return; - case CTB_PRINTERPORT: - return; - default: - goto badconsole; - } -#else - switch (ctb->ctb_term_type) { case CTB_GRAPHICS: #if NWSDISPLAY > 0 @@ -171,16 +154,12 @@ dec_3000_500_cons_init() } default: - goto badconsole; + printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type); + printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot); + panic("consinit: unknown console type %lu\n", + ctb->ctb_term_type); + /* NOTREACHED */ } -#endif - return; -badconsole: - printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type); - printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot); - - panic("consinit: unknown console type %lu\n", - ctb->ctb_term_type); } static void diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index a2de5a304195..ad62ec2475d6 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.192 2002/08/24 03:10:52 mhitch Exp $ */ +/* $NetBSD: pmap.c,v 1.193 2002/09/24 13:30:39 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -148,13 +148,12 @@ */ #include "opt_lockdebug.h" -#include "opt_new_scc_driver.h" #include "opt_sysv.h" #include "opt_multiprocessor.h" #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.192 2002/08/24 03:10:52 mhitch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.193 2002/09/24 13:30:39 ad Exp $"); #include #include @@ -1010,13 +1009,7 @@ int pmap_uses_prom_console(void) { -#if defined(NEW_SCC_DRIVER) return (cputype == ST_DEC_21000); -#else - return (cputype == ST_DEC_21000 - || cputype == ST_DEC_3000_300 - || cputype == ST_DEC_3000_500); -#endif /* NEW_SCC_DRIVER */ } #endif /* _PMAP_MAY_USE_PROM_CONSOLE */ diff --git a/sys/arch/alpha/conf/ALPHA b/sys/arch/alpha/conf/ALPHA index 0d6c270c7d2f..115ac723c056 100644 --- a/sys/arch/alpha/conf/ALPHA +++ b/sys/arch/alpha/conf/ALPHA @@ -1,4 +1,4 @@ -# $NetBSD: ALPHA,v 1.169 2002/09/20 10:39:48 martti Exp $ +# $NetBSD: ALPHA,v 1.170 2002/09/24 13:30:41 ad Exp $ # # Alpha kernel with all the options you'd want, and more. @@ -6,7 +6,7 @@ include "arch/alpha/conf/std.alpha" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -ident "ALPHA-$Revision: 1.169 $" +ident "ALPHA-$Revision: 1.170 $" maxusers 32 @@ -136,6 +136,7 @@ options FIX_UNALIGNED_VAX_FP # fix unaligned VAX FP loads & stores #options NO_KERNEL_RCSIDS # don't include kernel file RCS IDs options USERCONF # userconf(4) support #options PIPE_SOCKETPAIR # smaller, but slower pipe(2) +options FONT_GALLANT12x22 # Console font for TC devices # The Alpha console firmware network boots using the BOOTP # protocol, so we ask the NFS code to use BOOTP/DHCP as well, @@ -192,17 +193,27 @@ tc* at tcasic? ioasic* at tc? slot ? offset ? mcclock* at ioasic? offset ? le* at ioasic? offset ? -scc0 at ioasic? offset ? -scc1 at ioasic? offset ? +zsc0 at ioasic? offset 0x100000 +zsc1 at ioasic? offset 0x180000 bba0 at ioasic? offset ? audio* at bba? tcds* at tc? slot ? offset ? asc* at tcds? chip ? asc* at tc? slot ? offset ? -#cfb* at tc? slot ? offset ? -#sfb* at tc? slot ? offset ? le* at tc? slot ? offset ? fta* at tc? slot ? offset ? # DEC DEFTA FDDI cards +cfb* at tc? slot ? offset ? +mfb* at tc? slot ? offset ? +tfb* at tc? slot ? offset ? +sfb* at tc? slot ? offset ? +#sfbp* at tc? slot ? offset ? +px* at tc? slot ? offset ? +pxg* at tc? slot ? offset ? + +# TurboChannel serial attachments +zstty* at zsc? channel ? # serial ports on B channels +lkkbd0 at zsc1 channel ? # keyboard port on A channels +vsms0 at zsc0 channel ? # mouse port on A channels # PCI host bus adapter support apecs* at mainbus? @@ -508,10 +519,17 @@ uyap* at uhub? port ? ugen* at uhub? port ? # Workstation Console attachments -#wsdisplay* at cfb? +wsdisplay* at cfb? +wsdisplay* at mfb? +wsdisplay* at tfb? +wsdisplay* at sfb? +#wsdisplay* at sfbp? +wsdisplay* at px? +wsdisplay* at pxg? wsdisplay* at vga? -#wsdisplay* at sfb? wsdisplay* at tga? +wskbd* at lkkbd? console ? +wsmouse* at vsms? wskbd* at pckbd? wsmouse* at pms? diff --git a/sys/arch/alpha/conf/GENERIC b/sys/arch/alpha/conf/GENERIC index 09429260f74c..22cc426467bf 100644 --- a/sys/arch/alpha/conf/GENERIC +++ b/sys/arch/alpha/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.214 2002/09/24 09:34:39 jdolecek Exp $ +# $NetBSD: GENERIC,v 1.215 2002/09/24 13:30:41 ad Exp $ # # GENERIC machine description file # @@ -25,7 +25,7 @@ include "arch/alpha/conf/std.alpha" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.214 $" +#ident "GENERIC-$Revision: 1.215 $" maxusers 32 @@ -137,6 +137,7 @@ options UCONSOLE # users can use TIOCCONS (for xconsole) #options PCMCIAVERBOSE options USERCONF # userconf(4) support #options PIPE_SOCKETPAIR # smaller, but slower pipe(2) +options FONT_GALLANT12x22 # Console font for TC devices # The Alpha console firmware network boots using the BOOTP # protocol, so we ask the NFS code to use BOOTP/DHCP as well, @@ -193,17 +194,27 @@ tc* at tcasic? ioasic* at tc? slot ? offset ? mcclock* at ioasic? offset ? le* at ioasic? offset ? -scc0 at ioasic? offset ? -scc1 at ioasic? offset ? +zsc0 at ioasic? offset 0x100000 +zsc1 at ioasic? offset 0x180000 bba0 at ioasic? offset ? audio* at bba? tcds* at tc? slot ? offset ? asc* at tcds? chip ? asc* at tc? slot ? offset ? -#cfb* at tc? slot ? offset ? -#sfb* at tc? slot ? offset ? le* at tc? slot ? offset ? fta* at tc? slot ? offset ? # DEC DEFTA FDDI cards +cfb* at tc? slot ? offset ? +mfb* at tc? slot ? offset ? +tfb* at tc? slot ? offset ? +sfb* at tc? slot ? offset ? +#sfbp* at tc? slot ? offset ? +px* at tc? slot ? offset ? +pxg* at tc? slot ? offset ? + +# TurboChannel serial attachments +zstty* at zsc? channel ? # serial ports on B channels +lkkbd0 at zsc1 channel ? # keyboard port on A channels +vsms0 at zsc0 channel ? # mouse port on A channels # PCI host bus adapter support apecs* at mainbus? @@ -492,10 +503,17 @@ uyap* at uhub? port ? ugen* at uhub? port ? # Workstation Console attachments -#wsdisplay* at cfb? +wsdisplay* at cfb? +wsdisplay* at mfb? +wsdisplay* at tfb? +wsdisplay* at sfb? +#wsdisplay* at sfbp? +wsdisplay* at px? +wsdisplay* at pxg? wsdisplay* at vga? -#wsdisplay* at sfb? wsdisplay* at tga? +wskbd* at lkkbd? console ? +wsmouse* at vsms? wskbd* at pckbd? wsmouse* at pms? diff --git a/sys/arch/alpha/conf/INSTALL b/sys/arch/alpha/conf/INSTALL index 109164022a42..fe4a30be22e4 100644 --- a/sys/arch/alpha/conf/INSTALL +++ b/sys/arch/alpha/conf/INSTALL @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.67 2002/09/18 02:43:54 lukem Exp $ +# $NetBSD: INSTALL,v 1.68 2002/09/24 13:30:41 ad Exp $ # # Alpha INSTALL kernel. @@ -76,6 +76,7 @@ options INSECURE # disable `kernel security level' options USERCONF # userconf(4) support options PIPE_SOCKETPAIR # smaller, but slower pipe(2) options MALLOC_NOINLINE # Not inlining MALLOC saves memory +options FONT_GALLANT12x22 # Console font for TC devices # The Alpha console firmware network boots using the BOOTP # protocol, so we ask the NFS code to use BOOTP/DHCP as well, @@ -125,12 +126,24 @@ tc* at tcasic? ioasic* at tc? slot ? offset ? mcclock* at ioasic? offset ? le* at ioasic? offset ? -scc0 at ioasic? offset ? -scc1 at ioasic? offset ? +zsc0 at ioasic? offset 0x100000 +zsc1 at ioasic? offset 0x180000 tcds* at tc? slot ? offset ? asc* at tcds? chip ? le* at tc? slot ? offset ? fta* at tc? slot ? offset ? # DEC DEFTA FDDI cards +cfb* at tc? slot ? offset ? +mfb* at tc? slot ? offset ? +tfb* at tc? slot ? offset ? +sfb* at tc? slot ? offset ? +#sfbp* at tc? slot ? offset ? +px* at tc? slot ? offset ? +pxg* at tc? slot ? offset ? + +# TurboChannel serial attachments +zstty* at zsc? channel ? # serial ports on B channels +lkkbd0 at zsc1 channel ? # keyboard port on A channels +vsms0 at zsc0 channel ? # mouse port on A channels # PCI host bus adapter support apecs* at mainbus? @@ -291,6 +304,15 @@ ld* at mlx? unit ? # Workstation Console attachments wsdisplay* at vga? wsdisplay* at tga? +wsdisplay* at cfb? +wsdisplay* at mfb? +wsdisplay* at tfb? +wsdisplay* at sfb? +#wsdisplay* at sfbp? +wsdisplay* at px? +wsdisplay* at pxg? +wskbd* at lkkbd? console ? +wsmouse* at vsms? wskbd* at pckbd? wsmouse* at pms? diff --git a/sys/arch/alpha/conf/Makefile.alpha b/sys/arch/alpha/conf/Makefile.alpha index 94268ded1aaf..87493343f650 100644 --- a/sys/arch/alpha/conf/Makefile.alpha +++ b/sys/arch/alpha/conf/Makefile.alpha @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.alpha,v 1.72 2001/12/09 05:02:21 atatat Exp $ +# $NetBSD: Makefile.alpha,v 1.73 2002/09/24 13:30:41 ad Exp $ # Makefile for NetBSD # @@ -69,7 +69,7 @@ STRIPFLAGS= -g -X ## # depend on CPU configuration -clock.o apecs.o cia.o lca.o ioasic.o scc.o icasic.o: Makefile +clock.o apecs.o cia.o lca.o ioasic.o icasic.o: Makefile ## ## (7) misc settings diff --git a/sys/arch/alpha/conf/TCWSCONS b/sys/arch/alpha/conf/TCWSCONS deleted file mode 100644 index 9da5fe28f61d..000000000000 --- a/sys/arch/alpha/conf/TCWSCONS +++ /dev/null @@ -1,190 +0,0 @@ -# $NetBSD: TCWSCONS,v 1.29 2002/09/18 02:43:55 lukem Exp $ -# -# TURBOchannel Alpha DEC3000 - -include "arch/alpha/conf/std.alpha" - -#options INCLUDE_CONFIG_FILE # embed config file in kernel binary - -#ident "TCWSCONS-$Revision: 1.29 $" - -maxusers 32 - -# CPU Support -options DEC_3000_500 # Flamingo etc: 3000/[4-9]00* -options DEC_3000_300 # Pelican etc: 3000/300* - -# Standard system options -options KTRACE # System call tracing support -options NTP # kernel PLL for NTP - -# Diagnostic/debugging support options -options DIAGNOSTIC # Cheap kernel consistency checks -options DDB # kernel debugger -#makeoptions DEBUG="-g" - -# File systems -file-system FFS # Fast file system -file-system MFS # Memory-based file system -#file-system LFS # Log-based filesystem (still experimental) -file-system CD9660 # ISO-9660 CD-ROM FS (w/RockRidge extensions) -file-system MSDOSFS # MS-DOS-compatible file system -file-system NTFS # Windows/NT file system (experimental) -file-system NFS # Sun NFS-compatible file system client -file-system NULLFS # Null file system layer -file-system KERNFS # Kernel variable file system (/kern) -#file-system FDESC # File descriptor file system (/dev/fd) -#file-system PORTAL # Portal file system -#file-system OVERLAY # overlay file system -#file-system UMAPFS # User-mapping file system layer -file-system PROCFS # Process file system (/proc) -#file-system UNION # union file system - -# File system options -options NFSSERVER # Sun NFS-compatible file system server -#options FFS_EI # FFS Endian Independant support -options SOFTDEP # FFS soft updates support. - -# Networking options -options INET # Internet protocol suite -options INET6 # IPV6 -#options IPSEC # IP security -#options IPSEC_ESP # IP security (encryption part; define w/IPSEC) -#options IPSEC_DEBUG # debug for IP security - -# 4.3BSD compatibility. Should be optional, but necessary for now. -options COMPAT_43 - -# Binary compatibility with previous versions of NetBSD. -#options COMPAT_09 -options COMPAT_10 -options COMPAT_11 -options COMPAT_12 -options COMPAT_13 -options COMPAT_14 - -# OSF/1 binary compatibility -options COMPAT_OSF1 - -# Linux binary compatibility -options COMPAT_LINUX - -# System V-like message queues -options SYSVMSG - -# System V-like semaphores -options SYSVSEM - -# System V-like shared memory -options SYSVSHM -#options SHMMAXPGS=1024 # 1024 pages is the default - -# Loadable Kernel Modules -options LKM - -# Disable kernel security. Needed for X on a px or pxg. -#options INSECURE - -# Misc. options -options SCSIVERBOSE # Verbose SCSI errors -options TCVERBOSE # recognize "unknown" TC devices -options UCONSOLE # users can use TIOCCONS (for xconsole) -options USERCONF # userconf(4) support -#options PIPE_SOCKETPAIR # smaller, but slower pipe(2) - -# The Alpha console firmware network boots using the BOOTP -# protocol, so we ask the NFS code to use BOOTP/DHCP as well, -# in case we have NFS root. -options NFS_BOOT_DHCP # superset of BOOTP - -# Raster console options -options FONT_GALLANT12x22 -#options FONT_LUCIDA16x29 -#options FONT_BOLD8x16 # XXX not supported by HX -#options FONT_VT220L8x10 # XXX not supported by HX -#options FONT_VT220L8x8 # XXX not supported by HX -#options FONT_QVSS8x15 # XXX not supported by HX - -# WS console uses SUN or VT100 terminal emulation -options WSEMUL_VT100 - -# realtime clock compatible to OSF/1 -#options CLOCK_COMPAT_OSF1 - -config netbsd root on ? type ? -#config netbsd root on sd0 type ffs -#config netbsd root on ? type nfs - -mainbus0 at root -cpu* at mainbus0 - -# TURBOchannel host bus adapter support -tcasic* at mainbus0 - -# TURBOchannel bus support -tc* at tcasic? - -# TURBOchannel devices -ioasic* at tc? slot ? offset ? -mcclock* at ioasic? offset ? -le* at ioasic? offset ? -zsc0 at ioasic? offset 0x100000 -zsc1 at ioasic? offset 0x180000 -bba0 at ioasic? offset ? -audio* at bba? -tcds* at tc? slot ? offset ? -asc* at tcds? chip ? -#cfb* at tc? slot ? offset ? -#mfb* at tc? slot ? offset ? -#tfb* at tc? slot ? offset ? -sfb* at tc? slot ? offset ? -#sfbp* at tc? slot ? offset ? -#px* at tc? slot ? offset ? -#pxg* at tc? slot ? offset ? -le* at tc? slot ? offset ? -fta* at tc? slot ? offset ? # DEC DEFTA FDDI cards - -options NEW_SCC_DRIVER -zstty* at zsc? channel ? # serial ports on B channels -lkkbd0 at zsc1 channel ? # keyboard port on A channels -vsms0 at zsc0 channel ? # mouse port on A channels - -# SCSI bus support -scsibus* at asc? - -# SCSI devices -cd* at scsibus? target ? lun ? # SCSI CD-ROM drives -sd* at scsibus? target ? lun ? # SCSI disk drives -st* at scsibus? target ? lun ? # SCSI tape drives - -# Workstation Console attachments -#wsdisplay* at cfb? -#wsdisplay* at mfb? -#wsdisplay* at tfb? -wsdisplay* at sfb? -#wsdisplay* at sfbp? -#wsdisplay* at px? -#wsdisplay* at pxg? -wskbd* at lkkbd? console ? -wsmouse* at vsms? - -pseudo-device bpfilter 16 -pseudo-device ccd 4 -#pseudo-device raid 4 # RAIDframe disk driver -#options RAID_AUTOCONFIG # auto-configuration of RAID components -pseudo-device ipfilter 1 -pseudo-device loop 1 -pseudo-device md 1 -pseudo-device ppp 4 -pseudo-device pty # pseudo-terminals -pseudo-device sl 4 -pseudo-device vnd 4 -#pseudo-device gre 2 # generic L3 over IP tunnel -pseudo-device gif 4 # IPv[46] over IPv[46] tunnel (RFC1933) -#pseudo-device faith 1 # IPv[46] tcp relay translation i/f -#pseudo-device stf 1 # 6to4 IPv6 over IPv4 encapsulation -pseudo-device vlan # IEEE 802.1q encapsulation -#pseudo-device sequencer 1 # MIDI sequencer -pseudo-device rnd # /dev/random and in-kernel generator -#options RND_COM # use "com" randomness too -pseudo-device clockctl # user control of clock subsystem diff --git a/sys/arch/alpha/conf/files.alpha b/sys/arch/alpha/conf/files.alpha index a74689b14216..c2002cd1adc2 100644 --- a/sys/arch/alpha/conf/files.alpha +++ b/sys/arch/alpha/conf/files.alpha @@ -1,4 +1,4 @@ -# $NetBSD: files.alpha,v 1.157 2002/09/06 13:18:43 gehenna Exp $ +# $NetBSD: files.alpha,v 1.158 2002/09/24 13:30:42 ad Exp $ # # alpha-specific configuration info @@ -33,9 +33,6 @@ defflag API_UP1000 # EV6 Alpha Processor, Inc. UP1000 defflag FIX_UNALIGNED_VAX_FP defflag ZS_IOASIC_DMA -# XXX Temporary, until integration is finished. -defflag NEW_SCC_DRIVER - # realtime clock compatible to OSF/1 defflag CLOCK_COMPAT_OSF1 @@ -189,11 +186,6 @@ device pxg: wsemuldisplaydev, stic attach pxg at tc file dev/tc/pxg.c pxg needs-flag -# 8530 UARTs -device scc: tty -attach scc at ioasic -file arch/alpha/tc/scc.c scc needs-count - # 8530 UARTs using the MI 8530 driver device zsc { channel = -1 } attach zsc at ioasic with zsc_ioasic diff --git a/sys/arch/alpha/conf/majors.alpha b/sys/arch/alpha/conf/majors.alpha index 11d6863b57bd..122b10fa1bab 100644 --- a/sys/arch/alpha/conf/majors.alpha +++ b/sys/arch/alpha/conf/majors.alpha @@ -1,4 +1,4 @@ -# $NetBSD: majors.alpha,v 1.2 2002/09/06 13:18:43 gehenna Exp $ +# $NetBSD: majors.alpha,v 1.3 2002/09/24 13:30:42 ad Exp $ # # Device majors for alpha # @@ -19,7 +19,6 @@ device-major st char 12 block 2 st device-major cd char 13 block 3 cd device-major ch char 14 ch device-major zstty char 15 zstty -device-major scc char 15 scc & !zstty device-major lkm char 16 lkm device-major prom char 23 diff --git a/sys/arch/alpha/include/pmap.h b/sys/arch/alpha/include/pmap.h index 9a46c68e3852..643c993492c6 100644 --- a/sys/arch/alpha/include/pmap.h +++ b/sys/arch/alpha/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.56 2002/09/22 07:53:40 chs Exp $ */ +/* $NetBSD: pmap.h,v 1.57 2002/09/24 13:30:43 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -157,22 +157,11 @@ typedef struct pv_entry { #ifdef _KERNEL #ifndef _LKM -#include "opt_new_scc_driver.h" -#include "opt_dec_3000_300.h" /* XXX */ -#include "opt_dec_3000_500.h" /* XXX */ #include "opt_dec_kn8ae.h" /* XXX */ -#if defined(NEW_SCC_DRIVER) #if defined(DEC_KN8AE) #define _PMAP_MAY_USE_PROM_CONSOLE #endif -#else /* ! NEW_SCC_DRIVER */ -#if defined(DEC_3000_300) \ - || defined(DEC_3000_500) \ - || defined(DEC_KN8AE) /* XXX */ -#define _PMAP_MAY_USE_PROM_CONSOLE /* XXX */ -#endif /* XXX */ -#endif /* NEW_SCC_DRIVER */ #if defined(MULTIPROCESSOR) struct cpu_info; diff --git a/sys/arch/alpha/tc/scc.c b/sys/arch/alpha/tc/scc.c deleted file mode 100644 index 691ec0649adb..000000000000 --- a/sys/arch/alpha/tc/scc.c +++ /dev/null @@ -1,1280 +0,0 @@ -/* $NetBSD: scc.c,v 1.60 2002/09/06 13:18:43 gehenna Exp $ */ - -/* - * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)scc.c 8.2 (Berkeley) 11/30/93 - */ - -#include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.60 2002/09/06 13:18:43 gehenna Exp $"); - -#include "opt_ddb.h" -#include "opt_dec_3000_300.h" - -/* - * Intel 82530 dual usart chip driver. Supports the serial port(s) on the - * Personal DECstation 5000/xx and DECstation 5000/1xx, plus the keyboard - * and mouse on the 5000/1xx. (Don't ask me where the A channel signals - * are on the 5000/xx.) - * - * See: Intel MicroCommunications Handbook, Section 2, pg. 155-173, 1992. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#define raster_console() 1 /* Treat test for cn_screen as true */ -#define CONSOLE_ON_UNIT(unit) 0 /* No raster console on Alphas */ - -#define NSCCLINE (NSCC*2) -#define SCCUNIT(dev) (minor(dev) >> 1) -#define SCCLINE(dev) (minor(dev) & 0x1) - -#ifdef DEBUG -int debugChar; -#endif - -struct scc_softc { - struct device sc_dv; - struct pdma scc_pdma[2]; - struct { - u_char wr1; - u_char wr3; - u_char wr4; - u_char wr5; - u_char wr14; - } scc_wreg[2]; - struct tty *scc_tty[2]; - int scc_softCAR; - - int scc_flags[2]; -#define SCC_CHAN_NEEDSDELAY 0x01 /* sw must delay 1.6us between output*/ -#define SCC_CHAN_NOMODEM 0x02 /* don't touch modem ctl lines (may - be left floating or x-wired */ -#define SCC_CHAN_MODEM_CROSSED 0x04 /* modem lines wired to other channel*/ -#define SCC_CHAN_KBDLINE 0x08 /* XXX special-case keyboard lines */ -}; - -/* - * BRG formula is: - * ClockFrequency - * BRGconstant = --------------------------- - 2 - * 2 * BaudRate * ClockDivider - * - * Speed selections with Pclk=7.3728Mhz, clock x16 - */ -struct speedtab sccspeedtab[] = { - { 0, 0, }, - { 50, 4606, }, - { 75, 3070, }, - { 110, 2093, }, - { 134.5, 1711, }, - { 150, 1534, }, - { 200, 1150, }, - { 300, 766, }, - { 600, 382, }, - { 1200, 190, }, - { 1800, 126, }, - { 2400, 94, }, - { 4800, 46, }, - { 7200, 30, }, /* non-POSIX */ - { 9600, 22, }, - { 14400, 14, }, /* non-POSIX */ - { 19200, 10, }, - { 28800, 6, }, /* non-POSIX */ - { 38400, 4, }, /* non-POSIX */ - { 57600, 2, }, /* non-POSIX */ - { -1, -1, }, -}; - -#ifndef PORTSELECTOR -#define ISPEED TTYDEF_SPEED -#define LFLAG TTYDEF_LFLAG -#else -#define ISPEED B4800 -#define LFLAG (TTYDEF_LFLAG & ~ECHO) -#endif - -/* Definition of the driver for autoconfig. */ -static int sccmatch __P((struct device *parent, struct cfdata *cf, - void *aux)); -static void sccattach __P((struct device *parent, struct device *self, - void *aux)); - -struct cfattach scc_ca = { - sizeof (struct scc_softc), sccmatch, sccattach, -}; - -extern struct cfdriver scc_cd; - -dev_type_open(sccopen); -dev_type_close(sccclose); -dev_type_read(sccread); -dev_type_write(sccwrite); -dev_type_ioctl(sccioctl); -dev_type_stop(sccstop); -dev_type_tty(scctty); -dev_type_poll(sccpoll); - -const struct cdevsw scc_cdevsw = { - sccopen, sccclose, sccread, sccwrite, sccioctl, - sccstop, scctty, sccpoll, nommap, D_TTY -}; - -int sccGetc __P((dev_t)); -void sccPutc __P((dev_t, int)); -void sccPollc __P((dev_t, int)); -int sccparam __P((struct tty *, struct termios *)); -void sccstart __P((struct tty *)); - -static int sccmctl __P((struct scc_softc *, int, int, int)); -static int cold_sccparam __P((struct tty *, struct termios *, - struct scc_softc *sc, int line)); - -#ifdef SCC_DEBUG -static void rr __P((char *, scc_regmap_t *)); -#endif -static void scc_modem_intr __P((dev_t)); -static void sccreset __P((struct scc_softc *)); - -int sccintr __P((void *)); -void scc_alphaintr __P((int)); - -/* - * console variables, for using serial console while still cold and - * autoconfig has not attached the scc device. - */ -scc_regmap_t *scc_cons_addr = 0; -static struct consdev scccons = { - NULL, NULL, sccGetc, sccPutc, sccPollc, NULL, NODEV, 0 -}; - -int alpha_donot_kludge_scc; - -/* - * Test to see if device is present. - * Return true if found. - */ -int -sccmatch(parent, cf, aux) - struct device *parent; - struct cfdata *cf; - void *aux; -{ - extern struct cfdriver ioasic_cd; /* XXX */ - struct ioasicdev_attach_args *d = aux; - void *sccaddr; - - if (parent->dv_cfdata->cf_driver != &ioasic_cd) { -#ifdef DIAGNOSTIC - printf("Cannot attach scc on %s\n", parent->dv_xname); -#endif - return (0); - } - - /* Make sure that we're looking for this type of device. */ - if ((strncmp(d->iada_modname, "z8530 ", TC_ROM_LLEN) != 0) && - (strncmp(d->iada_modname, "scc", TC_ROM_LLEN)!= 0)) - return (0); - - /* - * Check user-specified offset against the ioasic offset. - * Allow it to be wildcarded. - */ - if (cf->cf_loc[IOASICCF_OFFSET] != IOASICCF_OFFSET_DEFAULT && - cf->cf_loc[IOASICCF_OFFSET] != d->iada_offset) - return (0); - - /* Get the address, and check it for validity. */ - sccaddr = (void *)d->iada_addr; -#ifdef SPARSE - sccaddr = (void *)TC_DENSE_TO_SPARSE((tc_addr_t)sccaddr); -#endif - if (badaddr(sccaddr, 2)) - return (0); - - return (1); -} - -/* - * Enable ioasic SCC interrupts and scc DMA engine interrupts. - * XXX does not really belong here. - */ -void -scc_alphaintr(onoff) - int onoff; -{ - if (onoff) { - *(volatile u_int *)(ioasic_base + IOASIC_IMSK) |= - IOASIC_INTR_SCC_1 | IOASIC_INTR_SCC_0; -#if !defined(DEC_3000_300) && defined(SCC_DMA) - *(volatile u_int *)(ioasic_base + IOASIC_CSR) |= - IOASIC_CSR_DMAEN_T1 | IOASIC_CSR_DMAEN_R1 | - IOASIC_CSR_DMAEN_T2 | IOASIC_CSR_DMAEN_R2; -#endif - } else { - *(volatile u_int *)(ioasic_base + IOASIC_IMSK) &= - ~(IOASIC_INTR_SCC_1 | IOASIC_INTR_SCC_0); -#if !defined(DEC_3000_300) && defined(SCC_DMA) - *(volatile u_int *)(ioasic_base + IOASIC_CSR) &= - ~(IOASIC_CSR_DMAEN_T1 | IOASIC_CSR_DMAEN_R1 | - IOASIC_CSR_DMAEN_T2 | IOASIC_CSR_DMAEN_R2); -#endif - } - tc_mb(); -} - -void -sccattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct scc_softc *sc = (struct scc_softc *)self; - struct ioasicdev_attach_args *d = aux; - struct pdma *pdp; - struct tty *tp; - void *sccaddr; - int cntr; - struct termios cterm; - struct tty ctty; - int s; - int unit; - - unit = sc->sc_dv.dv_unit; - - /* Get the address, and check it for validity. */ - sccaddr = (void *)d->iada_addr; -#ifdef SPARSE - sccaddr = (void *)TC_DENSE_TO_SPARSE((tc_addr_t)sccaddr); -#endif - - /* Register the interrupt handler. */ - ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_TTY, - sccintr, (void *)sc); - - /* - * For a remote console, wait a while for previous output to - * complete. - */ - if ((cputype == ST_DEC_3000_500 && sc->sc_dv.dv_unit == 1) || - (cputype == ST_DEC_3000_300 && sc->sc_dv.dv_unit == 0)) - DELAY(10000); - pdp = &sc->scc_pdma[0]; - - /* init pseudo DMA structures */ - for (cntr = 0; cntr < 2; cntr++) { - pdp->p_addr = (void *)sccaddr; - tp = sc->scc_tty[cntr] = ttymalloc(); - if (cntr == 0) - tty_attach(tp); - pdp->p_arg = (long)tp; - pdp->p_fcn = (void (*)__P((struct tty*)))0; - tp->t_dev = (dev_t)((sc->sc_dv.dv_unit << 1) | cntr); - pdp++; - } - /* What's the warning here? Defaulting to softCAR on line 2? */ - sc->scc_softCAR = sc->sc_dv.dv_cfdata->cf_flags | 0x2; /* XXX */ - - /* reset chip, initialize register-copies in softc */ - sccreset(sc); - - /* - * Special handling for consoles. - */ - if (1 /* SCCUNIT(cn_tab.cn_dev) == sc->sc_dv.dv_unit */) { - s = spltty(); - cterm.c_cflag = (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8; - cterm.c_ospeed = cterm.c_ispeed = 9600; - (void) cold_sccparam(&ctty, &cterm, sc, - SCCLINE((sc->sc_dv.dv_unit == 0) ? - SCCCOMM2_PORT : SCCCOMM3_PORT)); - DELAY(1000); - splx(s); - } - - /* - * XXX - * Unit 1 is the remote console, wire it up now. - */ - if ((cputype == ST_DEC_3000_500 && sc->sc_dv.dv_unit == 1) || - (cputype == ST_DEC_3000_300 && sc->sc_dv.dv_unit == 0)) { - if (alpha_donot_kludge_scc) - printf("\nSWITCHING TO SERIAL CONSOLE!\n"); - cn_tab = &scccons; - cn_tab->cn_dev = makedev(cdevsw_lookup_major(&scc_cdevsw), - sc->sc_dv.dv_unit * 2); - - printf("%s console\n", alpha_donot_kludge_scc ? "\n***" : ":"); - - /* wire carrier for console. */ - sc->scc_softCAR |= SCCLINE(cn_tab->cn_dev); - } else - printf("\n"); -} - -/* - * Reset the chip. - */ -static void -sccreset(sc) - register struct scc_softc *sc; -{ - register scc_regmap_t *regs; - register u_char val; - - regs = (scc_regmap_t *)sc->scc_pdma[0].p_addr; - /* - * Chip once-only initialization - * - * NOTE: The wiring we assume is the one on the 3min: - * - * out A-TxD --> TxD keybd or mouse - * in A-RxD --> RxD keybd or mouse - * out A-DTR~ --> DTR comm - * out A-RTS~ --> RTS comm - * in A-CTS~ --> SI comm - * in A-DCD~ --> RI comm - * in A-SYNCH~--> DSR comm - * out B-TxD --> TxD comm - * in B-RxD --> RxD comm - * in B-RxC --> TRxCB comm - * in B-TxC --> RTxCB comm - * out B-RTS~ --> SS comm - * in B-CTS~ --> CTS comm - * in B-DCD~ --> CD comm - */ - SCC_INIT_REG(regs, SCC_CHANNEL_A); - SCC_INIT_REG(regs, SCC_CHANNEL_B); - - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_WR9, ZSWR9_HARD_RESET); - DELAY(50000); /*enough ? */ - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_WR9, 0); - - /* program the interrupt vector */ - SCC_WRITE_REG(regs, SCC_CHANNEL_A, ZSWR_IVEC, 0xf0); - SCC_WRITE_REG(regs, SCC_CHANNEL_B, ZSWR_IVEC, 0xf0); - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_WR9, ZSWR9_VECTOR_INCL_STAT); - - /* receive parameters and control */ - sc->scc_wreg[SCC_CHANNEL_A].wr3 = 0; - sc->scc_wreg[SCC_CHANNEL_B].wr3 = 0; - - /* timing base defaults */ - sc->scc_wreg[SCC_CHANNEL_A].wr4 = ZSWR4_CLK_X16; - sc->scc_wreg[SCC_CHANNEL_B].wr4 = ZSWR4_CLK_X16; - - /* enable DTR, RTS and SS */ - sc->scc_wreg[SCC_CHANNEL_B].wr5 = 0; - sc->scc_wreg[SCC_CHANNEL_A].wr5 = ZSWR5_RTS | ZSWR5_DTR; - - /* baud rates */ - val = ZSWR14_BAUD_ENA | ZSWR14_BAUD_FROM_PCLK; - sc->scc_wreg[SCC_CHANNEL_B].wr14 = val; - sc->scc_wreg[SCC_CHANNEL_A].wr14 = val; - - /* interrupt conditions */ - val = ZSWR1_RIE | ZSWR1_PE_SC | ZSWR1_SIE | ZSWR1_TIE; - sc->scc_wreg[SCC_CHANNEL_A].wr1 = val; - sc->scc_wreg[SCC_CHANNEL_B].wr1 = val; -} - -int -sccopen(dev, flag, mode, p) - dev_t dev; - int flag, mode; - struct proc *p; -{ - register struct scc_softc *sc; - register struct tty *tp; - register int unit, line; - int s, error = 0; - int firstopen = 0; - - unit = SCCUNIT(dev); - if (unit >= scc_cd.cd_ndevs) - return (ENXIO); - sc = scc_cd.cd_devs[unit]; - if (!sc) - return (ENXIO); - - line = SCCLINE(dev); - if (sc->scc_pdma[line].p_addr == NULL) - return (ENXIO); - tp = sc->scc_tty[line]; - if (tp == NULL) { - tp = sc->scc_tty[line] = ttymalloc(); - tty_attach(tp); - } - tp->t_oproc = sccstart; - tp->t_param = sccparam; - tp->t_dev = dev; - if ((tp->t_state & TS_ISOPEN) == 0 && tp->t_wopen == 0) { - ttychars(tp); - firstopen = 1; -#ifndef PORTSELECTOR - if (tp->t_ispeed == 0) { -#endif - tp->t_iflag = TTYDEF_IFLAG; - tp->t_oflag = TTYDEF_OFLAG; - tp->t_cflag = TTYDEF_CFLAG; - tp->t_lflag = LFLAG; - tp->t_ispeed = tp->t_ospeed = ISPEED; -#ifdef PORTSELECTOR - tp->t_cflag |= HUPCL; -#else - } -#endif - (void) sccparam(tp, &tp->t_termios); - ttsetwater(tp); - } else if ((tp->t_state & TS_XCLUDE) && curproc->p_ucred->cr_uid != 0) - return (EBUSY); - (void) sccmctl(sc, SCCLINE(dev), DML_DTR, DMSET); - s = spltty(); - while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) && - !(tp->t_state & TS_CARR_ON)) { - tp->t_wopen++; - error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH, - ttopen, 0); - tp->t_wopen--; - if (error != 0) - break; - } - splx(s); - if (error) - return (error); - error = (*tp->t_linesw->l_open)(dev, tp); - - return (error); -} - -/*ARGSUSED*/ -int -sccclose(dev, flag, mode, p) - dev_t dev; - int flag, mode; - struct proc *p; -{ - register struct scc_softc *sc = scc_cd.cd_devs[SCCUNIT(dev)]; - register struct tty *tp; - register int line; - - line = SCCLINE(dev); - tp = sc->scc_tty[line]; - if (sc->scc_wreg[line].wr5 & ZSWR5_BREAK) { - sc->scc_wreg[line].wr5 &= ~ZSWR5_BREAK; - ttyoutput(0, tp); - } - (*tp->t_linesw->l_close)(tp, flag); - if ((tp->t_cflag & HUPCL) || tp->t_wopen || - !(tp->t_state & TS_ISOPEN)) - (void) sccmctl(sc, line, 0, DMSET); - return (ttyclose(tp)); -} - -int -sccread(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; -{ - register struct scc_softc *sc; - register struct tty *tp; - - sc = scc_cd.cd_devs[SCCUNIT(dev)]; /* XXX*/ - tp = sc->scc_tty[SCCLINE(dev)]; - return ((*tp->t_linesw->l_read)(tp, uio, flag)); -} - -int -sccwrite(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; -{ - register struct scc_softc *sc; - register struct tty *tp; - - sc = scc_cd.cd_devs[SCCUNIT(dev)]; /* XXX*/ - tp = sc->scc_tty[SCCLINE(dev)]; - return ((*tp->t_linesw->l_write)(tp, uio, flag)); -} - -int -sccpoll(dev, events, p) - dev_t dev; - int events; - struct proc *p; -{ - register struct scc_softc *sc; - register struct tty *tp; - - sc = scc_cd.cd_devs[SCCUNIT(dev)]; /* XXX*/ - tp = sc->scc_tty[SCCLINE(dev)]; - return ((*tp->t_linesw->l_poll)(tp, events, p)); -} - -struct tty * -scctty(dev) - dev_t dev; -{ - register struct scc_softc *sc; - register struct tty *tp; - register int unit = SCCUNIT(dev); - - if ((unit >= scc_cd.cd_ndevs) || (sc = scc_cd.cd_devs[unit]) == 0) - return (0); - tp = sc->scc_tty[SCCLINE(dev)]; - return (tp); -} - -/*ARGSUSED*/ -int -sccioctl(dev, cmd, data, flag, p) - dev_t dev; - u_long cmd; - caddr_t data; - int flag; - struct proc *p; -{ - register struct scc_softc *sc; - register struct tty *tp; - int error, line; - - line = SCCLINE(dev); - sc = scc_cd.cd_devs[SCCUNIT(dev)]; - tp = sc->scc_tty[line]; - error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, p); - if (error != EPASSTHROUGH) - return (error); - error = ttioctl(tp, cmd, data, flag, p); - if (error != EPASSTHROUGH) - return (error); - - switch (cmd) { - - case TIOCSBRK: - sc->scc_wreg[line].wr5 |= ZSWR5_BREAK; - ttyoutput(0, tp); - break; - - case TIOCCBRK: - sc->scc_wreg[line].wr5 &= ~ZSWR5_BREAK; - ttyoutput(0, tp); - break; - - case TIOCSDTR: - (void) sccmctl(sc, line, DML_DTR|DML_RTS, DMBIS); - break; - - case TIOCCDTR: - (void) sccmctl(sc, line, DML_DTR|DML_RTS, DMBIC); - break; - - case TIOCMSET: - (void) sccmctl(sc, line, *(int *)data, DMSET); - break; - - case TIOCMBIS: - (void) sccmctl(sc, line, *(int *)data, DMBIS); - break; - - case TIOCMBIC: - (void) sccmctl(sc, line, *(int *)data, DMBIC); - break; - - case TIOCMGET: - *(int *)data = sccmctl(sc, line, 0, DMGET); - break; - - default: - return (EPASSTHROUGH); - } - return (0); -} - - - -/* - * Set line parameters -- tty t_param entry point. - */ -int -sccparam(tp, t) - register struct tty *tp; - register struct termios *t; -{ - register struct scc_softc *sc; - - /* Extract the softc and call cold_sccparam to do all the work. */ - sc = scc_cd.cd_devs[SCCUNIT(tp->t_dev)]; - return cold_sccparam(tp, t, sc, SCCLINE(tp->t_dev)); -} - - -/* - * Do what sccparam() (t_param entry point) does, but callable when cold. - */ -static int -cold_sccparam(tp, t, sc, line) - register struct tty *tp; - register struct termios *t; - register struct scc_softc *sc; - register int line; -{ - register scc_regmap_t *regs; - register u_char value, wvalue; - register int cflag = t->c_cflag; - int ospeed; - - /* Check arguments */ - if (t->c_ispeed && t->c_ispeed != t->c_ospeed) - return (EINVAL); - ospeed = ttspeedtab(t->c_ospeed, sccspeedtab); - if (ospeed < 0) - return (EINVAL); - /* and copy to tty */ - tp->t_ispeed = t->c_ispeed; - tp->t_ospeed = t->c_ospeed; - tp->t_cflag = cflag; - - /* - * Handle console specially. - */ - { - cflag = CS8; - ospeed = ttspeedtab(9600, sccspeedtab); - } - if (ospeed == 0) { - (void) sccmctl(sc, line, 0, DMSET); /* hang up line */ - return (0); - } - - regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr; - - /* - * pmax driver used to reset the SCC here. That reset causes the - * other channel on the SCC to drop outpur chars: at least that's - * what CGD reports for the Alpha. It's a bug. - */ -#if 0 - /* reset line */ - if (line == SCC_CHANNEL_A) - value = ZSWR9_A_RESET; - else - value = ZSWR9_B_RESET; - SCC_WRITE_REG(regs, line, SCC_WR9, value); - DELAY(25); -#endif - - /* stop bits, normally 1 */ - value = sc->scc_wreg[line].wr4 & 0xf0; - if (cflag & CSTOPB) - value |= ZSWR4_TWOSB; - else - value |= ZSWR4_ONESB; - if ((cflag & PARODD) == 0) - value |= ZSWR4_EVENP; - if (cflag & PARENB) - value |= ZSWR4_PARENB; - - /* set it now, remember it must be first after reset */ - sc->scc_wreg[line].wr4 = value; - SCC_WRITE_REG(regs, line, SCC_WR4, value); - - /* vector again */ - SCC_WRITE_REG(regs, line, ZSWR_IVEC, 0xf0); - - /* clear break, keep rts dtr */ - wvalue = sc->scc_wreg[line].wr5 & (ZSWR5_DTR|ZSWR5_RTS); - switch (cflag & CSIZE) { - case CS5: - value = ZSWR3_RX_5; - wvalue |= ZSWR5_TX_5; - break; - case CS6: - value = ZSWR3_RX_6; - wvalue |= ZSWR5_TX_6; - break; - case CS7: - value = ZSWR3_RX_7; - wvalue |= ZSWR5_TX_7; - break; - case CS8: - default: - value = ZSWR3_RX_8; - wvalue |= ZSWR5_TX_8; - }; - sc->scc_wreg[line].wr3 = value; - SCC_WRITE_REG(regs, line, SCC_WR3, value); - - sc->scc_wreg[line].wr5 = wvalue; - SCC_WRITE_REG(regs, line, SCC_WR5, wvalue); - - /* - * XXX Does the SCC chip require us to refresh the WR5 register - * for the other channel after writing the other, or not? - */ -#ifdef notdef - /* XXX */ - { - int otherline = (line + 1) & 1; - SCC_WRITE_REG(regs, otherline, SCC_WR5, sc->scc_wreg[otherline].wr5); - } -#endif - - SCC_WRITE_REG(regs, line, ZSWR_SYNCLO, 0); - SCC_WRITE_REG(regs, line, ZSWR_SYNCHI, 0); - SCC_WRITE_REG(regs, line, SCC_WR9, ZSWR9_VECTOR_INCL_STAT); - SCC_WRITE_REG(regs, line, SCC_WR10, 0); - value = ZSWR11_RXCLK_BAUD | ZSWR11_TXCLK_BAUD | - ZSWR11_TRXC_OUT_ENA | ZSWR11_TRXC_BAUD; - SCC_WRITE_REG(regs, line, SCC_WR11, value); - SCC_SET_TIMING_BASE(regs, line, ospeed); - value = sc->scc_wreg[line].wr14; - SCC_WRITE_REG(regs, line, SCC_WR14, value); - - if (sc->sc_dv.dv_unit == 1) { - /* On unit one, on the flamingo, modem control is floating! */ - value = ZSWR15_BREAK_IE; - } else - { - value = ZSWR15_BREAK_IE | ZSWR15_CTS_IE | ZSWR15_DCD_IE; - } - SCC_WRITE_REG(regs, line, SCC_WR15, value); - - /* and now the enables */ - value = sc->scc_wreg[line].wr3 | ZSWR3_RX_ENABLE; - SCC_WRITE_REG(regs, line, SCC_WR3, value); - value = sc->scc_wreg[line].wr5 | ZSWR5_TX_ENABLE; - sc->scc_wreg[line].wr5 = value; - SCC_WRITE_REG(regs, line, SCC_WR5, value); - - /* master inter enable */ - value = ZSWR9_MASTER_IE | ZSWR9_VECTOR_INCL_STAT; - SCC_WRITE_REG(regs, line, SCC_WR9, value); - SCC_WRITE_REG(regs, line, SCC_WR1, sc->scc_wreg[line].wr1); - tc_mb(); - - scc_alphaintr(1); /* XXX XXX XXX */ - - return (0); -} - - -/* - * Check for interrupts from all devices. - */ -int -sccintr(xxxsc) - void *xxxsc; -{ - register struct scc_softc *sc = (struct scc_softc *)xxxsc; - register int unit = (long)sc->sc_dv.dv_unit; - register scc_regmap_t *regs; - register struct tty *tp; - register struct pdma *dp; - register int cc, chan, rr1, rr2, rr3; - int overrun = 0; - - rr1 = 0; /* shut up gcc -Wall */ - regs = (scc_regmap_t *)sc->scc_pdma[0].p_addr; - unit <<= 1; - for (;;) { - SCC_READ_REG(regs, SCC_CHANNEL_B, ZSRR_IVEC, rr2); - rr2 = SCC_RR2_STATUS(rr2); - /* are we done yet ? */ - if (rr2 == 6) { /* strange, distinguished value */ - SCC_READ_REG(regs, SCC_CHANNEL_A, ZSRR_IPEND, rr3); - if (rr3 == 0) - return 1; - } - - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_RR0, ZSWR0_CLR_INTR); - if ((rr2 == SCC_RR2_A_XMIT_DONE) || (rr2 == SCC_RR2_B_XMIT_DONE)) { - chan = (rr2 == SCC_RR2_A_XMIT_DONE) ? - SCC_CHANNEL_A : SCC_CHANNEL_B; - tp = sc->scc_tty[chan]; - dp = &sc->scc_pdma[chan]; - if (dp->p_mem < dp->p_end) { - SCC_WRITE_DATA(regs, chan, *dp->p_mem++); - tc_mb(); - } else { - tp->t_state &= ~TS_BUSY; - if (tp->t_state & TS_FLUSH) - tp->t_state &= ~TS_FLUSH; - else { - ndflush(&tp->t_outq, dp->p_mem - - (caddr_t) tp->t_outq.c_cf); - dp->p_end = dp->p_mem = tp->t_outq.c_cf; - } - (*tp->t_linesw->l_start)(tp); - if (tp->t_outq.c_cc == 0 || !(tp->t_state & TS_BUSY)) { - SCC_READ_REG(regs, chan, SCC_RR15, cc); - cc &= ~ZSWR15_TXUEOM_IE; - SCC_WRITE_REG(regs, chan, SCC_WR15, cc); - cc = sc->scc_wreg[chan].wr1 & ~ZSWR1_TIE; - SCC_WRITE_REG(regs, chan, SCC_WR1, cc); - sc->scc_wreg[chan].wr1 = cc; - tc_mb(); - } - } - } else if (rr2 == SCC_RR2_A_RECV_DONE || - rr2 == SCC_RR2_B_RECV_DONE || rr2 == SCC_RR2_A_RECV_SPECIAL || - rr2 == SCC_RR2_B_RECV_SPECIAL) { - if (rr2 == SCC_RR2_A_RECV_DONE || rr2 == SCC_RR2_A_RECV_SPECIAL) - chan = SCC_CHANNEL_A; - else - chan = SCC_CHANNEL_B; - tp = sc->scc_tty[chan]; - SCC_READ_DATA(regs, chan, cc); - if (rr2 == SCC_RR2_A_RECV_SPECIAL || - rr2 == SCC_RR2_B_RECV_SPECIAL) { - SCC_READ_REG(regs, chan, SCC_RR1, rr1); - SCC_WRITE_REG(regs, chan, SCC_RR0, ZSWR0_RESET_ERRORS); - if ((rr1 & ZSRR1_DO) && overrun == 0) { - log(LOG_WARNING, "scc%d,%d: silo overflow\n", - unit >> 1, chan); - overrun = 1; - } - } - - if (!(tp->t_state & TS_ISOPEN)) { - wakeup((caddr_t)&tp->t_rawq); -#ifdef PORTSELECTOR - if (tp->t_wopen == 0) -#endif - continue; - } - if (rr2 == SCC_RR2_A_RECV_SPECIAL || - rr2 == SCC_RR2_B_RECV_SPECIAL) { - if (rr1 & ZSRR1_PE) - cc |= TTY_PE; - if (rr1 & ZSRR1_FE) - cc |= TTY_FE; - } - (*tp->t_linesw->l_rint)(cc, tp); - } else if ((rr2 == SCC_RR2_A_EXT_STATUS) || (rr2 == SCC_RR2_B_EXT_STATUS)) { - chan = (rr2 == SCC_RR2_A_EXT_STATUS) ? - SCC_CHANNEL_A : SCC_CHANNEL_B; - SCC_WRITE_REG(regs, chan, SCC_RR0, ZSWR0_RESET_STATUS); - scc_modem_intr(unit | chan); - } - } -} - -void -sccstart(tp) - register struct tty *tp; -{ - register struct pdma *dp; - register scc_regmap_t *regs; - register struct scc_softc *sc; - register int cc, chan; - u_char temp; - int s, sendone; - - sc = scc_cd.cd_devs[SCCUNIT(tp->t_dev)]; - dp = &sc->scc_pdma[SCCLINE(tp->t_dev)]; - regs = (scc_regmap_t *)dp->p_addr; - s = spltty(); - if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) - goto out; - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup((caddr_t)&tp->t_outq); - } - selwakeup(&tp->t_wsel); - } - if (tp->t_outq.c_cc == 0) - goto out; - /* handle console specially */ - if (tp == scctty(makedev(cdevsw_lookup_major(&scc_cdevsw), - SCCKBD_PORT)) && - raster_console()) { - while (tp->t_outq.c_cc > 0) { - cc = getc(&tp->t_outq) & 0x7f; - cnputc(cc); - } - /* - * After we flush the output queue we may need to wake - * up the process that made the output. - */ - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup((caddr_t)&tp->t_outq); - } - selwakeup(&tp->t_wsel); - } - goto out; - } - cc = ndqb(&tp->t_outq, 0); - - tp->t_state |= TS_BUSY; - dp->p_end = dp->p_mem = tp->t_outq.c_cf; - dp->p_end += cc; - - /* - * Enable transmission and send the first char, as required. - */ - chan = SCCLINE(tp->t_dev); - SCC_READ_REG(regs, chan, SCC_RR0, temp); - sendone = (temp & ZSRR0_TX_READY); - SCC_READ_REG(regs, chan, SCC_RR15, temp); - temp |= ZSWR15_TXUEOM_IE; - SCC_WRITE_REG(regs, chan, SCC_WR15, temp); - temp = sc->scc_wreg[chan].wr1 | ZSWR1_TIE; - SCC_WRITE_REG(regs, chan, SCC_WR1, temp); - sc->scc_wreg[chan].wr1 = temp; - if (sendone) { -#ifdef DIAGNOSTIC - if (cc == 0) - panic("sccstart: No chars"); -#endif - SCC_WRITE_DATA(regs, chan, *dp->p_mem++); - } - tc_mb(); -out: - splx(s); -} - -/* - * Stop output on a line. - */ -/*ARGSUSED*/ -void -sccstop(tp, flag) - register struct tty *tp; - int flag; -{ - register struct pdma *dp; - register struct scc_softc *sc; - register int s; - - sc = scc_cd.cd_devs[SCCUNIT(tp->t_dev)]; - dp = &sc->scc_pdma[SCCLINE(tp->t_dev)]; - s = spltty(); - if (tp->t_state & TS_BUSY) { - dp->p_end = dp->p_mem; - if (!(tp->t_state & TS_TTSTOP)) - tp->t_state |= TS_FLUSH; - } - splx(s); -} - -int -sccmctl(sc, line, bits, how) - struct scc_softc *sc; - int line, bits, how; -{ - register scc_regmap_t *regs; - register int mbits; - register u_char value; - int s; - - regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr; - s = spltty(); - /* - * only channel B has modem control, however the DTR and RTS - * pins on the comm port are wired to the DTR and RTS A channel - * signals. - */ - mbits = DML_DTR | DML_DSR | DML_CAR; - if (line == SCC_CHANNEL_B) { - if (sc->scc_wreg[SCC_CHANNEL_A].wr5 & ZSWR5_DTR) - mbits = DML_DTR | DML_DSR; - else - mbits = 0; - SCC_READ_REG_ZERO(regs, SCC_CHANNEL_B, value); - if (value & ZSRR0_DCD) - mbits |= DML_CAR; - } - switch (how) { - case DMSET: - mbits = bits; - break; - - case DMBIS: - mbits |= bits; - break; - - case DMBIC: - mbits &= ~bits; - break; - - case DMGET: - (void) splx(s); - return (mbits); - } - if (line == SCC_CHANNEL_B) { - if (mbits & DML_DTR) - sc->scc_wreg[SCC_CHANNEL_A].wr5 |= ZSWR5_DTR; - else - sc->scc_wreg[SCC_CHANNEL_A].wr5 &= ~ZSWR5_DTR; - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_WR5, - sc->scc_wreg[SCC_CHANNEL_A].wr5); - } - if ((mbits & DML_DTR) || (sc->scc_softCAR & (1 << line))) - sc->scc_tty[line]->t_state |= TS_CARR_ON; - (void) splx(s); - return (mbits); -} - -/* - * Check for carrier transition. - */ -static void -scc_modem_intr(dev) - dev_t dev; -{ - register scc_regmap_t *regs; - register struct scc_softc *sc; - register struct tty *tp; - register int car, chan; - register u_char value; - int s; - - chan = SCCLINE(dev); - sc = scc_cd.cd_devs[SCCUNIT(dev)]; - tp = sc->scc_tty[chan]; - regs = (scc_regmap_t *)sc->scc_pdma[chan].p_addr; - if (chan == SCC_CHANNEL_A) - return; - s = spltty(); - if (sc->scc_softCAR & (1 << chan)) - car = 1; - else { - SCC_READ_REG_ZERO(regs, chan, value); - car = value & ZSRR0_DCD; - } - - /* Break on serial console drops into the debugger */ - if ((value & ZSRR0_BREAK) && CONSOLE_ON_UNIT(sc->sc_dv.dv_unit)) { -#ifdef DDB - splx(s); /* spl0()? */ - Debugger(); - return; -#else - /* XXX maybe fall back to PROM? */ -#endif - } - - splx(s); -} - -/* - * Get a char off the appropriate line via. a busy wait loop. - */ -int -sccGetc(dev) - dev_t dev; -{ - register scc_regmap_t *regs; - register int c, line; - register u_char value; - int s; - - line = SCCLINE(dev); - if (cold && scc_cons_addr) { - regs = scc_cons_addr; - } else { - register struct scc_softc *sc; - sc = scc_cd.cd_devs[SCCUNIT(dev)]; - regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr; - } - - if (!regs) - return (0); - s = splhigh(); - for (;;) { - SCC_READ_REG(regs, line, SCC_RR0, value); - if (value & ZSRR0_RX_READY) { - SCC_READ_REG(regs, line, SCC_RR1, value); - SCC_READ_DATA(regs, line, c); - if (value & (ZSRR1_PE | ZSRR1_DO | ZSRR1_FE)) { - SCC_WRITE_REG(regs, line, SCC_WR0, - ZSWR0_RESET_ERRORS); - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_WR0, - ZSWR0_CLR_INTR); - } else { - SCC_WRITE_REG(regs, SCC_CHANNEL_A, SCC_WR0, - ZSWR0_CLR_INTR); - splx(s); - return (c & 0xff); - } - } else - DELAY(10); - } -} - -/* - * Send a char on a port, via a busy wait loop. - */ -void -sccPutc(dev, c) - dev_t dev; - int c; -{ - register scc_regmap_t *regs; - register int line; - register u_char value; - int s; - - s = splhigh(); - line = SCCLINE(dev); - if (cold && scc_cons_addr) { - regs = scc_cons_addr; - } else { - register struct scc_softc *sc; - sc = scc_cd.cd_devs[SCCUNIT(dev)]; - regs = (scc_regmap_t *)sc->scc_pdma[line].p_addr; - } - - /* - * Wait for transmitter to be not busy. - */ - do { - SCC_READ_REG(regs, line, SCC_RR0, value); - if (value & ZSRR0_TX_READY) - break; - DELAY(100); - } while (1); - - /* - * Send the char. - */ - SCC_WRITE_DATA(regs, line, c); - tc_mb(); - splx(s); - - return; -} - -/* - * Enable/disable polling mode - */ -void -sccPollc(dev, on) - dev_t dev; - int on; -{ -} - -#ifdef SCC_DEBUG -static void -rr(msg, regs) - char *msg; - scc_regmap_t *regs; -{ - u_char value; - int r0, r1, r2, r3, r10, r15; - - printf("%s: register: %lx\n", msg, regs); -#define L(reg, r) { \ - SCC_READ_REG(regs, SCC_CHANNEL_A, reg, value); \ - r = value; \ -} - L(SCC_RR0, r0); - L(SCC_RR1, r1); - L(ZSRR_IVEC, r2); - L(ZSRR_IPEND, r3); - L(SCC_RR10, r10); - L(SCC_RR15, r15); - printf("A: 0: %x 1: %x 2(vec): %x 3: %x 10: %x 15: %x\n", - r0, r1, r2, r3, r10, r15); -#undef L -#define L(reg, r) { \ - SCC_READ_REG(regs, SCC_CHANNEL_B, reg, value); \ - r = value; \ -} - L(SCC_RR0, r0); - L(SCC_RR1, r1); - L(ZSRR_IVEC, r2); - L(SCC_RR10, r10); - L(SCC_RR15, r15); - printf("B: 0: %x 1: %x 2(state): %x 10: %x 15: %x\n", - r0, r1, r2, r10, r15); -} -#endif /* SCC_DEBUG */ diff --git a/sys/arch/alpha/tc/sccreg.h b/sys/arch/alpha/tc/sccreg.h deleted file mode 100644 index 43e2ccbfd381..000000000000 --- a/sys/arch/alpha/tc/sccreg.h +++ /dev/null @@ -1,176 +0,0 @@ -/* $NetBSD: sccreg.h,v 1.3 1997/04/06 22:30:30 cgd Exp $ */ - -/* - * Copyright (c) 1991,1990,1989,1994,1995 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ - -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)sccreg.h 8.1 (Berkeley) 6/10/93 - */ - -/* - * Definitions for Intel 82530 serial communications chip. Each chip is a - * dual uart with the A channels used for the keyboard and mouse with the B - * channel(s) for comm ports with modem control. Since some registers are - * used for the other channel, the following macros are used to access the - * register ports. - * - * Actual access to the registers is provided by sccvar.h, as it's - * machine-dependent. - */ - -/* Scc channel numbers; B channel comes first. */ -#define SCC_CHANNEL_B 0 -#define SCC_CHANNEL_A 1 - -#define SCC_INIT_REG(scc, chan) { \ - char tmp; \ - scc_get_datum((scc)->scc_channel[(chan)].scc_command, tmp); \ - scc_get_datum((scc)->scc_channel[(chan)].scc_command, tmp); \ -} - -#define SCC_READ_REG(scc, chan, reg, val) { \ - scc_set_datum((scc)->scc_channel[(chan)].scc_command, reg); \ - scc_get_datum((scc)->scc_channel[(chan)].scc_command, val); \ -} - -#define SCC_READ_REG_ZERO(scc, chan, val) { \ - scc_get_datum((scc)->scc_channel[(chan)].scc_command, val); \ -} - -#define SCC_WRITE_REG(scc, chan, reg, val) { \ - scc_set_datum((scc)->scc_channel[(chan)].scc_command, reg); \ - scc_set_datum((scc)->scc_channel[(chan)].scc_command, val); \ -} - -#define SCC_WRITE_REG_ZERO(scc, chan, val) { \ - scc_set_datum((scc)->scc_channel[(chan)].scc_command, val); \ -} - -#define SCC_READ_DATA(scc, chan, val) { \ - scc_get_datum((scc)->scc_channel[(chan)].scc_data, val); \ -} - -#define SCC_WRITE_DATA(scc, chan, val) { \ - scc_set_datum((scc)->scc_channel[(chan)].scc_data, val); \ -} - -/* Addressable registers. */ -#define SCC_RR0 0 /* status register */ -#define SCC_RR1 1 /* special receive conditions */ -#define SCC_RR8 8 /* recv buffer (alias for data) */ -#define SCC_RR10 10 /* sdlc status */ -#define SCC_RR15 15 /* interrupts currently enabled */ - -#define SCC_WR0 0 /* reg select, and commands */ -#define SCC_WR1 1 /* interrupt and DMA enables */ -#define SCC_WR3 3 /* receiver params and enables */ -#define SCC_WR4 4 /* clock/char/parity params */ -#define SCC_WR5 5 /* xmit params and enables */ -#define SCC_WR8 8 /* xmit buffer (alias for data) */ -#define SCC_WR9 9 /* vectoring and resets */ -#define SCC_WR10 10 /* synchr params */ -#define SCC_WR11 11 /* clocking definitions */ -#define SCC_WR14 14 /* BRG enables and commands */ -#define SCC_WR15 15 /* interrupt enables */ - -/* Read register's defines. */ - -/* - * RR2 contains the interrupt vector unmodified (channel A) or - * modified as follows (channel B, if vector-include-status). - */ -#define SCC_RR2_STATUS(val) ((val)&0xf) - -#define SCC_RR2_B_XMIT_DONE 0x0 -#define SCC_RR2_B_EXT_STATUS 0x2 -#define SCC_RR2_B_RECV_DONE 0x4 -#define SCC_RR2_B_RECV_SPECIAL 0x6 -#define SCC_RR2_A_XMIT_DONE 0x8 -#define SCC_RR2_A_EXT_STATUS 0xa -#define SCC_RR2_A_RECV_DONE 0xc -#define SCC_RR2_A_RECV_SPECIAL 0xe - -/* RR12/RR13 hold the timing base, upper byte in RR13. */ -#define SCC_GET_TIMING_BASE(scc, chan, val) { \ - register char tmp; \ - SCC_READ_REG(scc, chan, ZSRR_BAUDLO, val); \ - SCC_READ_REG(scc, chan, ZSRR_BAUDHI, tmp); \ - (val) = ((val) << 8) | (tmp & 0xff); \ - } - -/* - * Write register's defines. - */ - -/* WR12/WR13 are for timing base preset */ -#define SCC_SET_TIMING_BASE(scc, chan, val) { \ - SCC_WRITE_REG(scc, chan, ZSWR_BAUDLO, val); \ - SCC_WRITE_REG(scc, chan, ZSWR_BAUDHI, (val) >> 8); \ - } - -/* Bits in dm lsr, copied from dmreg.h. */ -#define DML_DSR 0000400 /* data set ready, not a real DM bit */ -#define DML_RNG 0000200 /* ring */ -#define DML_CAR 0000100 /* carrier detect */ -#define DML_CTS 0000040 /* clear to send */ -#define DML_SR 0000020 /* secondary receive */ -#define DML_ST 0000010 /* secondary transmit */ -#define DML_RTS 0000004 /* request to send */ -#define DML_DTR 0000002 /* data terminal ready */ -#define DML_LE 0000001 /* line enable */ diff --git a/sys/arch/alpha/tc/sccvar.h b/sys/arch/alpha/tc/sccvar.h deleted file mode 100644 index 130be66b4571..000000000000 --- a/sys/arch/alpha/tc/sccvar.h +++ /dev/null @@ -1,121 +0,0 @@ -/* $NetBSD: sccvar.h,v 1.8 2002/05/13 01:33:13 matt Exp $ */ - -/* - * Copyright (c) 1991,1990,1989,1994,1995 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ - -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)sccreg.h 8.1 (Berkeley) 6/10/93 - */ - -/* - * Definitions for Intel 82530 serial communications chip. Each chip is a - * dual uart with the A channels used for the keyboard and mouse with the B - * channel(s) for comm ports with modem control. Since some registers are - * used for the other channel, the following macros are used to access the - * register ports. - */ - -#if 1 -#define alpha_sparse -#endif - -#define DENSE -#ifdef alpha_sparse -#undef DENSE -#define SPARSE -#endif - -typedef struct { - struct { - volatile u_int scc_command; /* Register select. */ -#ifdef SPARSE - u_int scc_pad0; -#endif - volatile u_int scc_data; /* Rx/Tx buffer */ -#ifdef SPARSE - u_int scc_pad1; -#endif - } scc_channel[2]; -} scc_regmap_t; - -#define scc_get_datum(d, v) \ - do { (v) = ((d) >> 8) & 0xff; alpha_mb(); DELAY(5); } while (0) -#define scc_set_datum(d, v) \ - do { (d) = (volatile unsigned int)(v) << 8; alpha_mb(); DELAY(5); } while (0) - -/* From . */ -struct pdma { - void *p_addr; - char *p_mem; - char *p_end; - int p_arg; - void (*p_fcn) __P((struct tty *tp)); -}; - -/* - * Minor device numbers for scc. Weird because B channel comes first and - * the A channels are wired for keyboard/mouse and the B channels for the - * comm port(s). - */ -#define SCCCOMM2_PORT 0x0 -#define SCCMOUSE_PORT 0x1 -#define SCCCOMM3_PORT 0x2 -#define SCCKBD_PORT 0x3 - -extern int alpha_donot_kludge_scc;