summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distrib/sets/lists/base/md.vax6
-rw-r--r--distrib/sets/lists/comp/md.vax4
-rw-r--r--distrib/vax/install.md6
-rw-r--r--etc/Makefile10
-rw-r--r--etc/etc.vax/MAKEDEV.md66
-rw-r--r--etc/etc.vax/pcs750.bin.uu254
-rw-r--r--share/man/man4/man4.vax/Makefile10
-rw-r--r--share/man/man4/man4.vax/autoconf.4196
-rw-r--r--share/man/man4/man4.vax/cons.486
-rw-r--r--share/man/man4/man4.vax/hp.4165
-rw-r--r--share/man/man4/man4.vax/intro.48
-rw-r--r--share/man/man4/man4.vax/mem.417
-rw-r--r--share/man/man4/man4.vax/ts.495
-rw-r--r--share/man/man4/man4.vax/uba.46
-rw-r--r--sys/arch/vax/bi/bi.c147
-rw-r--r--sys/arch/vax/bi/bireg.h269
-rw-r--r--sys/arch/vax/bi/bivar.h81
-rw-r--r--sys/arch/vax/bi/if_ni.c864
-rw-r--r--sys/arch/vax/bi/if_nireg.h303
-rw-r--r--sys/arch/vax/bi/kdb.c341
-rw-r--r--sys/arch/vax/bi/kdbreg.h67
-rw-r--r--sys/arch/vax/boot/boot/Makefile4
-rw-r--r--sys/arch/vax/boot/boot/boot.c109
-rw-r--r--sys/arch/vax/boot/boot/conf.c10
-rw-r--r--sys/arch/vax/boot/boot/ctu.c178
-rw-r--r--sys/arch/vax/boot/boot/devopen.c44
-rw-r--r--sys/arch/vax/boot/boot/hp.c154
-rw-r--r--sys/arch/vax/boot/boot/if_de.c9
-rw-r--r--sys/arch/vax/boot/boot/if_ni.c534
-rw-r--r--sys/arch/vax/boot/boot/ra.c91
-rw-r--r--sys/arch/vax/boot/boot/tmscp.c204
-rw-r--r--sys/arch/vax/boot/boot/vaxstand.h10
-rw-r--r--sys/arch/vax/boot/boot/version3
-rw-r--r--sys/arch/vax/boot/common/romread.S20
-rw-r--r--sys/arch/vax/boot/common/srt0.S3
-rw-r--r--sys/arch/vax/boot/common/vaxstand.h7
-rw-r--r--sys/arch/vax/boot/xxboot/Makefile3
-rw-r--r--sys/arch/vax/boot/xxboot/bootxx.c92
-rw-r--r--sys/arch/vax/boot/xxboot/start.S44
-rw-r--r--sys/arch/vax/conf/GENERIC42
-rw-r--r--sys/arch/vax/conf/RAMDISK42
-rw-r--r--sys/arch/vax/conf/files.vax226
-rw-r--r--sys/arch/vax/consolerl/Makefile29
-rw-r--r--sys/arch/vax/consolerl/anyboo.com18
-rw-r--r--sys/arch/vax/consolerl/defboo.hk18
-rw-r--r--sys/arch/vax/consolerl/defboo.hp18
-rw-r--r--sys/arch/vax/consolerl/defboo.ra18
-rw-r--r--sys/arch/vax/consolerl/defboo.up18
-rw-r--r--sys/arch/vax/consolerl/hkmboo.com18
-rw-r--r--sys/arch/vax/consolerl/hksboo.com18
-rw-r--r--sys/arch/vax/consolerl/hpmboo.com18
-rw-r--r--sys/arch/vax/consolerl/hpsboo.com18
-rw-r--r--sys/arch/vax/consolerl/ramboo.com18
-rw-r--r--sys/arch/vax/consolerl/rasboo.com18
-rw-r--r--sys/arch/vax/consolerl/upmboo.com18
-rw-r--r--sys/arch/vax/consolerl/upsboo.com18
-rw-r--r--sys/arch/vax/floppy/Makefile45
-rw-r--r--sys/arch/vax/floppy/NOTE5
-rw-r--r--sys/arch/vax/floppy/anyboo.cmd15
-rw-r--r--sys/arch/vax/floppy/defboo.MS780C-interleaved17
-rw-r--r--sys/arch/vax/floppy/defboo.hk14
-rw-r--r--sys/arch/vax/floppy/defboo.hp16
-rw-r--r--sys/arch/vax/floppy/defboo.kra14
-rw-r--r--sys/arch/vax/floppy/defboo.ra16
-rw-r--r--sys/arch/vax/floppy/defboo.up14
-rw-r--r--sys/arch/vax/floppy/hkmboo.cmd13
-rw-r--r--sys/arch/vax/floppy/hksboo.cmd13
-rw-r--r--sys/arch/vax/floppy/hpmboo.cmd16
-rw-r--r--sys/arch/vax/floppy/hpsboo.cmd16
-rw-r--r--sys/arch/vax/floppy/ramboo.cmd16
-rw-r--r--sys/arch/vax/floppy/rasboo.cmd16
-rw-r--r--sys/arch/vax/floppy/restar.cmd16
-rw-r--r--sys/arch/vax/floppy/upmboo.cmd13
-rw-r--r--sys/arch/vax/floppy/upsboo.cmd13
-rw-r--r--sys/arch/vax/floppy/utboot.cmd20
-rw-r--r--sys/arch/vax/include/cpu.h3
-rw-r--r--sys/arch/vax/include/ioa.h115
-rw-r--r--sys/arch/vax/include/ka750.h44
-rw-r--r--sys/arch/vax/include/ka820.h140
-rw-r--r--sys/arch/vax/include/nexus.h132
-rw-r--r--sys/arch/vax/include/rsp.h90
-rw-r--r--sys/arch/vax/mba/hp.c476
-rw-r--r--sys/arch/vax/mba/hpreg.h126
-rw-r--r--sys/arch/vax/mba/mba.c296
-rw-r--r--sys/arch/vax/mba/mbareg.h123
-rw-r--r--sys/arch/vax/mba/mbavar.h124
-rw-r--r--sys/arch/vax/mscp/mscp_subr.c7
-rw-r--r--sys/arch/vax/qbus/files.uba10
-rw-r--r--sys/arch/vax/qbus/if_de.c611
-rw-r--r--sys/arch/vax/qbus/if_dereg.h217
-rw-r--r--sys/arch/vax/qbus/qd.c3824
-rw-r--r--sys/arch/vax/qbus/qdioctl.h110
-rw-r--r--sys/arch/vax/qbus/qduser.h506
-rw-r--r--sys/arch/vax/qbus/qfont.c3290
-rw-r--r--sys/arch/vax/qbus/ubavar.h3
-rw-r--r--sys/arch/vax/qbus/uda.c3
-rw-r--r--sys/arch/vax/stand/boot/Makefile4
-rw-r--r--sys/arch/vax/stand/boot/boot.c109
-rw-r--r--sys/arch/vax/stand/boot/conf.c10
-rw-r--r--sys/arch/vax/stand/boot/ctu.c178
-rw-r--r--sys/arch/vax/stand/boot/devopen.c44
-rw-r--r--sys/arch/vax/stand/boot/hp.c154
-rw-r--r--sys/arch/vax/stand/boot/if_de.c9
-rw-r--r--sys/arch/vax/stand/boot/if_ni.c534
-rw-r--r--sys/arch/vax/stand/boot/ra.c91
-rw-r--r--sys/arch/vax/stand/boot/tmscp.c204
-rw-r--r--sys/arch/vax/stand/boot/vaxstand.h10
-rw-r--r--sys/arch/vax/stand/boot/version3
-rw-r--r--sys/arch/vax/stand/common/romread.S20
-rw-r--r--sys/arch/vax/stand/common/srt0.S3
-rw-r--r--sys/arch/vax/stand/common/vaxstand.h7
-rw-r--r--sys/arch/vax/stand/xxboot/Makefile3
-rw-r--r--sys/arch/vax/stand/xxboot/bootxx.c92
-rw-r--r--sys/arch/vax/stand/xxboot/start.S44
-rw-r--r--sys/arch/vax/uba/qv.c1310
-rw-r--r--sys/arch/vax/uba/ts.c1454
-rw-r--r--sys/arch/vax/uba/tsreg.h259
-rw-r--r--sys/arch/vax/uba/uba_cmi.c143
-rw-r--r--sys/arch/vax/uba/uba_sbi.c324
-rw-r--r--sys/arch/vax/uba/ubareg.h116
-rw-r--r--sys/arch/vax/vax/autoconf.c71
-rw-r--r--sys/arch/vax/vax/cfl.c260
-rw-r--r--sys/arch/vax/vax/clock.c7
-rw-r--r--sys/arch/vax/vax/cmi.c133
-rw-r--r--sys/arch/vax/vax/conf.c299
-rw-r--r--sys/arch/vax/vax/crl.c258
-rw-r--r--sys/arch/vax/vax/crl.h79
-rw-r--r--sys/arch/vax/vax/crx.c262
-rw-r--r--sys/arch/vax/vax/crx.h82
-rw-r--r--sys/arch/vax/vax/ctu.c417
-rw-r--r--sys/arch/vax/vax/disksubr.c51
-rw-r--r--sys/arch/vax/vax/findcpu.c34
-rw-r--r--sys/arch/vax/vax/gencons.c26
-rw-r--r--sys/arch/vax/vax/gencons.h4
-rw-r--r--sys/arch/vax/vax/ka750.c269
-rw-r--r--sys/arch/vax/vax/ka780.c372
-rw-r--r--sys/arch/vax/vax/ka820.c451
-rw-r--r--sys/arch/vax/vax/ka860.c417
-rw-r--r--sys/arch/vax/vax/machdep.c35
-rw-r--r--sys/arch/vax/vax/pmap.c11
-rw-r--r--sys/arch/vax/vax/sbi.c141
141 files changed, 238 insertions, 24217 deletions
diff --git a/distrib/sets/lists/base/md.vax b/distrib/sets/lists/base/md.vax
index 3403d99f1fc..b0dd918a116 100644
--- a/distrib/sets/lists/base/md.vax
+++ b/distrib/sets/lists/base/md.vax
@@ -1,4 +1,3 @@
-./pcs750.bin
./sbin/kbd
./sbin/wsconsctl
./usr/lib/gcc-lib/vax-unknown-openbsd4.9
@@ -1698,7 +1697,6 @@
./usr/libdata/perl5/site_perl/vax-openbsd/vax/frame.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/internal_types.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/intr.ph
-./usr/libdata/perl5/site_perl/vax-openbsd/vax/ioa.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka410.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka420.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka43.ph
@@ -1708,8 +1706,6 @@
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka650.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka670.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka680.ph
-./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka750.ph
-./usr/libdata/perl5/site_perl/vax-openbsd/vax/ka820.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/kcore.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/limits.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/loadfile_machdep.ph
@@ -1728,7 +1724,6 @@
./usr/libdata/perl5/site_perl/vax-openbsd/vax/ptrace.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/reg.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/rpb.ph
-./usr/libdata/perl5/site_perl/vax-openbsd/vax/rsp.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/scb.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/setjmp.ph
./usr/libdata/perl5/site_perl/vax-openbsd/vax/sgmap.ph
@@ -2382,7 +2377,6 @@
./usr/local/libdata/perl5/site_perl/vax-openbsd
./usr/mdec/boot
./usr/mdec/hdboot
-./usr/mdec/hpboot
./usr/mdec/raboot
./usr/mdec/sdboot
./usr/mdec/xxboot
diff --git a/distrib/sets/lists/comp/md.vax b/distrib/sets/lists/comp/md.vax
index c5f14df3f13..de045d578f9 100644
--- a/distrib/sets/lists/comp/md.vax
+++ b/distrib/sets/lists/comp/md.vax
@@ -129,7 +129,6 @@
./usr/include/vax/frame.h
./usr/include/vax/internal_types.h
./usr/include/vax/intr.h
-./usr/include/vax/ioa.h
./usr/include/vax/ka410.h
./usr/include/vax/ka420.h
./usr/include/vax/ka43.h
@@ -139,8 +138,6 @@
./usr/include/vax/ka650.h
./usr/include/vax/ka670.h
./usr/include/vax/ka680.h
-./usr/include/vax/ka750.h
-./usr/include/vax/ka820.h
./usr/include/vax/kcore.h
./usr/include/vax/limits.h
./usr/include/vax/loadfile_machdep.h
@@ -159,7 +156,6 @@
./usr/include/vax/ptrace.h
./usr/include/vax/reg.h
./usr/include/vax/rpb.h
-./usr/include/vax/rsp.h
./usr/include/vax/scb.h
./usr/include/vax/setjmp.h
./usr/include/vax/sgmap.h
diff --git a/distrib/vax/install.md b/distrib/vax/install.md
index b2eb686ca98..f306d5f828c 100644
--- a/distrib/vax/install.md
+++ b/distrib/vax/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.36 2011/04/17 20:57:11 krw Exp $
+# $OpenBSD: install.md,v 1.37 2011/07/06 18:32:58 miod Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -34,9 +34,9 @@
#
MDTERM=vt100
-MDDKDEVS='/^[hs]d[0-9] /s/ .*//p;/^r[al][0-9] /s/ .*//p'
+MDDKDEVS='/^[hs]d[0-9] /s/ .*//p;/^ra[0-9] /s/ .*//p'
MDCDDEVS='/^cd[0-9] /s/ .*//p;/^ra[0-9] .* RRD40$/s/ .*//p'
-MDMTDEVS='/^[cms]t[0-9][0-9]* /s/ .*//p;/^ts[0-9]0-9]* /s/ .*//p'
+MDMTDEVS='/^[ms]t[0-9][0-9]* /s/ .*//p'
md_installboot() {
cp /mnt/usr/mdec/boot /mnt/boot
diff --git a/etc/Makefile b/etc/Makefile
index 5442399f34b..e4d5e738daf 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.295 2011/04/17 21:26:38 schwarze Exp $
+# $OpenBSD: Makefile,v 1.296 2011/07/06 18:32:58 miod Exp $
TZDIR= /usr/share/zoneinfo
LOCALTIME= Canada/Mountain
@@ -33,8 +33,6 @@ BIN2= motd
MISETS= base${OSrev}.tgz comp${OSrev}.tgz \
man${OSrev}.tgz game${OSrev}.tgz etc${OSrev}.tgz
-PCS= pcs750.bin
-
# Use NOGZIP on architectures where the gzip'ing would take too much time
# (pmax or slower :-)). This way you get only tar'ed snap files and you can
# gzip them on a faster machine
@@ -235,12 +233,6 @@ distribution-etc-root-var: distrib-dirs
${DESTDIR}/var/log/xferlog
${INSTALL} -c -o ${BINOWN} -g utmp -m 664 /dev/null \
${DESTDIR}/var/run/utmp
-.if ${MACHINE} == "vax"
- uudecode -p etc.vax/${PCS}.uu > ${DESTDIR}/${PCS} && \
- chown ${BINOWN} ${DESTDIR}/${PCS} && \
- chgrp ${BINGRP} ${DESTDIR}/${PCS} && \
- chmod 644 ${DESTDIR}/${PCS}
-.endif
cd ../gnu/usr.sbin/sendmail/cf/cf && exec ${MAKE} distribution
cd ../usr.sbin/ypserv/ypinit && exec ${MAKE} distribution
cd ../usr.bin/ssh && exec ${MAKE} distribution
diff --git a/etc/etc.vax/MAKEDEV.md b/etc/etc.vax/MAKEDEV.md
index c8944d15caa..84cff2e52f2 100644
--- a/etc/etc.vax/MAKEDEV.md
+++ b/etc/etc.vax/MAKEDEV.md
@@ -1,6 +1,6 @@
define(MACHINE,vax)dnl
vers(__file__,
- {-$OpenBSD: MAKEDEV.md,v 1.43 2010/09/30 15:27:54 claudio Exp $-},
+ {-$OpenBSD: MAKEDEV.md,v 1.44 2011/07/06 18:32:58 miod Exp $-},
etc.MACHINE)dnl
dnl
dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org>
@@ -91,27 +91,17 @@ _DEV(local)
_TITLE(dis)
_DEV(ccd, 54, 17)
_DEV(cd, 61, 22)
-_DEV(flo, 54, 16)
_DEV(hd, 58, 19)
-_DEV(hk, 11, 3)
-_DEV(hp, 4, 0)
_DEV(ra, 9, 9)
_DEV(raid, 73, 25)
-_DEV(rb, 23, 11)
_DEV(rd, 62, 23)
-_DEV(rl, 32, 14)
_DEV(rx, 30, 12)
_DEV(sd, 59, 20)
-_DEV(up, 13, 2)
_DEV(vnd, 55, 18)
_TITLE(tap)
_DEV(ch, 63)
-_DEV(ht, 5, 1)
_DEV(mt, 38, 15)
_DEV(st, 60, 21)
-_DEV(tm, 14, 5)
-_DEV(ts, 16, 6)
-_DEV(ut, 17, 10)
_TITLE(term)
_DEV(dhu, 34)
_DEV(dl, 66)
@@ -155,45 +145,27 @@ _std(2, 3, 50, 33)
M ttyg1 c 25 1 600
M ttyg2 c 25 2 600
M ttyg3 c 25 3 600
- M crl c 35 0 600
- M csa1 c 51 0 600
- M csa2 c 51 1 600
- M tu0 b 8 0 600
- M tu1 b 8 1 600
- M floppy c 8 0 600
;;
-ht*|tm*|mt*|ts*|ut*)
- case $i in
- ht*) n=ht b=1 c=5;;
- mt*) n=mt b=15 c=38;;
- tm*) n=tm b=5 c=14;;
- ts*) n=ts b=6 c=16;;
- ut*) n=ut b=10 c=17;;
- esac
+mt*)
case $U in
[0-7])
four=Add($U, 4)
eight=Add($U, 8)
twelve=Add($U, 12)
twenty=Add($U, 20)
- M $n$U b $b $U 660 operator
- M $n$four b $b $four 660 operator
- M $n$eight b $b $eight 660 operator
- M $n$twelve b $b $twelve 660 operator
- M n$n$U b $b $four 660 operator;: sanity w/pdp11 v7
- M n$n$eight b $b $twelve 660 operator;: ditto
- M nr$n$U c $c $four 660 operator;: ditto
- M nr$n$eight c $c $twelve 660 operator;: ditto
- M r$n$U c $c $U 660 operator
- M r$n$four c $c $four 660 operator
- M r$n$eight c $c $eight 660 operator
- M r$n$twelve c $c $twelve 660 operator
- if [ "$i" = "ut" ];
- then
- M $n$twenty b $b $twenty 660 operator
- M r$n$twenty c $b $twenty 660 operator
- fi
+ M mt$U b 15 $U 660 operator
+ M mt$four b 15 $four 660 operator
+ M mt$eight b 15 $eight 660 operator
+ M mt$twelve b 15 $twelve 660 operator
+ M nmt$U b 15 $four 660 operator;: sanity w/pdp11 v7
+ M nmt$eight b 15 $twelve 660 operator;: ditto
+ M nrmt$U c 38 $four 660 operator;: ditto
+ M nrmt$eight c 38 $twelve 660 operator;: ditto
+ M rmt$U c 38 $U 660 operator
+ M rmt$four c 38 $four 660 operator
+ M rmt$eight c 38 $eight 660 operator
+ M rmt$twelve c 38 $twelve 660 operator
;;
*)
echo bad unit for tape in: $i
@@ -204,8 +176,7 @@ ht*|tm*|mt*|ts*|ut*)
dnl
dnl *** vax specific targets
dnl
-dnl target(all, ut, 0)dnl
-dnl target(all, ch, 0)dnl
+target(all, ch, 0)dnl
target(all, nnpfs, 0)dnl
target(all, vscsi, 0)dnl
target(all, diskmap)dnl
@@ -213,9 +184,6 @@ target(all, pty, 0)dnl
target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7)dnl
target(all, bio)dnl
target(all, tun, 0, 1)dnl
-dnl target(all, xy, 0, 1, 2, 3)dnl
-dnl target(all, hk, 0, 1, 2, 3)dnl
-dnl target(all, up, 0, 1, 2, 3)dnl
dnl target(all, rd, 0)dnl
target(all, cd, 0)dnl
target(all, sd, 0, 1, 2, 3)dnl
@@ -223,10 +191,8 @@ target(all, vnd, 0)dnl
target( all, ccd, 0)dnl
target( all, hd, 0, 1, 2)dnl
target( all, mt, 0, 1)dnl
-target( all, ts, 0, 1)dnl
-target( all, uu, 0)dnl
target( all, st, 0, 1)dnl
target( all, dhu, 0)dnl
target( all, dz, 0)dnl
target( all, dl, 0)dnl
-dnl target( all, qsc, 0)dnl
+target( all, qsc, 0)dnl
diff --git a/etc/etc.vax/pcs750.bin.uu b/etc/etc.vax/pcs750.bin.uu
deleted file mode 100644
index ebc35f36d8a..00000000000
--- a/etc/etc.vax/pcs750.bin.uu
+++ /dev/null
@@ -1,254 +0,0 @@
-begin 644 pcs750.bin
-M_________________________________________[__________________
-M____________________________________________________________
-M____________________________________________________________
-M________________________W___________________________________
-M____________________________________________________________
-M____________________________________W_______________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________O_______________
-M__________________O___O_____________________________________
-M____________________________]_______________________________
-MW______]____________________________________________________
-M____________________________________________________________
-M________________________________]?__________________________
-M____________________________________________________________
-M___________________________W__________OW____________________
-M____?_______________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M_____________________________________________SDH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@8+W".>;,D6T#".2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2,LL@%T``B19$`BP<'"$!:]QPQW8.2A'```#9`,`2#DH1P```V0#`$BZ
-M+G`$`0-PPV,2NBYP!`$#<,-C$CDH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$A5
-M,W"$!P,XU>59.2A'```#9`,`2.@7<`0"`R3!:QA&*7"$`P,@P6M8.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(..2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.#!P2M@#)``$1@H7<`04`X``1$A$Z=`%`'MD`P!(TS)P2M@#
-MI`,`2#DH1P```V0#`$@Y*$<```-D`P!(@#YP2``#$'$:B#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!([!9P!`0#)%E2!/*6<`0#HR#!`9@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#@PL%T``B19`8[T
-MEG"$`*,@P0$8[C)P.`@#9`-`SCDS<`0``V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(BA9P!$`#
-M<%M`"(P6<`1``21;(`A^%G`$0`%P.T/(X:IPA`!O`,%CF#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!((BMP!$`!
-M)%L@"#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(L2AP!-@#I`-M"(T5X%0"`R3)$IBN*'`$`0,XQ6P8.2A'```#
-M9`,`2(P5<`0!`R3%;-@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$A,*'`$`0,XQ6P8O15P!`$#
-M),5L6$TH\`4X`R196PBZ%2`$``-D`P!(Q#]P!`$+<,-K&+L5\,L!`SC!&Q@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(..2A'```
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$C0+W!*"`,"P1M6.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(\Q1P!`(`Y%E7R/84,(4`9G&O`%8Y
-M*$<```-D`P!(.2A'```#9`,`2/@4<`0`IZ``$LCX%'`$`*.@`!*(Z#AP!`!G
-M9`,`B.@X<%C89&2!`(@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2(R4<`0!HP#!"]BL%'`$``-D`P!(CI1P!`!O)%D,B)`4<&0``V0#:PBL
-M%'`$``-D`P!(DI1P!`6G(,D+V)04<&#8`^1;`$B1%'`$`@,DQ6R8K!1P!`$#
-M<,-KV):4<`00HR#)#!B:%'!(``,D61K(H11P!``#9`,`R)B4<(0`HR#)"]B;
-M%'`$.`,D65N(HU1P!``#9`,`R,`_<`0`"V0#``BC5'!*V`,0`!J(HU1P2@(#
-M$,$:V)X4<$HX`^1;`(B?%'!(``,D61K(H!1P!``#9`,`2,`_<`0`#V0#`$BC
-M5'`$`0,XQ6P8/P!P!``+9`,`"*04<`4``V0#`$BE%'#H`0-PRP"8IA1P9``#
-M9`-K"*<4<&`%`W#+`)BH%'!0V`/D6QM(J11PX`8#<,L`F*H4<%#8`^1;&\BK
-M%'!@``,D60M(P3]P!``+9`,`B*T4<&0``V0#:<@Z-'`$!*<@R0E8.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2&(P<`4``V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-M9`,`2#$P<(0Q`R3;8E@Y*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y
-M*$<```-D`P!(.2A'```#9`,`2#DH1P```V0#`$@Y*$<```-D`P!(.2A'```#
-.9`,`2#DH1P```V0#`$@#
-`
-end
diff --git a/share/man/man4/man4.vax/Makefile b/share/man/man4/man4.vax/Makefile
index 6d94688df8e..5a7137b2c43 100644
--- a/share/man/man4/man4.vax/Makefile
+++ b/share/man/man4/man4.vax/Makefile
@@ -1,15 +1,11 @@
-# $OpenBSD: Makefile,v 1.24 2008/08/20 19:00:01 miod Exp $
+# $OpenBSD: Makefile,v 1.25 2011/07/06 18:32:58 miod Exp $
# $NetBSD: Makefile,v 1.6 1996/03/03 17:13:09 thorpej Exp $
# from: @(#)Makefile 5.4 (Berkeley) 5/11/90
-# Living in the Attic:
-# acc.4 ad.4 crl.4 css.4 ct.4 ddn.4 dh.4 dmc.4 dmf.4 dmv.4 dmz.4 dn.4
-# ec.4 en.4 ex.4 fl.4 hdh.4 hk.4 ht.4 hy.4 ik.4 il.4 ix.4 kg.4 lp.4 np.4
-# pcl.4 ps.4 tm.4 tmscp.4 tu.4 up.4 ut.4 uu.4 va.4 vp.4 vv.4
-MAN= asc.4 autoconf.4 cons.4 de.4 dhu.4 dz.4 fwio.4 gpx.4 hp.4 \
+MAN= asc.4 autoconf.4 cons.4 de.4 dhu.4 dz.4 fwio.4 gpx.4 \
ibus.4 intro.4 lcg.4 lcspx.4 le.4 led.4 legss.4 lkkbd.4 lkms.4 \
mbus.4 mem.4 mscpbus.4 mt.4 mtc.4 ncr.4 qe.4 qsc.4 ra.4 rx.4 \
- sii.4 smg.4 ts.4 uba.4 uda.4 vsbus.4 vxtbus.4 ze.4
+ sii.4 smg.4 uba.4 uda.4 vsbus.4 vxtbus.4 ze.4
MLINKS= mem.4 kmem.4
MANSUBDIR=vax
diff --git a/share/man/man4/man4.vax/autoconf.4 b/share/man/man4/man4.vax/autoconf.4
index 339d7d543e5..9adf6b9808d 100644
--- a/share/man/man4/man4.vax/autoconf.4
+++ b/share/man/man4/man4.vax/autoconf.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: autoconf.4,v 1.12 2007/05/31 19:19:57 jmc Exp $
+.\" $OpenBSD: autoconf.4,v 1.13 2011/07/06 18:32:58 miod Exp $
.\" $NetBSD: autoconf.4,v 1.3 1996/03/03 17:13:13 thorpej Exp $
.\"
.\" Copyright (c) 1980, 1991 Regents of the University of California.
@@ -30,7 +30,7 @@
.\"
.\" from: @(#)autoconf.4 6.3 (Berkeley) 3/27/91
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 6 2011 $
.Dt AUTOCONF 4 vax
.Os
.Sh NAME
@@ -47,209 +47,17 @@ This procedure is driven by a system configuration table which is processed by
.Xr config 8
and compiled into each kernel.
.Pp
-On the
-.Tn VAX ,
-devices in
-.Tn NEXUS
-slots are normally noted, thus memory controllers,
-.Tn UNIBUS
-and
-.Tn MASSBUS
-adaptors.
-Devices which are not supported which are found in
-.Tn NEXUS
-slots are noted also.
-The Q-bus, if present, is configured in the same way as the
-.Tn UNIBUS .
-.Pp
-.Tn MASSBUS
-devices are located by a very deterministic procedure since
-.Tn MASSBUS
-space is completely probe-able.
If devices exist which are not configured they will be silently ignored;
if devices exist of unsupported type they will be noted.
.Pp
-.Tn UNIBUS
-devices are located by probing to see if their control-status
-registers respond.
-If not, they are silently ignored.
-If the control status register responds but the device cannot be made to
-interrupt, a diagnostic warning will be printed on the console and the device
-will not be available to the system.
-.Pp
Normally, the system uses the disk from which it was loaded as the root
filesystem.
-If that is not possible,
-a generic system will pick its root device
-as the
-.Dq best
-available device
-.Pf ( Tn MASSBUS
-disks are better than
-.Tn SMD UNIBUS
-disks are better than
-.Tn RK07 Ns s ;
-the device must be drive 0
-to be considered).
If such a system is booted with the
.Dv RB_ASKNAME
option (see
.Xr reboot 2 ) ,
then the name of the root device is read from the console terminal at boot
time, and any available device may be used.
-.Sh DIAGNOSTICS
-.Bl -diag
-.It mba%d at tr%d.
-A
-.Tn MASSBUS
-adapter was found in
-.Ql tr%d
-(the
-.Tn NEXUS
-slot number).
-.Ox
-will call it
-.Ql mba%d .
-.Pp
-.It %d mbas not configured.
-More
-.Tn MASSBUS
-adapters were found on
-the machine than were declared in the machine configuration; the excess
-.Tn MASSBUS
-adapters will not be accessible.
-.Pp
-.It uba%d at tr%d.
-A
-.Tn UNIBUS or Q-bus
-adapter was found in
-.Ql tr%d
-(the
-.Tn NEXUS
-slot number).
-.Ox
-will call it
-.Ql uba%d .
-.Pp
-.It dr32 unsupported (at tr %d).
-A
-.Tn DR Ns 32
-interface was found in
-a
-.Tn NEXUS ,
-for which
-.Ox
-does not have a driver.
-.Pp
-.It ci unsupported (at tr %d).
-A
-.Tn CI
-interface was found in
-a
-.Tn NEXUS ,
-for which
-.Ox
-does not have a driver.
-.Pp
-.It mcr%d at tr%d.
-A memory controller was found in
-.Ql tr%d
-(the
-.Tn NEXUS
-slot number).
-.Ox
-will call it
-.Ql mcr%d .
-.Pp
-.It 5 mcrs unsupported.
-.Ox
-supports only 4 memory controllers
-per
-.Tn CPU .
-.Pp
-.It mpm unsupported (at tr%d).
-Multi-port memory is unsupported
-in the sense that
-.Ox
-does not know how to poll it for
-.Tn ECC
-errors.
-.Pp
-.It %s%d at mba%d drive %d.
-A tape formatter or a disk was found
-on the
-.Tn MASSBUS ;
-for disks
-.Ql %s%d
-will look like
-.Dq Li hp0 ,
-for tape formatters
-like
-.Dq Li ht1 .
-The drive number comes from the unit plug on the drive
-or in the
-.Tn TM
-formatter
-.Pf ( Em not
-on the tape drive; see below).
-.Pp
-.It %s%d at %s%d slave %d.
-(For
-.Tn MASSBUS
-devices).
-Which would look like
-.Dq Li tu0 at ht0 slave 0 ,
-where
-.Dq Li tu0
-is the name for the tape device and
-.Dq Li ht0
-is the name
-for the formatter.
-A tape slave was found on the tape formatter at the indicated drive number
-(on the front of the tape drive).
-.Ux
-will call the device, e.g.,
-.Dq Li tu0 .
-.Pp
-.It "%s%d at uba%d csr %o vec %o ipl %x."
-The device
-.Ql %s%d ,
-e.g.\&
-.Dq Li dz0
-was found on
-.Ql uba%d
-at control-status register address
-.Ql \&%o
-and with
-device vector
-.Ql \&%o .
-The device interrupted at priority level
-.Ql \&%x .
-.Pp
-.It %s%d at uba%d csr %o zero vector.
-The device did not present
-a valid interrupt vector, rather presented 0 (a passive release condition)
-to the adapter.
-.Pp
-.It "%s%d at uba%d csr %o didn't interrupt."
-The device did not interrupt,
-likely because it is broken, hung, or not the kind of device it is advertised
-to be.
-.Pp
-.It %s%d at %s%d slave %d.
-(For UNIBUS or Q-bus devices).
-Which would look like
-.Dq Li up0 at sc0 slave 0 ,
-where
-.Dq Li up0
-is the name of a disk drive and
-.Dq Li sc0
-is the name
-of the controller.
-Analogous to
-.Tn MASSBUS
-case.
-.El
.Sh SEE ALSO
.Xr intro 4 ,
.Xr boot_vax 8 ,
diff --git a/share/man/man4/man4.vax/cons.4 b/share/man/man4/man4.vax/cons.4
index 4548c671fd9..59b222984e9 100644
--- a/share/man/man4/man4.vax/cons.4
+++ b/share/man/man4/man4.vax/cons.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cons.4,v 1.10 2007/05/31 19:19:57 jmc Exp $
+.\" $OpenBSD: cons.4,v 1.11 2011/07/06 18:32:58 miod Exp $
.\"
.\" Copyright (c) 1980, 1991 Regents of the University of California.
.\" All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)cons.4 6.3 (Berkeley) 3/27/91
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 6 2011 $
.Dt CONS 4 vax
.Os
.Sh NAME
@@ -48,88 +48,6 @@ also called the
.Sq chevron
prompt.
.Pp
-The operation of the console in this mode varies
-among different VAX models.
-.Ss VAX-11/780 or 785
-On either the
-.Tn VAX
-11/780 or 785 the following commands may be used
-after placing the console in local mode with
-.Ic ^P .
-.Pp
-.Bl -tag -width continue -compact -offset 4n
-.It Ic c
-.It Ic continue
-Re-enter conversational mode
-if the processor was halted.
-.Pp
-.It Ic h
-.It Ic halt
-Halt the CPU.
-On an 11/780 or 785
-the processor is not stopped by entering local console mode.
-.Pp
-.It Ic set t p
-(set terminal program)
-Re-enter conversational mode
-if the processor is still
-running.
-.Pp
-.It Ic P
-(proceed)
-Get out of
-.Tn ODT
-mode.
-.Pp
-.It Ic <break>
-If you hit the break key on the console, then the console
-.Tn LSI Ns -11
-will go into
-.Tn ODT
-(console debugger mode).
-.El
-.Ss VAX-11/750 or 11/730
-On an 11/750
-or an 11/730
-the processor is halted whenever the console is not in conversational mode.
-.Pp
-.Bl -tag -width continue -compact -offset 4n
-.It Ic C
-Return to conversational mode.
-.Pp
-.It Ic ret
-Return from remote diagnosis mode to local console
-mode.
-.Pp
-.It Ic \&^D
-(11/750 only)
-When in console mode on an 11/750 which has a remote diagnosis module,
-a
-.Ic \&^D
-will put you in remote diagnosis mode, where the prompt will be
-.Ql RDM> .
-.El
-.Ss VAX 8600 or 8650
-The
-.Tn VAX
-8600 (8650) console normally works in the same way as the 11/750,
-except that there are many additional modes and commands.
-.Pp
-.Bl -tag -width continue -compact -offset 4n
-.It Ic c
-.It Ic continue
-Return to
-conversational mode.
-.Pp
-.It Ic halt
-Halt the processor if
-.Tn HEX
-debug enabled.
-.Pp
-.It Ic p
-Halt the processor if in normal mode.
-.El
-.Ss VAX 4000, MicroVAX, VAXstation, others
If the console is a serial console, sending a break will likely cause the
machine to halt and enter console mode.
The set of commands available at the console varies from machine to machine,
diff --git a/share/man/man4/man4.vax/hp.4 b/share/man/man4/man4.vax/hp.4
deleted file mode 100644
index c766aa5a279..00000000000
--- a/share/man/man4/man4.vax/hp.4
+++ /dev/null
@@ -1,165 +0,0 @@
-.\" $OpenBSD: hp.4,v 1.16 2007/05/31 19:19:57 jmc Exp $
-.\" $NetBSD: hp.4,v 1.4 1996/03/05 15:28:50 ragge Exp $
-.\"
-.\" Copyright (c) 1980,1988, 1991 Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" 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. 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: @(#)hp.4 6.5 (Berkeley) 3/27/91
-.\"
-.Dd $Mdocdate: May 31 2007 $
-.Dt HP 4 vax
-.Os
-.Sh NAME
-.Nm hp
-.Nd
-.Tn MASSBUS
-disk interface
-.Sh SYNOPSIS
-.Cd "hp* at mba?"
-.Sh DESCRIPTION
-The
-.Nm hp
-driver
-is a generic MASSBUS disk driver which handles the standard
-.Tn DEC
-controllers.
-It is typical of a block-device disk driver; block
-.Tn I/O
-is
-described in
-.Xr physio 9 .
-.Pp
-The script
-.Xr MAKEDEV 8
-should be used to create the special files; if a special file
-needs to be created by hand, consult
-.Xr mknod 8 .
-It is recommended as a security precaution to not create special files
-for devices which may never be installed.
-.Pp
-The first sector of each disk contains both a first-stage bootstrap program
-and a disk label containing geometry information and partition layouts (see
-.Xr disklabel 5 ) .
-This sector is normally write-protected, and disk-to-disk copies should
-avoid copying this sector.
-The label may be updated with
-.Xr disklabel 8 ,
-which can also be used to write-enable and write-disable the sector.
-The next 15 sectors contain a second-stage bootstrap program.
-.Sh DISK SUPPORT
-During autoconfiguration or whenever a drive comes on line for the first time,
-or when a drive is opened after all partitions are closed,
-the first sector of the drive is examined for a disk label.
-If a label is found, the geometry of the drive and the partition tables
-are taken from it.
-If no label is found, a fake label is created by the driver, enough
-so that a real label can be written.
-.Pp
-The hp?a partition is normally used for the root file system,
-the hp?b partition as a paging area,
-and the hp?c partition for pack-pack copying (it maps the entire disk).
-On disks larger than about 205 Megabytes, the hp?h partition
-is inserted prior to the hp?d or hp?g partition;
-the hp?g partition then maps the remainder of the pack.
-.Sh FILES
-.Bl -tag -width /dev/rhp[0-7][a-p] -compact
-.It Pa /dev/hp[0-7][a-p]
-block files
-.It Pa /dev/rhp[0-7][a-p]
-raw files
-.El
-.Sh DIAGNOSTICS
-.Bl -diag
-.It "hp%d%c: hard error %sing fsbn %d [of %d-%d] (hp%d bn %d cn %d tn %d sn %d) mbsr=%b er1=%b er2=%b."
-An unrecoverable error occurred during transfer of the specified
-filesystem block number,
-which is a logical block number on the indicated partition.
-If the transfer involved multiple blocks, the block range is printed as well.
-The parenthesized fields list the actual disk sector number
-relative to the beginning of the drive,
-as well as the cylinder, track and sector number of the block.
-The
-.Tn MASSBUS
-status register is printed in hexadecimal and
-with the error bits decoded if any error bits other than
-.Tn MBEXC
-and
-.Tn DTABT
-are set.
-In any case the contents of the two error registers are also printed
-in octal and symbolically with bits decoded.
-(Note that er2 is what old
-.Tn RP06
-manuals would call
-.Tn RPER3 ;
-the terminology
-is that of the
-.Tn RM
-disks).
-The error was either unrecoverable, or a large number of retry attempts
-(including offset positioning and drive recalibration) could not
-recover the error.
-.Pp
-.It "hp%d%c: soft ecc reading fsbn %d [of %d-%d] (hp%d bn %d cn %d tn %d sn %d)."
-A recoverable
-.Tn ECC
-error occurred on the
-specified sector of the specified disk partition.
-If the transfer involved multiple blocks, the block range is printed as well.
-The parenthesized fields list the actual disk sector number
-relative to the beginning of the drive,
-as well as the cylinder, track and sector number of the block.
-This happens normally
-a few times a week.
-If it happens more frequently than this the sectors where the errors are
-occurring should be checked to see if certain cylinders on the pack,
-spots on the carriage of the drive or heads are indicated.
-.Pp
-.El
-.Sh SEE ALSO
-.Xr intro 4 ,
-.Xr disklabel 5 ,
-.Xr disklabel 8
-.Sh HISTORY
-The
-.Nm
-driver appeared in
-.Bx 4.0 .
-A new
-.Nm
-driver showed up in
-.Nx 1.1a .
-.Sh BUGS
-.Tn DEC Ns -standard
-bad144
-bad-block handling should be used.
-.Pp
-.Tn DEC Ns -standard
-error logging should be supported.
-.Pp
-A program to analyze the logged error information (even in its
-present reduced form) is needed.
diff --git a/share/man/man4/man4.vax/intro.4 b/share/man/man4/man4.vax/intro.4
index c22761391e1..452c7b136a4 100644
--- a/share/man/man4/man4.vax/intro.4
+++ b/share/man/man4/man4.vax/intro.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: intro.4,v 1.32 2008/08/20 19:00:01 miod Exp $
+.\" $OpenBSD: intro.4,v 1.33 2011/07/06 18:32:58 miod Exp $
.\" $NetBSD: intro.4,v 1.3 1996/03/03 17:13:44 thorpej Exp $
.\"
.\" Copyright (c) 1980, 1991 Regents of the University of California.
@@ -30,7 +30,7 @@
.\"
.\" from: @(#)intro.4 6.6 (Berkeley) 3/27/91
.\"
-.Dd $Mdocdate: August 20 2008 $
+.Dd $Mdocdate: July 6 2011 $
.Dt INTRO 4 vax
.Os
.Sh NAME
@@ -114,8 +114,6 @@ DZ-11 multiplexer device interface
Firefox Workstation I/O module
.It Xr gpx 4
GPX color frame buffer
-.It Xr hp 4
-MASSBUS disk interface
.It Xr ibus 4
VAX internal bus
.It Xr lcg 4
@@ -154,8 +152,6 @@ DEC RX02 floppy disk interface
SII DSSI and SCSI controller
.It Xr smg 4
Small Monochrome Graphics frame buffer
-.It Xr ts 4
-TS11/TSV05 magtape interface
.It Xr uba 4
UNIBUS/Q-bus controller
.It Xr uda 4
diff --git a/share/man/man4/man4.vax/mem.4 b/share/man/man4/man4.vax/mem.4
index 99dd497600d..a4edc1214bd 100644
--- a/share/man/man4/man4.vax/mem.4
+++ b/share/man/man4/man4.vax/mem.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mem.4,v 1.10 2007/05/31 19:19:57 jmc Exp $
+.\" $OpenBSD: mem.4,v 1.11 2011/07/06 18:32:58 miod Exp $
.\" $NetBSD: mem.4,v 1.3 1996/03/03 17:13:50 thorpej Exp $
.\"
.\" Copyright (c) 1980, 1991 Regents of the University of California.
@@ -30,7 +30,7 @@
.\"
.\" from: @(#)mem.4 6.3 (Berkeley) 3/27/91
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 6 2011 $
.Dt MEM 4 vax
.Os
.Sh NAME
@@ -54,17 +54,8 @@ in the same manner as
.Pa /dev/mem .
Only kernel virtual addresses that are currently mapped to memory are allowed.
.Pp
-On the
-.Tn VAX
-11/780 (and others),
-the
-.Tn I/O
-space base address is
-20000000(16);
-on an 11/750
-the
-.Tn I/O
-space addresses are of the form fxxxxx(16).
+On the VAX, the I/O space base address is
+20000000(16).
On all
.Tn VAX Ns 'en
the
diff --git a/share/man/man4/man4.vax/ts.4 b/share/man/man4/man4.vax/ts.4
deleted file mode 100644
index ce8bde31203..00000000000
--- a/share/man/man4/man4.vax/ts.4
+++ /dev/null
@@ -1,95 +0,0 @@
-.\" $OpenBSD: ts.4,v 1.11 2007/05/31 19:19:57 jmc Exp $
-.\" $NetBSD: ts.4,v 1.4 1996/03/03 17:14:08 thorpej Exp $
-.\"
-.\" Copyright (c) 1980, 1991 Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" 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. 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: @(#)ts.4 6.2 (Berkeley) 3/27/91
-.\"
-.Dd $Mdocdate: May 31 2007 $
-.Dt TS 4 vax
-.Os
-.Sh NAME
-.Nm ts
-.Nd
-.Tn TS11/TSV05
-magtape interface
-.Sh SYNOPSIS
-.Cd "ts0 at uba? csr 0172520"
-.Sh DESCRIPTION
-The
-.Tn TS11/TSV05
-combination provides a standard tape drive
-interface as described in
-.Xr mtio 4 .
-The
-.Tn TS11
-operates only at 1600
-.Tn BPI ,
-and only one transport
-is possible per controller.
-.Pp
-The
-.Tn TS11
-is attached to an
-.Tn UNIBUS ,
-and the TSV05 is attached to a
-.Tn Q22 bus .
-.Sh DIAGNOSTICS
-.Bl -diag
-.It ts%d: no write ring.
-An attempt was made to write on the tape drive
-when no write ring was present; this message is written on the terminal of
-the user who tried to access the tape.
-.Pp
-.It ts%d: not online.
-An attempt was made to access the tape while it
-was offline; this message is written on the terminal of the user
-who tried to access the tape.
-.Pp
-.It ts%d: error at bn%d.
-An error occurred on the tape
-at block
-.Em bn ;
-status register and controller state is printed in hex and decimal.
-.El
-.Sh SEE ALSO
-.Xr mt 1 ,
-.Xr intro 4 ,
-.Xr mtio 4 ,
-.Xr uba 4
-.Sh HISTORY
-The
-.Nm
-driver appeared in
-.Bx 4.1 .
-A new
-.Nm
-driver showed up in
-.Nx 1.1a .
-.Sh BUGS
-Lots of them.
diff --git a/share/man/man4/man4.vax/uba.4 b/share/man/man4/man4.vax/uba.4
index ab7527cc999..f79132d8c97 100644
--- a/share/man/man4/man4.vax/uba.4
+++ b/share/man/man4/man4.vax/uba.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: uba.4,v 1.13 2008/08/18 23:19:18 miod Exp $
+.\" $OpenBSD: uba.4,v 1.14 2011/07/06 18:32:58 miod Exp $
.\"
.\" Copyright (c) 2003 Jason L. Wright (jason@thought.net)
.\" All rights reserved.
@@ -24,7 +24,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 18 2008 $
+.Dd $Mdocdate: July 6 2011 $
.Dt UBA 4 vax
.Os
.Sh NAME
@@ -53,8 +53,6 @@ DZ-11 multiplexer device interface
UNIBUS MSCP tape controller driver
.It Xr qe 4
DEC DEQNA Q-bus Ethernet device
-.It Xr ts 4
-TS11/TSV05 magtape interface
.It Xr uda 4
UDA50 disk controller interface
.El
diff --git a/sys/arch/vax/bi/bi.c b/sys/arch/vax/bi/bi.c
deleted file mode 100644
index 821b9efe4e2..00000000000
--- a/sys/arch/vax/bi/bi.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* $OpenBSD: bi.c,v 1.8 2008/05/15 22:17:08 brad Exp $ */
-/* $NetBSD: bi.c,v 1.17 2001/11/13 12:51:34 lukem Exp $ */
-/*
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-
-
-/*
- * VAXBI specific routines.
- */
-/*
- * TODO
- * handle BIbus errors more gracefully.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <machine/bus.h>
-#include <machine/cpu.h>
-
-#include <dev/bi/bireg.h>
-#include <dev/bi/bivar.h>
-
-static int bi_print(void *, const char *);
-
-struct bi_list bi_list[] = {
- {BIDT_MS820, DT_HAVDRV, "ms820"},
- {BIDT_DRB32, DT_UNSUPP, "drb32"},
- {BIDT_DWBUA, DT_HAVDRV|DT_ADAPT, "dwbua"},
- {BIDT_KLESI, DT_HAVDRV|DT_ADAPT, "klesi"},
- {BIDT_KA820, DT_HAVDRV, "ka820"},
- {BIDT_DB88, DT_HAVDRV|DT_QUIET, "db88"},
- {BIDT_CIBCA, DT_UNSUPP, "cibca"},
- {BIDT_DMB32, DT_UNSUPP, "dmb32"},
- {BIDT_CIBCI, DT_UNSUPP, "cibci"},
- {BIDT_KA800, DT_UNSUPP, "ka800"},
- {BIDT_KDB50, DT_HAVDRV|DT_VEC, "kdb50"},
- {BIDT_DWMBA, DT_HAVDRV|DT_QUIET, "dwmba"},
- {BIDT_KFBTA, DT_UNSUPP, "kfbta"},
- {BIDT_DEBNK, DT_HAVDRV|DT_VEC, "debnk"},
- {BIDT_DEBNA, DT_HAVDRV|DT_VEC, "debna"},
- {0,0,0}
-};
-
-int
-bi_print(aux, name)
- void *aux;
- const char *name;
-{
- struct bi_attach_args *ba = aux;
- struct bi_list *bl;
- u_int16_t nr;
-
- nr = bus_space_read_2(ba->ba_iot, ba->ba_ioh, 0);
- for (bl = &bi_list[0]; bl->bl_nr; bl++)
- if (bl->bl_nr == nr)
- break;
-
- if (name) {
- if (bl->bl_nr == 0)
- printf("unknown device 0x%x", nr);
- else
- printf(bl->bl_name);
- printf(" at %s", name);
- }
- printf(" node %d", ba->ba_nodenr);
- if (bl->bl_havedriver & DT_VEC)
- printf(" vec %d", ba->ba_ivec & 511);
-#ifdef DEBUG
- if (bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_SADR) &&
- bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_EADR))
- printf(" [sadr %x eadr %x]",
- bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_SADR),
- bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_EADR));
-#endif
- if (bl->bl_havedriver & DT_QUIET)
- printf("\n");
- return bl->bl_havedriver & DT_QUIET ? QUIET :
- bl->bl_havedriver & DT_HAVDRV ? UNCONF : UNSUPP;
-}
-
-void
-bi_attach(sc)
- struct bi_softc *sc;
-{
- struct bi_attach_args ba;
- int nodenr;
-
- printf("\n");
-
- ba.ba_iot = sc->sc_iot;
- ba.ba_busnr = sc->sc_busnr;
- ba.ba_dmat = sc->sc_dmat;
- ba.ba_intcpu = sc->sc_intcpu;
- ba.ba_icookie = sc;
- /*
- * Interrupt numbers. Assign them as described in
- * VAX 8800 system maintenance manual; this means like nexus
- * adapters have them assigned.
- * XXX - must address Unibus adapters.
- */
- for (nodenr = 0; nodenr < NNODEBI; nodenr++) {
- if (bus_space_map(sc->sc_iot, sc->sc_addr + BI_NODE(nodenr),
- BI_NODESIZE, 0, &ba.ba_ioh)) {
- printf("bi_attach: bus_space_map failed, node %d\n",
- nodenr);
- return;
- }
- if (badaddr((caddr_t)ba.ba_ioh, 4) ||
- (bus_space_read_2(ba.ba_iot, ba.ba_ioh, 0) == 0)) {
- bus_space_unmap(ba.ba_iot, ba.ba_ioh, BI_NODESIZE);
- continue;
- }
- ba.ba_nodenr = nodenr;
- ba.ba_ivec = sc->sc_lastiv + 64 + 4 * nodenr; /* all on spl5 */
- config_found(&sc->sc_dev, &ba, bi_print);
- }
-}
diff --git a/sys/arch/vax/bi/bireg.h b/sys/arch/vax/bi/bireg.h
deleted file mode 100644
index c540004b0ae..00000000000
--- a/sys/arch/vax/bi/bireg.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* $OpenBSD: bireg.h,v 1.5 2003/06/02 23:27:56 millert Exp $ */
-/* $NetBSD: bireg.h,v 1.7 2000/07/06 17:47:02 ragge Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)bireg.h 7.3 (Berkeley) 6/28/90
- */
-
-/*
- * VAXBI node definitions.
- */
-
-/*
- * BI node addresses
- */
-#define BI_NODESIZE 0x2000 /* Size of one BI node */
-#define BI_NODE(node) (BI_NODESIZE * (node))
-#define BI_BASE(bi,nod) ((0x20000000 + (bi) * 0x2000000) + BI_NODE(nod))
-#define MAXNBI 16 /* Spec says there can be 16 anyway */
-#define NNODEBI 16 /* 16 nodes per BI */
-
-#define BI_PROBE 0x80000 /* CPU on 8200, NBIA on 8800 */
-/*
- * BI nodes all start with BI interface registers (those on the BIIC chip).
- * These are followed with interface-specific registers.
- *
- * NB: This structure does NOT include the four GPRs (not anymore!)
- *
- * 990712: The structs not used anymore due to conversion to bus.h.
- */
-#ifdef notdef
-struct biiregs {
- u_short bi_dtype; /* device type */
- u_short bi_revs; /* revisions */
- u_long bi_csr; /* control and status register */
- u_long bi_ber; /* bus error register */
- u_long bi_eintrcsr; /* error interrupt control register */
- u_long bi_intrdes; /* interrupt destination register */
- /* the rest are not required for all nodes */
- u_long bi_ipintrmsk; /* IP interrupt mask register */
- u_long bi_fipsdes; /* Force-Bit IPINTR/STOP destination reg */
- u_long bi_ipintrsrc; /* IPINTR source register */
- u_long bi_sadr; /* starting address register */
- u_long bi_eadr; /* ending address register */
- u_long bi_bcicsr; /* BCI control and status register */
- u_long bi_wstat; /* write status register */
- u_long bi_fipscmd; /* Force-Bit IPINTR/STOP command reg */
- u_long bi_xxx1[3]; /* unused */
- u_long bi_uintrcsr; /* user interface interrupt control reg */
- u_long bi_xxx2[43]; /* unused */
-/* although these are on the BIIC, their interpretation varies */
-/* u_long bi_gpr[4]; */ /* general purpose registers */
-};
-
-/*
- * A generic BI node.
- */
-struct bi_node {
- struct biiregs biic; /* interface */
- u_long bi_xxx[1988]; /* pad to 8K */
-};
-
-/*
- * A cpu node.
- */
-struct bi_cpu {
- struct biiregs biic; /* interface chip */
- u_long bi_gpr[4]; /* gprs (unused) */
- u_long bi_sosr; /* slave only status register */
- u_long bi_xxx[63]; /* pad */
- u_long bi_rxcd; /* receive console data register */
-};
-#endif
-
-#define BIREG_DTYPE 0x00
-#define BIREG_VAXBICSR 0x04
-#define BIREG_BER 0x08
-#define BIREG_EINTRCSR 0x0c
-#define BIREG_INTRDES 0x10
-#define BIREG_IPINTRMSK 0x14
-#define BIREG_FIPSDES 0x18
-#define BIREG_IPINTRSRC 0x1c
-#define BIREG_SADR 0x20
-#define BIREG_EADR 0x24
-#define BIREG_BCICSR 0x28
-#define BIREG_WSTAT 0x2c
-#define BIREG_FIPSCMD 0x30
-#define BIREG_UINTRCSR 0x40
-
-/* device types */
-#define BIDT_MS820 0x0001 /* MS820 memory board */
-#define BIDT_DRB32 0x0101 /* DRB32 (MFA) Supercomputer gateway */
-#define BIDT_DWBUA 0x0102 /* DWBUA Unibus adapter */
-#define BIDT_KLESI 0x0103 /* KLESI-B (DWBLA) adapter */
-#define BIDT_HSB70 0x4104 /* HSB70 */
-#define BIDT_KA820 0x0105 /* KA820 cpu */
-#define BIDT_DB88 0x0106 /* DB88 (NBI) adapter */
-#define BIDT_DWMBA 0x2107 /* XMI-BI (XBI) adapter */
-#define BIDT_DWMBB 0x0107 /* XMI-BI (XBI) adapter */
-#define BIDT_CIBCA 0x0108 /* Computer Interconnect adapter */
-#define BIDT_DMB32 0x0109 /* DMB32 (COMB) adapter */
-#define BIDT_BAA 0x010a /* BAA */
-#define BIDT_CIBCI 0x010b /* Computer Interconnect adapter (old) */
-#define BIDT_DEBNT 0x410b /* (AIE_TK70) Ethernet+TK50/TBK70 */
-#define BIDT_KA800 0x010c /* KA800 (ACP) slave processor */
-#define BIDT_KFBTA 0x410d /* RD/RX disk controller */
-#define BIDT_KDB50 0x010e /* KDB50 (BDA) disk controller */
-#define BIDT_DEBNK 0x410e /* (AIE_TK) BI Ethernet (Lance) + TK50 */
-#define BIDT_DEBNA 0x410f /* (AIE) BI Ethernet (Lance) adapter */
-#define BIDT_DEBNI 0x0118 /* (XNA) BI Ethernet adapter */
-
-
-/* bits in bi_csr */
-#define BICSR_IREV(x) ((u_char)((x) >> 24)) /* VAXBI interface rev */
-#define BICSR_TYPE(x) ((u_char)((x) >> 16)) /* BIIC type */
-#define BICSR_HES 0x8000 /* hard error summary */
-#define BICSR_SES 0x4000 /* soft error summary */
-#define BICSR_INIT 0x2000 /* initialise node */
-#define BICSR_BROKE 0x1000 /* broke */
-#define BICSR_STS 0x0800 /* self test status */
-#define BICSR_NRST 0x0400 /* node reset */
-#define BICSR_UWP 0x0100 /* unlock write pending */
-#define BICSR_HEIE 0x0080 /* hard error interrupt enable */
-#define BICSR_SEIE 0x0040 /* soft error interrupt enable */
-#define BICSR_ARB_MASK 0x0030 /* mask to get arbitration codes */
-#define BICSR_ARB_NONE 0x0030 /* no arbitration */
-#define BICSR_ARB_LOG 0x0020 /* low priority */
-#define BICSR_ARB_HIGH 0x0010 /* high priority */
-#define BICSR_ARB_RR 0x0000 /* round robin */
-#define BICSR_NODEMASK 0x000f /* node ID */
-
-#define BICSR_BITS \
-"\20\20HES\17SES\16INIT\15BROKE\14STS\13NRST\11UWP\10HEIE\7SEIE"
-
-/* bits in bi_ber */
-#define BIBER_MBZ 0x8000fff0
-#define BIBER_NMR 0x40000000 /* no ack to multi-responder command */
-#define BIBER_MTCE 0x20000000 /* master transmit check error */
-#define BIBER_CTE 0x10000000 /* control transmit error */
-#define BIBER_MPE 0x08000000 /* master parity error */
-#define BIBER_ISE 0x04000000 /* interlock sequence error */
-#define BIBER_TDF 0x02000000 /* transmitter during fault */
-#define BIBER_IVE 0x01000000 /* ident vector error */
-#define BIBER_CPE 0x00800000 /* command parity error */
-#define BIBER_SPE 0x00400000 /* slave parity error */
-#define BIBER_RDS 0x00200000 /* read data substitute */
-#define BIBER_RTO 0x00100000 /* retry timeout */
-#define BIBER_STO 0x00080000 /* stall timeout */
-#define BIBER_BTO 0x00040000 /* bus timeout */
-#define BIBER_NEX 0x00020000 /* nonexistent address */
-#define BIBER_ICE 0x00010000 /* illegal confirmation error */
-#define BIBER_UPEN 0x00000008 /* user parity enable */
-#define BIBER_IPE 0x00000004 /* ID parity error */
-#define BIBER_CRD 0x00000002 /* corrected read data */
-#define BIBER_NPE 0x00000001 /* null bus parity error */
-#define BIBER_HARD 0x4fff0000
-
-#define BIBER_BITS \
-"\20\37NMR\36MTCE\35CTE\34MPE\33ISE\32TDF\31IVE\30CPE\
-\27SPE\26RDS\25RTO\24STO\23BTO\22NEX\21ICE\4UPEN\3IPE\2CRD\1NPE"
-
-/* bits in bi_eintrcsr */
-#define BIEIC_INTRAB 0x01000000 /* interrupt abort */
-#define BIEIC_INTRC 0x00800000 /* interrupt complete */
-#define BIEIC_INTRSENT 0x00200000 /* interrupt command sent */
-#define BIEIC_INTRFORCE 0x00100000 /* interrupt force */
-#define BIEIC_LEVELMASK 0x000f0000 /* mask for interrupt levels */
-#define BIEIC_IPL17 0x00080000 /* ipl 0x17 */
-#define BIEIC_IPL16 0x00040000 /* ipl 0x16 */
-#define BIEIC_IPL15 0x00020000 /* ipl 0x15 */
-#define BIEIC_IPL14 0x00010000 /* ipl 0x14 */
-#define BIEIC_VECMASK 0x00003ffc /* vector mask for error intr */
-
-/* bits in bi_intrdes */
-#define BIDEST_MASK 0x0000ffff /* one bit per node to be intr'ed */
-
-/* bits in bi_ipintrmsk */
-#define BIIPINTR_MASK 0xffff0000 /* one per node to allow to ipintr */
-
-/* bits in bi_fipsdes */
-#define BIFIPSD_MASK 0x0000ffff
-
-/* bits in bi_ipintrsrc */
-#define BIIPSRC_MASK 0xffff0000
-
-/* sadr and eadr are simple addresses */
-
-/* bits in bi_bcicsr */
-#define BCI_BURSTEN 0x00020000 /* burst mode enable */
-#define BCI_IPSTOP_FRC 0x00010000 /* ipintr/stop force */
-#define BCI_MCASTEN 0x00008000 /* multicast space enable */
-#define BCI_BCASTEN 0x00004000 /* broadcast enable */
-#define BCI_STOPEN 0x00002000 /* stop enable */
-#define BCI_RSRVDEN 0x00001000 /* reserved enable */
-#define BCI_IDENTEN 0x00000800 /* ident enable */
-#define BCI_INVALEN 0x00000400 /* inval enable */
-#define BCI_WINVEN 0x00000200 /* write invalidate enable */
-#define BCI_UINTEN 0x00000100 /* user interface csr space enable */
-#define BCI_BIICEN 0x00000080 /* BIIC csr space enable */
-#define BCI_INTEN 0x00000040 /* interrupt enable */
-#define BCI_IPINTEN 0x00000020 /* ipintr enable */
-#define BCI_PIPEEN 0x00000010 /* pipeline NXT enable */
-#define BCI_RTOEVEN 0x00000008 /* read timeout EV enable */
-
-#define BCI_BITS \
-"\20\22BURSTEN\21IPSTOP_FRC\20MCASTEN\
-\17BCASTEN\16STOPEN\15RSRVDEN\14IDENTEN\13INVALEN\12WINVEN\11UINTEN\
-\10BIICEN\7INTEN\6IPINTEN\5PIPEEN\4RTOEVEN"
-
-/* bits in bi_wstat */
-#define BIW_GPR3 0x80000000 /* gpr 3 was written */
-#define BIW_GPR2 0x40000000 /* gpr 2 was written */
-#define BIW_GPR1 0x20000000 /* gpr 1 was written */
-#define BIW_GPR0 0x10000000 /* gpr 0 was written */
-
-/* bits in force-bit ipintr/stop command register */
-#define BIFIPSC_CMDMASK 0x0000f000 /* command */
-#define BIFIPSC_MIDEN 0x00000800 /* master ID enable */
-
-/* bits in bi_uintcsr */
-#define BIUI_INTAB 0xf0000000 /* interrupt abort level */
-#define BIUI_INTC 0x0f000000 /* interrupt complete bits */
-#define BIUI_SENT 0x00f00000 /* interrupt sent bits */
-#define BIUI_FORCE 0x000f0000 /* force interrupt level */
-#define BIUI_EVECEN 0x00008000 /* external vector enable */
-#define BIUI_VEC 0x00003ffc /* interrupt vector */
-
-/* tell if a bi device is a slave (hence has SOSR) */
-#define BIDT_ISSLAVE(x) (((x) & 0x7f00) == 0)
-
-/* bits in bi_sosr */
-#define BISOSR_MEMSIZE 0x1ffc0000 /* memory size */
-#define BISOSR_BROKE 0x00001000 /* broke */
-
-/* bits in bi_rxcd */
-#define BIRXCD_BUSY2 0x80000000 /* busy 2 */
-#define BIRXCD_NODE2 0x0f000000 /* node id 2 */
-#define BIRXCD_CHAR2 0x00ff0000 /* character 2 */
-#define BIRXCD_BUSY1 0x00008000 /* busy 1 */
-#define BIRXCD_NODE1 0x00000f00 /* node id 1 */
-#define BIRXCD_CHAR1 0x000000ff /* character 1 */
diff --git a/sys/arch/vax/bi/bivar.h b/sys/arch/vax/bi/bivar.h
deleted file mode 100644
index 06ce7375958..00000000000
--- a/sys/arch/vax/bi/bivar.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $OpenBSD: bivar.h,v 1.7 2007/05/10 17:59:26 deraadt Exp $ */
-/* $NetBSD: bivar.h,v 1.8 2000/07/26 12:41:40 ragge Exp $ */
-/*
- * Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-
-
-/*
- * per-BI-adapter state.
- */
-struct bi_softc {
- struct device sc_dev;
- bus_space_tag_t sc_iot; /* Space tag for the BI bus */
- bus_dma_tag_t sc_dmat;
- bus_addr_t sc_addr; /* Address base address for this bus */
- int sc_busnr; /* (Physical) number of this bus */
- int sc_lastiv; /* last available interrupt vector */
- int sc_intcpu;
-};
-
-/*
- * Struct used for autoconfiguration; attaching of BI nodes.
- */
-struct bi_attach_args {
- bus_space_tag_t ba_iot;
- bus_space_handle_t ba_ioh; /* Base address for this node */
- bus_dma_tag_t ba_dmat;
- int ba_busnr;
- int ba_nodenr;
- int ba_intcpu; /* Mask of which cpus to interrupt */
- int ba_ivec; /* Interrupt vector to use */
- void *ba_icookie;
-};
-
-/*
- * BI node list.
- */
-struct bi_list {
- u_short bl_nr; /* Unit ID# */
- u_short bl_havedriver; /* Have device driver (informal) */
- char *bl_name; /* DEC name */
-};
-
-/* bl_havedriver field meaning */
-#define DT_UNSUPP 0 /* pseudo define */
-#define DT_HAVDRV 1 /* device have driver */
-#define DT_ADAPT 2 /* is an adapter */
-#define DT_QUIET 4 /* don't complain when not conf'ed */
-#define DT_VEC 8 /* uses a interrupt vector */
-
-/* Prototype */
-void bi_attach (struct bi_softc *);
-void bi_intr_establish (void *, int, void (*)(void *), void *);
diff --git a/sys/arch/vax/bi/if_ni.c b/sys/arch/vax/bi/if_ni.c
deleted file mode 100644
index 88e25152930..00000000000
--- a/sys/arch/vax/bi/if_ni.c
+++ /dev/null
@@ -1,864 +0,0 @@
-/* $OpenBSD: if_ni.c,v 1.15 2010/09/20 07:40:41 deraadt Exp $ */
-/* $NetBSD: if_ni.c,v 1.15 2002/05/22 16:03:14 wiz Exp $ */
-/*
- * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Driver for DEBNA/DEBNT/DEBNK ethernet cards.
- * Things that is still to do:
- * Collect statistics.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/sched.h>
-
-#include <net/if.h>
-#include <net/if_ether.h>
-#include <net/if_dl.h>
-
-#include <netinet/in.h>
-#include <netinet/if_inarp.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#include <net/bpfdesc.h>
-#endif
-
-#include <machine/bus.h>
-#ifdef __vax__
-#include <machine/mtpr.h>
-#include <machine/pte.h>
-#endif
-
-#include <dev/bi/bireg.h>
-#include <dev/bi/bivar.h>
-
-/*
- * Tunable buffer parameters. Good idea to have them as power of 8; then
- * they will fit into a logical VAX page.
- */
-#define NMSGBUF 8 /* Message queue entries */
-#define NTXBUF 16 /* Transmit queue entries */
-#define NTXFRAGS 8 /* Number of transmit buffer fragments */
-#define NRXBUF 24 /* Receive queue entries */
-#define NBDESCS (NTXBUF * NTXFRAGS + NRXBUF)
-#define NQUEUES 3 /* RX + TX + MSG */
-#define PKTHDR 18 /* Length of (control) packet header */
-#define RXADD 18 /* Additional length of receive datagram */
-#define TXADD (10+NTXFRAGS*8) /* "" transmit "" */
-#define MSGADD 134 /* "" message "" */
-
-#include <dev/bi/if_nireg.h> /* XXX include earlier */
-
-/*
- * Macros for (most cases of) insqti/remqhi.
- * Retry NRETRIES times to do the operation, if it still fails assume
- * a lost lock and panic.
- */
-#define NRETRIES 100
-#define INSQTI(e, h) ({ \
- int ret, i; \
- for (i = 0; i < NRETRIES; i++) { \
- if ((ret = insqti(e, h)) != ILCK_FAILED) \
- break; \
- } \
- if (i == NRETRIES) \
- panic("ni: insqti failed at %d", __LINE__); \
- ret; \
-})
-#define REMQHI(h) ({ \
- int i;void *ret; \
- for (i = 0; i < NRETRIES; i++) { \
- if ((ret = remqhi(h)) != (void *)ILCK_FAILED) \
- break; \
- } \
- if (i == NRETRIES) \
- panic("ni: remqhi failed at %d", __LINE__); \
- ret; \
-})
-
-
-#define nipqb (&sc->sc_gvppqb->nc_pqb)
-#define gvp sc->sc_gvppqb
-#define fqb sc->sc_fqb
-#define bbd sc->sc_bbd
-
-struct ni_softc {
- struct device sc_dev; /* Configuration common part */
- struct ethercom sc_ec; /* Ethernet common part */
-#define sc_if sc_ec.ec_if /* network-visible interface */
- bus_space_tag_t sc_iot;
- bus_addr_t sc_ioh;
- bus_dma_tag_t sc_dmat;
- struct ni_gvppqb *sc_gvppqb; /* Port queue block */
- struct ni_gvppqb *sc_pgvppqb; /* Phys address of PQB */
- struct ni_fqb *sc_fqb; /* Free Queue block */
- struct ni_bbd *sc_bbd; /* Buffer descriptors */
- u_int8_t sc_enaddr[ETHER_ADDR_LEN];
-};
-
-static int nimatch(struct device *, struct cfdata *, void *);
-static void niattach(struct device *, struct device *, void *);
-static void niinit(struct ni_softc *);
-static void nistart(struct ifnet *);
-static void niintr(void *);
-static int niioctl(struct ifnet *, u_long, caddr_t);
-static int ni_add_rxbuf(struct ni_softc *, struct ni_dg *, int);
-static void ni_setup(struct ni_softc *);
-static void nitimeout(struct ifnet *);
-static void ni_getpgs(struct ni_softc *sc, int size, caddr_t *v, paddr_t *p);
-static int failtest(struct ni_softc *, int, int, int, char *);
-
-volatile int endwait, retry; /* Used during autoconfig */
-
-struct cfattach ni_ca = {
- sizeof(struct ni_softc), nimatch, niattach
-};
-
-#define NI_WREG(csr, val) \
- bus_space_write_4(sc->sc_iot, sc->sc_ioh, csr, val)
-#define NI_RREG(csr) \
- bus_space_read_4(sc->sc_iot, sc->sc_ioh, csr)
-
-#define WAITREG(csr,val) while (NI_RREG(csr) & val);
-/*
- * Check for present device.
- */
-int
-nimatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct bi_attach_args *ba = aux;
- u_short type;
-
- type = bus_space_read_2(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE);
- if (type != BIDT_DEBNA && type != BIDT_DEBNT && type != BIDT_DEBNK)
- return 0;
-
- if (cf->cf_loc[BICF_NODE] != BICF_NODE_DEFAULT &&
- cf->cf_loc[BICF_NODE] != ba->ba_nodenr)
- return 0;
-
- return 1;
-}
-
-/*
- * Allocate a bunch of descriptor-safe memory.
- * We need to get the structures from the beginning of its own pages.
- */
-static void
-ni_getpgs(struct ni_softc *sc, int size, caddr_t *v, paddr_t *p)
-{
- bus_dma_segment_t seg;
- int nsegs, error;
-
- if ((error = bus_dmamem_alloc(sc->sc_dmat, size, NBPG, 0, &seg, 1,
- &nsegs, BUS_DMA_NOWAIT)) != 0)
- panic(" can't allocate memory: error %d", error);
-
- if ((error = bus_dmamem_map(sc->sc_dmat, &seg, nsegs, size, v,
- BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0)
- panic(" can't map mem space: error %d", error);
-
- if (p)
- *p = seg.ds_addr;
- memset(*v, 0, size);
-}
-
-static int
-failtest(struct ni_softc *sc, int reg, int mask, int test, char *str)
-{
- int i = 100;
-
- do {
- DELAY(100000);
- } while (((NI_RREG(reg) & mask) != test) && --i);
-
- if (i == 0) {
- printf("%s: %s\n", sc->sc_dev.dv_xname, str);
- return 1;
- }
- return 0;
-}
-
-
-/*
- * Interface exists: make available by filling in network interface
- * record. System will initialize the interface when it is ready
- * to accept packets.
- */
-void
-niattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct bi_attach_args *ba = aux;
- struct ni_softc *sc = (struct ni_softc *)self;
- struct ifnet *ifp = (struct ifnet *)&sc->sc_if;
- struct ni_msg *msg;
- struct ni_ptdb *ptdb;
- caddr_t va;
- int i, j, s, res;
- u_short type;
-
- type = bus_space_read_2(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE);
- printf(": DEBN%c\n", type == BIDT_DEBNA ? 'A' : type == BIDT_DEBNT ?
- 'T' : 'K');
- sc->sc_iot = ba->ba_iot;
- sc->sc_ioh = ba->ba_ioh;
- sc->sc_dmat = ba->ba_dmat;
-
- bi_intr_establish(ba->ba_icookie, ba->ba_ivec, niintr, sc);
-
- ni_getpgs(sc, sizeof(struct ni_gvppqb), (caddr_t *)&sc->sc_gvppqb,
- (paddr_t *)&sc->sc_pgvppqb);
- ni_getpgs(sc, sizeof(struct ni_fqb), (caddr_t *)&sc->sc_fqb, 0);
- ni_getpgs(sc, NBDESCS * sizeof(struct ni_bbd),
- (caddr_t *)&sc->sc_bbd, 0);
- /*
- * Zero the newly allocated memory.
- */
-
- nipqb->np_veclvl = (ba->ba_ivec << 2) + 2;
- nipqb->np_node = ba->ba_intcpu;
- nipqb->np_vpqb = (u_int32_t)gvp;
-#ifdef __vax__
- nipqb->np_spt = nipqb->np_gpt = mfpr(PR_SBR);
- nipqb->np_sptlen = nipqb->np_gptlen = mfpr(PR_SLR);
-#else
-#error Must fix support for non-vax.
-#endif
- nipqb->np_bvplvl = 1;
- nipqb->np_vfqb = (u_int32_t)fqb;
- nipqb->np_vbdt = (u_int32_t)bbd;
- nipqb->np_nbdr = NBDESCS;
-
- /* Free queue block */
- nipqb->np_freeq = NQUEUES;
- fqb->nf_mlen = PKTHDR+MSGADD;
- fqb->nf_dlen = PKTHDR+TXADD;
- fqb->nf_rlen = PKTHDR+RXADD;
-
- strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, sizeof ifp->if_xname);
- ifp->if_softc = sc;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_start = nistart;
- ifp->if_ioctl = niioctl;
- ifp->if_watchdog = nitimeout;
- IFQ_SET_READY(&ifp->if_snd);
-
- /*
- * Start init sequence.
- */
-
- /* Reset the node */
- NI_WREG(BIREG_VAXBICSR, NI_RREG(BIREG_VAXBICSR) | BICSR_NRST);
- DELAY(500000);
- i = 20;
- while ((NI_RREG(BIREG_VAXBICSR) & BICSR_BROKE) && --i)
- DELAY(500000);
- if (i == 0) {
- printf("%s: BROKE bit set after reset\n", sc->sc_dev.dv_xname);
- return;
- }
-
- /* Check state */
- if (failtest(sc, NI_PSR, PSR_STATE, PSR_UNDEF, "not undefined state"))
- return;
-
- /* Clear owner bits */
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
- NI_WREG(NI_PCR, NI_RREG(NI_PCR) & ~PCR_OWN);
-
- /* kick off init */
- NI_WREG(NI_PCR, (u_int32_t)sc->sc_pgvppqb | PCR_INIT | PCR_OWN);
- while (NI_RREG(NI_PCR) & PCR_OWN)
- DELAY(100000);
-
- /* Check state */
- if (failtest(sc, NI_PSR, PSR_INITED, PSR_INITED, "failed initialize"))
- return;
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
-
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_ENABLE);
- WAITREG(NI_PCR, PCR_OWN);
- WAITREG(NI_PSR, PSR_OWN);
-
- /* Check state */
- if (failtest(sc, NI_PSR, PSR_STATE, PSR_ENABLED, "failed enable"))
- return;
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
-
- /*
- * The message queue packets must be located on the beginning
- * of a page. A VAX page is 512 bytes, but it clusters 8 pages.
- * This knowledge is used here when allocating pages.
- * !!! How should this be done on MIPS and Alpha??? !!!
- */
-#if NBPG < 4096
-#error pagesize too small
-#endif
- s = splvm();
- /* Set up message free queue */
- ni_getpgs(sc, NMSGBUF * 512, &va, 0);
- for (i = 0; i < NMSGBUF; i++) {
- struct ni_msg *msg;
-
- msg = (void *)(va + i * 512);
-
- res = INSQTI(msg, &fqb->nf_mforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
- /* Set up xmit queue */
- ni_getpgs(sc, NTXBUF * 512, &va, 0);
- for (i = 0; i < NTXBUF; i++) {
- struct ni_dg *data;
-
- data = (void *)(va + i * 512);
- data->nd_status = 0;
- data->nd_len = TXADD;
- data->nd_ptdbidx = 1;
- data->nd_opcode = BVP_DGRAM;
- for (j = 0; j < NTXFRAGS; j++) {
- data->bufs[j]._offset = 0;
- data->bufs[j]._key = 1;
- bbd[i * NTXFRAGS + j].nb_key = 1;
- bbd[i * NTXFRAGS + j].nb_status = 0;
- data->bufs[j]._index = i * NTXFRAGS + j;
- }
- res = INSQTI(data, &fqb->nf_dforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
- /* recv buffers */
- ni_getpgs(sc, NRXBUF * 512, &va, 0);
- for (i = 0; i < NRXBUF; i++) {
- struct ni_dg *data;
- int idx;
-
- data = (void *)(va + i * 512);
- data->nd_len = RXADD;
- data->nd_opcode = BVP_DGRAMRX;
- data->nd_ptdbidx = 2;
- data->bufs[0]._key = 1;
-
- idx = NTXBUF * NTXFRAGS + i;
- if (ni_add_rxbuf(sc, data, idx))
- panic("niattach: ni_add_rxbuf: out of mbufs");
-
- res = INSQTI(data, &fqb->nf_rforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
- splx(s);
-
- /* Set initial parameters */
- msg = REMQHI(&fqb->nf_mforw);
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = sizeof(struct ni_param) + 6;
- msg->nm_opcode2 = NI_WPARAM;
- ((struct ni_param *)&msg->nm_text[0])->np_flags = NP_PAD;
-
- endwait = retry = 0;
- res = INSQTI(msg, &gvp->nc_forw0);
-
-retry: WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
- i = 1000;
- while (endwait == 0 && --i)
- DELAY(10000);
-
- if (endwait == 0) {
- if (++retry < 3)
- goto retry;
- printf("%s: no response to set params\n", sc->sc_dev.dv_xname);
- return;
- }
-
- /* Clear counters */
- msg = REMQHI(&fqb->nf_mforw);
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = sizeof(struct ni_param) + 6;
- msg->nm_opcode2 = NI_RCCNTR;
-
- res = INSQTI(msg, &gvp->nc_forw0);
-
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
- /* Enable transmit logic */
- msg = REMQHI(&fqb->nf_mforw);
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = 18;
- msg->nm_opcode2 = NI_STPTDB;
- ptdb = (struct ni_ptdb *)&msg->nm_text[0];
- memset(ptdb, 0, sizeof(struct ni_ptdb));
- ptdb->np_index = 1;
- ptdb->np_fque = 1;
-
- res = INSQTI(msg, &gvp->nc_forw0);
-
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
- /* Wait for everything to finish */
- WAITREG(NI_PSR, PSR_OWN);
-
- printf("%s: address %s\n", sc->sc_dev.dv_xname,
- ether_sprintf(sc->sc_enaddr));
-
- /*
- * Attach the interface.
- */
- if_attach(ifp);
- ether_ifattach(ifp, sc->sc_enaddr);
-}
-
-/*
- * Initialization of interface.
- */
-void
-niinit(sc)
- struct ni_softc *sc;
-{
- struct ifnet *ifp = (struct ifnet *)&sc->sc_if;
-
- /*
- * Set flags (so ni_setup() do the right thing).
- */
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- /*
- * Send setup messages so that the rx/tx locic starts.
- */
- ni_setup(sc);
-
-}
-
-/*
- * Start output on interface.
- */
-void
-nistart(ifp)
- struct ifnet *ifp;
-{
- struct ni_softc *sc = ifp->if_softc;
- struct ni_dg *data;
- struct ni_bbd *bdp;
- struct mbuf *m, *m0;
- int i, cnt, res, mlen;
-
- if (ifp->if_flags & IFF_OACTIVE)
- return;
-#ifdef DEBUG
- if (ifp->if_flags & IFF_DEBUG)
- printf("%s: nistart\n", sc->sc_dev.dv_xname);
-#endif
-
- while (fqb->nf_dforw) {
- IFQ_POLL(&ifp->if_snd, m);
- if (m == 0)
- break;
-
- data = REMQHI(&fqb->nf_dforw);
- if ((int)data == Q_EMPTY) {
- ifp->if_flags |= IFF_OACTIVE;
- break;
- }
-
- IFQ_DEQUEUE(&ifp->if_snd, m);
-
- /*
- * Count number of mbufs in chain.
- * Always do DMA directly from mbufs, therefore the transmit
- * ring is really big.
- */
- for (m0 = m, cnt = 0; m0; m0 = m0->m_next)
- if (m0->m_len)
- cnt++;
- if (cnt > NTXFRAGS)
- panic("nistart"); /* XXX */
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
-#endif
- bdp = &bbd[(data->bufs[0]._index & 0x7fff)];
- for (m0 = m, i = 0, mlen = 0; m0; m0 = m0->m_next) {
- if (m0->m_len == 0)
- continue;
- bdp->nb_status = (mtod(m0, u_int32_t) & NIBD_OFFSET) |
- NIBD_VALID;
- bdp->nb_pte = (u_int32_t)kvtopte(mtod(m0, void *));
- bdp->nb_len = m0->m_len;
- data->bufs[i]._offset = 0;
- data->bufs[i]._len = bdp->nb_len;
- data->bufs[i]._index |= NIDG_CHAIN;
- mlen += bdp->nb_len;
- bdp++;
- i++;
- }
- data->nd_opcode = BVP_DGRAM;
- data->nd_pad3 = 1;
- data->nd_ptdbidx = 1;
- data->nd_len = 10 + i * 8;
- data->bufs[i - 1]._index &= ~NIDG_CHAIN;
- if (mlen < 64)
- data->bufs[i - 1]._len = bdp[-1].nb_len += (64 - mlen);
- data->nd_cmdref = (u_int32_t)m;
-#ifdef DEBUG
- if (ifp->if_flags & IFF_DEBUG)
- printf("%s: sending %d bytes (%d segments)\n",
- sc->sc_dev.dv_xname, mlen, i);
-#endif
-
- res = INSQTI(data, &gvp->nc_forw0);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- }
- }
-}
-
-void
-niintr(void *arg)
-{
- struct ni_softc *sc = arg;
- struct ni_dg *data;
- struct ni_msg *msg;
- struct ifnet *ifp = &sc->sc_if;
- struct ni_bbd *bd;
- struct mbuf *m;
- int idx, res;
-
- if ((NI_RREG(NI_PSR) & PSR_STATE) != PSR_ENABLED)
- return;
-
- if ((NI_RREG(NI_PSR) & PSR_ERR))
- printf("%s: PSR %x\n", sc->sc_dev.dv_xname, NI_RREG(NI_PSR));
-
- KERNEL_LOCK();
- /* Got any response packets? */
- while ((NI_RREG(NI_PSR) & PSR_RSQ) && (data = REMQHI(&gvp->nc_forwr))) {
-
- switch (data->nd_opcode) {
- case BVP_DGRAMRX: /* Receive datagram */
- idx = data->bufs[0]._index;
- bd = &bbd[idx];
- m = (void *)data->nd_cmdref;
- m->m_pkthdr.len = m->m_len =
- data->bufs[0]._len - ETHER_CRC_LEN;
- m->m_pkthdr.rcvif = ifp;
- if (ni_add_rxbuf(sc, data, idx)) {
- bd->nb_len = (m->m_ext.ext_size - 2);
- bd->nb_pte =
- (long)kvtopte(m->m_ext.ext_buf);
- bd->nb_status = 2 | NIBD_VALID;
- bd->nb_key = 1;
- }
- data->nd_len = RXADD;
- data->nd_status = 0;
- res = INSQTI(data, &fqb->nf_rforw);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
- }
- if (m == (void *)data->nd_cmdref)
- break; /* Out of mbufs */
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
- (*ifp->if_input)(ifp, m);
- break;
-
- case BVP_DGRAM:
- m = (struct mbuf *)data->nd_cmdref;
- ifp->if_flags &= ~IFF_OACTIVE;
- m_freem(m);
- res = INSQTI(data, &fqb->nf_dforw);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
- }
- break;
-
- case BVP_MSGRX:
- msg = (struct ni_msg *)data;
- switch (msg->nm_opcode2) {
- case NI_WPARAM:
- memcpy(sc->sc_enaddr, ((struct ni_param *)&msg->nm_text[0])->np_dpa, ETHER_ADDR_LEN);
- endwait = 1;
- break;
-
- case NI_RCCNTR:
- case NI_CLPTDB:
- case NI_STPTDB:
- break;
-
- default:
- printf("Unkn resp %d\n",
- msg->nm_opcode2);
- break;
- }
- res = INSQTI(data, &fqb->nf_mforw);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- }
- break;
-
- default:
- printf("Unknown opcode %d\n", data->nd_opcode);
- res = INSQTI(data, &fqb->nf_mforw);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- }
- }
- }
-
- /* Try to kick on the start routine again */
- nistart(ifp);
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~(PSR_OWN|PSR_RSQ));
- KERNEL_UNLOCK();
-}
-
-/*
- * Process an ioctl request.
- */
-int
-niioctl(ifp, cmd, data)
- register struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
-{
- struct ni_softc *sc = ifp->if_softc;
- struct ifaddr *ifa = (struct ifaddr *)data;
- int s, error = 0;
-
- s = splnet();
-
- switch (cmd) {
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
- switch(ifa->ifa_addr->sa_family) {
-#ifdef INET
- case AF_INET:
- niinit(sc);
- arp_ifinit(ifp, ifa);
- break;
-#endif
- }
- break;
-
- case SIOCSIFFLAGS:
- if ((ifp->if_flags & IFF_UP) == 0 &&
- (ifp->if_flags & IFF_RUNNING) != 0) {
- /*
- * If interface is marked down and it is running,
- * stop it.
- */
- ifp->if_flags &= ~IFF_RUNNING;
- ni_setup(sc);
- } else if ((ifp->if_flags & IFF_UP) != 0 &&
- (ifp->if_flags & IFF_RUNNING) == 0) {
- /*
- * If interface it marked up and it is stopped, then
- * start it.
- */
- niinit(sc);
- } else if ((ifp->if_flags & IFF_UP) != 0) {
- /*
- * Send a new setup packet to match any new changes.
- * (Like IFF_PROMISC etc)
- */
- ni_setup(sc);
- }
- break;
-
- default:
- error = ether_ioctl(ifp, &sc->sc_ec, cmd, data);
- }
-
- if (error == ENETRESET) {
- if (ifp->if_flags & IFF_RUNNING)
- ni_setup(sc);
- error = 0;
- }
-
- splx(s);
- return (error);
-}
-
-/*
- * Add a receive buffer to the indicated descriptor.
- */
-int
-ni_add_rxbuf(struct ni_softc *sc, struct ni_dg *data, int idx)
-{
- struct ni_bbd *bd = &bbd[idx];
- struct mbuf *m;
-
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
- return (ENOBUFS);
-
- MCLGET(m, M_DONTWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- return (ENOBUFS);
- }
-
- m->m_data += 2;
- bd->nb_len = (m->m_ext.ext_size - 2);
- bd->nb_pte = (long)kvtopte(m->m_ext.ext_buf);
- bd->nb_status = 2 | NIBD_VALID;
- bd->nb_key = 1;
-
- data->bufs[0]._offset = 0;
- data->bufs[0]._len = bd->nb_len;
- data->bufs[0]._index = idx;
- data->nd_cmdref = (long)m;
-
- return (0);
-}
-
-/*
- * Create setup packet and put in queue for sending.
- */
-void
-ni_setup(struct ni_softc *sc)
-{
- struct ifnet *ifp = &sc->sc_if;
- struct ni_msg *msg;
- struct ni_ptdb *ptdb;
- struct ether_multi *enm;
- struct ether_multistep step;
- int i, res;
-
- msg = REMQHI(&fqb->nf_mforw);
- if ((int)msg == Q_EMPTY)
- return; /* What to do? */
-
- ptdb = (struct ni_ptdb *)&msg->nm_text[0];
- memset(ptdb, 0, sizeof(struct ni_ptdb));
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_len = 18;
- ptdb->np_index = 2; /* definition type index */
- ptdb->np_fque = 2; /* Free queue */
- if (ifp->if_flags & IFF_RUNNING) {
- msg->nm_opcode2 = NI_STPTDB;
- ptdb->np_type = ETHERTYPE_IP;
- ptdb->np_flags = PTDB_UNKN|PTDB_BDC;
- if (ifp->if_flags & IFF_PROMISC)
- ptdb->np_flags |= PTDB_PROMISC;
- memset(ptdb->np_mcast[0], 0xff, ETHER_ADDR_LEN); /* Broadcast */
- ptdb->np_adrlen = 1;
- msg->nm_len += 8;
- ifp->if_flags &= ~IFF_ALLMULTI;
- if ((ifp->if_flags & IFF_PROMISC) == 0) {
- ETHER_FIRST_MULTI(step, &sc->sc_ec, enm);
- i = 1;
- while (enm != NULL) {
- if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6)) {
- ifp->if_flags |= IFF_ALLMULTI;
- ptdb->np_flags |= PTDB_AMC;
- break;
- }
- msg->nm_len += 8;
- ptdb->np_adrlen++;
- memcpy(ptdb->np_mcast[i++], enm->enm_addrlo,
- ETHER_ADDR_LEN);
- ETHER_NEXT_MULTI(step, enm);
- }
- }
- } else
- msg->nm_opcode2 = NI_CLPTDB;
-
- res = INSQTI(msg, &gvp->nc_forw0);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- }
-}
-
-/*
- * Check for dead transmit logic. Not uncommon.
- */
-void
-nitimeout(ifp)
- struct ifnet *ifp;
-{
-#if 0
- struct ni_softc *sc = ifp->if_softc;
-
- if (sc->sc_inq == 0)
- return;
-
- printf("%s: xmit logic died, resetting...\n", sc->sc_dev.dv_xname);
- /*
- * Do a reset of interface, to get it going again.
- * Will it work by just restart the transmit logic?
- */
- niinit(sc);
-#endif
-}
diff --git a/sys/arch/vax/bi/if_nireg.h b/sys/arch/vax/bi/if_nireg.h
deleted file mode 100644
index 42abf1aa728..00000000000
--- a/sys/arch/vax/bi/if_nireg.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/* $OpenBSD: if_nireg.h,v 1.2 2003/06/02 23:27:56 millert Exp $ */
-/* $NetBSD: if_nireg.h,v 1.3 2001/08/20 12:20:07 wiz Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)nireg.h 7.3 (Berkeley) 6/28/90
- */
-
-/*
- * Registers for the DEBNA and DEBNK Ethernet interfaces
- * (DEC calls these Network Interfaces, hence nireg.h)
- */
-
-/*
- * this seems to be intended to be more general, but I have no details,
- * so it goes here for now
- *
- * BI Vax Port (BVP) stuff first:
- */
-#ifdef notdef
-struct bvpregs {
- u_long p_pcr; /* port control register */
- u_long p_psr; /* port status register */
- u_long p_per; /* port error register */
- u_long p_pdr; /* port data register */
-};
-
-/*
- * BI node space registers
- */
-struct ni_regs {
- struct biiregs ni_bi; /* BIIC registers, except GPRs */
- struct bvpregs ni_tkp; /* tk50 port control via BIIC GPRs */
- u_long ni_xxx[64]; /* unused */
- u_long ni_rxcd; /* receive console data */
- struct bvpregs ni_nip; /* NI port control via BCI3 GPRs */
- u_long ni_pudr; /* power-up diagnostic register */
-};
-#endif
-
-#define NI_PCR 0x204
-#define NI_PSR 0x208
-#define NI_PER 0x20c
-#define NI_PDR 0x210
-#define NI_PUDR 0x204
-
-/* bits in PCR */
-#define PCR_OWN 0x80
-#define PCR_MFREEQ 0x000
-#define PCR_DFREEQ 0x100
-#define PCR_RFREEQ 0x200
-#define PCR_IFREEQ 0x300
-#define PCR_CMDQ0 PCR_MFREEQ
-#define PCR_CMDQ1 PCR_DFREEQ
-#define PCR_CMDQ2 PCR_RFREEQ
-#define PCR_CMDQ3 PCR_IFREEQ
-#define PCR_RESTART 11
-#define PCR_FREEQNE 7
-#define PCR_CMDQNE 6
-#define PCR_SHUTDOWN 4
-#define PCR_ENABLE 2
-#define PCR_INIT 1
-
-/* bits in PSR */
-#define PSR_OWN 0x80000000
-#define PSR_STATE 0x00070000
-#define PSR_STOPPED 0x00060000
-#define PSR_ENABLED 0x00040000
-#define PSR_INITED 0x00020000
-#define PSR_UNDEF 0x00010000
-#define PSR_RSQ 0x00000080
-#define PSR_ERR 0x00000040
-
-/*
- * The DEBNx uses a very weird (set of) structure(s) to communicate
- * with something as simple as an ethernet controller. This is not
- * very different to the way communication is done over CI with disks.
- */
-
-/* Message packet */
-struct ni_msg {
- u_int32_t nm_forw;
- u_int32_t nm_back;
- u_int32_t nm_pad1;
- u_int8_t nm_pad2;
- u_int8_t nm_status;
- u_int8_t nm_opcode;
- u_int8_t nm_pad3;
- u_int16_t nm_len;
- u_int8_t nm_opcode2;
- u_int8_t nm_status2;
- u_int32_t nm_pad4;
- u_int8_t nm_text[128];
-};
-
-/* Datagram packet */
-struct ni_dg {
- u_int32_t nd_forw;
- u_int32_t nd_back;
- u_int32_t nd_pad1;
- u_int8_t nd_pad2;
- u_int8_t nd_status;
- u_int8_t nd_opcode;
- u_int8_t nd_pad3;
- u_int16_t nd_len;
- u_int16_t nd_status2;
- u_int32_t nd_cmdref;
- u_int32_t nd_ptdbidx;
- struct {
- u_int16_t _offset;
- u_int16_t _len;
- u_int16_t _index;
- u_int16_t _key;
- } bufs[NTXFRAGS];
-};
-
-#define NIDG_CHAIN 0x8000
-
-/* NI parameter block */
-struct ni_param {
- u_int8_t np_dpa[8];
- u_int8_t np_apa[8];
- u_int8_t np_lsa[8];
- u_int8_t np_bvc[8];
- u_int16_t np_curaddr;
- u_int16_t np_maxaddr;
- u_int16_t np_curptt;
- u_int16_t np_maxptt;
- u_int16_t np_curfq;
- u_int16_t np_maxfq;
- u_int32_t np_sid;
- u_int32_t np_mop;
- u_int32_t np_flags;
- u_int32_t np_rcto;
- u_int32_t np_xmto;
-};
-
-#define NP_ECT 0x01
-#define NP_PAD 0x02
-#define NP_BOO 0x04
-#define NP_CAR 0x08
-#define NP_ILP 0x10
-#define NP_ELP 0x20
-#define NP_DCRC 0x40
-#define NP_THRU 0x80
-
-/* Protocol type definition block */
-struct ni_ptdb {
- u_int16_t np_type; /* Protocol type */
- u_int8_t np_fque; /* Free queue */
- u_int8_t np_flags; /* See below */
- u_int32_t np_index; /* protocol type index */
- u_int16_t np_adrlen; /* # of multicast addresses */
- u_int16_t np_802; /* for IEEE 802 packets */
- u_int8_t np_mcast[16][8];/* Multicast (direct match) array */
-};
-
-#define PTDB_PROMISC 0x08
-#define PTDB_802 0x10
-#define PTDB_BDC 0x20
-#define PTDB_UNKN 0x40
-#define PTDB_AMC 0x80
-
-/* Buffer descriptor */
-struct ni_bbd {
- u_int16_t nb_status; /* Offset, valid etc */
- u_int16_t nb_key;
- u_int32_t nb_len; /* Buffer length */
- u_int32_t nb_pte; /* start (vax) PTE for this buffer */
- u_int32_t nb_pad;
-};
-#define NIBD_OFFSET 0x1ff
-#define NIBD_VALID 0x8000
-
-
-/* Free Queue Block */
-struct ni_fqb {
- u_int32_t nf_mlen;
- u_int32_t nf_mpad;
- u_int32_t nf_mforw;
- u_int32_t nf_mback;
- u_int32_t nf_dlen;
- u_int32_t nf_dpad;
- u_int32_t nf_dforw;
- u_int32_t nf_dback;
- u_int32_t nf_rlen;
- u_int32_t nf_rpad;
- u_int32_t nf_rforw;
- u_int32_t nf_rback;
- u_int32_t nf_ilen;
- u_int32_t nf_ipad;
- u_int32_t nf_iforw;
- u_int32_t nf_iback;
-};
-
-/* DEBNx specific part of Generic VAX Port */
-struct ni_pqb {
- u_int16_t np_veclvl; /* Interrupt vector + level */
- u_int16_t np_node; /* Where to interrupt */
- u_int32_t np_freeq;
- u_int32_t np_vfqb; /* Free queue block pointer */
- u_int32_t np_pad1[39];
- u_int32_t np_bvplvl;
- u_int32_t np_vpqb; /* Virtual address of Generic PQB */
- u_int32_t np_vbdt; /* Virtual address of descriptors */
- u_int32_t np_nbdr; /* Number of descriptors */
- u_int32_t np_spt; /* System Page Table */
- u_int32_t np_sptlen; /* System Page Table length */
- u_int32_t np_gpt; /* Global Page Table */
- u_int32_t np_gptlen; /* Global Page Table length */
- u_int32_t np_mask;
- u_int32_t np_pad2[67];
-};
-
-/* "Generic VAX Port Control Block" whatever it means */
-struct ni_gvppqb {
- u_int32_t nc_forw0;
- u_int32_t nc_back0;
- u_int32_t nc_forw1;
- u_int32_t nc_back1;
- u_int32_t nc_forw2;
- u_int32_t nc_back2;
- u_int32_t nc_forw3;
- u_int32_t nc_back3;
- u_int32_t nc_forwr;
- u_int32_t nc_backr;
- struct ni_pqb nc_pqb; /* DEBNx specific part of struct */
-};
-
-
-/* BVP opcodes, should be somewhere else */
-#define BVP_DGRAM 1
-#define BVP_MSG 2
-#define BVP_DGRAMI 3
-#define BVP_DGRAMRX 33
-#define BVP_MSGRX 34
-#define BVP_DGRAMIRX 35
-
-/* NI-specific sub-opcodes */
-#define NI_WSYSID 1
-#define NI_RSYSID 2
-#define NI_WPARAM 3
-#define NI_RPARAM 4
-#define NI_RCCNTR 5
-#define NI_RDCNTR 6
-#define NI_STPTDB 7
-#define NI_CLPTDB 8
-
-/* bits in ni_pudr */
-#define PUDR_TAPE 0x40000000 /* tk50 & assoc logic ok */
-#define PUDR_PATCH 0x20000000 /* patch logic ok */
-#define PUDR_VRAM 0x10000000 /* DEBNx onboard RAM ok */
-#define PUDR_VROM1 0x08000000 /* uVax ROM 1 ok */ /* ? */
-#define PUDR_VROM2 0x04000000 /* uVax ROM 2 ok */
-#define PUDR_VROM3 0x02000000 /* uVax ROM 3 ok */
-#define PUDR_VROM4 0x01000000 /* uVax ROM 4 ok */
-#define PUDR_UVAX 0x00800000 /* uVax passes self test */
-#define PUDR_BI 0x00400000 /* BIIC and BCI3 chips ok */
-#define PUDR_TMR 0x00200000 /* interval timer ok */
-#define PUDR_IRQ 0x00100000 /* no IRQ lines stuck */
-#define PUDR_NI 0x00080000 /* Ethernet ctlr ok */
-#define PUDR_TK50 0x00040000 /* tk50 present */
-#define PUDR_PRES 0x00001000 /* tk50 present (again?!) */
-#define PUDR_UVINT 0x00000800 /* uVax-to-80186 intr logic ok */
-#define PUDR_BUSHD 0x00000400 /* no bus hold errors */
-#define PUDR_II32 0x00000200 /* II32 transceivers ok */
-#define PUDR_MPSC 0x00000100 /* MPSC logic ok */
-#define PUDR_GAP 0x00000080 /* gap-detect logic ok */
-#define PUDR_MISC 0x00000040 /* misc. registers ok */
-#define PUDR_UNEXP 0x00000020 /* unexpected interrupt trapped */
-#define PUDR_80186 0x00000010 /* 80186 ok */
-#define PUDR_PATCH2 0x00000008 /* patch logic ok (again) */
-#define PUDR_8RAM 0x00000004 /* 80186 RAM ok */
-#define PUDR_8ROM2 0x00000002 /* 80186 ROM1 ok */
-#define PUDR_8ROM1 0x00000001 /* 80186 ROM2 ok */
diff --git a/sys/arch/vax/bi/kdb.c b/sys/arch/vax/bi/kdb.c
deleted file mode 100644
index d0cf3ac85ed..00000000000
--- a/sys/arch/vax/bi/kdb.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/* $OpenBSD: kdb.c,v 1.12 2009/06/02 20:58:38 miod Exp $ */
-/* $NetBSD: kdb.c,v 1.26 2001/11/13 12:51:34 lukem Exp $ */
-/*
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * KDB50 disk device driver
- */
-/*
- * TODO
- * Implement node reset routine.
- * Nices hardware error handling.
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/buf.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/malloc.h>
-#include <sys/systm.h>
-#include <sys/sched.h>
-
-#include <uvm/uvm_extern.h>
-
-#ifdef __vax__
-#include <machine/pte.h>
-#include <machine/pcb.h>
-#endif
-#include <machine/bus.h>
-
-#include <dev/bi/bireg.h>
-#include <dev/bi/bivar.h>
-#include <dev/bi/kdbreg.h>
-
-#include <dev/mscp/mscp.h>
-#include <dev/mscp/mscpreg.h>
-#include <dev/mscp/mscpvar.h>
-
-#define KDB_WL(adr, val) bus_space_write_4(sc->sc_iot, sc->sc_ioh, adr, val)
-#define KDB_RL(adr) bus_space_read_4(sc->sc_iot, sc->sc_ioh, adr)
-#define KDB_RS(adr) bus_space_read_2(sc->sc_iot, sc->sc_ioh, adr)
-
-/*
- * Software status, per controller.
- */
-struct kdb_softc {
- struct device sc_dev; /* Autoconfig info */
- caddr_t sc_kdb; /* Struct for kdb communication */
- struct mscp_softc *sc_softc; /* MSCP info (per mscpvar.h) */
- bus_dma_tag_t sc_dmat;
- bus_dmamap_t sc_cmap; /* Control structures */
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
-};
-
-int kdbmatch(struct device *, struct cfdata *, void *);
-void kdbattach(struct device *, struct device *, void *);
-void kdbreset(int);
-void kdbintr(void *);
-void kdbctlrdone(struct device *);
-int kdbprint(void *, const char *);
-void kdbsaerror(struct device *, int);
-void kdbgo(struct device *, struct mscp_xi *);
-
-struct cfattach kdb_ca = {
- sizeof(struct kdb_softc), kdbmatch, kdbattach
-};
-
-/*
- * More driver definitions, for generic MSCP code.
- */
-struct mscp_ctlr kdb_mscp_ctlr = {
- kdbctlrdone,
- kdbgo,
- kdbsaerror,
-};
-
-int
-kdbprint(aux, name)
- void *aux;
- const char *name;
-{
- if (name)
- printf("%s: mscpbus", name);
- return UNCONF;
-}
-
-/*
- * Poke at a supposed KDB to see if it is there.
- */
-int
-kdbmatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct bi_attach_args *ba = aux;
-
- if (bus_space_read_2(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE) != BIDT_KDB50)
- return 0;
-
- if (cf->cf_loc[BICF_NODE] != BICF_NODE_DEFAULT &&
- cf->cf_loc[BICF_NODE] != ba->ba_nodenr)
- return 0;
-
- return 1;
-}
-
-void
-kdbattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct kdb_softc *sc = (void *)self;
- struct bi_attach_args *ba = aux;
- struct mscp_attach_args ma;
- volatile int i = 10000;
- int error, rseg;
- bus_dma_segment_t seg;
-
- printf("\n");
- bi_intr_establish(ba->ba_icookie, ba->ba_ivec, kdbintr, sc);
-
- sc->sc_iot = ba->ba_iot;
- sc->sc_ioh = ba->ba_ioh;
- sc->sc_dmat = ba->ba_dmat;
-
- /*
- * Map the communication area and command and
- * response packets into Unibus space.
- */
- if ((error = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct mscp_pack),
- NBPG, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
- printf("Alloc ctrl area %d\n", error);
- return;
- }
- if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg,
- sizeof(struct mscp_pack), &sc->sc_kdb,
- BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
- printf("Map ctrl area %d\n", error);
-err: bus_dmamem_free(sc->sc_dmat, &seg, rseg);
- return;
- }
- if ((error = bus_dmamap_create(sc->sc_dmat, sizeof(struct mscp_pack),
- 1, sizeof(struct mscp_pack), 0, BUS_DMA_NOWAIT, &sc->sc_cmap))) {
- printf("Create DMA map %d\n", error);
-err2: bus_dmamem_unmap(sc->sc_dmat, sc->sc_kdb,
- sizeof(struct mscp_pack));
- goto err;
- }
- if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_cmap,
- sc->sc_kdb, sizeof(struct mscp_pack), 0, BUS_DMA_NOWAIT))) {
- printf("Load ctrl map %d\n", error);
- bus_dmamap_destroy(sc->sc_dmat, sc->sc_cmap);
- goto err2;
- }
- memset(sc->sc_kdb, 0, sizeof(struct mscp_pack));
-
- ma.ma_mc = &kdb_mscp_ctlr;
- ma.ma_type = MSCPBUS_DISK|MSCPBUS_KDB;
- ma.ma_uda = (struct mscp_pack *)sc->sc_kdb;
- ma.ma_softc = &sc->sc_softc;
- ma.ma_iot = sc->sc_iot;
- ma.ma_iph = sc->sc_ioh + KDB_IP;
- ma.ma_sah = sc->sc_ioh + KDB_SA;
- ma.ma_swh = sc->sc_ioh + KDB_SW;
- ma.ma_dmat = sc->sc_dmat;
- ma.ma_dmam = sc->sc_cmap;
- ma.ma_ivec = ba->ba_ivec;
- ma.ma_ctlrnr = ba->ba_nodenr;
- ma.ma_adapnr = ba->ba_busnr;
-
- KDB_WL(BIREG_VAXBICSR, KDB_RL(BIREG_VAXBICSR) | BICSR_NRST);
- while (i--) /* Need delay??? */
- ;
- KDB_WL(BIREG_INTRDES, ba->ba_intcpu); /* Interrupt on CPU # */
- KDB_WL(BIREG_BCICSR, KDB_RL(BIREG_BCICSR) |
- BCI_STOPEN | BCI_IDENTEN | BCI_UINTEN | BCI_INTEN);
- KDB_WL(BIREG_UINTRCSR, ba->ba_ivec);
- config_found(&sc->sc_dev, &ma, kdbprint);
-}
-
-void
-kdbgo(usc, mxi)
- struct device *usc;
- struct mscp_xi *mxi;
-{
- struct kdb_softc *sc = (void *)usc;
- struct buf *bp = mxi->mxi_bp;
- struct mscp *mp = mxi->mxi_mp;
- u_int32_t addr = (u_int32_t)bp->b_data;
- u_int32_t mapaddr;
- int err;
-
- /*
- * The KDB50 wants to read VAX Page tables directly, therefore
- * the result from bus_dmamap_load() is uninteresting. (But it
- * should never fail!).
- *
- * On VAX, point to the corresponding page tables. (user/sys)
- * On other systems, do something else...
- */
- err = bus_dmamap_load(sc->sc_dmat, mxi->mxi_dmam, bp->b_data,
- bp->b_bcount, (bp->b_flags & B_PHYS ? bp->b_proc : 0),
- BUS_DMA_NOWAIT);
-
- if (err) /* Shouldn't happen */
- panic("kdbgo: bus_dmamap_load: error %d", err);
-
-#ifdef __vax__
- /*
- * Get a pointer to the pte pointing out the first virtual address.
- * Use different ways in kernel and user space.
- */
- if ((bp->b_flags & B_PHYS) == 0) {
- mapaddr = ((u_int32_t)kvtopte(addr)) & ~KERNBASE;
- } else {
- struct pcb *pcb;
- u_int32_t eaddr;
-
- /*
- * We check if the PTE's needed crosses a page boundary.
- * If they do; only transfer the amount of data that is
- * mapped by the first PTE page and led the system handle
- * the rest of the data.
- */
- pcb = &bp->b_proc->p_addr->u_pcb;
- mapaddr = (u_int32_t)uvtopte(addr, pcb);
- eaddr = (u_int32_t)uvtopte(addr + (bp->b_bcount - 1), pcb);
- if (trunc_page(mapaddr) != trunc_page(eaddr)) {
- mp->mscp_seq.seq_bytecount =
- (((round_page(mapaddr) - mapaddr)/4) * 512);
- }
- mapaddr = kvtophys(mapaddr);
- }
-#else
-#error Must write code to handle KDB50 on non-vax.
-#endif
-
- mp->mscp_seq.seq_mapbase = mapaddr;
- mxi->mxi_dmam->dm_segs[0].ds_addr = (addr & 511) | KDB_MAP;
- mscp_dgo(sc->sc_softc, mxi);
-}
-
-void
-kdbsaerror(usc, doreset)
- struct device *usc;
- int doreset;
-{
- struct kdb_softc *sc = (void *)usc;
-
- if ((KDB_RS(KDB_SA) & MP_ERR) == 0)
- return;
- printf("%s: controller error, sa=0x%x\n", sc->sc_dev.dv_xname,
- KDB_RS(KDB_SA));
- /* What to do now??? */
-}
-
-/*
- * Interrupt routine. Depending on the state of the controller,
- * continue initialisation, or acknowledge command and response
- * interrupts, and process responses.
- */
-void
-kdbintr(void *arg)
-{
- struct kdb_softc *sc = arg;
-
- if (KDB_RS(KDB_SA) & MP_ERR) { /* ctlr fatal error */
- kdbsaerror(&sc->sc_dev, 1);
- return;
- }
- KERNEL_LOCK();
- mscp_intr(sc->sc_softc);
- KERNEL_UNLOCK();
-}
-
-#ifdef notyet
-/*
- * The KDB50 has been reset. Reinitialise the controller
- * and requeue outstanding I/O.
- */
-void
-kdbreset(ctlr)
- int ctlr;
-{
- struct kdb_softc *sc;
-
- sc = kdb_cd.cd_devs[ctlr];
- printf(" kdb%d", ctlr);
-
-
- /* reset queues and requeue pending transfers */
- mscp_requeue(sc->sc_softc);
-
- /*
- * If it fails to initialise we will notice later and
- * try again (and again...). Do not call kdbstart()
- * here; it will be done after the controller finishes
- * initialisation.
- */
- if (kdbinit(sc))
- printf(" (hung)");
-}
-#endif
-
-void
-kdbctlrdone(usc)
- struct device *usc;
-{
-}
diff --git a/sys/arch/vax/bi/kdbreg.h b/sys/arch/vax/bi/kdbreg.h
deleted file mode 100644
index 46f28145610..00000000000
--- a/sys/arch/vax/bi/kdbreg.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $OpenBSD: kdbreg.h,v 1.5 2003/06/02 23:27:57 millert Exp $ */
-/* $NetBSD: kdbreg.h,v 1.3 1999/11/03 21:57:40 ragge Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)kdbreg.h 7.3 (Berkeley) 6/28/90
- */
-
-/*
- * The KDB50 registers are embedded inside the bi interface
- * general-purpose registers.
- */
-#ifdef notdef
-struct kdb_regs {
- struct biiregs kdb_bi;
- short kdb_xxx; /* first half of GPR 0 unused */
- short kdb_ip; /* initialisation and polling */
- short kdb_sa; /* status & address (r/o half) */
- short kdb_sw; /* status & address (w/o half) */
-};
-#endif
-
-#define KDB_IP 0xf2
-#define KDB_SA 0xf4
-#define KDB_SW 0xf6
-
-#define KDBSR_BITS \
-"\20\20ERR\17STEP4\16STEP3\15STEP2\14STEP1\13oldNV\12oldQB\11DI\10IE\1GO"
-
-/*
- * Asserting KDB_MAP in values placed in mscp_seq.seq_buffer tells
- * the KDB to use mscp_seq.seq_mapbase as a set of PTEs and seq_buffer
- * as an offset value. Hence we need no mappings; the KDB50 reads
- * the hardware page tables directly. (Without KDB_MAP, seq_bufer
- * represents the physical memory address instead, and seq_mapbase is
- * unused.)
- */
-#define KDB_MAP 0x80000000
-#define KDB_PHYS 0 /* pseudo flag */
diff --git a/sys/arch/vax/boot/boot/Makefile b/sys/arch/vax/boot/boot/Makefile
index 59bb87a89e6..0463c1dfe6e 100644
--- a/sys/arch/vax/boot/boot/Makefile
+++ b/sys/arch/vax/boot/boot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.8 2008/03/30 19:54:05 miod Exp $
+# $OpenBSD: Makefile,v 1.9 2011/07/06 18:32:59 miod Exp $
# $NetBSD: Makefile,v 1.27 2002/04/07 07:00:25 matt Exp $
S!= cd ${.CURDIR}/../../../../; pwd
@@ -7,7 +7,7 @@ NOMAN= # defined
.include <bsd.own.mk>
PROG= boot
-DEVS= hp.c ctu.c ra.c mfm.c if_qe.c if_le.c if_ze.c if_de.c if_ni.c
+DEVS= ra.c mfm.c if_qe.c if_le.c if_ze.c if_de.c
SRCS= srt0.S boot.c devopen.c conf.c autoconf.c netio.c rom.c romread.S \
urem.s udiv.s consio.c consio2.S str.S ${DEVS} findcpu.c
diff --git a/sys/arch/vax/boot/boot/boot.c b/sys/arch/vax/boot/boot/boot.c
index 62c5ad59e16..597185c079e 100644
--- a/sys/arch/vax/boot/boot/boot.c
+++ b/sys/arch/vax/boot/boot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.19 2008/08/26 18:36:21 miod Exp $ */
+/* $OpenBSD: boot.c,v 1.20 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: boot.c,v 1.18 2002/05/31 15:58:26 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -38,8 +38,6 @@
#include <lib/libsa/stand.h>
#include <lib/libsa/loadfile.h>
-#define V750UCODE(x) ((x>>8)&255)
-
#include "machine/rpb.h"
#include "machine/sid.h"
@@ -61,9 +59,6 @@ void autoconf(void);
int getsecs(void);
int setjmp(int *);
int testkey(void);
-#if 0
-void loadpcs(void);
-#endif
const struct vals {
char *namn;
@@ -109,7 +104,7 @@ Xmain(void)
transition = ' ';
askname = bootrpb.rpb_bootr5 & RB_ASKNAME;
- printf("\n\r>> OpenBSD/vax boot [%s] <<\n", "1.15");
+ printf("\n\r>> OpenBSD/vax boot [%s] <<\n", "1.16");
printf(">> Press enter to autoboot now, or any other key to abort: ");
sluttid = getsecs() + 5;
senast = 0;
@@ -196,7 +191,7 @@ void
boot(char *arg)
{
char *fn = "bsd";
- int howto, fl, err;
+ int howto, err;
u_long marks[MARK_MAX];
if (arg) {
@@ -246,104 +241,6 @@ load:
printf("Boot failed: %s\n", strerror(errno));
}
-#if 0
-
-/* 750 Patchable Control Store magic */
-
-#include "../include/mtpr.h"
-#include "../include/cpu.h"
-#include "../include/sid.h"
-#define PCS_BITCNT 0x2000 /* number of patchbits */
-#define PCS_MICRONUM 0x400 /* number of ucode locs */
-#define PCS_PATCHADDR 0xf00000 /* start addr of patchbits */
-#define PCS_PCSADDR (PCS_PATCHADDR+0x8000) /* start addr of pcs */
-#define PCS_PATCHBIT (PCS_PATCHADDR+0xc000) /* patchbits enable reg */
-#define PCS_ENABLE 0xfff00000 /* enable bits for pcs */
-
-#define extzv(one, two, three,four) \
-({ \
- asm __volatile (" extzv %0,%3,(%1),(%2)+" \
- : \
- : "g"(one),"g"(two),"g"(three),"g"(four)); \
-})
-
-
-void
-loadpcs(void)
-{
- static int pcsdone = 0;
- int mid = mfpr(PR_SID);
- int i, j, *ip, *jp;
- char pcs[100];
- char *cp;
-
- if ((mid >> 24) != VAX_750 || ((mid >> 8) & 255) < 95 || pcsdone)
- return;
- printf("Updating 11/750 microcode: ");
- for (cp = line; *cp; cp++)
- if (*cp == ')' || *cp == ':')
- break;
- if (*cp) {
- bcopy(line, pcs, 99);
- pcs[99] = 0;
- i = cp - line + 1;
- } else
- i = 0;
- strncpy(pcs + i, "pcs750.bin", sizeof(pcs) - i - 1);
- pcs[sizeof(pcs)-1] = '\0';
- i = open(pcs, 0);
- if (i < 0) {
- printf("bad luck - missing pcs750.bin :-(\n");
- return;
- }
- /*
- * We ask for more than we need to be sure we get only what we expect.
- * After read:
- * locs 0 - 1023 packed patchbits
- * 1024 - 11264 packed microcode
- */
- if (read(i, (char *)0, 23*512) != 22*512) {
- printf("Error reading %s\n", pcs);
- close(i);
- return;
- }
- close(i);
-
- /*
- * Enable patchbit loading and load the bits one at a time.
- */
- *((int *)PCS_PATCHBIT) = 1;
- ip = (int *)PCS_PATCHADDR;
- jp = (int *)0;
- for (i=0; i < PCS_BITCNT; i++) {
- extzv(i,jp,ip,1);
- }
- *((int *)PCS_PATCHBIT) = 0;
-
- /*
- * Load PCS microcode 20 bits at a time.
- */
- ip = (int *)PCS_PCSADDR;
- jp = (int *)1024;
- for (i=j=0; j < PCS_MICRONUM * 4; i+=20, j++) {
- extzv(i,jp,ip,20);
- }
-
- /*
- * Enable PCS.
- */
- i = *jp; /* get 1st 20 bits of microcode again */
- i &= 0xfffff;
- i |= PCS_ENABLE; /* reload these bits with PCS enable set */
- *((int *)PCS_PCSADDR) = i;
-
- mid = mfpr(PR_SID);
- printf("new rev level=%d\n", V750UCODE(mid));
- pcsdone = 1;
-}
-
-#endif
-
void
usage(char *hej)
{
diff --git a/sys/arch/vax/boot/boot/conf.c b/sys/arch/vax/boot/boot/conf.c
index ec6a3777ddb..ea8ad1df942 100644
--- a/sys/arch/vax/boot/boot/conf.c
+++ b/sys/arch/vax/boot/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.5 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.6 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: conf.c,v 1.10 2000/06/15 19:53:23 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -50,9 +50,7 @@
static int nostrategy(void *, int, daddr32_t, size_t, void *, size_t *);
struct devsw devsw[]={
- SADEV("hp",hpstrategy, hpopen, nullsys, noioctl),
SADEV("qe",nostrategy, qeopen, qeclose, noioctl), /* DEQNA */
- SADEV("ctu",ctustrategy, ctuopen, nullsys, noioctl),
SADEV("ra",rastrategy, raopen, nullsys, noioctl),
SADEV("mt",rastrategy, raopen, nullsys, noioctl),
SADEV("rom",romstrategy, romopen, nullsys, noioctl),
@@ -63,15 +61,11 @@ struct devsw devsw[]={
SADEV("st",nullsys, nullsys, nullsys, noioctl),
SADEV("le",nostrategy, leopen, leclose, noioctl), /* LANCE */
SADEV("ze",nostrategy, zeopen, zeclose, noioctl), /* SGEC */
- SADEV("rl",romstrategy, romopen, nullsys, noioctl),
SADEV("de",nostrategy, deopen, declose, noioctl), /* DEUNA */
- SADEV("ni",nostrategy, niopen, nullsys, noioctl), /* DEBNA */
};
int cnvtab[] = {
- BDEV_HP,
BDEV_QE,
- BDEV_CNSL,
BDEV_UDA,
BDEV_TK,
-1,
@@ -82,9 +76,7 @@ int cnvtab[] = {
BDEV_ST,
BDEV_LE,
BDEV_ZE,
- BDEV_RL,
BDEV_DE,
- BDEV_NI,
};
int ndevs = (sizeof(devsw)/sizeof(devsw[0]));
diff --git a/sys/arch/vax/boot/boot/ctu.c b/sys/arch/vax/boot/boot/ctu.c
deleted file mode 100644
index 70654e2e905..00000000000
--- a/sys/arch/vax/boot/boot/ctu.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* $OpenBSD: ctu.c,v 1.5 2011/03/13 00:13:53 deraadt Exp $ */
-/* $NetBSD: ctu.c,v 1.3 2000/05/20 13:30:03 ragge Exp $ */
-/*
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Standalone device driver for 11/750 Console TU58.
- * It can only handle reads, and doesn't calculate checksum.
- */
-
-#include <sys/param.h>
-
-#include <lib/libsa/stand.h>
-
-#include <machine/mtpr.h>
-#include <machine/rsp.h>
-
-#include "vaxstand.h"
-
-static short ctu_cksum(unsigned short *, int);
-
-enum tu_state {
- SC_INIT,
- SC_READY,
- SC_SEND_CMD,
- SC_GET_RESP,
-};
-
-volatile struct tu_softc {
- enum tu_state sc_state;
- char sc_rsp[15]; /* Should be struct rsb; but don't work */
- u_char *sc_xfptr; /* Current char to xfer */
- int sc_nbytes; /* Number of bytes to xfer */
- int sc_xbytes; /* Number of xfer'd bytes */
- int sc_bbytes; /* Number of xfer'd bytes this block */
-} tu_sc;
-
-void ctutintr(void);
-void cturintr(void);
-
-int
-ctuopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
-{
-
- tu_sc.sc_state = SC_INIT;
-
- mtpr(RSP_TYP_INIT, PR_CSTD);
- cturintr();
- tu_sc.sc_state = SC_READY;
- return 0;
-
-}
-
-int
-ctustrategy(void *f, int func, daddr32_t dblk, size_t size, void *buf, size_t *rsize)
-{
- struct rsp *rsp = (struct rsp *)tu_sc.sc_rsp;
-
- tu_sc.sc_xfptr = buf;
- tu_sc.sc_nbytes = size;
- tu_sc.sc_xbytes = tu_sc.sc_bbytes = 0;
-
- rsp->rsp_typ = RSP_TYP_COMMAND;
- rsp->rsp_sz = 012;
- rsp->rsp_op = RSP_OP_READ;
- rsp->rsp_mod = 0;
- rsp->rsp_drv = 0;
- rsp->rsp_sw = rsp->rsp_xx1 = rsp->rsp_xx2 = 0;
- rsp->rsp_cnt = tu_sc.sc_nbytes;
- rsp->rsp_blk = dblk;
- rsp->rsp_sum = ctu_cksum((u_short *)rsp, 6);
- tu_sc.sc_state = SC_SEND_CMD;
- while (tu_sc.sc_state != SC_GET_RESP)
- ctutintr();
- while (tu_sc.sc_state != SC_READY)
- cturintr();
- *rsize = size;
- return 0;
-}
-
-void
-cturintr(void)
-{
- int status;
-
- while ((mfpr(PR_CSRS) & 0x80) == 0)
- ;
-
- status = mfpr(PR_CSRD);
-
- switch (tu_sc.sc_state) {
-
- case SC_INIT:
- break;
-
- case SC_GET_RESP:
- if (tu_sc.sc_xbytes == tu_sc.sc_nbytes) {
- tu_sc.sc_bbytes++;
- if (tu_sc.sc_bbytes == 146)
- tu_sc.sc_state = SC_READY;
- break;
- }
- tu_sc.sc_bbytes++;
- if (tu_sc.sc_bbytes < 3) /* Data header */
- break;
- if (tu_sc.sc_bbytes == 132) { /* Finished */
- tu_sc.sc_bbytes = 0;
- break;
- }
- if (tu_sc.sc_bbytes == 131) /* First checksum */
- break;
- tu_sc.sc_xfptr[tu_sc.sc_xbytes++] = status;
- break;
- case SC_READY:
- case SC_SEND_CMD:
- break;
- }
-
-}
-
-void
-ctutintr(void)
-{
- int c;
-
- while ((mfpr(PR_CSTS) & 0x80) == 0)
- ;
-
- c = tu_sc.sc_rsp[tu_sc.sc_xbytes++] & 0xff;
- mtpr(c, PR_CSTD);
- if (tu_sc.sc_xbytes > 13) {
- tu_sc.sc_state = SC_GET_RESP;
- tu_sc.sc_xbytes = 0;
- }
-}
-
-short
-ctu_cksum(unsigned short *buf, int words)
-{
- int i, cksum;
-
- for (i = cksum = 0; i < words; i++)
- cksum += buf[i];
-
-hej: if (cksum > 65535) {
- cksum = (cksum & 65535) + (cksum >> 16);
- goto hej;
- }
- return cksum;
-}
diff --git a/sys/arch/vax/boot/boot/devopen.c b/sys/arch/vax/boot/boot/devopen.c
index 879aec9465e..4a3bbe7b784 100644
--- a/sys/arch/vax/boot/boot/devopen.c
+++ b/sys/arch/vax/boot/boot/devopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: devopen.c,v 1.4 2008/08/26 18:36:21 miod Exp $ */
+/* $OpenBSD: devopen.c,v 1.5 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: devopen.c,v 1.10 2002/05/24 21:40:59 ragge Exp $ */
/*
* Copyright (c) 1997 Ludd, University of Lule}, Sweden.
@@ -36,10 +36,6 @@
#include "machine/rpb.h"
#include "machine/sid.h"
#include "machine/pte.h"
-#define VAX780 1
-#include "machine/ka750.h"
-
-#include <arch/vax/bi/bireg.h>
#include "vaxstand.h"
@@ -151,44 +147,6 @@ devopen(f, fname, file)
nexaddr = bootrpb.adpphy;
switch (vax_boardtype) {
- case VAX_BTYP_750:
- csrbase = (nexaddr == 0xf30000 ? 0xffe000 : 0xfbe000);
- if (adapt < 0)
- break;
- nexaddr = (NEX750 + NEXSIZE * adapt);
- csrbase = (adapt == 8 ? 0xffe000 : 0xfbe000);
- break;
- case VAX_BTYP_780:
- case VAX_BTYP_790:
- csrbase = 0x2007e000 + 0x40000 * ((nexaddr & 0x1e000) >> 13);
- if (adapt < 0)
- break;
- nexaddr = ((int)NEX780 + NEXSIZE * adapt);
- csrbase = 0x2007e000 + 0x40000 * adapt;
- break;
- case VAX_BTYP_9CC: /* 6000/200 */
- case VAX_BTYP_9RR: /* 6000/400 */
- case VAX_BTYP_1202: /* 6000/500 */
- csrbase = 0;
- if (ctlr < 0)
- ctlr = bootrpb.adpphy & 15;
- if (adapt < 0)
- adapt = (bootrpb.adpphy >> 4) & 15;
- nexaddr = BI_BASE(adapt, ctlr);
- break;
-
- case VAX_BTYP_8000:
- case VAX_BTYP_8800:
- case VAX_BTYP_8PS:
- csrbase = 0; /* _may_ be a KDB */
- nexaddr = bootrpb.csrphy;
- if (ctlr < 0)
- break;
- if (adapt < 0)
- nexaddr = (nexaddr & 0xff000000) + BI_NODE(ctlr);
- else
- nexaddr = BI_BASE(adapt, ctlr);
- break;
case VAX_BTYP_610:
nexaddr = 0; /* No map regs */
csrbase = 0x20000000;
diff --git a/sys/arch/vax/boot/boot/hp.c b/sys/arch/vax/boot/boot/hp.c
deleted file mode 100644
index c7f084a6f99..00000000000
--- a/sys/arch/vax/boot/boot/hp.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $OpenBSD: hp.c,v 1.3 2011/03/13 00:13:53 deraadt Exp $ */
-/* $NetBSD: hp.c,v 1.5 2000/07/19 00:58:25 matt Exp $ */
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
- /* All bugs are subject to removal without further notice */
-
-
-
-#include "sys/param.h"
-#include "sys/disklabel.h"
-
-#include "lib/libsa/stand.h"
-
-#include "../include/pte.h"
-#include "../include/rpb.h"
-#include "../include/sid.h"
-#define VAX780 1
-struct proc;
-#include "../include/ka750.h"
-
-#include "../mba/mbareg.h"
-#include "../mba/hpreg.h"
-
-#include "vaxstand.h"
-
-/*
- * These routines for HP disk standalone boot is wery simple,
- * assuming a lots of thing like that we only working at one hp disk
- * a time, no separate routines for mba driver etc..
- * But it works :)
- */
-
-static struct disklabel hplabel;
-static char io_buf[DEV_BSIZE];
-static int dpart;
-static int adpadr, unitadr;
-
-#define MBA_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((adpadr) + (reg)) = (val)));
-#define MBA_RCSR(reg) \
- (*(volatile u_int32_t *)((adpadr) + (reg)))
-#define HP_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((unitadr) + (reg)) = (val)));
-#define HP_RCSR(reg) \
- (*(volatile u_int32_t *)((unitadr) + (reg)))
-
-int
-hpopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
-{
- char *msg;
- int err;
- size_t i;
-
- if (askname == 0) { /* Take info from RPB */
- adpadr = bootrpb.adpphy;
- unitadr = adpadr + MUREG(bootrpb.unit, 0);
- } else {
- adpadr = nexaddr;
- unitadr = adpadr + MUREG(unit, 0);
- bootrpb.adpphy = adpadr;
- bootrpb.unit = unit;
- }
- bzero(&hplabel, sizeof(struct disklabel));
-
- hplabel.d_secpercyl = 32;
- hplabel.d_nsectors = 32;
-
- /* Set volume valid and 16 bit format; only done once */
- MBA_WCSR(MBA_CR, MBACR_INIT);
- HP_WCSR(HP_CS1, HPCS_PA);
- HP_WCSR(HP_OF, HPOF_FMT);
-
- err = hpstrategy(0, F_READ, LABELSECTOR, DEV_BSIZE, io_buf, &i);
- if (err) {
- printf("reading disklabel: %s\n", strerror(err));
- return 0;
- }
-
- msg = getdisklabel(io_buf + LABELOFFSET, &hplabel);
- if (msg)
- printf("getdisklabel: %s\n", msg);
- return 0;
-}
-
-int
-hpstrategy(void *f, int func, daddr32_t dblk,
- size_t size, void *buf, size_t *rsize)
-{
- unsigned int pfnum, mapnr, nsize, bn, cn, sn, tn;
-
- pfnum = (u_int)buf >> VAX_PGSHIFT;
-
- for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0;
- nsize -= VAX_NBPG, mapnr++, pfnum++)
- MBA_WCSR(MAPREG(mapnr), PG_V | pfnum);
-
- MBA_WCSR(MBA_VAR, ((u_int)buf & VAX_PGOFSET));
- MBA_WCSR(MBA_BC, (~size) + 1);
- bn = dblk + hplabel.d_partitions[dpart].p_offset;
-
- if (bn) {
- cn = bn / hplabel.d_secpercyl;
- sn = bn % hplabel.d_secpercyl;
- tn = sn / hplabel.d_nsectors;
- sn = sn % hplabel.d_nsectors;
- } else
- cn = sn = tn = 0;
-
- HP_WCSR(HP_DC, cn);
- HP_WCSR(HP_DA, (tn << 8) | sn);
-#ifdef notdef
- if (func == F_WRITE)
- HP_WCSR(HP_CS1, HPCS_WRITE);
- else
-#endif
- HP_WCSR(HP_CS1, HPCS_READ);
-
- while (MBA_RCSR(MBA_SR) & MBASR_DTBUSY)
- ;
-
- if (MBA_RCSR(MBA_SR) & MBACR_ABORT)
- return 1;
-
- *rsize = size;
- return 0;
-}
diff --git a/sys/arch/vax/boot/boot/if_de.c b/sys/arch/vax/boot/boot/if_de.c
index c4c61acfbc1..3dd71bb6aa2 100644
--- a/sys/arch/vax/boot/boot/if_de.c
+++ b/sys/arch/vax/boot/boot/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.2 2005/12/10 11:45:43 miod Exp $ */
+/* $OpenBSD: if_de.c,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: if_de.c,v 1.2 2002/05/24 21:41:40 ragge Exp $ */
/*
@@ -47,7 +47,12 @@
#include <lib/libsa/netif.h>
#include <lib/libsa/stand.h>
-#include <arch/vax/qbus/if_dereg.h>
+#include <arch/vax/if/if_dereg.h>
+
+#define DE_PCSR0 0
+#define DE_PCSR1 2
+#define DE_PCSR2 4
+#define DE_PCSR3 6
#include "arch/vax/include/sid.h"
#include "arch/vax/include/rpb.h"
diff --git a/sys/arch/vax/boot/boot/if_ni.c b/sys/arch/vax/boot/boot/if_ni.c
deleted file mode 100644
index 76f3477eb65..00000000000
--- a/sys/arch/vax/boot/boot/if_ni.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/* $OpenBSD: if_ni.c,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
-/* $NetBSD: if_ni.c,v 1.2 2000/07/10 10:40:38 ragge Exp $ */
-/*
- * Copyright (c) 2000 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Standalone routine for DEBNA Ethernet controller.
- */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/if_ether.h>
-
-#include <../include/sid.h>
-#include <../include/rpb.h>
-#include <../include/pte.h>
-#include <../include/macros.h>
-#include <../include/mtpr.h>
-#include <../include/scb.h>
-
-#include <lib/libkern/libkern.h>
-
-#include <lib/libsa/netif.h>
-#include <lib/libsa/stand.h>
-#include <lib/libsa/net.h>
-
-#include <arch/vax/bi/bireg.h>
-
-#include "vaxstand.h"
-
-#undef NIDEBUG
-/*
- * Tunable buffer parameters. Good idea to have them as power of 8; then
- * they will fit into a logical VAX page.
- */
-#define NMSGBUF 8 /* Message queue entries */
-#define NTXBUF 16 /* Transmit queue entries */
-#define NTXFRAGS 1 /* Number of transmit buffer fragments */
-#define NRXBUF 24 /* Receive queue entries */
-#define NBDESCS (NTXBUF + NRXBUF)
-#define NQUEUES 3 /* RX + TX + MSG */
-#define PKTHDR 18 /* Length of (control) packet header */
-#define RXADD 18 /* Additional length of receive datagram */
-#define TXADD 18 /* "" transmit "" */
-#define MSGADD 134 /* "" message "" */
-
-#include <arch/vax/bi/if_nireg.h>
-
-
-#define SPTSIZ 16384 /* 8MB */
-#define roundpg(x) (((int)x + VAX_PGOFSET) & ~VAX_PGOFSET)
-#define ALLOC(x) \
- allocbase;xbzero((caddr_t)allocbase,x);allocbase+=roundpg(x);
-#define nipqb (&gvppqb->nc_pqb)
-#define gvp gvppqb
-#define NI_WREG(csr, val) *(volatile long *)(niaddr + (csr)) = (val)
-#define NI_RREG(csr) *(volatile long *)(niaddr + (csr))
-#define DELAY(x) {volatile int i = x * 3;while (--i);}
-#define WAITREG(csr,val) while (NI_RREG(csr) & val);
-
-static int ni_get(struct iodesc *, void *, size_t, time_t);
-static int ni_put(struct iodesc *, void *, size_t);
-
-static int *syspte, allocbase, niaddr;
-static struct ni_gvppqb *gvppqb;
-static struct ni_fqb *fqb;
-static struct ni_bbd *bbd;
-static char enaddr[6];
-static int beenhere = 0;
-
-struct netif_driver ni_driver = {
- 0, 0, 0, 0, ni_get, ni_put,
-};
-
-static void
-xbzero(char *a, int s)
-{
- while (s--)
- *a++ = 0;
-}
-
-static int
-failtest(int reg, int mask, int test, char *str)
-{
- int i = 100;
-
- do {
- DELAY(100000);
- } while (((NI_RREG(reg) & mask) != test) && --i);
-
- if (i == 0) {
- printf("ni: %s\n", str);
- return 1;
- }
- return 0;
-}
-
-static int
-INSQTI(void *e, void *h)
-{
- int ret;
-
- while ((ret = insqti(e, h)) == ILCK_FAILED)
- ;
- return ret;
-}
-
-static void *
-REMQHI(void *h)
-{
- void *ret;
-
- while ((ret = remqhi(h)) == (void *)ILCK_FAILED)
- ;
- return ret;
-}
-
-static void
-puton(void *pkt, void *q, int args)
-{
- INSQTI(pkt, q);
-
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, args);
- WAITREG(NI_PCR, PCR_OWN);
-}
-
-static void
-remput(void *fq, void *pq, int args)
-{
- struct ni_dg *data;
- int res;
-
- while ((data = REMQHI(fq)) == 0)
- ;
-
- res = INSQTI(data, pq);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, args);
- }
-}
-
-static void
-insput(void *elem, void *q, int args)
-{
- int res;
-
- res = INSQTI(elem, q);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, args);
- }
-}
-
-int
-niopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
-{
- struct ni_dg *data;
- struct ni_msg *msg;
- struct ni_ptdb *ptdb;
- int i, va, res;
-
- if (beenhere++ && askname == 0)
- return 0;
-
- niaddr = nexaddr & ~(BI_NODESIZE - 1);
- bootrpb.csrphy = niaddr;
- if (adapt >= 0)
- bootrpb.adpphy = adapt;
- /*
- * We need a bunch of memory, take it from our load
- * address plus 1M.
- */
- allocbase = RELOC + 1024 * 1024;
- /*
- * First create a SPT for the first 8MB of physmem.
- */
- syspte = (int *)ALLOC(SPTSIZ*4);
- for (i = 0; i < SPTSIZ; i++)
- syspte[i] = PG_V|PG_RW|i;
-
-
- gvppqb = (struct ni_gvppqb *)ALLOC(sizeof(struct ni_gvppqb));
- fqb = (struct ni_fqb *)ALLOC(sizeof(struct ni_fqb));
- bbd = (struct ni_bbd *)ALLOC(sizeof(struct ni_bbd) * NBDESCS);
-
- /* Init the PQB struct */
- nipqb->np_spt = nipqb->np_gpt = (int)syspte;
- nipqb->np_sptlen = nipqb->np_gptlen = SPTSIZ;
- nipqb->np_vpqb = (u_int32_t)gvp;
- nipqb->np_bvplvl = 1;
- nipqb->np_vfqb = (u_int32_t)fqb;
- nipqb->np_vbdt = (u_int32_t)bbd;
- nipqb->np_nbdr = NBDESCS;
-
- /* Free queue block */
- nipqb->np_freeq = NQUEUES;
- fqb->nf_mlen = PKTHDR+MSGADD;
- fqb->nf_dlen = PKTHDR+TXADD;
- fqb->nf_rlen = PKTHDR+RXADD;
-#ifdef NIDEBUG
- printf("niopen: syspte %p gvp %p fqb %p bbd %p\n",
- syspte, gvppqb, fqb, bbd);
-#endif
-
- NI_WREG(BIREG_VAXBICSR, NI_RREG(BIREG_VAXBICSR) | BICSR_NRST);
- DELAY(500000);
- i = 20;
- while ((NI_RREG(BIREG_VAXBICSR) & BICSR_BROKE) && --i)
- DELAY(500000);
-#ifdef NIDEBUG
- if (i == 0) {
- printf("ni: BROKE bit set after reset\n");
- return 1;
- }
-#endif
- /* Check state */
- if (failtest(NI_PSR, PSR_STATE, PSR_UNDEF, "not undefined state"))
- return 1;
-
- /* Clear owner bits */
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
- NI_WREG(NI_PCR, NI_RREG(NI_PCR) & ~PCR_OWN);
-
- /* kick off init */
- NI_WREG(NI_PCR, (int)gvppqb | PCR_INIT | PCR_OWN);
- while (NI_RREG(NI_PCR) & PCR_OWN)
- DELAY(100000);
-
- /* Check state */
- if (failtest(NI_PSR, PSR_INITED, PSR_INITED, "failed initialize"))
- return 1;
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_ENABLE);
- WAITREG(NI_PCR, PCR_OWN);
- WAITREG(NI_PSR, PSR_OWN);
-
- /* Check state */
- if (failtest(NI_PSR, PSR_STATE, PSR_ENABLED, "failed enable"))
- return 1;
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
-
-#ifdef NIDEBUG
- printf("Set up message free queue\n");
-#endif
-
- /* Set up message free queue */
- va = ALLOC(NMSGBUF * 512);
- for (i = 0; i < NMSGBUF; i++) {
- msg = (void *)(va + i * 512);
-
- res = INSQTI(msg, &fqb->nf_mforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Set up xmit queue\n");
-#endif
-
- /* Set up xmit queue */
- va = ALLOC(NTXBUF * 512);
- for (i = 0; i < NTXBUF; i++) {
- struct ni_dg *data;
-
- data = (void *)(va + i * 512);
- data->nd_status = 0;
- data->nd_len = TXADD;
- data->nd_ptdbidx = 1;
- data->nd_opcode = BVP_DGRAM;
- data->bufs[0]._offset = 0;
- data->bufs[0]._key = 1;
- data->nd_cmdref = allocbase;
- bbd[i].nb_key = 1;
- bbd[i].nb_status = 0;
- bbd[i].nb_pte = (int)&syspte[allocbase>>9];
- allocbase += 2048;
- data->bufs[0]._index = i;
-
- res = INSQTI(data, &fqb->nf_dforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
-#ifdef NIDEBUG
- printf("recv buffers\n");
-#endif
-
- /* recv buffers */
- va = ALLOC(NRXBUF * 512);
- for (i = 0; i < NRXBUF; i++) {
- struct ni_dg *data;
- struct ni_bbd *bd;
- int idx;
-
- data = (void *)(va + i * 512);
- data->nd_cmdref = allocbase;
- data->nd_len = RXADD;
- data->nd_opcode = BVP_DGRAMRX;
- data->nd_ptdbidx = 2;
- data->bufs[0]._key = 1;
-
- idx = NTXBUF + i;
- bd = &bbd[idx];
- bd->nb_pte = (int)&syspte[allocbase>>9];
- allocbase += 2048;
- bd->nb_len = 2048;
- bd->nb_status = NIBD_VALID;
- bd->nb_key = 1;
- data->bufs[0]._offset = 0;
- data->bufs[0]._len = bd->nb_len;
- data->bufs[0]._index = idx;
-
- res = INSQTI(data, &fqb->nf_rforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Set initial parameters\n");
-#endif
-
- /* Set initial parameters */
- msg = REMQHI(&fqb->nf_mforw);
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = sizeof(struct ni_param) + 6;
- msg->nm_opcode2 = NI_WPARAM;
- ((struct ni_param *)&msg->nm_text[0])->np_flags = NP_PAD;
-
- puton(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
-
-
- while ((data = REMQHI(&gvp->nc_forwr)) == 0)
- ;
-
- msg = (struct ni_msg *)data;
-#ifdef NIDEBUG
- if (msg->nm_opcode2 != NI_WPARAM) {
- printf("ni: wrong response code %d\n", msg->nm_opcode2);
- insput(data, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- }
-#endif
- bcopy(((struct ni_param *)&msg->nm_text[0])->np_dpa,
- enaddr, ETHER_ADDR_LEN);
- insput(data, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Clear counters\n");
-#endif
-
- /* Clear counters */
- msg = REMQHI(&fqb->nf_mforw);
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = sizeof(struct ni_param) + 6;
- msg->nm_opcode2 = NI_RCCNTR;
-
- puton(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- remput(&gvp->nc_forwr, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Enable transmit logic\n");
-#endif
-
- /* Enable transmit logic */
- msg = REMQHI(&fqb->nf_mforw);
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = 18;
- msg->nm_opcode2 = NI_STPTDB;
- ptdb = (struct ni_ptdb *)&msg->nm_text[0];
- bzero(ptdb, sizeof(struct ni_ptdb));
- ptdb->np_index = 1;
- ptdb->np_fque = 1;
-
- puton(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- remput(&gvp->nc_forwr, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("ni: hardware address %s\n", ether_sprintf(enaddr));
- printf("Setting receive parameters\n");
-#endif
- msg = REMQHI(&fqb->nf_mforw);
- ptdb = (struct ni_ptdb *)&msg->nm_text[0];
- bzero(ptdb, sizeof(struct ni_ptdb));
- msg->nm_opcode = BVP_MSG;
- msg->nm_len = 18;
- ptdb->np_index = 2;
- ptdb->np_fque = 2;
- msg->nm_opcode2 = NI_STPTDB;
- ptdb->np_type = ETHERTYPE_IP;
- ptdb->np_flags = PTDB_UNKN|PTDB_BDC;
- memset(ptdb->np_mcast[0], 0xff, ETHER_ADDR_LEN);
- ptdb->np_adrlen = 1;
- msg->nm_len += 8;
- insput(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- remput(&gvp->nc_forwr, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("finished\n");
-#endif
-
- net_devinit(f, &ni_driver, enaddr);
- return 0;
-}
-
-int
-ni_get(struct iodesc *desc, void *pkt, size_t maxlen, time_t timeout)
-{
- struct ni_dg *data;
- struct ni_bbd *bd;
- int nsec = getsecs() + timeout;
- int len, idx;
-
-loop: while ((data = REMQHI(&gvp->nc_forwr)) == 0 && (nsec > getsecs()))
- ;
-
- if (nsec <= getsecs())
- return 0;
-
- switch (data->nd_opcode) {
- case BVP_DGRAMRX:
- idx = data->bufs[0]._index;
- bd = &bbd[idx];
- len = data->bufs[0]._len;
- if (len > maxlen)
- len = maxlen;
- bcopy((caddr_t)data->nd_cmdref, pkt, len);
- bd->nb_pte = (int)&syspte[data->nd_cmdref>>9];
- data->bufs[0]._len = bd->nb_len = 2048;
- data->bufs[0]._offset = 0;
- data->bufs[0]._key = 1;
- bd->nb_status = NIBD_VALID;
- bd->nb_key = 1;
- data->nd_len = RXADD;
- data->nd_status = 0;
- insput(data, &fqb->nf_rforw,
- PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
- return len;
-
- case BVP_DGRAM:
- insput(data, &fqb->nf_dforw, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
- break;
- default:
- insput(data, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- break;
- }
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~(PSR_OWN|PSR_RSQ));
- goto loop;
-}
-
-int
-ni_put(struct iodesc *desc, void *pkt, size_t len)
-{
- struct ni_dg *data;
- struct ni_bbd *bdp;
-
- data = REMQHI(&fqb->nf_dforw);
-#ifdef NIDEBUG
- if (data == 0) {
- printf("ni_put: driver problem, data == 0\n");
- return -1;
- }
-#endif
- bdp = &bbd[(data->bufs[0]._index & 0x7fff)];
- bdp->nb_status = NIBD_VALID;
- bdp->nb_len = (len < 64 ? 64 : len);
- bcopy(pkt, (caddr_t)data->nd_cmdref, len);
- data->bufs[0]._offset = 0;
- data->bufs[0]._len = bdp->nb_len;
- data->nd_opcode = BVP_DGRAM;
- data->nd_pad3 = 1;
- data->nd_ptdbidx = 1;
- data->nd_len = 18;
- insput(data, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- return len;
-}
-
-int
-niclose(struct open_file *f)
-{
- if (beenhere) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_SHUTDOWN);
- WAITREG(NI_PCR, PCR_OWN);
- }
- return 0;
-}
diff --git a/sys/arch/vax/boot/boot/ra.c b/sys/arch/vax/boot/boot/ra.c
index c7242cf4f07..dbb0efca4ce 100644
--- a/sys/arch/vax/boot/boot/ra.c
+++ b/sys/arch/vax/boot/boot/ra.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ra.c,v 1.4 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: ra.c,v 1.5 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: ra.c,v 1.11 2002/06/04 15:13:55 ragge Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -46,9 +46,6 @@
#include "arch/vax/mscp/mscp.h"
#include "arch/vax/mscp/mscpreg.h"
-#include "arch/vax/bi/bireg.h"
-#include "arch/vax/bi/kdbreg.h"
-
#include "vaxstand.h"
static void command(int, int);
@@ -69,7 +66,7 @@ static volatile struct uda {
static struct disklabel ralabel;
static char io_buf[DEV_BSIZE];
-static int dpart, dunit, remap, is_tmscp, curblock;
+static int dpart, dunit, is_tmscp, curblock;
static volatile u_short *ra_ip, *ra_sa, *ra_sw;
static volatile u_int *mapregs;
@@ -95,56 +92,28 @@ raopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
dpart = part;
if (ctlr < 0)
ctlr = 0;
- remap = csrbase && nexaddr;
curblock = 0;
- if (csrbase) { /* On a uda-alike adapter */
- if (askname == 0) {
- csrbase = bootrpb.csrphy;
- dunit = bootrpb.unit;
- nexaddr = bootrpb.adpphy;
- } else
- csrbase += (ctlr ? 000334 : 012150);
- ra_ip = (short *)csrbase;
- ra_sa = ra_sw = (short *)csrbase + 1;
- if (nexaddr) { /* have map registers */
- mapregs = (int *)nexaddr + 512;
- mapregs[494] = PG_V | (((u_int)&uda) >> 9);
- mapregs[495] = mapregs[494] + 1;
- (char *)ubauda = (char *)0x3dc00 +
- (((u_int)(&uda))&0x1ff);
- } else
- ubauda = &uda;
- johan = (((u_int)ubauda) & 0xffff) + 8;
- johan2 = (((u_int)ubauda) >> 16) & 077;
- *ra_ip = 0; /* Start init */
- bootrpb.csrphy = csrbase;
- } else {
- paddr_t kdaddr;
- volatile int *w;
- volatile int i = 10000;
-
- if (askname == 0) {
- nexaddr = bootrpb.csrphy;
- dunit = bootrpb.unit;
- } else {
- nexaddr = (bootrpb.csrphy & ~(BI_NODESIZE - 1)) + KDB_IP;
- bootrpb.csrphy = nexaddr;
- }
-
- kdaddr = nexaddr & ~(BI_NODESIZE - 1);
- ra_ip = (short *)(kdaddr + KDB_IP);
- ra_sa = (short *)(kdaddr + KDB_SA);
- ra_sw = (short *)(kdaddr + KDB_SW);
- johan = ((u_int)&uda.uda_ca.ca_rspdsc) & 0xffff;
- johan2 = (((u_int)&uda.uda_ca.ca_rspdsc) & 0xffff0000) >> 16;
- w = (int *)(kdaddr + BIREG_VAXBICSR);
- *w = *w | BICSR_NRST;
- while (i--) /* Need delay??? */
- ;
- w = (int *)(kdaddr + BIREG_BER);
- *w = ~(BIBER_MBZ|BIBER_NMR|BIBER_UPEN);/* ??? */
+ /* Assume uda-alike adapter */
+ if (askname == 0) {
+ csrbase = bootrpb.csrphy;
+ dunit = bootrpb.unit;
+ nexaddr = bootrpb.adpphy;
+ } else
+ csrbase += (ctlr ? 000334 : 012150);
+ ra_ip = (short *)csrbase;
+ ra_sa = ra_sw = (short *)csrbase + 1;
+ if (nexaddr) { /* have map registers */
+ mapregs = (int *)nexaddr + 512;
+ mapregs[494] = PG_V | (((u_int)&uda) >> 9);
+ mapregs[495] = mapregs[494] + 1;
+ (char *)ubauda = (char *)0x3dc00 +
+ (((u_int)(&uda))&0x1ff);
+ } else
ubauda = &uda;
- }
+ johan = (((u_int)ubauda) & 0xffff) + 8;
+ johan2 = (((u_int)ubauda) >> 16) & 077;
+ *ra_ip = 0; /* Start init */
+ bootrpb.csrphy = csrbase;
#ifdef DEV_DEBUG
printf("start init\n");
@@ -264,18 +233,14 @@ rastrategy(void *f, int func, daddr32_t dblk,
u_int pfnum, mapnr, nsize;
#ifdef DEV_DEBUG
- printf("rastrategy: buf %p remap %d is_tmscp %d\n",
- buf, remap, is_tmscp);
+ printf("rastrategy: buf %p is_tmscp %d\n",
+ buf, is_tmscp);
#endif
- if (remap) {
- pfnum = (u_int)buf >> VAX_PGSHIFT;
+ pfnum = (u_int)buf >> VAX_PGSHIFT;
- for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0;
- nsize -= VAX_NBPG)
- mapregs[mapnr++] = PG_V | pfnum++;
- uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf) & 0x1ff;
- } else
- uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf);
+ for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0; nsize -= VAX_NBPG)
+ mapregs[mapnr++] = PG_V | pfnum++;
+ uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf) & 0x1ff;
if (is_tmscp) {
int i;
diff --git a/sys/arch/vax/boot/boot/tmscp.c b/sys/arch/vax/boot/boot/tmscp.c
deleted file mode 100644
index 4c72cad1711..00000000000
--- a/sys/arch/vax/boot/boot/tmscp.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* $OpenBSD: tmscp.c,v 1.4 2011/03/13 00:13:53 deraadt Exp $ */
-/* $NetBSD: tmscp.c,v 1.3 1999/06/30 18:19:26 ragge Exp $ */
-/*
- * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
- /* All bugs are subject to removal without further notice */
-
-#define NRSP 0 /* Kludge */
-#define NCMD 0 /* Kludge */
-
-#include "sys/param.h"
-#include "sys/disklabel.h"
-
-#include "lib/libsa/stand.h"
-
-#include "../include/pte.h"
-#include "arch/vax/mscp/mscp.h"
-#include "arch/vax/mscp/mscpreg.h"
-
-#include "vaxstand.h"
-
-static command(int,int);
-
-/*
- * These routines for TMSCP tape standalone boot is very simple,
- * assuming a lots of thing like that we only working at one tape at
- * a time, no separate routines for uba driver etc..
- * This code is directly copied from ra disk driver.
- */
-
-struct ra_softc {
- int udaddr;
- int ubaddr;
- int unit;
-};
-
-static volatile struct uda {
- struct mscp_1ca uda_ca; /* communications area */
- struct mscp uda_rsp; /* response packets */
- struct mscp uda_cmd; /* command packets */
-} uda;
-
-struct udadevice {
- short udaip;
- short udasa;
-};
-
-static volatile struct uda *ubauda;
-static volatile struct udadevice *udacsr;
-static struct ra_softc ra_softc;
-static int curblock;
-
-
-tmscpopen(f, adapt, ctlr, unit, part)
- struct open_file *f;
- int ctlr, unit, part;
-{
- char *msg;
- extern u_int tmsaddr;
- volatile struct ra_softc *ra=&ra_softc;
- volatile u_int *nisse;
- unsigned short johan;
- int i,err;
-
- curblock = 0;
- if(adapt>nuba) return(EADAPT);
- if(ctlr>nuda) return(ECTLR);
- ra->udaddr=uioaddr[adapt]+tmsaddr;
- ra->ubaddr=(int)ubaaddr[adapt];
- ra->unit=unit;
- udacsr=(void*)ra->udaddr;
- nisse=((u_int *)ubaaddr[adapt]) + 512;
- nisse[494]=PG_V|(((u_int)&uda)>>9);
- nisse[495]=nisse[494]+1;
- ubauda=(void*)0x3dc00+(((u_int)(&uda))&0x1ff);
-
- /*
- * Init of this tmscp ctlr.
- */
- udacsr->udaip=0; /* Start init */
- while((udacsr->udasa&MP_STEP1) == 0);
- udacsr->udasa=0x8000;
- while((udacsr->udasa&MP_STEP2) == 0);
- johan=(((u_int)ubauda)&0xffff)+8;
- udacsr->udasa=johan;
- while((udacsr->udasa&MP_STEP3) == 0);
- udacsr->udasa=3;
- while((udacsr->udasa&MP_STEP4) == 0);
- udacsr->udasa=0x0001;
-
- uda.uda_ca.ca_rspdsc=(int)&ubauda->uda_rsp.mscp_cmdref;
- uda.uda_ca.ca_cmddsc=(int)&ubauda->uda_cmd.mscp_cmdref;
- uda.uda_cmd.mscp_un.un_seq.seq_addr = (long *)&uda.uda_ca.ca_cmddsc;
- uda.uda_rsp.mscp_un.un_seq.seq_addr = (long *)&uda.uda_ca.ca_rspdsc;
- uda.uda_cmd.mscp_vcid = 1;
- uda.uda_cmd.mscp_un.un_sccc.sccc_ctlrflags = 0;
-
- command(M_OP_SETCTLRC, 0);
- uda.uda_cmd.mscp_unit=ra->unit;
- command(M_OP_ONLINE, 0);
-
- if (part) {
- uda.uda_cmd.mscp_un.un_seq.seq_buffer = part;
- command(M_OP_POS, 0);
- uda.uda_cmd.mscp_un.un_seq.seq_buffer = 0;
- }
-
- f->f_devdata=(void *)ra;
- return(0);
-}
-
-static
-command(cmd, arg)
-{
- volatile int hej;
-
- uda.uda_cmd.mscp_opcode = cmd;
- uda.uda_cmd.mscp_modifier = arg;
-
- uda.uda_cmd.mscp_msglen = MSCP_MSGLEN;
- uda.uda_rsp.mscp_msglen = MSCP_MSGLEN;
-
- uda.uda_ca.ca_rspdsc |= MSCP_OWN|MSCP_INT;
- uda.uda_ca.ca_cmddsc |= MSCP_OWN|MSCP_INT;
- hej = udacsr->udaip;
- while (uda.uda_ca.ca_rspdsc < 0) {
- if (uda.uda_ca.ca_cmdint)
- uda.uda_ca.ca_cmdint = 0;
- }
-
-}
-
-tmscpstrategy(ra, func, dblk, size, buf, rsize)
- struct ra_softc *ra;
- int func;
- daddr32_t dblk;
- char *buf;
- u_int size, *rsize;
-{
- u_int i,j,pfnum, mapnr, nsize, bn, cn, sn, tn;
- volatile struct udadevice *udadev=(void*)ra->udaddr;
- volatile u_int *ptmapp = (u_int *)ra->ubaddr + 512;
- volatile int hej;
-
- pfnum=(u_int)buf>>VAX_PGSHIFT;
-
- for(mapnr=0, nsize=size;(nsize+VAX_NBPG)>0;nsize-=VAX_NBPG)
- ptmapp[mapnr++]=PG_V|pfnum++;
-
- /*
- * First position tape. Remember where we are.
- */
- if (dblk < curblock) {
- uda.uda_cmd.mscp_seq.seq_bytecount = curblock - dblk;
- command(M_OP_POS, 12); /* 12 == step block backward */
- } else {
- uda.uda_cmd.mscp_seq.seq_bytecount = dblk - curblock;
- command(M_OP_POS, 4); /* 4 == step block forward */
- }
- curblock = size/512 + dblk;
-
- /*
- * Read in the number of blocks we need.
- * Why doesn't read of multiple blocks work?????
- */
- for (i = 0 ; i < size/512 ; i++) {
- uda.uda_cmd.mscp_seq.seq_lbn = 1;
- uda.uda_cmd.mscp_seq.seq_bytecount = 512;
- uda.uda_cmd.mscp_seq.seq_buffer =
- (((u_int)buf) & 0x1ff) + i * 512;
- uda.uda_cmd.mscp_unit = ra->unit;
- command(M_OP_READ, 0);
- }
-
- *rsize=size;
- return 0;
-}
diff --git a/sys/arch/vax/boot/boot/vaxstand.h b/sys/arch/vax/boot/boot/vaxstand.h
index 867d7ba9ebf..c8b41c4bfab 100644
--- a/sys/arch/vax/boot/boot/vaxstand.h
+++ b/sys/arch/vax/boot/boot/vaxstand.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vaxstand.h,v 1.2 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: vaxstand.h,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: vaxstand.h,v 1.5 2000/06/15 19:53:23 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -59,12 +59,6 @@ int net_devinit(struct open_file *f, struct netif_driver *drv, u_char *eaddr);
/* device calls */
int raopen(struct open_file *, int, int, int, int),
rastrategy(void *, int, daddr32_t, size_t, void *, size_t *);
-int hpopen(struct open_file *, int, int, int, int),
- hpstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
-int ctuopen(struct open_file *, int, int, int, int),
- ctustrategy(void *, int, daddr32_t, size_t, void *, size_t *);
-int tmscpopen(struct open_file *, int, int, int, int),
- tmscpstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
int romopen(struct open_file *, int, int, int, int),
romstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
int mfmopen(struct open_file *, int, int, int, int),
@@ -79,7 +73,5 @@ int zeopen(struct open_file *, int, int, int, int),
zeclose(struct open_file *);
int deopen(struct open_file *, int, int, int, int),
declose(struct open_file *);
-int niopen(struct open_file *, int, int, int, int),
- niclose(struct open_file *);
int netopen(struct open_file *), netclose(struct open_file *);
diff --git a/sys/arch/vax/boot/boot/version b/sys/arch/vax/boot/boot/version
index 8bc0f4ed6b7..fafc63cb8a6 100644
--- a/sys/arch/vax/boot/boot/version
+++ b/sys/arch/vax/boot/boot/version
@@ -1,4 +1,4 @@
-$OpenBSD: version,v 1.8 2008/08/26 18:36:21 miod Exp $
+$OpenBSD: version,v 1.9 2011/07/06 18:32:59 miod Exp $
$NetBSD: version,v 1.4 2001/11/09 19:53:15 scw Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
@@ -37,3 +37,4 @@ is taken as the current.
1.14: Support for VaxStation 3[58][24]0.
1.15: Restore boot sd()... functionality on machines with asc(4) or sii(4)
controllers.
+1.16: Remove support for VAX 11/7x0, VAX6000 and VAX8000
diff --git a/sys/arch/vax/boot/common/romread.S b/sys/arch/vax/boot/common/romread.S
index 4de1e0a90f8..18772e4cc7c 100644
--- a/sys/arch/vax/boot/common/romread.S
+++ b/sys/arch/vax/boot/common/romread.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: romread.S,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
+/* $OpenBSD: romread.S,v 1.2 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: romread.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -41,24 +41,6 @@
#include "../include/asm.h"
/*
- * read750 (int block, int *regs)
- */
-ENTRY(read750, 0xFFE)
- movl 8(ap), r8
- movl 4(r8), r1
- movl 8(r8), r2
- movl 12(r8), r3
- movl 24(r8), r6
- clrl r5
- movl 4(ap), r8
- pushl $0
- movl $0, 4(sp)
- movl fp, 0xf0000 # ragge ???
- jsb (r6)
- movl 0xf0000, fp
- ret
-
-/*
* romread_uvax (int lbn, int size, void *buf, struct rpb *rpb)
*/
ENTRY(romread_uvax, 0xFFE)
diff --git a/sys/arch/vax/boot/common/srt0.S b/sys/arch/vax/boot/common/srt0.S
index 8ff71c5a35c..093d3324a30 100644
--- a/sys/arch/vax/boot/common/srt0.S
+++ b/sys/arch/vax/boot/common/srt0.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: srt0.S,v 1.1 2002/06/11 09:36:24 hugh Exp $ */
+/* $OpenBSD: srt0.S,v 1.2 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: srt0.S,v 1.2 2002/03/31 00:11:14 matt Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -68,7 +68,6 @@ relocated: # now relocation is done !!!
halt # no return
ENTRY(machdep_start, 0)
- calls $0,_C_LABEL(niclose) # Evil hack to shutdown DEBNA.
mtpr $0x1f,$0x12 # Block all interrupts
mtpr $0,$0x18 # stop real time interrupt clock
movl 4(ap), r6
diff --git a/sys/arch/vax/boot/common/vaxstand.h b/sys/arch/vax/boot/common/vaxstand.h
index b11d898b0b3..0db8d099de8 100644
--- a/sys/arch/vax/boot/common/vaxstand.h
+++ b/sys/arch/vax/boot/common/vaxstand.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vaxstand.h,v 1.2 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: vaxstand.h,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: vaxstand.h,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,13 +33,10 @@
/* All bugs are subject to removal without further notice */
-#define MAXNMBA 8 /* Massbussadapters */
#define MAXNUBA 8 /* Unibusadapters */
-#define MAXMBAU 8 /* Units on an mba */
/* Variables used in autoconf */
-extern int nmba, nuba, nbi, nsbi, nuda;
-extern int *ubaaddr, *mbaaddr, *udaaddr, *uioaddr, *biaddr;
+extern int *ubaaddr, *mbaaddr, *udaaddr;
extern int cpunumber, howto;
extern dev_t bootdev;
diff --git a/sys/arch/vax/boot/xxboot/Makefile b/sys/arch/vax/boot/xxboot/Makefile
index b20744469d5..4b3a10f5b4a 100644
--- a/sys/arch/vax/boot/xxboot/Makefile
+++ b/sys/arch/vax/boot/xxboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.7 2007/11/25 18:25:33 deraadt Exp $
+# $OpenBSD: Makefile,v 1.8 2011/07/06 18:32:59 miod Exp $
# $NetBSD: Makefile,v 1.12 2002/02/24 01:04:25 matt Exp $
S= ${.CURDIR}/../../../../
@@ -7,7 +7,6 @@ PROG= xxboot
LINKS= ${BINDIR}/xxboot ${BINDIR}/raboot
LINKS+= ${BINDIR}/xxboot ${BINDIR}/hdboot
LINKS+= ${BINDIR}/xxboot ${BINDIR}/sdboot
-LINKS+= ${BINDIR}/xxboot ${BINDIR}/hpboot
WARNS?= 1
SRCS= start.S bootxx.c romread.S str.S urem.s udiv.s
diff --git a/sys/arch/vax/boot/xxboot/bootxx.c b/sys/arch/vax/boot/xxboot/bootxx.c
index debf2c0ee4f..fb13641dae2 100644
--- a/sys/arch/vax/boot/xxboot/bootxx.c
+++ b/sys/arch/vax/boot/xxboot/bootxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootxx.c,v 1.11 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: bootxx.c,v 1.12 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: bootxx.c,v 1.16 2002/03/29 05:45:08 matt Exp $ */
/*-
@@ -49,9 +49,6 @@
#include "machine/rpb.h"
#include "../vax/gencons.h"
-#include "../mba/mbareg.h"
-#include "../mba/hpreg.h"
-
#define NRSP 1 /* Kludge */
#define NCMD 1 /* Kludge */
#define LIBSA_TOO_OLD
@@ -66,8 +63,6 @@
void Xmain(void);
void hoppabort(int);
void romread_uvax(int lbn, int size, void *buf, struct rpb *rpb);
-void hpread(int block);
-int read750(int block, int *regs);
int unit_init(int, struct rpb *, int);
struct open_file file;
@@ -82,13 +77,12 @@ volatile struct udadevice *csr;
static int moved;
extern int from;
-#define FROM750 1
#define FROMMV 2
#define FROMVMB 4
/*
- * The boot block are used by 11/750, 8200, MicroVAX II/III, VS2000,
- * VS3100/??, VS4000 and VAX6000/???, and only when booting from disk.
+ * The boot blocks are used by MicroVAX II/III, VS2000,
+ * VS3100, VS4000, and only when booting from disk.
*/
void
Xmain(void)
@@ -123,9 +117,6 @@ Xmain(void)
rpb->rpb_bootr5 = bootregs[5];
rpb->csrphy = bootregs[2];
rpb->adpphy = bootregs[1]; /* BI node on 8200 */
- if (rpb->devtyp != BDEV_HP && vax_cputype == VAX_TYP_750)
- rpb->adpphy =
- (bootregs[1] == 0xffe000 ? 0xf30000 : 0xf32000);
}
rpb->rpb_base = rpb;
rpb->iovec = (int)bqo;
@@ -233,14 +224,10 @@ devopen(struct open_file *f, const char *fname, char **file)
{
#ifdef LIBSA_TOO_OLD
- int i;
- struct devsw *dp;
f->f_dev = &devsw[0];
#endif
*file = (char *)fname;
- if (from == FROM750)
- return 0;
/*
* Reinit the VMB boot device.
*/
@@ -290,84 +277,13 @@ romstrategy(sc, func, dblk, size, buf, rsize)
}
}
- if (from == FROMMV) {
- romread_uvax(block, size, buf, rpb);
- } else /* if (from == FROM750) */ {
- while (size > 0) {
- if (rpb->devtyp == BDEV_HP)
- hpread(block);
- else
- read750(block, bootregs);
- bcopy(0, buf, 512);
- size -= 512;
- (char *)buf += 512;
- block++;
- }
- }
+ romread_uvax(block, size, buf, rpb);
if (rsize)
*rsize = nsize;
return 0;
}
-/*
- * The 11/750 boot ROM for Massbus disks doesn't seen to have layout info
- * for all RP disks (not RP07 at least) so therefore a very small and dumb
- * device driver is used. It assumes that there is a label on the disk
- * already that has valid layout info. If there is no label, we can't boot
- * anyway.
- */
-
-#define MBA_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((adpadr) + (reg)) = (val)));
-#define MBA_RCSR(reg) \
- (*(volatile u_int32_t *)((adpadr) + (reg)))
-#define HP_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((unitadr) + (reg)) = (val)));
-#define HP_RCSR(reg) \
- (*(volatile u_int32_t *)((unitadr) + (reg)))
-
-void
-hpread(int bn)
-{
- int adpadr = bootregs[1];
- int unitadr = adpadr + MUREG(bootregs[3], 0);
- u_int cn, sn, tn;
- struct disklabel *dp;
- extern char start;
-
- dp = (struct disklabel *)(LABELOFFSET + &start);
- MBA_WCSR(MAPREG(0), PG_V);
-
- MBA_WCSR(MBA_VAR, 0);
- MBA_WCSR(MBA_BC, (~512) + 1);
-#ifdef __GNUC__
- /*
- * Avoid four subroutine calls by using hardware division.
- */
- asm("clrl %r1;"
- "movl %3,%r0;"
- "ediv %4,%r0,%0,%1;"
- "movl %1,%r0;"
- "ediv %5,%r0,%2,%1"
- : "=g"(cn),"=g"(sn),"=g"(tn)
- : "g"(bn),"g"(dp->d_secpercyl),"g"(dp->d_nsectors)
- : "r0","r1","cc");
-#else
- cn = bn / dp->d_secpercyl;
- sn = bn % dp->d_secpercyl;
- tn = sn / dp->d_nsectors;
- sn = sn % dp->d_nsectors;
-#endif
- HP_WCSR(HP_DC, cn);
- HP_WCSR(HP_DA, (tn << 8) | sn);
- HP_WCSR(HP_CS1, HPCS_READ);
-
- while (MBA_RCSR(MBA_SR) & MBASR_DTBUSY)
- ;
- return;
-}
-
extern char end[];
static char *top = (char*)end;
diff --git a/sys/arch/vax/boot/xxboot/start.S b/sys/arch/vax/boot/xxboot/start.S
index ead88591dc4..df019026dc9 100644
--- a/sys/arch/vax/boot/xxboot/start.S
+++ b/sys/arch/vax/boot/xxboot/start.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: start.S,v 1.2 2003/11/07 10:16:45 jmc Exp $ */
+/* $OpenBSD: start.S,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: start.S,v 1.1 2002/02/24 01:04:26 matt Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -64,8 +64,7 @@ _C_LABEL(start):
brb from_0x08 # skip ...
.org 0x0C # 11/750 & 8200 starts here
- movzbl $1,_C_LABEL(from)# We booted from "old" rom.
- brw cont_750
+ halt # not supported
from_0x00: # uVAX from TK50
@@ -132,45 +131,6 @@ start_vmb:
_C_LABEL(from):
.long 0
-/*
- * After bootblock (LBN0) has been loaded into the first page
- * of good memory by 11/750's ROM-code (transfer address
- * of bootblock-code is: base of good memory + 0x0C) registers
- * are initialized as:
- * R0: type of boot-device
- * 0: Massbus device
- * 1: RK06/RK07
- * 2: RL02
- * 17: UDA50
- * 35: TK50
- * 64: TU58
- * R1: (UBA) address of UNIBUS I/O-page
- * (MBA) address of boot device's adapter
- * R2: (UBA) address of the boot device's CSR
- * (MBA) controller number of boot device
- * R6: address of driver subroutine in ROM
- *
- * cont_750 reads in LBN1-15 for further execution.
- */
-cont_750:
- movl $_C_LABEL(start), sp # move stack to avoid clobbering the code
- pushr $0x131 # save clobbered registers
- clrl r4 # %r4 == # of blocks transferred
- movab _C_LABEL(start),r5 # %r5 have base address for next transfer
- pushl r5 # ...on stack also (Why?)
-1: incl r4 # increment block count
- movl r4,r8 # LBN is in %r8 for rom routine
- addl2 $0x200,r5 # Increase address for next read
- cmpl $16,r4 # read 15 blocks?
- beql 2f # Yep
- movl r5,(sp) # move address to stack also
- jsb (r6) # read 512 bytes
- blbs r0,1b # jump if read succeeded
- halt # otherwise die...
-2: tstl (sp)+ # remove boring arg from stack
- popr $0x131 # restore clobbered registers
- brw start_all # Ok, continue...
-
/* uVAX main entry is at the start of the second disk block. This is
* needed for multi-arch CD booting where multiple architecture need
* to shove stuff in boot block 0.
diff --git a/sys/arch/vax/conf/GENERIC b/sys/arch/vax/conf/GENERIC
index a78ad9f8f6a..f75b8ca3347 100644
--- a/sys/arch/vax/conf/GENERIC
+++ b/sys/arch/vax/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.55 2011/06/29 20:52:09 matthew Exp $
+# $OpenBSD: GENERIC,v 1.56 2011/07/06 18:32:59 miod Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -15,10 +15,6 @@ maxusers 8 # estimated number of users
# Here are all different supported CPU types listed.
# One of these is required.
-#option VAX8600
-#option VAX8200
-#option VAX780 # 11/780
-#option VAX750 # 11/750
option VAX630 # MV II
option VAX650 # MV III, 3300, 3600, 3800, 3900
option VAX660 # VAX 4000 200
@@ -40,14 +36,8 @@ config bsd swap generic
mainbus0 at root
# All buses; from the beginning attached to mainbus.
-#abus0 at mainbus0 # Master bus on VAX 8600
-#sbi0 at mainbus0 # SBI, master bus on 11/780.
-#cmi0 at mainbus0 # 11/750 internal bus.
-#bi0 at mainbus0 # VAX 8200
vsbus0 at mainbus0 # All VAXstations but 3[58][24]0
ibus0 at mainbus0 # All Microvax
-#nbi0 at mainbus0 # VAX 8800
-#xmi0 at mainbus0 # VAX 6000
mbus0 at mainbus0 # VS 3[58][24]0
vxtbus0 at mainbus0 # VXT2000
@@ -91,36 +81,10 @@ ze0 at vxtbus0 # SGEC on-board ethernet
qsc0 at vxtbus0 # serial ports
lcspx0 at vxtbus0 # color frame buffer
-# Devices connected at VAXBI
-#cpu* at bi? node? # KA820/KA825 cpu
-#mem* at bi? node? # Memory subsystems
-#uba* at bi? node? # DWBUA BI-Unibus adapter
-#ni* at bi? node? # DEBNA/DEBNT ethernet adapter
-#kdb* at bi? node? # KDB50 MSCP disk ctlr
-#mscpbus* at kdb?
-
-# CMI (VAX 11/750)
-#mem* at cmi? tr? # Memory subsystems
-#uba* at cmi? tr? # Unibus adapters
-#mba* at cmi? tr? # Massbus adapters
-
-# SBI (VAX 11/780, VAX 8600)
-#sbi* at abus0 # VAX 8600 can have up to 4 SBI's.
-
-#mem* at sbi? tr? # Memory subsystems
-#uba* at sbi? tr? # Unibus adapters
-#mba* at sbi? tr? # Massbus adapters
-
-# Devices on Massbus adapters
-#hp* at mba? drive? # RM/RP disk drives
-
# Devices on Unibus/Qbus adapters
uda0 at uba? csr 0172150 # UDA50/RQDX?
uda1 at uba? csr 0160334
mtc0 at uba? csr 0174500 # Tape MSCP ctlr
-#ts0 at uba? csr 0172520 # TS11/TSV05 tape.
-#qd0 at uba? csr 0177400 # 4- or 8-bitplans color graphics
-#qv0 at uba? csr 0177400 # Monochrome graphics
#de0 at uba? csr 0174510 # DELUA/DEUNA
qe0 at uba? csr 0174440 # DEQNA/DELQA
dhu0 at uba? csr 0160440 # DHU-11
@@ -130,7 +94,6 @@ dz0 at uba? csr 0160100 # DZ-11
# MSCP devices
mscpbus* at uda?
mscpbus* at mtc?
-#mscpbus* at kdb?
ra* at mscpbus? drive? # MSCP disk
rx* at mscpbus? drive? # MSCP floppy
@@ -154,9 +117,6 @@ wsdisplay* at lcspx?
wsdisplay* at legss?
wsdisplay* at smg?
-#wsdisplay* at qd0
-#wsdisplay* at qv0
-
lkkbd0 at dz0 line 0
lkkbd0 at qsc0 line 2
wskbd* at lkkbd?
diff --git a/sys/arch/vax/conf/RAMDISK b/sys/arch/vax/conf/RAMDISK
index 1db39e23642..5968620f658 100644
--- a/sys/arch/vax/conf/RAMDISK
+++ b/sys/arch/vax/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.35 2011/06/29 20:52:09 matthew Exp $
+# $OpenBSD: RAMDISK,v 1.36 2011/07/06 18:32:59 miod Exp $
machine vax # machine type
@@ -7,10 +7,6 @@ option MINIROOTSIZE=3072
# Here are all different supported CPU types listed.
# One of these is required.
-#option VAX8600
-#option VAX8200
-#option VAX780 # 11/780
-#option VAX750 # 11/750
option VAX630 # MV II
option VAX650 # MV III, 3300, 3600, 3800, 3900
option VAX660 # VAX 4000 200
@@ -47,14 +43,8 @@ option INSN_EMULATE # CPU lacks some hardware instructions.
mainbus0 at root
# All buses; from the beginning attached to mainbus.
-#abus0 at mainbus0 # Master bus on VAX 8600
-#sbi0 at mainbus0 # SBI, master bus on 11/780.
-#cmi0 at mainbus0 # 11/750 internal bus.
-#bi0 at mainbus0 # VAX 8200
vsbus0 at mainbus0 # All VAXstations
ibus0 at mainbus0 # All Microvax
-#nbi0 at mainbus0 # VAX 8800
-#xmi0 at mainbus0 # VAX 6000
mbus0 at mainbus0 # VS 3[58][24]0
vxtbus0 at mainbus0 # VXT2000
@@ -98,36 +88,10 @@ ze0 at vxtbus0 # SGEC on-board ethernet
qsc0 at vxtbus0 # serial ports
lcspx0 at vxtbus0 # color frame buffer
-# Devices connected at VAXBI
-#cpu* at bi? node? # KA820/KA825 cpu
-#mem* at bi? node? # Memory subsystems
-#uba* at bi? node? # DWBUA BI-Unibus adapter
-#ni* at bi? node? # DEBNA/DEBNT ethernet adapter
-#kdb* at bi? node? # KDB50 MSCP disk ctlr
-#mscpbus* at kdb?
-
-# CMI (VAX 11/750)
-#mem* at cmi? tr? # Memory subsystems
-#uba* at cmi? tr? # Unibus adapters
-#mba* at cmi? tr? # Massbus adapters
-
-# SBI (VAX 11/780, VAX 8600)
-#sbi* at abus0 # VAX 8600 can have up to 4 SBI's.
-
-#mem* at sbi? tr? # Memory subsystems
-#uba* at sbi? tr? # Unibus adapters
-#mba* at sbi? tr? # Massbus adapters
-
-# Devices on Massbus adapters
-#hp* at mba? drive? # RM/RP disk drives
-
# Devices on Unibus/Qbus adapters
uda0 at uba? csr 0172150 # UDA50/RQDX?
uda1 at uba? csr 0160334
mtc0 at uba? csr 0174500 # Tape MSCP ctlr
-#ts0 at uba? csr 0172520 # TS11/TSV05 tape.
-#qd0 at uba? csr 0177400 # 4- or 8-bitplans color graphics
-#qv0 at uba? csr 0177400 # Monochrome graphics
#de0 at uba? csr 0174510 # DELUA/DEUNA
qe0 at uba? csr 0174440 # DEQNA/DELQA
#dhu0 at uba? csr 0160440 # DHU-11
@@ -137,7 +101,6 @@ dz0 at uba? csr 0160100 # DZ-11
# MSCP devices
mscpbus* at uda?
mscpbus* at mtc?
-#mscpbus* at kdb?
ra* at mscpbus? drive? # MSCP disk
rx* at mscpbus? drive? # MSCP floppy
@@ -161,9 +124,6 @@ wsdisplay* at lcspx?
wsdisplay* at legss?
wsdisplay* at smg?
-#wsdisplay* at qd0
-#wsdisplay* at qv0
-
lkkbd0 at dz0 line 0
lkkbd0 at qsc0 line 2
wskbd* at lkkbd?
diff --git a/sys/arch/vax/conf/files.vax b/sys/arch/vax/conf/files.vax
index 3312704cfa6..ad1da032637 100644
--- a/sys/arch/vax/conf/files.vax
+++ b/sys/arch/vax/conf/files.vax
@@ -1,4 +1,4 @@
-# $OpenBSD: files.vax,v 1.53 2011/06/27 03:27:07 tedu Exp $
+# $OpenBSD: files.vax,v 1.54 2011/07/06 18:32:59 miod Exp $
# $NetBSD: files.vax,v 1.60 1999/08/27 20:04:32 ragge Exp $
#
# new style config file for vax architecture
@@ -14,36 +14,9 @@ attach mainbus at root
# Define a bunch of devices, needed in more than one place.
device cpu
-device mem
-device mba {drive = -1}
define dzcons
-# SBI and related devices
-device sbi {tr = -1}
-attach sbi at mainbus with sbi_mainbus
-file arch/vax/vax/sbi.c sbi
-
-attach mem at sbi with mem_sbi
-file arch/vax/vax/ka780.c vax780 | mem_sbi
-file arch/vax/vax/cfl.c vax780 | mem_sbi
-
-# Abus and related devices
-device abus {}
-attach abus at mainbus
-attach sbi at abus with sbi_abus
-file arch/vax/vax/ka860.c abus
-file arch/vax/vax/crl.c abus
-
-# CMI and related devices
-device cmi {tr = -1}
-attach cmi at mainbus
-file arch/vax/vax/cmi.c cmi
-
-attach mem at cmi with mem_cmi
-file arch/vax/vax/ka750.c vax750 | mem_cmi
-file arch/vax/vax/ctu.c vax750 | mem_cmi
-
device vsbus {csr}
attach vsbus at mainbus
file arch/vax/vsa/vsbus.c vsbus
@@ -72,23 +45,6 @@ file arch/vax/vxt/if_ze_vxtbus.c ze_vxtbus
attach le at ibus with le_ibus
file arch/vax/if/if_le.c le_ibus
-attach mba at sbi with mba_sbi
-attach mba at cmi with mba_cmi
-file arch/vax/mba/mba.c mba needs-flag
-
-device hp: disk
-attach hp at mba
-file arch/vax/mba/hp.c hp needs-flag
-major {hp = 0}
-
-device ht: tape
-attach ht at mba
-file arch/vax/mba/ht.c ht needs-flag
-
-# Memory Disk for install floppy
-#file arch/vax/vax/md_root.c memory_disk_hooks
-#major {md = 23}
-
# MSCP device drivers
include "arch/vax/mscp/files.mscp"
major {ra = 9}
@@ -98,25 +54,6 @@ include "arch/vax/qbus/files.uba"
attach uba at ibus with uba_ibus
file arch/vax/uba/uba_ibus.c uba_ibus
-attach uba at sbi with uba_sbi
-file arch/vax/uba/uba_sbi.c uba_sbi
-attach uba at cmi with uba_cmi
-file arch/vax/uba/uba_cmi.c uba_cmi
-
-# BI bus definitions
-#include "arch/vax/bi/files.bi"
-
-#attach bi at mainbus with bi_mainbus
-#file arch/vax/bi/bi_mainbus.c bi_mainbus
-
-# VAX CPUs at BI, do not belong in MI code.
-#attach cpu at bi with cpu_bi
-#attach mem at bi with mem_bi
-
-# TS11 at UBA
-device ts: tape
-attach ts at uba
-file arch/vax/uba/ts.c ts needs-flag
attach dz at vsbus with dz_vsbus: dzcons
file arch/vax/vsa/dz_ibus.c dz_vsbus
@@ -210,141 +147,6 @@ file arch/vax/vxt/qscms.c qscms needs-flag
file arch/vax/dec/dzinput.c dzkbd | dzms
-# These devices aren't tested (or even compiled!)
-# They are just included here to make some files happy ;)
-#
-
-# Ikonas framebuffer
-device ik
-attach ik at uba
-file arch/vax/uba/ik.c ik needs-flag
-
-device vs
-attach vs at uba
-file arch/vax/uba/vs.c vs needs-flag
-
-# RK06/07 on UBA
-device rk: disk
-attach rk at uba
-file arch/vax/uba/rk.c rk needs-flag
-
-# TM11/TE10 at UBA
-device te: tape
-attach te at uba
-file arch/vax/uba/tm.c te needs-flag
-
-# TU78 at MBA
-device mu: tape
-attach mu at mba
-file arch/vax/mba/mt.c mu needs-flag
-
-# DMF32 on UBA
-device dmf # XXX?
-attach dmf at uba
-file arch/vax/uba/dmf.c dmf needs-flag
-file arch/vax/uba/dmz.c dmf needs-flag
-
-# DMZ32 on UBA
-device dmz # XXX?
-attach dmz at uba
-file arch/vax/uba/dmx.c dmz needs-flag
-
-# DN-11 on UBA
-device dn # XXX?
-attach dn at uba
-file arch/vax/uba/dn.c dn needs-flag
-
-# IDC (RB730) on UBA (VAX 11/730)
-device idc {drive = -1}
-attach idc at uba
-device rb: disk
-attach rb at idc
-file arch/vax/uba/idc.c rb needs-flag
-
-# LP-11 at UBA
-device lp
-attach lp at uba
-file arch/vax/uba/lp.c lp needs-flag
-
-# ???? at UBA
-device lpa
-attach lpa at uba
-file arch/vax/uba/lpa.c lpa needs-flag
-
-# PS2 at UBA
-device ps
-attach ps at uba
-file arch/vax/uba/ps.c ps needs-flag
-
-# RL02/RL11 at UBA
-#device hl {drive = -1}
-#attach hl at uba
-#device rl: disk
-#attach rl at hl
-#file arch/vax/uba/rl.c rl needs-flag
-
-# SC-21/SC-31 at UBA
-device sc {drive = -1}
-attach sc at uba
-device up: disk
-attach up at sc
-file arch/vax/uba/up.c up needs-flag
-
-# TU45 at UBA
-device ut {drive = -1}
-attach ut at uba
-device tj: tape
-attach tj at ut
-file arch/vax/uba/ut.c tj needs-flag
-
-# TU58/DECtape II
-device uu: tape
-attach uu at uba
-file arch/vax/uba/uu.c uu needs-flag
-
-# Benson-Varian plotter at UBA
-device va {drive = -1}
-attach va at uba
-device vz
-attach vz at va
-file arch/vax/uba/va.c va needs-flag
-
-# Versatec plotter at UBA
-device vp
-attach vp at uba
-file arch/vax/uba/vp.c vp needs-flag
-
-# QVSS at UBA
-device qv
-attach qv at uba
-file arch/vax/uba/qv.c qv needs-flag
-
-# Interlan NP100 at UBA
-device np: ifnet
-attach np at uba
-file arch/vax/if/if_ix.c np needs-flag
-file arch/vax/uba/np.c np needs-flag
-
-# ACC LH/DH IMP on UBA
-device acc: ifnet
-attach acc at uba
-file arch/vax/if/if_acc.c acc needs-flag
-
-# DR11C at UBA
-device ct # XXX
-attach ct at uba
-file arch/vax/uba/ct.c ct needs-flag
-
-# A/D-converter on UBA
-device ad
-attach ad at uba
-file arch/vax/uba/ad.c ad needs-flag
-
-# DH-11/DM-11 on UBA
-device dh # XXX?
-attach dh at uba
-file arch/vax/uba/dh.c dh needs-flag
-
# M-bus on VS 3[58][24]0
include "arch/vax/mbus/files.mbus"
@@ -360,14 +162,14 @@ file arch/vax/vax/bus_dma.c
file arch/vax/vax/bus_mem.c
file arch/vax/vax/clock.c
file arch/vax/vax/conf.c
-file arch/vax/vax/crx.c vax8200
file arch/vax/vax/cvax.c vax60 | vax650
file arch/vax/vax/db_disasm.c ddb
file arch/vax/vax/db_machdep.c ddb
file arch/vax/vax/disksubr.c disk | tape
file arch/vax/vax/emulate.s insn_emulate
file arch/vax/vax/findcpu.c
-file arch/vax/vax/gencons.c vax8600|vax8200|vax780|vax750|vax630|vax650|vax660|vax670|vax680
+file arch/vax/vax/gencons.c vax630 | vax650 | vax660 |
+ vax670 | vax680
file arch/vax/vax/in_cksum.c inet
file arch/vax/vax/in4_cksum.c inet
file arch/vax/vax/ka410.c vax410
@@ -382,7 +184,6 @@ file arch/vax/vax/ka650.c vax650
file arch/vax/vax/ka660.c vax660
file arch/vax/vax/ka670.c vax670
file arch/vax/vax/ka680.c vax680
-file arch/vax/vax/ka820.c vax8200
file arch/vax/vax/machdep.c
file arch/vax/vax/mem.c
file arch/vax/vax/mutex.c
@@ -400,27 +201,6 @@ file arch/vax/vax/vxt.c vxt
file arch/vax/vax/wscons_machdep.c wsdisplay | wskbd
file arch/vax/uba/uba_dma.c uba
-# Keep these for now. Time will tell which we will need...
-#arch/vax/vax/dkbad.c standard
-#arch/vax/vax/ka730.c standard
-#arch/vax/vax/iidr.o optional ii
-#arch/vax/vax/iidrsys.o optional ii
-#arch/vax/vax/iidr_glob.o optional ii
-#arch/vax/if/if_css.c optional css imp device-driver
-#arch/vax/if/if_dp.c optional dp device-driver
-#arch/vax/if/if_ddn.c optional ddn device-driver
-#arch/vax/if/if_dmc.c optional dmc device-driver
-#arch/vax/if/if_dmv.c optional dmv device-driver
-#arch/vax/if/if_ec.c optional ec device-driver
-#arch/vax/if/if_en.c optional en device-driver
-#arch/vax/if/if_ex.c optional ex device-driver
-#arch/vax/if/if_hdh.c optional hdh device-driver
-#arch/vax/if/if_hy.c optional hy device-driver
-#arch/vax/if/if_il.c optional il device-driver
-#arch/vax/if/if_pcl.c optional pcl device-driver
-#arch/vax/if/if_vv.c optional vv device-driver
-#arch/vax/if/raw_hy.c optional hy device-driver
-
# quad support is necessary for 32 bit architectures
file lib/libkern/adddi3.c
file lib/libkern/anddi3.c
diff --git a/sys/arch/vax/consolerl/Makefile b/sys/arch/vax/consolerl/Makefile
deleted file mode 100644
index a36978efd2e..00000000000
--- a/sys/arch/vax/consolerl/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# $OpenBSD: Makefile,v 1.2 1997/05/29 00:04:30 niklas Exp $
-# $NetBSD: Makefile,v 1.1 1996/03/08 12:41:33 ragge Exp $
-
-BOOTS= boot
-STDBOOS= defboo.com anyboo.com
-DEFBOOS= defboo.hk defboo.hp defboo.ra defboo.up
-DEVBOOS= hkmboo.com hksboo.com hpmboo.com hpsboo.com \
- ramboo.com rasboo.com upmboo.com upsboo.com
-#UTILS= format copy drtest
-# order is NOT random...
-OBJS= ${BOOTS} ${STDBOOS} ${DEVBOOS} ${UTILS}
-DRIVE= /dev/crl
-
-# build a boot console rl02 from a DEC console rl02 pack
-update: ${OBJS}
- arff rmf ${DRIVE} ${OBJS}
- -rm -f defboo.com
-
-defboo.com:
- @echo You must copy one of ${DEFBOOS} to defboo.com.
- @echo See installing and operating guide for details.
- @/bin/false #force exits
-
-boot: ../boot/boot
- (cd ../boot;make boot)
- dd if=../boot/boot of=boot bs=32 skip=1
-
-clean:
- rm -f ${BOOTS} ${UTILS} defboo.com
diff --git a/sys/arch/vax/consolerl/anyboo.com b/sys/arch/vax/consolerl/anyboo.com
deleted file mode 100644
index d10e93242fd..00000000000
--- a/sys/arch/vax/consolerl/anyboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! Conversational boot to single user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 0 ! Not used for conversational boot
-DEPOSIT R11 3 ! Software boot flags (conversational and single)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/defboo.hk b/sys/arch/vax/consolerl/defboo.hk
deleted file mode 100644
index 91afd768200..00000000000
--- a/sys/arch/vax/consolerl/defboo.hk
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! rk07 drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 3 ! rk07 drive type - uba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/defboo.hp b/sys/arch/vax/consolerl/defboo.hp
deleted file mode 100644
index ca3f5b2b0a6..00000000000
--- a/sys/arch/vax/consolerl/defboo.hp
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'hp' drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 0 ! 'hp' drive type - mba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/defboo.ra b/sys/arch/vax/consolerl/defboo.ra
deleted file mode 100644
index 7c6e5aae128..00000000000
--- a/sys/arch/vax/consolerl/defboo.ra
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'ra' MSCP drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 9 ! 'ra' MSCP drive type - uba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/defboo.up b/sys/arch/vax/consolerl/defboo.up
deleted file mode 100644
index b394b49403e..00000000000
--- a/sys/arch/vax/consolerl/defboo.up
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'up' drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 2 ! 'up' drive type - uba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/hkmboo.com b/sys/arch/vax/consolerl/hkmboo.com
deleted file mode 100644
index 91afd768200..00000000000
--- a/sys/arch/vax/consolerl/hkmboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! rk07 drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 3 ! rk07 drive type - uba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/hksboo.com b/sys/arch/vax/consolerl/hksboo.com
deleted file mode 100644
index ca20e30f60e..00000000000
--- a/sys/arch/vax/consolerl/hksboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! rk07 drive type boot to single user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 3 ! rk07 drive type - uba0 - drive 0
-DEPOSIT R11 2 ! Software boot flags (single user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/hpmboo.com b/sys/arch/vax/consolerl/hpmboo.com
deleted file mode 100644
index ca3f5b2b0a6..00000000000
--- a/sys/arch/vax/consolerl/hpmboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'hp' drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 0 ! 'hp' drive type - mba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/hpsboo.com b/sys/arch/vax/consolerl/hpsboo.com
deleted file mode 100644
index 4b9d6be9111..00000000000
--- a/sys/arch/vax/consolerl/hpsboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'hp' drive type boot to single user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 0 ! 'hp' drive type - mba0 - drive 0
-DEPOSIT R11 2 ! Software boot flags (single user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/ramboo.com b/sys/arch/vax/consolerl/ramboo.com
deleted file mode 100644
index 7c6e5aae128..00000000000
--- a/sys/arch/vax/consolerl/ramboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'ra' MSCP drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 9 ! 'ra' MSCP drive type - uba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/rasboo.com b/sys/arch/vax/consolerl/rasboo.com
deleted file mode 100644
index 9e43ec98c50..00000000000
--- a/sys/arch/vax/consolerl/rasboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'ra' MSCP drive type boot to single user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 9 ! 'ra' MSCP drive type - uba0 - drive 0
-DEPOSIT R11 2 ! Software boot flags (single user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/upmboo.com b/sys/arch/vax/consolerl/upmboo.com
deleted file mode 100644
index b394b49403e..00000000000
--- a/sys/arch/vax/consolerl/upmboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'up' drive type boot to multi user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 2 ! 'up' drive type - uba0 - drive 0
-DEPOSIT R11 0 ! Software boot flags (multi user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/consolerl/upsboo.com b/sys/arch/vax/consolerl/upsboo.com
deleted file mode 100644
index 2420463aac1..00000000000
--- a/sys/arch/vax/consolerl/upsboo.com
+++ /dev/null
@@ -1,18 +0,0 @@
-!
-! Load 'boot.' and boot 4.3BSD.
-!
-! 'up' drive type boot to single user mode
-!
-!
-SET SNAP ON ! Enable ERROR_HALT snapshots
-SET FBOX OFF ! System will turn on Fbox
-INIT ! SRM processor init
-UNJAM ! UNJAM SBIA's and enable master sbia interrupts
-INIT/PAMM ! INIT physical address memory map
-DEPOSIT CSWP 8 ! Turn off the cache - System will enable cache
-
-DEPOSIT R10 2 ! 'up' drive type - uba0 - drive 0
-DEPOSIT R11 2 ! Software boot flags (single user mode)
-
-LOAD/START:0 BOOT. ! Load 'boot.' at memory location 0
-START 2 ! Start 'boot.' at the address 2
diff --git a/sys/arch/vax/floppy/Makefile b/sys/arch/vax/floppy/Makefile
deleted file mode 100644
index 0afacaadceb..00000000000
--- a/sys/arch/vax/floppy/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-# $OpenBSD: Makefile,v 1.2 1997/05/29 00:04:31 niklas Exp $
-# $NetBSD: Makefile,v 1.1 1996/03/02 17:57:34 ragge Exp $
-
-# Make a 780 rx01 floppy
-#
-BOOTS= boot
-STDBOO= defboo.cmd anyboo.cmd restar.cmd
-DEFBOO= defboo.hk defboo.hp defboo.ra defboo.up
-DEVBOO= hkmboo.cmd hksboo.cmd hpmboo.cmd hpsboo.cmd \
- ramboo.cmd rasboo.cmd upmboo.cmd upsboo.cmd
-UTILS= format copy drtest
-
-# order is NOT random...
-OBJS= ${BOOTS} ${STDBOO} ${DEVBOO} ${UTILS}
-FROMDEC=du* dm* db* s[mbr]* *boo.* vmb.exe *.hlp cs* ci*
-
-FLOPPY= /dev/floppy
-#FLOPPY= /dev/rrx0b # for using RX device
-
-all: floppy
-
-floppy: 3tracks ${OBJS}
- cp 3tracks floppy
- arff crf floppy ${OBJS}
-
-install: floppy
- dd if=floppy of=${FLOPPY}
-
-# build a boot floppy from a DEC console floppy
-update: ${OBJS}
- -mkdir fromdec
- cd fromdec; arff xf ${FLOPPY}; rm -f ${FROMDEC} ${OBJS} ${DEFBOO}; \
- flcopy -t3 -f ${FLOPPY}; rm -f floppy; arff crf ${FLOPPY} *
- rm -rf fromdec
- arff rf ${FLOPPY} ${OBJS}
- -rm -f defboo.cmd
-
-defboo.cmd:
- @echo You must copy one of \{${DEFBOO}\} to defboo.cmd.
- @echo See installing and operating guide for details.
- @/bin/false #force exits
-
-clean:
- rm -f ${BOOTS} ${UTILS} floppy defboo.cmd
- rm -rf fromdec
diff --git a/sys/arch/vax/floppy/NOTE b/sys/arch/vax/floppy/NOTE
deleted file mode 100644
index a0936cfb5ed..00000000000
--- a/sys/arch/vax/floppy/NOTE
+++ /dev/null
@@ -1,5 +0,0 @@
-This are the boot files needed to boot up a 11/780 system.
-BUT; both arff and flcopy are missing from the distribution;
-neither is there a driver for the LSI11 RX01 in the kernel.
-Anyway, these files must be installed on the console RX01
-to be able to boot up a 11/780 system.
diff --git a/sys/arch/vax/floppy/anyboo.cmd b/sys/arch/vax/floppy/anyboo.cmd
deleted file mode 100644
index 2e4159eefe2..00000000000
--- a/sys/arch/vax/floppy/anyboo.cmd
+++ /dev/null
@@ -1,15 +0,0 @@
-!
-! BOOTSTRAP ANY DEVICE TO A SINGLE USER SHELL
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D R8 0 ! MEMORY NOT COUNTED
-D R11 3 ! 3=RB_ASKNAME+RB_SINGLE
-D R10 0 ! DEVICE CHOICE ISNT APPLICABLE
-D AP FFFFFFFF ! WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/defboo.MS780C-interleaved b/sys/arch/vax/floppy/defboo.MS780C-interleaved
deleted file mode 100644
index ced73085ad1..00000000000
--- a/sys/arch/vax/floppy/defboo.MS780C-interleaved
+++ /dev/null
@@ -1,17 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-D 20002000 101
-D 20004000 101
-D 20004004 4000
-LOAD BOOT
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G A 0 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK)
-START 2
diff --git a/sys/arch/vax/floppy/defboo.hk b/sys/arch/vax/floppy/defboo.hk
deleted file mode 100644
index 26cc2627734..00000000000
--- a/sys/arch/vax/floppy/defboo.hk
+++ /dev/null
@@ -1,14 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G A 3 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK, 9=RA)
-START 2
diff --git a/sys/arch/vax/floppy/defboo.hp b/sys/arch/vax/floppy/defboo.hp
deleted file mode 100644
index 497e6c5c86e..00000000000
--- a/sys/arch/vax/floppy/defboo.hp
+++ /dev/null
@@ -1,16 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G 8 0 ! MEMORY IS NOT COUNTED IN BOOT
-D/G A 0 ! DEV TO BOOT FROM, SEE CODING IN REBOOT.H AND RPB.H
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G C FFFFFFFF ! SHOW THAT WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/defboo.kra b/sys/arch/vax/floppy/defboo.kra
deleted file mode 100644
index a09d592326b..00000000000
--- a/sys/arch/vax/floppy/defboo.kra
+++ /dev/null
@@ -1,14 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G A 10 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK, 9=RA, 16=KRA)
-START 2
diff --git a/sys/arch/vax/floppy/defboo.ra b/sys/arch/vax/floppy/defboo.ra
deleted file mode 100644
index 1143c7b05ed..00000000000
--- a/sys/arch/vax/floppy/defboo.ra
+++ /dev/null
@@ -1,16 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G 8 0 ! MEMORY IS NOT COUNTED IN BOOT
-D/G A 11 ! DEV TO BOOT FROM, SEE CODING IN REBOOT.H AND RPB.H
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G C FFFFFFFF ! SHOW THAT WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/defboo.up b/sys/arch/vax/floppy/defboo.up
deleted file mode 100644
index 655e3dd45b8..00000000000
--- a/sys/arch/vax/floppy/defboo.up
+++ /dev/null
@@ -1,14 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G A 2 ! DEV TO BOOT FROM (0=HP, 2=UP, 3=HK, 9=RA)
-START 2
diff --git a/sys/arch/vax/floppy/hkmboo.cmd b/sys/arch/vax/floppy/hkmboo.cmd
deleted file mode 100644
index db424340872..00000000000
--- a/sys/arch/vax/floppy/hkmboo.cmd
+++ /dev/null
@@ -1,13 +0,0 @@
-!
-! BOOTSTRAP ON HK, GOING MULTI USER
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D R10 3 ! DEVICE CHOICE 3=HK
-D R11 0 ! 0= AUTOBOOT
-START 2
diff --git a/sys/arch/vax/floppy/hksboo.cmd b/sys/arch/vax/floppy/hksboo.cmd
deleted file mode 100644
index 670f9e6dfbf..00000000000
--- a/sys/arch/vax/floppy/hksboo.cmd
+++ /dev/null
@@ -1,13 +0,0 @@
-!
-! BOOTSTRAP ON HK, LEAVING SINGLE USER
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D R10 3 ! DEVICE CHOICE 3=HK
-D R11 2 ! 2= RB_SINGLE
-START 2
diff --git a/sys/arch/vax/floppy/hpmboo.cmd b/sys/arch/vax/floppy/hpmboo.cmd
deleted file mode 100644
index 497e6c5c86e..00000000000
--- a/sys/arch/vax/floppy/hpmboo.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G 8 0 ! MEMORY IS NOT COUNTED IN BOOT
-D/G A 0 ! DEV TO BOOT FROM, SEE CODING IN REBOOT.H AND RPB.H
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G C FFFFFFFF ! SHOW THAT WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/hpsboo.cmd b/sys/arch/vax/floppy/hpsboo.cmd
deleted file mode 100644
index de805fb7aec..00000000000
--- a/sys/arch/vax/floppy/hpsboo.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO SINGLE-USER AFTER BOOT
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G 8 0 ! MEMORY IS NOT COUNTED IN BOOT
-D/G A 0 ! DEV TO BOOT FROM, SEE CODING IN REBOOT.H AND RPB.H
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G C FFFFFFFF ! SHOW THAT WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/ramboo.cmd b/sys/arch/vax/floppy/ramboo.cmd
deleted file mode 100644
index 1143c7b05ed..00000000000
--- a/sys/arch/vax/floppy/ramboo.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO MULTI-USER AFTER CHECKING; BOOT FROM DEFAULT DEVICE
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G 8 0 ! MEMORY IS NOT COUNTED IN BOOT
-D/G A 11 ! DEV TO BOOT FROM, SEE CODING IN REBOOT.H AND RPB.H
-D/G B 0 ! BOOT PARAMETERS: MULTI USER AFTER CHECK
-D/G C FFFFFFFF ! SHOW THAT WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/rasboo.cmd b/sys/arch/vax/floppy/rasboo.cmd
deleted file mode 100644
index c6e7138f3b7..00000000000
--- a/sys/arch/vax/floppy/rasboo.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-!
-! BOOTSTRAP BY BOOT() SYSCALL
-! GO SINGLE-USER AFTER BOOT
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D/G 8 0 ! MEMORY IS NOT COUNTED IN BOOT
-D/G A 11 ! DEV TO BOOT FROM, SEE CODING IN REBOOT.H AND RPB.H
-D/G B 2 ! BOOT PARAMETERS: SINGLE USER AFTER CHECK
-D/G C FFFFFFFF ! SHOW THAT WE ARE NOT NETBOOTED
-START 22
diff --git a/sys/arch/vax/floppy/restar.cmd b/sys/arch/vax/floppy/restar.cmd
deleted file mode 100644
index 64e345dfb88..00000000000
--- a/sys/arch/vax/floppy/restar.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-! RESTART COMMMAND FILE
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT ! HALT PROCESSOR
-UNJAM ! UNJAM SBI
-INIT ! INITIALIZE PROCESSOR
-D/I 11 20003800 ! SET SCBB TO ROM
-D/G 0 0
-D/G 1 3 ! UBA TR NUMBER
-D/G 2 0
-D/G 3 0
-D/G 4 0
-D/G 5 0
-D/G FP 0
-S 20003004
diff --git a/sys/arch/vax/floppy/upmboo.cmd b/sys/arch/vax/floppy/upmboo.cmd
deleted file mode 100644
index 41be64da676..00000000000
--- a/sys/arch/vax/floppy/upmboo.cmd
+++ /dev/null
@@ -1,13 +0,0 @@
-!
-! BOOTSTRAP ON UP, GOING MULTI USER
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D R10 2 ! DEVICE CHOICE 2=UP
-D R11 0 ! 0= AUTOBOOT
-START 2
diff --git a/sys/arch/vax/floppy/upsboo.cmd b/sys/arch/vax/floppy/upsboo.cmd
deleted file mode 100644
index af96678067b..00000000000
--- a/sys/arch/vax/floppy/upsboo.cmd
+++ /dev/null
@@ -1,13 +0,0 @@
-!
-! BOOTSTRAP ON UP, LEAVING SINGLE USER
-!
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-LOAD BOOT
-D R10 2 ! DEVICE CHOICE 2=UP
-D R11 2 ! 2= RB_SINGLE
-START 2
diff --git a/sys/arch/vax/floppy/utboot.cmd b/sys/arch/vax/floppy/utboot.cmd
deleted file mode 100644
index fe89eb5ebea..00000000000
--- a/sys/arch/vax/floppy/utboot.cmd
+++ /dev/null
@@ -1,20 +0,0 @@
-SET DEF HEX
-SET DEF LONG
-SET REL:0
-HALT
-UNJAM
-INIT
-D/P 200 0036EFD0
-D + D0510000
-D + 2000008F
-D + 0800C180
-D + 0804C1D4
-D + 0026EFD0
-D + C8520000
-D + 00F5208F
-D + 8FB05200
-D + 1AA204C0
-02008fae 8fae06a2
-0000060 02a20100 b004a2b4 00006239 20006000
-0000100 2013e000
-0000104
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h
index 924a18c8419..cf9be972be7 100644
--- a/sys/arch/vax/include/cpu.h
+++ b/sys/arch/vax/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.37 2011/03/23 16:54:37 pirofti Exp $ */
+/* $OpenBSD: cpu.h,v 1.38 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $ */
/*
@@ -152,7 +152,6 @@ void dumpconf(void);
void dumpsys(void);
void swapconf(void);
void disk_printtype(int, int);
-void disk_reallymapin(struct buf *, pt_entry_t *, int, int);
vaddr_t vax_map_physmem(paddr_t, int);
void vax_unmap_physmem(vaddr_t, int);
void ioaccess(vaddr_t, paddr_t, int);
diff --git a/sys/arch/vax/include/ioa.h b/sys/arch/vax/include/ioa.h
deleted file mode 100644
index 0378c1d8203..00000000000
--- a/sys/arch/vax/include/ioa.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $OpenBSD: ioa.h,v 1.8 2003/06/02 23:27:57 millert Exp $ */
-/* $NetBSD: ioa.h,v 1.6 2000/01/24 02:40:32 matt Exp $ */
-/*-
- * Copyright (c) 1982, 1986 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)ioa.h 7.3 (Berkeley) 5/9/91
- */
-
-/****************************************************************
- * *
- * Licensed from Digital Equipment Corporation *
- * Copyright (c) *
- * Digital Equipment Corporation *
- * Maynard, Massachusetts *
- * 1985, 1986 *
- * All rights reserved. *
- * *
- * The Information in this software is subject to change *
- * without notice and should not be construed as a commitment *
- * by Digital Equipment Corporation. Digital makes no *
- * representations about the suitability of this software for *
- * any purpose. It is supplied "As Is" without expressed or *
- * implied warranty. *
- * *
- * If the Regents of the University of California or its *
- * licensees modify the software in a manner creating *
- * derivative copyright rights, appropriate copyright *
- * legends may be placed on the derivative work in addition *
- * to that set forth above. *
- * *
- ****************************************************************/
-
-#if VAX8600
-#define MAXNIOA 4
-#define NIOA8600 2
-#define IOASIZE 0x2000000
-#define IOAMAPSIZ 512 /* Map one page to get at SBIA regs */
-#define IOA8600(i) ((caddr_t)(0x20080000+IOASIZE*i))
-
-struct sbia_regs
-{
- int sbi_cfg;
- int sbi_csr;
- int sbi_errsum;
- int sbi_dctl;
- int sbi_dmaica;
- int sbi_dmaiid;
- int sbi_dmaaca;
- int sbi_dmaaid;
- int sbi_dmabcs;
- int sbi_dmabid;
- int sbi_dmaccs;
- int sbi_dmacid;
- int sbi_silo;
- int sbi_error;
- int sbi_timo;
- int sbi_fltsts;
- int sbi_silcmp;
- int sbi_maint;
- int sbi_unjam;
- int sbi_qclr;
- int sbi_unused[12];
- int sbi_iv10;
- int sbi_iv11;
- int sbi_iv12;
- int sbi_iv13;
- int sbi_iv14;
- int sbi_iv15;
- int sbi_iv16;
- int sbi_iv17;
- int sbi_iv18;
- int sbi_iv19;
- int sbi_iv1a;
- int sbi_iv1b;
- int sbi_iv1c;
- int sbi_iv1d;
- int sbi_iv1e;
-};
-struct ioa {
- union ioacsr {
- long ioa_csr;
- u_char ioa_type;
- } ioacsr;
- long ioa_pad[IOAMAPSIZ / sizeof (long) - 1];
-};
-
-#define IOA_TYPMSK 0xf0
-#define IOA_SBIA 0x10
-
-#endif /* VAX8600 */
diff --git a/sys/arch/vax/include/ka750.h b/sys/arch/vax/include/ka750.h
deleted file mode 100644
index e796295b6d8..00000000000
--- a/sys/arch/vax/include/ka750.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $NetBSD: ka750.h,v 1.8 1997/02/12 17:58:56 ragge Exp $ */
-/* $OpenBSD: ka750.h,v 1.8 2000/04/26 03:08:41 bjc Exp $ */
-
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-#include <machine/nexus.h>
-
-#define V750UCODE(x) ((x>>8)&255)
-#define V750HARDW(x) (x&255)
-
-#define NNEX750 NNEXSBI
-#define NEX750 (0xf20000)
-#define NEX750SZ (NNEX750 * sizeof(struct nexus))
-
-/* 11/750 specific pages needed to be stolen when bootstrapping */
-#define V750PGS 4
diff --git a/sys/arch/vax/include/ka820.h b/sys/arch/vax/include/ka820.h
deleted file mode 100644
index 45544ce9ce7..00000000000
--- a/sys/arch/vax/include/ka820.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* $OpenBSD: ka820.h,v 1.5 2003/06/02 23:27:57 millert Exp $ */
-/* $NetBSD: ka820.h,v 1.3 2000/01/24 02:40:32 matt Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)ka820.h 7.3 (Berkeley) 6/28/90
- */
-
-/*
- * Definitions specific to the ka820 cpu.
- */
-
-/*
- * Device addresses.
- */
-#define KA820_PORTADDR 0x20088000 /* port controller */
-#define KA820_BRAMADDR 0x20090000 /* boot ram */
-#define KA820_EEPROMADDR 0x20098000 /* eeprom */
-#define KA820_RX50ADDR 0x200b0000 /* rcx50 */
-#define KA820_CLOCKADDR 0x200b8000 /* watch chip */
-
-/*
- * Sizes. The port controller, RCX50, and watch chip are all one page.
- */
-#define KA820_BRPAGES 16 /* 8K */
-#define KA820_EEPAGES 64 /* 32K */
-
-/* port controller CSR bit values */
-#define KA820PORT_RSTHALT 0x80000000 /* restart halt */
-#define KA820PORT_LCONS 0x40000000 /* logical console */
-#define KA820PORT_LCONSEN 0x20000000 /* logical console enable */
-#define KA820PORT_BIRESET 0x10000000 /* BI reset */
-#define KA820PORT_BISTF 0x08000000 /* ??? */
-#define KA820PORT_ENBAPT 0x04000000 /* ??? */
-#define KA820PORT_STPASS 0x02000000 /* self test pass */
-#define KA820PORT_RUN 0x01000000 /* run */
-#define KA820PORT_WWPE 0x00800000 /* ??? parity even? */
-#define KA820PORT_EVLCK 0x00400000 /* event lock */
-#define KA820PORT_WMEM 0x00200000 /* write mem */
-#define KA820PORT_EV4 0x00100000 /* event 4 */
-#define KA820PORT_EV3 0x00080000 /* event 3 */
-#define KA820PORT_EV2 0x00040000 /* event 2 */
-#define KA820PORT_EV1 0x00020000 /* event 1 */
-#define KA820PORT_EV0 0x00010000 /* event 0 */
-#define KA820PORT_WWPO 0x00008000 /* ??? parity odd? */
-#define KA820PORT_PERH 0x00004000 /* parity error H */
-#define KA820PORT_ENBPIPE 0x00002000 /* enable? pipe */
-#define KA820PORT_TIMEOUT 0x00001000 /* timeout */
-#define KA820PORT_RSVD 0x00000800 /* reserved */
-#define KA820PORT_CONSEN 0x00000400 /* console interrupt enable */
-#define KA820PORT_CONSCLR 0x00000200 /* clear console interrupt */
-#define KA820PORT_CONSINTR 0x00000100 /* console interrupt req */
-#define KA820PORT_RXIE 0x00000080 /* RX50 interrupt enable */
-#define KA820PORT_RXCLR 0x00000040 /* clear RX50 interrupt */
-#define KA820PORT_RXIRQ 0x00000020 /* RX50 interrupt request */
-#define KA820PORT_IPCLR 0x00000010 /* clear IP interrupt */
-#define KA820PORT_IPINTR 0x00000008 /* IP interrupt request */
-#define KA820PORT_CRDEN 0x00000004 /* enable CRD interrupts */
-#define KA820PORT_CRDCLR 0x00000002 /* clear CRD interrupt */
-#define KA820PORT_CRDINTR 0x00000001 /* CRD interrupt request */
-
-/* interrupt vectors unique for this CPU */
-#define KA820_INT_RXCD 0x58
-
-/* what the heck */
-#define KA820PORT_BITS \
-"\20\40RSTHALT\37LCONS\36LCONSEN\35BIRESET\34BISTF\33ENBAPT\32STPASS\31RUN\
-\30WWPE\27EVLCK\26WMEM\25EV4\24EV3\23EV2\22EV1\21EV\20WWPO\17PERH\16ENBPIPE\
-\15TIMEOUT\13CONSEN\12CONSCLR\11CONSINTR\10RXIE\7RXCLR\6RXIRQ\5IPCLR\4IPINTR\
-\3CRDEN\2CLRCLR\1CRDINTR"
-
-/* clock CSR bit values, per csr */
-#define KA820CLK_0_BUSY 0x01 /* busy (time changing) */
-#define KA820CLK_1_GO 0x0c /* run */
-#define KA820CLK_1_SET 0x0d /* set the time */
-#define KA820CLK_3_VALID 0x01 /* clock is valid */
-
-#ifndef LOCORE
-struct ka820port {
- u_long csr;
- /* that seems to be all.... */
-};
-
-struct ka820clock {
- u_char sec;
- u_char pad0;
- u_char secalrm;
- u_char pad1;
- u_char min;
- u_char pad2;
- u_char minalrm;
- u_char pad3;
- u_char hr;
- u_char pad4;
- u_char hralrm;
- u_char pad5;
- u_char dayofwk;
- u_char pad6;
- u_char day;
- u_char pad7;
- u_char mon;
- u_char pad8;
- u_char yr;
- u_char pad9;
- u_short csr0;
- u_short csr1;
- u_short csr2;
- u_short csr3;
-};
-
-void crxintr(void *arg);
-#endif
diff --git a/sys/arch/vax/include/nexus.h b/sys/arch/vax/include/nexus.h
index 9d844dc9a57..b818b6bf50f 100644
--- a/sys/arch/vax/include/nexus.h
+++ b/sys/arch/vax/include/nexus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nexus.h,v 1.15 2011/03/23 16:54:37 pirofti Exp $ */
+/* $OpenBSD: nexus.h,v 1.16 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: nexus.h,v 1.17 2000/06/04 17:58:19 ragge Exp $ */
/*-
@@ -44,152 +44,22 @@ struct mainbus_attach_args {
/*
* Values for bus (or pseudo-bus) types
*/
-#define VAX_SBIBUS 1 /* SBI parent (780) */
-#define VAX_CMIBUS 2 /* CMI backplane (750) */
-#define VAX_UNIBUS 3 /* Direct backplane (730) */
-#define VAX_ABUS 4 /* SBI placeholder (8600) */
-#define VAX_BIBUS 5 /* BI bus (8200) */
-#define VAX_NBIBUS 6 /* NBI backplane (8800) */
#define VAX_VSBUS 7 /* Virtual vaxstation bus */
#define VAX_IBUS 8 /* Internal Microvax bus */
-#define VAX_XMIBUS 9 /* XMI master bus (6000) */
#define VAX_VXTBUS 10 /* Pseudo VXT2000 bus */
#define VAX_MBUS 11 /* M-bus (KA60) */
#define VAX_LEDS 0x42 /* pseudo value to attach led0 */
-/*
- * Information about nexus's.
- *
- * Each machine has an address of backplane slots (nexi).
- * Each nexus is some type of adapter, whose code is the low
- * byte of the first word of the adapter address space.
- * At boot time the system looks through the array of available
- * slots and finds the interconnects for the machine.
- */
-#define IO_CMI750 2
-#define MAXNMCR 1
-
-#define NNEXSBI 16
-#if VAX8600
-#define NNEX8600 NNEXSBI
-#define NEXA8600 ((struct nexus *)(0x20000000))
-#define NEXB8600 ((struct nexus *)(0x22000000))
-#endif
-#if VAX780
-#define NNEX780 NNEXSBI
-#define NEX780 ((struct nexus *)0x20000000)
-#endif
-#if VAX730
-#define NNEX730 NNEXSBI
-#define NEX730 ((struct nexus *)0xf20000)
-#endif
-#define NEXSIZE 0x2000
-
-#if VAX8600
-#define MAXNNEXUS (2 * NNEXSBI)
-#else
-#define MAXNNEXUS NNEXSBI
-#endif
-
#ifdef _KERNEL
-struct nexus {
- union nexcsr {
- long nex_csr;
- u_char nex_type;
- } nexcsr;
- long nex_pad[NEXSIZE / sizeof (long) - 1];
-};
-
-struct sbi_attach_args {
- int sa_nexnum; /* This nexus TR number */
- int sa_type; /* This nexus type */
- bus_space_tag_t sa_iot;
- bus_space_handle_t sa_ioh;
-};
-
-/* Memory device struct. This should be somewhere else */
-struct mem_softc {
- struct device sc_dev;
- caddr_t sc_memaddr;
- int sc_memtype;
- int sc_memnr;
-};
-
struct bp_conf {
char *type;
- int num;
- int partyp;
int bp_addr;
};
#endif
-/*
- * Bits in high word of nexus's.
- */
-#define SBI_PARFLT (1<<31) /* sbi parity fault */
-#define SBI_WSQFLT (1<<30) /* write sequence fault */
-#define SBI_URDFLT (1<<29) /* unexpected read data fault */
-#define SBI_ISQFLT (1<<28) /* interlock sequence fault */
-#define SBI_MXTFLT (1<<27) /* multiple transmitter fault */
-#define SBI_XMTFLT (1<<26) /* transmit fault */
-
-#define NEX_CFGFLT (0xfc000000)
-
-#ifndef _LOCORE
-#if VAX780 || VAX8600
-#define NEXFLT_BITS \
-"\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT"
-#endif
-#endif
-
-#define NEX_APD (1<<23) /* adaptor power down */
-#define NEX_APU (1<<22) /* adaptor power up */
-
-#define MBA_OT (1<<21) /* overtemperature */
-
-#define UBA_UBINIT (1<<18) /* unibus init */
-#define UBA_UBPDN (1<<17) /* unibus power down */
-#define UBA_UBIC (1<<16) /* unibus initialization complete */
-
-/*
- * Types for nex_type.
- */
-#define NEX_ANY 0 /* pseudo for handling 11/750 */
-#define NEX_MEM4 0x08 /* 4K chips, non-interleaved mem */
-#define NEX_MEM4I 0x09 /* 4K chips, interleaved mem */
-#define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */
-#define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */
-#define NEX_MBA 0x20 /* Massbus adaptor */
-#define NEX_UBA0 0x28 /* Unibus adaptor */
-#define NEX_UBA1 0x29 /* 4 flavours for 4 addr spaces */
-#define NEX_UBA2 0x2a
-#define NEX_UBA3 0x2b
-#define NEX_DR32 0x30 /* DR32 user i'face to SBI */
-#define NEX_CI 0x38 /* CI adaptor */
-#define NEX_MPM0 0x40 /* Multi-port mem */
-#define NEX_MPM1 0x41 /* Who knows why 4 different ones ? */
-#define NEX_MPM2 0x42
-#define NEX_MPM3 0x43
-#define NEX_MEM64L 0x68 /* 64K chips, non-interleaved, lower */
-#define NEX_MEM64LI 0x69 /* 64K chips, ext-interleaved, lower */
-#define NEX_MEM64U 0x6a /* 64K chips, non-interleaved, upper */
-#define NEX_MEM64UI 0x6b /* 64K chips, ext-interleaved, upper */
-#define NEX_MEM64I 0x6c /* 64K chips, interleaved */
-#define NEX_MEM256L 0x70 /* 256K chips, non-interleaved, lower */
-#define NEX_MEM256LI 0x71 /* 256K chips, ext-interleaved, lower */
-#define NEX_MEM256U 0x72 /* 256K chips, non-interleaved, upper */
-#define NEX_MEM256UI 0x73 /* 256K chips, ext-interleaved, upper */
-#define NEX_MEM256I 0x74 /* 256K chips, interleaved */
-
-/* Memory classes */
-#define M_NONE 0
-#define M780C 1
-#define M780EL 2
-#define M780EU 3
-
/* Memory recover defines */
#define MCHK_PANIC -1
#define MCHK_RECOVERED 0
diff --git a/sys/arch/vax/include/rsp.h b/sys/arch/vax/include/rsp.h
deleted file mode 100644
index b6d701ca1c4..00000000000
--- a/sys/arch/vax/include/rsp.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* $OpenBSD: rsp.h,v 1.2 1997/05/29 00:04:50 niklas Exp $ */
-/* $NetBSD: rsp.h,v 1.1 1996/02/17 18:14:50 ragge Exp $ */
-/*
- * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-
-/*
- * The Radial Serial Protocol (RSP) that TU58 (DECtape II) uses
- * is a strange animal that is sent over serial lines.
- * Most packet types can match the struct rsp, but some can't (i.e.
- * data packets).
- * More about RSP can be read in Digital Peripherals Handbook, p. 92.
- */
-
-struct rsp {
- char rsp_typ; /* Packet type */
- char rsp_sz; /* Packet size */
- char rsp_op; /* Operation */
- char rsp_mod; /* Modifier */
- char rsp_drv; /* Tape drive number */
- char rsp_sw; /* Switches */
- char rsp_xx1; /* Unused, always zero */
- char rsp_xx2; /* Unused, always zero */
- short rsp_cnt; /* Byte count to transfer */
- short rsp_blk; /* Block number */
- short rsp_sum; /* Checksum of packet */
-};
-
-/* Types of packets */
-#define RSP_TYP_DATA 001 /* DATA packet */
-#define RSP_TYP_COMMAND 002 /* COMMAND packet */
-#define RSP_TYP_INIT 004 /* INITIALIZE packet */
-#define RSP_TYP_BOOT 010 /* BOOTSTRAP packet (PDP11) */
-#define RSP_TYP_CONTINUE 020 /* CONTINUE packet */
-#define RSP_TYP_XOFF 023 /* XOFF packet */
-
-/* Operation types */
-#define RSP_OP_NOP 000 /* No operation */
-#define RSP_OP_RESET 001 /* Reset */
-#define RSP_OP_READ 002 /* Read data */
-#define RSP_OP_WRITE 003 /* Write data */
-#define RSP_OP_POS 005 /* Position tape */
-#define RSP_OP_DIAG 007 /* internal diagnose */
-#define RSP_OP_GSTAT 010 /* Get status */
-#define RSP_OP_SSTAT 011 /* Set status */
-#define RSP_OP_END 100 /* End packet */
-
-/* Modifier */
-#define RSP_MOD_VERIFY 001 /* Verify read data */
-#define RSP_MOD_OK 000 /* Success */
-#define RSP_MOD_RETR 001 /* Success w/ retries */
-#define RSP_MOD_FAIL -1 /* Failed self-test */
-#define RSP_MOD_PART -2 /* Partial operation */
-#define RSP_MOD_NET -8 /* Non-existent tape drive */
-#define RSP_MOD_NOC -9 /* No cartridge */
-#define RSP_MOD_WP -11 /* Write protected */
-#define RSP_MOD_DERR -17 /* Data error */
-#define RSP_MOD_SERR -32 /* Seek error */
-#define RSP_MOD_STOP -33 /* Motor stopped */
-#define RSP_MOD_INVAL -48 /* Invalid opcode */
-#define RSP_MOD_INVBLK -55 /* Invalid bloch number */
-
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c
deleted file mode 100644
index 3588dd468a0..00000000000
--- a/sys/arch/vax/mba/hp.c
+++ /dev/null
@@ -1,476 +0,0 @@
-/* $OpenBSD: hp.c,v 1.26 2011/06/05 18:40:33 matthew Exp $ */
-/* $NetBSD: hp.c,v 1.22 2000/02/12 16:09:33 ragge Exp $ */
-/*
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Simple device driver routine for massbuss disks.
- * TODO:
- * Fix support for Standard DEC BAD144 bad block forwarding.
- * Be able to to handle soft/hard transfer errors.
- * Handle non-data transfer interrupts.
- * Autoconfiguration of disk drives 'on the fly'.
- * Handle disk media changes.
- * Dual-port operations should be supported.
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/disklabel.h>
-#include <sys/disk.h>
-#include <sys/dkio.h>
-#include <sys/buf.h>
-#include <sys/stat.h>
-#include <sys/ioccom.h>
-#include <sys/fcntl.h>
-#include <sys/syslog.h>
-#include <sys/reboot.h>
-#include <sys/conf.h>
-
-#include <machine/trap.h>
-#include <machine/pte.h>
-#include <machine/mtpr.h>
-#include <machine/cpu.h>
-
-#include <vax/mba/mbavar.h>
-#include <vax/mba/mbareg.h>
-#include <vax/mba/hpreg.h>
-
-#define HPMASK 0xffff
-
-struct hp_softc {
- struct device sc_dev;
- struct disk sc_disk;
- struct mba_device sc_md; /* Common struct used by mbaqueue. */
- int sc_physnr; /* Physical disk number */
-};
-
-int hpmatch(struct device *, struct cfdata *, void *);
-void hpattach(struct device *, struct device *, void *);
-void hpstart(struct mba_device *);
-int hpattn(struct mba_device *);
-enum xfer_action hpfinish(struct mba_device *, int, int *);
-bdev_decl(hp);
-int hpread(dev_t, struct uio *);
-int hpwrite(dev_t, struct uio *);
-
-struct cfattach hp_ca = {
- sizeof(struct hp_softc), hpmatch, hpattach
-};
-
-extern struct cfdriver hp_cd;
-
-/*
- * Check if this is a disk drive; done by checking type from mbaattach.
- */
-int
-hpmatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct mba_attach_args *ma = aux;
-
- if (cf->cf_loc[MBACF_DRIVE] != MBACF_DRIVE_DEFAULT &&
- cf->cf_loc[MBACF_DRIVE] != ma->unit)
- return 0;
-
- if (ma->devtyp != MB_RP)
- return 0;
-
- return 1;
-}
-
-/*
- * Disk drive found; fake a disklabel and try to read the real one.
- * If the on-disk label can't be read; we lose.
- */
-void
-hpattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct hp_softc *sc = (void *)self;
- struct mba_softc *ms = (void *)parent;
- struct disklabel *dl;
- struct mba_attach_args *ma = aux;
- char *msg;
-
- /*
- * Init the common struct for both the adapter and its slaves.
- */
- BUFQ_INIT(&sc->sc_md.md_q);
- sc->sc_md.md_softc = (void *)sc; /* Pointer to this softc */
- sc->sc_md.md_mba = (void *)parent; /* Pointer to parent softc */
- sc->sc_md.md_start = hpstart; /* Disk start routine */
- sc->sc_md.md_attn = hpattn; /* Disk attention routine */
- sc->sc_md.md_finish = hpfinish; /* Disk xfer finish routine */
-
- ms->sc_md[ma->unit] = &sc->sc_md; /* Per-unit backpointer */
-
- sc->sc_physnr = ma->unit;
- /*
- * Init and attach the disk structure.
- */
- sc->sc_disk.dk_name = sc->sc_dev.dv_xname;
- disk_attach(&sc->sc_dev, &sc->sc_disk);
-
- /*
- * Fake a disklabel to be able to read in the real label.
- */
- dl = sc->sc_disk.dk_label;
-
- dl->d_secsize = DEV_BSIZE;
- dl->d_ntracks = 1;
- dl->d_nsectors = 32;
- dl->d_secpercyl = 32;
-
- /*
- * Read in label.
- */
- if ((msg = readdisklabel(makedev(0, self->dv_unit * 8), hpstrategy,
- dl, NULL)) != NULL) {
- /*printf(": %s", msg);*/
- }
- printf(": %.*s, size = %d sectors\n",
- (int)sizeof(dl->d_typename), dl->d_typename, DL_GETDSIZE(dl));
- /*
- * check if this was what we booted from.
- */
- if ((B_TYPE(bootdev) == BDEV_HP) && (ma->unit == B_UNIT(bootdev)) &&
- (ms->sc_physnr == B_ADAPTOR(bootdev)))
- booted_from = self;
-}
-
-
-void
-hpstrategy(bp)
- struct buf *bp;
-{
- struct hp_softc *sc;
- struct buf *gp;
- int unit, s;
- struct disklabel *lp;
-
- unit = DISKUNIT(bp->b_dev);
- sc = hp_cd.cd_devs[unit];
- lp = sc->sc_disk.dk_label;
-
- if (bounds_check_with_label(bp, lp) <= 0)
- goto done;
-
- bp->b_rawblkno =
- bp->b_blkno + DL_GETPOFFSET(&lp->d_partitions[DISKPART(bp->b_dev)]);
- bp->b_cylinder = bp->b_rawblkno / lp->d_secpercyl;
-
- s = splbio();
-
- gp = BUFQ_FIRST(&sc->sc_md.md_q);
- disksort_cylinder(&sc->sc_md.md_q, bp);
- if (gp == 0)
- mbaqueue(&sc->sc_md);
-
- splx(s);
- return;
-
-done:
- bp->b_resid = bp->b_bcount;
- s = splbio();
- biodone(bp);
- splx(s);
-}
-
-/*
- * Start transfer on given disk. Called from mbastart().
- */
-void
-hpstart(md)
- struct mba_device *md;
-{
- struct hp_softc *sc = md->md_softc;
- struct mba_regs *mr = md->md_mba->sc_mbareg;
- volatile struct hp_regs *hr;
- struct disklabel *lp = sc->sc_disk.dk_label;
- struct buf *bp = BUFQ_FIRST(&md->md_q);
- unsigned bn, cn, sn, tn;
-
- /*
- * Collect statistics.
- */
- disk_busy(&sc->sc_disk);
- sc->sc_disk.dk_seek++;
-
- hr = (void *)&mr->mba_md[DISKUNIT(bp->b_dev)];
-
- bn = bp->b_rawblkno;
- if (bn) {
- cn = bn / lp->d_secpercyl;
- sn = bn % lp->d_secpercyl;
- tn = sn / lp->d_nsectors;
- sn = sn % lp->d_nsectors;
- } else
- cn = sn = tn = 0;
-
- hr->hp_dc = cn;
- hr->hp_da = (tn << 8) | sn;
- if (bp->b_flags & B_READ)
- hr->hp_cs1 = HPCS_READ; /* GO */
- else
- hr->hp_cs1 = HPCS_WRITE;
-}
-
-int
-hpopen(dev, flag, fmt)
- dev_t dev;
- int flag, fmt;
-{
- struct hp_softc *sc;
- int unit, part;
-
- unit = DISKUNIT(dev);
- if (unit >= hp_cd.cd_ndevs)
- return ENXIO;
- sc = hp_cd.cd_devs[unit];
- if (sc == 0)
- return ENXIO;
-
- part = DISKPART(dev);
-
- if (part >= sc->sc_disk.dk_label->d_npartitions)
- return ENXIO;
-
- switch (fmt) {
- case S_IFCHR:
- sc->sc_disk.dk_copenmask |= (1 << part);
- break;
-
- case S_IFBLK:
- sc->sc_disk.dk_bopenmask |= (1 << part);
- break;
- }
- sc->sc_disk.dk_openmask =
- sc->sc_disk.dk_copenmask | sc->sc_disk.dk_bopenmask;
-
- return 0;
-}
-
-int
-hpclose(dev, flag, fmt)
- dev_t dev;
- int flag, fmt;
-{
- struct hp_softc *sc;
- int unit, part;
-
- unit = DISKUNIT(dev);
- sc = hp_cd.cd_devs[unit];
-
- part = DISKPART(dev);
-
- switch (fmt) {
- case S_IFCHR:
- sc->sc_disk.dk_copenmask &= ~(1 << part);
- break;
-
- case S_IFBLK:
- sc->sc_disk.dk_bopenmask &= ~(1 << part);
- break;
- }
- sc->sc_disk.dk_openmask =
- sc->sc_disk.dk_copenmask | sc->sc_disk.dk_bopenmask;
-
- return 0;
-}
-
-int
-hpioctl(dev, cmd, addr, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t addr;
- int flag;
- struct proc *p;
-{
- struct hp_softc *sc = hp_cd.cd_devs[DISKUNIT(dev)];
- struct disklabel *lp = sc->sc_disk.dk_label;
- int error;
-
- switch (cmd) {
- case DIOCGDINFO:
- case DIOCGPDINFO: /* no separate 'physical' info available. */
- bcopy(lp, addr, sizeof (struct disklabel));
- return 0;
-
- case DIOCGPART:
- ((struct partinfo *)addr)->disklab = lp;
- ((struct partinfo *)addr)->part =
- &lp->d_partitions[DISKPART(dev)];
- break;
-
- case DIOCWDINFO:
- case DIOCSDINFO:
- if ((flag & FWRITE) == 0)
- return EBADF;
-
- error = setdisklabel(lp, (struct disklabel *)addr, 0);
- if (error == 0) {
- if (cmd == DIOCWDINFO) {
- error = writedisklabel(dev, hpstrategy, lp, 0);
- }
- }
- return error;
-
- default:
- printf("hpioctl: command %x\n", (unsigned int)cmd);
- return ENOTTY;
- }
- return 0;
-}
-
-/*
- * Called when a transfer is finished. Check if transfer went OK,
- * Return info about what-to-do-now.
- */
-enum xfer_action
-hpfinish(md, mbasr, attn)
- struct mba_device *md;
- int mbasr, *attn;
-{
- struct hp_softc *sc = md->md_softc;
- struct buf *bp = BUFQ_FIRST(&md->md_q);
- volatile struct mba_regs *mr = md->md_mba->sc_mbareg;
- volatile struct hp_regs *hr = (void *)&mr->mba_md[DISKUNIT(bp->b_dev)];
- int er1, er2;
- volatile int bc; /* to get GCC read whole longword */
- unsigned byte;
-
- er1 = hr->hp_er1 & HPMASK;
- er2 = hr->hp_er2 & HPMASK;
- hr->hp_er1 = hr->hp_er2 = 0;
-hper1:
- switch (ffs(er1) - 1) {
- case -1:
- hr->hp_er1 = 0;
- goto hper2;
-
- case HPER1_DCK: /* Corrected? data read. Just notice. */
- bc = mr->mba_bc;
- byte = ~(bc >> 16);
- diskerr(buf, hp_cd.cd_name, "soft ecc", LOG_PRINTF,
- btodb(bp->b_bcount - byte), sc->sc_disk.dk_label);
- er1 &= ~(1<<HPER1_DCK);
- er1 &= HPMASK;
- break;
-
- default:
- printf("drive error :%s er1 %x er2 %x\n",
- sc->sc_dev.dv_xname, er1, er2);
- hr->hp_er1 = hr->hp_er2 = 0;
- goto hper2;
- }
- goto hper1;
-
-hper2:
- mbasr &= ~(MBASR_DTBUSY|MBASR_DTCMP|MBASR_ATTN);
- if (mbasr)
- printf("massbuss error :%s %x\n",
- sc->sc_dev.dv_xname, mbasr);
-
- BUFQ_FIRST(&md->md_q)->b_resid = 0;
- disk_unbusy(&sc->sc_disk, BUFQ_FIRST(&md->md_q)->b_bcount,
- (BUFQ_FIRST(&md->md_q)->b_flags & B_READ));
- return XFER_FINISH;
-}
-
-/*
- * Non-data transfer interrupt; like volume change.
- */
-int
-hpattn(md)
- struct mba_device *md;
-{
- struct hp_softc *sc = md->md_softc;
- struct mba_softc *ms = (void *)sc->sc_dev.dv_parent;
- struct mba_regs *mr = ms->sc_mbareg;
- struct hp_regs *hr = (void *)&mr->mba_md[sc->sc_dev.dv_unit];
- int er1, er2;
-
- er1 = hr->hp_er1 & HPMASK;
- er2 = hr->hp_er2 & HPMASK;
-
- printf("%s: Attention! er1 %x er2 %x\n",
- sc->sc_dev.dv_xname, er1, er2);
- return 0;
-}
-
-
-daddr64_t
-hpsize(dev)
- dev_t dev;
-{
- int size, unit = DISKUNIT(dev);
- struct hp_softc *sc;
-
- if (unit >= hp_cd.cd_ndevs || hp_cd.cd_devs[unit] == 0)
- return -1;
-
- sc = hp_cd.cd_devs[unit];
- size = DL_GETPSIZE(&sc->sc_disk.dk_label->d_partitions[DISKPART(dev)]) *
- (sc->sc_disk.dk_label->d_secsize / DEV_BSIZE);
-
- return size;
-}
-
-int
-hpdump(dev, a1, a2, size)
- dev_t dev;
- daddr64_t a1;
- caddr_t a2;
- size_t size;
-{
- printf("hpdump: Not implemented yet.\n");
- return 0;
-}
-
-int
-hpread(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- return (physio(hpstrategy, dev, B_READ, minphys, uio));
-}
-
-int
-hpwrite(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- return (physio(hpstrategy, dev, B_WRITE, minphys, uio));
-}
diff --git a/sys/arch/vax/mba/hpreg.h b/sys/arch/vax/mba/hpreg.h
deleted file mode 100644
index 76f6459923c..00000000000
--- a/sys/arch/vax/mba/hpreg.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/* $OpenBSD: hpreg.h,v 1.5 2002/06/11 09:36:24 hugh Exp $ */
-/* $NetBSD: hpreg.h,v 1.5 2000/06/04 18:04:39 ragge Exp $ */
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-#ifdef notdef
-struct hp_regs {
- int hp_cs1;
- int hp_ds;
- int hp_er1;
- int hp_mr1;
- int hp_as;
- int hp_da;
- int hp_dt;
- int hp_la;
- int hp_sn;
- int hp_of;
- int hp_dc;
- int hp_hr;
- int hp_mr2;
- int hp_er2;
- int hp_ec1;
- int hp_ec2;
- int utrymme[16];
-};
-#endif
-
-#define HP_CS1 0
-#define HP_DS 4
-#define HP_ER1 8
-#define HP_MR1 12
-#define HP_AS 16
-#define HP_DA 20
-#define HP_DT 24
-#define HP_LA 28
-#define HP_SN 32
-#define HP_OF 36
-#define HP_DC 40
-#define HP_HR 44
-#define HP_MR2 48
-#define HP_ER2 52
-#define HP_EC1 56
-#define HP_EC2 60
-
-#define HPCS_DVA 4000 /* Drive avail, in dual-port config */
-#define HPCS_WRITE 061 /* Write data */
-#define HPCS_WCHECK 051 /* Write check data */
-#define HPCS_WHEAD 063 /* Write header and data */
-#define HPCS_WCHEAD 053 /* Write check header and data */
-#define HPCS_READ 071 /* Read data */
-#define HPCS_RHEAD 073 /* Read header and data */
-#define HPCS_SEEK 005 /* Just seek */
-#define HPCS_RECAL 007 /* Recalibrate */
-#define HPCS_RTC 017 /* Return to centerline */
-#define HPCS_OFFSET 015 /* Offset */
-#define HPCS_SEARCH 031 /* Search */
-#define HPCS_UNLOAD 003 /* Unload pack (removable) */
-#define HPCS_RELEASE 013 /* Release massbuss port */
-#define HPCS_RPS 021 /* Read-in preset */
-#define HPCS_PA 023 /* Pack acknowledge */
-#define HPCS_DC 011 /* Drive clear */
-
-
-#define HPDS_VV 0x40 /* Volume valid, not changed */
-#define HPDS_DRY 0x80 /* Drive ready to accept commands */
-#define HPDS_DPR 0x100 /* Drive present */
-#define HPDS_PGM 0x200 /* Programmable in dual-port config */
-#define HPDS_LBT 0x400 /* Last block transferred */
-#define HPDS_WRL 0x800 /* Write locked media */
-#define HPDS_MOL 0x1000 /* Medium on-line */
-#define HPDS_PIP 0x2000 /* Positioning in progress */
-#define HPDS_ERR 0x4000 /* ORed error bit, something wrong */
-#define HPDS_ATA 0x8000 /* Attention drive */
-
-#define HPDT_DRQ 0x800 /* Dual-port disk */
-
-#define HPOF_FMT 0x1000 /* 16/18 bit data */
-
-/*
- * Error registers. The defines are the corresponding bit number
- * in the error register, instead of a bit mask.
- * Use (1<<HPER1_FOO) when touching registers.
- */
-#define HPER1_ILF 0 /* Illegal function */
-#define HPER1_ILR 1 /* Illegal register */
-#define HPER1_RMR 2 /* Register modification refused */
-#define HPER1_PAR 3 /* Parity error */
-#define HPER1_FER 4 /* Format error */
-#define HPER1_WCF 5 /* Write clock failed */
-#define HPER1_ECH 6 /* ECC hard error */
-#define HPER1_HCE 7 /* Header compare error */
-#define HPER1_HCRC 8 /* Header CRC error */
-#define HPER1_AOE 9 /* Address overflow error */
-#define HPER1_IAE 10 /* Invalid address error */
-#define HPER1_WLE 11 /* Write lock error */
-#define HPER1_DTE 12 /* Drive timing error */
-#define HPER1_OPI 13 /* Operation incomplete */
-#define HPER1_UNS 14 /* Unsafe drive */
-#define HPER1_DCK 15 /* Data check error */
diff --git a/sys/arch/vax/mba/mba.c b/sys/arch/vax/mba/mba.c
deleted file mode 100644
index 1a89f6ad2d1..00000000000
--- a/sys/arch/vax/mba/mba.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/* $OpenBSD: mba.c,v 1.10 2006/01/20 23:27:25 miod Exp $ */
-/* $NetBSD: mba.c,v 1.18 2000/01/24 02:40:36 matt Exp $ */
-/*
- * Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Simple massbus drive routine.
- * TODO:
- * Autoconfig new devices 'on the fly'.
- * More intelligent way to handle different interrupts.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/queue.h>
-#include <sys/buf.h>
-#include <sys/proc.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <machine/trap.h>
-#include <machine/scb.h>
-#include <machine/nexus.h>
-#include <machine/pte.h>
-#include <machine/pcb.h>
-#include <machine/sid.h>
-#include <machine/cpu.h>
-
-#include <vax/mba/mbareg.h>
-#include <vax/mba/mbavar.h>
-
-struct mbaunit mbaunit[] = {
- {MBADT_RP04, "rp04", MB_RP},
- {MBADT_RP05, "rp05", MB_RP},
- {MBADT_RP06, "rp06", MB_RP},
- {MBADT_RP07, "rp07", MB_RP},
- {MBADT_RM02, "rm02", MB_RP},
- {MBADT_RM03, "rm03", MB_RP},
- {MBADT_RM05, "rm05", MB_RP},
- {MBADT_RM80, "rm80", MB_RP},
- {0, 0, 0}
-};
-
-int mbamatch(struct device *, struct cfdata *, void *);
-void mbaattach(struct device *, struct device *, void *);
-void mbaintr(void *);
-int mbaprint(void *, const char *);
-void mbaqueue(struct mba_device *);
-void mbastart(struct mba_softc *);
-void mbamapregs(struct mba_softc *);
-
-struct cfattach mba_cmi_ca = {
- sizeof(struct mba_softc), mbamatch, mbaattach
-};
-
-struct cfattach mba_sbi_ca = {
- sizeof(struct mba_softc), mbamatch, mbaattach
-};
-
-extern struct cfdriver mba_cd;
-
-/*
- * Look if this is a massbuss adapter.
- */
-int
-mbamatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
-
- if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1 ))
- return 0;
-
- if (sa->type == NEX_MBA)
- return 1;
-
- return 0;
-}
-
-/*
- * Attach the found massbuss adapter. Setup its interrupt vectors,
- * reset it and go searching for drives on it.
- */
-void
-mbaattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct mba_softc *sc = (void *)self;
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
- volatile struct mba_regs *mbar = (struct mba_regs *)sa->nexaddr;
- struct mba_attach_args ma;
- int i, j;
-
- printf("\n");
- /*
- * Set up interrupt vectors for this MBA.
- */
- sc->sc_dsp = idsptch;
- sc->sc_dsp.pushlarg = sc;
- sc->sc_dsp.hoppaddr = mbaintr;
- scb->scb_nexvec[0][sa->nexnum] = scb->scb_nexvec[1][sa->nexnum] =
- scb->scb_nexvec[2][sa->nexnum] = scb->scb_nexvec[3][sa->nexnum] =
- &sc->sc_dsp;
-
- sc->sc_physnr = sa->nexnum - 8; /* MBA's have TR between 8 - 11... */
-#if VAX750
- if (vax_cputype == VAX_750)
- sc->sc_physnr += 4; /* ...but not on 11/750 */
-#endif
- sc->sc_first = 0;
- sc->sc_last = (void *)&sc->sc_first;
- sc->sc_mbareg = (struct mba_regs *)mbar;
- mbar->mba_cr = MBACR_INIT; /* Reset adapter */
- mbar->mba_cr = MBACR_IE; /* Enable interrupts */
-
- for (i = 0; i < MAXMBADEV; i++) {
- sc->sc_state = SC_AUTOCONF;
- if ((mbar->mba_md[i].md_ds & MBADS_DPR) == 0)
- continue;
- /* We have a drive, ok. */
- ma.unit = i;
- ma.type = mbar->mba_md[i].md_dt & 0777;
- j = 0;
- while (mbaunit[j++].nr)
- if (mbaunit[j].nr == ma.type)
- break;
- ma.devtyp = mbaunit[j].devtyp;
- ma.name = mbaunit[j].name;
- config_found(&sc->sc_dev, (void *)&ma, mbaprint);
- }
-}
-
-/*
- * We got an interrupt. Check type of interrupt and call the specific
- * device interrupt handling routine.
- */
-void
-mbaintr(mba)
- void *mba;
-{
- struct mba_softc *sc = mba;
- volatile struct mba_regs *mr = sc->sc_mbareg;
- struct mba_device *md;
- struct buf *bp;
- int itype, attn, anr;
-
- itype = mr->mba_sr;
- mr->mba_sr = itype; /* Write back to clear bits */
-
- attn = mr->mba_md[0].md_as & 0xff;
- mr->mba_md[0].md_as = attn;
-
- if (sc->sc_state == SC_AUTOCONF)
- return; /* During autoconfig */
-
- md = sc->sc_first;
- bp = BUFQ_FIRST(&md->md_q);
- /*
- * A data-transfer interrupt. Current operation is finished,
- * call that device's finish routine to see what to do next.
- */
- if (sc->sc_state == SC_ACTIVE) {
-
- sc->sc_state = SC_IDLE;
- switch ((*md->md_finish)(md, itype, &attn)) {
-
- case XFER_FINISH:
- /*
- * Transfer is finished. Take buffer of drive
- * queue, and take drive of adapter queue.
- * If more to transfer, start the adapter again
- * by calling mbastart().
- */
- BUFQ_REMOVE(&md->md_q, bp);
- sc->sc_first = md->md_back;
- md->md_back = 0;
- if (sc->sc_first == 0)
- sc->sc_last = (void *)&sc->sc_first;
-
- if (BUFQ_FIRST(&md->md_q) != NULL) {
- sc->sc_last->md_back = md;
- sc->sc_last = md;
- }
-
- bp->b_resid = 0;
- biodone(bp);
- if (sc->sc_first)
- mbastart(sc);
- break;
-
- case XFER_RESTART:
- /*
- * Something went wrong with the transfer. Try again.
- */
- mbastart(sc);
- break;
- }
- }
-
- while (attn) {
- anr = ffs(attn) - 1;
- attn &= ~(1 << anr);
- if (sc->sc_md[anr]->md_attn == 0)
- panic("Should check for new MBA device %d", anr);
- (*sc->sc_md[anr]->md_attn)(sc->sc_md[anr]);
- }
-}
-
-int
-mbaprint(aux, mbaname)
- void *aux;
- const char *mbaname;
-{
- struct mba_attach_args *ma = aux;
-
- if (mbaname) {
- if (ma->name)
- printf("%s", ma->name);
- else
- printf("device type %o", ma->type);
- printf(" at %s", mbaname);
- }
- printf(" drive %d", ma->unit);
- return (ma->name ? UNCONF : UNSUPP);
-}
-
-/*
- * A device calls mbaqueue() when it wants to get on the adapter queue.
- * Called at splbio(). If the adapter is inactive, start it.
- */
-void
-mbaqueue(md)
- struct mba_device *md;
-{
- struct mba_softc *sc = md->md_mba;
- int i = (int)sc->sc_first;
-
- sc->sc_last->md_back = md;
- sc->sc_last = md;
-
- if (i == 0)
- mbastart(sc);
-}
-
-/*
- * Start activity on (idling) adapter. Calls mbamapregs() to setup
- * for dma transfer, then the unit-specific start routine.
- */
-void
-mbastart(sc)
- struct mba_softc *sc;
-{
- struct mba_device *md = sc->sc_first;
- volatile struct mba_regs *mr = sc->sc_mbareg;
- struct buf *bp = BUFQ_FIRST(&md->md_q);
-
- disk_reallymapin(BUFQ_FIRST(&md->md_q), sc->sc_mbareg->mba_map,
- 0, PG_V);
-
- sc->sc_state = SC_ACTIVE;
- mr->mba_var = ((u_int)bp->b_data & VAX_PGOFSET);
- mr->mba_bc = (~bp->b_bcount) + 1;
- (*md->md_start)(md); /* machine-dependent start */
-}
diff --git a/sys/arch/vax/mba/mbareg.h b/sys/arch/vax/mba/mbareg.h
deleted file mode 100644
index 427a7185edb..00000000000
--- a/sys/arch/vax/mba/mbareg.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $OpenBSD: mbareg.h,v 1.5 2002/06/11 09:36:24 hugh Exp $ */
-/* $NetBSD: mbareg.h,v 1.4 2000/06/04 18:04:39 ragge Exp $ */
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-#ifdef notdef
-struct mba_hack {
- u_int pad1;
- u_int md_ds; /* unit status */
- u_int pad4[2];
- u_int md_as; /* Attention summary */
- u_int pad2;
- u_int md_dt; /* unit type */
- u_int pad3[25];
-};
-
-struct mba_regs {
- u_int mba_csr;
- u_int mba_cr;
- u_int mba_sr;
- u_int mba_var;
- u_int mba_bc;
- u_int mba_dr;
- u_int mba_smr;
- u_int mba_car;
- u_int utrymme[248];
- struct mba_hack mba_md[8]; /* unit specific regs */
- struct pte mba_map[256];
-};
-#endif
-
-#define MBA_CSR 0
-#define MBA_CR 4
-#define MBA_SR 8
-#define MBA_VAR 12
-#define MBA_BC 16
-#define MBA_DR 20
-#define MBA_SMR 24
-#define MBA_CAR 28
-
-#define MUREG(dev,reg) (1024+(dev)*128+(reg))
-#define MAPREG(nr) (2048+(nr)*4)
-
-#define MU_DS 4 /* unit status */
-#define MU_AS 16 /* attention summary */
-#define MU_DT 24 /* drive type */
-
-/*
- * Different states which can be on massbus.
- */
-/* Write to mba_cr */
-#define MBACR_IBC 0x10
-#define MBACR_MMM 0x8
-#define MBACR_IE 0x4
-#define MBACR_ABORT 0x2
-#define MBACR_INIT 0x1
-
-/* Read from mba_sr: */
-#define MBASR_DTBUSY 0x80000000
-#define MBASR_NRCONF 0x40000000
-#define MBASR_CRD 0x20000000
-#define MBASR_CBHUNG 0x800000
-#define MBASR_PGE 0x80000
-#define MBASR_NED 0x40000 /* NonExistent Drive */
-#define MBASR_MCPE 0x20000 /* Massbuss Control Parity Error */
-#define MBASR_ATTN 0x10000 /* Attention from Massbus */
-#define MBASR_SPE 0x4000 /* Silo Parity Error */
-#define MBASR_DTCMP 0x2000 /* Data Transfer CoMPleted */
-#define MBASR_DTABT 0x1000 /* Data Transfer ABorTed */
-#define MBASR_DLT 0x800 /* Data LaTe */
-#define MBASR_WCKUE 0x400 /* Write check upper error */
-#define MBASR_WCKLE 0x200 /* Write check lower error */
-#define MBASR_MXF 0x100 /* Miss transfer fault */
-#define MBASR_MBEXC 0x80 /* Massbuss exception */
-#define MBASR_MDPE 0x40 /* Massbuss data parity error */
-#define MBASR_MAPPE 0x20 /* Page frame map parity error */
-#define MBASR_INVMAP 0x10 /* Invalid map */
-#define MBASR_ERR_STAT 0x8 /* Error status */
-#define MBASR_ERRC 0x4 /* Error confirmation */
-#define MBASR_ISTIMO 0x2 /* Interface sequence timeout */
-#define MBASR_RDTIMO 0x1 /* Read data timeout status */
-
-/* Definitions in mba_device md_ds */
-#define MBADS_DPR 0x100 /* Unit present */
-
-/* Definitions in mba_device md_dt */
-#define MBADT_RP04 0x10
-#define MBADT_RP05 0x11
-#define MBADT_RP06 0x12
-#define MBADT_RP07 0x22
-#define MBADT_RM02 0x15
-#define MBADT_RM03 0x14
-#define MBADT_RM05 0x17
-#define MBADT_RM80 0x16
-#define MBADT_DRQ 0x800 /* Dual ported */
-#define MBADT_MOH 0x2000 /* Moving head device */
diff --git a/sys/arch/vax/mba/mbavar.h b/sys/arch/vax/mba/mbavar.h
deleted file mode 100644
index c2653f38f3e..00000000000
--- a/sys/arch/vax/mba/mbavar.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* $OpenBSD: mbavar.h,v 1.7 2007/05/10 17:59:26 deraadt Exp $ */
-/* $NetBSD: mbavar.h,v 1.7 2000/06/04 18:04:39 ragge Exp $ */
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-#include <sys/device.h>
-#include <machine/scb.h>
-
-#define MBCR_INIT 1
-#define MBCR_IE (1<<2)
-#define MBDS_DPR (1<<8)
-#define MBSR_NED (1<<18)
-#define MBDT_MOH (1<<13)
-#define MBDT_TYPE 511
-#define MBDT_TAP (1<<14)
-
-#define CLOSED 0
-#define WANTOPEN 1
-#define RDLABEL 2
-#define OPEN 3
-#define OPENRAW 4
-
-#define MAXMBADEV 8 /* Max units per MBA */
-
-/*
- * Devices that have different device drivers.
- */
-enum mb_devices {
- MB_RP, /* RM/RP disk */
- MB_TU, /* TM03 based tape, ex. TU45 or TU77 */
- MB_MT /* TU78 tape */
-};
-
-/*
- * Current state of the adapter.
- */
-enum sc_state {
- SC_AUTOCONF,
- SC_ACTIVE,
- SC_IDLE
-};
-
-/*
- * Return value after a finished data transfer, from device driver.
- */
-enum xfer_action {
- XFER_RESTART,
- XFER_FINISH
-};
-
-/*
- * Info passed do unit device driver during autoconfig.
- */
-struct mba_attach_args {
- int ma_unit;
- int ma_type;
- char *ma_name;
- enum mb_devices ma_devtyp;
- bus_space_tag_t ma_iot;
- bus_space_handle_t ma_ioh;
-};
-
-/*
- * Common struct used to communicate between the mba device driver
- * and the unit device driver.
- */
-struct mba_device {
- struct mba_device *md_back; /* linked list of runnable devices */
- /* Start routine to be called by mbastart. */
- void (*md_start)(struct mba_device *);
- /* Routine to be called after attn intr */
- int (*md_attn)(struct mba_device *);
- /* Call after xfer finish */
- enum xfer_action (*md_finish)(struct mba_device *, int, int *);
- void *md_softc; /* Backpointer to this units softc. */
- struct mba_softc *md_mba;
- struct buf_queue md_q; /* queue of I/O requests */
-};
-
-struct mba_softc {
- struct device sc_dev;
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
- struct mba_device *sc_first, *sc_last;
- enum sc_state sc_state;
- struct mba_device *sc_md[MAXMBADEV];
-};
-
-struct mbaunit {
- int nr;
- char *name;
- enum mb_devices devtyp;
-};
-
-/* Common prototypes */
-void mbaqueue(struct mba_device *);
-
diff --git a/sys/arch/vax/mscp/mscp_subr.c b/sys/arch/vax/mscp/mscp_subr.c
index 5750844daab..37376f67bf0 100644
--- a/sys/arch/vax/mscp/mscp_subr.c
+++ b/sys/arch/vax/mscp/mscp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mscp_subr.c,v 1.10 2009/06/02 20:58:39 miod Exp $ */
+/* $OpenBSD: mscp_subr.c,v 1.11 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: mscp_subr.c,v 1.18 2001/11/13 07:38:28 lukem Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -332,9 +332,8 @@ mscp_init(mi)
}
/* step2 */
- WRITE_SW(((mi->mi_dmam->dm_segs[0].ds_addr & 0xffff) +
- offsetof(struct mscp_pack, mp_ca.ca_rspdsc[0])) |
- (vax_cputype == VAX_780 || vax_cputype == VAX_8600 ? MP_PI : 0));
+ WRITE_SW((mi->mi_dmam->dm_segs[0].ds_addr & 0xffff) +
+ offsetof(struct mscp_pack, mp_ca.ca_rspdsc[0]));
status = mscp_waitstep(mi, STEP2MASK, STEP2GOOD(mi->mi_ivec >> 2));
if (status == 0) {
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
diff --git a/sys/arch/vax/qbus/files.uba b/sys/arch/vax/qbus/files.uba
index 38a6a77029d..4c9b72ab88b 100644
--- a/sys/arch/vax/qbus/files.uba
+++ b/sys/arch/vax/qbus/files.uba
@@ -1,4 +1,4 @@
-# $OpenBSD: files.uba,v 1.3 2005/03/08 20:00:24 tdeval Exp $
+# $OpenBSD: files.uba,v 1.4 2011/07/06 18:32:59 miod Exp $
# $NetBSD: files.uba,v 1.6 1999/06/20 18:09:22 ragge Exp $
#
# Config file and device description for machine-independent
@@ -42,11 +42,3 @@ file arch/vax/if/if_qe.c qe
device de: ifnet, ether
attach de at uba
file arch/vax/if/if_de.c de
-
-# QDSS at UBA
-device qd: qfont
-attach qd at uba
-file arch/vax/qbus/qd.c qd needs-count
-
-# Fontfile for DEC framebuffers, soon to die in favour for MI fontfiles.
-file arch/vax/qbus/qfont.c qfont
diff --git a/sys/arch/vax/qbus/if_de.c b/sys/arch/vax/qbus/if_de.c
deleted file mode 100644
index d3c082dec1c..00000000000
--- a/sys/arch/vax/qbus/if_de.c
+++ /dev/null
@@ -1,611 +0,0 @@
-/* $OpenBSD: if_de.c,v 1.10 2010/09/20 07:40:41 deraadt Exp $ */
-/* $NetBSD: if_de.c,v 1.11 2001/11/13 07:11:24 lukem Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
- * Copyright (c) 2000 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- *
- * 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. 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.
- *
- * @(#)if_de.c 7.12 (Berkeley) 12/16/90
- */
-
-/*
- * DEC DEUNA interface
- *
- * Lou Salkind
- * New York University
- *
- * Rewritten by Ragge 30 April 2000 to match new world.
- *
- * TODO:
- * timeout routine (get statistics)
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/buf.h>
-#include <sys/protosw.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-
-#include <net/if.h>
-#include <net/if_ether.h>
-#include <net/if_dl.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_inarp.h>
-#endif
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#include <net/bpfdesc.h>
-#endif
-
-#include <machine/bus.h>
-
-#include <dev/qbus/ubavar.h>
-#include <dev/qbus/if_dereg.h>
-#include <dev/qbus/if_uba.h>
-
-/*
- * Be careful with transmit/receive buffers, each entry steals 4 map
- * registers, and there is only 496 on one unibus...
- */
-#define NRCV 7 /* number of receive buffers (must be > 1) */
-#define NXMT 3 /* number of transmit buffers */
-
-/*
- * Structure containing the elements that must be in DMA-safe memory.
- */
-struct de_cdata {
- /* the following structures are always mapped in */
- struct de_pcbb dc_pcbb; /* port control block */
- struct de_ring dc_xrent[NXMT]; /* transmit ring entries */
- struct de_ring dc_rrent[NRCV]; /* receive ring entries */
- struct de_udbbuf dc_udbbuf; /* UNIBUS data buffer */
- /* end mapped area */
-};
-
-/*
- * Ethernet software status per interface.
- *
- * Each interface is referenced by a network interface structure,
- * ds_if, which the routing code uses to locate the interface.
- * This structure contains the output queue for the interface, its address, ...
- * We also have, for each interface, a UBA interface structure, which
- * contains information about the UNIBUS resources held by the interface:
- * map registers, buffered data paths, etc. Information is cached in this
- * structure for use by the if_uba.c routines in running the interface
- * efficiently.
- */
-struct de_softc {
- struct device sc_dev; /* Configuration common part */
- struct ethercom sc_ec; /* Ethernet common part */
-#define sc_if sc_ec.ec_if /* network-visible interface */
- bus_space_tag_t sc_iot;
- bus_addr_t sc_ioh;
- bus_dma_tag_t sc_dmat;
- int sc_flags;
-#define DSF_MAPPED 1
- struct ubinfo sc_ui;
- struct de_cdata *sc_dedata; /* Control structure */
- struct de_cdata *sc_pdedata; /* Bus-mapped control structure */
- struct ifubinfo sc_ifuba; /* UNIBUS resources */
- struct ifrw sc_ifr[NRCV]; /* UNIBUS receive buffer maps */
- struct ifxmt sc_ifw[NXMT]; /* UNIBUS receive buffer maps */
-
- int sc_xindex; /* UNA index into transmit chain */
- int sc_rindex; /* UNA index into receive chain */
- int sc_xfree; /* index for next transmit buffer */
- int sc_nxmit; /* # of transmits in progress */
-};
-
-static int dematch(struct device *, struct cfdata *, void *);
-static void deattach(struct device *, struct device *, void *);
-static void dewait(struct de_softc *, char *);
-static int deinit(struct ifnet *);
-static int deioctl(struct ifnet *, u_long, caddr_t);
-static void dereset(struct device *);
-static void destop(struct ifnet *, int);
-static void destart(struct ifnet *);
-static void derecv(struct de_softc *);
-static void deintr(void *);
-
-struct cfattach de_ca = {
- sizeof(struct de_softc), dematch, deattach
-};
-
-#define DE_WCSR(csr, val) \
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, csr, val)
-#define DE_WLOW(val) \
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, DE_PCSR0, val)
-#define DE_WHIGH(val) \
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, DE_PCSR0 + 1, val)
-#define DE_RCSR(csr) \
- bus_space_read_2(sc->sc_iot, sc->sc_ioh, csr)
-
-#define LOWORD(x) ((int)(x) & 0xffff)
-#define HIWORD(x) (((int)(x) >> 16) & 0x3)
-/*
- * Interface exists: make available by filling in network interface
- * record. System will initialize the interface when it is ready
- * to accept packets. We get the ethernet address here.
- */
-void
-deattach(struct device *parent, struct device *self, void *aux)
-{
- struct uba_attach_args *ua = aux;
- struct de_softc *sc = (struct de_softc *)self;
- struct ifnet *ifp = &sc->sc_if;
- u_int8_t myaddr[ETHER_ADDR_LEN];
- int csr1, error;
- char *c;
-
- sc->sc_iot = ua->ua_iot;
- sc->sc_ioh = ua->ua_ioh;
- sc->sc_dmat = ua->ua_dmat;
-
- /*
- * What kind of a board is this?
- * The error bits 4-6 in pcsr1 are a device id as long as
- * the high byte is zero.
- */
- csr1 = DE_RCSR(DE_PCSR1);
- if (csr1 & 0xff60)
- c = "broken";
- else if (csr1 & 0x10)
- c = "delua";
- else
- c = "deuna";
-
- /*
- * Reset the board and temporarily map
- * the pcbb buffer onto the Unibus.
- */
- DE_WCSR(DE_PCSR0, 0); /* reset INTE */
- DELAY(100);
- DE_WCSR(DE_PCSR0, PCSR0_RSET);
- dewait(sc, "reset");
-
- sc->sc_ui.ui_size = sizeof(struct de_cdata);
- if ((error = ubmemalloc((struct uba_softc *)parent, &sc->sc_ui, 0)))
- return printf(": failed ubmemalloc(), error = %d\n", error);
- sc->sc_dedata = (struct de_cdata *)sc->sc_ui.ui_vaddr;
-
- /*
- * Tell the DEUNA about our PCB
- */
- DE_WCSR(DE_PCSR2, LOWORD(sc->sc_ui.ui_baddr));
- DE_WCSR(DE_PCSR3, HIWORD(sc->sc_ui.ui_baddr));
- DE_WLOW(CMD_GETPCBB);
- dewait(sc, "pcbb");
-
- sc->sc_dedata->dc_pcbb.pcbb0 = FC_RDPHYAD;
- DE_WLOW(CMD_GETCMD);
- dewait(sc, "read addr ");
-
- bcopy((caddr_t)&sc->sc_dedata->dc_pcbb.pcbb2, myaddr, sizeof (myaddr));
- printf(": %s, address %s\n", c, ether_sprintf(myaddr));
-
- uba_intr_establish(ua->ua_icookie, ua->ua_cvec, deintr, sc,
- &sc->sc_intrcnt);
- uba_reset_establish(dereset, &sc->sc_dev);
-
- strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, sizeof ifp->if_xname);
- ifp->if_softc = sc;
- ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI;
- ifp->if_ioctl = deioctl;
- ifp->if_start = destart;
- ifp->if_stop = destop;
- IFQ_SET_READY(&ifp->if_snd);
-
- if_attach(ifp);
- ether_ifattach(ifp, myaddr);
- ubmemfree((struct uba_softc *)parent, &sc->sc_ui);
-}
-
-void
-destop(struct ifnet *ifp, int a)
-{
- struct de_softc *sc = ifp->if_softc;
-
- DE_WLOW(0);
- DELAY(5000);
- DE_WLOW(PCSR0_RSET);
-}
-
-
-/*
- * Reset of interface after UNIBUS reset.
- */
-void
-dereset(struct device *dev)
-{
- struct de_softc *sc = (void *)dev;
-
- sc->sc_if.if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
- sc->sc_flags &= ~DSF_MAPPED;
- sc->sc_pdedata = NULL; /* All mappings lost */
- DE_WCSR(DE_PCSR0, PCSR0_RSET);
- dewait(sc, "reset");
- deinit(&sc->sc_if);
-}
-
-/*
- * Initialization of interface; clear recorded pending
- * operations, and reinitialize UNIBUS usage.
- */
-int
-deinit(struct ifnet *ifp)
-{
- struct de_softc *sc = ifp->if_softc;
- struct de_cdata *dc, *pdc;
- struct ifrw *ifrw;
- struct ifxmt *ifxp;
- struct de_ring *rp;
- int s, error;
-
- if (ifp->if_flags & IFF_RUNNING)
- return 0;
- if ((sc->sc_flags & DSF_MAPPED) == 0) {
- if (if_ubaminit(&sc->sc_ifuba, (void *)sc->sc_dev.dv_parent,
- MCLBYTES, sc->sc_ifr, NRCV, sc->sc_ifw, NXMT)) {
- printf("%s: can't initialize\n", sc->sc_dev.dv_xname);
- ifp->if_flags &= ~IFF_UP;
- return 0;
- }
- sc->sc_ui.ui_size = sizeof(struct de_cdata);
- if ((error = ubmemalloc((void *)sc->sc_dev.dv_parent,
- &sc->sc_ui, 0))) {
- printf(": unable to ubmemalloc(), error = %d\n", error);
- return 0;
- }
- sc->sc_pdedata = (struct de_cdata *)sc->sc_ui.ui_baddr;
- sc->sc_dedata = (struct de_cdata *)sc->sc_ui.ui_vaddr;
- sc->sc_flags |= DSF_MAPPED;
- }
-
- /*
- * Tell the DEUNA about our PCB
- */
- DE_WCSR(DE_PCSR2, LOWORD(sc->sc_pdedata));
- DE_WCSR(DE_PCSR3, HIWORD(sc->sc_pdedata));
- DE_WLOW(0); /* reset INTE */
- DELAY(500);
- DE_WLOW(CMD_GETPCBB);
- dewait(sc, "pcbb");
-
- dc = sc->sc_dedata;
- pdc = sc->sc_pdedata;
- /* set the transmit and receive ring header addresses */
- dc->dc_pcbb.pcbb0 = FC_WTRING;
- dc->dc_pcbb.pcbb2 = LOWORD(&pdc->dc_udbbuf);
- dc->dc_pcbb.pcbb4 = HIWORD(&pdc->dc_udbbuf);
-
- dc->dc_udbbuf.b_tdrbl = LOWORD(&pdc->dc_xrent[0]);
- dc->dc_udbbuf.b_tdrbh = HIWORD(&pdc->dc_xrent[0]);
- dc->dc_udbbuf.b_telen = sizeof (struct de_ring) / sizeof(u_int16_t);
- dc->dc_udbbuf.b_trlen = NXMT;
- dc->dc_udbbuf.b_rdrbl = LOWORD(&pdc->dc_rrent[0]);
- dc->dc_udbbuf.b_rdrbh = HIWORD(&pdc->dc_rrent[0]);
- dc->dc_udbbuf.b_relen = sizeof (struct de_ring) / sizeof(u_int16_t);
- dc->dc_udbbuf.b_rrlen = NRCV;
-
- DE_WLOW(CMD_GETCMD);
- dewait(sc, "wtring");
-
- sc->sc_dedata->dc_pcbb.pcbb0 = FC_WTMODE;
- sc->sc_dedata->dc_pcbb.pcbb2 = MOD_TPAD|MOD_HDX|MOD_DRDC|MOD_ENAL;
- DE_WLOW(CMD_GETCMD);
- dewait(sc, "wtmode");
-
- /* set up the receive and transmit ring entries */
- ifxp = &sc->sc_ifw[0];
- for (rp = &dc->dc_xrent[0]; rp < &dc->dc_xrent[NXMT]; rp++) {
- rp->r_segbl = LOWORD(ifxp->ifw_info);
- rp->r_segbh = HIWORD(ifxp->ifw_info);
- rp->r_flags = 0;
- ifxp++;
- }
- ifrw = &sc->sc_ifr[0];
- for (rp = &dc->dc_rrent[0]; rp < &dc->dc_rrent[NRCV]; rp++) {
- rp->r_slen = MCLBYTES - 2;
- rp->r_segbl = LOWORD(ifrw->ifrw_info);
- rp->r_segbh = HIWORD(ifrw->ifrw_info);
- rp->r_flags = RFLG_OWN;
- ifrw++;
- }
-
- /* start up the board (rah rah) */
- s = splnet();
- sc->sc_rindex = sc->sc_xindex = sc->sc_xfree = sc->sc_nxmit = 0;
- sc->sc_if.if_flags |= IFF_RUNNING;
- DE_WLOW(PCSR0_INTE); /* avoid interlock */
- destart(&sc->sc_if); /* queue output packets */
- DE_WLOW(CMD_START|PCSR0_INTE);
- splx(s);
- return 0;
-}
-
-/*
- * Setup output on interface.
- * Get another datagram to send off of the interface queue,
- * and map it to the interface before starting the output.
- * Must be called from ipl >= our interrupt level.
- */
-void
-destart(struct ifnet *ifp)
-{
- struct de_softc *sc = ifp->if_softc;
- struct de_cdata *dc;
- struct de_ring *rp;
- struct mbuf *m;
- int nxmit, len;
-
- /*
- * the following test is necessary, since
- * the code is not reentrant and we have
- * multiple transmission buffers.
- */
- if (sc->sc_if.if_flags & IFF_OACTIVE)
- return;
- dc = sc->sc_dedata;
- for (nxmit = sc->sc_nxmit; nxmit < NXMT; nxmit++) {
- IFQ_DEQUEUE(&ifp->if_snd, m);
- if (m == 0)
- break;
-
- rp = &dc->dc_xrent[sc->sc_xfree];
- if (rp->r_flags & XFLG_OWN)
- panic("deuna xmit in progress");
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
-#endif
-
- len = if_ubaput(&sc->sc_ifuba, &sc->sc_ifw[sc->sc_xfree], m);
- rp->r_slen = len;
- rp->r_tdrerr = 0;
- rp->r_flags = XFLG_STP|XFLG_ENP|XFLG_OWN;
-
- sc->sc_xfree++;
- if (sc->sc_xfree == NXMT)
- sc->sc_xfree = 0;
- }
- if (sc->sc_nxmit != nxmit) {
- sc->sc_nxmit = nxmit;
- if (ifp->if_flags & IFF_RUNNING)
- DE_WLOW(PCSR0_INTE|CMD_PDMD);
- }
-}
-
-/*
- * Command done interrupt.
- */
-void
-deintr(void *arg)
-{
- struct ifxmt *ifxp;
- struct de_cdata *dc;
- struct de_softc *sc = arg;
- struct de_ring *rp;
- short csr0;
-
- /* save flags right away - clear out interrupt bits */
- csr0 = DE_RCSR(DE_PCSR0);
- DE_WHIGH(csr0 >> 8);
-
-
- sc->sc_if.if_flags |= IFF_OACTIVE; /* prevent entering destart */
- /*
- * if receive, put receive buffer on mbuf
- * and hang the request again
- */
- derecv(sc);
-
- /*
- * Poll transmit ring and check status.
- * Be careful about loopback requests.
- * Then free buffer space and check for
- * more transmit requests.
- */
- dc = sc->sc_dedata;
- for ( ; sc->sc_nxmit > 0; sc->sc_nxmit--) {
- rp = &dc->dc_xrent[sc->sc_xindex];
- if (rp->r_flags & XFLG_OWN)
- break;
-
- sc->sc_if.if_opackets++;
- ifxp = &sc->sc_ifw[sc->sc_xindex];
- /* check for unusual conditions */
- if (rp->r_flags & (XFLG_ERRS|XFLG_MTCH|XFLG_ONE|XFLG_MORE)) {
- if (rp->r_flags & XFLG_ERRS) {
- /* output error */
- sc->sc_if.if_oerrors++;
- } else if (rp->r_flags & XFLG_ONE) {
- /* one collision */
- sc->sc_if.if_collisions++;
- } else if (rp->r_flags & XFLG_MORE) {
- /* more than one collision */
- sc->sc_if.if_collisions += 2; /* guess */
- }
- }
- if_ubaend(&sc->sc_ifuba, ifxp);
- /* check if next transmit buffer also finished */
- sc->sc_xindex++;
- if (sc->sc_xindex == NXMT)
- sc->sc_xindex = 0;
- }
- sc->sc_if.if_flags &= ~IFF_OACTIVE;
- destart(&sc->sc_if);
-
- if (csr0 & PCSR0_RCBI) {
- DE_WLOW(PCSR0_INTE|CMD_PDMD);
- }
-}
-
-/*
- * Ethernet interface receiver interface.
- * If input error just drop packet.
- * Otherwise purge input buffered data path and examine
- * packet to determine type. If can't determine length
- * from type, then have to drop packet. Othewise decapsulate
- * packet based on type and pass to type specific higher-level
- * input routine.
- */
-void
-derecv(struct de_softc *sc)
-{
- struct ifnet *ifp = &sc->sc_if;
- struct de_ring *rp;
- struct de_cdata *dc;
- struct mbuf *m;
- int len;
-
- dc = sc->sc_dedata;
- rp = &dc->dc_rrent[sc->sc_rindex];
- while ((rp->r_flags & RFLG_OWN) == 0) {
- sc->sc_if.if_ipackets++;
- len = (rp->r_lenerr&RERR_MLEN) - ETHER_CRC_LEN;
- /* check for errors */
- if ((rp->r_flags & (RFLG_ERRS|RFLG_FRAM|RFLG_OFLO|RFLG_CRC)) ||
- (rp->r_lenerr & (RERR_BUFL|RERR_UBTO))) {
- sc->sc_if.if_ierrors++;
- goto next;
- }
- m = if_ubaget(&sc->sc_ifuba, &sc->sc_ifr[sc->sc_rindex],
- ifp, len);
- if (m == 0) {
- sc->sc_if.if_ierrors++;
- goto next;
- }
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- (*ifp->if_input)(ifp, m);
-
- /* hang the receive buffer again */
-next: rp->r_lenerr = 0;
- rp->r_flags = RFLG_OWN;
-
- /* check next receive buffer */
- sc->sc_rindex++;
- if (sc->sc_rindex == NRCV)
- sc->sc_rindex = 0;
- rp = &dc->dc_rrent[sc->sc_rindex];
- }
-}
-
-/*
- * Process an ioctl request.
- */
-int
-deioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
-{
- int s, error = 0;
-
- s = splnet();
-
- error = ether_ioctl(ifp, cmd, data);
- if (error == ENETRESET)
- error = 0;
-
- splx(s);
- return (error);
-}
-
-/*
- * Await completion of the named function
- * and check for errors.
- */
-void
-dewait(struct de_softc *sc, char *fn)
-{
- int csr0;
-
- while ((DE_RCSR(DE_PCSR0) & PCSR0_INTR) == 0)
- ;
- csr0 = DE_RCSR(DE_PCSR0);
- DE_WHIGH(csr0 >> 8);
- if (csr0 & PCSR0_PCEI) {
- char bits[64];
- printf("%s: %s failed, csr0=%s ", sc->sc_dev.dv_xname, fn,
- bitmask_snprintf(csr0, PCSR0_BITS, bits, sizeof(bits)));
- printf("csr1=%s\n", bitmask_snprintf(DE_RCSR(DE_PCSR1),
- PCSR1_BITS, bits, sizeof(bits)));
- }
-}
-
-int
-dematch(struct device *parent, struct cfdata *cf, void *aux)
-{
- struct uba_attach_args *ua = aux;
- struct de_softc ssc;
- struct de_softc *sc = &ssc;
- int i;
-
- sc->sc_iot = ua->ua_iot;
- sc->sc_ioh = ua->ua_ioh;
- /*
- * Make sure self-test is finished before we screw with the board.
- * Self-test on a DELUA can take 15 seconds (argh).
- */
- for (i = 0;
- (i < 160) &&
- (DE_RCSR(DE_PCSR0) & PCSR0_FATI) == 0 &&
- (DE_RCSR(DE_PCSR1) & PCSR1_STMASK) == STAT_RESET;
- ++i)
- DELAY(50000);
- if (((DE_RCSR(DE_PCSR0) & PCSR0_FATI) != 0) ||
- (((DE_RCSR(DE_PCSR1) & PCSR1_STMASK) != STAT_READY) &&
- ((DE_RCSR(DE_PCSR1) & PCSR1_STMASK) != STAT_RUN)))
- return(0);
-
- DE_WCSR(DE_PCSR0, 0);
- DELAY(5000);
- DE_WCSR(DE_PCSR0, PCSR0_RSET);
- while ((DE_RCSR(DE_PCSR0) & PCSR0_INTR) == 0)
- ;
- /* make board interrupt by executing a GETPCBB command */
- DE_WCSR(DE_PCSR0, PCSR0_INTE);
- DE_WCSR(DE_PCSR2, 0);
- DE_WCSR(DE_PCSR3, 0);
- DE_WCSR(DE_PCSR0, PCSR0_INTE|CMD_GETPCBB);
- DELAY(50000);
-
- return 1;
-}
diff --git a/sys/arch/vax/qbus/if_dereg.h b/sys/arch/vax/qbus/if_dereg.h
deleted file mode 100644
index 468a4a654d4..00000000000
--- a/sys/arch/vax/qbus/if_dereg.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $OpenBSD: if_dereg.h,v 1.2 2003/06/02 23:27:58 millert Exp $ */
-/* $NetBSD: if_dereg.h,v 1.2 2000/05/28 17:23:44 ragge Exp $ */
-
-/*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)if_dereg.h 7.3 (Berkeley) 6/28/90
- */
-
-/*
- * DEC DEUNA interface
- */
-#ifdef notdef
-struct dedevice {
- union {
- short p0_w;
- char p0_b[2];
- } u_p0;
-#define pcsr0 u_p0.p0_w
-#define pclow u_p0.p0_b[0]
-#define pchigh u_p0.p0_b[1]
- short pcsr1;
- short pcsr2;
- short pcsr3;
-};
-#endif
-
-#define DE_PCSR0 0
-#define DE_PCSR1 2
-#define DE_PCSR2 4
-#define DE_PCSR3 6
-
-/*
- * PCSR 0 bit descriptions
- */
-#define PCSR0_SERI 0x8000 /* Status error interrupt */
-#define PCSR0_PCEI 0x4000 /* Port command error interrupt */
-#define PCSR0_RXI 0x2000 /* Receive done interrupt */
-#define PCSR0_TXI 0x1000 /* Transmit done interrupt */
-#define PCSR0_DNI 0x0800 /* Done interrupt */
-#define PCSR0_RCBI 0x0400 /* Receive buffer unavail intrpt */
-#define PCSR0_FATI 0x0100 /* Fatal error interrupt */
-#define PCSR0_INTR 0x0080 /* Interrupt summary */
-#define PCSR0_INTE 0x0040 /* Interrupt enable */
-#define PCSR0_RSET 0x0020 /* DEUNA reset */
-#define PCSR0_CMASK 0x000f /* command mask */
-
-#define PCSR0_BITS "\20\20SERI\17PCEI\16RXI\15TXI\14DNI\13RCBI\11FATI\10INTR\7INTE\6RSET"
-
-/* bits 0-3 are for the PORT_COMMAND */
-#define CMD_NOOP 0x0
-#define CMD_GETPCBB 0x1 /* Get PCB Block */
-#define CMD_GETCMD 0x2 /* Execute command in PCB */
-#define CMD_STEST 0x3 /* Self test mode */
-#define CMD_START 0x4 /* Reset xmit and receive ring ptrs */
-#define CMD_BOOT 0x5 /* Boot DEUNA */
-#define CMD_PDMD 0x8 /* Polling demand */
-#define CMD_TMRO 0x9 /* Sanity timer on */
-#define CMD_TMRF 0xa /* Sanity timer off */
-#define CMD_RSTT 0xb /* Reset sanity timer */
-#define CMD_STOP 0xf /* Suspend operation */
-
-/*
- * PCSR 1 bit descriptions
- */
-#define PCSR1_XPWR 0x8000 /* Transceiver power BAD */
-#define PCSR1_ICAB 0x4000 /* Interconnect cabling BAD */
-#define PCSR1_STCODE 0x3f00 /* Self test error code */
-#define PCSR1_PCTO 0x0080 /* Port command timed out */
-#define PCSR1_ILLINT 0x0040 /* Illegal interrupt */
-#define PCSR1_TIMEOUT 0x0020 /* Timeout */
-#define PCSR1_POWER 0x0010 /* Power fail */
-#define PCSR1_RMTC 0x0008 /* Remote console reserved */
-#define PCSR1_STMASK 0x0007 /* State */
-
-/* bit 0-3 are for STATE */
-#define STAT_RESET 0x0
-#define STAT_PRIMLD 0x1 /* Primary load */
-#define STAT_READY 0x2
-#define STAT_RUN 0x3
-#define STAT_UHALT 0x5 /* UNIBUS halted */
-#define STAT_NIHALT 0x6 /* NI halted */
-#define STAT_NIUHALT 0x7 /* NI and UNIBUS Halted */
-
-#define PCSR1_BITS "\20\20XPWR\17ICAB\10PCTO\7ILLINT\6TIMEOUT\5POWER\4RMTC"
-
-/*
- * Port Control Block Base
- */
-struct de_pcbb {
- int16_t pcbb0; /* function */
- int16_t pcbb2; /* command specific */
- int16_t pcbb4;
- int16_t pcbb6;
-};
-
-/* PCBB function codes */
-#define FC_NOOP 0x00 /* NO-OP */
-#define FC_LSUADDR 0x01 /* Load and start microaddress */
-#define FC_RDDEFAULT 0x02 /* Read default physical address */
-#define FC_RDPHYAD 0x04 /* Read physical address */
-#define FC_WTPHYAD 0x05 /* Write physical address */
-#define FC_RDMULTI 0x06 /* Read multicast address list */
-#define FC_WTMULTI 0x07 /* Read multicast address list */
-#define FC_RDRING 0x08 /* Read ring format */
-#define FC_WTRING 0x09 /* Write ring format */
-#define FC_RDCNTS 0x0a /* Read counters */
-#define FC_RCCNTS 0x0b /* Read and clear counters */
-#define FC_RDMODE 0x0c /* Read mode */
-#define FC_WTMODE 0x0d /* Write mode */
-#define FC_RDSTATUS 0x0e /* Read port status */
-#define FC_RCSTATUS 0x0f /* Read and clear port status */
-#define FC_DUMPMEM 0x10 /* Dump internal memory */
-#define FC_LOADMEM 0x11 /* Load internal memory */
-#define FC_RDSYSID 0x12 /* Read system ID parameters */
-#define FC_WTSYSID 0x13 /* Write system ID parameters */
-#define FC_RDSERAD 0x14 /* Read load server address */
-#define FC_WTSERAD 0x15 /* Write load server address */
-
-/*
- * Unibus Data Block Base (UDBB) for ring buffers
- */
-struct de_udbbuf {
- int16_t b_tdrbl; /* Transmit desc ring base low 16 bits */
- int8_t b_tdrbh; /* Transmit desc ring base high 2 bits */
- int8_t b_telen; /* Length of each transmit entry */
- int16_t b_trlen; /* Number of entries in the XMIT desc ring */
- int16_t b_rdrbl; /* Receive desc ring base low 16 bits */
- int8_t b_rdrbh; /* Receive desc ring base high 2 bits */
- int8_t b_relen; /* Length of each receive entry */
- int16_t b_rrlen; /* Number of entries in the RECV desc ring */
-};
-
-/*
- * Transmit/Receive Ring Entry
- */
-struct de_ring {
- int16_t r_slen; /* Segment length */
- int16_t r_segbl; /* Segment address (low 16 bits) */
- int8_t r_segbh; /* Segment address (hi 2 bits) */
- u_int8_t r_flags; /* Status flags */
- u_int16_t r_tdrerr; /* Errors */
-#define r_lenerr r_tdrerr
-};
-
-#define XFLG_OWN 0x80 /* If 0 then owned by driver */
-#define XFLG_ERRS 0x40 /* Error summary */
-#define XFLG_MTCH 0x20 /* Address match on xmit request */
-#define XFLG_MORE 0x10 /* More than one entry required */
-#define XFLG_ONE 0x08 /* One collision encountered */
-#define XFLG_DEF 0x04 /* Transmit deferred */
-#define XFLG_STP 0x02 /* Start of packet */
-#define XFLG_ENP 0x01 /* End of packet */
-
-#define XFLG_BITS "\10\10OWN\7ERRS\6MTCH\5MORE\4ONE\3DEF\2STP\1ENP"
-
-#define XERR_BUFL 0x8000 /* Buffer length error */
-#define XERR_UBTO 0x4000 /* UNIBUS tiemout */
-#define XERR_LCOL 0x1000 /* Late collision */
-#define XERR_LCAR 0x0800 /* Loss of carrier */
-#define XERR_RTRY 0x0400 /* Failed after 16 retries */
-#define XERR_TDR 0x03ff /* TDR value */
-
-#define XERR_BITS "\20\20BUFL\17UBTO\15LCOL\14LCAR\13RTRY"
-
-#define RFLG_OWN 0x80 /* If 0 then owned by driver */
-#define RFLG_ERRS 0x40 /* Error summary */
-#define RFLG_FRAM 0x20 /* Framing error */
-#define RFLG_OFLO 0x10 /* Message overflow */
-#define RFLG_CRC 0x08 /* CRC error */
-#define RFLG_STP 0x02 /* Start of packet */
-#define RFLG_ENP 0x01 /* End of packet */
-
-#define RFLG_BITS "\10\10OWN\7ERRS\6FRAM\5OFLO\4CRC\2STP\1ENP"
-
-#define RERR_BUFL 0x8000 /* Buffer length error */
-#define RERR_UBTO 0x4000 /* UNIBUS tiemout */
-#define RERR_NCHN 0x2000 /* No data chaining */
-#define RERR_MLEN 0x0fff /* Message length */
-
-#define RERR_BITS "\20\20BUFL\17UBTO\16NCHN"
-
-/* mode description bits */
-#define MOD_HDX 0x0001 /* Half duplex mode */
-#define MOD_LOOP 0x0004 /* Enable internal loopback */
-#define MOD_DTCR 0x0008 /* Disables CRC generation */
-#define MOD_DMNT 0x0200 /* Disable maintenance features */
-#define MOD_ECT 0x0400 /* Enable collision test */
-#define MOD_TPAD 0x1000 /* Transmit message pad enable */
-#define MOD_DRDC 0x2000 /* Disable data chaining */
-#define MOD_ENAL 0x4000 /* Enable all multicast */
-#define MOD_PROM 0x8000 /* Enable promiscuous mode */
diff --git a/sys/arch/vax/qbus/qd.c b/sys/arch/vax/qbus/qd.c
deleted file mode 100644
index d97ce5b9bc8..00000000000
--- a/sys/arch/vax/qbus/qd.c
+++ /dev/null
@@ -1,3824 +0,0 @@
-/* $OpenBSD: qd.c,v 1.20 2010/09/22 01:18:57 matthew Exp $ */
-/* $NetBSD: qd.c,v 1.17 2000/01/24 02:40:29 matt Exp $ */
-
-/*-
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)qd.c 7.1 (Berkeley) 6/28/91
- */
-
-/************************************************************************
-* *
-* Copyright (c) 1985-1988 by *
-* Digital Equipment Corporation, Maynard, MA *
-* All rights reserved. *
-* *
-* This software is furnished under a license and may be used and *
-* copied only in accordance with the terms of such license and *
-* with the inclusion of the above copyright notice. This *
-* software or any other copies thereof may not be provided or *
-* otherwise made available to any other person. No title to and *
-* ownership of the software is hereby transferred. *
-* *
-* The information in this software is subject to change without *
-* notice and should not be construed as a commitment by Digital *
-* Equipment Corporation. *
-* *
-* Digital assumes no responsibility for the use or reliability *
-* of its software on equipment which is not supplied by Digital. *
-* *
-*************************************************************************/
-
-/*
- * qd.c - QDSS display driver for VAXSTATION-II GPX workstation
- */
-
-#include "qd.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/tty.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/poll.h>
-#include <sys/buf.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <dev/cons.h>
-
-#include <machine/bus.h>
-#include <machine/scb.h>
-
-#ifdef __vax__
-#include <machine/sid.h>
-#include <machine/cpu.h>
-#include <machine/pte.h>
-#endif
-
-#include <arch/vax/qbus/ubavar.h>
-
-#include <arch/vax/qbus/qduser.h>
-#include <arch/vax/qbus/qdreg.h>
-#include <arch/vax/qbus/qdioctl.h>
-
-/*
- * QDSS driver status flags for tracking operational state
- */
-struct qdflags {
- u_int inuse; /* which minor dev's are in use now */
- u_int config; /* I/O page register content */
- u_int mapped; /* user mapping status word */
- u_int kernel_loop; /* if kernel console is redirected */
- u_int user_dma; /* DMA from user space in progress */
- u_short pntr_id; /* type code of pointing device */
- u_short duart_imask; /* shadowing for duart intrpt mask reg */
- u_short adder_ie; /* shadowing for adder intrpt enbl reg */
- u_short curs_acc; /* cursor acceleration factor */
- u_short curs_thr; /* cursor acceleration threshold level */
- u_short tab_res; /* tablet resolution factor */
- u_short selmask; /* mask for active qd select entries */
-};
-
-/*
- * Softc struct to keep track of all states in this driver.
- */
-struct qd_softc {
- struct device sc_dev;
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
- bus_dma_tag_t sc_dmat;
-};
-
-/*
- * bit definitions for 'inuse' entry
- */
-#define CONS_DEV 0x01
-#define GRAPHIC_DEV 0x04
-
-/*
- * bit definitions for 'mapped' member of flag structure
- */
-#define MAPDEV 0x01 /* hardware is mapped */
-#define MAPDMA 0x02 /* DMA buffer mapped */
-#define MAPEQ 0x04 /* event queue buffer mapped */
-#define MAPSCR 0x08 /* scroll param area mapped */
-#define MAPCOLOR 0x10 /* color map writing buffer mapped */
-
-/*
- * bit definitions for 'selmask' member of qdflag structure
- */
-#define SEL_READ 0x01 /* read select is active */
-#define SEL_WRITE 0x02 /* write select is active */
-
-/*
- * constants used in shared memory operations
- */
-#define EVENT_BUFSIZE 1024 /* # of bytes per device's event buffer */
-#define MAXEVENTS ( (EVENT_BUFSIZE - sizeof(struct qdinput)) \
- / sizeof(struct _vs_event) )
-#define DMA_BUFSIZ (1024 * 10)
-#define COLOR_BUFSIZ ((sizeof(struct color_buf) + 512) & ~0x01FF)
-
-/*
- * reference to an array of "uba_device" structures built by the auto
- * configuration program. The uba_device structure decribes the device
- * sufficiently for the driver to talk to it. The auto configuration code
- * fills in the uba_device structures (located in ioconf.c) from user
- * maintained info.
- */
-struct uba_device *qdinfo[NQD]; /* array of pntrs to each QDSS's */
-struct tty *qd_tty[NQD*4]; /* teletype structures for each.. */
-volatile char *qvmem[NQD];
-volatile pt_entry_t *QVmap[NQD];
-#define CHUNK (64 * 1024)
-#define QMEMSIZE (1024 * 1024 * 4) /* 4 meg */
-
-/*
- * static storage used by multiple functions in this code
- */
-int Qbus_unmap[NQD]; /* Qbus mapper release code */
-struct qdmap qdmap[NQD]; /* QDSS register map structure */
-struct qdflags qdflags[NQD]; /* QDSS register map structure */
-caddr_t qdbase[NQD]; /* base address of each QDSS unit */
-short qdopened[NQD]; /* graphics device is open exclusive use */
-
-/*
- * the array "event_shared[]" is made up of a number of event queue buffers
- * equal to the number of QDSS's configured into the running kernel (NQD).
- * Each event queue buffer begins with an event queue header (struct qdinput)
- * followed by a group of event queue entries (struct _vs_event). The array
- * "*eq_header[]" is an array of pointers to the start of each event queue
- * buffer in "event_shared[]".
- */
-#define EQSIZE ((EVENT_BUFSIZE * NQD) + 512)
-
-char event_shared[EQSIZE]; /* reserve space for event bufs */
-struct qdinput *eq_header[NQD]; /* event queue header pntrs */
-
-/*
- * This allocation method reserves enough memory pages for NQD shared DMA I/O
- * buffers. Each buffer must consume an integral number of memory pages to
- * guarantee that a following buffer will begin on a page boundary. Also,
- * enough space is allocated so that the FIRST I/O buffer can start at the
- * 1st page boundary after "&DMA_shared". Page boundaries are used so that
- * memory protections can be turned on/off for individual buffers.
- */
-#define IOBUFSIZE ((DMA_BUFSIZ * NQD) + 512)
-
-char DMA_shared[IOBUFSIZE]; /* reserve I/O buffer space */
-struct DMAreq_header *DMAheader[NQD]; /* DMA buffer header pntrs */
-
-/*
- * The driver assists a client in scroll operations by loading dragon
- * registers from an interrupt service routine. The loading is done using
- * parameters found in memory shrade between the driver and its client.
- * The scroll parameter structures are ALL loacted in the same memory page
- * for reasons of memory economy.
- */
-char scroll_shared[2 * 512]; /* reserve space for scroll structs */
-struct scroll *scroll[NQD]; /* pointers to scroll structures */
-
-/*
- * the driver is programmable to provide the user with color map write
- * services at VSYNC interrupt time. At interrupt time the driver loads
- * the color map with any user-requested load data found in shared memory
- */
-#define COLOR_SHARED ((COLOR_BUFSIZ * NQD) + 512)
-
-char color_shared[COLOR_SHARED]; /* reserve space: color bufs */
-struct color_buf *color_buf[NQD]; /* pointers to color bufs */
-
-/*
- * mouse input event structures
- */
-struct mouse_report last_rep[NQD];
-struct mouse_report current_rep[NQD];
-
-struct selinfo qdrsel[NQD]; /* process waiting for select */
-struct _vs_cursor cursor[NQD]; /* console cursor */
-int qdcount = 0; /* count of successfully probed qd's */
-int nNQD = NQD;
-int DMAbuf_size = DMA_BUFSIZ;
-int QDlast_DMAtype; /* type of the last DMA operation */
-
-/* #define QDSSMAJOR 41 */ /* QDSS major device number. We don't care! */
-
-/*
- * macro to get system time. Used to time stamp event queue entries
- */
-#define TOY ((time.tv_sec * 100) + (time.tv_usec / 10000))
-
-void qd_attach(struct device *, struct device *, void *);
-static int qd_match(struct device *, struct cfdata *, void *);
-
-static void qddint(void *); /* DMA gate array intrpt service */
-static void qdaint(void *); /* Dragon ADDER intrpt service */
-static void qdiint(void *);
-
-#define QDPRIOR (PZERO-1) /* must be negative */
-#define FALSE 0
-#ifdef TRUE
-#undef TRUE
-#endif
-#define TRUE ~FALSE
-#define BAD -1
-#define GOOD 0
-
-/*
- * macro to create a system virtual page number from system virtual adrs
- */
-#define VTOP(x) (((int)x & ~0xC0000000) >> VAX_PGSHIFT)
-
-/*
- * QDSS register address offsets from start of QDSS address space
- */
-#define QDSIZE (52 * 1024) /* size of entire QDSS foot print */
-#define TMPSIZE (16 * 1024) /* template RAM is 8k SHORT WORDS */
-#define TMPSTART 0x8000 /* offset of template RAM from base adrs */
-#define REGSIZE (5 * 512) /* regs touch 2.5k (5 pages) of addr space */
-#define REGSTART 0xC000 /* offset of reg pages from base adrs */
-#define ADDER (REGSTART+0x000)
-#define DGA (REGSTART+0x200)
-#define DUART (REGSTART+0x400)
-#define MEMCSR (REGSTART+0x800)
-#define CLRSIZE (3 * 512) /* color map size */
-#define CLRSTART (REGSTART+0xA00) /* color map start offset from base */
-/* 0x0C00 really */
-#define RED (CLRSTART+0x000)
-#define BLUE (CLRSTART+0x200)
-#define GREEN (CLRSTART+0x400)
-
-
-/*
- * QDSS minor device numbers. The *real* minor device numbers are in
- * the bottom two bits of the major/minor device spec. Bits 2 and up are
- * used to specify the QDSS device number (ie: which one?)
- */
-
-#define CONS 0
-#define GRAPHIC 2
-
-/*
- * console cursor bitmap (white block cursor)
- */
-short cons_cursor[32] = {
- /* A */ 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF,
- 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF,
- /* B */ 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF,
- 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF
-};
-
-/*
- * constants used in font operations
- */
-#define CHARS 190 /* # of chars in the font */
-#define CHAR_HEIGHT 15 /* char height in pixels */
-#define CHAR_WIDTH 8 /* char width in pixels*/
-#define FONT_WIDTH (CHAR_WIDTH * CHARS) /* font width in pixels */
-#define ROWS CHAR_HEIGHT
-#define FONT_X 0 /* font's off screen adrs */
-#define FONT_Y (2048 - CHAR_HEIGHT)
-
-/* Offset to second row characters (XXX - should remove) */
-#define FONT_OFFSET ((MAX_SCREEN_X/CHAR_WIDTH)*CHAR_HEIGHT)
-
-extern char q_font[]; /* reference font object code */
-extern u_short q_key[]; /* reference key xlation tables */
-extern u_short q_shift_key[];
-extern char *q_special[];
-
-/*
- * definitions for cursor acceleration reporting
- */
-#define ACC_OFF 0x01 /* acceleration is inactive */
-
-/*
- * virtual console support.
- */
-extern struct cdevsw *consops;
-cons_decl(qd);
-cdev_decl(qd);
-void setup_dragon(int);
-void init_shared(int);
-void clear_qd_screen(int);
-void ldfont(int);
-void ldcursor(int, short *);
-void setup_input(int);
-void blitc(int, u_char);
-void scroll_up(volatile struct adder *);
-void write_ID(volatile struct adder *, short, short);
-int wait_status(volatile struct adder *, int);
-void led_control(int, int, int);
-void qdstart(struct tty *);
-void qdearly(void);
-int qdpolling = 0;
-
-/*
- * LK-201 state storage for input console keyboard conversion to ASCII
- */
-struct q_keyboard {
- int shift; /* state variables */
- int cntrl;
- int lock;
- int lastcode; /* last keycode typed */
- unsigned kup[8]; /* bits for each keycode*/
- unsigned dkeys[8]; /* down/up mode keys */
- char last; /* last character */
-} q_keyboard;
-
-/*
- * tty settings on first open
- */
-#define IFLAG (BRKINT|ISTRIP|IXON|IXANY|ICRNL|IMAXBEL)
-#define OFLAG (OPOST|OXTABS|ONLCR)
-#define LFLAG (ISIG|ICANON|ECHO|IEXTEN)
-#define CFLAG (PARENB|CREAD|CS7|CLOCAL)
-
-/*
- * Kernel virtual addresses where we can map in the QBUS io page and the
- * QDSS memory during qdcninit. pmap_bootstrap fills this in.
- */
-void *qd_ubaio;
-
-/* This is the QDSS unit 0 CSR. It is hard-coded in here so that the
- * QDSS can be used as the console. The console routines don't get
- * any config info. The ROM also autodetects at this address, so
- * the console QDSS should be at this address. Furthermore, nothing
- * else shuld be at this address instead because that would confuse the
- * ROM and this driver.
- */
-#define QDSSCSR 0x1F00
-
-volatile u_short *qdaddr; /* Virtual address for QDSS CSR */
-
-/*
- * This flag is set to 1 if the console initialization (qdcninit)
- * has been performed on qd0. That initialization is required and must
- * be done before the device probe routine.
- */
-int qd0cninited = 0, qd0iscons = 0;
-
-/*
- * Do early check if the qdss is console. If not; don't allocate
- * any memory for it in bootstrap.
- */
-void
-qdearly()
-{
- extern vaddr_t virtual_avail;
- int tmp;
-
- /* Make sure we're running on a system that can have a QDSS */
- if (vax_boardtype == VAX_BTYP_630) {
- /* Now check some undocumented flag */
- if ((*(int *)(0x200B801E) & 0x60) == 0)
- /* The KA630 isn't using a QDSS as the console,
- * so we won't either */
- return;
- } else if (vax_boardtype != VAX_BTYP_650)
- return;
-
- /* How to check for console on KA650? We assume that if there is a
- * QDSS, it is console.
- */
-#define QIOPAGE 0x20000000 /* XXX */
-#define UBAIOPAGES 16
- tmp = QIOPAGE + ubdevreg(QDSSCSR);
- if (badaddr((caddr_t)tmp, sizeof(short)))
- return;
-
- MAPVIRT(qvmem[0], 64 * 1024 * NQD / VAX_NBPG);
- MAPVIRT(qd_ubaio, 16);
- pmap_map((int)qd_ubaio, QIOPAGE, QIOPAGE + UBAIOPAGES * VAX_NBPG,
- VM_PROT_READ|VM_PROT_WRITE);
- qdaddr = (u_short *)((u_int)qd_ubaio + ubdevreg(QDSSCSR));
- qd0iscons = 1;
-}
-
-void
-qdcnprobe(cndev)
- struct consdev *cndev;
-{
- int i;
-
- if (mfpr(PR_MAPEN) == 0)
- return; /* Cannot use qd if vm system is OFF */
-
- if (!qd0iscons)
- return;
-
- /* Find the console device corresponding to the console QDSS */
- for (i = 0; i < nchrdev; i++)
- if (cdevsw[i].d_open == qdopen) {
- cndev->cn_dev = makedev(i,0);
- cndev->cn_pri = CN_MIDPRI;
- return;
- }
- return;
-}
-
-
-/*
- * Init QDSS as console (before probe routine)
- */
-void
-qdcninit(cndev)
- struct consdev *cndev;
-{
- caddr_t phys_adr; /* physical QDSS base adrs */
- u_int mapix; /* index into QVmap[] array */
- int unit;
-
- /* qdaddr must point to CSR for this unit! */
-
- /* The console QDSS is QDSS unit 0 */
- unit = 0;
-
- /*
- * Map q-bus memory used by qdss. (separate map)
- */
- mapix = QMEMSIZE - (CHUNK * (unit + 1));
-#define QMEM 0x30000000
- (int)phys_adr = QMEM + mapix;
- pmap_map((int)(qvmem[0]), (int)phys_adr, (int)(phys_adr + (CHUNK*NQD)),
- VM_PROT_READ|VM_PROT_WRITE);
-
- /*
- * Set QVmap to point to page table entries for what we just
- * mapped.
- */
- QVmap[0] = kvtopte(qvmem[0]);
-
- /*
- * tell QDSS which Q memory address base to decode
- * (shifted right 16 bits - its in 64K units)
- */
- *qdaddr = (u_short)((int)mapix >> 16);
- qdflags[unit].config = *(u_short *)qdaddr;
-
- /*
- * load qdmap struct with the virtual addresses of the QDSS elements
- */
- qdbase[unit] = (caddr_t) (qvmem[0]);
- qdmap[unit].template = qdbase[unit] + TMPSTART;
- qdmap[unit].adder = qdbase[unit] + ADDER;
- qdmap[unit].dga = qdbase[unit] + DGA;
- qdmap[unit].duart = qdbase[unit] + DUART;
- qdmap[unit].memcsr = qdbase[unit] + MEMCSR;
- qdmap[unit].red = qdbase[unit] + RED;
- qdmap[unit].blue = qdbase[unit] + BLUE;
- qdmap[unit].green = qdbase[unit] + GREEN;
-
- qdflags[unit].duart_imask = 0; /* init shadow variables */
-
- /*
- * init the QDSS
- */
-
- *(short *)qdmap[unit].memcsr |= SYNC_ON; /* once only: turn on sync */
-
- cursor[unit].x = 0;
- cursor[unit].y = 0;
- init_shared(unit); /* init shared memory */
- setup_dragon(unit); /* init the ADDER/VIPER stuff */
- clear_qd_screen(unit); /* clear the screen */
- ldfont(unit); /* load the console font */
- ldcursor(unit, cons_cursor); /* load default cursor map */
- setup_input(unit); /* init the DUART */
-
- /* Set flag so probe knows */
- qd0cninited = 1;
-} /* qdcninit */
-
-/* see <sys/device.h> */
-struct cfattach qd_ca = {
- sizeof(struct qd_softc), qd_match, qd_attach
-};
-
-#define QD_RCSR(reg) \
- bus_space_read_2(sc->sc_iot, sc->sc_ioh, reg)
-#define QD_WCSR(reg, val) \
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, reg, val)
-
-/*
- * Configure QDSS into Q memory and make it intrpt.
- *
- * side effects: QDSS gets mapped into Qbus memory space at the first
- * vacant 64kb boundary counting back from the top of
- * Qbus memory space (qvmem+4mb)
- *
- * return: QDSS bus request level and vector address returned in
- * registers by UNIX convention.
- *
- */
-static int
-qd_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
-{
- struct qd_softc ssc;
- struct qd_softc *sc = &ssc;
- struct uba_attach_args *ua = aux;
- struct uba_softc *uh = (void *)parent;
- register int unit;
- volatile struct dga *dga; /* pointer to gate array structure */
- int vector;
-#ifdef notdef
- int *ptep; /* page table entry pointer */
- caddr_t phys_adr; /* physical QDSS base adrs */
- u_int mapix;
-#endif
-
- /* Create a "fake" softc with only a few fields used. */
- sc->sc_iot = ua->ua_iot;
- sc->sc_ioh = ua->ua_ioh;
- sc->sc_dmat = ua->ua_dmat;
- /*
- * calculate board unit number from I/O page register address
- */
- unit = (int) (((int)sc->sc_ioh >> 1) & 0x0007);
-
- /*
- * QDSS regs must be mapped to Qbus memory space at a 64kb
- * physical boundary. The Qbus memory space is mapped into
- * the system memory space at config time. After config
- * runs, "qvmem[0]" (ubavar.h) holds the system virtual adrs
- * of the start of Qbus memory. The Qbus memory page table
- * is found via an array of pte ptrs called "QVmap[]" (ubavar.h)
- * which is also loaded at config time. These are the
- * variables used below to find a vacant 64kb boundary in
- * Qbus memory, and load its corresponding physical adrs
- * into the QDSS's I/O page CSR.
- */
-
- /*
- * Only if QD is the graphics device.
- */
-
- /* if this QDSS is NOT the console, then do init here.. */
-
- if (unit != 0) {
- printf("qd: can't support two qdss's (yet)\n");
-#ifdef notdef /* can't test */
- if (v_consputc != qdputc || unit != 0) {
-
- /*
- * read QDSS config info
- */
- qdflags[unit].config = *(u_short *)reg;
-
- /*
- * find an empty 64kb adrs boundary
- */
-
- qdbase[unit] = (caddr_t) (qvmem[0] + QMEMSIZE - CHUNK);
-
- /*
- * find the cpusw entry that matches this machine.
- */
- cpup = &cpusw[cpu];
- while (!(BADADDR(qdbase[unit], sizeof(short))))
- qdbase[unit] -= CHUNK;
-
- /*
- * tell QDSS which Q memory address base to decode
- */
- mapix = (int) (VTOP(qdbase[unit]) - VTOP(qvmem[0]));
- ptep = (int *) QVmap[0] + mapix;
- phys_adr = (caddr_t)(((int)*ptep&0x001FFFFF)<<VAX_PGSHIFT);
- *(u_short *)reg = (u_short) ((int)phys_adr >> 16);
-
- /*
- * load QDSS adrs map with system addresses
- * of device regs
- */
- qdmap[unit].template = qdbase[unit] + TMPSTART;
- qdmap[unit].adder = qdbase[unit] + ADDER;
- qdmap[unit].dga = qdbase[unit] + DGA;
- qdmap[unit].duart = qdbase[unit] + DUART;
- qdmap[unit].memcsr = qdbase[unit] + MEMCSR;
- qdmap[unit].red = qdbase[unit] + RED;
- qdmap[unit].blue = qdbase[unit] + BLUE;
- qdmap[unit].green = qdbase[unit] + GREEN;
-
- /* device init */
-
- cursor[unit].x = 0;
- cursor[unit].y = 0;
- init_shared(unit); /* init shared memory */
- setup_dragon(unit); /* init the ADDER/VIPER stuff */
- ldcursor(unit, cons_cursor); /* load default cursor map */
- setup_input(unit); /* init the DUART */
- clear_qd_screen(unit);
- ldfont(unit); /* load the console font */
-
- /* once only: turn on sync */
-
- *(short *)qdmap[unit].memcsr |= SYNC_ON;
- }
-#endif /*notdef*/
- } else {
- /* We are dealing with qd0 */
-
- if (!qd0cninited) {
- /*
- * qd0 has not been initiallized as the console.
- * We need to do some initialization now
- *
- * XXX
- * However, if the QDSS is not the console then
- * that stupid undocumented bit (see qdcnprobe)
- * is cleared. Then the QDSS refuses to work.
- * (What did the ROM do to it!?)
- * XXX
- */
- return 0;
-
-#if 0
- qdaddr = (void *)reg;
-
- /* Lame probe for QDSS. Should be ok for qd0 */
- if (badaddr((caddr_t)qdaddr, sizeof(short)))
- return 0;
-
- qdcninit(NULL);
-#endif
- }
- }
-
-
- /*
- * The QDSS interrupts at HEX vectors xx0 (DMA) xx4
- * (ADDER) and xx8 (DUART). Therefore, we take three
- * vectors from the vector pool, and then continue
- * to take them until we get a xx0 HEX vector. The
- * pool provides vectors in contiguous decending
- * order.
- */
-
- vector = (uh->uh_lastiv -= 4*3); /* take three vectors */
-
- while (vector & 0x0F) { /* if lo nibble != 0.. */
- /* ..take another vector */
- vector = (uh->uh_lastiv -= 4);
- }
-
- /*
- * setup DGA to do a DMA interrupt (transfer count = 0)
- */
- dga = (struct dga *) qdmap[unit].dga;
- dga->csr = (short) HALT; /* disable everything */
- dga->ivr = (short) vector; /* load intrpt base vector */
- dga->bytcnt_lo = (short) 0; /* DMA xfer count = 0 */
- dga->bytcnt_hi = (short) 0;
-
- /*
- * turn on DMA interrupts
- */
- dga->csr &= ~SET_DONE_FIFO;
- dga->csr |= DMA_IE | DL_ENB;
-
- DELAY(20000); /* wait for the intrpt */
- dga->csr = HALT; /* stop the wheels */
-
- /*
- * score this as an existing qdss
- */
- qdcount++;
-
- return 1;
-} /* qdprobe */
-
-
-void qd_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
- {
- register struct uba_attach_args *ua = aux;
- register int unit; /* QDSS module # for this call */
-
- printf("\n");
-
- unit = self->dv_unit; /* get QDSS number */
-
- /* Set interrupt vectors for interrupt handlers */
-
- uba_intr_establish(ua->ua_icookie, ua->ua_cvec , qddint, self);
- uba_intr_establish(ua->ua_icookie, ua->ua_cvec + 4, qdaint, self);
- uba_intr_establish(ua->ua_icookie, ua->ua_cvec + 8, qdiint, self);
-
- /*
- * init "qdflags[]" for this QDSS
- */
- qdflags[unit].inuse = 0; /* init inuse variable EARLY! */
- qdflags[unit].mapped = 0;
- qdflags[unit].kernel_loop = -1;
- qdflags[unit].user_dma = 0;
- qdflags[unit].curs_acc = ACC_OFF;
- qdflags[unit].curs_thr = 128;
- qdflags[unit].tab_res = 2; /* default tablet resolution factor */
- qdflags[unit].duart_imask = 0; /* init shadow variables */
- qdflags[unit].adder_ie = 0;
-
- /*
- * init structures used in kbd/mouse interrupt service. This code must
- * come after the "init_shared()" routine has run since that routine
- * inits the eq_header[unit] structure used here.
- */
-
- /*
- * init the "latest mouse report" structure
- */
- last_rep[unit].state = 0;
- last_rep[unit].dx = 0;
- last_rep[unit].dy = 0;
- last_rep[unit].bytcnt = 0;
-
- /*
- * init the event queue (except mouse position)
- */
- eq_header[unit]->header.events =
- (struct _vs_event *)((int)eq_header[unit] + sizeof(struct qdinput));
-
- eq_header[unit]->header.size = MAXEVENTS;
- eq_header[unit]->header.head = 0;
- eq_header[unit]->header.tail = 0;
-
- /*
- * open exclusive for graphics device.
- */
- qdopened[unit] = 0;
-
-} /* qdattach */
-
-
-/*ARGSUSED*/
-int
-qdopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- volatile register struct dga *dga; /* ptr to gate array struct */
- register struct tty *tp;
- volatile struct duart *duart;
- int unit;
- int minor_dev;
-
- minor_dev = minor(dev); /* get QDSS minor device number */
- unit = minor_dev >> 2;
-
- /*
- * check for illegal conditions
- */
- if (unit >= qd_cd.cd_ndevs || qd_cd.cd_devs[unit] == NULL)
- return (ENXIO); /* no such device or address */
-
- duart = (struct duart *) qdmap[unit].duart;
- dga = (struct dga *) qdmap[unit].dga;
-
- if ((minor_dev & 0x03) == 2) {
- /*
- * this is the graphic device...
- */
- if (qdopened[unit] != 0)
- return(EBUSY);
- else
- qdopened[unit] = 1;
- qdflags[unit].inuse |= GRAPHIC_DEV; /* graphics dev is open */
- /*
- * enble kbd & mouse intrpts in DUART mask reg
- */
- qdflags[unit].duart_imask |= 0x22;
- duart->imask = qdflags[unit].duart_imask;
- } else {
- /* Only one console */
- if (minor_dev) return ENXIO;
-
- /* If not done already, allocate tty structure */
- if (qd_tty[minor_dev] == NULL)
- qd_tty[minor_dev] = ttymalloc(0);
-
- /*
- * this is the console
- */
- qdflags[unit].inuse |= CONS_DEV; /* mark console as open */
- dga->csr |= CURS_ENB;
- qdflags[unit].duart_imask |= 0x02;
- duart->imask = qdflags[unit].duart_imask;
- /*
- * some setup for tty handling
- */
- tp = qd_tty[minor_dev];
- /* tp->t_addr = ui->ui_addr; */
- tp->t_oproc = qdstart;
- tp->t_dev = dev;
- if ((tp->t_state & TS_ISOPEN) == 0) {
- ttychars(tp);
- tp->t_ispeed = B9600;
- tp->t_ospeed = B9600;
- tp->t_state = TS_ISOPEN | TS_CARR_ON;
- tp->t_iflag = TTYDEF_IFLAG;
- tp->t_oflag = TTYDEF_OFLAG;
- tp->t_lflag = TTYDEF_LFLAG;
- tp->t_cflag = TTYDEF_CFLAG;
- ttsetwater(tp);
- }
- /*
- * enable intrpts, open line discipline
- */
- dga->csr |= GLOBAL_IE; /* turn on the interrupts */
- return ((*linesw[tp->t_line].l_open)(dev, tp, p));
- }
- dga->csr |= GLOBAL_IE; /* turn on the interrupts */
- return(0);
-
-} /* qdopen */
-
-/*ARGSUSED*/
-int
-qdclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- register struct tty *tp;
- register struct qdmap *qd;
- volatile register int *ptep;
- volatile struct dga *dga; /* gate array register map pointer */
- volatile struct duart *duart;
- volatile struct adder *adder;
- int unit;
- int minor_dev;
- u_int mapix;
- int i; /* SIGNED index */
- struct uba_softc *uh;
-
- minor_dev = minor(dev); /* get minor device number */
- unit = minor_dev >> 2; /* get QDSS number */
- qd = &qdmap[unit];
-
- uh = (struct uba_softc *)
- (((struct device *)(qd_cd.cd_devs[unit]))->dv_parent);
-
-
- if ((minor_dev & 0x03) == 2) {
- /*
- * this is the graphic device...
- */
- if (qdopened[unit] != 1)
- return(EBUSY);
- else
- qdopened[unit] = 0; /* allow it to be re-opened */
- /*
- * re-protect device memory
- */
- if (qdflags[unit].mapped & MAPDEV) {
- /*
- * TEMPLATE RAM
- */
- mapix = VTOP((int)qd->template) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- for (i = 0; i < vax_btop(TMPSIZE); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_V | PG_KW;
- /*
- * ADDER
- */
- mapix = VTOP((int)qd->adder) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- for (i = 0; i < vax_btop(REGSIZE); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_V | PG_KW;
- /*
- * COLOR MAPS
- */
- mapix = VTOP((int)qd->red) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- for (i = 0; i < vax_btop(CLRSIZE); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_V | PG_KW;
- }
-
- /*
- * re-protect DMA buffer and free the map registers
- */
- if (qdflags[unit].mapped & MAPDMA) {
- panic("Unmapping unmapped buffer");
-#ifdef notyet
-/*
- * Ragge 990620:
- * Can't happen because the buffer can't be mapped.
- */
- dga = (struct dga *) qdmap[unit].dga;
- adder = (struct adder *) qdmap[unit].adder;
- dga->csr &= ~DMA_IE;
- dga->csr &= ~0x0600; /* kill DMA */
- adder->command = CANCEL;
- /*
- * if DMA was running, flush spurious intrpt
- */
- if (dga->bytcnt_lo != 0) {
- dga->bytcnt_lo = 0;
- dga->bytcnt_hi = 0;
- DMA_SETIGNORE(DMAheader[unit]);
- dga->csr |= DMA_IE;
- dga->csr &= ~DMA_IE;
- }
- ptep = (int *)
- ((VTOP(DMAheader[unit]*4)) + (mfpr(PR_SBR)|0x80000000));
- for (i = 0; i < vax_btop(DMAbuf_size); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_V | PG_KW;
- ubarelse(uh, &Qbus_unmap[unit]);
-#endif
- }
-
- /*
- * re-protect 1K (2 pages) event queue
- */
- if (qdflags[unit].mapped & MAPEQ) {
- ptep = (int *)
- ((VTOP(eq_header[unit])*4) + (mfpr(PR_SBR)|0x80000000));
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V; ptep++;
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V;
- }
- /*
- * re-protect scroll param area and disable scroll intrpts
- */
- if (qdflags[unit].mapped & MAPSCR) {
- ptep = (int *) ((VTOP(scroll[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- /*
- * re-protect 512 scroll param area
- */
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V;
- adder = (struct adder *) qdmap[unit].adder;
- qdflags[unit].adder_ie &= ~FRAME_SYNC;
- adder->interrupt_enable = qdflags[unit].adder_ie;
- }
- /*
- * re-protect color map write buffer area and kill intrpts
- */
- if (qdflags[unit].mapped & MAPCOLOR) {
- ptep = (int *) ((VTOP(color_buf[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V; ptep++;
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V;
- color_buf[unit]->status = 0;
- adder = (struct adder *) qdmap[unit].adder;
- qdflags[unit].adder_ie &= ~VSYNC;
- adder->interrupt_enable = qdflags[unit].adder_ie;
- }
- mtpr(0, PR_TBIA);
- /* flag everything now unmapped */
- qdflags[unit].mapped = 0;
- qdflags[unit].inuse &= ~GRAPHIC_DEV;
- qdflags[unit].curs_acc = ACC_OFF;
- qdflags[unit].curs_thr = 128;
- /*
- * restore the console
- */
- dga = (struct dga *) qdmap[unit].dga;
- adder = (struct adder *) qdmap[unit].adder;
- dga->csr &= ~DMA_IE;
- dga->csr &= ~0x0600; /* halt the DMA! (just in case...) */
- dga->csr |= DMA_ERR; /* clear error condition */
- adder->command = CANCEL;
- /*
- * if DMA was running, flush spurious intrpt
- */
- if (dga->bytcnt_lo != 0) {
- dga->bytcnt_lo = 0;
- dga->bytcnt_hi = 0;
- DMA_SETIGNORE(DMAheader[unit]);
- dga->csr |= DMA_IE;
- dga->csr &= ~DMA_IE;
- }
- init_shared(unit); /* init shared memory */
- setup_dragon(unit); /* init ADDER/VIPER */
- ldcursor(unit, cons_cursor); /* load default cursor map */
- setup_input(unit); /* init the DUART */
- ldfont(unit);
- cursor[unit].x = 0;
- cursor[unit].y = 0;
- /*
- * shut off the mouse rcv intrpt and turn on kbd intrpts
- */
- duart = (struct duart *) qdmap[unit].duart;
- qdflags[unit].duart_imask &= ~(0x20);
- qdflags[unit].duart_imask |= 0x02;
- duart->imask = qdflags[unit].duart_imask;
- /*
- * shut off interrupts if all is closed
- */
- if (!(qdflags[unit].inuse & CONS_DEV)) {
- dga = (struct dga *) qdmap[unit].dga;
- dga->csr &= ~(GLOBAL_IE | DMA_IE);
- }
- } else {
- /*
- * this is the console
- */
- tp = qd_tty[minor_dev];
- (*linesw[tp->t_line].l_close)(tp, flag, p);
- ttyclose(tp);
- tp->t_state = 0;
- qdflags[unit].inuse &= ~CONS_DEV;
- /*
- * if graphics device is closed, kill interrupts
- */
- if (!(qdflags[unit].inuse & GRAPHIC_DEV)) {
- dga = (struct dga *) qdmap[unit].dga;
- dga->csr &= ~(GLOBAL_IE | DMA_IE);
- }
- }
-
- return(0);
-
-} /* qdclose */
-
-int
-qdioctl(dev, cmd, datap, flags, p)
- dev_t dev;
- u_long cmd;
- caddr_t datap;
- int flags;
- struct proc *p;
-{
- volatile register int *ptep; /* page table entry pointer */
- register int mapix; /* QVmap[] page table index */
- register struct _vs_event *event;
- register struct tty *tp;
- register int i;
- struct qdmap *qd; /* pointer to device map struct */
- volatile struct dga *dga; /* Gate Array reg structure pntr */
- volatile struct duart *duart; /* DUART reg structure pointer */
- volatile struct adder *adder; /* ADDER reg structure pointer */
- struct prgkbd *cmdbuf;
- struct prg_cursor *curs;
- struct _vs_cursor *pos;
- int unit = minor(dev) >> 2; /* number of caller's QDSS */
- u_int minor_dev = minor(dev);
- int error;
- int s;
- short *temp; /* a pointer to template RAM */
- struct uba_softc *uh;
-
- uh = (struct uba_softc *)
- (((struct device *)(qd_cd.cd_devs[unit]))->dv_parent);
-
- /*
- * service graphic device ioctl commands
- */
- switch (cmd) {
-
- case QD_GETEVENT:
- /*
- * extract the oldest event from the event queue
- */
- if (ISEMPTY(eq_header[unit])) {
- event = (struct _vs_event *) datap;
- event->vse_device = VSE_NULL;
- break;
- }
- event = (struct _vs_event *) GETBEGIN(eq_header[unit]);
- s = spl5();
- GETEND(eq_header[unit]);
- splx(s);
- bcopy((caddr_t)event, datap, sizeof(struct _vs_event));
- break;
-
- case QD_RESET:
- /*
- * init the dragon stuff, DUART, and driver variables
- */
- init_shared(unit); /* init shared memory */
- setup_dragon(unit); /* init the ADDER/VIPER stuff */
- clear_qd_screen(unit);
- ldcursor(unit, cons_cursor); /* load default cursor map */
- ldfont(unit); /* load the console font */
- setup_input(unit); /* init the DUART */
- break;
-
- case QD_SET:
- /*
- * init the DUART and driver variables
- */
- init_shared(unit);
- setup_input(unit);
- break;
-
- case QD_CLRSCRN:
- /*
- * clear the QDSS screen. (NOTE that this reinits the dragon)
- */
-#ifdef notdef /* has caused problems and isn't necessary */
- setup_dragon(unit);
- clear_qd_screen(unit);
-#endif
- break;
-
- case QD_WTCURSOR:
- /*
- * load a cursor into template RAM
- */
- ldcursor(unit, (short *)datap);
- break;
-
- case QD_RDCURSOR:
-
- temp = (short *) qdmap[unit].template;
- /*
- * cursor is 32 WORDS from the end of the 8k WORD...
- * ...template space
- */
- temp += (8 * 1024) - 32;
- for (i = 0; i < 32; ++i, datap += sizeof(short))
- *(short *)datap = *temp++;
- break;
-
- case QD_POSCURSOR:
- /*
- * position the mouse cursor
- */
- dga = (struct dga *) qdmap[unit].dga;
- pos = (struct _vs_cursor *) datap;
- s = spl5();
- dga->x_cursor = TRANX(pos->x);
- dga->y_cursor = TRANY(pos->y);
- eq_header[unit]->curs_pos.x = pos->x;
- eq_header[unit]->curs_pos.y = pos->y;
- splx(s);
- break;
-
- case QD_PRGCURSOR:
- /*
- * set the cursor acceleration factor
- */
- curs = (struct prg_cursor *) datap;
- s = spl5();
- qdflags[unit].curs_acc = curs->acc_factor;
- qdflags[unit].curs_thr = curs->threshold;
- splx(s);
- break;
-
- case QD_MAPDEVICE:
- /*
- * enable 'user write' to device pages
- */
- qdflags[unit].mapped |= MAPDEV;
- qd = (struct qdmap *) &qdmap[unit];
- /*
- * enable user write to template RAM
- */
- mapix = VTOP((int)qd->template) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- for (i = 0; i < vax_btop(TMPSIZE); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
-
- /*
- * enable user write to registers
- */
- mapix = VTOP((int)qd->adder) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- for (i = 0; i < vax_btop(REGSIZE); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
-
- /*
- * enable user write to color maps
- */
- mapix = VTOP((int)qd->red) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- for (i = 0; i < vax_btop(CLRSIZE); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
-
- /*
- * enable user write to DUART
- */
- mapix = VTOP((int)qd->duart) - VTOP(qvmem[0]);
- ptep = (int *)(QVmap[0] + mapix);
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V; /* duart page */
-
- mtpr(0, PR_TBIA); /* invalidate translation buffer */
-
- /*
- * stuff qdmap structure in return buffer
- */
- bcopy((caddr_t)qd, datap, sizeof(struct qdmap));
-
- break;
-
-#ifdef notyet
-/*
- * Ragge 999620:
- * Can't map in the graphic buffer into user space for now.
- * The best way to fix this is to convert this driver to wscons.
- */
- case QD_MAPIOBUF:
- /*
- * do setup for DMA by user process
- *
- * set 'user write enable' bits for DMA buffer
- */
- qdflags[unit].mapped |= MAPDMA;
- ptep = (int *) ((VTOP(DMAheader[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- for (i = 0; i < vax_btop(DMAbuf_size); i++, ptep++)
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
- mtpr(0, PR_TBIA); /* invalidate translation buffer */
- /*
- * set up QBUS map registers for DMA
- */
- DMAheader[unit]->QBAreg =
- uballoc(uh, (caddr_t)DMAheader[unit], DMAbuf_size, 0);
- if (DMAheader[unit]->QBAreg == 0)
- printf("qd%d: qdioctl: QBA setup error\n", unit);
- Qbus_unmap[unit] = DMAheader[unit]->QBAreg;
- DMAheader[unit]->QBAreg &= 0x3FFFF;
- /*
- * return I/O buf adr
- */
- *(int *)datap = (int) DMAheader[unit];
- break;
-#endif
-
- case QD_MAPSCROLL:
- /*
- * map the shared scroll param area and enable scroll interpts
- */
- qdflags[unit].mapped |= MAPSCR;
- ptep = (int *) ((VTOP(scroll[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- /*
- * allow user write to scroll area
- */
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
- mtpr(0, PR_TBIA); /* invalidate translation buf */
- scroll[unit]->status = 0;
- adder = (struct adder *) qdmap[unit].adder;
- qdflags[unit].adder_ie |= FRAME_SYNC;
- adder->interrupt_enable = qdflags[unit].adder_ie;
- *(int *)datap = (int) scroll[unit]; /* return scroll area */
- break;
-
- case QD_UNMAPSCROLL:
- /*
- * unmap shared scroll param area and disable scroll intrpts
- */
- if (qdflags[unit].mapped & MAPSCR) {
- qdflags[unit].mapped &= ~MAPSCR;
- ptep = (int *) ((VTOP(scroll[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- /*
- * re-protect 512 scroll param area
- */
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V;
- mtpr(0, PR_TBIA); /* smash CPU's translation buf */
- adder = (struct adder *) qdmap[unit].adder;
- qdflags[unit].adder_ie &= ~FRAME_SYNC;
- adder->interrupt_enable = qdflags[unit].adder_ie;
- }
- break;
-
- case QD_MAPCOLOR:
- /*
- * map shared color map write buf and turn on vsync intrpt
- */
- qdflags[unit].mapped |= MAPCOLOR;
- ptep = (int *) ((VTOP(color_buf[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- /*
- * allow user write to color map write buffer
- */
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V; ptep++;
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
- mtpr(0, PR_TBIA); /* clr CPU translation buf */
- adder = (struct adder *) qdmap[unit].adder;
- qdflags[unit].adder_ie |= VSYNC;
- adder->interrupt_enable = qdflags[unit].adder_ie;
- /*
- * return color area address
- */
- *(int *)datap = (int) color_buf[unit];
- break;
-
- case QD_UNMAPCOLOR:
- /*
- * unmap shared color map write buffer and kill VSYNC intrpts
- */
- if (qdflags[unit].mapped & MAPCOLOR) {
- qdflags[unit].mapped &= ~MAPCOLOR;
- ptep = (int *) ((VTOP(color_buf[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- /*
- * re-protect color map write buffer
- */
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V; ptep++;
- *ptep = (*ptep & ~PG_PROT) | PG_KW | PG_V;
- mtpr(0, PR_TBIA);
- adder = (struct adder *) qdmap[unit].adder;
- qdflags[unit].adder_ie &= ~VSYNC;
- adder->interrupt_enable = qdflags[unit].adder_ie;
- }
- break;
-
- case QD_MAPEVENT:
- /*
- * give user write access to the event queue
- */
- qdflags[unit].mapped |= MAPEQ;
- ptep = (int *) ((VTOP(eq_header[unit]) * 4)
- + (mfpr(PR_SBR) | 0x80000000));
- /*
- * allow user write to 1K event queue
- */
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V; ptep++;
- *ptep = (*ptep & ~PG_PROT) | PG_RW | PG_V;
- mtpr(0, PR_TBIA); /* clr CPU translation buf */
- /*
- * return event queue address
- */
- *(int *)datap = (int)eq_header[unit];
- break;
-
- case QD_PRGKBD:
- /*
- * pass caller's programming commands to LK201
- */
- duart = (struct duart *)qdmap[unit].duart;
- cmdbuf = (struct prgkbd *)datap; /* pnt to kbd cmd buf */
- /*
- * send command
- */
- for (i = 1000; i > 0; --i) {
- if (duart->statusA&XMT_RDY) {
- duart->dataA = cmdbuf->cmd;
- break;
- }
- }
- if (i == 0) {
- printf("qd%d: qdioctl: timeout on XMT_RDY [1]\n", unit);
- break;
- }
- /*
- * send param1?
- */
- if (cmdbuf->cmd & LAST_PARAM)
- break;
- for (i = 1000; i > 0; --i) {
- if (duart->statusA&XMT_RDY) {
- duart->dataA = cmdbuf->param1;
- break;
- }
- }
- if (i == 0) {
- printf("qd%d: qdioctl: timeout on XMT_RDY [2]\n", unit);
- break;
- }
- /*
- * send param2?
- */
- if (cmdbuf->param1 & LAST_PARAM)
- break;
- for (i = 1000; i > 0; --i) {
- if (duart->statusA&XMT_RDY) {
- duart->dataA = cmdbuf->param2;
- break;
- }
- }
- if (i == 0) {
- printf("qd%d: qdioctl: timeout on XMT_RDY [3]\n", unit);
- break;
- }
- break;
-
- case QD_PRGMOUSE:
- /*
- * pass caller's programming commands to the mouse
- */
- duart = (struct duart *) qdmap[unit].duart;
- for (i = 1000; i > 0; --i) {
- if (duart->statusB&XMT_RDY) {
- duart->dataB = *datap;
- break;
- }
- }
- if (i == 0) {
- printf("qd%d: qdioctl: timeout on XMT_RDY [4]\n", unit);
- }
- break;
-
- case QD_RDCONFIG:
- /*
- * get QDSS configuration word and return it
- */
- *(short *)datap = qdflags[unit].config;
- break;
-
- case QD_KERN_LOOP:
- case QD_KERN_UNLOOP:
- /*
- * vestige from ultrix. BSD uses TIOCCONS to redirect
- * kernel console output.
- */
- break;
-
- case QD_PRGTABLET:
- /*
- * program the tablet
- */
- duart = (struct duart *) qdmap[unit].duart;
- for (i = 1000; i > 0; --i) {
- if (duart->statusB&XMT_RDY) {
- duart->dataB = *datap;
- break;
- }
- }
- if (i == 0) {
- printf("qd%d: qdioctl: timeout on XMT_RDY [5]\n", unit);
- }
- break;
-
- case QD_PRGTABRES:
- /*
- * program the tablet report resolution factor
- */
- qdflags[unit].tab_res = *(short *)datap;
- break;
-
- default:
- /*
- * service tty ioctl's
- */
- if (!(minor_dev & 0x02)) {
- tp = qd_tty[minor_dev];
- error =
-
- (*linesw[tp->t_line].l_ioctl)(tp, cmd, datap, flags, p);
- if (error >= 0) {
- return(error);
- }
- error = ttioctl(tp, cmd, datap, flags, p);
- if (error >= 0) {
- return(error);
- }
- }
- break;
- }
-
- return(0);
-
-} /* qdioctl */
-
-
-int
-qdpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- register int s;
- register int unit;
- register struct tty *tp;
- u_int minor_dev = minor(dev);
- int revents = 0;
-
- s = spl5();
- unit = minor_dev >> 2;
-
- if ((minor_dev & 0x03) == 2) {
- /*
- * This is a graphics device, so check for events.
- */
-
- if (events & (POLLIN | POLLRDNORM))
- if(!(ISEMPTY(eq_header[unit])))
- revents |= events & (POLLIN | POLLRDNORM);
-
- if (events & (POLLOUT | POLLWRNORM))
- if (DMA_ISEMPTY(DMAheader[unit]))
- revents |= events & (POLLOUT | POLLWRNORM);
-
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM)) {
- selrecord(p, &qdrsel[unit]);
- qdflags[unit].selmask |= SEL_READ;
- }
-
- if (events & (POLLOUT | POLLWRNORM)) {
- selrecord(p, &qdrsel[unit]);
- qdflags[unit].selmask |= SEL_WRITE;
- }
- }
- } else {
- /*
- * this is a tty device
- */
- tp = qd_tty[minor_dev];
-
- if (events & (POLLIN | POLLRDNORM)) {
- /* This is ttnread. It's static and I don't feel
- * like altering platform independent parts of NetBSD
- */
- int nread;
- /* if (tp->t_lflag & PENDIN)
- ttypend(tp); */
- nread = tp->t_canq.c_cc;
- if (!(tp->t_lflag & ICANON)) {
- nread += tp->t_rawq.c_cc;
- if (nread < tp->t_cc[VMIN] && !tp->t_cc[VTIME])
- nread = 0;
- }
- if (nread > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- }
-
- if (events & (POLLOUT | POLLWRNORM))
- if (tp->t_outq.c_cc <= tp->t_lowat)
- revents |= events & (POLLOUT | POLLWRNORM);
-
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &tp->t_rsel);
-
- if (events & (POLLOUT | POLLWRNORM))
- selrecord(p, &tp->t_wsel);
- }
- }
-
- splx(s);
- return (revents);
-} /* qdpoll() */
-
-
-void qd_strategy(struct buf *bp);
-
-/*ARGSUSED*/
-int
-qdwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
-{
- register struct tty *tp;
- register int minor_dev;
- register int unit;
-
- minor_dev = minor(dev);
- unit = (minor_dev >> 2) & 0x07;
-
- if (((minor_dev&0x03) != 0x02) && (qdflags[unit].inuse&CONS_DEV)) {
- /*
- * this is the console...
- */
- tp = qd_tty[minor_dev];
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
- } else if (qdflags[unit].inuse & GRAPHIC_DEV) {
- /*
- * this is a DMA xfer from user space
- */
- return (physio(qd_strategy, dev, B_WRITE, minphys, uio));
- }
- return (ENXIO);
-}
-
-/*ARGSUSED*/
-int
-qdread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
-{
- register struct tty *tp;
- register int minor_dev;
- register int unit;
-
- minor_dev = minor(dev);
- unit = (minor_dev >> 2) & 0x07;
-
- if ((minor_dev & 0x03) != 0x02 && qdflags[unit].inuse & CONS_DEV) {
- /*
- * this is the console
- */
- tp = qd_tty[minor_dev];
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
- } else if (qdflags[unit].inuse & GRAPHIC_DEV) {
- /*
- * this is a bitmap-to-processor xfer
- */
- return (physio(qd_strategy, dev, B_READ, minphys, uio));
- }
- return (ENXIO);
-}
-
-/***************************************************************
-*
-* qd_strategy()... strategy routine to do DMA
-*
-***************************************************************/
-
-void
-qd_strategy(bp)
- register struct buf *bp;
-{
- volatile register struct dga *dga;
- volatile register struct adder *adder;
- register int unit;
- int QBAreg;
- int s;
- int cookie;
- struct uba_softc *uh;
-
- unit = (minor(bp->b_dev) >> 2) & 0x07;
-
- uh = (struct uba_softc *)
- (((struct device *)(qd_cd.cd_devs[unit]))->dv_parent);
-
- /*
- * init pointers
- */
- dga = (struct dga *) qdmap[unit].dga;
-panic("qd_strategy");
-#ifdef notyet
- if ((QBAreg = ubasetup(uh, bp, 0)) == 0) {
- printf("qd%d: qd_strategy: QBA setup error\n", unit);
- goto STRAT_ERR;
- }
-#endif
- s = spl5();
- qdflags[unit].user_dma = -1;
- dga->csr |= DMA_IE;
- cookie = QBAreg & 0x3FFFF;
- dga->adrs_lo = (short) cookie;
- dga->adrs_hi = (short) (cookie >> 16);
- dga->bytcnt_lo = (short) bp->b_bcount;
- dga->bytcnt_hi = (short) (bp->b_bcount >> 16);
-
- while (qdflags[unit].user_dma) {
- tsleep((caddr_t)&qdflags[unit].user_dma, QDPRIOR, "qdstrat", 0);
- }
- splx(s);
-#ifdef notyet
- ubarelse(uh, &QBAreg);
-#endif
- if (!(dga->csr & DMA_ERR)) {
- s = splbio();
- biodone(bp);
- splx(s);
- return;
- }
-
-/* STRAT_ERR: */
- adder = (struct adder *) qdmap[unit].adder;
- adder->command = CANCEL; /* cancel adder activity */
- dga->csr &= ~DMA_IE;
- dga->csr &= ~0x0600; /* halt DMA (reset fifo) */
- dga->csr |= DMA_ERR; /* clear error condition */
- bp->b_flags |= B_ERROR; /* flag an error to physio() */
-
- /*
- * if DMA was running, flush spurious intrpt
- */
- if (dga->bytcnt_lo != 0) {
- dga->bytcnt_lo = 0;
- dga->bytcnt_hi = 0;
- DMA_SETIGNORE(DMAheader[unit]);
- dga->csr |= DMA_IE;
- }
- s = splbio();
- biodone(bp);
- splx(s);
-} /* qd_strategy */
-
-
-/*
- * Start output to the console screen
- */
-void qdstart(tp)
- struct tty *tp;
-{
- register int which_unit, unit, c;
- int s;
-
- unit = minor(tp->t_dev);
- which_unit = (unit >> 2) & 0x3;
- unit &= 0x03;
-
- s = spl5();
-
- /*
- * If it's currently active, or delaying, no need to do anything.
- */
- if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP))
- goto out;
-
- /*
- * Display chars until the queue is empty.
- * Drop input from anything but the console
- * device on the floor.
- *
- * XXX - this loop is done at spltty.
- *
- */
- while (tp->t_outq.c_cc) {
- c = getc(&tp->t_outq);
- if (unit == 0)
- blitc(which_unit, (u_char)c);
- }
- /*
- * If there are sleepers, and output has drained below low
- * water mark, wake up the sleepers.
- */
- 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);
- }
- }
-
- tp->t_state &= ~TS_BUSY;
-
-out:
- splx(s);
-
-} /* qdstart */
-
-/*ARGSUSED*/
-void
-qdstop(tp, flag)
- struct tty *tp;
- int flag;
-{
- register int s;
-
- s = spl5(); /* block intrpts during state modification */
- if (tp->t_state & TS_BUSY) {
- if ((tp->t_state & TS_TTSTOP) == 0)
- tp->t_state |= TS_FLUSH;
- else
- tp->t_state &= ~TS_BUSY;
- }
- splx(s);
-}
-
-/*
- * Output a character to the QDSS screen
- */
-void
-blitc(unit, chr)
- int unit;
- u_char chr;
-{
- volatile register struct adder *adder;
- volatile register struct dga *dga;
- register int i;
- int nograph = !(qdflags[unit].inuse&GRAPHIC_DEV);
- static short inescape[NQD];
-
- adder = (struct adder *)qdmap[unit].adder;
- dga = (struct dga *) qdmap[unit].dga;
- /*
- * BSD comment: this (&=0177) defeats the extended character
- * set code for the glass tty, but if i had the time i would
- * spend it ripping out the code completely. This driver
- * is too big for its own good.
- */
- chr &= 0177;
- /*
- * Cursor addressing (so vi will work).
- * Decode for "\E=%.%." cursor motion description.
- * Corresponds to type "qdcons" in /etc/termcap:
- *
- * qd|qdss|qdcons|qdss glass tty (4.4 BSD):\
- * :am:do=^J:le=^H:bs:cm=\E=%.%.:cl=1^Z:co#128:li#57::nd=^L:up=^K:
- *
- */
- if (inescape[unit] && nograph) {
- switch (inescape[unit]++) {
- case 1:
- if (chr != '=') {
- /* abort escape sequence */
- inescape[unit] = 0;
- blitc(unit, chr);
- }
- return;
- case 2:
- /* position row */
- cursor[unit].y = CHAR_HEIGHT * chr;
- if (cursor[unit].y > 863 - CHAR_HEIGHT)
- cursor[unit].y = 863 - CHAR_HEIGHT;
- dga->y_cursor = TRANY(cursor[unit].y);
- return;
- case 3:
- /* position column */
- cursor[unit].x = CHAR_WIDTH * chr;
- if (cursor[unit].x > 1024 - CHAR_WIDTH)
- cursor[unit].x = 1023 - CHAR_WIDTH;
- dga->x_cursor = TRANX(cursor[unit].x);
- inescape[unit] = 0;
- return;
- default:
- inescape[unit] = 0;
- blitc(unit, chr);
- }
- }
-
- switch (chr) {
- case '\r': /* return char */
- cursor[unit].x = 0;
- if (nograph)
- dga->x_cursor = TRANX(cursor[unit].x);
- return;
-
- case '\t': /* tab char */
- for (i = 8 - ((cursor[unit].x >> 3) & 0x07); i > 0; --i) {
- blitc(unit, ' ');
- }
- return;
-
- case '\n': /* line feed char */
- if ((cursor[unit].y += CHAR_HEIGHT) > (863 - CHAR_HEIGHT)) {
- if (nograph) {
- cursor[unit].y -= CHAR_HEIGHT;
- scroll_up(adder);
- } else
- cursor[unit].y = 0;
- }
- if (nograph)
- dga->y_cursor = TRANY(cursor[unit].y);
- return;
-
- case '\b': /* backspace char */
- if (cursor[unit].x > 0) {
- cursor[unit].x -= CHAR_WIDTH;
- if (nograph)
- dga->x_cursor = TRANX(cursor[unit].x);
- }
- return;
- case CTRL('k'): /* cursor up */
- if (nograph && cursor[unit].y > 0) {
- cursor[unit].y -= CHAR_HEIGHT;
- dga->y_cursor = TRANY(cursor[unit].y);
- }
- return;
-
- case CTRL('^'): /* home cursor */
- if (nograph) {
- cursor[unit].x = 0;
- dga->x_cursor = TRANX(cursor[unit].x);
- cursor[unit].y = 0;
- dga->y_cursor = TRANY(cursor[unit].y);
- }
- return;
-
- case CTRL('l'): /* cursor right */
- if (nograph && cursor[unit].x < 1023 - CHAR_WIDTH) {
- cursor[unit].x += CHAR_WIDTH;
- dga->x_cursor = TRANX(cursor[unit].x);
- }
- return;
-
- case CTRL('z'): /* clear screen */
- if (nograph) {
- setup_dragon(unit);
- clear_qd_screen(unit);
- /* home cursor - termcap seems to assume this */
- cursor[unit].x = 0;
- dga->x_cursor = TRANX(cursor[unit].x);
- cursor[unit].y = 0;
- dga->y_cursor = TRANY(cursor[unit].y);
- }
- return;
-
- case '\033': /* start escape sequence */
- if (nograph)
- inescape[unit] = 1;
- return;
-
- default:
- if ((chr < ' ') || (chr > '~'))
- return;
- }
- /*
- * setup VIPER operand control registers
- */
- write_ID(adder, CS_UPDATE_MASK, 0x0001); /* select plane #0 */
- write_ID(adder, SRC1_OCR_B,
- EXT_NONE | INT_SOURCE | ID | BAR_SHIFT_DELAY);
- write_ID(adder, CS_UPDATE_MASK, 0x00FE); /* select other planes */
- write_ID(adder, SRC1_OCR_B,
- EXT_SOURCE | INT_NONE | NO_ID | BAR_SHIFT_DELAY);
- write_ID(adder, CS_UPDATE_MASK, 0x00FF); /* select all planes */
- write_ID(adder, DST_OCR_B,
- EXT_NONE | INT_NONE | NO_ID | NO_BAR_SHIFT_DELAY);
- write_ID(adder, MASK_1, 0xFFFF);
- write_ID(adder, VIPER_Z_LOAD | FOREGROUND_COLOR_Z, 1);
- write_ID(adder, VIPER_Z_LOAD | BACKGROUND_COLOR_Z, 0);
- adder->x_clip_min = 0;
- adder->x_clip_max = 1024;
- adder->y_clip_min = 0;
- adder->y_clip_max = 864;
- /*
- * load DESTINATION origin and vectors
- */
- adder->fast_dest_dy = 0;
- adder->slow_dest_dx = 0;
- adder->error_1 = 0;
- adder->error_2 = 0;
- adder->rasterop_mode = DST_WRITE_ENABLE | NORMAL;
- (void)wait_status(adder, RASTEROP_COMPLETE);
- adder->destination_x = cursor[unit].x;
- adder->fast_dest_dx = CHAR_WIDTH;
- adder->destination_y = cursor[unit].y;
- adder->slow_dest_dy = CHAR_HEIGHT;
- /*
- * load SOURCE origin and vectors
- */
- if ((chr - ' ') > (CHARS - 1)) {
- printf("Invalid character (x)%x in blitc\n",chr);
- chr = ' ';
- }
- /*
- * X position is modulo the number of characters per line
- */
- adder->source_1_x = FONT_X +
- (((chr - ' ') % (MAX_SCREEN_X/CHAR_WIDTH)) * CHAR_WIDTH);
- /*
- * Point to either first or second row
- */
- adder->source_1_y = 2048 - 15 *
- (((chr - ' ')/(MAX_SCREEN_X/CHAR_WIDTH)) + 1);
- adder->source_1_dx = CHAR_WIDTH;
- adder->source_1_dy = CHAR_HEIGHT;
- write_ID(adder, LU_FUNCTION_R1, FULL_SRC_RESOLUTION | LF_SOURCE);
- adder->cmd = RASTEROP | OCRB | 0 | S1E | DTE;
- /*
- * update console cursor coordinates
- */
- cursor[unit].x += CHAR_WIDTH;
- if (nograph)
- dga->x_cursor = TRANX(cursor[unit].x);
- if (cursor[unit].x > (1024 - CHAR_WIDTH)) {
- blitc(unit, '\r');
- blitc(unit, '\n');
- }
-
-} /* blitc */
-
-/*
- * INTERRUPT SERVICE ROUTINES
- */
-
-/*
- * Service "DMA DONE" interrupt condition
- */
-
-static void
-qddint(arg)
- void *arg;
-{
- struct device *dv = arg;
- register struct DMAreq_header *header;
- register struct DMAreq *request;
- volatile register struct dga *dga;
- volatile struct adder *adder;
- int cookie; /* DMA adrs for QDSS */
-
- (void)spl4(); /* allow interval timer in */
-
- /*
- * init pointers
- */
- header = DMAheader[dv->dv_unit]; /* register for optimization */
- dga = (struct dga *) qdmap[dv->dv_unit].dga;
- adder = (struct adder *) qdmap[dv->dv_unit].adder;
-
- /*
- * if this interrupt flagged as bogus for interrupt flushing purposes..
- */
- if (DMA_ISIGNORE(header)) {
- DMA_CLRIGNORE(header);
- return;
- }
-
- /*
- * dump a DMA hardware error message if appropriate
- */
- if (dga->csr & DMA_ERR) {
-
- if (dga->csr & PARITY_ERR)
- printf("qd%d: qddint: DMA hardware parity fault.\n", dv->dv_unit);
-
- if (dga->csr & BUS_ERR)
- printf("qd%d: qddint: DMA hardware bus error.\n", dv->dv_unit);
- }
-
- /*
- * if this was a DMA from user space...
- */
- if (qdflags[dv->dv_unit].user_dma) {
- qdflags[dv->dv_unit].user_dma = 0;
- wakeup((caddr_t)&qdflags[dv->dv_unit].user_dma);
- return;
- }
-
- /*
- * if we're doing DMA request queue services, field the error condition
- */
- if (dga->csr & DMA_ERR) {
-
- dga->csr &= ~0x0600; /* halt DMA (reset fifo) */
- dga->csr |= DMA_ERR; /* clear error condition */
- adder->command = CANCEL; /* cancel adder activity */
-
- DMA_SETERROR(header); /* flag error in header status word */
- DMA_CLRACTIVE(header);
- header->DMAreq[header->oldest].DMAdone |= HARD_ERROR;
- header->newest = header->oldest;
- header->used = 0;
-
- if (qdrsel[dv->dv_unit].si_pid && qdflags[dv->dv_unit].selmask & SEL_WRITE) {
- selwakeup(&qdrsel[dv->dv_unit]);
- qdrsel[dv->dv_unit].si_pid = 0;
- qdflags[dv->dv_unit].selmask &= ~SEL_WRITE;
- }
-
- if (dga->bytcnt_lo != 0) {
- dga->bytcnt_lo = 0;
- dga->bytcnt_hi = 0;
- DMA_SETIGNORE(header);
- }
- return;
- }
-
- /*
- * if the DMA request queue is now becoming non-full,
- * wakeup "select" client.
- */
- if (DMA_ISFULL(header)) {
- if (qdrsel[dv->dv_unit].si_pid && qdflags[dv->dv_unit].selmask & SEL_WRITE) {
- selwakeup(&qdrsel[dv->dv_unit]);
- qdrsel[dv->dv_unit].si_pid = 0;
- qdflags[dv->dv_unit].selmask &= ~SEL_WRITE;
- }
- }
-
- header->DMAreq[header->oldest].DMAdone |= REQUEST_DONE;
- QDlast_DMAtype = header->DMAreq[header->oldest].DMAtype;
-
- /* check for unexpected interrupt */
- if (DMA_ISEMPTY(header))
- return;
-
- DMA_GETEND(header); /* update request queue indices */
-
- /*
- * if no more DMA pending, wake up "select" client and exit
- */
- if (DMA_ISEMPTY(header)) {
- if (qdrsel[dv->dv_unit].si_pid && qdflags[dv->dv_unit].selmask & SEL_WRITE) {
- selwakeup(&qdrsel[dv->dv_unit]);
- qdrsel[dv->dv_unit].si_pid = 0;
- qdflags[dv->dv_unit].selmask &= ~SEL_WRITE;
- }
- DMA_CLRACTIVE(header); /* flag DMA done */
- return;
- }
-
- /*
- * initiate next DMA xfer
- */
- request = DMA_GETBEGIN(header);
- if (request->DMAtype != QDlast_DMAtype) {
- dga->csr &= ~0x0600; /* halt DMA (reset fifo) */
- adder->command = CANCEL; /* cancel adder activity */
- }
-
-
- switch (request->DMAtype) {
-
- case DISPLIST:
- if (request->DMAtype != QDlast_DMAtype) {
- dga->csr |= DL_ENB;
- dga->csr &= ~(BTOP_ENB | BYTE_DMA);
- }
- break;
-
- case PTOB:
- if (request->DMAtype != QDlast_DMAtype) {
- if (request->DMAdone & BYTE_PACK)
- dga->csr |= (PTOB_ENB | BYTE_DMA);
- else {
- dga->csr |= PTOB_ENB;
- dga->csr &= ~BYTE_DMA;
- }
- }
- break;
-
- case BTOP:
- if (request->DMAtype != QDlast_DMAtype) {
- if (request->DMAdone & BYTE_PACK) {
- dga->csr &= ~DL_ENB;
- dga->csr |= (BTOP_ENB | BYTE_DMA);
- }
- else {
- dga->csr |= BTOP_ENB;
- dga->csr &= ~(BYTE_DMA | DL_ENB);
- }
- }
- break;
- default:
- printf("qd%d: qddint: illegal DMAtype parameter.\n", dv->dv_unit);
- DMA_CLRACTIVE(header); /* flag DMA done */
- return;
- }
-
- if (request->DMAdone & COUNT_ZERO) {
- dga->csr &= ~SET_DONE_FIFO;
- }
- else if (request->DMAdone & FIFO_EMPTY) {
- dga->csr |= SET_DONE_FIFO;
- }
-
- if (request->DMAdone & WORD_PACK)
- dga->csr &= ~BYTE_DMA;
- else if (request->DMAdone & BYTE_PACK)
- dga->csr |= BYTE_DMA;
-
- dga->csr |= DMA_IE;
- QDlast_DMAtype = request->DMAtype;
-
- cookie = ((int)request->bufp - (int)header) + (int)header->QBAreg;
-
- dga->adrs_lo = (short) cookie;
- dga->adrs_hi = (short) (cookie >> 16);
-
- dga->bytcnt_lo = (short) request->length;
- dga->bytcnt_hi = (short) (request->length >> 16);
-
- return;
-}
-
-/*
- * ADDER interrupt service routine
- */
-static void
-qdaint(arg)
- void *arg;
-{
- struct device *dv = arg;
- volatile register struct adder *adder;
- struct color_buf *cbuf;
- int i;
- register struct rgb *rgbp;
- volatile register short *red;
- volatile register short *green;
- volatile register short *blue;
-
- (void)spl4(); /* allow interval timer in */
-
- adder = (struct adder *) qdmap[dv->dv_unit].adder;
-
- /*
- * service the vertical blank interrupt (VSYNC bit) by loading
- * any pending color map load request
- */
- if (adder->status & VSYNC) {
- adder->status &= ~VSYNC; /* clear the interrupt */
- cbuf = color_buf[dv->dv_unit];
- if (cbuf->status & LOAD_COLOR_MAP) {
-
- red = (short *) qdmap[dv->dv_unit].red;
- green = (short *) qdmap[dv->dv_unit].green;
- blue = (short *) qdmap[dv->dv_unit].blue;
-
- for (i = cbuf->count, rgbp = cbuf->rgb;
- --i >= 0; rgbp++) {
- red[rgbp->offset] = (short) rgbp->red;
- green[rgbp->offset] = (short) rgbp->green;
- blue[rgbp->offset] = (short) rgbp->blue;
- }
-
- cbuf->status &= ~LOAD_COLOR_MAP;
- }
- }
-
- /*
- * service the scroll interrupt (FRAME_SYNC bit)
- */
- if (adder->status & FRAME_SYNC) {
- adder->status &= ~FRAME_SYNC; /* clear the interrupt */
-
- if (scroll[dv->dv_unit]->status & LOAD_REGS) {
-
- for (i = 1000, adder->status = 0; i > 0 &&
- !(adder->status&ID_SCROLL_READY); --i)
- ;
-
- if (i == 0) {
- printf("qd%d: qdaint: timeout on ID_SCROLL_READY\n",
- qd);
- return;
- }
-
- adder->ID_scroll_data = scroll[dv->dv_unit]->viper_constant;
- adder->ID_scroll_command = ID_LOAD | SCROLL_CONSTANT;
-
- adder->y_scroll_constant =
- scroll[dv->dv_unit]->y_scroll_constant;
- adder->y_offset_pending = scroll[dv->dv_unit]->y_offset;
-
- if (scroll[dv->dv_unit]->status & LOAD_INDEX) {
-
- adder->x_index_pending =
- scroll[dv->dv_unit]->x_index_pending;
- adder->y_index_pending =
- scroll[dv->dv_unit]->y_index_pending;
- }
-
- scroll[dv->dv_unit]->status = 0x00;
- }
- }
-}
-
-/*
- * DUART input interrupt service routine
- *
- * XXX - this routine should be broken out - it is essentially
- * straight line code.
- */
-
-static void
-qdiint(arg)
- void *arg;
-{
- struct device *dv = arg;
- register struct _vs_event *event;
- register struct qdinput *eqh;
- volatile struct dga *dga;
- volatile struct duart *duart;
- struct mouse_report *new_rep;
- struct tty *tp;
- u_short chr;
- u_short status;
- u_short data;
- u_short key;
- char do_wakeup = 0; /* flag to do a select wakeup call */
- char a, b, c; /* mouse button test variables */
-
- (void)spl4(); /* allow interval timer in */
-
- eqh = eq_header[dv->dv_unit]; /* optimized as a register */
- new_rep = &current_rep[dv->dv_unit];
- duart = (struct duart *) qdmap[dv->dv_unit].duart;
-
- /*
- * if the graphic device is turned on..
- */
- if (qdflags[dv->dv_unit].inuse & GRAPHIC_DEV) {
- /*
- * empty DUART
- */
- while (duart->statusA&RCV_RDY || duart->statusB&RCV_RDY) {
- /*
- * pick up LK-201 input (if any)
- */
- if (duart->statusA&RCV_RDY) {
-
- /* if error condition, then reset it */
-
- if (duart->statusA&0x70) {
- duart->cmdA = 0x40;
- continue;
- }
-
- /* event queue full now? (overflow condition) */
-
- if (ISFULL(eqh) == TRUE) {
- printf(
- "qd%d: qdiint: event queue overflow\n",
- qd);
- break;
- }
-
- /*
- * Check for various keyboard errors */
-
- key = duart->dataA & 0xFF;
-
- if (key==LK_POWER_ERROR ||
- key==LK_KDOWN_ERROR ||
- key == LK_INPUT_ERROR ||
- key == LK_OUTPUT_ERROR) {
- printf(
- "qd%d: qdiint: keyboard error, code = %x\n",
- qd,key);
- return;
- }
-
- if (key < LK_LOWEST)
- return;
-
- ++do_wakeup; /* request a select wakeup call */
-
- event = PUTBEGIN(eqh);
- PUTEND(eqh);
-
- event->vse_key = key;
- event->vse_key &= 0x00FF;
- event->vse_x = eqh->curs_pos.x;
- event->vse_y = eqh->curs_pos.y;
- event->vse_time = TOY;
- event->vse_type = VSE_BUTTON;
- event->vse_direction = VSE_KBTRAW;
- event->vse_device = VSE_DKB;
- }
-
- /*
- * pick up the mouse input (if any) */
-
- if ((status = duart->statusB) & RCV_RDY &&
- qdflags[dv->dv_unit].pntr_id == MOUSE_ID) {
-
- if (status & 0x70) {
- duart->cmdB = 0x40;
- continue;
- }
-
- /* event queue full now? (overflow condition) */
-
- if (ISFULL(eqh) == TRUE) {
- printf(
- "qd%d: qdiint: event queue overflow\n",
- qd);
- break;
- }
-
- data = duart->dataB; /* get report byte */
- ++new_rep->bytcnt; /* bump report byte count */
-
- /*
- * if 1st byte of report.. */
-
- if ( data & START_FRAME) {
- new_rep->state = data;
- if (new_rep->bytcnt > 1) {
- /* start of new frame */
- new_rep->bytcnt = 1;
- /* ..continue looking */
- continue;
- }
- }
-
- /*
- * if 2nd byte of report.. */
-
- else if (new_rep->bytcnt == 2) {
- new_rep->dx = data & 0x00FF;
- }
-
- /*
- * if 3rd byte of report, load input event queue */
-
- else if (new_rep->bytcnt == 3) {
-
- new_rep->dy = data & 0x00FF;
- new_rep->bytcnt = 0;
-
- /*
- * if mouse position has changed.. */
-
- if (new_rep->dx != 0 || new_rep->dy != 0) {
-
- /*
- * calculate acceleration factor, if needed */
-
- if (qdflags[dv->dv_unit].curs_acc > ACC_OFF) {
-
- if (qdflags[dv->dv_unit].curs_thr <= new_rep->dx)
- new_rep->dx +=
- (new_rep->dx - qdflags[dv->dv_unit].curs_thr)
- * qdflags[dv->dv_unit].curs_acc;
-
- if (qdflags[dv->dv_unit].curs_thr <= new_rep->dy)
- new_rep->dy +=
- (new_rep->dy - qdflags[dv->dv_unit].curs_thr)
- * qdflags[dv->dv_unit].curs_acc;
- }
-
- /*
- * update cursor position coordinates */
-
- if (new_rep->state & X_SIGN) {
- eqh->curs_pos.x += new_rep->dx;
- if (eqh->curs_pos.x > 1023)
- eqh->curs_pos.x = 1023;
- }
- else {
- eqh->curs_pos.x -= new_rep->dx;
- if (eqh->curs_pos.x < -15)
- eqh->curs_pos.x = -15;
- }
-
- if (new_rep->state & Y_SIGN) {
- eqh->curs_pos.y -= new_rep->dy;
- if (eqh->curs_pos.y < -15)
- eqh->curs_pos.y = -15;
- }
- else {
- eqh->curs_pos.y += new_rep->dy;
- if (eqh->curs_pos.y > 863)
- eqh->curs_pos.y = 863;
- }
-
- /*
- * update cursor screen position */
-
- dga = (struct dga *) qdmap[dv->dv_unit].dga;
- dga->x_cursor = TRANX(eqh->curs_pos.x);
- dga->y_cursor = TRANY(eqh->curs_pos.y);
-
- /*
- * if cursor is in the box, no event report */
-
- if (eqh->curs_pos.x <= eqh->curs_box.right &&
- eqh->curs_pos.x >= eqh->curs_box.left &&
- eqh->curs_pos.y >= eqh->curs_box.top &&
- eqh->curs_pos.y <= eqh->curs_box.bottom ) {
- goto GET_MBUTTON;
- }
-
- /*
- * report the mouse motion event */
-
- event = PUTBEGIN(eqh);
- PUTEND(eqh);
-
- ++do_wakeup; /* request a select wakeup call */
-
- event->vse_x = eqh->curs_pos.x;
- event->vse_y = eqh->curs_pos.y;
-
- event->vse_device = VSE_MOUSE; /* mouse */
- event->vse_type = VSE_MMOTION; /* pos changed */
- event->vse_key = 0;
- event->vse_direction = 0;
- event->vse_time = TOY; /* time stamp */
- }
-
-GET_MBUTTON:
- /*
- * if button state has changed */
-
- a = new_rep->state & 0x07; /*mask nonbutton bits */
- b = last_rep[dv->dv_unit].state & 0x07;
-
- if (a ^ b) {
-
- for ( c = 1; c < 8; c <<= 1) {
-
- if (!( c & (a ^ b))) /* this button change? */
- continue;
-
- /* event queue full? (overflow condition) */
-
- if (ISFULL(eqh) == TRUE) {
- printf("qd%d: qdiint: event queue overflow\n", qd);
- break;
- }
-
- event = PUTBEGIN(eqh); /* get new event */
- PUTEND(eqh);
-
- ++do_wakeup; /* request select wakeup */
-
- event->vse_x = eqh->curs_pos.x;
- event->vse_y = eqh->curs_pos.y;
-
- event->vse_device = VSE_MOUSE; /* mouse */
- event->vse_type = VSE_BUTTON; /* new button */
- event->vse_time = TOY; /* time stamp */
-
- /* flag changed button and if up or down */
-
- if (c == RIGHT_BUTTON)
- event->vse_key = VSE_RIGHT_BUTTON;
- else if (c == MIDDLE_BUTTON)
- event->vse_key = VSE_MIDDLE_BUTTON;
- else if (c == LEFT_BUTTON)
- event->vse_key = VSE_LEFT_BUTTON;
-
- /* set bit = button depressed */
-
- if (c & a)
- event->vse_direction = VSE_KBTDOWN;
- else
- event->vse_direction = VSE_KBTUP;
- }
- }
-
- /* refresh last report */
-
- last_rep[dv->dv_unit] = current_rep[dv->dv_unit];
-
- } /* get last byte of report */
- } else if ((status = duart->statusB)&RCV_RDY &&
- qdflags[dv->dv_unit].pntr_id == TABLET_ID) {
- /*
- * pickup tablet input, if any
- */
- if (status&0x70) {
- duart->cmdB = 0x40;
- continue;
- }
- /*
- * event queue full now? (overflow condition)
- */
- if (ISFULL(eqh) == TRUE) {
- printf("qd%d: qdiint: event queue overflow\n", qd);
- break;
- }
-
- data = duart->dataB; /* get report byte */
- ++new_rep->bytcnt; /* bump report byte count */
-
- /*
- * if 1st byte of report.. */
-
- if (data & START_FRAME) {
- new_rep->state = data;
- if (new_rep->bytcnt > 1) {
- new_rep->bytcnt = 1; /* start of new frame */
- continue; /* ..continue looking */
- }
- }
-
- /*
- * if 2nd byte of report.. */
-
- else if (new_rep->bytcnt == 2) {
- new_rep->dx = data & 0x3F;
- }
-
- /*
- * if 3rd byte of report.. */
-
- else if (new_rep->bytcnt == 3) {
- new_rep->dx |= (data & 0x3F) << 6;
- }
-
- /*
- * if 4th byte of report.. */
-
- else if (new_rep->bytcnt == 4) {
- new_rep->dy = data & 0x3F;
- }
-
- /*
- * if 5th byte of report, load input event queue */
-
- else if (new_rep->bytcnt == 5) {
-
- new_rep->dy |= (data & 0x3F) << 6;
- new_rep->bytcnt = 0;
-
- /*
- * update cursor position coordinates */
-
- new_rep->dx /= qdflags[dv->dv_unit].tab_res;
- new_rep->dy = (2200 - new_rep->dy)
- / qdflags[dv->dv_unit].tab_res;
-
- if (new_rep->dx > 1023) {
- new_rep->dx = 1023;
- }
- if (new_rep->dy > 863) {
- new_rep->dy = 863;
- }
-
- /*
- * report an event if the puck/stylus has moved
- */
-
- if (eqh->curs_pos.x != new_rep->dx ||
- eqh->curs_pos.y != new_rep->dy) {
-
- eqh->curs_pos.x = new_rep->dx;
- eqh->curs_pos.y = new_rep->dy;
-
- /*
- * update cursor screen position */
-
- dga = (struct dga *) qdmap[dv->dv_unit].dga;
- dga->x_cursor = TRANX(eqh->curs_pos.x);
- dga->y_cursor = TRANY(eqh->curs_pos.y);
-
- /*
- * if cursor is in the box, no event report
- */
-
- if (eqh->curs_pos.x <= eqh->curs_box.right &&
- eqh->curs_pos.x >= eqh->curs_box.left &&
- eqh->curs_pos.y >= eqh->curs_box.top &&
- eqh->curs_pos.y <= eqh->curs_box.bottom ) {
- goto GET_TBUTTON;
- }
-
- /*
- * report the tablet motion event */
-
- event = PUTBEGIN(eqh);
- PUTEND(eqh);
-
- ++do_wakeup; /* request a select wakeup call */
-
- event->vse_x = eqh->curs_pos.x;
- event->vse_y = eqh->curs_pos.y;
-
- event->vse_device = VSE_TABLET; /* tablet */
- /*
- * right now, X handles tablet motion the same
- * as mouse motion
- */
- event->vse_type = VSE_MMOTION; /* pos changed */
- event->vse_key = 0;
- event->vse_direction = 0;
- event->vse_time = TOY; /* time stamp */
- }
-GET_TBUTTON:
- /*
- * if button state has changed */
-
- a = new_rep->state & 0x1E; /* mask nonbutton bits */
- b = last_rep[dv->dv_unit].state & 0x1E;
-
- if (a ^ b) {
-
- /* event queue full now? (overflow condition) */
-
- if (ISFULL(eqh) == TRUE) {
- printf("qd%d: qdiint: event queue overflow\n",qd);
- break;
- }
-
- event = PUTBEGIN(eqh); /* get new event */
- PUTEND(eqh);
-
- ++do_wakeup; /* request a select wakeup call */
-
- event->vse_x = eqh->curs_pos.x;
- event->vse_y = eqh->curs_pos.y;
-
- event->vse_device = VSE_TABLET; /* tablet */
- event->vse_type = VSE_BUTTON; /* button changed */
- event->vse_time = TOY; /* time stamp */
-
- /* define the changed button and if up or down */
-
- for ( c = 1; c <= 0x10; c <<= 1) {
- if (c & (a ^ b)) {
- if (c == T_LEFT_BUTTON)
- event->vse_key = VSE_T_LEFT_BUTTON;
- else if (c == T_FRONT_BUTTON)
- event->vse_key = VSE_T_FRONT_BUTTON;
- else if (c == T_RIGHT_BUTTON)
- event->vse_key = VSE_T_RIGHT_BUTTON;
- else if (c == T_BACK_BUTTON)
- event->vse_key = VSE_T_BACK_BUTTON;
- break;
- }
- }
-
- /* set bit = button depressed */
-
- if (c & a)
- event->vse_direction = VSE_KBTDOWN;
- else
- event->vse_direction = VSE_KBTUP;
- }
-
- /* refresh last report */
-
- last_rep[dv->dv_unit] = current_rep[dv->dv_unit];
-
- } /* get last byte of report */
- } /* pick up tablet input */
-
- } /* while input available.. */
-
- /*
- * do select wakeup
- */
- if (qdrsel[dv->dv_unit].si_pid && do_wakeup && qdflags[dv->dv_unit].selmask & SEL_READ) {
- selwakeup(&qdrsel[dv->dv_unit]);
- qdrsel[dv->dv_unit].si_pid = 0;
- qdflags[dv->dv_unit].selmask &= ~SEL_READ;
- do_wakeup = 0;
- }
- } else {
- /*
- * if the graphic device is not turned on, this is console input
- */
- if (qdpolling)
- return;
-
- if (dv->dv_unit >= qd_cd.cd_ndevs || qd_cd.cd_devs[dv->dv_unit] == NULL)
- return; /* no such device or address */
-
- tp = qd_tty[dv->dv_unit << 2];
-
- /*
- * Get a character from the keyboard.
- */
- while (duart->statusA&RCV_RDY) {
- key = duart->dataA;
- key &= 0xFF;
- /*
- * Check for various keyboard errors
- */
- if (key == LK_POWER_ERROR || key == LK_KDOWN_ERROR ||
- key == LK_INPUT_ERROR || key == LK_OUTPUT_ERROR) {
- printf("qd%d: qdiint: Keyboard error, code = %x\n",qd,key);
- return;
- }
-
- if (key < LK_LOWEST)
- return;
-
- /*
- * See if its a state change key */
-
- switch (key) {
-
- case LOCK:
- q_keyboard.lock ^= 0xffff; /* toggle */
- if (q_keyboard.lock)
- led_control(qd, LK_LED_ENABLE,
- LK_LED_LOCK);
- else
- led_control(qd, LK_LED_DISABLE,
- LK_LED_LOCK);
- return;
-
- case SHIFT:
- q_keyboard.shift ^= 0xFFFF;
- return;
-
- case CNTRL:
- q_keyboard.cntrl ^= 0xFFFF;
- return;
-
- case ALLUP:
- q_keyboard.cntrl = 0;
- q_keyboard.shift = 0;
- return;
-
- case REPEAT:
- chr = q_keyboard.last;
- break;
-
- /*
- * Test for cntrl characters. If set, see if the character
- * is elligible to become a control character. */
-
- default:
-
- if (q_keyboard.cntrl) {
- chr = q_key[key];
- if (chr >= ' ' && chr <= '~')
- chr &= 0x1F;
- else if (chr >= 0xA1 && chr <= 0xFE)
- chr &= 0x9F;
- }
- else if( q_keyboard.lock || q_keyboard.shift )
- chr = q_shift_key[key];
- else
- chr = q_key[key];
- break;
- }
-
- q_keyboard.last = chr;
-
- /*
- * Check for special function keys */
-
- if (chr & 0x100) {
- char *string;
- string = q_special[chr & 0x7F];
- while(*string)
- (*linesw[tp->t_line].l_rint)(*string++, tp);
- }
- else {
-#ifdef DDB
- /* Check for kernel debugger escape here */
- int j;
-
- j = kdbrint(chr&0177);
-
- if (j == 1) /* Escape received, just return */
- return;
-
- if (j == 2) /* Second char wasn't 'D' */
- (*linesw[tp->t_line].l_rint)(27, tp);
-#endif
- (*linesw[tp->t_line].l_rint)(chr&0177, tp);
- }
- }
- }
-} /* qdiint */
-
-/*
- *
- * Clear the QDSS screen
- *
- * >>> NOTE <<<
- *
- * This code requires that certain adder initialization be valid. To
- * assure that this requirement is satisfied, this routine should be
- * called only after calling the "setup_dragon()" function.
- *
- * Clear the bitmap a piece at a time. Since the fast scroll clear
- * only clears the current displayed portion of the bitmap put a
- * temporary value in the y limit register so we can access whole
- * bitmap
- *
- */
-void
-clear_qd_screen(unit)
- int unit;
-{
- volatile register struct adder *adder;
- adder = (struct adder *) qdmap[unit].adder;
-
- adder->x_limit = 1024;
- adder->y_limit = 2048 - CHAR_HEIGHT;
- adder->y_offset_pending = 0;
-#define WSV (void)wait_status(adder, VSYNC); (void)wait_status(adder, VSYNC)
- WSV;
- adder->y_scroll_constant = SCROLL_ERASE;
- WSV;
- adder->y_offset_pending = 864;
- WSV;
- adder->y_scroll_constant = SCROLL_ERASE;
- WSV;
- adder->y_offset_pending = 1728;
- WSV;
- adder->y_scroll_constant = SCROLL_ERASE;
- WSV;
- adder->y_offset_pending = 0; /* back to normal */
- WSV;
- adder->x_limit = MAX_SCREEN_X;
- adder->y_limit = MAX_SCREEN_Y + FONT_HEIGHT;
-#undef WSV
-
-} /* clear_qd_screen */
-
-/*
- * kernel console output to the glass tty
- */
-void
-qdcnputc(dev, chr)
- dev_t dev;
- int chr;
-{
-
- /*
- * if system is now physical, forget it (ie: crash DUMP)
- */
- if ((mfpr(PR_MAPEN) & 1) == 0)
- return;
-
- blitc(0, (u_char)(chr & 0xff));
-} /* qdputc */
-
-/*
- * load the mouse cursor's template RAM bitmap
- */
-void
-ldcursor(unit, bitmap)
- int unit;
- short *bitmap;
-{
- volatile register struct dga *dga;
- volatile register short *temp;
- register int i;
- int curs;
-
- dga = (struct dga *) qdmap[unit].dga;
- temp = (short *) qdmap[unit].template;
-
- if (dga->csr & CURS_ENB) { /* if the cursor is enabled.. */
- curs = -1; /* ..note that.. */
- dga->csr &= ~CURS_ENB; /* ..and shut it off */
- } else
- curs = 0;
-
- dga->csr &= ~CURS_ENB; /* shut off the cursor */
-
- temp += (8 * 1024) - 32; /* cursor is 32 WORDS from the end */
- /* ..of the 8k WORD template space */
- for (i = 0; i < 32; ++i)
- *temp++ = *bitmap++;
-
- if (curs) { /* if cursor was enabled.. */
- dga->csr |= CURS_ENB; /* ..turn it back on */
- }
-
-} /* ldcursor */
-
-/*
- * Put the console font in the QDSS off-screen memory
- */
-void
-ldfont(unit)
- int unit;
-{
- volatile register struct adder *adder;
-
- register int i, j, k, max_chars_line;
- register short packed;
-
- adder = (struct adder *) qdmap[unit].adder;
-
- /*
- * setup VIPER operand control registers
- */
- write_ID(adder, MASK_1, 0xFFFF);
- write_ID(adder, VIPER_Z_LOAD | FOREGROUND_COLOR_Z, 255);
- write_ID(adder, VIPER_Z_LOAD | BACKGROUND_COLOR_Z, 0);
-
- write_ID(adder, SRC1_OCR_B,
- EXT_NONE | INT_NONE | ID | BAR_SHIFT_DELAY);
- write_ID(adder, SRC2_OCR_B,
- EXT_NONE | INT_NONE | ID | BAR_SHIFT_DELAY);
- write_ID(adder, DST_OCR_B,
- EXT_SOURCE | INT_NONE | NO_ID | NO_BAR_SHIFT_DELAY);
-
- adder->rasterop_mode = DST_WRITE_ENABLE | DST_INDEX_ENABLE | NORMAL;
-
- /*
- * load destination data
- */
- (void)wait_status(adder, RASTEROP_COMPLETE);
-
- adder->destination_x = FONT_X;
- adder->destination_y = FONT_Y;
-#if FONT_WIDTH > MAX_SCREEN_X
- adder->fast_dest_dx = MAX_SCREEN_X;
-#else
- adder->fast_dest_dx = FONT_WIDTH;
-#endif
- adder->slow_dest_dy = CHAR_HEIGHT;
-
- /*
- * setup for processor to bitmap xfer */
-
- write_ID(adder, CS_UPDATE_MASK, 0x0001);
- adder->cmd = PBT | OCRB | 2 | DTE | 2;
-
- /*
- * Figure out how many characters can be stored on one "line" of
- * offscreen memory.
- */
- max_chars_line = MAX_SCREEN_X/(CHAR_WIDTH*2);
- if ((CHARS/2 + CHARS%2) < max_chars_line)
- max_chars_line = CHARS/2 + CHARS%2;
-
- /*
- * iteratively do the processor to bitmap xfer */
-
- for (i = 0; i < ROWS; ++i) {
-
- /* PTOB a scan line */
-
- for (j = 0, k = i; j < max_chars_line; ++j) {
- /* PTOB one scan of a char cell */
-
- packed = q_font[k];
- k += ROWS;
- packed |= ((short)q_font[k] << 8);
- k += ROWS;
-
- (void)wait_status(adder, TX_READY);
- adder->id_data = packed;
- }
- }
-
- /*
- * (XXX XXX XXX - should remove)
- *
- * Copy the second row of characters. Subtract the first
- * row from the total number. Divide this quantity by 2
- * because 2 chars are stored in a short in the PTOB loop
- * below. Figure out how many characters can be stored on
- * one "line" of offscreen memory
- */
-
- max_chars_line = MAX_SCREEN_X/(CHAR_WIDTH*2);
- if ((CHARS/2 + CHARS%2) < max_chars_line)
- return;
- max_chars_line = (CHARS/2 + CHARS%2) - max_chars_line; /* 95 - 64 */
- /* Paranoia check to see if 3rd row may be needed */
- if (max_chars_line > (MAX_SCREEN_X/(CHAR_WIDTH*2)))
- max_chars_line = MAX_SCREEN_X/(CHAR_WIDTH*2);
-
- adder->destination_x = FONT_X;
- adder->destination_y = FONT_Y - CHAR_HEIGHT;
- adder->fast_dest_dx = max_chars_line * CHAR_WIDTH * 2;
- adder->slow_dest_dy = CHAR_HEIGHT;
-
- /*
- * setup for processor to bitmap xfer
- */
- write_ID(adder, CS_UPDATE_MASK, 0x0001);
- adder->cmd = PBT | OCRB | 2 | DTE | 2;
-
- /*
- * iteratively do the processor to bitmap xfer
- */
- for (i = 0; i < ROWS; ++i) {
- /*
- * PTOB a scan line
- */
- for (j = 0, k = i; j < max_chars_line; ++j) {
- /*
- * PTOB one scan of a char cell
- */
- packed = q_font[k + FONT_OFFSET];
- k += ROWS;
- packed |= ((short)q_font[k + FONT_OFFSET] << 8);
- k += ROWS;
- (void)wait_status(adder, TX_READY);
- adder->id_data = packed;
- }
- }
-
-} /* ldfont */
-
-
-/*
- * Disable or enable polling. This is used when entering or leaving the
- * kernel debugger.
- */
-void
-qdcnpollc(dev, onoff)
- dev_t dev;
- int onoff;
-{
- qdpolling = onoff;
-}
-
-
-/*
- * Get a character from the LK201 (polled)
- */
-int
-qdcngetc(dev)
- dev_t dev;
-{
- register short key;
- register char chr;
- volatile register struct duart *duart;
-
- duart = (struct duart *) qdmap[0].duart;
-
- /*
- * Get a character from the keyboard.
- */
-LOOP:
- while (!(duart->statusA&RCV_RDY))
- ;
-
- key = duart->dataA;
- key &= 0xFF;
-
- /*
- * Check for various keyboard errors */
-
- if (key == LK_POWER_ERROR || key == LK_KDOWN_ERROR ||
- key == LK_INPUT_ERROR || key == LK_OUTPUT_ERROR) {
- printf("Keyboard error, code = %x\n", key);
- return(0);
- }
-
- if (key < LK_LOWEST)
- return(0);
-
- /*
- * See if its a state change key
- */
- switch (key) {
-
- case LOCK:
- q_keyboard.lock ^= 0xffff; /* toggle */
- if (q_keyboard.lock)
- led_control(0, LK_LED_ENABLE, LK_LED_LOCK);
- else
- led_control(0, LK_LED_DISABLE, LK_LED_LOCK);
- goto LOOP;
-
- case SHIFT:
- q_keyboard.shift ^= 0xFFFF;
- goto LOOP;
-
- case CNTRL:
- q_keyboard.cntrl ^= 0xFFFF;
- goto LOOP;
-
- case ALLUP:
- q_keyboard.cntrl = 0;
- q_keyboard.shift = 0;
- goto LOOP;
-
- case REPEAT:
- chr = q_keyboard.last;
- break;
-
- /*
- * Test for cntrl characters. If set, see if the character
- * is elligible to become a control character.
- */
- default:
-
- if (q_keyboard.cntrl) {
- chr = q_key[key];
- if (chr >= ' ' && chr <= '~')
- chr &= 0x1F;
- }
- else if ( q_keyboard.lock || q_keyboard.shift )
- chr = q_shift_key[key];
- else
- chr = q_key[key];
- break;
- }
-
- if (chr < ' ' && chr > '~') /* if input is non-displayable */
- return(0); /* ..then pitch it! */
-
- q_keyboard.last = chr;
-
- /*
- * Check for special function keys */
-
- if (chr & 0x80) /* pitch the function keys */
- return(0);
- else
- return(chr);
-
-} /* qdgetc */
-
-/*
- * led_control()... twiddle LK-201 LED's
- */
-void
-led_control(unit, cmd, led_mask)
- int unit, cmd, led_mask;
-{
- register int i;
- volatile register struct duart *duart;
-
- duart = (struct duart *)qdmap[unit].duart;
-
- for (i = 1000; i > 0; --i) {
- if (duart->statusA&XMT_RDY) {
- duart->dataA = cmd;
- break;
- }
- }
- for (i = 1000; i > 0; --i) {
- if (duart->statusA&XMT_RDY) {
- duart->dataA = led_mask;
- break;
- }
- }
- return;
-
-} /* led_control */
-
-/*
- * scroll_up()... move the screen up one character height
- */
-void
-scroll_up(adder)
- volatile struct adder *adder;
-{
- /*
- * setup VIPER operand control registers
- */
- (void)wait_status(adder, ADDRESS_COMPLETE);
- write_ID(adder, CS_UPDATE_MASK, 0x00FF); /* select all planes */
- write_ID(adder, MASK_1, 0xFFFF);
- write_ID(adder, VIPER_Z_LOAD | FOREGROUND_COLOR_Z, 255);
- write_ID(adder, VIPER_Z_LOAD | BACKGROUND_COLOR_Z, 0);
- write_ID(adder, SRC1_OCR_B,
- EXT_NONE | INT_SOURCE | ID | BAR_SHIFT_DELAY);
- write_ID(adder, DST_OCR_B,
- EXT_NONE | INT_NONE | NO_ID | NO_BAR_SHIFT_DELAY);
- /*
- * load DESTINATION origin and vectors
- */
- adder->fast_dest_dy = 0;
- adder->slow_dest_dx = 0;
- adder->error_1 = 0;
- adder->error_2 = 0;
- adder->rasterop_mode = DST_WRITE_ENABLE | NORMAL;
- adder->destination_x = 0;
- adder->fast_dest_dx = 1024;
- adder->destination_y = 0;
- adder->slow_dest_dy = 864 - CHAR_HEIGHT;
- /*
- * load SOURCE origin and vectors
- */
- adder->source_1_x = 0;
- adder->source_1_dx = 1024;
- adder->source_1_y = 0 + CHAR_HEIGHT;
- adder->source_1_dy = 864 - CHAR_HEIGHT;
- write_ID(adder, LU_FUNCTION_R1, FULL_SRC_RESOLUTION | LF_SOURCE);
- adder->cmd = RASTEROP | OCRB | 0 | S1E | DTE;
- /*
- * do a rectangle clear of last screen line
- */
- write_ID(adder, MASK_1, 0xffff);
- write_ID(adder, SOURCE, 0xffff);
- write_ID(adder,DST_OCR_B,
- (EXT_NONE | INT_NONE | NO_ID | NO_BAR_SHIFT_DELAY));
- write_ID(adder, VIPER_Z_LOAD | FOREGROUND_COLOR_Z, 0);
- adder->error_1 = 0;
- adder->error_2 = 0;
- adder->slow_dest_dx = 0; /* set up the width of */
- adder->slow_dest_dy = CHAR_HEIGHT; /* rectangle */
- adder->rasterop_mode = (NORMAL | DST_WRITE_ENABLE) ;
- (void)wait_status(adder, RASTEROP_COMPLETE);
- adder->destination_x = 0;
- adder->destination_y = 864 - CHAR_HEIGHT;
- adder->fast_dest_dx = 1024; /* set up the height */
- adder->fast_dest_dy = 0; /* of rectangle */
- write_ID(adder, LU_FUNCTION_R2, (FULL_SRC_RESOLUTION | LF_SOURCE));
- adder->cmd = (RASTEROP | OCRB | LF_R2 | DTE ) ;
-
-} /* scroll_up */
-
-/*
- * init shared memory pointers and structures
- */
-void
-init_shared(unit)
- int unit;
-{
- volatile register struct dga *dga;
-
- dga = (struct dga *) qdmap[unit].dga;
-
- /*
- * initialize the event queue pointers and header */
-
- eq_header[unit] = (struct qdinput *)
- ((((int)event_shared & ~(0x01FF)) + 512)
- + (EVENT_BUFSIZE * unit));
- eq_header[unit]->curs_pos.x = 0;
- eq_header[unit]->curs_pos.y = 0;
- dga->x_cursor = TRANX(eq_header[unit]->curs_pos.x);
- dga->y_cursor = TRANY(eq_header[unit]->curs_pos.y);
- eq_header[unit]->curs_box.left = 0;
- eq_header[unit]->curs_box.right = 0;
- eq_header[unit]->curs_box.top = 0;
- eq_header[unit]->curs_box.bottom = 0;
- /*
- * assign a pointer to the DMA I/O buffer for this QDSS.
- */
- DMAheader[unit] = (struct DMAreq_header *)
- (((int)(&DMA_shared[0] + 512) & ~0x1FF)
- + (DMAbuf_size * unit));
- DMAheader[unit]->DMAreq = (struct DMAreq *) ((int)DMAheader[unit]
- + sizeof(struct DMAreq_header));
- DMAheader[unit]->QBAreg = 0;
- DMAheader[unit]->status = 0;
- DMAheader[unit]->shared_size = DMAbuf_size;
- DMAheader[unit]->used = 0;
- DMAheader[unit]->size = 10; /* default = 10 requests */
- DMAheader[unit]->oldest = 0;
- DMAheader[unit]->newest = 0;
- /*
- * assign a pointer to the scroll structure for this QDSS.
- */
- scroll[unit] = (struct scroll *)
- (((int)(&scroll_shared[0] + 512) & ~0x1FF)
- + (sizeof(struct scroll) * unit));
- scroll[unit]->status = 0;
- scroll[unit]->viper_constant = 0;
- scroll[unit]->y_scroll_constant = 0;
- scroll[unit]->y_offset = 0;
- scroll[unit]->x_index_pending = 0;
- scroll[unit]->y_index_pending = 0;
- /*
- * assign a pointer to the color map write buffer for this QDSS
- */
- color_buf[unit] = (struct color_buf *)
- (((int)(&color_shared[0] + 512) & ~0x1FF)
- + (COLOR_BUFSIZ * unit));
- color_buf[unit]->status = 0;
- color_buf[unit]->count = 0;
-
-} /* init_shared */
-
-/*
- * init the ADDER, VIPER, bitmaps, & color map
- */
-void
-setup_dragon(unit)
- int unit;
-{
-
- volatile register struct adder *adder;
- volatile register struct dga *dga;
- volatile short *memcsr;
- register int i;
- short top; /* clipping/scrolling boundaries */
- short bottom;
- short right;
- short left;
- volatile short *red; /* color map pointers */
- volatile short *green;
- volatile short *blue;
-
- /*
- * init for setup
- */
- adder = (struct adder *) qdmap[unit].adder;
- dga = (struct dga *) qdmap[unit].dga;
- memcsr = (short *) qdmap[unit].memcsr;
- dga->csr &= ~(DMA_IE | 0x700); /* halt DMA and kill the intrpts */
- *memcsr = SYNC_ON; /* blank screen and turn off LED's */
- adder->command = CANCEL;
- /*
- * set monitor timing
- */
- adder->x_scan_count_0 = 0x2800;
- adder->x_scan_count_1 = 0x1020;
- adder->x_scan_count_2 = 0x003A;
- adder->x_scan_count_3 = 0x38F0;
- adder->x_scan_count_4 = 0x6128;
- adder->x_scan_count_5 = 0x093A;
- adder->x_scan_count_6 = 0x313C;
- adder->sync_phase_adj = 0x0100;
- adder->x_scan_conf = 0x00C8;
- /*
- * got a bug in second pass ADDER! lets take care of it
- *
- * normally, just use the code in the following bug fix code, but to
- * make repeated demos look pretty, load the registers as if there was
- * no bug and then test to see if we are getting sync
- */
- adder->y_scan_count_0 = 0x135F;
- adder->y_scan_count_1 = 0x3363;
- adder->y_scan_count_2 = 0x2366;
- adder->y_scan_count_3 = 0x0388;
- /*
- * if no sync, do the bug fix code
- */
- if (wait_status(adder, VSYNC) == BAD) {
- /* first load all Y scan registers with very short frame and
- * wait for scroll service. This guarantees at least one SYNC
- * to fix the pass 2 Adder initialization bug (synchronizes
- * XCINCH with DMSEEDH)
- */
- adder->y_scan_count_0 = 0x01;
- adder->y_scan_count_1 = 0x01;
- adder->y_scan_count_2 = 0x01;
- adder->y_scan_count_3 = 0x01;
- /*
- * delay at least 1 full frame time
- */
- (void)wait_status(adder, VSYNC);
- (void)wait_status(adder, VSYNC);
- /*
- * now load the REAL sync values (in reverse order just to
- * be safe.
- */
- adder->y_scan_count_3 = 0x0388;
- adder->y_scan_count_2 = 0x2366;
- adder->y_scan_count_1 = 0x3363;
- adder->y_scan_count_0 = 0x135F;
- }
- *memcsr = SYNC_ON | UNBLANK; /* turn off leds and turn on video */
- /*
- * zero the index registers
- */
- adder->x_index_pending = 0;
- adder->y_index_pending = 0;
- adder->x_index_new = 0;
- adder->y_index_new = 0;
- adder->x_index_old = 0;
- adder->y_index_old = 0;
- adder->pause = 0;
- /*
- * set rasterop mode to normal pen down
- */
- adder->rasterop_mode = DST_WRITE_ENABLE | DST_INDEX_ENABLE | NORMAL;
- /*
- * set the rasterop registers to a default values
- */
- adder->source_1_dx = 1;
- adder->source_1_dy = 1;
- adder->source_1_x = 0;
- adder->source_1_y = 0;
- adder->destination_x = 0;
- adder->destination_y = 0;
- adder->fast_dest_dx = 1;
- adder->fast_dest_dy = 0;
- adder->slow_dest_dx = 0;
- adder->slow_dest_dy = 1;
- adder->error_1 = 0;
- adder->error_2 = 0;
- /*
- * scale factor = UNITY
- */
- adder->fast_scale = UNITY;
- adder->slow_scale = UNITY;
- /*
- * set the source 2 parameters
- */
- adder->source_2_x = 0;
- adder->source_2_y = 0;
- adder->source_2_size = 0x0022;
- /*
- * initialize plane addresses for eight vipers
- */
- write_ID(adder, CS_UPDATE_MASK, 0x0001);
- write_ID(adder, PLANE_ADDRESS, 0x0000);
- write_ID(adder, CS_UPDATE_MASK, 0x0002);
- write_ID(adder, PLANE_ADDRESS, 0x0001);
- write_ID(adder, CS_UPDATE_MASK, 0x0004);
- write_ID(adder, PLANE_ADDRESS, 0x0002);
- write_ID(adder, CS_UPDATE_MASK, 0x0008);
- write_ID(adder, PLANE_ADDRESS, 0x0003);
- write_ID(adder, CS_UPDATE_MASK, 0x0010);
- write_ID(adder, PLANE_ADDRESS, 0x0004);
- write_ID(adder, CS_UPDATE_MASK, 0x0020);
- write_ID(adder, PLANE_ADDRESS, 0x0005);
- write_ID(adder, CS_UPDATE_MASK, 0x0040);
- write_ID(adder, PLANE_ADDRESS, 0x0006);
- write_ID(adder, CS_UPDATE_MASK, 0x0080);
- write_ID(adder, PLANE_ADDRESS, 0x0007);
- /*
- * initialize the external registers.
- */
- write_ID(adder, CS_UPDATE_MASK, 0x00FF);
- write_ID(adder, CS_SCROLL_MASK, 0x00FF);
- /*
- * initialize resolution mode
- */
- write_ID(adder, MEMORY_BUS_WIDTH, 0x000C); /* bus width = 16 */
- write_ID(adder, RESOLUTION_MODE, 0x0000); /* one bit/pixel */
- /*
- * initialize viper registers
- */
- write_ID(adder, SCROLL_CONSTANT, SCROLL_ENABLE|VIPER_LEFT|VIPER_UP);
- write_ID(adder, SCROLL_FILL, 0x0000);
- /*
- * set clipping and scrolling limits to full screen
- */
- for (i = 1000, adder->status = 0;
- i > 0 && !(adder->status&ADDRESS_COMPLETE); --i)
- ;
- if (i == 0)
- printf("qd%d: setup_dragon: timeout on ADDRESS_COMPLETE\n",unit);
- top = 0;
- bottom = 2048;
- left = 0;
- right = 1024;
- adder->x_clip_min = left;
- adder->x_clip_max = right;
- adder->y_clip_min = top;
- adder->y_clip_max = bottom;
- adder->scroll_x_min = left;
- adder->scroll_x_max = right;
- adder->scroll_y_min = top;
- adder->scroll_y_max = bottom;
- (void)wait_status(adder, VSYNC); /* wait at LEAST 1 full frame */
- (void)wait_status(adder, VSYNC);
- adder->x_index_pending = left;
- adder->y_index_pending = top;
- adder->x_index_new = left;
- adder->y_index_new = top;
- adder->x_index_old = left;
- adder->y_index_old = top;
-
- for (i = 1000, adder->status = 0; i > 0 &&
- !(adder->status&ADDRESS_COMPLETE) ; --i)
- ;
- if (i == 0)
- printf("qd%d: setup_dragon: timeout on ADDRESS_COMPLETE\n",unit);
-
- write_ID(adder, LEFT_SCROLL_MASK, 0x0000);
- write_ID(adder, RIGHT_SCROLL_MASK, 0x0000);
- /*
- * set source and the mask register to all ones (ie: white) o
- */
- write_ID(adder, SOURCE, 0xFFFF);
- write_ID(adder, MASK_1, 0xFFFF);
- write_ID(adder, VIPER_Z_LOAD | FOREGROUND_COLOR_Z, 255);
- write_ID(adder, VIPER_Z_LOAD | BACKGROUND_COLOR_Z, 0);
- /*
- * initialize Operand Control Register banks for fill command
- */
- write_ID(adder, SRC1_OCR_A, EXT_NONE | INT_M1_M2 | NO_ID | WAIT);
- write_ID(adder, SRC2_OCR_A, EXT_NONE | INT_SOURCE | NO_ID | NO_WAIT);
- write_ID(adder, DST_OCR_A, EXT_NONE | INT_NONE | NO_ID | NO_WAIT);
- write_ID(adder, SRC1_OCR_B, EXT_NONE | INT_SOURCE | NO_ID | WAIT);
- write_ID(adder, SRC2_OCR_B, EXT_NONE | INT_M1_M2 | NO_ID | NO_WAIT);
- write_ID(adder, DST_OCR_B, EXT_NONE | INT_NONE | NO_ID | NO_WAIT);
- /*
- * init Logic Unit Function registers, (these are just common values,
- * and may be changed as required).
- */
- write_ID(adder, LU_FUNCTION_R1, FULL_SRC_RESOLUTION | LF_SOURCE);
- write_ID(adder, LU_FUNCTION_R2, FULL_SRC_RESOLUTION | LF_SOURCE |
- INV_M1_M2);
- write_ID(adder, LU_FUNCTION_R3, FULL_SRC_RESOLUTION | LF_D_OR_S);
- write_ID(adder, LU_FUNCTION_R4, FULL_SRC_RESOLUTION | LF_D_XOR_S);
- /*
- * load the color map for black & white
- */
- for (i = 0, adder->status = 0; i < 10000 && !(adder->status&VSYNC); ++i)
- ;
-
- if (i == 0)
- printf("qd%d: setup_dragon: timeout on VSYNC\n", unit);
-
- red = (short *) qdmap[unit].red;
- green = (short *) qdmap[unit].green;
- blue = (short *) qdmap[unit].blue;
-
- *red++ = 0x00; /* black */
- *green++ = 0x00;
- *blue++ = 0x00;
-
- *red-- = 0xFF; /* white */
- *green-- = 0xFF;
- *blue-- = 0xFF;
-
- /*
- * set color map for mouse cursor
- */
-
- red += 254;
- green += 254;
- blue += 254;
-
- *red++ = 0x00; /* black */
- *green++ = 0x00;
- *blue++ = 0x00;
-
- *red = 0xFF; /* white */
- *green = 0xFF;
- *blue = 0xFF;
-
-} /* setup_dragon */
-
-/*
- * Init the DUART and set defaults in input
- */
-void
-setup_input(unit)
- int unit;
-{
- volatile register struct duart *duart; /* DUART register structure pointer */
- register int i, bits;
- char id_byte;
-
- duart = (struct duart *) qdmap[unit].duart;
- duart->imask = 0;
-
- /*
- * setup the DUART for kbd & pointing device
- */
- duart->cmdA = RESET_M; /* reset mode reg ptr for kbd */
- duart->modeA = 0x13; /* 8 bits, no parity, rcv IE, */
- /* no RTS control,char error mode */
- duart->modeA = 0x07; /* 1 stop bit,CTS does not IE XMT */
- /* no RTS control,no echo or loop */
- duart->cmdB = RESET_M; /* reset mode reg pntr for host */
- duart->modeB = 0x07; /* 8 bits, odd parity, rcv IE.. */
- /* ..no RTS cntrl, char error mode */
- duart->modeB = 0x07; /* 1 stop bit,CTS does not IE XMT */
- /* no RTS control,no echo or loop */
- duart->auxctl = 0x00; /* baud rate set 1 */
- duart->clkselA = 0x99; /* 4800 baud for kbd */
- duart->clkselB = 0x99; /* 4800 baud for mouse */
-
- /* reset everything for keyboard */
-
- for (bits = RESET_M; bits < START_BREAK; bits += 0x10)
- duart->cmdA = bits;
-
- /* reset everything for host */
-
- for (bits = RESET_M; bits < START_BREAK; bits += 0x10)
- duart->cmdB = bits;
-
- duart->cmdA = EN_RCV | EN_XMT; /* enbl xmt & rcv for kbd */
- duart->cmdB = EN_RCV | EN_XMT; /* enbl xmt & rcv for pointer device */
-
- /*
- * init keyboard defaults (DUART channel A)
- */
- for (i = 500; i > 0; --i) {
- if (duart->statusA&XMT_RDY) {
- duart->dataA = LK_DEFAULTS;
- break;
- }
- }
-
- for (i = 100000; i > 0; --i) {
- if (duart->statusA&RCV_RDY) {
- break;
- }
- }
-
- if (duart->dataA) /* flush the ACK */
- ;
-
- /*
- * identify the pointing device
- */
- for (i = 500; i > 0; --i) {
- if (duart->statusB&XMT_RDY) {
- duart->dataB = SELF_TEST;
- break;
- }
- }
-
- /*
- * wait for 1st byte of self test report */
-
- for (i = 100000; i > 0; --i) {
- if (duart->statusB&RCV_RDY) {
- break;
- }
- }
-
- if (i == 0) {
- printf("qd[%d]: setup_input: timeout on 1st byte of self test\n"
- ,unit);
- goto OUT;
- }
-
- if (duart->dataB)
- ;
-
- /*
- * wait for ID byte of self test report
- */
- for (i = 100000; i > 0; --i) {
- if (duart->statusB&RCV_RDY) {
- break;
- }
- }
-
- if (i == 0) {
- printf("qd[%d]: setup_input: timeout on 2nd byte of self test\n", unit);
- goto OUT;
- }
-
- id_byte = duart->dataB;
-
- /*
- * wait for other bytes to come in
- */
- for (i = 100000; i > 0; --i) {
- if (duart->statusB & RCV_RDY) {
- if (duart->dataB)
- ;
- break;
- }
- }
- if (i == 0) {
- printf("qd[%d]: setup_input: timeout on 3rd byte of self test\n", unit);
- goto OUT;
- }
- for (i = 100000; i > 0; --i) {
- if (duart->statusB&RCV_RDY) {
- if (duart->dataB)
- ;
- break;
- }
- }
- if (i == 0) {
- printf("qd[%d]: setup_input: timeout on 4th byte of self test\n", unit);
- goto OUT;
- }
- /*
- * flag pointing device type and set defaults
- */
- for (i=100000; i>0; --i)
- ; /*XXX*/
-
- if ((id_byte & 0x0F) != TABLET_ID) {
- qdflags[unit].pntr_id = MOUSE_ID;
-
- for (i = 500; i > 0; --i) {
- if (duart->statusB&XMT_RDY) {
- duart->dataB = INC_STREAM_MODE;
- break;
- }
- }
- }
- else {
- qdflags[unit].pntr_id = TABLET_ID;
-
- for (i = 500; i > 0; --i) {
- if (duart->statusB&XMT_RDY) {
- duart->dataB = T_STREAM;
- break;
- }
- }
- }
-OUT:
- duart->imask = qdflags[unit].duart_imask;
-
-} /* setup_input */
-
-/*
- * delay for at least one display frame time
- *
- * return: BAD means that we timed out without ever seeing the
- * vertical sync status bit
- * GOOD otherwise
- */
-int
-wait_status(adder, mask)
- volatile struct adder *adder;
- int mask;
-{
- register int i;
-
- for (i = 10000, adder->status = 0 ; i > 0 &&
- !(adder->status&mask) ; --i)
- ;
-
- if (i == 0) {
- printf("wait_status: timeout polling for 0x%x in adder->status\n", mask);
- return(BAD);
- }
-
- return(GOOD);
-
-} /* wait_status */
-
-/*
- * write out onto the ID bus
- */
-void
-write_ID(adder, adrs, data)
- volatile struct adder *adder;
- short adrs;
- short data;
-{
- register int i;
-
- for (i = 100000, adder->status = 0 ;
- i > 0 && !(adder->status&ADDRESS_COMPLETE) ; --i)
- ;
-
- if (i == 0)
- goto ERR;
-
- for (i = 100000, adder->status = 0 ;
- i > 0 && !(adder->status&TX_READY) ; --i)
- ;
-
- if (i > 0) {
- adder->id_data = data;
- adder->command = ID_LOAD | adrs;
- return ;
- }
-
-ERR:
- printf("write_ID: timeout trying to write to VIPER\n");
- return ;
-
-} /* write_ID */
diff --git a/sys/arch/vax/qbus/qdioctl.h b/sys/arch/vax/qbus/qdioctl.h
deleted file mode 100644
index f60f0903fc1..00000000000
--- a/sys/arch/vax/qbus/qdioctl.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* $OpenBSD: qdioctl.h,v 1.3 2006/01/17 20:26:16 miod Exp $ */
-/* $NetBSD: qdioctl.h,v 1.1 1998/03/21 10:02:39 ragge Exp $ */
-/*-
- * Copyright (c) 1982, 1986
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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. 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.
- *
- * @(#)qdioctl.h 7.2 (Berkeley) 1/21/94
- */
-
-/*
- * derived from: qdioctl.h 1.1 (ULTRIX) 8/22/85
- */
-/*
- * QDSS IOCTL definitions
- */
-
-
-/************************************************************************
- * *
- * Copyright (c) 1985 by *
- * Digital Equipment Corporation, Maynard, MA *
- * All rights reserved. *
- * *
- * This software is furnished under a license and may be used and *
- * copied only in accordance with the terms of such license and *
- * with the inclusion of the above copyright notice. This *
- * software or any other copies thereof may not be provided or *
- * otherwise made available to any other person. No title to and *
- * ownership of the software is hereby transferred. *
- * *
- * This software is derived from software received from the *
- * University of California, Berkeley, and from Bell *
- * Laboratories. Use, duplication, or disclosure is subject to *
- * restrictions under license agreements with University of *
- * California and with AT&T. *
- * *
- * The information in this software is subject to change without *
- * notice and should not be construed as a commitment by Digital *
- * Equipment Corporation. *
- * *
- * Digital assumes no responsibility for the use or reliability *
- * of its software on equipment which is not supplied by Digital. *
- * *
- ************************************************************************/
-/***************************************************************************
-* revision history: (belongs in sccs)
-****************************************************************************
-*
-* 22 oct 85 longo fixed QD_PRGTABRES cmd number to be 22 instead of 12
-* 14 oct 85 longo added QD_KERN_LOOP and QD_KERN_UNLOOP
-* 02 oct 85 longo added QD_MAPCOLOR and QD_UNMAPCOLOR
-* 17 sep 85 longo made QD_MAPIOBUF a read/write command type
-*
-***************************************************************************/
-
-
-#include <sys/ioctl.h>
-
-
-#define QD_GETEVENT _IOR('g', 1, struct _vs_event) /* get oldest event */
-#define QD_WTCURSOR _IOW('g', 2, short[32]) /* write cursor bitmap */
-#define QD_RDCURSOR _IOR('g', 3, 64) /* read cursor bitmap */
-#define QD_CLRSCRN _IO('g', 4) /* clear the screen */
-#define QD_RDCONFIG _IOR('g', 5, short) /* read QDSS configuration */
-#define QD_PRGMOUSE _IOW('g', 6, char) /* program mouse */
-#define QD_PRGTABLET _IOW('g', 7, char) /* program tablet */
-#define QD_PRGKBD _IOW('g', 8, struct prgkbd) /* program LK201 kbd */
-#define QD_MAPDEVICE _IOR('g', 9, struct qdmap) /* map device to user */
-#define QD_MAPIOBUF _IOWR('g', 10, caddr_t) /* map DMA iobuf to user */
-#define QD_MAPEVENT _IOR('g', 11, caddr_t) /* map event queue to user */
-#define QD_PRGCURSOR _IOW('g', 12, struct prg_cursor) /* program cursor */
-#define QD_RESET _IO('g', 13) /* set device & driver defaults */
-#define QD_POSCURSOR _IOW('g', 14, struct _vs_cursor) /* position cursor */
-#define QD_SET _IO('g', 15) /* set DUART & driver defaults */
-#define QD_MAPSCROLL _IOR('g', 16, caddr_t) /* map scroll param area */
-#define QD_UNMAPSCROLL _IO('g', 17) /* unmap scroll param area */
-#define QD_MAPCOLOR _IOR('g', 18, caddr_t) /* map color map write buf */
-#define QD_UNMAPCOLOR _IO('g', 19) /* unmap color map write buf */
-#define QD_KERN_LOOP _IO('g', 20) /* detour kernel console output */
-#define QD_KERN_UNLOOP _IO('g', 21) /* un-detour kernel console output */
-#define QD_PRGTABRES _IOW('g', 22, short) /* program tablet resolution */
diff --git a/sys/arch/vax/qbus/qduser.h b/sys/arch/vax/qbus/qduser.h
deleted file mode 100644
index 515caedd4ff..00000000000
--- a/sys/arch/vax/qbus/qduser.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/* $OpenBSD: qduser.h,v 1.4 2006/01/17 20:26:16 miod Exp $ */
-/* $NetBSD: qduser.h,v 1.1 1998/03/21 10:02:39 ragge Exp $ */
-/*-
- * Copyright (c) 1982, 1986 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)qduser.h 7.1 (Berkeley) 5/9/91
- */
-
-/* derived from: @(#)qduser.h 6.1 (ULTRIX) 11/24/87 */
-/************************************************************************
- * *
- * Copyright (c) 1986 by *
- * Digital Equipment Corporation, Maynard, MA *
- * All rights reserved. *
- * *
- * This software is furnished under a license and may be used and *
- * copied only in accordance with the terms of such license and *
- * with the inclusion of the above copyright notice. This *
- * software or any other copies thereof may not be provided or *
- * otherwise made available to any other person. No title to and *
- * ownership of the software is hereby transferred. *
- * *
- * The information in this software is subject to change without *
- * notice and should not be construed as a commitment by Digital *
- * Equipment Corporation. *
- * *
- * Digital assumes no responsibility for the use or reliability *
- * of its software on equipment which is not supplied by Digital. *
- * *
- ************************************************************************/
-
-/***************************************************************************
-*
-* QDUSER...
-* This file defines values shared between the driver and a client
-*
-***************************************************************************/
-
-/***************************************************************************
-* revision history:
-****************************************************************************
-*
-* 21 jul 86 ram fixed define of CURSOR_MIN_Y
-* 25 nov 85 longo added macro and bit defines for DMA error flags
-* 11 nov 85 longo renamed _vs_eventqueue to "qdinput" struct
-* 23 oct 85 longo added more defines to the DMA stuff
-* 17 oct 85 longo changed "struct rgb" chars to be unsigned
-* 16 oct 85 longo added new TABLET support definitions
-* 15 oct 85 longo re-wrote DMA queue access macros
-* 08 oct 85 longo added status flag manipulation macros to DMA stuff
-* 02 oct 85 longo added support for color map write buffer loading
-* 26 sep 85 longo removed adder sertup params from DMA request struct
-* 23 sep 85 longo added DMA queue access macros
-* 30 aug 85 longo fixed crock in "qdiobuf" struct compile-time sizing. Also
-* removed DMAcontrol struct from DMA buffer for field test
-* 26 aug 85 longo put in conditional include of "qevent.h" for user prg's
-* 18 jul 85 longo changed semantics so that head is tail and tail is head
-* 12 jul 85 longo moved "mouse_report" struct and defs over to qd_data.c
-* 11 jul 85 longo added device coordinate to gate array cursor coordinate
-* transformation macros
-* 03 jul 85 longo changed kernel typdef's for data types to long-hand
-* 10 may 85 longo created
-*
-***************************************************************************/
-
-#include <vax/uba/qevent.h>
-
-/*---------------------
-* QDSS device map */
-
- struct qdmap { /* map of register blocks in QDSS */
-
- char *template;
- char *adder;
- char *dga;
- char *duart;
- char *memcsr;
- char *red;
- char *blue;
- char *green;
- };
-
-/*--------------------------------------------
-* DGA CSR bit definitions and register map */
-
-#define DMADONE 0x8000 /* DMA done status */
-#define SET_DONE_FIFO 0x4000 /* set DMADONE when FIFO empty.. */
- /* ..AND count = 0 */
-
-#define PTOB_ENB 0x0600 /* host-to-bitmap DMA xfer */
-#define BTOP_ENB 0x0400 /* bitmap-to-host DMA xfer */
-#define DL_ENB 0x0200 /* display list DMA xfer */
-#define HALT 0x0000 /* halt DGA */
-
-#define BYTE_DMA 0x0100 /* byte/word DMA xfer */
-
-#define DMA_ERR 0x0080 /* DMA error bits */
-#define PARITY_ERR 0x0040 /* memory parity error in DMA */
-#define BUS_ERR 0x0020 /* bus timeout error in DMA */
-
-#define GLOBAL_IE 0x0004 /* global interrupt enable */
-#define DMA_IE 0x0002 /* DMA interrupt enable */
-#define CURS_ENB 0x0001 /* cursor enable */
-
-/* QDSS memcsr bit definitions */
-
-#define UNBLANK 0x0020
-#define SYNC_ON 0x0008
-
- struct dga {
-
- unsigned short csr;
- unsigned short adrs_lo; /* destination address of bitmap to */
- unsigned short adrs_hi; /* host DMA */
- unsigned short bytcnt_lo; /* byte length of requested DMA */
- unsigned short bytcnt_hi; /* (WO = bytcnt) (RO = fifo count) */
- unsigned short fifo; /* FIFO register */
- unsigned short x_cursor; /* cursor position registers */
- unsigned short y_cursor;
- unsigned short ivr; /* interrupt vector register */
- unsigned short memadr; /* memory base address register */
- };
-
-/*-------------------------------------------------------------------------
-* macros to transform device coordinates to hardware cursor coordinates */
-
-#define CURS_MIN_X 232 /* device coordinate x = 0 */
-#define CURS_MIN_Y 16 /* device coordinate y = 0 */
-
-#define TRANX(x) ( -(((int)(x)+CURS_MIN_X) & ~0x0003) | \
- (((int)(x)+CURS_MIN_X) & 0x0003) )
-
-#define TRANY(y) ( -((y)+CURS_MIN_Y) )
-
-/*********************************************************************
-*
-* EVENT QUEUE DEFINITIONS
-*
-**********************************************************************
-* most of the event queue definitions are found in "qevent.h". But a
-* few things not found there are here. */
-
-/* The event queue header */
-
-struct qdinput {
-
- struct _vs_eventqueue header; /* event queue ring handling */
-
- /* for VS100 and QVSS compatibility reasons, additions to this
- * structure must be made below this point. */
-
- struct _vs_cursor curs_pos; /* current mouse position */
- struct _vs_box curs_box; /* cursor reporting box */
-
- };
-
-/* vse_key field. definitions for mouse buttons */
-
-#define VSE_LEFT_BUTTON 0
-#define VSE_MIDDLE_BUTTON 1
-#define VSE_RIGHT_BUTTON 2
-
-/* vse_key field. definitions for mouse buttons */
-
-#define VSE_T_LEFT_BUTTON 0
-#define VSE_T_FRONT_BUTTON 1
-#define VSE_T_RIGHT_BUTTON 2
-#define VSE_T_BACK_BUTTON 4
-
-#define VSE_T_BARREL_BUTTON VSE_T_LEFT_BUTTON
-#define VSE_T_TIP_BUTTON VSE_T_FRONT_BUTTON
-
-/*--------------------------------------------------------------------------
-* These are the macros to be used for loading and extracting from the event
-* queue. It is presumed that the macro user will only use the access macros
-* if the event queue is non-empty ( ISEMPTY(eq) == FALSE ), and that the
-* driver will only load the event queue after checking that it is not full
-* ( ISFULL(eq) == FALSE ). ("eq" is a pointer to the event queue header.)
-*
-* Before an event access session for a particular event, the macro users
-* must use the xxxBEGIN macro, and the xxxEND macro after an event is through
-* with. As seen below, the xxxBEGIN and xxxEND macros maintain the event
-* queue access mechanism.
-*
-* First, the macros to be used by the event queue reader
-*/
-
-#define ISEMPTY(eq) ((eq)->header.head == (eq)->header.tail)
-#define GETBEGIN(eq) (&(eq)->header.events[(eq)->header.head])
-
-#define GET_X(event) ((event)->vse_x) /* get x position */
-#define GET_Y(event) ((event)->vse_y) /* get y position */
-#define GET_TIME(event) ((event)->vse_time) /* get time */
-#define GET_TYPE(event) ((event)->vse_type) /* get entry type */
-#define GET_KEY(event) ((event)->vse_key) /* get keycode */
-#define GET_DIR(event) ((event)->vse_direction) /* get direction */
-#define GET_DEVICE(event) ((event)->vse_device) /* get device */
-
-#define GETEND(eq) (++(eq)->header.head >= (eq)->header.size ? \
- (eq)->header.head = 0 : 0 )
-
-/*------------------------------------------------
-* macros to be used by the event queue loader */
-
- /* ISFULL yields TRUE if queue is full */
-
-#define ISFULL(eq) ((eq)->header.tail+1 == (eq)->header.head || \
- ((eq)->header.tail+1 == (eq)->header.size && \
- (eq)->header.head == 0))
-
- /* get address of the billet for NEXT event */
-
-#define PUTBEGIN(eq) (&(eq)->header.events[(eq)->header.tail])
-
-#define PUT_X(event, value) ((event)->vse_x = value) /* put X pos */
-#define PUT_Y(event, value) ((event)->vse_y = value) /* put Y pos */
-#define PUT_TIME(event, value) ((event)->vse_time = value) /* put time */
-#define PUT_TYPE(event, value) ((event)->vse_type = value) /* put type */
-#define PUT_KEY(event, value) ((event)->vse_key = value) /* put input key */
-#define PUT_DIR(event, value) ((event)->vse_direction = value) /* put dir */
-#define PUT_DEVICE(event, value) ((event)->vse_device = value) /* put dev */
-
-#define PUTEND(eq) (++(eq)->header.tail >= (eq)->header.size ? \
- (eq)->header.tail = 0 : 0)
-
-/******************************************************************
-*
-* DMA I/O DEFINITIONS
-*
-******************************************************************/
-
-/*---------------------------------------------------------------------
-* The DMA request queue is implemented as a ring buffer of "DMAreq"
- structures. The queue is accessed using ring indices located in the
- "DMAreq_header" structure. Access is implemented using access macros
- similar to the event queue access macros above. */
-
- struct DMAreq {
-
- short DMAtype; /* DMA type code (for QDSS) */
- short DMAdone; /* DMA done parameter */
- char *bufp; /* virtual adrs of buffer */
- int length; /* transfer buffer length */
- };
-
-/* DMA type command codes */
-
-#define DISPLIST 1 /* display list DMA */
-#define PTOB 2 /* 1 plane Qbus to bitmap DMA */
-#define BTOP 3 /* 1 plane bitmap to Qbus DMA */
-
-/* DMA done notification code */
-
-#define FIFO_EMPTY 0x01 /* DONE when FIFO becomes empty */
-#define COUNT_ZERO 0x02 /* DONE when count becomes zero */
-#define WORD_PACK 0x04 /* program the gate array for word packing */
-#define BYTE_PACK 0x08 /* program gate array for byte packing */
-#define REQUEST_DONE 0x100 /* clear when driver has processed request */
-#define HARD_ERROR 0x200 /* DMA hardware error occurred */
-
-/* DMA request queue is a ring buffer of request structures */
-
- struct DMAreq_header {
-
- int QBAreg; /* cookie Qbus map reg for this buffer */
- short status; /* master DMA status word */
- int shared_size; /* size of shared memory in bytes */
- struct DMAreq *DMAreq; /* start address of request queue */
- int used; /* # of queue entries currently used */
- int size; /* # of "DMAreq"'s in the request queue */
- int oldest; /* index to oldest queue'd request */
- int newest; /* index to newest queue'd request */
- };
-
-/* bit definitions for DMAstatus word in DMAreq_header */
-
-#define DMA_ACTIVE 0x0004 /* DMA in progress */
-#define DMA_ERROR 0x0080 /* DMA hardware error */
-#define DMA_IGNORE 0x0002 /* flag to ignore this interrupt */
-
-/*------------------------------------------
-* macros for DMA request queue fiddling */
-
- /* DMA status set/check macros */
-
-#define DMA_SETACTIVE(header) ((header)->status |= DMA_ACTIVE)
-#define DMA_CLRACTIVE(header) ((header)->status &= ~DMA_ACTIVE)
-#define DMA_ISACTIVE(header) ((header)->status & DMA_ACTIVE)
-
-#define DMA_SETERROR(header) ((header)->status |= DMA_ERROR)
-#define DMA_CLRERROR(header) ((header)->status &= ~DMA_ERROR)
-#define DMA_ISERROR(header) ((header)->status & DMA_ERROR)
-
-#define DMA_SETIGNORE(header) ((header)->status |= DMA_IGNORE)
-#define DMA_CLRIGNORE(header) ((header)->status &= ~DMA_IGNORE)
-#define DMA_ISIGNORE(header) ((header)->status & DMA_IGNORE)
-
- /* yields TRUE if queue is empty (ISEMPTY) or full (ISFULL) */
-
-#define DMA_ISEMPTY(header) ((header)->used == 0)
-#define DMA_ISFULL(header) ((header)->used >= (header)->size)
-
- /* returns address of the billet for next (PUT)
- * or oldest (GET) request */
-
-#define DMA_PUTBEGIN(header) (&(header)->DMAreq[(header)->newest])
-#define DMA_GETBEGIN(header) (&(header)->DMAreq[(header)->oldest])
-
- /* does queue access pointer maintenance */
-
-#define DMA_GETEND(header) (++(header)->oldest >= (header)->size \
- ? (header)->oldest = 0 : 0); \
- --(header)->used;
-
-#define DMA_PUTEND(header) (++(header)->newest >= (header)->size \
- ? (header)->newest = 0 : 0); \
- ++(header)->used;
-
-/******************************************************************
-*
-* COLOR MAP WRITE BUFFER DEFINITIONS
-*
-******************************************************************/
-
- struct rgb {
-
- unsigned char offset; /* color map address for load */
- unsigned char red; /* data for red map */
- unsigned char green; /* data for green map */
- unsigned char blue; /* data for blue map */
- };
-
- struct color_buf {
-
- char status; /* load request/service status */
- short count; /* number of entries to br loaded */
- struct rgb rgb[256];
- };
-
-#define LOAD_COLOR_MAP 0x0001
-
-/******************************************************************
-*
-* SCROLL ASSIST DEFINITIONS
-*
-******************************************************************/
-
- struct scroll {
-
- short status;
- short viper_constant;
- short y_scroll_constant;
- short y_offset;
- short x_index_pending;
- short y_index_pending;
- };
-
-#define LOAD_REGS 0x0001
-#define LOAD_INDEX 0x0002
-
-/******************************************************************
-*
-* MOUSE/TABLET/KBD PROGRAMMING DEFINITIONS
-*
-******************************************************************/
-
-/*-----------------------------------
-* LK201 programmming definitions */
-
-#define LK_UPDOWN 0x86 /* bits for setting lk201 modes */
-#define LK_AUTODOWN 0x82
-#define LK_DOWN 0x80
-#define LK_DEFAULTS 0xD3 /* reset (some) default settings */
-#define LK_AR_ENABLE 0xE3 /* global auto repeat enable */
-#define LK_CL_ENABLE 0x1B /* keyclick enable */
-#define LK_KBD_ENABLE 0x8B /* keyboard enable */
-#define LK_BELL_ENABLE 0x23 /* the bell */
-#define LK_RING_BELL 0xA7 /* ring keyboard bell */
-
-#define LK_LED_ENABLE 0x13 /* light led */
-#define LK_LED_DISABLE 0x11 /* turn off led */
-#define LED_1 0x81 /* led bits */
-#define LED_2 0x82
-#define LED_3 0x84
-#define LED_4 0x88
-#define LED_ALL 0x8F
-#define LK_LED_HOLD LED_4
-#define LK_LED_LOCK LED_3
-#define LK_LED_COMPOSE LED_2
-#define LK_LED_WAIT LED_1
-
-#define LK_KDOWN_ERROR 0x3D /* key down on powerup error */
-#define LK_POWER_ERROR 0x3E /* keyboard failure on powerup test */
-#define LK_OUTPUT_ERROR 0xB5 /* keystrokes lost during inhibit */
-#define LK_INPUT_ERROR 0xB6 /* garbage command to keyboard */
-#define LK_LOWEST 0x56 /* lowest significant keycode */
-#define LK_DIV6_START 0xAD /* start of div 6 */
-#define LK_DIV5_END 0xB2 /* end of div 5 */
-
-#define LAST_PARAM 0x80 /* "no more params" bit */
-
- struct prgkbd {
-
- short cmd; /* LK201 command opcode */
- short param1; /* 1st cmd parameter (can be null) */
- short param2; /* 2nd cmd parameter (can be null) */
- };
-
-/*-------------------------
-* "special" LK-201 keys */
-
-#define SHIFT 174
-#define LOCK 176
-#define REPEAT 180
-#define CNTRL 175
-#define ALLUP 179
-
-/*--------------------------------
-* cursor programming structure */
-
- struct prg_cursor {
-
- unsigned short acc_factor; /* cursor aceleration factor */
- unsigned short threshold; /* threshold to trigger acc at */
- };
-
-/*---------------------
-* mouse definitions */
-
-#define INC_STREAM_MODE 'R' /* stream mode reports (55 hz) */
-#define PROMPT_MODE 'D' /* report when prompted */
-#define REQUEST_POS 'P' /* request position report */
-#define SELF_TEST 'T' /* request self test */
-
-#define MOUSE_ID 0x2 /* mouse ID in lo 4 bits */
-
-#define START_FRAME 0x80 /* start of report frame bit */
-#define X_SIGN 0x10 /* position sign bits */
-#define Y_SIGN 0x08
-
-#define RIGHT_BUTTON 0x01 /* mouse buttons */
-#define MIDDLE_BUTTON 0x02
-#define LEFT_BUTTON 0x04
-
- /* mouse report structure definition */
-
- struct mouse_report {
-
- char state; /* buttons and sign bits */
- short dx; /* delta X since last change */
- short dy; /* delta Y since last change */
- char bytcnt; /* mouse report byte count */
- };
-
-/*-----------------------------------------
-* tablet command/interface definitions */
-
-#define T_STREAM 'R' /* continuous stream report mode */
-#define T_POINT 'D' /* enter report-on-request mode */
-#define T_REQUEST 'P' /* request position report */
-
-#define T_BAUD 'B' /* increase baud to 9600 from 4800 */
-#define T_RATE_55 'K' /* report rate: 55/sec */
-#define T_RATE_72 'L' /* report rate: 72/sec */
-#define T_RATE_120 'M' /* report rate: 120/sec (9600 only) */
-
-#define T_TEST SELF_TEST /* do self test */
-
-#define TABLET_ID 0x4 /* tablet ID in lo 4 bits */
-
-#define T_START_FRAME 0x80 /* start of report frame bit */
-#define T_PROXIMITY 0x01 /* state pointer in proximity */
-
-#define T_LEFT_BUTTON 0x02 /* puck buttons */
-#define T_FRONT_BUTTON 0x04
-#define T_RIGHT_BUTTON 0x08
-#define T_BACK_BUTTON 0x10
-
-#define T_BARREL_BUTTON T_LEFT_BUTTON /* stylus buttons */
-#define T_TIP_BUTTON T_FRONT_BUTTON
-
diff --git a/sys/arch/vax/qbus/qfont.c b/sys/arch/vax/qbus/qfont.c
deleted file mode 100644
index 9057f2d47ac..00000000000
--- a/sys/arch/vax/qbus/qfont.c
+++ /dev/null
@@ -1,3290 +0,0 @@
-/* $OpenBSD: qfont.c,v 1.2 2003/06/02 23:27:58 millert Exp $ */
-/* $NetBSD: qfont.c,v 1.4 1999/06/20 17:58:57 ragge Exp $ */
-/*-
- * Copyright (c) 1982, 1986
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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. 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.
- *
- * @(#)qfont.c 7.2 (Berkeley) 1/21/94
- */
-
-/*
- * derived from: "@(#)qfont.c 6.2 ULTRIX 2/4/88"
- */
-
-/************************************************************************
- * *
- * Copyright (c) 1984, 1987 by *
- * Digital Equipment Corporation, Maynard, MA *
- * All rights reserved. *
- * *
- * This software is furnished under a license and may be used and *
- * copied only in accordance with the terms of such license and *
- * with the inclusion of the above copyright notice. This *
- * software or any other copies thereof may not be provided or *
- * otherwise made available to any other person. No title to and *
- * ownership of the software is hereby transferred. *
- * *
- * This software is derived from software received from the *
- * University of California, Berkeley, and from Bell *
- * Laboratories. Use, duplication, or disclosure is subject to *
- * restrictions under license agreements with University of *
- * California and with AT&T. *
- * *
- * The information in this software is subject to change without *
- * notice and should not be construed as a commitment by Digital *
- * Equipment Corporation. *
- * *
- * Digital assumes no responsibility for the use or reliability *
- * of its software on equipment which is not supplied by Digital. *
- * *
- ************************************************************************/
-
-/*
- * The following tables are used to translate LK201 key strokes
- * into ascii characters. The tables also support the special
- * function keys.
- */
-
-unsigned short q_key[]={
- 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 0 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 8 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 16 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 24 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 32 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 40 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 48 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 56 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 64 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 72 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x101 ,0x102 /* 80 */
- ,0x103 ,0x104 ,0x105 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 88 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x106 ,0x107 ,0x108 ,0x109 /* 96 */
- ,0x10a ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 104 */
- ,0x00 ,0x1b ,0x08 ,0x0a ,0x10b ,0x00 ,0x00 ,0x00 /* 112 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x10c ,0x10d ,0x00 ,0x00 /* 120 */
- ,0x10e ,0x10f ,0x110 ,0x111 ,0x00 ,0x00 ,0x00 ,0x00 /* 128 */
- ,0x00 ,0x00 ,0x112 ,0x113 ,0x114 ,0x115 ,0x116 ,0x117 /* 136 */
- ,0x00 ,0x00 ,0x120 ,0x00 ,0x121 ,0x122 ,0x123 ,0x124 /* 144 */
- ,0x125 ,0x126 ,0x127 ,0x128 ,0x129 ,0x12a ,0x12b ,0x12c /* 152 */
- ,0x12d ,0x118 ,0x119 ,0x11a ,0x11b ,0x00 ,0x00 ,0x11c /* 160 */
- ,0x11d ,0x11e ,0x11f ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 168 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 176 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x7f ,'\r' ,0x09 ,'`' /* 184 */
- ,'1' ,'q' ,'a' ,'z' ,0x00 ,'2' ,'w' ,'s' /* 192 */
- ,'x' ,'<' ,0x00 ,'3' ,'e' ,'d' ,'c' ,0x00 /* 200 */
- ,'4' ,'r' ,'f' ,'v' ,' ' ,0x00 ,'5' ,'t' /* 208 */
- ,'g' ,'b' ,0x00 ,'6' ,'y' ,'h' ,'n' ,0x00 /* 216 */
- ,'7' ,'u' ,'j' ,'m' ,0x00 ,'8' ,'i' ,'k' /* 224 */
- ,',' ,0x00 ,'9' ,'o' ,'l' ,'.' ,0x00 ,'0' /* 232 */
- ,'p' ,0x00 ,';' ,'/' ,0x00 ,'=' ,']' ,'\\' /* 240 */
- ,0x00 ,'-' ,'[' ,'\'' ,0x00 ,0x00 ,0x00 ,0x00 /* 248 */
-};
-
-unsigned short q_shift_key[]={
- 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 0 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 8 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 16 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 24 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 32 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 40 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 48 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 56 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 64 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 72 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x101 ,0x102 /* 80 */
- ,0x103 ,0x104 ,0x105 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 88 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x106 ,0x107 ,0x108 ,0x109 /* 96 */
- ,0x10a ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 104 */
- ,0x00 ,0x1b ,0x08 ,0x0a ,0x10b ,0x00 ,0x00 ,0x00 /* 112 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x10c ,0x10d ,0x00 ,0x00 /* 120 */
- ,0x10e ,0x10f ,0x110 ,0x111 ,0x00 ,0x00 ,0x00 ,0x00 /* 128 */
- ,0x00 ,0x00 ,0x112 ,0x113 ,0x114 ,0x115 ,0x116 ,0x117 /* 136 */
- ,0x00 ,0x00 ,0x120 ,0x00 ,0x121 ,0x122 ,0x123 ,0x124 /* 144 */
- ,0x125 ,0x126 ,0x127 ,0x128 ,0x129 ,0x12a ,0x12b ,0x12c /* 152 */
- ,0x12d ,0x118 ,0x119 ,0x11a ,0x11b ,0x00 ,0x00 ,0x11c /* 160 */
- ,0x11d ,0x11e ,0x11f ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 168 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 176 */
- ,0x00 ,0x00 ,0x00 ,0x00 ,0x7f ,'\r' ,0x09 ,'~' /* 184 */
- ,'!' ,'Q' ,'A' ,'Z' ,0x00 ,'@' ,'W' ,'S' /* 192 */
- ,'X' ,'>' ,0x00 ,'#' ,'E' ,'D' ,'C' ,0x00 /* 200 */
- ,'$' ,'R' ,'F' ,'V' ,' ' ,0x00 ,'%' ,'T' /* 208 */
- ,'G' ,'B' ,0x00 ,'^' ,'Y' ,'H' ,'N' ,0x00 /* 216 */
- ,'&' ,'U' ,'J' ,'M' ,0x00 ,'*' ,'I' ,'K' /* 224 */
- ,',' ,0x00 ,'(' ,'O' ,'L' ,'.' ,0x00 ,')' /* 232 */
- ,'P' ,0x00 ,':' ,'?' ,0x00 ,'+' ,'}' ,'|' /* 240 */
- ,0x00 ,'_' ,'{' ,'"' ,0x00 ,0x00 ,0x00 ,0x00 /* 248 */
-};
-
-/*
- * LK201 special purpose keys. Translations from the tables above
- * includes codes for the function keys and other goodies. They can
- * be determined by the presence of the 8th bit being set. The
- * following table is accessed by removing that bit and using the
- * result as the index to the following table. Note that table begins
- * a null entry.
- */
-char *q_special[]={ 0,
- "\33[11~", /* f1 */
- "\33[12~", /* f2 */
- "\33[13~", /* f3 */
- "\33[14~", /* f4 */
- "\33[15~", /* f5 */
- "\33[17~", /* f6 */
- "\33[18~", /* f7 */
- "\33[19~", /* f8 */
- "\33[20~", /* f9 */
- "\33[21~", /* f10 */
- "\33[26~", /* f14 */
- "\33[28~", /* f15 */
- "\33[29~", /* f16 */
- "\33[31~", /* f17 */
- "\33[32~", /* f18 */
- "\33[33~", /* f19 */
- "\33[34~", /* f20 */
- "\33[1~", /* find */
- "\33[2~", /* insert */
- "\33[3~", /* remove */
- "\33[4~", /* select */
- "\33[5~", /* prev */
- "\33[6~", /* next */
- "\33OP", /* pf1 */
- "\33OQ", /* pf2 */
- "\33OR", /* pf3 */
- "\33OS", /* pf4 */
- "\33[D", /* left */
- "\33[C", /* right */
- "\33[B", /* down */
- "\33[A", /* up */
- "\33Op", /* key pad 0 */
- "\33On", /* key pad . */
- "\33OM", /* key pad enter */
- "\33Oq", /* key pad 1 */
- "\33Or", /* key pad 2 */
- "\33Os", /* key pad 3 */
- "\33Ot", /* key pad 4 */
- "\33Ou", /* key pad 5 */
- "\33Ov", /* key pad 6 */
- "\33O/*", /* key pad , */
- "\33Ow", /* key pad 7 */
- "\33Ox", /* key pad 8 */
- "\33Oy", /* key pad 9 */
- "\33Om", /* key pad - */
- /*
- * The following strings are to allow a numeric keypad
- * mode and still use the same translation tables
- */
- "0",
- ".",
- "\r",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- ",",
- "7",
- "8",
- "9",
- "-"
-};
-
-
-/*
- * QVSS font table of displayable characters.
- */
-char q_font[]={
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
- 0x00, /* 0x00000000 */
-/* */
- 0x00, /* 0x00000000 ! */
- 0x00, /* 0x00000000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x08, /* 0x00001000 ! */
- 0x00, /* 0x00000000 ! */
- 0x08, /* 0x00001000 ! */
- 0x00, /* 0x00000000 ! */
- 0x00, /* 0x00000000 ! */
- 0x00, /* 0x00000000 ! */
-/* */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x24, /* 0x00100100 " */
- 0x24, /* 0x00100100 " */
- 0x24, /* 0x00100100 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
- 0x00, /* 0x00000000 " */
-/* */
- 0x00, /* 0x00000000 # */
- 0x00, /* 0x00000000 # */
- 0x00, /* 0x00000000 # */
- 0x12, /* 0x00010010 # */
- 0x12, /* 0x00010010 # */
- 0x3f, /* 0x00111111 # */
- 0x12, /* 0x00010010 # */
- 0x12, /* 0x00010010 # */
- 0x3f, /* 0x00111111 # */
- 0x12, /* 0x00010010 # */
- 0x12, /* 0x00010010 # */
- 0x00, /* 0x00000000 # */
- 0x00, /* 0x00000000 # */
- 0x00, /* 0x00000000 # */
- 0x00, /* 0x00000000 # */
-/* */
- 0x00, /* 0x00000000 $ */
- 0x00, /* 0x00000000 $ */
- 0x00, /* 0x00000000 $ */
- 0x08, /* 0x00001000 $ */
- 0x3e, /* 0x00111110 $ */
- 0x09, /* 0x00001001 $ */
- 0x09, /* 0x00001001 $ */
- 0x3e, /* 0x00111110 $ */
- 0x48, /* 0x01001000 $ */
- 0x48, /* 0x01001000 $ */
- 0x3e, /* 0x00111110 $ */
- 0x08, /* 0x00001000 $ */
- 0x00, /* 0x00000000 $ */
- 0x00, /* 0x00000000 $ */
- 0x00, /* 0x00000000 $ */
-/* */
- 0x00, /* 0x00000000 % */
- 0x00, /* 0x00000000 % */
- 0x42, /* 0x01000010 % */
- 0x25, /* 0x00100101 % */
- 0x25, /* 0x00100101 % */
- 0x12, /* 0x00010010 % */
- 0x08, /* 0x00001000 % */
- 0x08, /* 0x00001000 % */
- 0x24, /* 0x00100100 % */
- 0x52, /* 0x01010010 % */
- 0x52, /* 0x01010010 % */
- 0x21, /* 0x00100001 % */
- 0x00, /* 0x00000000 % */
- 0x00, /* 0x00000000 % */
- 0x00, /* 0x00000000 % */
-/* */
- 0x00, /* 0x00000000 & */
- 0x00, /* 0x00000000 & */
- 0x0e, /* 0x00001110 & */
- 0x11, /* 0x00010001 & */
- 0x11, /* 0x00010001 & */
- 0x11, /* 0x00010001 & */
- 0x0e, /* 0x00001110 & */
- 0x11, /* 0x00010001 & */
- 0x51, /* 0x01010001 & */
- 0x21, /* 0x00100001 & */
- 0x31, /* 0x00110001 & */
- 0x4e, /* 0x01001110 & */
- 0x00, /* 0x00000000 & */
- 0x00, /* 0x00000000 & */
- 0x00, /* 0x00000000 & */
-/* */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x38, /* 0x00111000 ' */
- 0x18, /* 0x00011000 ' */
- 0x04, /* 0x00000100 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
- 0x00, /* 0x00000000 ' */
-/* */
- 0x00, /* 0x00000000 ( */
- 0x00, /* 0x00000000 ( */
- 0x10, /* 0x00010000 ( */
- 0x08, /* 0x00001000 ( */
- 0x08, /* 0x00001000 ( */
- 0x04, /* 0x00000100 ( */
- 0x04, /* 0x00000100 ( */
- 0x04, /* 0x00000100 ( */
- 0x04, /* 0x00000100 ( */
- 0x08, /* 0x00001000 ( */
- 0x08, /* 0x00001000 ( */
- 0x10, /* 0x00010000 ( */
- 0x00, /* 0x00000000 ( */
- 0x00, /* 0x00000000 ( */
- 0x00, /* 0x00000000 ( */
-/* */
- 0x00, /* 0x00000000 ) */
- 0x00, /* 0x00000000 ) */
- 0x04, /* 0x00000100 ) */
- 0x08, /* 0x00001000 ) */
- 0x08, /* 0x00001000 ) */
- 0x10, /* 0x00010000 ) */
- 0x10, /* 0x00010000 ) */
- 0x10, /* 0x00010000 ) */
- 0x10, /* 0x00010000 ) */
- 0x08, /* 0x00001000 ) */
- 0x08, /* 0x00001000 ) */
- 0x04, /* 0x00000100 ) */
- 0x00, /* 0x00000000 ) */
- 0x00, /* 0x00000000 ) */
- 0x00, /* 0x00000000 ) */
-/* */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x22, /* 0x00100010 * */
- 0x14, /* 0x00010100 * */
- 0x7f, /* 0x01111111 * */
- 0x14, /* 0x00010100 * */
- 0x22, /* 0x00100010 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
- 0x00, /* 0x00000000 * */
-/* */
- 0x00, /* 0x00000000 + */
- 0x00, /* 0x00000000 + */
- 0x00, /* 0x00000000 + */
- 0x00, /* 0x00000000 + */
- 0x08, /* 0x00001000 + */
- 0x08, /* 0x00001000 + */
- 0x08, /* 0x00001000 + */
- 0x7f, /* 0x01111111 + */
- 0x08, /* 0x00001000 + */
- 0x08, /* 0x00001000 + */
- 0x08, /* 0x00001000 + */
- 0x00, /* 0x00000000 + */
- 0x00, /* 0x00000000 + */
- 0x00, /* 0x00000000 + */
- 0x00, /* 0x00000000 + */
-/* */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
- 0x1c, /* 0x00011100 , */
- 0x0c, /* 0x00001100 , */
- 0x02, /* 0x00000010 , */
- 0x00, /* 0x00000000 , */
- 0x00, /* 0x00000000 , */
-/* */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x7f, /* 0x01111111 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
- 0x00, /* 0x00000000 - */
-/* */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
- 0x08, /* 0x00001000 . */
- 0x1c, /* 0x00011100 . */
- 0x08, /* 0x00001000 . */
- 0x00, /* 0x00000000 . */
- 0x00, /* 0x00000000 . */
-/* */
- 0x00, /* 0x00000000 / */
- 0x00, /* 0x00000000 / */
- 0x40, /* 0x01000000 / */
- 0x40, /* 0x01000000 / */
- 0x20, /* 0x00100000 / */
- 0x10, /* 0x00010000 / */
- 0x08, /* 0x00001000 / */
- 0x04, /* 0x00000100 / */
- 0x02, /* 0x00000010 / */
- 0x01, /* 0x00000001 / */
- 0x01, /* 0x00000001 / */
- 0x01, /* 0x00000001 / */
- 0x00, /* 0x00000000 / */
- 0x00, /* 0x00000000 / */
- 0x00, /* 0x00000000 / */
-/* */
- 0x00, /* 0x00000000 0 */
- 0x00, /* 0x00000000 0 */
- 0x0c, /* 0x00001100 0 */
- 0x12, /* 0x00010010 0 */
- 0x21, /* 0x00100001 0 */
- 0x21, /* 0x00100001 0 */
- 0x21, /* 0x00100001 0 */
- 0x21, /* 0x00100001 0 */
- 0x21, /* 0x00100001 0 */
- 0x21, /* 0x00100001 0 */
- 0x12, /* 0x00010010 0 */
- 0x0c, /* 0x00001100 0 */
- 0x00, /* 0x00000000 0 */
- 0x00, /* 0x00000000 0 */
- 0x00, /* 0x00000000 0 */
-/* */
- 0x00, /* 0x00000000 1 */
- 0x00, /* 0x00000000 1 */
- 0x08, /* 0x00001000 1 */
- 0x0c, /* 0x00001100 1 */
- 0x0a, /* 0x00001010 1 */
- 0x08, /* 0x00001000 1 */
- 0x08, /* 0x00001000 1 */
- 0x08, /* 0x00001000 1 */
- 0x08, /* 0x00001000 1 */
- 0x08, /* 0x00001000 1 */
- 0x08, /* 0x00001000 1 */
- 0x3e, /* 0x00111110 1 */
- 0x00, /* 0x00000000 1 */
- 0x00, /* 0x00000000 1 */
- 0x00, /* 0x00000000 1 */
-/* */
- 0x00, /* 0x00000000 2 */
- 0x00, /* 0x00000000 2 */
- 0x3e, /* 0x00111110 2 */
- 0x41, /* 0x01000001 2 */
- 0x41, /* 0x01000001 2 */
- 0x40, /* 0x01000000 2 */
- 0x20, /* 0x00100000 2 */
- 0x10, /* 0x00010000 2 */
- 0x0c, /* 0x00001100 2 */
- 0x02, /* 0x00000010 2 */
- 0x01, /* 0x00000001 2 */
- 0x7f, /* 0x01111111 2 */
- 0x00, /* 0x00000000 2 */
- 0x00, /* 0x00000000 2 */
- 0x00, /* 0x00000000 2 */
-/* */
- 0x00, /* 0x00000000 3 */
- 0x00, /* 0x00000000 3 */
- 0x7f, /* 0x01111111 3 */
- 0x40, /* 0x01000000 3 */
- 0x20, /* 0x00100000 3 */
- 0x10, /* 0x00010000 3 */
- 0x38, /* 0x00111000 3 */
- 0x40, /* 0x01000000 3 */
- 0x40, /* 0x01000000 3 */
- 0x40, /* 0x01000000 3 */
- 0x41, /* 0x01000001 3 */
- 0x3e, /* 0x00111110 3 */
- 0x00, /* 0x00000000 3 */
- 0x00, /* 0x00000000 3 */
- 0x00, /* 0x00000000 3 */
-/* */
- 0x00, /* 0x00000000 4 */
- 0x00, /* 0x00000000 4 */
- 0x20, /* 0x00100000 4 */
- 0x30, /* 0x00110000 4 */
- 0x28, /* 0x00101000 4 */
- 0x24, /* 0x00100100 4 */
- 0x22, /* 0x00100010 4 */
- 0x21, /* 0x00100001 4 */
- 0x7f, /* 0x01111111 4 */
- 0x20, /* 0x00100000 4 */
- 0x20, /* 0x00100000 4 */
- 0x20, /* 0x00100000 4 */
- 0x00, /* 0x00000000 4 */
- 0x00, /* 0x00000000 4 */
- 0x00, /* 0x00000000 4 */
-/* */
- 0x00, /* 0x00000000 5 */
- 0x00, /* 0x00000000 5 */
- 0x7f, /* 0x01111111 5 */
- 0x01, /* 0x00000001 5 */
- 0x01, /* 0x00000001 5 */
- 0x3d, /* 0x00111101 5 */
- 0x43, /* 0x01000011 5 */
- 0x40, /* 0x01000000 5 */
- 0x40, /* 0x01000000 5 */
- 0x40, /* 0x01000000 5 */
- 0x41, /* 0x01000001 5 */
- 0x3e, /* 0x00111110 5 */
- 0x00, /* 0x00000000 5 */
- 0x00, /* 0x00000000 5 */
- 0x00, /* 0x00000000 5 */
-/* */
- 0x00, /* 0x00000000 6 */
- 0x00, /* 0x00000000 6 */
- 0x3c, /* 0x00111100 6 */
- 0x02, /* 0x00000010 6 */
- 0x01, /* 0x00000001 6 */
- 0x01, /* 0x00000001 6 */
- 0x3d, /* 0x00111101 6 */
- 0x43, /* 0x01000011 6 */
- 0x41, /* 0x01000001 6 */
- 0x41, /* 0x01000001 6 */
- 0x41, /* 0x01000001 6 */
- 0x3e, /* 0x00111110 6 */
- 0x00, /* 0x00000000 6 */
- 0x00, /* 0x00000000 6 */
- 0x00, /* 0x00000000 6 */
-/* */
- 0x00, /* 0x00000000 7 */
- 0x00, /* 0x00000000 7 */
- 0x7f, /* 0x01111111 7 */
- 0x40, /* 0x01000000 7 */
- 0x40, /* 0x01000000 7 */
- 0x20, /* 0x00100000 7 */
- 0x10, /* 0x00010000 7 */
- 0x08, /* 0x00001000 7 */
- 0x04, /* 0x00000100 7 */
- 0x04, /* 0x00000100 7 */
- 0x02, /* 0x00000010 7 */
- 0x02, /* 0x00000010 7 */
- 0x00, /* 0x00000000 7 */
- 0x00, /* 0x00000000 7 */
- 0x00, /* 0x00000000 7 */
-/* */
- 0x00, /* 0x00000000 8 */
- 0x00, /* 0x00000000 8 */
- 0x3e, /* 0x00111110 8 */
- 0x41, /* 0x01000001 8 */
- 0x41, /* 0x01000001 8 */
- 0x41, /* 0x01000001 8 */
- 0x3e, /* 0x00111110 8 */
- 0x41, /* 0x01000001 8 */
- 0x41, /* 0x01000001 8 */
- 0x41, /* 0x01000001 8 */
- 0x41, /* 0x01000001 8 */
- 0x3e, /* 0x00111110 8 */
- 0x00, /* 0x00000000 8 */
- 0x00, /* 0x00000000 8 */
- 0x00, /* 0x00000000 8 */
-/* */
- 0x00, /* 0x00000000 9 */
- 0x00, /* 0x00000000 9 */
- 0x3e, /* 0x00111110 9 */
- 0x41, /* 0x01000001 9 */
- 0x41, /* 0x01000001 9 */
- 0x41, /* 0x01000001 9 */
- 0x61, /* 0x01100001 9 */
- 0x5e, /* 0x01011110 9 */
- 0x40, /* 0x01000000 9 */
- 0x40, /* 0x01000000 9 */
- 0x20, /* 0x00100000 9 */
- 0x1e, /* 0x00011110 9 */
- 0x00, /* 0x00000000 9 */
- 0x00, /* 0x00000000 9 */
- 0x00, /* 0x00000000 9 */
-/* */
- 0x00, /* 0x00000000 : */
- 0x00, /* 0x00000000 : */
- 0x00, /* 0x00000000 : */
- 0x00, /* 0x00000000 : */
- 0x00, /* 0x00000000 : */
- 0x08, /* 0x00001000 : */
- 0x1c, /* 0x00011100 : */
- 0x08, /* 0x00001000 : */
- 0x00, /* 0x00000000 : */
- 0x00, /* 0x00000000 : */
- 0x08, /* 0x00001000 : */
- 0x1c, /* 0x00011100 : */
- 0x08, /* 0x00001000 : */
- 0x00, /* 0x00000000 : */
- 0x00, /* 0x00000000 : */
-/* */
- 0x00, /* 0x00000000 ; */
- 0x00, /* 0x00000000 ; */
- 0x00, /* 0x00000000 ; */
- 0x00, /* 0x00000000 ; */
- 0x00, /* 0x00000000 ; */
- 0x08, /* 0x00001000 ; */
- 0x1c, /* 0x00011100 ; */
- 0x08, /* 0x00001000 ; */
- 0x00, /* 0x00000000 ; */
- 0x00, /* 0x00000000 ; */
- 0x1c, /* 0x00011100 ; */
- 0x0c, /* 0x00001100 ; */
- 0x02, /* 0x00000010 ; */
- 0x00, /* 0x00000000 ; */
- 0x00, /* 0x00000000 ; */
-/* */
- 0x00, /* 0x00000000 < */
- 0x00, /* 0x00000000 < */
- 0x20, /* 0x00100000 < */
- 0x10, /* 0x00010000 < */
- 0x08, /* 0x00001000 < */
- 0x04, /* 0x00000100 < */
- 0x02, /* 0x00000010 < */
- 0x02, /* 0x00000010 < */
- 0x04, /* 0x00000100 < */
- 0x08, /* 0x00001000 < */
- 0x10, /* 0x00010000 < */
- 0x20, /* 0x00100000 < */
- 0x00, /* 0x00000000 < */
- 0x00, /* 0x00000000 < */
- 0x00, /* 0x00000000 < */
-/* */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x7f, /* 0x01111111 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x7f, /* 0x01111111 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
- 0x00, /* 0x00000000 = */
-/* */
- 0x00, /* 0x00000000 > */
- 0x00, /* 0x00000000 > */
- 0x02, /* 0x00000010 > */
- 0x04, /* 0x00000100 > */
- 0x08, /* 0x00001000 > */
- 0x10, /* 0x00010000 > */
- 0x20, /* 0x00100000 > */
- 0x20, /* 0x00100000 > */
- 0x10, /* 0x00010000 > */
- 0x08, /* 0x00001000 > */
- 0x04, /* 0x00000100 > */
- 0x02, /* 0x00000010 > */
- 0x00, /* 0x00000000 > */
- 0x00, /* 0x00000000 > */
- 0x00, /* 0x00000000 > */
-/* */
- 0x00, /* 0x00000000 ? */
- 0x00, /* 0x00000000 ? */
- 0x3e, /* 0x00111110 ? */
- 0x41, /* 0x01000001 ? */
- 0x41, /* 0x01000001 ? */
- 0x40, /* 0x01000000 ? */
- 0x20, /* 0x00100000 ? */
- 0x10, /* 0x00010000 ? */
- 0x08, /* 0x00001000 ? */
- 0x08, /* 0x00001000 ? */
- 0x00, /* 0x00000000 ? */
- 0x08, /* 0x00001000 ? */
- 0x00, /* 0x00000000 ? */
- 0x00, /* 0x00000000 ? */
- 0x00, /* 0x00000000 ? */
-/* */
- 0x00, /* 0x00000000 @ */
- 0x00, /* 0x00000000 @ */
- 0x3e, /* 0x00111110 @ */
- 0x41, /* 0x01000001 @ */
- 0x41, /* 0x01000001 @ */
- 0x79, /* 0x01111001 @ */
- 0x45, /* 0x01000101 @ */
- 0x65, /* 0x01100101 @ */
- 0x59, /* 0x01011001 @ */
- 0x01, /* 0x00000001 @ */
- 0x01, /* 0x00000001 @ */
- 0x3e, /* 0x00111110 @ */
- 0x00, /* 0x00000000 @ */
- 0x00, /* 0x00000000 @ */
- 0x00, /* 0x00000000 @ */
-/* */
- 0x00, /* 0x00000000 A */
- 0x00, /* 0x00000000 A */
- 0x08, /* 0x00001000 A */
- 0x14, /* 0x00010100 A */
- 0x22, /* 0x00100010 A */
- 0x41, /* 0x01000001 A */
- 0x41, /* 0x01000001 A */
- 0x41, /* 0x01000001 A */
- 0x7f, /* 0x01111111 A */
- 0x41, /* 0x01000001 A */
- 0x41, /* 0x01000001 A */
- 0x41, /* 0x01000001 A */
- 0x00, /* 0x00000000 A */
- 0x00, /* 0x00000000 A */
- 0x00, /* 0x00000000 A */
-/* */
- 0x00, /* 0x00000000 B */
- 0x00, /* 0x00000000 B */
- 0x3f, /* 0x00111111 B */
- 0x42, /* 0x01000010 B */
- 0x42, /* 0x01000010 B */
- 0x42, /* 0x01000010 B */
- 0x3e, /* 0x00111110 B */
- 0x42, /* 0x01000010 B */
- 0x42, /* 0x01000010 B */
- 0x42, /* 0x01000010 B */
- 0x42, /* 0x01000010 B */
- 0x3f, /* 0x00111111 B */
- 0x00, /* 0x00000000 B */
- 0x00, /* 0x00000000 B */
- 0x00, /* 0x00000000 B */
-/* */
- 0x00, /* 0x00000000 C */
- 0x00, /* 0x00000000 C */
- 0x3e, /* 0x00111110 C */
- 0x41, /* 0x01000001 C */
- 0x01, /* 0x00000001 C */
- 0x01, /* 0x00000001 C */
- 0x01, /* 0x00000001 C */
- 0x01, /* 0x00000001 C */
- 0x01, /* 0x00000001 C */
- 0x01, /* 0x00000001 C */
- 0x41, /* 0x01000001 C */
- 0x3e, /* 0x00111110 C */
- 0x00, /* 0x00000000 C */
- 0x00, /* 0x00000000 C */
- 0x00, /* 0x00000000 C */
-/* */
- 0x00, /* 0x00000000 D */
- 0x00, /* 0x00000000 D */
- 0x3f, /* 0x00111111 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x42, /* 0x01000010 D */
- 0x3f, /* 0x00111111 D */
- 0x00, /* 0x00000000 D */
- 0x00, /* 0x00000000 D */
- 0x00, /* 0x00000000 D */
-/* */
- 0x00, /* 0x00000000 E */
- 0x00, /* 0x00000000 E */
- 0x7e, /* 0x01111110 E */
- 0x02, /* 0x00000010 E */
- 0x02, /* 0x00000010 E */
- 0x02, /* 0x00000010 E */
- 0x1e, /* 0x00011110 E */
- 0x02, /* 0x00000010 E */
- 0x02, /* 0x00000010 E */
- 0x02, /* 0x00000010 E */
- 0x02, /* 0x00000010 E */
- 0x7e, /* 0x01111110 E */
- 0x00, /* 0x00000000 E */
- 0x00, /* 0x00000000 E */
- 0x00, /* 0x00000000 E */
-/* */
- 0x00, /* 0x00000000 F */
- 0x00, /* 0x00000000 F */
- 0x7e, /* 0x01111110 F */
- 0x02, /* 0x00000010 F */
- 0x02, /* 0x00000010 F */
- 0x02, /* 0x00000010 F */
- 0x1e, /* 0x00011110 F */
- 0x02, /* 0x00000010 F */
- 0x02, /* 0x00000010 F */
- 0x02, /* 0x00000010 F */
- 0x02, /* 0x00000010 F */
- 0x02, /* 0x00000010 F */
- 0x00, /* 0x00000000 F */
- 0x00, /* 0x00000000 F */
- 0x00, /* 0x00000000 F */
-/* */
- 0x00, /* 0x00000000 G */
- 0x00, /* 0x00000000 G */
- 0x3e, /* 0x00111110 G */
- 0x41, /* 0x01000001 G */
- 0x01, /* 0x00000001 G */
- 0x01, /* 0x00000001 G */
- 0x01, /* 0x00000001 G */
- 0x71, /* 0x01110001 G */
- 0x41, /* 0x01000001 G */
- 0x41, /* 0x01000001 G */
- 0x41, /* 0x01000001 G */
- 0x3e, /* 0x00111110 G */
- 0x00, /* 0x00000000 G */
- 0x00, /* 0x00000000 G */
- 0x00, /* 0x00000000 G */
-/* */
- 0x00, /* 0x00000000 H */
- 0x00, /* 0x00000000 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x7f, /* 0x01111111 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x41, /* 0x01000001 H */
- 0x00, /* 0x00000000 H */
- 0x00, /* 0x00000000 H */
- 0x00, /* 0x00000000 H */
-/* */
- 0x00, /* 0x00000000 I */
- 0x00, /* 0x00000000 I */
- 0x3e, /* 0x00111110 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x08, /* 0x00001000 I */
- 0x3e, /* 0x00111110 I */
- 0x00, /* 0x00000000 I */
- 0x00, /* 0x00000000 I */
- 0x00, /* 0x00000000 I */
-/* */
- 0x00, /* 0x00000000 J */
- 0x00, /* 0x00000000 J */
- 0x78, /* 0x01111000 J */
- 0x20, /* 0x00100000 J */
- 0x20, /* 0x00100000 J */
- 0x20, /* 0x00100000 J */
- 0x20, /* 0x00100000 J */
- 0x20, /* 0x00100000 J */
- 0x20, /* 0x00100000 J */
- 0x20, /* 0x00100000 J */
- 0x21, /* 0x00100001 J */
- 0x1e, /* 0x00011110 J */
- 0x00, /* 0x00000000 J */
- 0x00, /* 0x00000000 J */
- 0x00, /* 0x00000000 J */
-/* */
- 0x00, /* 0x00000000 K */
- 0x00, /* 0x00000000 K */
- 0x41, /* 0x01000001 K */
- 0x21, /* 0x00100001 K */
- 0x11, /* 0x00010001 K */
- 0x09, /* 0x00001001 K */
- 0x07, /* 0x00000111 K */
- 0x05, /* 0x00000101 K */
- 0x09, /* 0x00001001 K */
- 0x11, /* 0x00010001 K */
- 0x21, /* 0x00100001 K */
- 0x41, /* 0x01000001 K */
- 0x00, /* 0x00000000 K */
- 0x00, /* 0x00000000 K */
- 0x00, /* 0x00000000 K */
-/* */
- 0x00, /* 0x00000000 L */
- 0x00, /* 0x00000000 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x01, /* 0x00000001 L */
- 0x7f, /* 0x01111111 L */
- 0x00, /* 0x00000000 L */
- 0x00, /* 0x00000000 L */
- 0x00, /* 0x00000000 L */
-/* */
- 0x00, /* 0x00000000 M */
- 0x00, /* 0x00000000 M */
- 0x41, /* 0x01000001 M */
- 0x41, /* 0x01000001 M */
- 0x63, /* 0x01100011 M */
- 0x55, /* 0x01010101 M */
- 0x55, /* 0x01010101 M */
- 0x49, /* 0x01001001 M */
- 0x49, /* 0x01001001 M */
- 0x41, /* 0x01000001 M */
- 0x41, /* 0x01000001 M */
- 0x41, /* 0x01000001 M */
- 0x00, /* 0x00000000 M */
- 0x00, /* 0x00000000 M */
- 0x00, /* 0x00000000 M */
-/* */
- 0x00, /* 0x00000000 N */
- 0x00, /* 0x00000000 N */
- 0x41, /* 0x01000001 N */
- 0x41, /* 0x01000001 N */
- 0x43, /* 0x01000011 N */
- 0x45, /* 0x01000101 N */
- 0x49, /* 0x01001001 N */
- 0x51, /* 0x01010001 N */
- 0x61, /* 0x01100001 N */
- 0x41, /* 0x01000001 N */
- 0x41, /* 0x01000001 N */
- 0x41, /* 0x01000001 N */
- 0x00, /* 0x00000000 N */
- 0x00, /* 0x00000000 N */
- 0x00, /* 0x00000000 N */
-/* */
- 0x00, /* 0x00000000 O */
- 0x00, /* 0x00000000 O */
- 0x3e, /* 0x00111110 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x41, /* 0x01000001 O */
- 0x3e, /* 0x00111110 O */
- 0x00, /* 0x00000000 O */
- 0x00, /* 0x00000000 O */
- 0x00, /* 0x00000000 O */
-/* */
- 0x00, /* 0x00000000 P */
- 0x00, /* 0x00000000 P */
- 0x3f, /* 0x00111111 P */
- 0x41, /* 0x01000001 P */
- 0x41, /* 0x01000001 P */
- 0x41, /* 0x01000001 P */
- 0x3f, /* 0x00111111 P */
- 0x01, /* 0x00000001 P */
- 0x01, /* 0x00000001 P */
- 0x01, /* 0x00000001 P */
- 0x01, /* 0x00000001 P */
- 0x01, /* 0x00000001 P */
- 0x00, /* 0x00000000 P */
- 0x00, /* 0x00000000 P */
- 0x00, /* 0x00000000 P */
-/* */
- 0x00, /* 0x00000000 Q */
- 0x00, /* 0x00000000 Q */
- 0x3e, /* 0x00111110 Q */
- 0x41, /* 0x01000001 Q */
- 0x41, /* 0x01000001 Q */
- 0x41, /* 0x01000001 Q */
- 0x41, /* 0x01000001 Q */
- 0x41, /* 0x01000001 Q */
- 0x41, /* 0x01000001 Q */
- 0x49, /* 0x01001001 Q */
- 0x51, /* 0x01010001 Q */
- 0x3e, /* 0x00111110 Q */
- 0x40, /* 0x01000000 Q */
- 0x00, /* 0x00000000 Q */
- 0x00, /* 0x00000000 Q */
-/* */
- 0x00, /* 0x00000000 R */
- 0x00, /* 0x00000000 R */
- 0x3f, /* 0x00111111 R */
- 0x41, /* 0x01000001 R */
- 0x41, /* 0x01000001 R */
- 0x41, /* 0x01000001 R */
- 0x3f, /* 0x00111111 R */
- 0x09, /* 0x00001001 R */
- 0x11, /* 0x00010001 R */
- 0x21, /* 0x00100001 R */
- 0x41, /* 0x01000001 R */
- 0x41, /* 0x01000001 R */
- 0x00, /* 0x00000000 R */
- 0x00, /* 0x00000000 R */
- 0x00, /* 0x00000000 R */
-/* */
- 0x00, /* 0x00000000 S */
- 0x00, /* 0x00000000 S */
- 0x3e, /* 0x00111110 S */
- 0x41, /* 0x01000001 S */
- 0x01, /* 0x00000001 S */
- 0x01, /* 0x00000001 S */
- 0x3e, /* 0x00111110 S */
- 0x40, /* 0x01000000 S */
- 0x40, /* 0x01000000 S */
- 0x40, /* 0x01000000 S */
- 0x41, /* 0x01000001 S */
- 0x3e, /* 0x00111110 S */
- 0x00, /* 0x00000000 S */
- 0x00, /* 0x00000000 S */
- 0x00, /* 0x00000000 S */
-/* */
- 0x00, /* 0x00000000 T */
- 0x00, /* 0x00000000 T */
- 0x7f, /* 0x01111111 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x08, /* 0x00001000 T */
- 0x00, /* 0x00000000 T */
- 0x00, /* 0x00000000 T */
- 0x00, /* 0x00000000 T */
-/* */
- 0x00, /* 0x00000000 U */
- 0x00, /* 0x00000000 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x41, /* 0x01000001 U */
- 0x3e, /* 0x00111110 U */
- 0x00, /* 0x00000000 U */
- 0x00, /* 0x00000000 U */
- 0x00, /* 0x00000000 U */
-/* */
- 0x00, /* 0x00000000 V */
- 0x00, /* 0x00000000 V */
- 0x41, /* 0x01000001 V */
- 0x41, /* 0x01000001 V */
- 0x41, /* 0x01000001 V */
- 0x22, /* 0x00100010 V */
- 0x22, /* 0x00100010 V */
- 0x22, /* 0x00100010 V */
- 0x14, /* 0x00010100 V */
- 0x14, /* 0x00010100 V */
- 0x14, /* 0x00010100 V */
- 0x08, /* 0x00001000 V */
- 0x00, /* 0x00000000 V */
- 0x00, /* 0x00000000 V */
- 0x00, /* 0x00000000 V */
-/* */
- 0x00, /* 0x00000000 W */
- 0x00, /* 0x00000000 W */
- 0x41, /* 0x01000001 W */
- 0x41, /* 0x01000001 W */
- 0x41, /* 0x01000001 W */
- 0x41, /* 0x01000001 W */
- 0x49, /* 0x01001001 W */
- 0x49, /* 0x01001001 W */
- 0x49, /* 0x01001001 W */
- 0x49, /* 0x01001001 W */
- 0x55, /* 0x01010101 W */
- 0x22, /* 0x00100010 W */
- 0x00, /* 0x00000000 W */
- 0x00, /* 0x00000000 W */
- 0x00, /* 0x00000000 W */
-/* */
- 0x00, /* 0x00000000 X */
- 0x00, /* 0x00000000 X */
- 0x41, /* 0x01000001 X */
- 0x41, /* 0x01000001 X */
- 0x22, /* 0x00100010 X */
- 0x14, /* 0x00010100 X */
- 0x08, /* 0x00001000 X */
- 0x08, /* 0x00001000 X */
- 0x14, /* 0x00010100 X */
- 0x22, /* 0x00100010 X */
- 0x41, /* 0x01000001 X */
- 0x41, /* 0x01000001 X */
- 0x00, /* 0x00000000 X */
- 0x00, /* 0x00000000 X */
- 0x00, /* 0x00000000 X */
-/* */
- 0x00, /* 0x00000000 Y */
- 0x00, /* 0x00000000 Y */
- 0x41, /* 0x01000001 Y */
- 0x41, /* 0x01000001 Y */
- 0x22, /* 0x00100010 Y */
- 0x14, /* 0x00010100 Y */
- 0x08, /* 0x00001000 Y */
- 0x08, /* 0x00001000 Y */
- 0x08, /* 0x00001000 Y */
- 0x08, /* 0x00001000 Y */
- 0x08, /* 0x00001000 Y */
- 0x08, /* 0x00001000 Y */
- 0x00, /* 0x00000000 Y */
- 0x00, /* 0x00000000 Y */
- 0x00, /* 0x00000000 Y */
-/* */
- 0x00, /* 0x00000000 Z */
- 0x00, /* 0x00000000 Z */
- 0x7f, /* 0x01111111 Z */
- 0x40, /* 0x01000000 Z */
- 0x20, /* 0x00100000 Z */
- 0x10, /* 0x00010000 Z */
- 0x08, /* 0x00001000 Z */
- 0x04, /* 0x00000100 Z */
- 0x02, /* 0x00000010 Z */
- 0x01, /* 0x00000001 Z */
- 0x01, /* 0x00000001 Z */
- 0x7f, /* 0x01111111 Z */
- 0x00, /* 0x00000000 Z */
- 0x00, /* 0x00000000 Z */
- 0x00, /* 0x00000000 Z */
-/* */
- 0x00, /* 0x00000000 [ */
- 0x00, /* 0x00000000 [ */
- 0x3c, /* 0x00111100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x04, /* 0x00000100 [ */
- 0x3c, /* 0x00111100 [ */
- 0x00, /* 0x00000000 [ */
- 0x00, /* 0x00000000 [ */
- 0x00, /* 0x00000000 [ */
-/* */
- 0x00, /* 0x00000000 \ */
- 0x00, /* 0x00000000 \ */
- 0x01, /* 0x00000001 \ */
- 0x02, /* 0x00000010 \ */
- 0x02, /* 0x00000010 \ */
- 0x04, /* 0x00000100 \ */
- 0x08, /* 0x00001000 \ */
- 0x08, /* 0x00001000 \ */
- 0x10, /* 0x00010000 \ */
- 0x20, /* 0x00100000 \ */
- 0x20, /* 0x00100000 \ */
- 0x40, /* 0x01000000 \ */
- 0x00, /* 0x00000000 \ */
- 0x00, /* 0x00000000 \ */
- 0x00, /* 0x00000000 \ */
-/* */
- 0x00, /* 0x00000000 ] */
- 0x00, /* 0x00000000 ] */
- 0x1e, /* 0x00011110 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x10, /* 0x00010000 ] */
- 0x1e, /* 0x00011110 ] */
- 0x00, /* 0x00000000 ] */
- 0x00, /* 0x00000000 ] */
- 0x00, /* 0x00000000 ] */
-/* */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x08, /* 0x00001000 ^ */
- 0x14, /* 0x00010100 ^ */
- 0x22, /* 0x00100010 ^ */
- 0x41, /* 0x01000001 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
- 0x00, /* 0x00000000 ^ */
-/* */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
- 0x7f, /* 0x01111111 _ */
- 0x00, /* 0x00000000 _ */
- 0x00, /* 0x00000000 _ */
-/* */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x0e, /* 0x00001110 ` */
- 0x0c, /* 0x00001100 ` */
- 0x10, /* 0x00010000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
- 0x00, /* 0x00000000 ` */
-/* */
- 0x00, /* 0x00000000 a */
- 0x00, /* 0x00000000 a */
- 0x00, /* 0x00000000 a */
- 0x00, /* 0x00000000 a */
- 0x00, /* 0x00000000 a */
- 0x3e, /* 0x00111110 a */
- 0x40, /* 0x01000000 a */
- 0x40, /* 0x01000000 a */
- 0x7e, /* 0x01111110 a */
- 0x41, /* 0x01000001 a */
- 0x61, /* 0x01100001 a */
- 0x5e, /* 0x01011110 a */
- 0x00, /* 0x00000000 a */
- 0x00, /* 0x00000000 a */
- 0x00, /* 0x00000000 a */
-/* */
- 0x00, /* 0x00000000 b */
- 0x00, /* 0x00000000 b */
- 0x01, /* 0x00000001 b */
- 0x01, /* 0x00000001 b */
- 0x01, /* 0x00000001 b */
- 0x3d, /* 0x00111101 b */
- 0x43, /* 0x01000011 b */
- 0x41, /* 0x01000001 b */
- 0x41, /* 0x01000001 b */
- 0x41, /* 0x01000001 b */
- 0x43, /* 0x01000011 b */
- 0x3d, /* 0x00111101 b */
- 0x00, /* 0x00000000 b */
- 0x00, /* 0x00000000 b */
- 0x00, /* 0x00000000 b */
-/* */
- 0x00, /* 0x00000000 c */
- 0x00, /* 0x00000000 c */
- 0x00, /* 0x00000000 c */
- 0x00, /* 0x00000000 c */
- 0x00, /* 0x00000000 c */
- 0x3e, /* 0x00111110 c */
- 0x41, /* 0x01000001 c */
- 0x01, /* 0x00000001 c */
- 0x01, /* 0x00000001 c */
- 0x01, /* 0x00000001 c */
- 0x41, /* 0x01000001 c */
- 0x3e, /* 0x00111110 c */
- 0x00, /* 0x00000000 c */
- 0x00, /* 0x00000000 c */
- 0x00, /* 0x00000000 c */
-/* */
- 0x00, /* 0x00000000 d */
- 0x00, /* 0x00000000 d */
- 0x40, /* 0x01000000 d */
- 0x40, /* 0x01000000 d */
- 0x40, /* 0x01000000 d */
- 0x5e, /* 0x01011110 d */
- 0x61, /* 0x01100001 d */
- 0x41, /* 0x01000001 d */
- 0x41, /* 0x01000001 d */
- 0x41, /* 0x01000001 d */
- 0x61, /* 0x01100001 d */
- 0x5e, /* 0x01011110 d */
- 0x00, /* 0x00000000 d */
- 0x00, /* 0x00000000 d */
- 0x00, /* 0x00000000 d */
-/* */
- 0x00, /* 0x00000000 e */
- 0x00, /* 0x00000000 e */
- 0x00, /* 0x00000000 e */
- 0x00, /* 0x00000000 e */
- 0x00, /* 0x00000000 e */
- 0x3e, /* 0x00111110 e */
- 0x41, /* 0x01000001 e */
- 0x41, /* 0x01000001 e */
- 0x7f, /* 0x01111111 e */
- 0x01, /* 0x00000001 e */
- 0x01, /* 0x00000001 e */
- 0x3e, /* 0x00111110 e */
- 0x00, /* 0x00000000 e */
- 0x00, /* 0x00000000 e */
- 0x00, /* 0x00000000 e */
-/* */
- 0x00, /* 0x00000000 f */
- 0x00, /* 0x00000000 f */
- 0x38, /* 0x00111000 f */
- 0x44, /* 0x01000100 f */
- 0x44, /* 0x01000100 f */
- 0x04, /* 0x00000100 f */
- 0x04, /* 0x00000100 f */
- 0x1f, /* 0x00011111 f */
- 0x04, /* 0x00000100 f */
- 0x04, /* 0x00000100 f */
- 0x04, /* 0x00000100 f */
- 0x04, /* 0x00000100 f */
- 0x00, /* 0x00000000 f */
- 0x00, /* 0x00000000 f */
- 0x00, /* 0x00000000 f */
-/* */
- 0x00, /* 0x00000000 g */
- 0x00, /* 0x00000000 g */
- 0x00, /* 0x00000000 g */
- 0x00, /* 0x00000000 g */
- 0x00, /* 0x00000000 g */
- 0x5e, /* 0x01011110 g */
- 0x21, /* 0x00100001 g */
- 0x21, /* 0x00100001 g */
- 0x21, /* 0x00100001 g */
- 0x1e, /* 0x00011110 g */
- 0x01, /* 0x00000001 g */
- 0x3e, /* 0x00111110 g */
- 0x41, /* 0x01000001 g */
- 0x41, /* 0x01000001 g */
- 0x3e, /* 0x00111110 g */
-/* */
- 0x00, /* 0x00000000 h */
- 0x00, /* 0x00000000 h */
- 0x01, /* 0x00000001 h */
- 0x01, /* 0x00000001 h */
- 0x01, /* 0x00000001 h */
- 0x3d, /* 0x00111101 h */
- 0x43, /* 0x01000011 h */
- 0x41, /* 0x01000001 h */
- 0x41, /* 0x01000001 h */
- 0x41, /* 0x01000001 h */
- 0x41, /* 0x01000001 h */
- 0x41, /* 0x01000001 h */
- 0x00, /* 0x00000000 h */
- 0x00, /* 0x00000000 h */
- 0x00, /* 0x00000000 h */
-/* */
- 0x00, /* 0x00000000 i */
- 0x00, /* 0x00000000 i */
- 0x00, /* 0x00000000 i */
- 0x08, /* 0x00001000 i */
- 0x00, /* 0x00000000 i */
- 0x0c, /* 0x00001100 i */
- 0x08, /* 0x00001000 i */
- 0x08, /* 0x00001000 i */
- 0x08, /* 0x00001000 i */
- 0x08, /* 0x00001000 i */
- 0x08, /* 0x00001000 i */
- 0x3e, /* 0x00111110 i */
- 0x00, /* 0x00000000 i */
- 0x00, /* 0x00000000 i */
- 0x00, /* 0x00000000 i */
-/* */
- 0x00, /* 0x00000000 j */
- 0x00, /* 0x00000000 j */
- 0x00, /* 0x00000000 j */
- 0x20, /* 0x00100000 j */
- 0x00, /* 0x00000000 j */
- 0x38, /* 0x00111000 j */
- 0x20, /* 0x00100000 j */
- 0x20, /* 0x00100000 j */
- 0x20, /* 0x00100000 j */
- 0x20, /* 0x00100000 j */
- 0x20, /* 0x00100000 j */
- 0x21, /* 0x00100001 j */
- 0x21, /* 0x00100001 j */
- 0x21, /* 0x00100001 j */
- 0x1e, /* 0x00011110 j */
-/* */
- 0x00, /* 0x00000000 k */
- 0x00, /* 0x00000000 k */
- 0x01, /* 0x00000001 k */
- 0x01, /* 0x00000001 k */
- 0x01, /* 0x00000001 k */
- 0x41, /* 0x01000001 k */
- 0x31, /* 0x00110001 k */
- 0x0d, /* 0x00001101 k */
- 0x03, /* 0x00000011 k */
- 0x0d, /* 0x00001101 k */
- 0x31, /* 0x00110001 k */
- 0x41, /* 0x01000001 k */
- 0x00, /* 0x00000000 k */
- 0x00, /* 0x00000000 k */
- 0x00, /* 0x00000000 k */
-/* */
- 0x00, /* 0x00000000 l */
- 0x00, /* 0x00000000 l */
- 0x0c, /* 0x00001100 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x08, /* 0x00001000 l */
- 0x3e, /* 0x00111110 l */
- 0x00, /* 0x00000000 l */
- 0x00, /* 0x00000000 l */
- 0x00, /* 0x00000000 l */
-/* */
- 0x00, /* 0x00000000 m */
- 0x00, /* 0x00000000 m */
- 0x00, /* 0x00000000 m */
- 0x00, /* 0x00000000 m */
- 0x00, /* 0x00000000 m */
- 0x37, /* 0x00110111 m */
- 0x49, /* 0x01001001 m */
- 0x49, /* 0x01001001 m */
- 0x49, /* 0x01001001 m */
- 0x49, /* 0x01001001 m */
- 0x49, /* 0x01001001 m */
- 0x41, /* 0x01000001 m */
- 0x00, /* 0x00000000 m */
- 0x00, /* 0x00000000 m */
- 0x00, /* 0x00000000 m */
-/* */
- 0x00, /* 0x00000000 n */
- 0x00, /* 0x00000000 n */
- 0x00, /* 0x00000000 n */
- 0x00, /* 0x00000000 n */
- 0x00, /* 0x00000000 n */
- 0x3d, /* 0x00111101 n */
- 0x43, /* 0x01000011 n */
- 0x41, /* 0x01000001 n */
- 0x41, /* 0x01000001 n */
- 0x41, /* 0x01000001 n */
- 0x41, /* 0x01000001 n */
- 0x41, /* 0x01000001 n */
- 0x00, /* 0x00000000 n */
- 0x00, /* 0x00000000 n */
- 0x00, /* 0x00000000 n */
-/* */
- 0x00, /* 0x00000000 o */
- 0x00, /* 0x00000000 o */
- 0x00, /* 0x00000000 o */
- 0x00, /* 0x00000000 o */
- 0x00, /* 0x00000000 o */
- 0x3e, /* 0x00111110 o */
- 0x41, /* 0x01000001 o */
- 0x41, /* 0x01000001 o */
- 0x41, /* 0x01000001 o */
- 0x41, /* 0x01000001 o */
- 0x41, /* 0x01000001 o */
- 0x3e, /* 0x00111110 o */
- 0x00, /* 0x00000000 o */
- 0x00, /* 0x00000000 o */
- 0x00, /* 0x00000000 o */
-/* */
- 0x00, /* 0x00000000 p */
- 0x00, /* 0x00000000 p */
- 0x00, /* 0x00000000 p */
- 0x00, /* 0x00000000 p */
- 0x00, /* 0x00000000 p */
- 0x3d, /* 0x00111101 p */
- 0x43, /* 0x01000011 p */
- 0x41, /* 0x01000001 p */
- 0x41, /* 0x01000001 p */
- 0x41, /* 0x01000001 p */
- 0x43, /* 0x01000011 p */
- 0x3d, /* 0x00111101 p */
- 0x01, /* 0x00000001 p */
- 0x01, /* 0x00000001 p */
- 0x01, /* 0x00000001 p */
-/* */
- 0x00, /* 0x00000000 q */
- 0x00, /* 0x00000000 q */
- 0x00, /* 0x00000000 q */
- 0x00, /* 0x00000000 q */
- 0x00, /* 0x00000000 q */
- 0x5e, /* 0x01011110 q */
- 0x61, /* 0x01100001 q */
- 0x41, /* 0x01000001 q */
- 0x41, /* 0x01000001 q */
- 0x41, /* 0x01000001 q */
- 0x61, /* 0x01100001 q */
- 0x5e, /* 0x01011110 q */
- 0x40, /* 0x01000000 q */
- 0x40, /* 0x01000000 q */
- 0x40, /* 0x01000000 q */
-/* */
- 0x00, /* 0x00000000 r */
- 0x00, /* 0x00000000 r */
- 0x00, /* 0x00000000 r */
- 0x00, /* 0x00000000 r */
- 0x00, /* 0x00000000 r */
- 0x39, /* 0x00111001 r */
- 0x46, /* 0x01000110 r */
- 0x42, /* 0x01000010 r */
- 0x02, /* 0x00000010 r */
- 0x02, /* 0x00000010 r */
- 0x02, /* 0x00000010 r */
- 0x02, /* 0x00000010 r */
- 0x00, /* 0x00000000 r */
- 0x00, /* 0x00000000 r */
- 0x00, /* 0x00000000 r */
-/* */
- 0x00, /* 0x00000000 s */
- 0x00, /* 0x00000000 s */
- 0x00, /* 0x00000000 s */
- 0x00, /* 0x00000000 s */
- 0x00, /* 0x00000000 s */
- 0x3e, /* 0x00111110 s */
- 0x41, /* 0x01000001 s */
- 0x01, /* 0x00000001 s */
- 0x3e, /* 0x00111110 s */
- 0x40, /* 0x01000000 s */
- 0x41, /* 0x01000001 s */
- 0x3e, /* 0x00111110 s */
- 0x00, /* 0x00000000 s */
- 0x00, /* 0x00000000 s */
- 0x00, /* 0x00000000 s */
-/* */
- 0x00, /* 0x00000000 t */
- 0x00, /* 0x00000000 t */
- 0x00, /* 0x00000000 t */
- 0x04, /* 0x00000100 t */
- 0x04, /* 0x00000100 t */
- 0x3f, /* 0x00111111 t */
- 0x04, /* 0x00000100 t */
- 0x04, /* 0x00000100 t */
- 0x04, /* 0x00000100 t */
- 0x04, /* 0x00000100 t */
- 0x44, /* 0x01000100 t */
- 0x38, /* 0x00111000 t */
- 0x00, /* 0x00000000 t */
- 0x00, /* 0x00000000 t */
- 0x00, /* 0x00000000 t */
-/* */
- 0x00, /* 0x00000000 u */
- 0x00, /* 0x00000000 u */
- 0x00, /* 0x00000000 u */
- 0x00, /* 0x00000000 u */
- 0x00, /* 0x00000000 u */
- 0x21, /* 0x00100001 u */
- 0x21, /* 0x00100001 u */
- 0x21, /* 0x00100001 u */
- 0x21, /* 0x00100001 u */
- 0x21, /* 0x00100001 u */
- 0x21, /* 0x00100001 u */
- 0x5e, /* 0x01011110 u */
- 0x00, /* 0x00000000 u */
- 0x00, /* 0x00000000 u */
- 0x00, /* 0x00000000 u */
-/* */
- 0x00, /* 0x00000000 v */
- 0x00, /* 0x00000000 v */
- 0x00, /* 0x00000000 v */
- 0x00, /* 0x00000000 v */
- 0x00, /* 0x00000000 v */
- 0x41, /* 0x01000001 v */
- 0x41, /* 0x01000001 v */
- 0x22, /* 0x00100010 v */
- 0x22, /* 0x00100010 v */
- 0x14, /* 0x00010100 v */
- 0x14, /* 0x00010100 v */
- 0x08, /* 0x00001000 v */
- 0x00, /* 0x00000000 v */
- 0x00, /* 0x00000000 v */
- 0x00, /* 0x00000000 v */
-/* */
- 0x00, /* 0x00000000 w */
- 0x00, /* 0x00000000 w */
- 0x00, /* 0x00000000 w */
- 0x00, /* 0x00000000 w */
- 0x00, /* 0x00000000 w */
- 0x41, /* 0x01000001 w */
- 0x41, /* 0x01000001 w */
- 0x49, /* 0x01001001 w */
- 0x49, /* 0x01001001 w */
- 0x49, /* 0x01001001 w */
- 0x55, /* 0x01010101 w */
- 0x22, /* 0x00100010 w */
- 0x00, /* 0x00000000 w */
- 0x00, /* 0x00000000 w */
- 0x00, /* 0x00000000 w */
-/* */
- 0x00, /* 0x00000000 x */
- 0x00, /* 0x00000000 x */
- 0x00, /* 0x00000000 x */
- 0x00, /* 0x00000000 x */
- 0x00, /* 0x00000000 x */
- 0x41, /* 0x01000001 x */
- 0x22, /* 0x00100010 x */
- 0x14, /* 0x00010100 x */
- 0x08, /* 0x00001000 x */
- 0x14, /* 0x00010100 x */
- 0x22, /* 0x00100010 x */
- 0x41, /* 0x01000001 x */
- 0x00, /* 0x00000000 x */
- 0x00, /* 0x00000000 x */
- 0x00, /* 0x00000000 x */
-/* */
- 0x00, /* 0x00000000 y */
- 0x00, /* 0x00000000 y */
- 0x00, /* 0x00000000 y */
- 0x00, /* 0x00000000 y */
- 0x00, /* 0x00000000 y */
- 0x21, /* 0x00100001 y */
- 0x21, /* 0x00100001 y */
- 0x21, /* 0x00100001 y */
- 0x21, /* 0x00100001 y */
- 0x21, /* 0x00100001 y */
- 0x31, /* 0x00110001 y */
- 0x2e, /* 0x00101110 y */
- 0x20, /* 0x00100000 y */
- 0x21, /* 0x00100001 y */
- 0x1e, /* 0x00011110 y */
-/* */
- 0x00, /* 0x00000000 z */
- 0x00, /* 0x00000000 z */
- 0x00, /* 0x00000000 z */
- 0x00, /* 0x00000000 z */
- 0x00, /* 0x00000000 z */
- 0x7f, /* 0x01111111 z */
- 0x20, /* 0x00100000 z */
- 0x10, /* 0x00010000 z */
- 0x08, /* 0x00001000 z */
- 0x04, /* 0x00000100 z */
- 0x02, /* 0x00000010 z */
- 0x7f, /* 0x01111111 z */
- 0x00, /* 0x00000000 z */
- 0x00, /* 0x00000000 z */
- 0x00, /* 0x00000000 z */
-/* */
- 0x00, /* 0x00000000 { */
- 0x00, /* 0x00000000 { */
- 0x70, /* 0x01110000 { */
- 0x08, /* 0x00001000 { */
- 0x08, /* 0x00001000 { */
- 0x10, /* 0x00010000 { */
- 0x0c, /* 0x00001100 { */
- 0x0c, /* 0x00001100 { */
- 0x10, /* 0x00010000 { */
- 0x08, /* 0x00001000 { */
- 0x08, /* 0x00001000 { */
- 0x70, /* 0x01110000 { */
- 0x00, /* 0x00000000 { */
- 0x00, /* 0x00000000 { */
- 0x00, /* 0x00000000 { */
-/* */
- 0x00, /* 0x00000000 | */
- 0x00, /* 0x00000000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x08, /* 0x00001000 | */
- 0x00, /* 0x00000000 | */
- 0x00, /* 0x00000000 | */
- 0x00, /* 0x00000000 | */
-/* */
- 0x00, /* 0x00000000 } */
- 0x00, /* 0x00000000 } */
- 0x07, /* 0x00000111 } */
- 0x08, /* 0x00001000 } */
- 0x08, /* 0x00001000 } */
- 0x04, /* 0x00000100 } */
- 0x18, /* 0x00011000 } */
- 0x18, /* 0x00011000 } */
- 0x04, /* 0x00000100 } */
- 0x08, /* 0x00001000 } */
- 0x08, /* 0x00001000 } */
- 0x07, /* 0x00000111 } */
- 0x00, /* 0x00000000 } */
- 0x00, /* 0x00000000 } */
- 0x00, /* 0x00000000 } */
-/* */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x46, /* 0x01000110 ~ */
- 0x49, /* 0x01001001 ~ */
- 0x31, /* 0x00110001 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
- 0x00, /* 0x00000000 ~ */
-/* */
-/* ascii0241 */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x00,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0242 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x10,
- 0x3c,
- 0x42,
- 0x02,
- 0x02,
- 0x42,
- 0x3c,
- 0x10,
- 0x10,
- 0x00,
-/* ascii0243 */
- 0x00,
- 0x00,
- 0x70,
- 0x88,
- 0x08,
- 0x08,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0xdc,
- 0x76,
- 0x00,
- 0x00,
-/* ascii0244 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0245 */
- 0x00,
- 0x00,
- 0x00,
- 0x44,
- 0x44,
- 0x44,
- 0x28,
- 0x10,
- 0x7c,
- 0x10,
- 0x7c,
- 0x10,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0246 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0247 */
- 0x00,
- 0x1c,
- 0x22,
- 0x02,
- 0x04,
- 0x1c,
- 0x22,
- 0x22,
- 0x1c,
- 0x10,
- 0x20,
- 0x22,
- 0x1c,
- 0x00,
- 0x00,
-/* ascii0250 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x82,
- 0x44,
- 0x38,
- 0x44,
- 0x44,
- 0x44,
- 0x38,
- 0x44,
- 0x82,
- 0x00,
- 0x00,
-/* ascii0251 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x7c,
- 0x82,
- 0xb2,
- 0x8a,
- 0x8a,
- 0xb2,
- 0x82,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0252 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x7c,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0253 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x48,
- 0x24,
- 0x12,
- 0x09,
- 0x12,
- 0x24,
- 0x48,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0254 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0255 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0256 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0257 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0260 */
- 0x00,
- 0x18,
- 0x24,
- 0x24,
- 0x18,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0261 */
- 0x00,
- 0x00,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x3e,
- 0x08,
- 0x08,
- 0x08,
- 0x00,
- 0x3e,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0262 */
- 0x00,
- 0x00,
- 0x0c,
- 0x12,
- 0x08,
- 0x04,
- 0x02,
- 0x1e,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0263 */
- 0x00,
- 0x00,
- 0x1e,
- 0x10,
- 0x08,
- 0x10,
- 0x12,
- 0x0c,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0264 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0265 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x44,
- 0x44,
- 0x44,
- 0x44,
- 0x44,
- 0x7c,
- 0xc2,
- 0x01,
-/* ascii0266 */
- 0x00,
- 0x00,
- 0x00,
- 0x7c,
- 0x4e,
- 0x4e,
- 0x4e,
- 0x4e,
- 0x7c,
- 0x48,
- 0x48,
- 0x48,
- 0x48,
- 0x00,
- 0x00,
-/* ascii0267 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x18,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0270 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0271 */
- 0x00,
- 0x00,
- 0x08,
- 0x0c,
- 0x08,
- 0x08,
- 0x08,
- 0x1c,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0272 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x3c,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-/* ascii0273 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x12,
- 0x24,
- 0x48,
- 0x90,
- 0x48,
- 0x24,
- 0x12,
- 0x00,
- 0x00,
-/* ascii0274 */
- 0x00,
- 0x04,
- 0x06,
- 0x04,
- 0x04,
- 0x4e,
- 0x20,
- 0x10,
- 0x48,
- 0x64,
- 0x52,
- 0xf8,
- 0x40,
- 0x40,
- 0x00,
-/* ascii0275 */
- 0x00,
- 0x04,
- 0x06,
- 0x04,
- 0x04,
- 0x4e,
- 0x20,
- 0x10,
- 0x08,
- 0x74,
- 0x82,
- 0x60,
- 0x10,
- 0xf0,
- 0x00,
-/* ascii0276 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0277 */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x00,
- 0x10,
- 0x10,
- 0x08,
- 0x04,
- 0x02,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0300 */
- 0x00,
- 0x08,
- 0x10,
- 0x20,
- 0x18,
- 0x24,
- 0x42,
- 0x42,
- 0x42,
- 0x7e,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0301 */
- 0x00,
- 0x10,
- 0x08,
- 0x04,
- 0x18,
- 0x24,
- 0x42,
- 0x42,
- 0x42,
- 0x7e,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0302 */
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x18,
- 0x24,
- 0x42,
- 0x42,
- 0x42,
- 0x7e,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0303 */
- 0x00,
- 0x4c,
- 0x32,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x42,
- 0x42,
- 0x7e,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0304 */
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x42,
- 0x42,
- 0x7e,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0305 */
- 0x18,
- 0x24,
- 0x18,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x42,
- 0x42,
- 0x7e,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0306 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xf8,
- 0x14,
- 0x12,
- 0x12,
- 0x7e,
- 0x12,
- 0x12,
- 0x12,
- 0xf2,
- 0x00,
- 0x00,
-/* ascii0307 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x02,
- 0x02,
- 0x02,
- 0x02,
- 0x02,
- 0x42,
- 0x3c,
- 0x10,
- 0x0c,
-/* ascii0310 */
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x7e,
- 0x02,
- 0x02,
- 0x02,
- 0x1e,
- 0x02,
- 0x02,
- 0x02,
- 0x7e,
- 0x00,
- 0x00,
-/* ascii0311 */
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x7e,
- 0x02,
- 0x02,
- 0x02,
- 0x1e,
- 0x02,
- 0x02,
- 0x02,
- 0x7e,
- 0x00,
- 0x00,
-/* ascii0312 */
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x7e,
- 0x02,
- 0x02,
- 0x02,
- 0x1e,
- 0x02,
- 0x02,
- 0x02,
- 0x7e,
- 0x00,
- 0x00,
-/* ascii0313 */
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x7e,
- 0x02,
- 0x02,
- 0x02,
- 0x1e,
- 0x02,
- 0x02,
- 0x02,
- 0x7e,
- 0x00,
- 0x00,
-/* ascii0314 */
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x3c,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0315 */
- 0x40,
- 0x20,
- 0x10,
- 0x00,
- 0x3c,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0316 */
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x3c,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0317 */
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x3c,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0320 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0321 */
- 0x00,
- 0x4c,
- 0x32,
- 0x00,
- 0x42,
- 0x42,
- 0x46,
- 0x4a,
- 0x52,
- 0x62,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0322 */
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0323 */
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0324 */
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0325 */
- 0x00,
- 0x4c,
- 0x32,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0326 */
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0327 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xfc,
- 0x12,
- 0x12,
- 0x12,
- 0x72,
- 0x12,
- 0x12,
- 0x12,
- 0xfc,
- 0x00,
- 0x00,
-/* ascii0330 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xbc,
- 0x42,
- 0x62,
- 0x52,
- 0x52,
- 0x4a,
- 0x46,
- 0x42,
- 0x3d,
- 0x00,
- 0x00,
-/* ascii0331 */
- 0x00,
- 0x04,
- 0x08,
- 0x10,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0332 */
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0333 */
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0334 */
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0335 */
- 0x00,
- 0xc6,
- 0x00,
- 0x00,
- 0x82,
- 0x82,
- 0x44,
- 0x28,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0336 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0337 */
- 0x00,
- 0x00,
- 0x70,
- 0x88,
- 0x84,
- 0x84,
- 0x44,
- 0x74,
- 0x84,
- 0x84,
- 0x84,
- 0x94,
- 0x74,
- 0x04,
- 0x02,
-/* ascii0340 */
- 0x00,
- 0x00,
- 0x00,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0341 */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0342 */
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0343 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x4c,
- 0x32,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0344 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0345 */
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x24,
- 0x18,
- 0x00,
- 0x3c,
- 0x40,
- 0x7c,
- 0x42,
- 0x42,
- 0x7c,
- 0x00,
- 0x00,
-/* ascii0346 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x6e,
- 0x90,
- 0xfc,
- 0x12,
- 0x12,
- 0xec,
- 0x00,
- 0x00,
-/* ascii0347 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x02,
- 0x02,
- 0x42,
- 0x3c,
- 0x10,
- 0x0c,
-/* ascii0350 */
- 0x00,
- 0x00,
- 0x00,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x3c,
- 0x42,
- 0x7e,
- 0x02,
- 0x02,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0351 */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x3c,
- 0x42,
- 0x7e,
- 0x02,
- 0x02,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0352 */
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x3c,
- 0x42,
- 0x7e,
- 0x02,
- 0x02,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0353 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x7e,
- 0x02,
- 0x02,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0354 */
- 0x00,
- 0x00,
- 0x00,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0355 */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0356 */
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0357 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x08,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0360 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0361 */
- 0x00,
- 0x00,
- 0x00,
- 0x4c,
- 0x32,
- 0x00,
- 0x00,
- 0x3e,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x00,
- 0x00,
-/* ascii0362 */
- 0x00,
- 0x00,
- 0x00,
- 0x08,
- 0x10,
- 0x20,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0363 */
- 0x00,
- 0x00,
- 0x00,
- 0x10,
- 0x08,
- 0x04,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0364 */
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0365 */
- 0x00,
- 0x00,
- 0x00,
- 0x4c,
- 0x32,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0366 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0367 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x6c,
- 0x92,
- 0xf2,
- 0x12,
- 0x12,
- 0xec,
- 0x00,
- 0x00,
-/* ascii0370 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0xbc,
- 0x62,
- 0x52,
- 0x4a,
- 0x46,
- 0x3c,
- 0x02,
- 0x00,
-/* ascii0371 */
- 0x00,
- 0x00,
- 0x00,
- 0x04,
- 0x08,
- 0x10,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0372 */
- 0x00,
- 0x00,
- 0x00,
- 0x20,
- 0x10,
- 0x08,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0373 */
- 0x00,
- 0x00,
- 0x00,
- 0x18,
- 0x24,
- 0x42,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0374 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x00,
- 0x00,
-/* ascii0375 */
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x66,
- 0x00,
- 0x00,
- 0x42,
- 0x42,
- 0x42,
- 0x42,
- 0x3c,
- 0x40,
- 0x40,
- 0x3e,
-/* ascii0376 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-/* ascii0377 */
- 0x00,
- 0x00,
- 0x00,
- 0x3c,
- 0x42,
- 0x42,
- 0x02,
- 0x04,
- 0x08,
- 0x10,
- 0x10,
- 0x00,
- 0x10,
- 0x00,
- 0x00,
-
-};
-
-/*
- * Default Cursor
- */
-unsigned short q_cursor[] = {
- 0x0000,
- 0x0000,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x00ff,
- 0x0000,
- 0x0000,
- 0x0000
-};
-
diff --git a/sys/arch/vax/qbus/ubavar.h b/sys/arch/vax/qbus/ubavar.h
index de9c102ff96..7001bc294b5 100644
--- a/sys/arch/vax/qbus/ubavar.h
+++ b/sys/arch/vax/qbus/ubavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubavar.h,v 1.7 2006/07/19 20:22:37 miod Exp $ */
+/* $OpenBSD: ubavar.h,v 1.8 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: ubavar.h,v 1.31 2001/04/26 19:16:07 ragge Exp $ */
/*
@@ -94,7 +94,6 @@ struct uba_unit {
int (*uu_ready)(struct uba_unit *);
void *uu_ref; /* Buffer this is related to */
short uu_xclu; /* want exclusive use of bdp's */
- short uu_keepbdp; /* hang on to bdp's once allocated */
};
/*
diff --git a/sys/arch/vax/qbus/uda.c b/sys/arch/vax/qbus/uda.c
index 1db6997767d..89c55fa3eac 100644
--- a/sys/arch/vax/qbus/uda.c
+++ b/sys/arch/vax/qbus/uda.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uda.c,v 1.8 2010/09/20 06:33:48 matthew Exp $ */
+/* $OpenBSD: uda.c,v 1.9 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: uda.c,v 1.36 2000/06/04 06:17:05 matt Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -213,7 +213,6 @@ udaattach(parent, self, aux)
*/
sc->sc_unit.uu_softc = sc; /* Backpointer to softc */
sc->sc_unit.uu_ready = udaready;/* go routine called from adapter */
- sc->sc_unit.uu_keepbdp = vax_cputype == VAX_750 ? 1 : 0;
/*
* Map the communication area and command and
diff --git a/sys/arch/vax/stand/boot/Makefile b/sys/arch/vax/stand/boot/Makefile
index 59bb87a89e6..0463c1dfe6e 100644
--- a/sys/arch/vax/stand/boot/Makefile
+++ b/sys/arch/vax/stand/boot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.8 2008/03/30 19:54:05 miod Exp $
+# $OpenBSD: Makefile,v 1.9 2011/07/06 18:32:59 miod Exp $
# $NetBSD: Makefile,v 1.27 2002/04/07 07:00:25 matt Exp $
S!= cd ${.CURDIR}/../../../../; pwd
@@ -7,7 +7,7 @@ NOMAN= # defined
.include <bsd.own.mk>
PROG= boot
-DEVS= hp.c ctu.c ra.c mfm.c if_qe.c if_le.c if_ze.c if_de.c if_ni.c
+DEVS= ra.c mfm.c if_qe.c if_le.c if_ze.c if_de.c
SRCS= srt0.S boot.c devopen.c conf.c autoconf.c netio.c rom.c romread.S \
urem.s udiv.s consio.c consio2.S str.S ${DEVS} findcpu.c
diff --git a/sys/arch/vax/stand/boot/boot.c b/sys/arch/vax/stand/boot/boot.c
index 62c5ad59e16..597185c079e 100644
--- a/sys/arch/vax/stand/boot/boot.c
+++ b/sys/arch/vax/stand/boot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.19 2008/08/26 18:36:21 miod Exp $ */
+/* $OpenBSD: boot.c,v 1.20 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: boot.c,v 1.18 2002/05/31 15:58:26 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -38,8 +38,6 @@
#include <lib/libsa/stand.h>
#include <lib/libsa/loadfile.h>
-#define V750UCODE(x) ((x>>8)&255)
-
#include "machine/rpb.h"
#include "machine/sid.h"
@@ -61,9 +59,6 @@ void autoconf(void);
int getsecs(void);
int setjmp(int *);
int testkey(void);
-#if 0
-void loadpcs(void);
-#endif
const struct vals {
char *namn;
@@ -109,7 +104,7 @@ Xmain(void)
transition = ' ';
askname = bootrpb.rpb_bootr5 & RB_ASKNAME;
- printf("\n\r>> OpenBSD/vax boot [%s] <<\n", "1.15");
+ printf("\n\r>> OpenBSD/vax boot [%s] <<\n", "1.16");
printf(">> Press enter to autoboot now, or any other key to abort: ");
sluttid = getsecs() + 5;
senast = 0;
@@ -196,7 +191,7 @@ void
boot(char *arg)
{
char *fn = "bsd";
- int howto, fl, err;
+ int howto, err;
u_long marks[MARK_MAX];
if (arg) {
@@ -246,104 +241,6 @@ load:
printf("Boot failed: %s\n", strerror(errno));
}
-#if 0
-
-/* 750 Patchable Control Store magic */
-
-#include "../include/mtpr.h"
-#include "../include/cpu.h"
-#include "../include/sid.h"
-#define PCS_BITCNT 0x2000 /* number of patchbits */
-#define PCS_MICRONUM 0x400 /* number of ucode locs */
-#define PCS_PATCHADDR 0xf00000 /* start addr of patchbits */
-#define PCS_PCSADDR (PCS_PATCHADDR+0x8000) /* start addr of pcs */
-#define PCS_PATCHBIT (PCS_PATCHADDR+0xc000) /* patchbits enable reg */
-#define PCS_ENABLE 0xfff00000 /* enable bits for pcs */
-
-#define extzv(one, two, three,four) \
-({ \
- asm __volatile (" extzv %0,%3,(%1),(%2)+" \
- : \
- : "g"(one),"g"(two),"g"(three),"g"(four)); \
-})
-
-
-void
-loadpcs(void)
-{
- static int pcsdone = 0;
- int mid = mfpr(PR_SID);
- int i, j, *ip, *jp;
- char pcs[100];
- char *cp;
-
- if ((mid >> 24) != VAX_750 || ((mid >> 8) & 255) < 95 || pcsdone)
- return;
- printf("Updating 11/750 microcode: ");
- for (cp = line; *cp; cp++)
- if (*cp == ')' || *cp == ':')
- break;
- if (*cp) {
- bcopy(line, pcs, 99);
- pcs[99] = 0;
- i = cp - line + 1;
- } else
- i = 0;
- strncpy(pcs + i, "pcs750.bin", sizeof(pcs) - i - 1);
- pcs[sizeof(pcs)-1] = '\0';
- i = open(pcs, 0);
- if (i < 0) {
- printf("bad luck - missing pcs750.bin :-(\n");
- return;
- }
- /*
- * We ask for more than we need to be sure we get only what we expect.
- * After read:
- * locs 0 - 1023 packed patchbits
- * 1024 - 11264 packed microcode
- */
- if (read(i, (char *)0, 23*512) != 22*512) {
- printf("Error reading %s\n", pcs);
- close(i);
- return;
- }
- close(i);
-
- /*
- * Enable patchbit loading and load the bits one at a time.
- */
- *((int *)PCS_PATCHBIT) = 1;
- ip = (int *)PCS_PATCHADDR;
- jp = (int *)0;
- for (i=0; i < PCS_BITCNT; i++) {
- extzv(i,jp,ip,1);
- }
- *((int *)PCS_PATCHBIT) = 0;
-
- /*
- * Load PCS microcode 20 bits at a time.
- */
- ip = (int *)PCS_PCSADDR;
- jp = (int *)1024;
- for (i=j=0; j < PCS_MICRONUM * 4; i+=20, j++) {
- extzv(i,jp,ip,20);
- }
-
- /*
- * Enable PCS.
- */
- i = *jp; /* get 1st 20 bits of microcode again */
- i &= 0xfffff;
- i |= PCS_ENABLE; /* reload these bits with PCS enable set */
- *((int *)PCS_PCSADDR) = i;
-
- mid = mfpr(PR_SID);
- printf("new rev level=%d\n", V750UCODE(mid));
- pcsdone = 1;
-}
-
-#endif
-
void
usage(char *hej)
{
diff --git a/sys/arch/vax/stand/boot/conf.c b/sys/arch/vax/stand/boot/conf.c
index ec6a3777ddb..ea8ad1df942 100644
--- a/sys/arch/vax/stand/boot/conf.c
+++ b/sys/arch/vax/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.5 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.6 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: conf.c,v 1.10 2000/06/15 19:53:23 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -50,9 +50,7 @@
static int nostrategy(void *, int, daddr32_t, size_t, void *, size_t *);
struct devsw devsw[]={
- SADEV("hp",hpstrategy, hpopen, nullsys, noioctl),
SADEV("qe",nostrategy, qeopen, qeclose, noioctl), /* DEQNA */
- SADEV("ctu",ctustrategy, ctuopen, nullsys, noioctl),
SADEV("ra",rastrategy, raopen, nullsys, noioctl),
SADEV("mt",rastrategy, raopen, nullsys, noioctl),
SADEV("rom",romstrategy, romopen, nullsys, noioctl),
@@ -63,15 +61,11 @@ struct devsw devsw[]={
SADEV("st",nullsys, nullsys, nullsys, noioctl),
SADEV("le",nostrategy, leopen, leclose, noioctl), /* LANCE */
SADEV("ze",nostrategy, zeopen, zeclose, noioctl), /* SGEC */
- SADEV("rl",romstrategy, romopen, nullsys, noioctl),
SADEV("de",nostrategy, deopen, declose, noioctl), /* DEUNA */
- SADEV("ni",nostrategy, niopen, nullsys, noioctl), /* DEBNA */
};
int cnvtab[] = {
- BDEV_HP,
BDEV_QE,
- BDEV_CNSL,
BDEV_UDA,
BDEV_TK,
-1,
@@ -82,9 +76,7 @@ int cnvtab[] = {
BDEV_ST,
BDEV_LE,
BDEV_ZE,
- BDEV_RL,
BDEV_DE,
- BDEV_NI,
};
int ndevs = (sizeof(devsw)/sizeof(devsw[0]));
diff --git a/sys/arch/vax/stand/boot/ctu.c b/sys/arch/vax/stand/boot/ctu.c
deleted file mode 100644
index 70654e2e905..00000000000
--- a/sys/arch/vax/stand/boot/ctu.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* $OpenBSD: ctu.c,v 1.5 2011/03/13 00:13:53 deraadt Exp $ */
-/* $NetBSD: ctu.c,v 1.3 2000/05/20 13:30:03 ragge Exp $ */
-/*
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Standalone device driver for 11/750 Console TU58.
- * It can only handle reads, and doesn't calculate checksum.
- */
-
-#include <sys/param.h>
-
-#include <lib/libsa/stand.h>
-
-#include <machine/mtpr.h>
-#include <machine/rsp.h>
-
-#include "vaxstand.h"
-
-static short ctu_cksum(unsigned short *, int);
-
-enum tu_state {
- SC_INIT,
- SC_READY,
- SC_SEND_CMD,
- SC_GET_RESP,
-};
-
-volatile struct tu_softc {
- enum tu_state sc_state;
- char sc_rsp[15]; /* Should be struct rsb; but don't work */
- u_char *sc_xfptr; /* Current char to xfer */
- int sc_nbytes; /* Number of bytes to xfer */
- int sc_xbytes; /* Number of xfer'd bytes */
- int sc_bbytes; /* Number of xfer'd bytes this block */
-} tu_sc;
-
-void ctutintr(void);
-void cturintr(void);
-
-int
-ctuopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
-{
-
- tu_sc.sc_state = SC_INIT;
-
- mtpr(RSP_TYP_INIT, PR_CSTD);
- cturintr();
- tu_sc.sc_state = SC_READY;
- return 0;
-
-}
-
-int
-ctustrategy(void *f, int func, daddr32_t dblk, size_t size, void *buf, size_t *rsize)
-{
- struct rsp *rsp = (struct rsp *)tu_sc.sc_rsp;
-
- tu_sc.sc_xfptr = buf;
- tu_sc.sc_nbytes = size;
- tu_sc.sc_xbytes = tu_sc.sc_bbytes = 0;
-
- rsp->rsp_typ = RSP_TYP_COMMAND;
- rsp->rsp_sz = 012;
- rsp->rsp_op = RSP_OP_READ;
- rsp->rsp_mod = 0;
- rsp->rsp_drv = 0;
- rsp->rsp_sw = rsp->rsp_xx1 = rsp->rsp_xx2 = 0;
- rsp->rsp_cnt = tu_sc.sc_nbytes;
- rsp->rsp_blk = dblk;
- rsp->rsp_sum = ctu_cksum((u_short *)rsp, 6);
- tu_sc.sc_state = SC_SEND_CMD;
- while (tu_sc.sc_state != SC_GET_RESP)
- ctutintr();
- while (tu_sc.sc_state != SC_READY)
- cturintr();
- *rsize = size;
- return 0;
-}
-
-void
-cturintr(void)
-{
- int status;
-
- while ((mfpr(PR_CSRS) & 0x80) == 0)
- ;
-
- status = mfpr(PR_CSRD);
-
- switch (tu_sc.sc_state) {
-
- case SC_INIT:
- break;
-
- case SC_GET_RESP:
- if (tu_sc.sc_xbytes == tu_sc.sc_nbytes) {
- tu_sc.sc_bbytes++;
- if (tu_sc.sc_bbytes == 146)
- tu_sc.sc_state = SC_READY;
- break;
- }
- tu_sc.sc_bbytes++;
- if (tu_sc.sc_bbytes < 3) /* Data header */
- break;
- if (tu_sc.sc_bbytes == 132) { /* Finished */
- tu_sc.sc_bbytes = 0;
- break;
- }
- if (tu_sc.sc_bbytes == 131) /* First checksum */
- break;
- tu_sc.sc_xfptr[tu_sc.sc_xbytes++] = status;
- break;
- case SC_READY:
- case SC_SEND_CMD:
- break;
- }
-
-}
-
-void
-ctutintr(void)
-{
- int c;
-
- while ((mfpr(PR_CSTS) & 0x80) == 0)
- ;
-
- c = tu_sc.sc_rsp[tu_sc.sc_xbytes++] & 0xff;
- mtpr(c, PR_CSTD);
- if (tu_sc.sc_xbytes > 13) {
- tu_sc.sc_state = SC_GET_RESP;
- tu_sc.sc_xbytes = 0;
- }
-}
-
-short
-ctu_cksum(unsigned short *buf, int words)
-{
- int i, cksum;
-
- for (i = cksum = 0; i < words; i++)
- cksum += buf[i];
-
-hej: if (cksum > 65535) {
- cksum = (cksum & 65535) + (cksum >> 16);
- goto hej;
- }
- return cksum;
-}
diff --git a/sys/arch/vax/stand/boot/devopen.c b/sys/arch/vax/stand/boot/devopen.c
index 879aec9465e..4a3bbe7b784 100644
--- a/sys/arch/vax/stand/boot/devopen.c
+++ b/sys/arch/vax/stand/boot/devopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: devopen.c,v 1.4 2008/08/26 18:36:21 miod Exp $ */
+/* $OpenBSD: devopen.c,v 1.5 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: devopen.c,v 1.10 2002/05/24 21:40:59 ragge Exp $ */
/*
* Copyright (c) 1997 Ludd, University of Lule}, Sweden.
@@ -36,10 +36,6 @@
#include "machine/rpb.h"
#include "machine/sid.h"
#include "machine/pte.h"
-#define VAX780 1
-#include "machine/ka750.h"
-
-#include <arch/vax/bi/bireg.h>
#include "vaxstand.h"
@@ -151,44 +147,6 @@ devopen(f, fname, file)
nexaddr = bootrpb.adpphy;
switch (vax_boardtype) {
- case VAX_BTYP_750:
- csrbase = (nexaddr == 0xf30000 ? 0xffe000 : 0xfbe000);
- if (adapt < 0)
- break;
- nexaddr = (NEX750 + NEXSIZE * adapt);
- csrbase = (adapt == 8 ? 0xffe000 : 0xfbe000);
- break;
- case VAX_BTYP_780:
- case VAX_BTYP_790:
- csrbase = 0x2007e000 + 0x40000 * ((nexaddr & 0x1e000) >> 13);
- if (adapt < 0)
- break;
- nexaddr = ((int)NEX780 + NEXSIZE * adapt);
- csrbase = 0x2007e000 + 0x40000 * adapt;
- break;
- case VAX_BTYP_9CC: /* 6000/200 */
- case VAX_BTYP_9RR: /* 6000/400 */
- case VAX_BTYP_1202: /* 6000/500 */
- csrbase = 0;
- if (ctlr < 0)
- ctlr = bootrpb.adpphy & 15;
- if (adapt < 0)
- adapt = (bootrpb.adpphy >> 4) & 15;
- nexaddr = BI_BASE(adapt, ctlr);
- break;
-
- case VAX_BTYP_8000:
- case VAX_BTYP_8800:
- case VAX_BTYP_8PS:
- csrbase = 0; /* _may_ be a KDB */
- nexaddr = bootrpb.csrphy;
- if (ctlr < 0)
- break;
- if (adapt < 0)
- nexaddr = (nexaddr & 0xff000000) + BI_NODE(ctlr);
- else
- nexaddr = BI_BASE(adapt, ctlr);
- break;
case VAX_BTYP_610:
nexaddr = 0; /* No map regs */
csrbase = 0x20000000;
diff --git a/sys/arch/vax/stand/boot/hp.c b/sys/arch/vax/stand/boot/hp.c
deleted file mode 100644
index c7f084a6f99..00000000000
--- a/sys/arch/vax/stand/boot/hp.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* $OpenBSD: hp.c,v 1.3 2011/03/13 00:13:53 deraadt Exp $ */
-/* $NetBSD: hp.c,v 1.5 2000/07/19 00:58:25 matt Exp $ */
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
- /* All bugs are subject to removal without further notice */
-
-
-
-#include "sys/param.h"
-#include "sys/disklabel.h"
-
-#include "lib/libsa/stand.h"
-
-#include "../include/pte.h"
-#include "../include/rpb.h"
-#include "../include/sid.h"
-#define VAX780 1
-struct proc;
-#include "../include/ka750.h"
-
-#include "../mba/mbareg.h"
-#include "../mba/hpreg.h"
-
-#include "vaxstand.h"
-
-/*
- * These routines for HP disk standalone boot is wery simple,
- * assuming a lots of thing like that we only working at one hp disk
- * a time, no separate routines for mba driver etc..
- * But it works :)
- */
-
-static struct disklabel hplabel;
-static char io_buf[DEV_BSIZE];
-static int dpart;
-static int adpadr, unitadr;
-
-#define MBA_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((adpadr) + (reg)) = (val)));
-#define MBA_RCSR(reg) \
- (*(volatile u_int32_t *)((adpadr) + (reg)))
-#define HP_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((unitadr) + (reg)) = (val)));
-#define HP_RCSR(reg) \
- (*(volatile u_int32_t *)((unitadr) + (reg)))
-
-int
-hpopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
-{
- char *msg;
- int err;
- size_t i;
-
- if (askname == 0) { /* Take info from RPB */
- adpadr = bootrpb.adpphy;
- unitadr = adpadr + MUREG(bootrpb.unit, 0);
- } else {
- adpadr = nexaddr;
- unitadr = adpadr + MUREG(unit, 0);
- bootrpb.adpphy = adpadr;
- bootrpb.unit = unit;
- }
- bzero(&hplabel, sizeof(struct disklabel));
-
- hplabel.d_secpercyl = 32;
- hplabel.d_nsectors = 32;
-
- /* Set volume valid and 16 bit format; only done once */
- MBA_WCSR(MBA_CR, MBACR_INIT);
- HP_WCSR(HP_CS1, HPCS_PA);
- HP_WCSR(HP_OF, HPOF_FMT);
-
- err = hpstrategy(0, F_READ, LABELSECTOR, DEV_BSIZE, io_buf, &i);
- if (err) {
- printf("reading disklabel: %s\n", strerror(err));
- return 0;
- }
-
- msg = getdisklabel(io_buf + LABELOFFSET, &hplabel);
- if (msg)
- printf("getdisklabel: %s\n", msg);
- return 0;
-}
-
-int
-hpstrategy(void *f, int func, daddr32_t dblk,
- size_t size, void *buf, size_t *rsize)
-{
- unsigned int pfnum, mapnr, nsize, bn, cn, sn, tn;
-
- pfnum = (u_int)buf >> VAX_PGSHIFT;
-
- for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0;
- nsize -= VAX_NBPG, mapnr++, pfnum++)
- MBA_WCSR(MAPREG(mapnr), PG_V | pfnum);
-
- MBA_WCSR(MBA_VAR, ((u_int)buf & VAX_PGOFSET));
- MBA_WCSR(MBA_BC, (~size) + 1);
- bn = dblk + hplabel.d_partitions[dpart].p_offset;
-
- if (bn) {
- cn = bn / hplabel.d_secpercyl;
- sn = bn % hplabel.d_secpercyl;
- tn = sn / hplabel.d_nsectors;
- sn = sn % hplabel.d_nsectors;
- } else
- cn = sn = tn = 0;
-
- HP_WCSR(HP_DC, cn);
- HP_WCSR(HP_DA, (tn << 8) | sn);
-#ifdef notdef
- if (func == F_WRITE)
- HP_WCSR(HP_CS1, HPCS_WRITE);
- else
-#endif
- HP_WCSR(HP_CS1, HPCS_READ);
-
- while (MBA_RCSR(MBA_SR) & MBASR_DTBUSY)
- ;
-
- if (MBA_RCSR(MBA_SR) & MBACR_ABORT)
- return 1;
-
- *rsize = size;
- return 0;
-}
diff --git a/sys/arch/vax/stand/boot/if_de.c b/sys/arch/vax/stand/boot/if_de.c
index c4c61acfbc1..3dd71bb6aa2 100644
--- a/sys/arch/vax/stand/boot/if_de.c
+++ b/sys/arch/vax/stand/boot/if_de.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_de.c,v 1.2 2005/12/10 11:45:43 miod Exp $ */
+/* $OpenBSD: if_de.c,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: if_de.c,v 1.2 2002/05/24 21:41:40 ragge Exp $ */
/*
@@ -47,7 +47,12 @@
#include <lib/libsa/netif.h>
#include <lib/libsa/stand.h>
-#include <arch/vax/qbus/if_dereg.h>
+#include <arch/vax/if/if_dereg.h>
+
+#define DE_PCSR0 0
+#define DE_PCSR1 2
+#define DE_PCSR2 4
+#define DE_PCSR3 6
#include "arch/vax/include/sid.h"
#include "arch/vax/include/rpb.h"
diff --git a/sys/arch/vax/stand/boot/if_ni.c b/sys/arch/vax/stand/boot/if_ni.c
deleted file mode 100644
index 76f3477eb65..00000000000
--- a/sys/arch/vax/stand/boot/if_ni.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/* $OpenBSD: if_ni.c,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
-/* $NetBSD: if_ni.c,v 1.2 2000/07/10 10:40:38 ragge Exp $ */
-/*
- * Copyright (c) 2000 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Standalone routine for DEBNA Ethernet controller.
- */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/if_ether.h>
-
-#include <../include/sid.h>
-#include <../include/rpb.h>
-#include <../include/pte.h>
-#include <../include/macros.h>
-#include <../include/mtpr.h>
-#include <../include/scb.h>
-
-#include <lib/libkern/libkern.h>
-
-#include <lib/libsa/netif.h>
-#include <lib/libsa/stand.h>
-#include <lib/libsa/net.h>
-
-#include <arch/vax/bi/bireg.h>
-
-#include "vaxstand.h"
-
-#undef NIDEBUG
-/*
- * Tunable buffer parameters. Good idea to have them as power of 8; then
- * they will fit into a logical VAX page.
- */
-#define NMSGBUF 8 /* Message queue entries */
-#define NTXBUF 16 /* Transmit queue entries */
-#define NTXFRAGS 1 /* Number of transmit buffer fragments */
-#define NRXBUF 24 /* Receive queue entries */
-#define NBDESCS (NTXBUF + NRXBUF)
-#define NQUEUES 3 /* RX + TX + MSG */
-#define PKTHDR 18 /* Length of (control) packet header */
-#define RXADD 18 /* Additional length of receive datagram */
-#define TXADD 18 /* "" transmit "" */
-#define MSGADD 134 /* "" message "" */
-
-#include <arch/vax/bi/if_nireg.h>
-
-
-#define SPTSIZ 16384 /* 8MB */
-#define roundpg(x) (((int)x + VAX_PGOFSET) & ~VAX_PGOFSET)
-#define ALLOC(x) \
- allocbase;xbzero((caddr_t)allocbase,x);allocbase+=roundpg(x);
-#define nipqb (&gvppqb->nc_pqb)
-#define gvp gvppqb
-#define NI_WREG(csr, val) *(volatile long *)(niaddr + (csr)) = (val)
-#define NI_RREG(csr) *(volatile long *)(niaddr + (csr))
-#define DELAY(x) {volatile int i = x * 3;while (--i);}
-#define WAITREG(csr,val) while (NI_RREG(csr) & val);
-
-static int ni_get(struct iodesc *, void *, size_t, time_t);
-static int ni_put(struct iodesc *, void *, size_t);
-
-static int *syspte, allocbase, niaddr;
-static struct ni_gvppqb *gvppqb;
-static struct ni_fqb *fqb;
-static struct ni_bbd *bbd;
-static char enaddr[6];
-static int beenhere = 0;
-
-struct netif_driver ni_driver = {
- 0, 0, 0, 0, ni_get, ni_put,
-};
-
-static void
-xbzero(char *a, int s)
-{
- while (s--)
- *a++ = 0;
-}
-
-static int
-failtest(int reg, int mask, int test, char *str)
-{
- int i = 100;
-
- do {
- DELAY(100000);
- } while (((NI_RREG(reg) & mask) != test) && --i);
-
- if (i == 0) {
- printf("ni: %s\n", str);
- return 1;
- }
- return 0;
-}
-
-static int
-INSQTI(void *e, void *h)
-{
- int ret;
-
- while ((ret = insqti(e, h)) == ILCK_FAILED)
- ;
- return ret;
-}
-
-static void *
-REMQHI(void *h)
-{
- void *ret;
-
- while ((ret = remqhi(h)) == (void *)ILCK_FAILED)
- ;
- return ret;
-}
-
-static void
-puton(void *pkt, void *q, int args)
-{
- INSQTI(pkt, q);
-
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, args);
- WAITREG(NI_PCR, PCR_OWN);
-}
-
-static void
-remput(void *fq, void *pq, int args)
-{
- struct ni_dg *data;
- int res;
-
- while ((data = REMQHI(fq)) == 0)
- ;
-
- res = INSQTI(data, pq);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, args);
- }
-}
-
-static void
-insput(void *elem, void *q, int args)
-{
- int res;
-
- res = INSQTI(elem, q);
- if (res == Q_EMPTY) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, args);
- }
-}
-
-int
-niopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
-{
- struct ni_dg *data;
- struct ni_msg *msg;
- struct ni_ptdb *ptdb;
- int i, va, res;
-
- if (beenhere++ && askname == 0)
- return 0;
-
- niaddr = nexaddr & ~(BI_NODESIZE - 1);
- bootrpb.csrphy = niaddr;
- if (adapt >= 0)
- bootrpb.adpphy = adapt;
- /*
- * We need a bunch of memory, take it from our load
- * address plus 1M.
- */
- allocbase = RELOC + 1024 * 1024;
- /*
- * First create a SPT for the first 8MB of physmem.
- */
- syspte = (int *)ALLOC(SPTSIZ*4);
- for (i = 0; i < SPTSIZ; i++)
- syspte[i] = PG_V|PG_RW|i;
-
-
- gvppqb = (struct ni_gvppqb *)ALLOC(sizeof(struct ni_gvppqb));
- fqb = (struct ni_fqb *)ALLOC(sizeof(struct ni_fqb));
- bbd = (struct ni_bbd *)ALLOC(sizeof(struct ni_bbd) * NBDESCS);
-
- /* Init the PQB struct */
- nipqb->np_spt = nipqb->np_gpt = (int)syspte;
- nipqb->np_sptlen = nipqb->np_gptlen = SPTSIZ;
- nipqb->np_vpqb = (u_int32_t)gvp;
- nipqb->np_bvplvl = 1;
- nipqb->np_vfqb = (u_int32_t)fqb;
- nipqb->np_vbdt = (u_int32_t)bbd;
- nipqb->np_nbdr = NBDESCS;
-
- /* Free queue block */
- nipqb->np_freeq = NQUEUES;
- fqb->nf_mlen = PKTHDR+MSGADD;
- fqb->nf_dlen = PKTHDR+TXADD;
- fqb->nf_rlen = PKTHDR+RXADD;
-#ifdef NIDEBUG
- printf("niopen: syspte %p gvp %p fqb %p bbd %p\n",
- syspte, gvppqb, fqb, bbd);
-#endif
-
- NI_WREG(BIREG_VAXBICSR, NI_RREG(BIREG_VAXBICSR) | BICSR_NRST);
- DELAY(500000);
- i = 20;
- while ((NI_RREG(BIREG_VAXBICSR) & BICSR_BROKE) && --i)
- DELAY(500000);
-#ifdef NIDEBUG
- if (i == 0) {
- printf("ni: BROKE bit set after reset\n");
- return 1;
- }
-#endif
- /* Check state */
- if (failtest(NI_PSR, PSR_STATE, PSR_UNDEF, "not undefined state"))
- return 1;
-
- /* Clear owner bits */
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
- NI_WREG(NI_PCR, NI_RREG(NI_PCR) & ~PCR_OWN);
-
- /* kick off init */
- NI_WREG(NI_PCR, (int)gvppqb | PCR_INIT | PCR_OWN);
- while (NI_RREG(NI_PCR) & PCR_OWN)
- DELAY(100000);
-
- /* Check state */
- if (failtest(NI_PSR, PSR_INITED, PSR_INITED, "failed initialize"))
- return 1;
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_ENABLE);
- WAITREG(NI_PCR, PCR_OWN);
- WAITREG(NI_PSR, PSR_OWN);
-
- /* Check state */
- if (failtest(NI_PSR, PSR_STATE, PSR_ENABLED, "failed enable"))
- return 1;
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
-
-#ifdef NIDEBUG
- printf("Set up message free queue\n");
-#endif
-
- /* Set up message free queue */
- va = ALLOC(NMSGBUF * 512);
- for (i = 0; i < NMSGBUF; i++) {
- msg = (void *)(va + i * 512);
-
- res = INSQTI(msg, &fqb->nf_mforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Set up xmit queue\n");
-#endif
-
- /* Set up xmit queue */
- va = ALLOC(NTXBUF * 512);
- for (i = 0; i < NTXBUF; i++) {
- struct ni_dg *data;
-
- data = (void *)(va + i * 512);
- data->nd_status = 0;
- data->nd_len = TXADD;
- data->nd_ptdbidx = 1;
- data->nd_opcode = BVP_DGRAM;
- data->bufs[0]._offset = 0;
- data->bufs[0]._key = 1;
- data->nd_cmdref = allocbase;
- bbd[i].nb_key = 1;
- bbd[i].nb_status = 0;
- bbd[i].nb_pte = (int)&syspte[allocbase>>9];
- allocbase += 2048;
- data->bufs[0]._index = i;
-
- res = INSQTI(data, &fqb->nf_dforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
-#ifdef NIDEBUG
- printf("recv buffers\n");
-#endif
-
- /* recv buffers */
- va = ALLOC(NRXBUF * 512);
- for (i = 0; i < NRXBUF; i++) {
- struct ni_dg *data;
- struct ni_bbd *bd;
- int idx;
-
- data = (void *)(va + i * 512);
- data->nd_cmdref = allocbase;
- data->nd_len = RXADD;
- data->nd_opcode = BVP_DGRAMRX;
- data->nd_ptdbidx = 2;
- data->bufs[0]._key = 1;
-
- idx = NTXBUF + i;
- bd = &bbd[idx];
- bd->nb_pte = (int)&syspte[allocbase>>9];
- allocbase += 2048;
- bd->nb_len = 2048;
- bd->nb_status = NIBD_VALID;
- bd->nb_key = 1;
- data->bufs[0]._offset = 0;
- data->bufs[0]._len = bd->nb_len;
- data->bufs[0]._index = idx;
-
- res = INSQTI(data, &fqb->nf_rforw);
- }
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
- WAITREG(NI_PCR, PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Set initial parameters\n");
-#endif
-
- /* Set initial parameters */
- msg = REMQHI(&fqb->nf_mforw);
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = sizeof(struct ni_param) + 6;
- msg->nm_opcode2 = NI_WPARAM;
- ((struct ni_param *)&msg->nm_text[0])->np_flags = NP_PAD;
-
- puton(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
-
-
- while ((data = REMQHI(&gvp->nc_forwr)) == 0)
- ;
-
- msg = (struct ni_msg *)data;
-#ifdef NIDEBUG
- if (msg->nm_opcode2 != NI_WPARAM) {
- printf("ni: wrong response code %d\n", msg->nm_opcode2);
- insput(data, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- }
-#endif
- bcopy(((struct ni_param *)&msg->nm_text[0])->np_dpa,
- enaddr, ETHER_ADDR_LEN);
- insput(data, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Clear counters\n");
-#endif
-
- /* Clear counters */
- msg = REMQHI(&fqb->nf_mforw);
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = sizeof(struct ni_param) + 6;
- msg->nm_opcode2 = NI_RCCNTR;
-
- puton(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- remput(&gvp->nc_forwr, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("Enable transmit logic\n");
-#endif
-
- /* Enable transmit logic */
- msg = REMQHI(&fqb->nf_mforw);
-
- msg->nm_opcode = BVP_MSG;
- msg->nm_status = 0;
- msg->nm_len = 18;
- msg->nm_opcode2 = NI_STPTDB;
- ptdb = (struct ni_ptdb *)&msg->nm_text[0];
- bzero(ptdb, sizeof(struct ni_ptdb));
- ptdb->np_index = 1;
- ptdb->np_fque = 1;
-
- puton(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- remput(&gvp->nc_forwr, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("ni: hardware address %s\n", ether_sprintf(enaddr));
- printf("Setting receive parameters\n");
-#endif
- msg = REMQHI(&fqb->nf_mforw);
- ptdb = (struct ni_ptdb *)&msg->nm_text[0];
- bzero(ptdb, sizeof(struct ni_ptdb));
- msg->nm_opcode = BVP_MSG;
- msg->nm_len = 18;
- ptdb->np_index = 2;
- ptdb->np_fque = 2;
- msg->nm_opcode2 = NI_STPTDB;
- ptdb->np_type = ETHERTYPE_IP;
- ptdb->np_flags = PTDB_UNKN|PTDB_BDC;
- memset(ptdb->np_mcast[0], 0xff, ETHER_ADDR_LEN);
- ptdb->np_adrlen = 1;
- msg->nm_len += 8;
- insput(msg, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- remput(&gvp->nc_forwr, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
-
-#ifdef NIDEBUG
- printf("finished\n");
-#endif
-
- net_devinit(f, &ni_driver, enaddr);
- return 0;
-}
-
-int
-ni_get(struct iodesc *desc, void *pkt, size_t maxlen, time_t timeout)
-{
- struct ni_dg *data;
- struct ni_bbd *bd;
- int nsec = getsecs() + timeout;
- int len, idx;
-
-loop: while ((data = REMQHI(&gvp->nc_forwr)) == 0 && (nsec > getsecs()))
- ;
-
- if (nsec <= getsecs())
- return 0;
-
- switch (data->nd_opcode) {
- case BVP_DGRAMRX:
- idx = data->bufs[0]._index;
- bd = &bbd[idx];
- len = data->bufs[0]._len;
- if (len > maxlen)
- len = maxlen;
- bcopy((caddr_t)data->nd_cmdref, pkt, len);
- bd->nb_pte = (int)&syspte[data->nd_cmdref>>9];
- data->bufs[0]._len = bd->nb_len = 2048;
- data->bufs[0]._offset = 0;
- data->bufs[0]._key = 1;
- bd->nb_status = NIBD_VALID;
- bd->nb_key = 1;
- data->nd_len = RXADD;
- data->nd_status = 0;
- insput(data, &fqb->nf_rforw,
- PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
- return len;
-
- case BVP_DGRAM:
- insput(data, &fqb->nf_dforw, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
- break;
- default:
- insput(data, &fqb->nf_mforw, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
- break;
- }
-
- NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~(PSR_OWN|PSR_RSQ));
- goto loop;
-}
-
-int
-ni_put(struct iodesc *desc, void *pkt, size_t len)
-{
- struct ni_dg *data;
- struct ni_bbd *bdp;
-
- data = REMQHI(&fqb->nf_dforw);
-#ifdef NIDEBUG
- if (data == 0) {
- printf("ni_put: driver problem, data == 0\n");
- return -1;
- }
-#endif
- bdp = &bbd[(data->bufs[0]._index & 0x7fff)];
- bdp->nb_status = NIBD_VALID;
- bdp->nb_len = (len < 64 ? 64 : len);
- bcopy(pkt, (caddr_t)data->nd_cmdref, len);
- data->bufs[0]._offset = 0;
- data->bufs[0]._len = bdp->nb_len;
- data->nd_opcode = BVP_DGRAM;
- data->nd_pad3 = 1;
- data->nd_ptdbidx = 1;
- data->nd_len = 18;
- insput(data, &gvp->nc_forw0, PCR_CMDQNE|PCR_CMDQ0|PCR_OWN);
- return len;
-}
-
-int
-niclose(struct open_file *f)
-{
- if (beenhere) {
- WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_SHUTDOWN);
- WAITREG(NI_PCR, PCR_OWN);
- }
- return 0;
-}
diff --git a/sys/arch/vax/stand/boot/ra.c b/sys/arch/vax/stand/boot/ra.c
index c7242cf4f07..dbb0efca4ce 100644
--- a/sys/arch/vax/stand/boot/ra.c
+++ b/sys/arch/vax/stand/boot/ra.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ra.c,v 1.4 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: ra.c,v 1.5 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: ra.c,v 1.11 2002/06/04 15:13:55 ragge Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -46,9 +46,6 @@
#include "arch/vax/mscp/mscp.h"
#include "arch/vax/mscp/mscpreg.h"
-#include "arch/vax/bi/bireg.h"
-#include "arch/vax/bi/kdbreg.h"
-
#include "vaxstand.h"
static void command(int, int);
@@ -69,7 +66,7 @@ static volatile struct uda {
static struct disklabel ralabel;
static char io_buf[DEV_BSIZE];
-static int dpart, dunit, remap, is_tmscp, curblock;
+static int dpart, dunit, is_tmscp, curblock;
static volatile u_short *ra_ip, *ra_sa, *ra_sw;
static volatile u_int *mapregs;
@@ -95,56 +92,28 @@ raopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
dpart = part;
if (ctlr < 0)
ctlr = 0;
- remap = csrbase && nexaddr;
curblock = 0;
- if (csrbase) { /* On a uda-alike adapter */
- if (askname == 0) {
- csrbase = bootrpb.csrphy;
- dunit = bootrpb.unit;
- nexaddr = bootrpb.adpphy;
- } else
- csrbase += (ctlr ? 000334 : 012150);
- ra_ip = (short *)csrbase;
- ra_sa = ra_sw = (short *)csrbase + 1;
- if (nexaddr) { /* have map registers */
- mapregs = (int *)nexaddr + 512;
- mapregs[494] = PG_V | (((u_int)&uda) >> 9);
- mapregs[495] = mapregs[494] + 1;
- (char *)ubauda = (char *)0x3dc00 +
- (((u_int)(&uda))&0x1ff);
- } else
- ubauda = &uda;
- johan = (((u_int)ubauda) & 0xffff) + 8;
- johan2 = (((u_int)ubauda) >> 16) & 077;
- *ra_ip = 0; /* Start init */
- bootrpb.csrphy = csrbase;
- } else {
- paddr_t kdaddr;
- volatile int *w;
- volatile int i = 10000;
-
- if (askname == 0) {
- nexaddr = bootrpb.csrphy;
- dunit = bootrpb.unit;
- } else {
- nexaddr = (bootrpb.csrphy & ~(BI_NODESIZE - 1)) + KDB_IP;
- bootrpb.csrphy = nexaddr;
- }
-
- kdaddr = nexaddr & ~(BI_NODESIZE - 1);
- ra_ip = (short *)(kdaddr + KDB_IP);
- ra_sa = (short *)(kdaddr + KDB_SA);
- ra_sw = (short *)(kdaddr + KDB_SW);
- johan = ((u_int)&uda.uda_ca.ca_rspdsc) & 0xffff;
- johan2 = (((u_int)&uda.uda_ca.ca_rspdsc) & 0xffff0000) >> 16;
- w = (int *)(kdaddr + BIREG_VAXBICSR);
- *w = *w | BICSR_NRST;
- while (i--) /* Need delay??? */
- ;
- w = (int *)(kdaddr + BIREG_BER);
- *w = ~(BIBER_MBZ|BIBER_NMR|BIBER_UPEN);/* ??? */
+ /* Assume uda-alike adapter */
+ if (askname == 0) {
+ csrbase = bootrpb.csrphy;
+ dunit = bootrpb.unit;
+ nexaddr = bootrpb.adpphy;
+ } else
+ csrbase += (ctlr ? 000334 : 012150);
+ ra_ip = (short *)csrbase;
+ ra_sa = ra_sw = (short *)csrbase + 1;
+ if (nexaddr) { /* have map registers */
+ mapregs = (int *)nexaddr + 512;
+ mapregs[494] = PG_V | (((u_int)&uda) >> 9);
+ mapregs[495] = mapregs[494] + 1;
+ (char *)ubauda = (char *)0x3dc00 +
+ (((u_int)(&uda))&0x1ff);
+ } else
ubauda = &uda;
- }
+ johan = (((u_int)ubauda) & 0xffff) + 8;
+ johan2 = (((u_int)ubauda) >> 16) & 077;
+ *ra_ip = 0; /* Start init */
+ bootrpb.csrphy = csrbase;
#ifdef DEV_DEBUG
printf("start init\n");
@@ -264,18 +233,14 @@ rastrategy(void *f, int func, daddr32_t dblk,
u_int pfnum, mapnr, nsize;
#ifdef DEV_DEBUG
- printf("rastrategy: buf %p remap %d is_tmscp %d\n",
- buf, remap, is_tmscp);
+ printf("rastrategy: buf %p is_tmscp %d\n",
+ buf, is_tmscp);
#endif
- if (remap) {
- pfnum = (u_int)buf >> VAX_PGSHIFT;
+ pfnum = (u_int)buf >> VAX_PGSHIFT;
- for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0;
- nsize -= VAX_NBPG)
- mapregs[mapnr++] = PG_V | pfnum++;
- uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf) & 0x1ff;
- } else
- uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf);
+ for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0; nsize -= VAX_NBPG)
+ mapregs[mapnr++] = PG_V | pfnum++;
+ uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf) & 0x1ff;
if (is_tmscp) {
int i;
diff --git a/sys/arch/vax/stand/boot/tmscp.c b/sys/arch/vax/stand/boot/tmscp.c
deleted file mode 100644
index 4c72cad1711..00000000000
--- a/sys/arch/vax/stand/boot/tmscp.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* $OpenBSD: tmscp.c,v 1.4 2011/03/13 00:13:53 deraadt Exp $ */
-/* $NetBSD: tmscp.c,v 1.3 1999/06/30 18:19:26 ragge Exp $ */
-/*
- * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
- /* All bugs are subject to removal without further notice */
-
-#define NRSP 0 /* Kludge */
-#define NCMD 0 /* Kludge */
-
-#include "sys/param.h"
-#include "sys/disklabel.h"
-
-#include "lib/libsa/stand.h"
-
-#include "../include/pte.h"
-#include "arch/vax/mscp/mscp.h"
-#include "arch/vax/mscp/mscpreg.h"
-
-#include "vaxstand.h"
-
-static command(int,int);
-
-/*
- * These routines for TMSCP tape standalone boot is very simple,
- * assuming a lots of thing like that we only working at one tape at
- * a time, no separate routines for uba driver etc..
- * This code is directly copied from ra disk driver.
- */
-
-struct ra_softc {
- int udaddr;
- int ubaddr;
- int unit;
-};
-
-static volatile struct uda {
- struct mscp_1ca uda_ca; /* communications area */
- struct mscp uda_rsp; /* response packets */
- struct mscp uda_cmd; /* command packets */
-} uda;
-
-struct udadevice {
- short udaip;
- short udasa;
-};
-
-static volatile struct uda *ubauda;
-static volatile struct udadevice *udacsr;
-static struct ra_softc ra_softc;
-static int curblock;
-
-
-tmscpopen(f, adapt, ctlr, unit, part)
- struct open_file *f;
- int ctlr, unit, part;
-{
- char *msg;
- extern u_int tmsaddr;
- volatile struct ra_softc *ra=&ra_softc;
- volatile u_int *nisse;
- unsigned short johan;
- int i,err;
-
- curblock = 0;
- if(adapt>nuba) return(EADAPT);
- if(ctlr>nuda) return(ECTLR);
- ra->udaddr=uioaddr[adapt]+tmsaddr;
- ra->ubaddr=(int)ubaaddr[adapt];
- ra->unit=unit;
- udacsr=(void*)ra->udaddr;
- nisse=((u_int *)ubaaddr[adapt]) + 512;
- nisse[494]=PG_V|(((u_int)&uda)>>9);
- nisse[495]=nisse[494]+1;
- ubauda=(void*)0x3dc00+(((u_int)(&uda))&0x1ff);
-
- /*
- * Init of this tmscp ctlr.
- */
- udacsr->udaip=0; /* Start init */
- while((udacsr->udasa&MP_STEP1) == 0);
- udacsr->udasa=0x8000;
- while((udacsr->udasa&MP_STEP2) == 0);
- johan=(((u_int)ubauda)&0xffff)+8;
- udacsr->udasa=johan;
- while((udacsr->udasa&MP_STEP3) == 0);
- udacsr->udasa=3;
- while((udacsr->udasa&MP_STEP4) == 0);
- udacsr->udasa=0x0001;
-
- uda.uda_ca.ca_rspdsc=(int)&ubauda->uda_rsp.mscp_cmdref;
- uda.uda_ca.ca_cmddsc=(int)&ubauda->uda_cmd.mscp_cmdref;
- uda.uda_cmd.mscp_un.un_seq.seq_addr = (long *)&uda.uda_ca.ca_cmddsc;
- uda.uda_rsp.mscp_un.un_seq.seq_addr = (long *)&uda.uda_ca.ca_rspdsc;
- uda.uda_cmd.mscp_vcid = 1;
- uda.uda_cmd.mscp_un.un_sccc.sccc_ctlrflags = 0;
-
- command(M_OP_SETCTLRC, 0);
- uda.uda_cmd.mscp_unit=ra->unit;
- command(M_OP_ONLINE, 0);
-
- if (part) {
- uda.uda_cmd.mscp_un.un_seq.seq_buffer = part;
- command(M_OP_POS, 0);
- uda.uda_cmd.mscp_un.un_seq.seq_buffer = 0;
- }
-
- f->f_devdata=(void *)ra;
- return(0);
-}
-
-static
-command(cmd, arg)
-{
- volatile int hej;
-
- uda.uda_cmd.mscp_opcode = cmd;
- uda.uda_cmd.mscp_modifier = arg;
-
- uda.uda_cmd.mscp_msglen = MSCP_MSGLEN;
- uda.uda_rsp.mscp_msglen = MSCP_MSGLEN;
-
- uda.uda_ca.ca_rspdsc |= MSCP_OWN|MSCP_INT;
- uda.uda_ca.ca_cmddsc |= MSCP_OWN|MSCP_INT;
- hej = udacsr->udaip;
- while (uda.uda_ca.ca_rspdsc < 0) {
- if (uda.uda_ca.ca_cmdint)
- uda.uda_ca.ca_cmdint = 0;
- }
-
-}
-
-tmscpstrategy(ra, func, dblk, size, buf, rsize)
- struct ra_softc *ra;
- int func;
- daddr32_t dblk;
- char *buf;
- u_int size, *rsize;
-{
- u_int i,j,pfnum, mapnr, nsize, bn, cn, sn, tn;
- volatile struct udadevice *udadev=(void*)ra->udaddr;
- volatile u_int *ptmapp = (u_int *)ra->ubaddr + 512;
- volatile int hej;
-
- pfnum=(u_int)buf>>VAX_PGSHIFT;
-
- for(mapnr=0, nsize=size;(nsize+VAX_NBPG)>0;nsize-=VAX_NBPG)
- ptmapp[mapnr++]=PG_V|pfnum++;
-
- /*
- * First position tape. Remember where we are.
- */
- if (dblk < curblock) {
- uda.uda_cmd.mscp_seq.seq_bytecount = curblock - dblk;
- command(M_OP_POS, 12); /* 12 == step block backward */
- } else {
- uda.uda_cmd.mscp_seq.seq_bytecount = dblk - curblock;
- command(M_OP_POS, 4); /* 4 == step block forward */
- }
- curblock = size/512 + dblk;
-
- /*
- * Read in the number of blocks we need.
- * Why doesn't read of multiple blocks work?????
- */
- for (i = 0 ; i < size/512 ; i++) {
- uda.uda_cmd.mscp_seq.seq_lbn = 1;
- uda.uda_cmd.mscp_seq.seq_bytecount = 512;
- uda.uda_cmd.mscp_seq.seq_buffer =
- (((u_int)buf) & 0x1ff) + i * 512;
- uda.uda_cmd.mscp_unit = ra->unit;
- command(M_OP_READ, 0);
- }
-
- *rsize=size;
- return 0;
-}
diff --git a/sys/arch/vax/stand/boot/vaxstand.h b/sys/arch/vax/stand/boot/vaxstand.h
index 867d7ba9ebf..c8b41c4bfab 100644
--- a/sys/arch/vax/stand/boot/vaxstand.h
+++ b/sys/arch/vax/stand/boot/vaxstand.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vaxstand.h,v 1.2 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: vaxstand.h,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: vaxstand.h,v 1.5 2000/06/15 19:53:23 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -59,12 +59,6 @@ int net_devinit(struct open_file *f, struct netif_driver *drv, u_char *eaddr);
/* device calls */
int raopen(struct open_file *, int, int, int, int),
rastrategy(void *, int, daddr32_t, size_t, void *, size_t *);
-int hpopen(struct open_file *, int, int, int, int),
- hpstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
-int ctuopen(struct open_file *, int, int, int, int),
- ctustrategy(void *, int, daddr32_t, size_t, void *, size_t *);
-int tmscpopen(struct open_file *, int, int, int, int),
- tmscpstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
int romopen(struct open_file *, int, int, int, int),
romstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
int mfmopen(struct open_file *, int, int, int, int),
@@ -79,7 +73,5 @@ int zeopen(struct open_file *, int, int, int, int),
zeclose(struct open_file *);
int deopen(struct open_file *, int, int, int, int),
declose(struct open_file *);
-int niopen(struct open_file *, int, int, int, int),
- niclose(struct open_file *);
int netopen(struct open_file *), netclose(struct open_file *);
diff --git a/sys/arch/vax/stand/boot/version b/sys/arch/vax/stand/boot/version
index 8bc0f4ed6b7..fafc63cb8a6 100644
--- a/sys/arch/vax/stand/boot/version
+++ b/sys/arch/vax/stand/boot/version
@@ -1,4 +1,4 @@
-$OpenBSD: version,v 1.8 2008/08/26 18:36:21 miod Exp $
+$OpenBSD: version,v 1.9 2011/07/06 18:32:59 miod Exp $
$NetBSD: version,v 1.4 2001/11/09 19:53:15 scw Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
@@ -37,3 +37,4 @@ is taken as the current.
1.14: Support for VaxStation 3[58][24]0.
1.15: Restore boot sd()... functionality on machines with asc(4) or sii(4)
controllers.
+1.16: Remove support for VAX 11/7x0, VAX6000 and VAX8000
diff --git a/sys/arch/vax/stand/common/romread.S b/sys/arch/vax/stand/common/romread.S
index 4de1e0a90f8..18772e4cc7c 100644
--- a/sys/arch/vax/stand/common/romread.S
+++ b/sys/arch/vax/stand/common/romread.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: romread.S,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
+/* $OpenBSD: romread.S,v 1.2 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: romread.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -41,24 +41,6 @@
#include "../include/asm.h"
/*
- * read750 (int block, int *regs)
- */
-ENTRY(read750, 0xFFE)
- movl 8(ap), r8
- movl 4(r8), r1
- movl 8(r8), r2
- movl 12(r8), r3
- movl 24(r8), r6
- clrl r5
- movl 4(ap), r8
- pushl $0
- movl $0, 4(sp)
- movl fp, 0xf0000 # ragge ???
- jsb (r6)
- movl 0xf0000, fp
- ret
-
-/*
* romread_uvax (int lbn, int size, void *buf, struct rpb *rpb)
*/
ENTRY(romread_uvax, 0xFFE)
diff --git a/sys/arch/vax/stand/common/srt0.S b/sys/arch/vax/stand/common/srt0.S
index 8ff71c5a35c..093d3324a30 100644
--- a/sys/arch/vax/stand/common/srt0.S
+++ b/sys/arch/vax/stand/common/srt0.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: srt0.S,v 1.1 2002/06/11 09:36:24 hugh Exp $ */
+/* $OpenBSD: srt0.S,v 1.2 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: srt0.S,v 1.2 2002/03/31 00:11:14 matt Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -68,7 +68,6 @@ relocated: # now relocation is done !!!
halt # no return
ENTRY(machdep_start, 0)
- calls $0,_C_LABEL(niclose) # Evil hack to shutdown DEBNA.
mtpr $0x1f,$0x12 # Block all interrupts
mtpr $0,$0x18 # stop real time interrupt clock
movl 4(ap), r6
diff --git a/sys/arch/vax/stand/common/vaxstand.h b/sys/arch/vax/stand/common/vaxstand.h
index b11d898b0b3..0db8d099de8 100644
--- a/sys/arch/vax/stand/common/vaxstand.h
+++ b/sys/arch/vax/stand/common/vaxstand.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vaxstand.h,v 1.2 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: vaxstand.h,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: vaxstand.h,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,13 +33,10 @@
/* All bugs are subject to removal without further notice */
-#define MAXNMBA 8 /* Massbussadapters */
#define MAXNUBA 8 /* Unibusadapters */
-#define MAXMBAU 8 /* Units on an mba */
/* Variables used in autoconf */
-extern int nmba, nuba, nbi, nsbi, nuda;
-extern int *ubaaddr, *mbaaddr, *udaaddr, *uioaddr, *biaddr;
+extern int *ubaaddr, *mbaaddr, *udaaddr;
extern int cpunumber, howto;
extern dev_t bootdev;
diff --git a/sys/arch/vax/stand/xxboot/Makefile b/sys/arch/vax/stand/xxboot/Makefile
index b20744469d5..4b3a10f5b4a 100644
--- a/sys/arch/vax/stand/xxboot/Makefile
+++ b/sys/arch/vax/stand/xxboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.7 2007/11/25 18:25:33 deraadt Exp $
+# $OpenBSD: Makefile,v 1.8 2011/07/06 18:32:59 miod Exp $
# $NetBSD: Makefile,v 1.12 2002/02/24 01:04:25 matt Exp $
S= ${.CURDIR}/../../../../
@@ -7,7 +7,6 @@ PROG= xxboot
LINKS= ${BINDIR}/xxboot ${BINDIR}/raboot
LINKS+= ${BINDIR}/xxboot ${BINDIR}/hdboot
LINKS+= ${BINDIR}/xxboot ${BINDIR}/sdboot
-LINKS+= ${BINDIR}/xxboot ${BINDIR}/hpboot
WARNS?= 1
SRCS= start.S bootxx.c romread.S str.S urem.s udiv.s
diff --git a/sys/arch/vax/stand/xxboot/bootxx.c b/sys/arch/vax/stand/xxboot/bootxx.c
index debf2c0ee4f..fb13641dae2 100644
--- a/sys/arch/vax/stand/xxboot/bootxx.c
+++ b/sys/arch/vax/stand/xxboot/bootxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootxx.c,v 1.11 2011/03/13 00:13:53 deraadt Exp $ */
+/* $OpenBSD: bootxx.c,v 1.12 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: bootxx.c,v 1.16 2002/03/29 05:45:08 matt Exp $ */
/*-
@@ -49,9 +49,6 @@
#include "machine/rpb.h"
#include "../vax/gencons.h"
-#include "../mba/mbareg.h"
-#include "../mba/hpreg.h"
-
#define NRSP 1 /* Kludge */
#define NCMD 1 /* Kludge */
#define LIBSA_TOO_OLD
@@ -66,8 +63,6 @@
void Xmain(void);
void hoppabort(int);
void romread_uvax(int lbn, int size, void *buf, struct rpb *rpb);
-void hpread(int block);
-int read750(int block, int *regs);
int unit_init(int, struct rpb *, int);
struct open_file file;
@@ -82,13 +77,12 @@ volatile struct udadevice *csr;
static int moved;
extern int from;
-#define FROM750 1
#define FROMMV 2
#define FROMVMB 4
/*
- * The boot block are used by 11/750, 8200, MicroVAX II/III, VS2000,
- * VS3100/??, VS4000 and VAX6000/???, and only when booting from disk.
+ * The boot blocks are used by MicroVAX II/III, VS2000,
+ * VS3100, VS4000, and only when booting from disk.
*/
void
Xmain(void)
@@ -123,9 +117,6 @@ Xmain(void)
rpb->rpb_bootr5 = bootregs[5];
rpb->csrphy = bootregs[2];
rpb->adpphy = bootregs[1]; /* BI node on 8200 */
- if (rpb->devtyp != BDEV_HP && vax_cputype == VAX_TYP_750)
- rpb->adpphy =
- (bootregs[1] == 0xffe000 ? 0xf30000 : 0xf32000);
}
rpb->rpb_base = rpb;
rpb->iovec = (int)bqo;
@@ -233,14 +224,10 @@ devopen(struct open_file *f, const char *fname, char **file)
{
#ifdef LIBSA_TOO_OLD
- int i;
- struct devsw *dp;
f->f_dev = &devsw[0];
#endif
*file = (char *)fname;
- if (from == FROM750)
- return 0;
/*
* Reinit the VMB boot device.
*/
@@ -290,84 +277,13 @@ romstrategy(sc, func, dblk, size, buf, rsize)
}
}
- if (from == FROMMV) {
- romread_uvax(block, size, buf, rpb);
- } else /* if (from == FROM750) */ {
- while (size > 0) {
- if (rpb->devtyp == BDEV_HP)
- hpread(block);
- else
- read750(block, bootregs);
- bcopy(0, buf, 512);
- size -= 512;
- (char *)buf += 512;
- block++;
- }
- }
+ romread_uvax(block, size, buf, rpb);
if (rsize)
*rsize = nsize;
return 0;
}
-/*
- * The 11/750 boot ROM for Massbus disks doesn't seen to have layout info
- * for all RP disks (not RP07 at least) so therefore a very small and dumb
- * device driver is used. It assumes that there is a label on the disk
- * already that has valid layout info. If there is no label, we can't boot
- * anyway.
- */
-
-#define MBA_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((adpadr) + (reg)) = (val)));
-#define MBA_RCSR(reg) \
- (*(volatile u_int32_t *)((adpadr) + (reg)))
-#define HP_WCSR(reg, val) \
- ((void)(*(volatile u_int32_t *)((unitadr) + (reg)) = (val)));
-#define HP_RCSR(reg) \
- (*(volatile u_int32_t *)((unitadr) + (reg)))
-
-void
-hpread(int bn)
-{
- int adpadr = bootregs[1];
- int unitadr = adpadr + MUREG(bootregs[3], 0);
- u_int cn, sn, tn;
- struct disklabel *dp;
- extern char start;
-
- dp = (struct disklabel *)(LABELOFFSET + &start);
- MBA_WCSR(MAPREG(0), PG_V);
-
- MBA_WCSR(MBA_VAR, 0);
- MBA_WCSR(MBA_BC, (~512) + 1);
-#ifdef __GNUC__
- /*
- * Avoid four subroutine calls by using hardware division.
- */
- asm("clrl %r1;"
- "movl %3,%r0;"
- "ediv %4,%r0,%0,%1;"
- "movl %1,%r0;"
- "ediv %5,%r0,%2,%1"
- : "=g"(cn),"=g"(sn),"=g"(tn)
- : "g"(bn),"g"(dp->d_secpercyl),"g"(dp->d_nsectors)
- : "r0","r1","cc");
-#else
- cn = bn / dp->d_secpercyl;
- sn = bn % dp->d_secpercyl;
- tn = sn / dp->d_nsectors;
- sn = sn % dp->d_nsectors;
-#endif
- HP_WCSR(HP_DC, cn);
- HP_WCSR(HP_DA, (tn << 8) | sn);
- HP_WCSR(HP_CS1, HPCS_READ);
-
- while (MBA_RCSR(MBA_SR) & MBASR_DTBUSY)
- ;
- return;
-}
-
extern char end[];
static char *top = (char*)end;
diff --git a/sys/arch/vax/stand/xxboot/start.S b/sys/arch/vax/stand/xxboot/start.S
index ead88591dc4..df019026dc9 100644
--- a/sys/arch/vax/stand/xxboot/start.S
+++ b/sys/arch/vax/stand/xxboot/start.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: start.S,v 1.2 2003/11/07 10:16:45 jmc Exp $ */
+/* $OpenBSD: start.S,v 1.3 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: start.S,v 1.1 2002/02/24 01:04:26 matt Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -64,8 +64,7 @@ _C_LABEL(start):
brb from_0x08 # skip ...
.org 0x0C # 11/750 & 8200 starts here
- movzbl $1,_C_LABEL(from)# We booted from "old" rom.
- brw cont_750
+ halt # not supported
from_0x00: # uVAX from TK50
@@ -132,45 +131,6 @@ start_vmb:
_C_LABEL(from):
.long 0
-/*
- * After bootblock (LBN0) has been loaded into the first page
- * of good memory by 11/750's ROM-code (transfer address
- * of bootblock-code is: base of good memory + 0x0C) registers
- * are initialized as:
- * R0: type of boot-device
- * 0: Massbus device
- * 1: RK06/RK07
- * 2: RL02
- * 17: UDA50
- * 35: TK50
- * 64: TU58
- * R1: (UBA) address of UNIBUS I/O-page
- * (MBA) address of boot device's adapter
- * R2: (UBA) address of the boot device's CSR
- * (MBA) controller number of boot device
- * R6: address of driver subroutine in ROM
- *
- * cont_750 reads in LBN1-15 for further execution.
- */
-cont_750:
- movl $_C_LABEL(start), sp # move stack to avoid clobbering the code
- pushr $0x131 # save clobbered registers
- clrl r4 # %r4 == # of blocks transferred
- movab _C_LABEL(start),r5 # %r5 have base address for next transfer
- pushl r5 # ...on stack also (Why?)
-1: incl r4 # increment block count
- movl r4,r8 # LBN is in %r8 for rom routine
- addl2 $0x200,r5 # Increase address for next read
- cmpl $16,r4 # read 15 blocks?
- beql 2f # Yep
- movl r5,(sp) # move address to stack also
- jsb (r6) # read 512 bytes
- blbs r0,1b # jump if read succeeded
- halt # otherwise die...
-2: tstl (sp)+ # remove boring arg from stack
- popr $0x131 # restore clobbered registers
- brw start_all # Ok, continue...
-
/* uVAX main entry is at the start of the second disk block. This is
* needed for multi-arch CD booting where multiple architecture need
* to shove stuff in boot block 0.
diff --git a/sys/arch/vax/uba/qv.c b/sys/arch/vax/uba/qv.c
deleted file mode 100644
index 2623391d822..00000000000
--- a/sys/arch/vax/uba/qv.c
+++ /dev/null
@@ -1,1310 +0,0 @@
-/* $OpenBSD: qv.c,v 1.16 2010/11/18 21:15:14 miod Exp $ */
-/* $NetBSD: qv.c,v 1.2 1996/09/02 06:44:28 mycroft Exp $ */
-
-/*-
- * Copyright (c) 1988
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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. 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.
- *
- * @(#)qv.c 7.2 (Berkeley) 1/21/94
- */
-
-/*
- * derived from: @(#)qv.c 1.8 (ULTRIX) 8/21/85
- */
-
-/************************************************************************
- * *
- * Copyright (c) 1985 by *
- * Digital Equipment Corporation, Maynard, MA *
- * All rights reserved. *
- * *
- * This software is furnished under a license and may be used and *
- * copied only in accordance with the terms of such license and *
- * with the inclusion of the above copyright notice. This *
- * software or any other copies thereof may not be provided or *
- * otherwise made available to any other person. No title to and *
- * ownership of the software is hereby transferred. *
- * *
- * This software is derived from software received from the *
- * University of California, Berkeley, and from Bell *
- * Laboratories. Use, duplication, or disclosure is subject to *
- * restrictions under license agreements with University of *
- * California and with AT&T. *
- * *
- * The information in this software is subject to change without *
- * notice and should not be construed as a commitment by Digital *
- * Equipment Corporation. *
- * *
- * Digital assumes no responsibility for the use or reliability *
- * of its software on equipment which is not supplied by Digital. *
- * *
- ************************************************************************
- *
- * This driver provides glass tty functionality to the qvss. It is a strange
- * device in that it supports three subchannels. The first being the asr,
- * the second being a channel that intercepts the chars headed for the screen
- * ( like a pseudo tty ) and the third being a source of mouse state changes.
- * NOTE: the second is conditional on #ifdef CONS_HACK in this version
- * of the driver, as it's a total crock.
- *
- * There may be one and only one qvss in the system. This restriction is based
- * on the inability to map more than one at a time. This restriction will
- * exist until the kernel has shared memory services. This driver therefore
- * support a single unit. No attempt was made to have it service more.
- *
- * (this belongs in sccs - not here)
- *
- * 02 Aug 85 -- rjl
- * Changed the names of the special setup routines so that the system
- * can have a qvss or a qdss system console.
- *
- * 03 Jul 85 -- rjl
- * Added a check for virtual mode in qvputc so that the driver
- * doesn't crash while in a dump which is done in physical mode.
- *
- * 10 Apr 85 -- jg
- * Well, our theory about keyboard handling was wrong; most of the
- * keyboard is in autorepeat, down mode. These changes are to make
- * the qvss work the same as the Vs100, which is not necessarily
- * completely correct, as some chord usage may fail. But since we
- * can't easily change the Vs100, we might as well propagate the
- * problem to another device. There are also changes for screen and
- * mouse accellaration.
- *
- * 27 Mar 85 -- rjl
- * MicroVAX-II systems have interval timers that interrupt at ipl4.
- * Everything else is higher and thus causes us to miss clock ticks. The
- * problem isn't severe except in the case of a device like this one that
- * generates lots of interrupts. We aren't willing to make this change to
- * all device drivers but it seems acceptable in this case.
- *
- * 3 Dec 84 -- jg
- * To continue the tradition of building a better mouse trap, this
- * driver has been extended to form Vs100 style event queues. If the
- * mouse device is open, the keyboard events are intercepted and put
- * into the shared memory queue. Unfortunately, we are ending up with
- * one of the longest Unix device drivers. Sigh....
- *
- * 20 Nov 84 -- rjl
- * As a further complication this driver is required to function as the
- * virtual system console. This code runs before and during auto-
- * configuration and therefore is require to have a second path for setup.
- * It is further constrained to have a character output routine that
- * is not dependant on the interrupt system.
- *
- */
-
-
-#include <machine/pte.h>
-
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <vax/uba/qvioctl.h>
-#include <sys/tty.h>
-#include <sys/map.h>
-#include <sys/buf.h>
-#include <sys/vm.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/poll.h>
-#include <machine/cpu.h>
-#include <machine/mtpr.h>
-#include <vax/uba/ubareg.h>
-#include <vax/uba/ubavar.h>
-
-#define CONS_HACK
-
-struct uba_device *qvinfo[NQV];
-
-struct tty qv_tty[NQV*4];
-
-int nqv = NQV*4;
-
-/*
- * Definition of the driver for the auto-configuration program.
- */
-int qvprobe(), qvattach(), qvkint(), qvvint();
-u_short qvstd[] = { 0 };
-struct uba_driver qvdriver =
- { qvprobe, 0, qvattach, 0, qvstd, "qv", qvinfo };
-
-extern char qvmem[][512*NBPG];
-extern pt_entry_t QVmap[][512];
-
-/*
- * Local variables for the driver. Initialized for 15' screen
- * so that it can be used during the boot process.
- */
-
-#define QVWAITPRI (PZERO+1)
-#define QVSSMAJOR 40
-
-#define QVKEYBOARD 0 /* minor 0, keyboard/glass tty */
-#define QVPCONS 1 /* minor 1, console interceptor XXX */
-#define QVMOUSECHAN 2 /* minor 2, mouse */
-#define QVSPARE 3 /* unused */
-#define QVCHAN(unit) ((unit) & 03)
-/*
- * v_putc is the switch that is used to redirect the console cnputc to the
- * virtual console vputc. consops is used to redirect the console
- * device to the qvss console.
- */
-extern (*v_putc)();
-extern struct cdevsw *consops;
-/*
- * qv_def_scrn is used to select the appropriate tables. 0=15 inch 1=19 inch,
- * 2 = uVAXII.
- */
-int qv_def_scrn = 2;
-
-#define QVMAXEVQ 64 /* must be power of 2 */
-#define EVROUND(x) ((x) & (QVMAXEVQ - 1))
-
-/*
- * Screen parameters 15 & 19 inch monitors. These determine the max size in
- * pixel and character units for the display and cursor positions.
- * Notice that the mouse defaults to original square algorithm, but X
- * will change to its defaults once implemented.
- */
-struct qv_info *qv_scn;
-struct qv_info qv_scn_defaults[] = {
- {0, {0, 0}, 0, {0, 0}, 0, 0, 30, 80, 768, 480, 768-16, 480-16,
- 0, 0, 0, 0, 0, QVMAXEVQ, 0, 0, {0, 0}, {0, 0, 0, 0}, 2, 4},
- {0, {0, 0}, 0, {0, 0}, 0, 0, 55, 120, 960, 864, 960-16, 864-16,
- 0, 0, 0, 0, 0, QVMAXEVQ, 0, 0, {0, 0}, {0, 0, 0, 0}, 2, 4},
- {0, {0, 0}, 0, {0, 0}, 0, 0, 56, 120,1024, 864,1024-16, 864-16,
- 0, 0, 0, 0, 0, QVMAXEVQ, 0, 0, {0, 0}, {0, 0, 0, 0}, 2, 4}
-};
-
-/*
- * Screen controller initialization parameters. The definations and use
- * of these parameters can be found in the Motorola 68045 crtc specs. In
- * essence they set the display parameters for the chip. The first set is
- * for the 15" screen and the second is for the 19" separate sync. There
- * is also a third set for a 19" composite sync monitor which we have not
- * tested and which is not supported.
- */
-static short qv_crt_parms[][16] = {
- { 31, 25, 27, 0142, 31, 13, 30, 31, 4, 15, 040, 0, 0, 0, 0, 0 },
-/* VR100*/ { 39, 30, 32, 0262, 55, 5, 54, 54, 4, 15, 040, 0, 0, 0, 0, 0 },
-/* VR260*/ { 39, 32, 33, 0264, 56, 5, 54, 54, 4, 15, 040, 0, 0, 0, 0, 0},
-};
-
-/*
- * Screen parameters
- */
-struct qv_info *qv_scn;
-int maxqvmem = 254*1024 - sizeof(struct qv_info) - QVMAXEVQ*sizeof(vsEvent);
-
-/*
- * Keyboard state
- */
-struct qv_keyboard {
- int shift; /* state variables */
- int cntrl;
- int lock;
- char last; /* last character */
-} qv_keyboard;
-
-short divdefaults[15] = { LK_DOWN, /* 0 doesn't exist */
- LK_AUTODOWN, LK_AUTODOWN, LK_AUTODOWN, LK_DOWN,
- LK_UPDOWN, LK_UPDOWN, LK_AUTODOWN, LK_AUTODOWN,
- LK_AUTODOWN, LK_AUTODOWN, LK_AUTODOWN, LK_AUTODOWN,
- LK_DOWN, LK_AUTODOWN };
-
-short kbdinitstring[] = { /* reset any random keyboard stuff */
- LK_AR_ENABLE, /* we want autorepeat by default */
- LK_CL_ENABLE, /* keyclick */
- 0x84, /* keyclick volume */
- LK_KBD_ENABLE, /* the keyboard itself */
- LK_BELL_ENABLE, /* keyboard bell */
- 0x84, /* bell volume */
- LK_LED_DISABLE, /* keyboard leds */
- LED_ALL };
-#define KBD_INIT_LENGTH sizeof(kbdinitstring)/sizeof(short)
-
-#define TOY ((time.tv_sec * 100) + (time.tv_usec / 10000))
-
-int qv_ipl_lo = 1; /* IPL low flag */
-int mouseon = 0; /* mouse channel is enabled when 1*/
-struct proc *qvrsel; /* process waiting for select */
-
-int qvstart(), qvputc();
-
-/*
- * Keyboard translation and font tables
- */
-extern u_short q_key[], q_shift_key[], q_cursor[];
-extern char *q_special[], q_font[];
-
-/*
- * See if the qvss will interrupt.
- */
-
-/*ARGSUSED*/
-qvprobe(reg, ctlr)
- caddr_t reg;
- int ctlr;
-{
- register int br, cvec; /* these are ``value-result'' */
- register struct qvdevice *qvaddr = (struct qvdevice *)reg;
- static int tvec, ovec;
-
-#ifdef lint
- br = 0; cvec = br; br = cvec;
- qvkint(0); qvvint(0);
-#endif
- /*
- * Allocate the next two vectors
- */
- tvec = 0360;
- ovec = cvec;
- /*
- * Turn on the keyboard and vertical interrupt vectors.
- */
- qvaddr->qv_intcsr = 0; /* init the interrupt controller */
- qvaddr->qv_intcsr = 0x40; /* reset irr */
- qvaddr->qv_intcsr = 0x80; /* specify individual vectors */
- qvaddr->qv_intcsr = 0xc0; /* preset autoclear data */
- qvaddr->qv_intdata = 0xff; /* all setup as autoclear */
-
- qvaddr->qv_intcsr = 0xe0; /* preset vector address 1 */
- qvaddr->qv_intdata = tvec; /* give it the keyboard vector */
- qvaddr->qv_intcsr = 0x28; /* enable tx/rx interrupt */
-
- qvaddr->qv_intcsr = 0xe1; /* preset vector address 2 */
- qvaddr->qv_intdata = tvec+4; /* give it the vertical sysnc */
- qvaddr->qv_intcsr = 0x29; /* enable */
-
- qvaddr->qv_intcsr = 0xa1; /* arm the interrupt ctrl */
-
- qvaddr->qv_uartcmd = 0x15; /* set mode pntr/enable rx/tx */
- qvaddr->qv_uartmode = 0x17; /* noparity, 8-bit */
- qvaddr->qv_uartmode = 0x07; /* 1 stop bit */
- qvaddr->qv_uartstatus = 0x99; /* 4800 baud xmit/recv */
- qvaddr->qv_uartintstatus = 2; /* enable recv interrupts */
-
- qvaddr->qv_csr |= QV_INT_ENABLE | QV_CUR_MODE;
-
- DELAY(10000);
-
- qvaddr->qv_csr &= ~QV_INT_ENABLE;
-
- /*
- * If the qvss did interrupt it was the second vector not
- * the first so we have to return the first so that they
- * will be setup properly
- */
- if( ovec == cvec ) {
- return 0;
- } else
- cvec -= 4;
- return (sizeof (struct qvdevice));
-}
-
-/*
- * Routine called to attach a qv.
- */
-qvattach(ui)
- struct uba_device *ui;
-{
-
- /*
- * If not the console then we have to setup the screen
- */
- if (v_putc != qvputc || ui->ui_unit != 0)
- (void)qv_setup((struct qvdevice *)ui->ui_addr, ui->ui_unit, 1);
- else
- qv_scn->qvaddr = (struct qvdevice *)ui->ui_addr;
-}
-
-
-/*ARGSUSED*/
-qvopen(dev, flag)
- dev_t dev;
-{
- register struct tty *tp;
- register int unit, qv;
- register struct qvdevice *qvaddr;
- register struct uba_device *ui;
- register struct qv_info *qp = qv_scn;
-
- unit = minor(dev);
- qv = unit >> 2;
- if (unit >= nqv || (ui = qvinfo[qv])== 0 || ui->ui_alive == 0)
- return (ENXIO);
- if (QVCHAN(unit) == QVSPARE
-#ifndef CONS_HACK
- || QVCHAN(unit) == QVPCONS
-#endif
- )
- return (ENODEV);
- tp = &qv_tty[unit];
- if (tp->t_state&TS_XCLUDE && u.u_uid!=0)
- return (EBUSY);
- qvaddr = (struct qvdevice *)ui->ui_addr;
- qv_scn->qvaddr = qvaddr;
- tp->t_addr = (caddr_t)qvaddr;
- tp->t_oproc = qvstart;
-
- if ((tp->t_state&TS_ISOPEN) == 0) {
- ttychars(tp);
- tp->t_state = TS_ISOPEN|TS_CARR_ON;
- tp->t_ispeed = B9600;
- tp->t_ospeed = B9600;
- if( QVCHAN(unit) == QVKEYBOARD ) {
- /* make sure keyboard is always back to default */
- qvkbdreset();
- qvaddr->qv_csr |= QV_INT_ENABLE;
- tp->t_iflag = TTYDEF_IFLAG;
- tp->t_oflag = TTYDEF_OFLAG;
- tp->t_lflag = TTYDEF_LFLAG;
- tp->t_cflag = TTYDEF_CFLAG;
- }
- /* XXX ?why? else
- tp->t_flags = RAW;
- */
- }
- /*
- * Process line discipline specific open if its not the
- * mouse channel. For the mouse we init the ring ptr's.
- */
- if( QVCHAN(unit) != QVMOUSECHAN )
- return ((*linesw[tp->t_line].l_open)(dev, tp, p));
- else {
- mouseon = 1;
- /* set up event queue for later */
- qp->ibuff = (vsEvent *)qp - QVMAXEVQ;
- qp->iqsize = QVMAXEVQ;
- qp->ihead = qp->itail = 0;
- return 0;
- }
-}
-
-/*
- * Close a QVSS line.
- */
-/*ARGSUSED*/
-qvclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- register struct tty *tp;
- register unit;
- register struct qvdevice *qvaddr;
- int error;
-
- unit = minor(dev);
- tp = &qv_tty[unit];
-
- /*
- * If this is the keyboard unit (0) shutdown the
- * interface.
- */
- qvaddr = (struct qvdevice *)tp->t_addr;
- if (QVCHAN(unit) == QVKEYBOARD )
- qvaddr->qv_csr &= ~QV_INT_ENABLE;
-
- /*
- * If unit is not the mouse channel call the line disc.
- * otherwise clear the state flag, and put the keyboard into down/up.
- */
- if (QVCHAN(unit) != QVMOUSECHAN) {
- (*linesw[tp->t_line].l_close)(tp, flag, p);
- error = ttyclose(tp);
- } else {
- mouseon = 0;
- qv_init( qvaddr );
- error = 0;
- }
- tp->t_state = 0;
- return (error);
-}
-
-qvread(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- register struct tty *tp;
- int unit = minor( dev );
-
- if (QVCHAN(unit) != QVMOUSECHAN) {
- tp = &qv_tty[unit];
- return ((*linesw[tp->t_line].l_read)(tp, uio));
- }
- return (ENXIO);
-}
-
-qvwrite(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- register struct tty *tp;
- int unit = minor( dev );
-
- /*
- * If this is the mouse we simply fake the i/o, otherwise
- * we let the line disp. handle it.
- */
- if (QVCHAN(unit) == QVMOUSECHAN) {
- uio->uio_offset = uio->uio_resid;
- uio->uio_resid = 0;
- return 0;
- }
- tp = &qv_tty[unit];
- return ((*linesw[tp->t_line].l_write)(tp, uio));
-}
-
-
-/*
- * Mouse activity poll routine
- */
-int
-qvpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- struct qv_info *qp = qv_scn;
- int revents = 0;
- int s = spl5();
-
- if (QVCHAN(minor(dev)) != QVMOUSECHAN) {
- splx(s);
- return(ttpoll(dev, events, p));
- }
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (qp->ihead != qp->itail)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- qvrsel = u.u_procp;
- }
- splx(s);
- return(revents);
-}
-
-/*
- * QVSS keyboard interrupt.
- */
-qvkint(qv)
- int qv;
-{
- struct tty *tp;
- register c;
- struct uba_device *ui;
- register int key;
- register int i;
-
- ui = qvinfo[qv];
- if (ui == 0 || ui->ui_alive == 0)
- return;
- tp = &qv_tty[qv<<2];
- /*
- * Get a character from the keyboard.
- */
- key = ((struct qvdevice *)ui->ui_addr)->qv_uartdata & 0xff;
- if( mouseon == 0) {
- /*
- * Check for various keyboard errors
- */
- if( key == LK_POWER_ERROR || key == LK_KDOWN_ERROR ||
- key == LK_INPUT_ERROR || key == LK_OUTPUT_ERROR) {
- log(LOG_ERR,
- "qv%d: Keyboard error, code = %x\n",qv,key);
- return;
- }
- if( key < LK_LOWEST ) return;
- /*
- * See if its a state change key
- */
- switch ( key ) {
- case LOCK:
- qv_keyboard.lock ^= 0xffff; /* toggle */
- if( qv_keyboard.lock )
- qv_key_out( LK_LED_ENABLE );
- else
- qv_key_out( LK_LED_DISABLE );
- qv_key_out( LED_3 );
- return;
- case SHIFT:
- qv_keyboard.shift ^= 0xffff;
- return;
- case CNTRL:
- qv_keyboard.cntrl ^= 0xffff;
- return;
- case ALLUP:
- qv_keyboard.cntrl = qv_keyboard.shift = 0;
- return;
- case REPEAT:
- c = qv_keyboard.last;
- break;
- default:
- /*
- * Test for control characters. If set, see if the character
- * is eligible to become a control character.
- */
- if( qv_keyboard.cntrl ) {
- c = q_key[ key ];
- if( c >= ' ' && c <= '~' )
- c &= 0x1f;
- } else if( qv_keyboard.lock || qv_keyboard.shift )
- c = q_shift_key[ key ];
- else
- c = q_key[ key ];
- break;
- }
-
- qv_keyboard.last = c;
-
- /*
- * Check for special function keys
- */
- if( c & 0x80 ) {
- register char *string;
- string = q_special[ c & 0x7f ];
- while( *string )
- (*linesw[tp->t_line].l_rint)(*string++, tp);
- } else
- (*linesw[tp->t_line].l_rint)(c, tp);
- } else {
- /*
- * Mouse channel is open put it into the event queue
- * instead.
- */
- register struct qv_info *qp = qv_scn;
- register vsEvent *vep;
-
- if ((i = EVROUND(qp->itail+1)) == qp->ihead)
- return;
- vep = &qp->ibuff[qp->itail];
- vep->vse_direction = VSE_KBTRAW;
- vep->vse_type = VSE_BUTTON;
- vep->vse_device = VSE_DKB;
- vep->vse_x = qp->mouse.x;
- vep->vse_y = qp->mouse.y;
- vep->vse_time = TOY;
- vep->vse_key = key;
- qp->itail = i;
- if(qvrsel) {
- selwakeup(qvrsel,0);
- qvrsel = 0;
- }
- }
-}
-
-/*
- * Ioctl for QVSS.
- */
-/*ARGSUSED*/
-qvioctl(dev, cmd, data, flag)
- dev_t dev;
- register caddr_t data;
-{
- register struct tty *tp;
- register int unit = minor(dev);
- register struct qv_info *qp = qv_scn;
- register struct qv_kpcmd *qk;
- register unsigned char *cp;
- int error;
-
- /*
- * Check for and process qvss specific ioctl's
- */
- switch( cmd ) {
- case QIOCGINFO: /* return screen info */
- bcopy((caddr_t)qp, data, sizeof (struct qv_info));
- break;
-
- case QIOCSMSTATE: /* set mouse state */
- qp->mouse = *((vsCursor *)data);
- qv_pos_cur( qp->mouse.x, qp->mouse.y );
- break;
-
- case QIOCINIT: /* init screen */
- qv_init( qp->qvaddr );
- break;
-
- case QIOCKPCMD:
- qk = (struct qv_kpcmd *)data;
- if(qk->nbytes == 0) qk->cmd |= 0200;
- if(mouseon == 0) qk->cmd |= 1; /* no mode changes */
- qv_key_out(qk->cmd);
- cp = &qk->par[0];
- while(qk->nbytes-- > 0) { /* terminate parameters */
- if(qk->nbytes <= 0) *cp |= 0200;
- qv_key_out(*cp++);
- }
- break;
- case QIOCADDR: /* get struct addr */
- *(struct qv_info **) data = qp;
- break;
- default: /* not ours ?? */
- tp = &qv_tty[unit];
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag);
- if (error >= 0)
- return (error);
- error = ttioctl(tp, cmd, data, flag);
- if (error >= 0) {
- return (error);
- }
- break;
- }
- return (0);
-}
-/*
- * Initialize the screen and the scanmap
- */
-qv_init(qvaddr)
-struct qvdevice *qvaddr;
-{
- register short *scanline;
- register int i;
- register short scan;
- register char *ptr;
- register struct qv_info *qp = qv_scn;
-
- /*
- * Clear the bit map
- */
- for( i=0 , ptr = qp->bitmap ; i<240 ; i += 2 , ptr += 2048)
- bzero( ptr, 2048 );
- /*
- * Reinitialize the scanmap
- */
- scan = qvaddr->qv_csr & QV_MEM_BANK;
- scanline = qp->scanmap;
- for(i = 0 ; i < qp->max_y ; i++ )
- *scanline++ = scan++;
-
- /*
- * Home the cursor
- */
- qp->row = qp->col = 0;
-
- /*
- * Reset the cursor to the default type.
- */
- for( i=0 ; i<16 ; i++ )
- qp->cursorbits[i] = q_cursor[i];
- qvaddr->qv_csr |= QV_CUR_MODE;
- /*
- * Reset keyboard to default state.
- */
- qvkbdreset();
-}
-
-qvreset()
-{
-}
-qvkbdreset()
-{
- register int i;
- qv_key_out(LK_DEFAULTS);
- for( i=1 ; i < 15 ; i++ )
- qv_key_out( divdefaults[i] | (i<<3));
- for (i = 0; i < KBD_INIT_LENGTH; i++)
- qv_key_out(kbdinitstring[i]);
-}
-
-#define abs(x) (((x) > 0) ? (x) : (-(x)))
-/*
- * QVSS vertical sync interrupt
- */
-qvvint(qv)
- int qv;
-{
- extern int selwait;
- register struct qvdevice *qvaddr;
- struct uba_device *ui;
- register struct qv_info *qp = qv_scn;
- int unit;
- struct tty *tp0;
- int i;
- register int j;
- /*
- * Mouse state info
- */
- static ushort omouse = 0, nmouse = 0;
- static char omx=0, omy=0, mx=0, my=0, om_switch=0, m_switch=0;
- register int dx, dy;
-
- /*
- * Test and set the qv_ipl_lo flag. If the result is not zero then
- * someone else must have already gotten here.
- */
- if( --qv_ipl_lo )
- return;
- (void)spl4();
- ui = qvinfo[qv];
- unit = qv<<2;
- qvaddr = (struct qvdevice *)ui->ui_addr;
- tp0 = &qv_tty[QVCHAN(unit) + QVMOUSECHAN];
- /*
- * See if the mouse has moved.
- */
- if( omouse != (nmouse = qvaddr->qv_mouse) ) {
- omouse = nmouse;
- mx = nmouse & 0xff;
- my = nmouse >> 8;
- dy = my - omy; omy = my;
- dx = mx - omx; omx = mx;
- if( dy < 50 && dy > -50 && dx < 50 && dx > -50 ) {
- register vsEvent *vep;
- if( qp->mscale < 0 ) { /* Ray Lanza's original */
- if( dy < 0 )
- dy = -( dy * dy );
- else
- dy *= dy;
- if( dx < 0 )
- dx = -( dx * dx );
- else
- dx *= dx;
- }
- else { /* Vs100 style, see WGA spec */
- int thresh = qp->mthreshold;
- int scale = qp->mscale;
- if( abs(dx) > thresh ) {
- if ( dx < 0 )
- dx = (dx + thresh)*scale - thresh;
- else
- dx = (dx - thresh)*scale + thresh;
- }
- if( abs(dy) > thresh ) {
- if ( dy < 0 )
- dy = (dy + thresh)*scale - thresh;
- else
- dy = (dy - thresh)*scale + thresh;
- }
- }
- qp->mouse.x += dx;
- qp->mouse.y -= dy;
- if( qp->mouse.x < 0 )
- qp->mouse.x = 0;
- if( qp->mouse.y < 0 )
- qp->mouse.y = 0;
- if( qp->mouse.x > qp->max_cur_x )
- qp->mouse.x = qp->max_cur_x;
- if( qp->mouse.y > qp->max_cur_y )
- qp->mouse.y = qp->max_cur_y;
- if( tp0->t_state & TS_ISOPEN )
- qv_pos_cur( qp->mouse.x, qp->mouse.y );
- if (qp->mouse.y < qp->mbox.bottom &&
- qp->mouse.y >= qp->mbox.top &&
- qp->mouse.x < qp->mbox.right &&
- qp->mouse.x >= qp->mbox.left) goto switches;
- qp->mbox.bottom = 0; /* trash box */
- if (EVROUND(qp->itail+1) == qp->ihead)
- goto switches;
- i = EVROUND(qp->itail - 1);
- if ((qp->itail != qp->ihead) && (i != qp->ihead)) {
- vep = & qp->ibuff[i];
- if(vep->vse_type == VSE_MMOTION) {
- vep->vse_x = qp->mouse.x;
- vep->vse_y = qp->mouse.y;
- goto switches;
- }
- }
- /* put event into queue and do select */
- vep = & qp->ibuff[qp->itail];
- vep->vse_type = VSE_MMOTION;
- vep->vse_time = TOY;
- vep->vse_x = qp->mouse.x;
- vep->vse_y = qp->mouse.y;
- qp->itail = EVROUND(qp->itail+1);
- }
- }
- /*
- * See if mouse switches have changed.
- */
-switches:if( om_switch != ( m_switch = (qvaddr->qv_csr & QV_MOUSE_ANY) >> 8 ) ) {
- qp->mswitches = ~m_switch & 0x7;
- for (j = 0; j < 3; j++) { /* check each switch */
- register vsEvent *vep;
- if ( ((om_switch>>j) & 1) == ((m_switch>>j) & 1) )
- continue;
- /* check for room in the queue */
- if ((i = EVROUND(qp->itail+1)) == qp->ihead) return;
- /* put event into queue and do select */
- vep = &qp->ibuff[qp->itail];
- vep->vse_type = VSE_BUTTON;
- vep->vse_key = 2 - j;
- vep->vse_direction = VSE_KBTDOWN;
- if ( (m_switch >> j) & 1)
- vep->vse_direction = VSE_KBTUP;
- vep->vse_device = VSE_MOUSE;
- vep->vse_time = TOY;
- vep->vse_x = qp->mouse.x;
- vep->vse_y = qp->mouse.y;
- }
- qp->itail = i;
- om_switch = m_switch;
- qp->mswitches = m_switch;
- }
- /* if we have proc waiting, and event has happened, wake him up */
- if(qvrsel && (qp->ihead != qp->itail)) {
- selwakeup(qvrsel,0);
- qvrsel = 0;
- }
- /*
- * Okay we can take another hit now
- */
- qv_ipl_lo = 1;
-}
-
-/*
- * Start transmission
- */
-qvstart(tp)
- register struct tty *tp;
-{
- register int unit, c;
- register struct tty *tp0;
- int s;
-
- unit = minor(tp->t_dev);
-#ifdef CONS_HACK
- tp0 = &qv_tty[(unit&0xfc)+QVPCONS];
-#endif
- unit = QVCHAN(unit);
-
- s = spl5();
- /*
- * If it's currently active, or delaying, no need to do anything.
- */
- if (tp->t_state&(TS_TIMEOUT|TS_BUSY|TS_TTSTOP))
- goto out;
- /*
- * Display chars until the queue is empty, if the second subchannel
- * is open direct them there. Drop characters from subchannels other
- * than 0 on the floor.
- */
-
- while( tp->t_outq.c_cc ) {
- c = getc(&tp->t_outq);
- if (unit == QVKEYBOARD)
-#ifdef CONS_HACK
- if( tp0->t_state & TS_ISOPEN ){
- (*linesw[tp0->t_line].l_rint)(c, tp0);
- } else
-#endif
- qvputchar( c & 0xff );
- }
- /*
- * Position the cursor to the next character location.
- */
- qv_pos_cur( qv_scn->col*8, qv_scn->row*15 );
-
- /*
- * If there are sleepers, and output has drained below low
- * water mark, wake up the sleepers.
- */
- 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);
- }
- }
- tp->t_state &= ~TS_BUSY;
-out:
- splx(s);
-}
-
-/*
- * Stop output on a line, e.g. for ^S/^Q or output flush.
- */
-/*ARGSUSED*/
-void
-qvstop(tp, flag)
- register struct tty *tp;
- int flag;
-{
- register int s;
-
- /*
- * Block input/output interrupts while messing with state.
- */
- s = spl5();
- if (tp->t_state & TS_BUSY) {
- if ((tp->t_state&TS_TTSTOP)==0) {
- tp->t_state |= TS_FLUSH;
- } else
- tp->t_state &= ~TS_BUSY;
- }
- splx(s);
-}
-
-qvputc(c)
-char c;
-{
- qvputchar(c);
-}
-
-/*
- * Routine to display a character on the screen. The model used is a
- * glass tty. It is assumed that the user will only use this emulation
- * during system boot and that the screen will be eventually controlled
- * by a window manager.
- *
- */
-qvputchar( c )
-register char c;
-{
-
- register char *b_row, *f_row;
- register int i;
- register short *scanline;
- register int ote = 128;
- register struct qv_info *qp = qv_scn;
-
- /*
- * This routine may be called in physical mode by the dump code
- * so we check and punt if that's the case.
- */
- if( (mfpr(MAPEN) & 1) == 0 )
- return;
-
- c &= 0x7f;
-
- switch ( c ) {
- case '\t': /* tab */
- for( i = 8 - (qp->col & 0x7) ; i > 0 ; i-- )
- qvputchar( ' ' );
- break;
-
- case '\r': /* return */
- qp->col = 0;
- break;
-
- case '\010': /* backspace */
- if( --qp->col < 0 )
- qp->col = 0;
- break;
-
- case '\n': /* linefeed */
- if( qp->row+1 >= qp->max_row )
- qvscroll();
- else
- qp->row++;
- /*
- * Position the cursor to the next character location.
- */
- qv_pos_cur( qp->col*8, qp->row*15 );
- break;
-
- case '\007': /* bell */
- /*
- * We don't do anything to the keyboard until after
- * autoconfigure.
- */
- if( qp->qvaddr )
- qv_key_out( LK_RING_BELL );
- return;
-
- default:
- if( c >= ' ' && c <= '~' ) {
- scanline = qp->scanmap;
- b_row = qp->bitmap+(scanline[qp->row*15]&0x3ff)*128+qp->col;
- i = c - ' ';
- if( i < 0 || i > 95 )
- i = 0;
- else
- i *= 15;
- f_row = (char *)((int)q_font + i);
-
-/* for( i=0 ; i<15 ; i++ , b_row += 128, f_row++ )
- *b_row = *f_row;*/
- /* inline expansion for speed */
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
- *b_row = *f_row++; b_row += ote;
-
- if( ++qp->col >= qp->max_col ) {
- qp->col = 0 ;
- if( qp->row+1 >= qp->max_row )
- qvscroll();
- else
- qp->row++;
- }
- }
- break;
- }
-}
-
-/*
- * Position the cursor to a particular spot.
- */
-qv_pos_cur( x, y)
-register int x,y;
-{
- register struct qvdevice *qvaddr;
- register struct qv_info *qp = qv_scn;
- register index;
-
- if( qvaddr = qp->qvaddr ) {
- if( y < 0 || y > qp->max_cur_y )
- y = qp->max_cur_y;
- if( x < 0 || x > qp->max_cur_x )
- x = qp->max_cur_x;
- qp->cursor.x = x; /* keep track of real cursor*/
- qp->cursor.y = y; /* position, indep. of mouse*/
-
- qvaddr->qv_crtaddr = 10; /* select cursor start reg */
- qvaddr->qv_crtdata = y & 0xf;
- qvaddr->qv_crtaddr = 11; /* select cursor end reg */
- qvaddr->qv_crtdata = y & 0xf;
- qvaddr->qv_crtaddr = 14; /* select cursor y pos. */
- qvaddr->qv_crtdata = y >> 4;
- qvaddr->qv_xcur = x; /* pos x axis */
- /*
- * If the mouse is being used then we change the mode of
- * cursor display based on the pixels under the cursor
- */
- if( mouseon ) {
- index = y*128 + x/8;
- if( qp->bitmap[ index ] && qp->bitmap[ index+128 ] )
- qvaddr->qv_csr &= ~QV_CUR_MODE;
- else
- qvaddr->qv_csr |= QV_CUR_MODE;
- }
- }
-}
-/*
- * Scroll the bitmap by moving the scanline map words. This could
- * be done by moving the bitmap but it's much too slow for a full screen.
- * The only drawback is that the scanline map must be reset when the user
- * wants to do graphics.
- */
-qvscroll()
-{
- short tmpscanlines[15];
- register char *b_row;
- register short *scanline;
- register struct qv_info *qp = qv_scn;
-
- /*
- * If the mouse is on we don't scroll so that the bit map
- * remains sane.
- */
- if( mouseon ) {
- qp->row = 0;
- return;
- }
- /*
- * Save the first 15 scanlines so that we can put them at
- * the bottom when done.
- */
- bcopy((caddr_t)qp->scanmap, (caddr_t)tmpscanlines, sizeof tmpscanlines);
-
- /*
- * Clear the wrapping line so that it won't flash on the bottom
- * of the screen.
- */
- scanline = qp->scanmap;
- b_row = qp->bitmap+(*scanline&0x3ff)*128;
- bzero( b_row, 1920 );
-
- /*
- * Now move the scanlines down
- */
- bcopy((caddr_t)(qp->scanmap+15), (caddr_t)qp->scanmap,
- (qp->row * 15) * sizeof (short) );
-
- /*
- * Now put the other lines back
- */
- bcopy((caddr_t)tmpscanlines, (caddr_t)(qp->scanmap+(qp->row * 15)),
- sizeof (tmpscanlines) );
-
-}
-
-/*
- * Output to the keyboard. This routine status polls the transmitter on the
- * keyboard to output a code. The timer is to avoid hanging on a bad device.
- */
-qv_key_out(c)
- u_short c;
-{
- int timer = 30000;
- register struct qv_info *qp = qv_scn;
-
- if (qp->qvaddr) {
- while ((qp->qvaddr->qv_uartstatus & 0x4) == 0 && timer--)
- ;
- qp->qvaddr->qv_uartdata = c;
- }
-}
-/*
- * Virtual console initialization. This routine sets up the qvss so that it can
- * be used as the system console. It is invoked before autoconfig and has to do
- * everything necessary to allow the device to serve as the system console.
- * In this case it must map the q-bus and device areas and initialize the qvss
- * screen.
- */
-qvcons_init()
-{
- struct percpu *pcpu; /* pointer to percpu structure */
- register struct qbus *qb;
- struct qvdevice *qvaddr; /* device pointer */
- short *devptr; /* virtual device space */
- extern cnputc(); /* standard serial console putc */
-#define QVSSCSR 017200
-
- /*
- * If secondary console already configured,
- * don't override the previous one.
- */
- if (v_putc != cnputc)
- return 0;
- /*
- * find the percpu entry that matches this machine.
- */
- for( pcpu = percpu ; pcpu && pcpu->pc_cputype != cpu ; pcpu++ )
- ;
- if( pcpu == NULL )
- return 0;
- if (pcpu->pc_io->io_type != IO_QBUS)
- return 0;
-
- /*
- * Found an entry for this cpu. Because this device is Microvax specific
- * we assume that there is a single q-bus and don't have to worry about
- * multiple adapters.
- *
- * Map the device registers.
- */
- qb = (struct qbus *)pcpu->pc_io->io_details;
- ioaccess(qb->qb_iopage, UMEMmap[0] + qb->qb_memsize, UBAIOPAGES * NBPG);
-
- /*
- * See if the qvss is there.
- */
- devptr = (short *)((char *)umem[0] + (qb->qb_memsize * NBPG));
- qvaddr = (struct qvdevice *)((u_int)devptr + ubdevreg(QVSSCSR));
- if (badaddr((caddr_t)qvaddr, sizeof(short)))
- return 0;
- /*
- * Okay the device is there lets set it up
- */
- if (!qv_setup(qvaddr, 0, 0))
- return 0;
- v_putc = qvputc;
- consops = &cdevsw[QVSSMAJOR];
- return 1;
-}
-/*
- * Do the board specific setup
- */
-qv_setup(qvaddr, unit, probed)
-struct qvdevice *qvaddr;
-int unit;
-int probed;
-{
- caddr_t qvssmem; /* pointer to the display mem */
- register i; /* simple index */
- register struct qv_info *qp;
- register int *pte;
- struct percpu *pcpu; /* pointer to percpu structure */
- register struct qbus *qb;
-
- /*
- * find the percpu entry that matches this machine.
- */
- for( pcpu = percpu ; pcpu && pcpu->pc_cputype != cpu ; pcpu++ )
- ;
- if( pcpu == NULL )
- return(0);
-
- /*
- * Found an entry for this cpu. Because this device is Microvax specific
- * we assume that there is a single q-bus and don't have to worry about
- * multiple adapters.
- *
- * Map the device memory.
- */
- qb = (struct qbus *)pcpu->pc_io->io_details;
-
- i = (u_int)(qvaddr->qv_csr & QV_MEM_BANK) << 7;
- ioaccess(qb->qb_maddr + i, QVmap[unit], 512 * NBPG);
- qvssmem = qvmem[unit];
- pte = (int *)(QVmap[unit]);
- for (i=0; i < 512; i++, pte++)
- *pte = (*pte & ~PG_PROT) | PG_UW | PG_V;
-
- qv_scn = (struct qv_info *)((u_int)qvssmem + 251*1024);
- qp = qv_scn;
- if( (qvaddr->qv_csr & QV_19INCH) && qv_def_scrn == 0)
- qv_def_scrn = 1;
- *qv_scn = qv_scn_defaults[ qv_def_scrn ];
- if (probed)
- qp->qvaddr = qvaddr;
- qp->bitmap = qvssmem;
- qp->scanmap = (short *)((u_int)qvssmem + 254*1024);
- qp->cursorbits = (short *)((u_int)qvssmem + 256*1024-32);
- /* set up event queue for later */
- qp->ibuff = (vsEvent *)qp - QVMAXEVQ;
- qp->iqsize = QVMAXEVQ;
- qp->ihead = qp->itail = 0;
-
- /*
- * Setup the crt controller chip.
- */
- for( i=0 ; i<16 ; i++ ) {
- qvaddr->qv_crtaddr = i;
- qvaddr->qv_crtdata = qv_crt_parms[ qv_def_scrn ][ i ];
- }
- /*
- * Setup the display.
- */
- qv_init( qvaddr );
-
- /*
- * Turn on the video
- */
- qvaddr->qv_csr |= QV_VIDEO_ENA ;
- return 1;
-}
diff --git a/sys/arch/vax/uba/ts.c b/sys/arch/vax/uba/ts.c
deleted file mode 100644
index 9d443e6659d..00000000000
--- a/sys/arch/vax/uba/ts.c
+++ /dev/null
@@ -1,1454 +0,0 @@
-/* $OpenBSD: ts.c,v 1.20 2008/06/12 06:58:37 deraadt Exp $ */
-/* $NetBSD: ts.c,v 1.11 1997/01/11 11:34:43 ragge Exp $ */
-
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)tmscp.c 7.16 (Berkeley) 5/9/91
- */
-
-/*
- * sccsid = "@(#)tmscp.c 1.24 (ULTRIX) 1/21/86";
- */
-
-/************************************************************************
- * *
- * Licensed from Digital Equipment Corporation *
- * Copyright (c) *
- * Digital Equipment Corporation *
- * Maynard, Massachusetts *
- * 1985, 1986 *
- * All rights reserved. *
- * *
- * The Information in this software is subject to change *
- * without notice and should not be construed as a commitment *
- * by Digital Equipment Corporation. Digital makes no *
- * representations about the suitability of this software for *
- * any purpose. It is supplied "As Is" without expressed or *
- * implied warranty. *
- * *
- * If the Regents of the University of California or its *
- * licensees modify the software in a manner creating *
- * diriviative copyright rights, appropriate copyright *
- * legends may be placed on the drivative work in addition *
- * to that set forth above. *
- * *
- ************************************************************************/
-
-/*
- * TSV05/TS05 device driver, written by Bertram Barth.
- *
- * should be TS11 compatible (untested)
- */
-
-#define TS11_COMPAT /* don't use extended features provided by TS05 */
-
-#ifdef NEED_18BIT
-#define TS_UBAFLAGS UBA_NEED16
-#else
-#define TS_UBAFLAGS 0
-#endif
-
-#define ENABLE_ESS
-#define ENABLE_END
-
-#define ENABLE_EAI /* enable Attention-Interrupts */
-#undef ENABLE_EAI
-
-#define ENABLE_ERI /* Enable Release Buffer Interrupts */
-#undef ENABLE_ERI
-
-#ifdef DEBUG
-int tsdebug = 1;
-# define debug(x) if (tsdebug > 0) {DELAY(2000); printf x; DELAY(3000);}
-# define debug10(x) if (tsdebug > 9) printf x
-#else
-# define debug(x) /* just ignore it */
-# define debug10(x) /* just ignore it */
-#endif
-
-#ifdef TRACE
-int tstrace = 1;
-# define trace(x) if (tstrace > 0) {DELAY(2000); printf x; DELAY(3000);}
-#else
-# define trace(x) /* just ignore it */
-#endif
-
-/*
- * TODO: most :-)
- *
- * include uba-mapping into tsinit();
- * merge tsinit(), tsreset() and tsprobe();
- * complete tsintr();
- * add proper error/status messages
- * make messages appear where they are intended to.
- * check for termination-classes and appropriate actions.
- * check if flags like CVC and ATTN should be used.
- * look for correct handling of attentions.
- * check for correct usage of retry-commands.
- * ...
- */
-
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/errno.h>
-#include <sys/file.h>
-#include <sys/syslog.h>
-#include <sys/ioctl.h>
-#include <sys/mtio.h>
-#include <sys/uio.h>
-#include <sys/proc.h>
-
-#include <machine/pte.h>
-#include <machine/sid.h>
-#include <machine/cpu.h>
-#include <machine/mtpr.h>
-
-#include <vax/uba/ubareg.h>
-#include <vax/uba/ubavar.h>
-
-#include <vax/uba/tsreg.h>
-
-#include "ts.h"
-
-/*
- * ts command packets and communication area (per controller)
- */
-struct ts {
- struct tsdevice *reg; /* address of i/o-registers */
- struct tscmd cmd; /* command packet(s) */
- struct tsmsg msg; /* message packet(s) */
-} ts[NTS];
-
-/*
- * Software status, per controller.
- * also status per tape-unit, since only one unit per controller
- * (thus we have no struct ts_info)
- */
-struct ts_softc {
- struct device sc_dev; /* Autoconf ... */
- struct uba_unit sc_unit; /* Struct common for UBA to talk */
- struct ts *sc_ts; /* Unibus address of uda struct */
- short sc_mapped; /* Unibus map allocated ? */
- int sc_ubainfo; /* Unibus mapping info */
- short sc_state; /* see below: ST_xxx */
- short sc_flags; /* see below: FL_xxx */
- short sc_lcmd; /* last command word */
- short sc_rtc; /* retry count for lcmd */
- short sc_lssr; /* last status register */
- short sc_lmsgh; /* last message header */
- short sc_lxst0; /* last status word */
- short sc_cmdf; /* command flags (ack,cvc,ie) */
- short sc_openf; /* lock against multiple opens */
- short sc_liowf; /* last operation was write */
- int sc_micro; /* microcode revision */
- int sc_ivec; /* interrupt vector address */
- short sc_ipl; /* interrupt priority, Q-bus */
-};
-
-void tsintr(int);
-int tsinit(struct ts_softc *);
-void tscommand(dev_t, int, int);
-int tsstatus(int);
-int tsexec(int, int);
-int tsstart(struct ts_softc *, struct buf *);
-int tswchar(int);
-void tsreset(int);
-void tsxstatus(struct tsmsg *);
-int tsmatch(struct device *, void *, void *);
-void tsattach(struct device *, struct device *, void *);
-void tsstrategy(struct buf *);
-
-int tsopen(dev_t, int, int, struct proc *);
-int tsclose(dev_t, int, int, struct proc *);
-int tsioctl(dev_t, u_long, caddr_t, int, struct proc *);
-int tsread(dev_t, struct uio *);
-int tswrite(dev_t, struct uio *);
-int tsdump(dev_t, daddr64_t, caddr_t, size_t);
-
-struct cfdriver ts_cd = {
- NULL, "ts", DV_DULL
-};
-
-struct cfattach ts_ca = {
- sizeof(struct ts_softc), tsmatch, tsattach
-};
-
-
-#define ST_INVALID 0 /* uninitialized, before probe */
-#define ST_PROBE 1 /* during tsprobe(), not used */
-#define ST_SLAVE 2 /* in tsslave(), init almost complete */
-#define ST_ATTACH 3 /* during tsattach(), not used */
-#define ST_INITIALIZED 4 /* init completed, set by tsintr() */
-#define ST_RUNNING 5
-#define ST_IDLE 6
-#define ST_BUSY 7
-
-/* Bits in minor device */
-#define TS_UNIT(dev) (minor(dev)&03)
-#define TS_HIDENSITY 010
-
-#define TS_PRI LOG_INFO
-
-
-/*
- * Since we don't have credits and thus only one operation per time,
- * we don't have and don't need queues like MSCP/TMSCP use them.
- * Per controller we only need one internal buffer for ioctls and
- * two pointers to buffers to simulate similar behaviour ...
- */
-struct buf ts_cbuf[NTS]; /* internal cmd buffer (for ioctls) */
-struct buf *ts_wtab[NTS]; /* dummy I/O wait queue */
-#define b_ubinfo b_resid /* Unibus mapping info, per buffer */
-
-/*----------------------------------------------------------------------*/
-
-/*
- * Initialize a TS device. Set up UBA mapping registers,
- * initialize data structures, what else ???
- */
-int
-tsinit (sc)
- struct ts_softc *sc;
-{
- volatile struct tsdevice *tsregs;
- int unit = sc->sc_dev.dv_unit;
- struct uba_unit *uu;
-
- uu = &sc->sc_unit;
- tsregs = (struct tsdevice *)ts[unit].reg;
- if (sc->sc_mapped == 0) {
- /*
- * Map the communications area and command and message
- * buffer into Unibus address space.
- */
- sc->sc_ubainfo = uballoc((struct uba_softc *)
- sc->sc_dev.dv_parent,
- (caddr_t)&ts[unit], sizeof (struct ts), TS_UBAFLAGS);
- sc->sc_ts = (struct ts *)(UBAI_ADDR(sc->sc_ubainfo));
- sc->sc_mapped = 1;
- }
-
- /*
- * bertram: start hardware initialization ??????
- */
-
- /* tsreset(unit); */
-
- return (1);
-}
-
-/*
- * send a command using the default command-buffer for this unit/controller.
- * If a command-word is given, then assemble a one-word command.
- * other words in command-buffer are unchanged and must thus be initialized
- * before calling this function.
- */
-int
-tsexec (ctlr, cmd)
- int ctlr;
- int cmd;
-{
- register struct ts_softc *sc = ts_cd.cd_devs[ctlr];
- register struct tscmd *tscmdp = &ts[ctlr].cmd;
- register long tscmdma = (long)&sc->sc_ts->cmd; /* mapped address */
- volatile struct tsdevice *tsreg = ts[ctlr].reg;
- volatile char *dbx = ((char *)tsreg) + 3;
- volatile short sr;
-
- sc->sc_cmdf |= TS_CF_ACK | TS_CF_IE;
- tscmdp->cmdr = sc->sc_cmdf | cmd;
- tscmdp->cmdr = TS_CF_ACK | TS_CF_IE | sc->sc_cmdf | cmd;
- sc->sc_cmdf = 0; /* XXX */
-
-#ifdef DEBUG
- switch (tscmdp->cmdr & TS_CF_CMASK) {
- case TS_CMD_RNF: cmdName = "Read Next (Forward)"; break;
- case TS_CMD_RPR: cmdName = "Read Previous (Reverse)"; break;
- case TS_CMD_WCHAR: cmdName = "Write Characteristics"; break;
- case TS_CMD_WD: cmdName = "Write Data (Next)"; break;
- case TS_CMD_WDR: cmdName = "Write Data (Retry)"; break;
- case TS_CMD_SRF: cmdName = "Space Records Forward"; break;
- case TS_CMD_SRR: cmdName = "Space Records Reverse"; break;
- case TS_CMD_STMF: cmdName = "Skip Tape Marks Forward"; break;
- case TS_CMD_STMR: cmdName = "Skip Tape Marks Reverse"; break;
- case TS_CMD_RWND: cmdName = "Rewind"; break;
- case TS_CMD_WTM: cmdName = "Write Tape Mark"; break;
- case TS_CMD_WTMR: cmdName = "Write Tape Mark (Retry)"; break;
- case TS_CMD_STAT: cmdName = "Get Status (END)"; break;
- default: cmdName = "Unexpected Command"; break;
- }
-#endif
-
- sr = tsreg->tssr;
- if ((sr & TS_SSR) == 0) { /* subsystem NOT ready */
- printf ("%s%d: subsystem not ready [%x]\n",
- sc->sc_dev.dv_xname, sr);
- return (-1);
- }
- dbx = ((char *)tsreg) + 3; /* dbx is located at the fourth byte */
- *dbx = (tscmdma >> 18) & 0x0F; /* load bits 18-21 into dbx */
-
- /* possible race-condition with ATTN !!! */
-
- sr = tsreg->tssr;
- if ((sr & TS_RMR) != 0) { /* Register modification Refused */
- printf ("ts: error writing TSDBX\n");
- return (-1);
- }
- /* now load bits 15-2 at pos 15-2 and bits 17,16 at pos 1,0 of TSDB */
- tsreg->tsdb = (tscmdma & 0xfffc) | ((tscmdma >> 16) & 0x03);
-
- /*
- * wait for SSR or RMR to show up
- */
- sr = tsreg->tssr;
- if ((sr & TS_SSR) != 0) { /* something went wrong .. */
- if (sr & TS_RMR) {
- printf ("ts: error writing TSDB (RMR)\n");
- return (-1);
- }
- if (sr & TS_NXM) {
- printf ("ts: error writing TSDB (NXM)\n");
- return (-1);
- }
- printf ("ts: error 0x%x while writing TSDB\n", sr);
- tsstatus (sr);
- return (-1);
- }
-
- return (0); /* completed successfully */
-}
-
-/*
- * Execute a (ioctl) command on the tape drive a specified number of times.
- * This routine sets up a buffer and calls the strategy routine which
- * issues the command to the controller.
- */
-void
-tscommand (dev, cmd, count)
- register dev_t dev;
- int cmd;
- int count;
-{
- register struct buf *bp;
- register int s;
-
- trace (("tscommand (%d, %x, %d)\n", TS_UNIT(dev), cmd, count));
-
- s = splbio();
- bp = &ts_cbuf[TS_UNIT(dev)];
-
- while (bp->b_flags & B_BUSY) {
- /*
- * This special check is because B_BUSY never
- * gets cleared in the non-waiting rewind case. ???
- */
- if (bp->b_bcount == 0 && (bp->b_flags & B_DONE))
- break;
- bp->b_flags |= B_WANTED;
- tsleep ((caddr_t)bp, PRIBIO, "tscommand", 0);
- /* check MOT-flag !!! */
- }
- bp->b_flags = B_BUSY | B_READ | B_RAW;
-
- splx(s);
-
- /*
- * Load the buffer. The b_count field gets used to hold the command
- * count. the b_resid field gets used to hold the command mneumonic.
- * These 2 fields are "known" to be "safe" to use for this purpose.
- * (Most other drivers also use these fields in this way.)
- */
- bp->b_dev = dev;
- bp->b_bcount = count;
- bp->b_resid = cmd;
- bp->b_blkno = 0;
- tsstrategy (bp);
- /*
- * In case of rewind from close, don't wait.
- * This is the only case where count can be 0.
- */
- if (count == 0) {
- debug (("tscommand: direct return, no biowait.\n"));
- return;
- }
- debug (("tscommand: calling biowait ...\n"));
- biowait (bp);
- if (bp->b_flags & B_WANTED)
- wakeup ((caddr_t)bp);
- bp->b_flags &= B_ERROR;
-}
-
-/*
- * Start an I/O operation on TS05 controller
- */
-int
-tsstart (sc, bp)
- register struct ts_softc *sc;
- register struct buf *bp;
-{
- int ctlr = sc->sc_dev.dv_unit;
- volatile struct tsdevice *tsreg = ts[ctlr].reg;
- register struct tscmd *tscmdp = &ts[ctlr].cmd;
- register struct buf *dp;
- volatile int i, itmp;
- int ioctl;
- int cmd;
- int s;
-
- if ((dp = ts_wtab[ctlr]) != NULL) {
- /*
- * There's already a command pending ...
- * Either we are called by tsintr or we have missed
- * something important (race condition).
- */
-
- /* bertram: ubarelse ??? */
- ts_wtab[ctlr] = NULL;
- dp->b_flags |= B_ERROR;
- s = splbio();
- biodone (dp);
- splx(s);
-
- if (tsreg->tssr & TS_SC) { /* Special Condition; Error */
- log (TS_PRI, "%s: tssr 0x%x, state %d\n",
- sc->sc_dev.dv_xname, tsreg->tssr, sc->sc_state);
- tsinit (sc);
- return (-1);
- }
- /* XXX */
- }
-
- /*
- * Check if command is an ioctl or not (ie. read or write).
- * If it's an ioctl then just set the flags for later use;
- * For other commands attempt to setup a buffer pointer.
- */
- if (bp == &ts_cbuf[ctlr]) {
- ioctl = 1;
- } else {
- ioctl = 0;
-
- /*
- * now we try to map the buffer into uba map space (???)
- */
- i = TS_UBAFLAGS;
- switch (vax_cputype) {
- case VAX_8600:
- case VAX_780:
- i |= UBA_CANTWAIT;
- break;
- case VAX_750:
- i |= sc->sc_unit.uu_ubinfo | UBA_CANTWAIT;
- break;
- case VAX_730:
- case VAX_78032:
- i |= UBA_CANTWAIT;
- break;
- default:
- printf ("unsupported cpu %d in tsstart.\n", vax_cputype);
- } /* end switch (vax_cputype) */
-
- if ((i = ubasetup(sc->sc_dev.dv_parent->dv_unit, bp, i)) == 0) {
- /*
- * For some reasons which I don't (yet? :) understand,
- * tmscp.c initiates in this situation a GET-UNIT
- * command. (Because no data-buffers are necessary?)
- */
- cmd = TS_CMD_STAT;
- goto do_cmd;
- return (-1); /* ??? */
- }
-#if defined(VAX750)
- if (vax_cputype == VAX_750)
- itmp = i & 0xfffffff; /* mask off bdp */
- else
-#endif
- itmp = i;
-
- /* XXX */
- }
-
- /*
- * If it's an ioctl command, then assemble the command.
- * The "b_resid" field holds the command-number as defined
- * in <sys/mtio.h>
- */
- if (ioctl) {
- switch ((int)bp->b_resid) {
- case MTWEOF:
- cmd = TS_CMD_WTM;
- break;
- case MTFSF:
- cmd = TS_CMD_STMF;
- tscmdp->cw1 = bp->b_bcount;
- break;
- case MTBSF:
- cmd = TS_CMD_STMR;
- tscmdp->cw1 = bp->b_bcount;
- break;
- case MTFSR:
- cmd = TS_CMD_SRF;
- tscmdp->cw1 = bp->b_bcount;
- break;
- case MTBSR:
- cmd = TS_CMD_SRR;
- tscmdp->cw1 = bp->b_bcount;
- break;
- case MTREW:
- cmd = TS_CMD_RWND;
-#ifndef TS11_COMPAT
- if (bp->b_bcount == 0) {
- cmd = TS_CMD_RWII;
- }
-#endif
- break;
- case MTOFFL:
- cmd = TS_CMD_RWUL;
- break;
- case MTNOP:
- cmd = TS_CMD_STAT;
- break;
- default:
- printf ("%s: bad ioctl %d\n", sc->sc_dev.dv_xname,
- (int)bp->b_resid);
- /* Need a no-op. get status */
- cmd = TS_CMD_STAT;
- } /* end switch (bp->b_resid) */
- } else { /* Its a read/write command (not an ioctl) */
- tscmdp->cw1 = UBAI_ADDR(i) & 0xffff;
- tscmdp->cw2 = (UBAI_ADDR(i) >> 16) & 0x3f;
- tscmdp->cw3 = bp->b_bcount;
-
- if (bp->b_flags & B_READ) {
- cmd = TS_CMD_RNF;
- }
- else {
- cmd = TS_CMD_WD;
- }
- bp->b_ubinfo = itmp; /* save mapping info */
- }
-
- /*
- * Move buffer to I/O wait pseudo-queue
- */
- if (ts_wtab[ctlr]) {
- /*
- * we are already waiting for something ...
- * this should not happen, so we have a problem now.
- * bertram: set error-flag and call biodone() ???
- */
- }
- ts_wtab[ctlr] = bp;
-
- /*
- * Now that the command-buffer is setup, give it to the controller
- */
-do_cmd:
- return (tsexec(ctlr, cmd));
-}
-
-/*
- * initialize the controller by sending WRITE CHARACTERISTICS command.
- * contents of command- and message-buffer are assembled during this
- * function.
- */
-int
-tswchar (ctlr)
- int ctlr;
-{
- struct ts_softc *sc = ts_cd.cd_devs[ctlr];
- volatile struct tsdevice *tsregs = ts[ctlr].reg;
- volatile struct tscmd *tscmdp = &ts[ctlr].cmd;
- volatile struct tsmsg *tsmsgp = &ts[ctlr].msg;
- volatile unsigned int sr, ma, timeout;
-
- /*
- * assemble and send "WRITE CHARACTERISTICS" command
- */
- ma = (long)tsmsgp;
- if (ma & 0x7FC00001) { /* address must be even and 22-bit */
- printf ("invalid address 0x%0x for msg-buffer.\n", ma);
- return (-1);
- }
-
- tsmsgp->hdr = ma & 0xFFFF; /* low order addr. bits */
- tsmsgp->dfl = (ma >> 16) & 0x003F; /* high order addr. bits */
- tsmsgp->rbpcr = 16; /* size of message-buffer */
- tsmsgp->xst0 = 0; /* chacacteristics mode word */
- tsmsgp->xst1 = 0; /* control word (ext.feat.) */
-
-#ifdef TS11_COMPAT
- tsmsgp->rbpcr = 14; /* size of message-buffer */
- tsmsgp->xst0 = 0; /* chacacteristics mode word */
- tsmsgp->xst1 = 0; /* control word (ext.feat.) */
-#else
- tsmsgp->rbpcr = 16; /* size of extended message buffer */
- tsmsgp->xst0 = 0; /* chacacteristics mode word */
- tsmsgp->xst1 = 0; /* unit-select */
- tsmsgp->xst1 |= TS_WC_HSP; /* high speed */
-#endif
-
-#ifdef ENABLE_ESS
- tsmsgp->xst0 |= TS_WC_ESS;
-#ifdef ENABLE_ENB
- tsmsgp->xst0 |= TS_WC_ENB;
-#endif
-#endif
-
-#ifdef ENABLE_EAI
- tsmsgp->xst0 |= TS_WC_EAI;
-#ifdef ENABLE_ERI
- tsmsgp->xst0 |= TS_WC_ERI;
-#endif
-#endif
-
- tscmdp->cmdr = TS_CF_ACK | TS_CF_IE | TS_CMD_WCHAR; /* obsolete */
- tscmdp->cw1 = ma & 0xFFFF;
- tscmdp->cw2 = (ma >> 16) & 0x003F;
- tscmdp->cw3 = 10; /* size of charact.-data */
-
- if (tsexec (ctlr, TS_CMD_WCHAR) < 0) {
- printf ("%s: write characteristics command failed [%x]\n",
- sc->sc_dev.dv_xname, tsregs->tssr);
- return (-1);
- }
-
- timeout = 1000; /* timeout in 10 seconds */
- do {
- DELAY(10000);
- sr = tsregs->tssr;
- debug10 (("\ttssr: 0x%x\n", sr));
- if (timeout-- > 0) {
- printf ("timeout during initialize.");
- tsstatus (sr);
- return (-1);
- }
- } while ((sr & TS_SSR) == 0);
- tsstatus (sr);
-
- return (0);
-}
-
-/*
- *
- */
-void
-tsreset(ctlr)
- int ctlr;
-{
- struct ts_softc *sc = ts_cd.cd_devs[ctlr];
- volatile struct tsdevice *tsreg = ts[ctlr].reg;
- volatile unsigned int sr, timeout;
-
- /*
- * reset ctlr by writing into TSSR, then write characteristics
- */
- timeout = 1000; /* timeout in 10 seconds */
- tsreg->tssr = 0; /* start initialization */
- do {
- DELAY(10000);
- sr = tsreg->tssr;
- debug10 (("\ttssr: 0x%x\n", sr));
- if (timeout-- > 0) {
- if (sr != 0)
- printf ("%s: timeout waiting for TS_SSR\n",
- sc->sc_dev.dv_xname);
- tsstatus (sr);
- return;
- }
- } while ((sr & TS_SSR) == 0); /* wait until subsystem ready */
- tsstatus (sr);
-
- return;
-}
-
-/*
- * probe for device. If found, try to raise an interrupt.
- * XXX - most of this should be done in the attach routine.
- */
-int
-tsmatch(parent, match, aux)
- struct device *parent;
- void *match, *aux;
-{
- struct ts_softc *sc = match;
- struct uba_softc *uh = (void *)parent;
- struct uba_attach_args *ua = aux;
- struct tsdevice *tsregs = (struct tsdevice*)ua->ua_addr;
- volatile unsigned int sr, timeout, count;
- int ctlr = sc->sc_dev.dv_unit;
-
- ts_wtab[ctlr] = NULL;
- sc->sc_ts = &ts[ctlr];
- sc->sc_state = ST_PROBE;
- sc->sc_flags = 0;
- ts[ctlr].reg = (struct tsdevice*)ua->ua_addr;
-
- /*
- * Set host-settable interrupt vector.
- * Assign 0 to the TSSR register to start the ts-device initialization.
- * The device is not really initialized at this point, this is just to
- * find out if the device exists.
- */
- sc->sc_ivec = (uh->uh_lastiv -= 4);
-
- count = 0;
-again:
- timeout = 1000; /* timeout in 10 seconds */
- tsregs->tssr = 0; /* start initialization */
- do {
- DELAY(10000);
- sr = tsregs->tssr;
- debug10 (("\ttssr-1: 0x%x\n", sr));
- if (timeout-- > 0) {
- if (sr != 0) /* the device exists !!! */
- printf ("%s: timeout waiting for TS_SSR\n",
- sc->sc_dev.dv_xname);
- tsstatus (sr);
- goto bad;
- }
- } while ((sr & TS_SSR) == 0); /* wait until subsystem ready */
- tsstatus (sr);
-
- tswchar (ctlr); /* write charact. to enable interrupts */
- /* completion of this will raise the intr. */
-
-#ifdef notyet
- sc->sc_ipl = br = qbgetpri();
-#else
- sc->sc_ipl = 0x15;
-#endif
- return (sizeof (struct tsdevice));
-
-bad: if (++count < 3)
- goto again;
-
-#ifdef notyet
- splx(s);
-#endif
- return (0);
-}
-
-
-/*
- * Try to find a slave (a drive) on the controller.
- * Since there's only one drive per controller there's nothing to do.
- * (we could check the status of the drive (online/offline/...)
- */
-void
-tsattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct ts_softc *sc = (void *)self;
- int ctlr = sc->sc_dev.dv_unit;
- struct tsmsg *tsmsgp = &ts[ctlr].msg;
-
- trace (("tsslave (%x, %x)\n", ui, reg));
-
- /*
- * write the characteristics (again)
- * This will raise an interrupt during ST_SLAVE which indicates
- * completion of initialization ...
- */
- sc->sc_state = ST_SLAVE; /* tsintr() checks this ... */
- if (tswchar (ctlr) < 0) {
- printf ("%s: cannot initialize", sc->sc_dev.dv_xname);
- }
- sc->sc_micro = (tsmsgp->xst2 & TS_SF_MCRL) >> 2;
- printf ("%s: rev %d, extended features %s, transport %s\n",
- sc->sc_dev.dv_xname, sc->sc_micro,
- (tsmsgp->xst2 & TS_SF_EFES ? "enabled" : "disabled"),
- (ts[ctlr].reg->tssr & TS_OFL ? "offline" : "online"));
-
- tsinit (sc); /* must be called once, why not here ? */
-}
-
-
-/*
- * TSV05/TS05 interrupt routine
- */
-void
-tsintr(ctlr)
- int ctlr;
-{
- register struct ts_softc *sc = ts_cd.cd_devs[ctlr];
- register struct tsmsg *tsmsgp = &ts[ctlr].msg;
- register struct tscmd *tscmdp = &ts[ctlr].cmd;
- volatile struct tsdevice *tsreg = ts[ctlr].reg;
- struct uba_unit *um = &sc->sc_unit;
- register struct buf *bp;
-
- unsigned short sr = tsreg->tssr; /* save TSSR */
- unsigned short mh = tsmsgp->hdr; /* and msg-header */
- /* clear the message header ??? */
-
- short ccode = tscmdp->cmdr & TS_CF_CCODE;
- short cmask = tscmdp->cmdr & TS_CF_CMASK;
-
-#ifdef DEBUG
- {
- char bits[64];
- printf ("TSSR: %s, MSG: %x ", bitmask_snprintf(sr,
- TS_TSSR_BITS, bits, sizeof(bits)), mh);
- }
- switch (tsmsgp->hdr & 0x001F) {
- case 16: printf ("(End)"); break;
- case 17: printf ("(Fail)"); break;
- case 18: printf ("(Error)"); break;
- case 19: printf ("(Attention)"); break;
- }
-#endif
-
- trace ((" tsintr (%d, %d, %d, %x)\n", uba, vector, level, ctlr));
-
- if (tsmsgp->xst0 & TS_SF_VCK)
- sc->sc_cmdf |= TS_CF_CVC;
-
-#ifdef QBA /* copied from uda.c */
- if(vax_cputype == VAX_78032)
- splx(sc->sc_ipl); /* Qbus interrupt protocol is odd */
-#endif
-
- /*
- * There are two different things which can (and should) be checked:
- * the actual (internal) state and the device's result (tssr/msg.hdr)
- *
- * For each state there's only one "normal" interrupt. Anything else
- * has to be checked more intensively. Thus in a first run according
- * to the internal state the expected interrupt is checked/handled.
- *
- * In a second run the remaining (not yet handled) interrupts are
- * checked according to the drive's result.
- */
- switch (sc->sc_state) {
-
- case ST_INVALID:
- /*
- * Ignore unsolicited interrupts.
- */
- log (LOG_WARNING, "%s: stray intr [%x,%x]\n",
- sc->sc_dev.dv_xname, sr, mh);
- return;
-
- case ST_SLAVE:
- /*
- * this interrupt was caused by write-charact. command
- * issued by tsslave() and indicates the end of the
- * initialization phase. Just ignore it ...
- */
- if ((sr & TS_SC) != 0 || (sr & TS_TC) != TS_TC_NORM) {
- printf("%s: problem during init [%x,%x]\n",
- sc->sc_dev.dv_xname, sr, mh);
- /* return here ??? */
- /* break and check the error outside switch ??? */
- break;
- }
- sc->sc_state = ST_RUNNING;
- return;
-
-
- case ST_RUNNING:
- /*
- * Here we expect interrupts indicating the end of
- * commands or indicating problems.
- */
- /*
- * Anything else is handled outside this switch ...
- */
- break;
-
- case ST_IDLE:
- break;
-
-
- default:
- printf ("%s: unexpected interrupt during state %d [%x,%x]\n",
- sc->sc_dev.dv_xname, sc->sc_state, sr, mh);
- return;
- }
-
- /*
- * now we check the termination class.
- */
- switch (sr & TS_TC) {
-
- case TS_TC_NORM:
- /*
- * Normal termination -- The operation is completed
- * witout incident.
- */
- sc->sc_state = ST_IDLE; /* XXX ??? */
- sc->sc_state = ST_RUNNING;
- sc->sc_liowf = (ccode == TS_CC_WRITE);
- sc->sc_rtc = 0;
- if ((bp = ts_wtab[ctlr]) != NULL) {
- ts_wtab[ctlr] = NULL; /* pseudo-unlink */
-
- if (bp != &ts_cbuf[ctlr]) { /* no ioctl */
- ubarelse((struct uba_softc *)
- sc->sc_dev.dv_parent,
- (int *)&bp->b_ubinfo);
-#if defined(VAX750)
- if (vax_cputype == VAX_750 &&
- sc->sc_unit.uu_ubinfo != 0)
- ubarelse((struct uba_softc *)
- sc->sc_dev.dv_parent,
- &sc->sc_unit.uu_ubinfo);
- /* XXX */
-#endif
- }
- bp->b_resid = tsmsgp->rbpcr;
- debug (("tsintr: biodone(NORM) [%d,%d,%d]\n",
- bp->b_resid, bp->b_bcount, tsmsgp->rbpcr));
- biodone (bp); /* bertram: ioctl ??? */
- }
- return;
-
- case TS_TC_ATTN:
- /*
- * Attention condition -- this code indicates that the
- * drive has undergone a status change, such as going
- * off-line or coming on-line.
- * (Without EAI enabled, no Attention interrupts occur.
- * drive status changes are signaled by the VCK flag.)
- */
- return;
-
- case TS_TC_TSA:
- /*
- * Tape Status Alert -- A status condition is encountered
- * that may have significance to the program. Bits of
- * interest in the extended status registers include
- * TMK, EOT and RLL.
- */
- debug (("Tape Status Alert\n"));
- tsxstatus (tsmsgp);
- if (tsmsgp->xst0 & TS_SF_TMK) {
- debug (("Tape Mark detected"));
- }
- if (tsmsgp->xst0 & TS_SF_EOT) {
- debug (("End of Tape"));
- }
- break;
-
- case TS_TC_FR:
- /*
- * Function Reject -- The specified function was not
- * initiated. Bits of interest include OFL, VCK, BOT,
- * WLE, ILC and ILA.
- */
- debug (("Function reject\n"));
- tsxstatus (tsmsgp);
- if (sr & TS_OFL) {
- printf ("tape is off-line.\n");
- break;
- }
- if (tsmsgp->xst0 & TS_SF_VCK) {
- printf ("Volume check: repeating command ...\n");
- tsexec (ctlr, tscmdp->cmdr);
- return;
- }
- if (tsmsgp->xst0 & TS_SF_BOT) {
- printf ("bottom of tape.\n");
- }
- if (tsmsgp->xst0 & TS_SF_WLE) {
- printf ("Write Lock Error\n");
- }
- break;
-
- case TS_TC_TPD:
- /*
- * Recoverable Error -- Tape position is a record beyond
- * what its position was when the function was initiated.
- * Suggested recovery procedure is to log the error and
- * issue the appropriate retry command.
- */
- debug (("Tape position down\n"));
- switch (cmask) {
- case TS_CMD_RNF: /* Read Next (forward) */
- debug (("retry read forward ...\n"));
- sc->sc_rtc = 1;
- tsexec (ctlr, TS_CMD_RPF);
- return;
- case TS_CMD_RPR: /* Read Previous (Reverse) */
- debug (("retry read reverse ...\n"));
- sc->sc_rtc = 1;
- tsexec (ctlr, TS_CMD_RNR);
- return;
- case TS_CMD_WD: /* Write Data (Next) */
- debug (("retry write data ...\n"));
- sc->sc_rtc = 1;
- tsexec (ctlr, TS_CMD_WDR);
- return;
- case TS_CMD_WTM:
- debug (("retry write tape mark ...\n"));
- sc->sc_rtc = 1;
- tsexec (ctlr, TS_CMD_WTMR);
- return;
- default:
- debug (("TPD in command %x\n", cmask));
- }
- break;
-
- case TS_TC_TNM:
- /*
- * Recoverable Error -- Tape position has not changed.
- * Suggested recovery procedure is to log the error and
- * reissue the original command.
- */
- printf ("Tape not moved\n");
- if (sc->sc_rtc < 3) {
- sc->sc_rtc++;
- /* bertram: log the error !!! */
- printf ("retrying command %x (%d)\n",
- tscmdp->cmdr, sc->sc_rtc);
- tsexec (ctlr, tscmdp->cmdr);
- return;
- }
- break;
-
- case TS_TC_TPL:
- /*
- * Unrecoverable Error -- Tape position has been lost.
- * No valid recovery procedures exist unless the tape
- * has labels or sequence numbers.
- */
- printf ("Tape position lost\n");
- break;
-
- case TS_TC_FCE:
- /*
- * Fatal subsytem Error -- The subsytem is incapable
- * of properly performing commands, or at least its
- * integrity is seriously questionable. Refer to the
- * fatal class code field in the TSSR register for
- * additional information on the type of fatal error.
- */
- printf ("Fatal Controller Error\n");
-
- default:
- printf ("%s: error 0x%x, resetting controller\n",
- sc->sc_dev.dv_xname, sr & TS_TC);
- tsreset (ctlr);
- }
-
- /*
- * reset controller ?? call tsinit() ???
- */
- if ((bp = ts_wtab[ctlr]) != NULL) {
- ts_wtab[ctlr] = NULL; /* pseudo unlink */
-
- if (bp != &ts_cbuf[ctlr]) /* no ioctl */
- ubarelse((struct uba_softc *)sc->sc_dev.dv_parent,
- (int *)&bp->b_ubinfo);
-
- if ((sr & TS_TC) != TS_TC_NORM)
- bp->b_flags |= B_ERROR;
-
- debug (("resid:%d, count:%d, rbpcr:%d\n",
- bp->b_resid, bp->b_bcount, tsmsgp->rbpcr));
- bp->b_resid = tsmsgp->rbpcr; /* XXX */
- debug (("tsintr: biodone(%x)\n", bp->b_flags));
- biodone (bp);
- }
- if ((sr & TS_TC) > TS_TC_FR)
- tsreset (ctlr);
-
- return;
-}
-
-
-/*
- * Open a ts device and set the unit online. If the controller is not
- * in the run state, call init to initialize the ts controller first.
- */
-int
-tsopen (dev, flag, type, p)
- dev_t dev;
- int flag, type;
- struct proc *p;
-{
- register struct uba_device *ui;
- register struct uba_ctlr *um;
- register struct ts_softc *sc;
- register int unit = TS_UNIT(dev);
- int s;
-
- trace (("tsopen (%x, %x)\n", dev, flag));
-
- if (unit >= ts_cd.cd_ndevs)
- return ENXIO;
-
- sc = ts_cd.cd_devs[unit];
- if (sc == 0)
- return ENXIO;
-
- if (sc->sc_openf)
- return EBUSY;
-
- sc->sc_openf = 1;
-
- s = splbio ();
- if (sc->sc_state < ST_RUNNING) { /* XXX */
- printf ("%s not running.\n", sc->sc_dev.dv_xname);
- splx(s);
- sc->sc_openf = 0;
- return (ENXIO);
- }
- splx(s);
-
- /*
- * check if transport is really online.
- * (without attention-interrupts enabled, we really don't know
- * the actual state of the transport. Thus we call get-status
- * (ie. MTNOP) once and check the actual status.)
- */
- tscommand (dev, MTNOP, 1);
- if (ts[unit].reg->tssr & TS_OFL) {
- printf ("%s: transport is offline.\n", sc->sc_dev.dv_xname);
- sc->sc_openf = 0;
- return EIO; /* transport is offline */
- }
-
- sc->sc_liowf = 0;
- return 0;
-}
-
-
-/*
- * Close tape device.
- *
- * If tape was open for writing or last operation was
- * a write, then write two EOF's and backspace over the last one.
- * Unless this is a non-rewinding special file, rewind the tape.
- *
- * Make the tape available to others, by clearing openf flag.
- */
-int
-tsclose (dev, flag, type, p)
- dev_t dev;
- int flag, type;
- struct proc *p;
-{
- register struct ts_softc *sc = ts_cd.cd_devs[TS_UNIT(dev)];
-
- if (flag == FWRITE || ((flag & FWRITE) && sc->sc_liowf)) {
- /*
- * We are writing two tape marks (EOT), but place the tape
- * before the second one, so that another write operation
- * will overwrite the second one and leave and EOF-mark.
- */
- tscommand (dev, MTWEOF, 1); /* Write Tape Mark */
- tscommand (dev, MTWEOF, 1); /* Write Tape Mark */
- tscommand (dev, MTBSF, 1); /* Skip Tape Marks Reverse */
- }
-
- if ((dev & T_NOREWIND) == 0)
- tscommand (dev, MTREW, 0);
-
- sc->sc_openf = 0;
- sc->sc_liowf = 0;
- return 0;
-}
-
-
-/*
- * Manage buffers and perform block mode read and write operations.
- */
-void
-tsstrategy (bp)
- register struct buf *bp;
-{
- register int unit = TS_UNIT(bp->b_dev);
- struct ts_softc *sc = (void *)ts_cd.cd_devs[unit];
- int s;
-
- s = splbio ();
- /*
- * we have only one command at one time, no credits.
- * thus we don't need buffer management and controller queue
- * just try to execute the command ...
- */
-
- tsstart (sc, bp);
- splx(s);
- return;
-}
-
-
-/*
- * Catch ioctl commands, and call the "command" routine to do them.
- */
-int
-tsioctl (dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- register struct buf *bp = &ts_cbuf[TS_UNIT(dev)];
- register struct ts_softc *sc;
- register struct mtop *mtop; /* mag tape cmd op to perform */
- register struct mtget *mtget; /* mag tape struct to get info in */
- register callcount; /* number of times to call routine */
- int scount; /* number of files/records to space */
- int spaceop = 0; /* flag for skip/space operation */
- int error = 0;
-
- trace (("tsioctl (%x, %x, %x, %d)\n", dev, cmd, data, flag));
-
- switch (cmd) {
- case MTIOCTOP: /* do a mag tape op */
- mtop = (struct mtop *)data;
- switch (mtop->mt_op) {
- case MTWEOF: /* write an end-of-file record */
- callcount = mtop->mt_count;
- scount = 1;
- break;
- case MTFSF: /* forward space file */
- case MTBSF: /* backward space file */
- case MTFSR: /* forward space record */
- case MTBSR: /* backward space record */
- spaceop = 1;
- callcount = 1;
- scount = mtop->mt_count;
- break;
- case MTREW: /* rewind */
- case MTOFFL: /* rewind and put the drive offline */
- case MTNOP: /* no operation, sets status only */
- callcount = 1;
- scount = 1; /* wait for this rewind */
- break;
- case MTRETEN: /* retension */
- case MTERASE: /* erase entire tape */
- case MTEOM: /* forward to end of media */
- case MTNBSF: /* backward space to begin of file */
- case MTCACHE: /* enable controller cache */
- case MTNOCACHE: /* disable controller cache */
- case MTSETBSIZ: /* set block size; 0 for variable */
- case MTSETDNSTY: /* set density code for current mode */
- debug (("ioctl %d not implemented.\n", mtop->mt_op));
- return (ENXIO);
- default:
- debug (("invalid ioctl %d\n", mtop->mt_op));
- return (ENXIO);
- } /* switch (mtop->mt_op) */
-
- if (callcount <= 0 || scount <= 0) {
- debug (("invalid values %d/%d\n", callcount, scount));
- return (EINVAL);
- }
- do {
- tscommand (dev, mtop->mt_op, scount);
- if (spaceop && bp->b_resid) {
- debug (("spaceop didn't complete\n"));
- return (EIO);
- }
- if (bp->b_flags & B_ERROR) {
- debug (("error in ioctl %d\n", mtop->mt_op));
- break;
- }
- } while (--callcount > 0);
- if (bp->b_flags & B_ERROR)
- if ((error = bp->b_error) == 0)
- return (EIO);
- return (error);
-
- case MTIOCGET: /* get tape status */
- sc = ts_cd.cd_devs[TS_UNIT(dev)];
- mtget = (struct mtget *)data;
- mtget->mt_type = MT_ISTS;
- mtget->mt_dsreg = (unsigned)(ts[TS_UNIT(dev)].reg->tssr);
- mtget->mt_erreg = (unsigned)(ts[TS_UNIT(dev)].msg.hdr);
- mtget->mt_resid = 0; /* ??? */
- mtget->mt_density = 0; /* ??? */
- break;
-
- case MTIOCIEOT: /* ignore EOT error */
- debug (("MTIOCIEOT not implemented.\n"));
- return (ENXIO);
-
- case MTIOCEEOT: /* enable EOT error */
- debug (("MTIOCEEOT not implemented.\n"));
- return (ENXIO);
-
- default:
- debug (("invalid ioctl cmd 0x%x\n", cmd));
- return (ENXIO);
- }
-
- return (0);
-}
-
-
-/*
- *
- */
-int
-tsread (dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- return (physio (tsstrategy, NULL, dev, B_READ, minphys, uio));
-}
-
-/*
- *
- */
-int
-tswrite (dev, uio)
- dev_t dev;
- struct uio *uio;
-{
- return (physio (tsstrategy, NULL, dev, B_WRITE, minphys, uio));
-}
-
-/*
- *
- */
-int
-tsdump(dev, blkno, va, size)
- dev_t dev;
- daddr64_t blkno;
- caddr_t va;
- size_t size;
-{
- trace (("tsdump (%x)\n", dev));
- return 0;
-}
-
-/*----------------------------------------------------------------------*/
-
-int
-tsstatus (sr)
- int sr;
-{
-#ifdef DEBUG
- char bits[64];
-
- debug (("status: TSSR=%s\n", bitmask_snprintf(sr, TS_TSSR_BITS,
- bits, sizeof(bits))));
-
- if (tsdebug < 5)
- return (0);
-
- if (sr & TS_SC) printf ("special condition\n");
- if (sr & TS_UPE) printf ("UPE\n");
- if (sr & TS_SCE) printf ("Sanity Check Error\n");
- if (sr & TS_RMR) printf ("Register Modification Refused\n");
- if (sr & TS_NXM) printf ("Nonexistent Memory\n");
- if (sr & TS_NBA) printf ("Need Buffer Address\n");
- if (sr & TS_A11) printf ("Address Bits 17-16\n");
- if (sr & TS_SSR) printf ("Subsystem Ready\n");
- if (sr & TS_OFL) printf ("Off Line\n");
- if (sr & TS_FTC) printf ("Fatal Termination Class Code\n");
- switch (sr & TS_TC) {
- case TS_TC_NORM: printf ("Normal Termination\n"); break;
- case TS_TC_ATTN: printf ("Attention Condition\n"); break;
- case TS_TC_TSA: printf ("Tape status \n"); break;
- case TS_TC_FR: printf ("Function reject\n"); break;
- case TS_TC_TPD: printf ("Tape position down\n"); break;
- case TS_TC_TNM: printf ("Tape not moved\n"); break;
- case TS_TC_TPL: printf ("Tape position lost\n"); break;
- case TS_TC_FCE: printf ("Fatal Controller Error\n"); break;
- }
-#endif
- return (0);
-}
-
-void
-tsxstatus (mp)
- struct tsmsg *mp;
-{
-#ifdef DEBUG
- char bits[64];
-
- debug (("tsxstatus: xst0=%s, ", bitmask_snprintf(mp->xst0,
- TS_XST0_BITS, bits, sizeof(bits))));
- debug (("xst1=%s, ", bitmask_snprintf(mp->xst1, TS_XST1_BITS,
- bits, sizeof(bits))));
- debug (("xst2=%s, ", bitmask_snprintf(mp->xst2, TS_XST2_BITS,
- bits, sizeof(bits))));
- debug (("xst3=%s, ", bitmask_snprintf(mp->xst3, TS_XST3_BITS,
- bits, sizeof(bits))));
- debug (("xst4=%s\n", bitmask_snprintf(mp->xst4, "\20",
- bits, sizeof(bits))));
-
- if (tsdebug < 10)
- return (0);
-
- if (mp->xst0 & TS_SF_TMK) printf ("Tape Mark Detected\n");
- if (mp->xst0 & TS_SF_RLS) printf ("Record Length Short\n");
- if (mp->xst0 & TS_SF_LET) printf ("Logical End of Tape\n");
- if (mp->xst0 & TS_SF_RLL) printf ("Record Length Long\n");
- if (mp->xst0 & TS_SF_WLE) printf ("Write Lock Error\n");
- if (mp->xst0 & TS_SF_NEF) printf ("Nonexecutable Function\n");
- if (mp->xst0 & TS_SF_ILC) printf ("Illegal Command\n");
- if (mp->xst0 & TS_SF_ILA) printf ("Illegal Address\n");
- if (mp->xst0 & TS_SF_MOT) printf ("Motion\n");
- if (mp->xst0 & TS_SF_ONL) printf ("On-Line\n");
- if (mp->xst0 & TS_SF_IE) printf ("Interrupt Enable\n");
- if (mp->xst0 & TS_SF_VCK) printf ("Volume Check\n");
- if (mp->xst0 & TS_SF_PED) printf ("Phase Encoded Drive\n");
- if (mp->xst0 & TS_SF_WLK) printf ("Write Locked\n");
- if (mp->xst0 & TS_SF_BOT) printf ("Beginning of Tape\n");
- if (mp->xst0 & TS_SF_EOT) printf ("End of Tape\n");
-
- if (mp->xst1 & TS_SF_DLT) printf ("Data Late\n");
- if (mp->xst1 & TS_SF_COR) printf ("Correctable Data\n");
- if (mp->xst1 & TS_SF_RBP) printf ("Read Bus Parity Error\n");
- if (mp->xst1 & TS_SF_UNC) printf ("Uncorrectable Data or Hard Error\n");
-
- if (mp->xst2 & TS_SF_OPM) printf ("Operation in Progress\n");
- if (mp->xst2 & TS_SF_RCE) printf ("RAM Checksum Error\n");
- if (mp->xst2 & TS_SF_WCF) printf ("Write Clock Failure\n");
- if (mp->xst2 & TS_SF_EFES) printf ("extended features enabled\n");
- if (mp->xst2 & TS_SF_BES) printf ("Buffering enabled\n");
-
- printf ("micro-code revision level: %d\n", (mp->xst2 & TS_SF_MCRL)>>2);
- printf ("unit number: %d\n", (mp->xst2 & TS_SF_UNIT));
-
- if (mp->xst3 & TS_SF_MDE)
- printf ("Micro-Diagnostics Error Code: 0x%x\n", mp->xst3 >> 8);
- if (mp->xst3 & TS_SF_OPI) printf ("Operation Incomplete\n");
- if (mp->xst3 & TS_SF_REV) printf ("Revers\n");
- if (mp->xst3 & TS_SF_DCK) printf ("Density Check\n");
- if (mp->xst3 & TS_SF_RIB) printf ("Reverse into BOT\n");
-
- if (mp->xst4 & TS_SF_HSP) printf ("High Speed\n");
- if (mp->xst4 & TS_SF_RCX) printf ("Retry Count Exceeded\n");
-#endif
-}
diff --git a/sys/arch/vax/uba/tsreg.h b/sys/arch/vax/uba/tsreg.h
deleted file mode 100644
index 84fbba779d2..00000000000
--- a/sys/arch/vax/uba/tsreg.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/* $OpenBSD: tsreg.h,v 1.2 1997/05/29 00:05:09 niklas Exp $ */
-/* $NetBSD: tsreg.h,v 1.1 1996/01/06 16:43:47 ragge Exp $ */
-/*
- * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * This code is derived from software contributed to Ludd by
- * Bertram Barth.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * TSV05 u.g. 5-11:
- *
- * The TSV05 Subsystem has four device registers that occupy only two
- * LSI-11 Bus word locations: a Data Buffer (TSDB), a Bus Address
- * Register (TSBA), a Status Register (TSSR), and an Extended Data
- * Bufffer (TSDBX). The TSDB is an 18-bit register that is ...
- */
-
-struct tsdevice {
- unsigned short tsdb;/* Data Buffer (TSDB)/Bus Address Register (TSBA) */
- unsigned short tssr;/* Status Reg. (TSSR)/Extended Data Buffer(TSDBX) */
-};
-
-/*
- * TSSR Register bit definitions
- */
-#define TS_SC 0x8000 /* Special Condition */
-#define TS_UPE 0x4000 /* not used in TSV05, UPE in TS11 */
-#define TS_SCE 0x2000 /* Sanity Check Error, SPE in TS11 */
-#define TS_RMR 0x1000 /* Register Modification Refused */
-#define TS_NXM 0x0800 /* Nonexistent Memory */
-#define TS_NBA 0x0400 /* Need Buffer Address */
-#define TS_A11 0x0300 /* Address Bits 17-16 */
-#define TS_SSR 0x0080 /* Subsystem Ready */
-#define TS_OFL 0x0040 /* Off Line */
-#define TS_FTC 0x0030 /* Fatal Termination Class Code */
-#define TS_TC 0x000E /* Termination Class Code */
-#define TS_NU 0x0001 /* Not Used */
-
-#define TS_TSSR_BITS "\20\20SC\17UPE\16SCE\15RMR\14NXM\13NBA\12A17\11A16" \
- "\10SSR\7OFL\6FTC\5FTC\4FTL\3ERR\2ATTN\1NU"
-
-/*
- * Termination Codes
- */
-#define TS_FTC_IDF (0<<4) /* internal diagnostic failure */
-#define TS_FTC_RSVD (1<<4) /* Reserved */
-#define TS_FTC_NU (2<<4) /* Not Used */
-#define TS_FTC_DPD (3<<4) /* Detection of Power Down (not implemented) */
-
-#define TS_TC_NORM (0<<1) /* Normal Termination */
-#define TS_TC_ATTN (1<<1) /* Attention Condition */
-#define TS_TC_TSA (2<<1) /* Tape status alert */
-#define TS_TC_FR (3<<1) /* Function reject */
-#define TS_TC_TPD (4<<1) /* Tape position is one record down (recov.) */
-#define TS_TC_TNM (5<<1) /* Tape not moved (recoverable) */
-#define TS_TC_TPL (6<<1) /* Tape position lost (unrecoverable) */
-#define TS_TC_FCE (7<<1) /* Fatal Controller Error (see FTC) */
-
-struct tscmd { /* command packet (not all words required) */
- unsigned short cmdr; /* command word */
- unsigned short cw1; /* low order data pointer address (A15-00) */
- unsigned short cw2; /* high order data pointer address (A21-16) */
- unsigned short cw3; /* count parameter */
-};
-
-/*
- * Command flags
- */
-#define TS_CF_ACK (1<<15) /* Acknowledge */
-#define TS_CF_CVC (1<<14) /* Clear Volume Check */
-#define TS_CF_OPP (1<<13) /* Opposite */
-#define TS_CF_SWB (1<<12) /* Swap Bytes */
-#define TS_CF_IE (1<< 7) /* Interrupt Enable */
-#define TS_CF_CMODE 0x0F00 /* Command Mode Field */
-#define TS_CF_CCODE 0x001F /* Command Code (major) */
-#define TS_CF_CMASK 0x0F1F /* mask for complete command */
-
-#define TS_CMD(cMode,cCode) ((cMode<<8)|cCode)
-
-#define TS_CC_READ 0x01 /* READ */
-#define TS_CMD_RNF TS_CMD(0,TS_CC_READ) /* Read Next (Forward) */
-#define TS_CMD_RPR TS_CMD(1,TS_CC_READ) /* Read Previous (Reverse) */
-#define TS_CMD_RPF TS_CMD(2,TS_CC_READ) /* Read Previous (Forward) */
-#define TS_CMD_RNR TS_CMD(3,TS_CC_READ) /* Read Next (Reverse) */
-
-#define TS_CC_WCHAR 0x04 /* WRITE CHARACTERISTICS */
-#define TS_CMD_WCHAR TS_CMD(0,TS_CC_WCHAR) /* Load msg-buffer etc. */
-
-#define TS_CC_WRITE 0x05 /* WRITE */
-#define TS_CMD_WD TS_CMD(0,TS_CC_WRITE) /* Write Data (Next) */
-#define TS_CMD_WDR TS_CMD(1,TS_CC_WRITE) /* Write Data (Retry) */
-
-#define TS_CC_WSM 0x06 /* WRITE SUBSYSTEM MEMORY */
-#define TS_CMD_WSM TS_CMD(0,TS_CC_WSM) /* (diagnostics only) */
-
-#define TS_CC_POS 0x08 /* POSITION */
-#define TS_CMD_SRF TS_CMD(0,TS_CC_POS) /* Space Records Forward */
-#define TS_CMD_SRR TS_CMD(1,TS_CC_POS) /* Space Records Reverse */
-#define TS_CMD_STMF TS_CMD(2,TS_CC_POS) /* Skip Tape Marks Forward */
-#define TS_CMD_STMR TS_CMD(3,TS_CC_POS) /* Skip Tape Marks Reverse */
-#define TS_CMD_RWND TS_CMD(4,TS_CC_POS) /* Rewind */
-
-#define TS_CC_FRMT 0x09 /* FORMAT */
-#define TS_CMD_WTM TS_CMD(0,TS_CC_FRMT) /* Write Tape Mark */
-#define TS_CMD_ETM TS_CMD(1,TS_CC_FRMT) /* Erase */
-#define TS_CMD_WTMR TS_CMD(2,TS_CC_FRMT) /* Write Tape Mark (Retry) */
-
-#define TS_CC_CTRL 0x0A /* CONTROL */
-#define TS_CMD_MBR TS_CMD(0,TS_CC_CTRL) /* Message Buffer Release */
-#define TS_CMD_RWUL TS_CMD(1,TS_CC_CTRL) /* Rewind and Unload */
-#define TS_CMD_NOP TS_CMD(2,TS_CC_CTRL) /* NO-OP (TS11: clean tape) */
-#define TS_CMD_RWII TS_CMD(4,TS_CC_CTRL) /* Rewind with intermediate */
- /* interrupt (TS11: N.A.) */
-#define TS_CC_INIT 0x0B /* INITIALIZE */
-#define TS_CMD_INIT TS_CMD(0,TS_CC_INIT) /* Controller/Drive Initial. */
-
-#define TS_CC_STAT 0x0F /* GET STATUS */
-#define TS_CMD_STAT TS_CMD(0,TS_CC_STAT) /* Get Status (END) */
-
-struct tsmsg { /* message packet */
- unsigned short hdr; /* ACK, class-code, format 1, message type */
- unsigned short dfl; /* data field length (8 bit) */
- unsigned short rbpcr; /* residual b/r/tm count word */
- unsigned short xst0; /* Extended Status Registers 0-4 */
- unsigned short xst1;
- unsigned short xst2;
- unsigned short xst3;
- unsigned short xst4; /* total size: 16 bytes */
-};
-
-/*
- * Flags used in write-characteristics command
- */
-#define TS_WC_ESS (1<<7) /* Enable Skip Tape Marks Stop */
-#define TS_WC_ENB (1<<6) /* Enable Tape Mark Stop at Bot */
-#define TS_WC_EAI (1<<5) /* Enable Attention interrupts */
-#define TS_WC_ERI (1<<4) /* Enable Message Buffer Release interrupts */
-#define TS_WC_HSP (1<<5) /* High Speed Select (25 in/s vs. 100 in/s) */
-
-/*
- * Status flags
- *
- * Extended Status register 0 (XST0) -- XST0 appears as the fourth word
- * in the message buffer stored by the TSV05 subsystem upon completion of
- * a command or an ATTN
- */
-#define TS_SF_TMK (1<<15) /* Tape Mark Detected */
-#define TS_SF_RLS (1<<14) /* Record Length Short */
-#define TS_SF_LET (1<<13) /* Logical End of Tape */
-#define TS_SF_RLL (1<<12) /* Record Length Long */
-#define TS_SF_WLE (1<<11) /* Write Lock Error */
-#define TS_SF_NEF (1<<10) /* Nonexecutable Function */
-#define TS_SF_ILC (1<< 9) /* Illegal Command */
-#define TS_SF_ILA (1<< 8) /* Illegal Address */
-#define TS_SF_MOT (1<< 7) /* Motion */
-#define TS_SF_ONL (1<< 6) /* On-Line */
-#define TS_SF_IE (1<< 5) /* Interrupt Enable */
-#define TS_SF_VCK (1<< 4) /* Volume Check */
-#define TS_SF_PED (1<< 3) /* Phase Encoded Drive */
-#define TS_SF_WLK (1<< 2) /* Write Locked */
-#define TS_SF_BOT (1<< 1) /* Beginning of Tape */
-#define TS_SF_EOT (1<< 0) /* End of Tape */
-
-#define TS_XST0_BITS "\20\20TMK\17RLS\16LET\15RLL\14WLE\13NEF\12ILC\11ILA" \
- "\10MOT\07ONL\06IE \05VCK\04PED\03WLK\02BOT\01EOT"
-/*
- * Extended Status register 1 (XST1) -- XST1 appears as the fifth word
- * in the message buffer stored by the TSV05 subsystem upon completion of
- * a command or an ATTN
- */
-#define TS_SF_DLT (1<<15) /* Data Late */
-#define TS_SF_COR (1<<13) /* Correctable Data */
-#define TS_SF_CRS (1<<12) /* TS11: Crease Detected */
-#define TS_SF_TIG (1<<11) /* TS11: Trash in Gap */
-#define TS_SF_DBF (1<<10) /* TS11: Desckew Buffer Fail */
-#define TS_SF_SCK (1<< 9) /* TS11: Speed Check */
-#define TS_SF_RBP (1<< 8) /* Read Bus Parity Error */
-#define TS_SF_IPR (1<< 7) /* TS11: Invalid Preamble */
-#define TS_SF_IPO (1<< 6) /* TS11: Invalid Postamble */
-#define TS_SF_SYN (1<< 5) /* TS11: Sync Failure */
-#define TS_SF_IED (1<< 4) /* TS11: Invalid End Data */
-#define TS_SF_POS (1<< 3) /* TS11: Postamble short */
-#define TS_SF_POL (1<< 2) /* TS11: Postamble long */
-#define TS_SF_UNC (1<< 1) /* Uncorrectable Data or Hard Error */
-#define TS_SF_MTE (1<< 0) /* TS11: Multitrack Error */
-
-#define TS_XST1_BITS "\20\20DLT\16COR\15CRS\14TIG\13DBF\12SCK\11RBP" \
- "\10IPR\07IPO\06SYN\05IED\04POS\03POL\02UNC\01MTE"
-
-/*
- * Extended Status register 2 (XST2) -- sixth word
- */
-#define TS_SF_OPM (1<<15) /* Operation in Progress (tape moving) */
-#define TS_SF_RCE (1<<14) /* RAM Checksum Error */
-#define TS_SF_SBP (1<<13) /* TS11: Serial 08 bus parity */
-#define TS_SF_CAF (1<<12) /* TS11: Capstan Acceleration fail */
-#define TS_SF_WCF (1<<10) /* Write Clock Failure */
-#define TS_SF_PDT (1<< 8) /* TS11: Parity Dead Track */
-#define TS_SF_RL 0x00FF /* Revision Level */
-#define TS_SF_EFES (1<< 7) /* extended features enable switch */
-#define TS_SF_BES (1<< 6) /* Buffering enable switch */
-#define TS_SF_MCRL 0x003F /* micro-code revision level */
-#define TS_SF_UNIT 0x0003 /* unit number of selected transport */
-
-#define TS_XST2_BITS "\20\20OPM\17RCE\16SBP\15CAF\13WCF\11PDT\10EFES\7BES"
-
-/*
- * Extended Status register 3 (XST3)) -- seventh word
- */
-#define TS_SF_MDE 0xFF00 /* Micro-Diagnostics Error Code */
-#define TS_SF_LMX (1<< 7) /* TS11: Tension Arm Limit Exceeded */
-#define TS_SF_OPI (1<< 6) /* Operation Incomplete */
-#define TS_SF_REV (1<< 5) /* Revers */
-#define TS_SF_CRF (1<< 4) /* TS11: Capstan Response Failure */
-#define TS_SF_DCK (1<< 3) /* Density Check */
-#define TS_SF_NBE (1<< 2) /* TS11: Noise Bit during Erase */
-#define TS_SF_LSA (1<< 1) /* TS11: Limit Switch Activated */
-#define TS_SF_RIB (1<< 0) /* Reverse into BOT */
-
-#define TS_XST3_BITS "\20\10LMX\07OPI\06REV\05CRF\04DCK\03NBE\02LSA\01RIB"
-
-/*
- * Extended Status register 4 (XST4)) -- eighth word
- */
-#define TS_SF_HSP (1<<15) /* High Speed */
-#define TS_SF_RCX (1<<14) /* Retry Count Exceeded */
-#define TS_SF_WRC 0x00FF /* Write Retry Count Statistics */
-
-#define TS_XST4_BITS "\20\20HSP\17RCX"
-
-
diff --git a/sys/arch/vax/uba/uba_cmi.c b/sys/arch/vax/uba/uba_cmi.c
deleted file mode 100644
index 85b8599d648..00000000000
--- a/sys/arch/vax/uba/uba_cmi.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* $OpenBSD: uba_cmi.c,v 1.3 2003/06/02 23:27:58 millert Exp $ */
-/* $NetBSD: uba_cmi.c,v 1.2 1999/08/14 11:31:48 ragge Exp $ */
-/*
- * Copyright (c) 1996 Jonathan Stone.
- * Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
- * Copyright (c) 1982, 1986 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)uba.c 7.10 (Berkeley) 12/16/90
- * @(#)autoconf.c 7.20 (Berkeley) 5/9/91
- */
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#define _VAX_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-#include <machine/mtpr.h>
-#include <machine/nexus.h>
-#include <machine/cpu.h>
-#include <machine/sgmap.h>
-
-#include <arch/vax/qbus/ubavar.h>
-
-#include <arch/vax/uba/uba_common.h>
-
-/* Some CMI-specific defines */
-#define UBASIZE ((UBAPAGES + UBAIOPAGES) * VAX_NBPG)
-#define UMEM750(i) (0xfc0000 - (i) * UBASIZE)
-#define UIOPAGE(x) (UMEM750(x) + (UBAPAGES * VAX_NBPG))
-
-/*
- * The DW780 and DW750 are quite similar to their function from
- * a programmers point of view. Differencies are number of BDP's
- * and bus status/command registers, the latter are (partly) IPR's
- * on 750.
- */
-static int dw750_match(struct device *, struct cfdata *, void *);
-static void dw750_attach(struct device *, struct device *, void *);
-static void dw750_init(struct uba_softc*);
-#ifdef notyet
-static void dw750_purge(struct uba_softc *, int);
-#endif
-
-struct cfattach uba_cmi_ca = {
- sizeof(struct uba_vsoftc), dw750_match, dw750_attach
-};
-
-extern struct vax_bus_space vax_mem_bus_space;
-
-int
-dw750_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
-
- if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1 ))
- return 0;
- /*
- * The uba type is actually only telling where the uba
- * space is in nexus space.
- */
- if ((sa->type & ~3) != NEX_UBA0)
- return 0;
-
- return 1;
-}
-
-void
-dw750_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct uba_vsoftc *sc = (void *)self;
- struct sbi_attach_args *sa = aux;
- struct uba_regs *uh_uba = (void *)sa->nexaddr;
- int ubaddr = sa->nexinfo & 1;
-
- printf(": DW750\n");
- /*
- * Fill in bus specific data.
- */
- sc->uv_sc.uh_ubainit = dw750_init;
-#ifdef notyet
- sc->uv_sc.uh_ubapurge = dw750_purge;
-#endif
- sc->uv_sc.uh_iot = &vax_mem_bus_space;
- sc->uv_sc.uh_dmat = &sc->uv_dmat;
-
- /*
- * Fill in variables used by the sgmap system.
- */
- sc->uv_size = UBASIZE; /* Size in bytes of Qbus space */
- sc->uv_addr = (paddr_t)uh_uba->uba_map; /* Map regs physical address */
-
- uba_dma_init(sc);
- uba_attach(&sc->uv_sc, UIOPAGE(ubaddr));
-}
-
-void
-dw750_init(sc)
- struct uba_softc *sc;
-{
- mtpr(0, PR_IUR);
- DELAY(500000);
-}
-
-#ifdef notyet
-void
-dw750_purge(sc, bdp)
- struct uba_softc *sc;
- int bdp;
-{
- sc->uh_uba->uba_dpr[bdp] |= UBADPR_PURGE | UBADPR_NXM | UBADPR_UCE;
-}
-#endif
diff --git a/sys/arch/vax/uba/uba_sbi.c b/sys/arch/vax/uba/uba_sbi.c
deleted file mode 100644
index f2c57de9ad8..00000000000
--- a/sys/arch/vax/uba/uba_sbi.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/* $OpenBSD: uba_sbi.c,v 1.5 2008/08/18 23:09:42 miod Exp $ */
-/* $NetBSD: uba_sbi.c,v 1.1 1999/06/21 16:23:01 ragge Exp $ */
-/*
- * Copyright (c) 1996 Jonathan Stone.
- * Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
- * Copyright (c) 1982, 1986 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)uba.c 7.10 (Berkeley) 12/16/90
- * @(#)autoconf.c 7.20 (Berkeley) 5/9/91
- */
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-
-#define _VAX_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-#include <machine/mtpr.h>
-#include <machine/nexus.h>
-#include <machine/cpu.h>
-#include <machine/sgmap.h>
-#include <machine/scb.h>
-
-#include <arch/vax/qbus/ubavar.h>
-
-#include <arch/vax/uba/uba_common.h>
-
-/* Some SBI-specific defines */
-#define UBASIZE (UBAPAGES * VAX_NBPG)
-#define UMEMA8600(i) (0x20100000+(i)*0x40000)
-#define UMEMB8600(i) (0x22100000+(i)*0x40000)
-
-/*
- * Some status registers.
- */
-#define UBACNFGR_UBIC 0x00010000 /* unibus init complete */
-#define UBACNFGR_BITS \
-"\40\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT\30ADPDN\27ADPUP\23UBINIT\22UBPDN\21UBIC"
-
-#define UBACR_IFS 0x00000040 /* interrupt field switch */
-#define UBACR_BRIE 0x00000020 /* BR interrupt enable */
-#define UBACR_USEFIE 0x00000010 /* UNIBUS to SBI error field IE */
-#define UBACR_SUEFIE 0x00000008 /* SBI to UNIBUS error field IE */
-#define UBACR_ADINIT 0x00000001 /* adapter init */
-
-#define UBADPR_BNE 0x80000000 /* buffer not empty - purge */
-
-#define UBABRRVR_DIV 0x0000ffff /* device interrupt vector field */
-
-#define UBASR_BITS \
-"\20\13RDTO\12RDS\11CRD\10CXTER\7CXTMO\6DPPE\5IVMR\4MRPF\3LEB\2UBSTO\1UBSSYNTO"
-
-char ubasr_bits[] = UBASR_BITS;
-
-/*
- * The DW780 are directly connected to the SBI on 11/780 and 8600.
- */
-static int dw780_match(struct device *, struct cfdata *, void *);
-static void dw780_attach(struct device *, struct device *, void *);
-static void dw780_init(struct uba_softc*);
-static void dw780_beforescan(struct uba_softc *);
-static void dw780_afterscan(struct uba_softc *);
-static int dw780_errchk(struct uba_softc *);
-static void uba_dw780int(int);
-static void ubaerror(struct uba_softc *, int *, int *);
-#ifdef notyet
-static void dw780_purge(struct uba_softc *, int);
-#endif
-
-struct cfattach uba_sbi_ca = {
- sizeof(struct uba_vsoftc), dw780_match, dw780_attach
-};
-
-extern struct vax_bus_space vax_mem_bus_space;
-
-volatile int svec;
-
-int
-dw780_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
-
- if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1 ))
- return 0;
- /*
- * The uba type is actually only telling where the uba
- * space is in nexus space.
- */
- if ((sa->type & ~3) != NEX_UBA0)
- return 0;
-
- return 1;
-}
-
-void
-dw780_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct uba_vsoftc *sc = (void *)self;
- struct sbi_attach_args *sa = aux;
- int ubaddr = sa->type & 3;
- int i;
-
- printf(": DW780\n");
- /*
- * Fill in bus specific data.
- */
- sc->uv_sc.uh_ubainit = dw780_init;
-#ifdef notyet
- sc->uv_sc.uh_ubapurge = dw780_purge;
-#endif
- sc->uv_sc.uh_beforescan = dw780_beforescan;
- sc->uv_sc.uh_afterscan = dw780_afterscan;
- sc->uv_sc.uh_errchk = dw780_errchk;
- sc->uv_sc.uh_iot = &vax_mem_bus_space;
- sc->uv_sc.uh_dmat = &sc->uv_dmat;
- sc->uv_uba = (void *)sa->nexaddr;
- sc->uh_ibase = VAX_NBPG + ubaddr * VAX_NBPG;
-
- /*
- * Set up dispatch vectors for DW780.
- */
- for (i = 0; i < 4; i++)
- scb_vecalloc(256 + i * 64 + sa->nexnum * 4, uba_dw780int,
- sc->uv_sc.uh_dev.dv_unit, SCB_ISTACK);
- /*
- * Fill in variables used by the sgmap system.
- */
- sc->uv_size = UBASIZE; /* Size in bytes of Qbus space */
- sc->uv_addr = (paddr_t)sc->uv_uba->uba_map;
-
- uba_dma_init(sc);
- uba_attach(&sc->uv_sc, (parent->dv_unit ? UMEMB8600(ubaddr) :
- UMEMA8600(ubaddr)) + (UBAPAGES * VAX_NBPG));
-}
-
-void
-dw780_beforescan(sc)
- struct uba_softc *sc;
-{
- struct uba_vsoftc *vc = (void *)sc;
- volatile int *hej = &vc->uv_uba->uba_sr;
-
- *hej = *hej;
- vc->uv_uba->uba_cr = UBACR_IFS|UBACR_BRIE;
-}
-
-void
-dw780_afterscan(sc)
- struct uba_softc *sc;
-{
- struct uba_vsoftc *vc = (void *)sc;
-
- vc->uv_uba->uba_cr = UBACR_IFS | UBACR_BRIE |
- UBACR_USEFIE | UBACR_SUEFIE |
- (vc->uv_uba->uba_cr & 0x7c000000);
-}
-
-
-int
-dw780_errchk(sc)
- struct uba_softc *sc;
-{
- struct uba_vsoftc *vc = (void *)sc;
- volatile int *hej = &vc->uv_uba->uba_sr;
-
- if (*hej) {
- *hej = *hej;
- return 1;
- }
- return 0;
-}
-
-void
-uba_dw780int(uba)
- int uba;
-{
- int br, vec, arg;
- struct uba_vsoftc *vc = uba_cd.cd_devs[uba];
- struct uba_regs *ur = vc->uv_uba;
- void (*func)(int);
-
- br = mfpr(PR_IPL);
- vec = ur->uba_brrvr[br - 0x14];
- if (vec <= 0) {
- ubaerror(&vc->uv_sc, &br, (int *)&vec);
- if (svec == 0)
- return;
- }
- if (cold)
- scb_fake(vec + vc->uh_ibase, br);
- else {
- struct ivec_dsp *scb_vec = (struct ivec_dsp *)((int)scb + 512);
- func = scb_vec[vec/4].hoppaddr;
- arg = scb_vec[vec/4].pushlarg;
- (*func)(arg);
- scb_vec[vec/4].ev->ec_count++;
- }
-}
-
-void
-dw780_init(sc)
- struct uba_softc *sc;
-{
- struct uba_vsoftc *vc = (void *)sc;
-
- vc->uv_uba->uba_cr = UBACR_ADINIT;
- vc->uv_uba->uba_cr = UBACR_IFS|UBACR_BRIE|UBACR_USEFIE|UBACR_SUEFIE;
- while ((vc->uv_uba->uba_cnfgr & UBACNFGR_UBIC) == 0)
- ;
-}
-
-#ifdef notyet
-void
-dw780_purge(sc, bdp)
- struct uba_softc *sc;
- int bdp;
-{
- struct uba_vsoftc *vc = (void *)sc;
-
- vc->uv_uba->uba_dpr[bdp] |= UBADPR_BNE;
-}
-#endif
-
-int ubawedgecnt = 10;
-int ubacrazy = 500;
-int zvcnt_max = 5000; /* in 8 sec */
-int ubaerrcnt;
-/*
- * This routine is called by the locore code to process a UBA
- * error on an 11/780 or 8600. The arguments are passed
- * on the stack, and value-result (through some trickery).
- * In particular, the uvec argument is used for further
- * uba processing so the result aspect of it is very important.
- * It must not be declared register.
- */
-/*ARGSUSED*/
-void
-ubaerror(uh, ipl, uvec)
- register struct uba_softc *uh;
- int *ipl, *uvec;
-{
- struct uba_vsoftc *vc = (void *)uh;
- struct uba_regs *uba = vc->uv_uba;
- register int sr, s;
-
- if (*uvec == 0) {
- /*
- * Declare dt as unsigned so that negative values
- * are handled as >8 below, in case time was set back.
- */
- u_long dt = time.tv_sec - vc->uh_zvtime;
-
- vc->uh_zvtotal++;
- if (dt > 8) {
- vc->uh_zvtime = time.tv_sec;
- vc->uh_zvcnt = 0;
- }
- if (++vc->uh_zvcnt > zvcnt_max) {
- printf("%s: too many zero vectors (%d in <%d sec)\n",
- vc->uv_sc.uh_dev.dv_xname, vc->uh_zvcnt, (int)dt + 1);
- printf("\tIPL 0x%x\n\tcnfgr: %b Adapter Code: 0x%x\n",
- *ipl, uba->uba_cnfgr&(~0xff), UBACNFGR_BITS,
- uba->uba_cnfgr&0xff);
- printf("\tsr: %b\n\tdcr: %x (MIC %sOK)\n",
- uba->uba_sr, ubasr_bits, uba->uba_dcr,
- (uba->uba_dcr&0x8000000)?"":"NOT ");
- ubareset(vc->uv_sc.uh_dev.dv_unit);
- }
- return;
- }
- if (uba->uba_cnfgr & NEX_CFGFLT) {
- printf("%s: sbi fault sr=%b cnfgr=%b\n",
- vc->uv_sc.uh_dev.dv_xname, uba->uba_sr, ubasr_bits,
- uba->uba_cnfgr, NEXFLT_BITS);
- ubareset(vc->uv_sc.uh_dev.dv_unit);
- *uvec = 0;
- return;
- }
- sr = uba->uba_sr;
- s = spluba();
- printf("%s: uba error sr=%b fmer=%x fubar=%o\n", vc->uv_sc.uh_dev.dv_xname,
- uba->uba_sr, ubasr_bits, uba->uba_fmer, 4*uba->uba_fubar);
- splx(s);
- uba->uba_sr = sr;
- *uvec &= UBABRRVR_DIV;
- if (++ubaerrcnt % ubawedgecnt == 0) {
- if (ubaerrcnt > ubacrazy)
- panic("uba crazy");
- printf("ERROR LIMIT ");
- ubareset(vc->uv_sc.uh_dev.dv_unit);
- *uvec = 0;
- }
-}
diff --git a/sys/arch/vax/uba/ubareg.h b/sys/arch/vax/uba/ubareg.h
index 4870197817f..c4708784acd 100644
--- a/sys/arch/vax/uba/ubareg.h
+++ b/sys/arch/vax/uba/ubareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubareg.h,v 1.13 2008/08/18 23:19:27 miod Exp $ */
+/* $OpenBSD: ubareg.h,v 1.14 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: ubareg.h,v 1.11 2000/01/24 02:40:36 matt Exp $ */
/*-
@@ -42,32 +42,6 @@
*/
/*
- * "UNIBUS" adaptor types.
- * This code is used for both UNIBUSes and Q-buses
- * with different types of adaptors.
- * Definition of a type includes support code for that type.
- */
-
-#if VAX780 || VAX8600
-#define DW780 1 /* has adaptor regs, sr: 780/785/8600 */
-#else
-#undef DW780
-#endif
-
-
-#if VAX750
-#define DW750 2 /* has adaptor regs, no sr: 750, 730 */
-#endif
-
-#if VAX730
-#define DW730 3 /* has adaptor regs, no sr: 750, 730 */
-#endif
-
-#if VAX630 || VAX650 || VAX660 || VAX670 || VAX60
-#define QBA 4 /* 22-bit Q-bus, no adaptor regs: uVAX II */
-#endif
-
-/*
* Size of unibus memory address space in pages
* (also number of map registers).
* QBAPAGES should be 8192, but we don't need nearly that much
@@ -105,69 +79,6 @@ struct uba_regs {
};
#endif
-#ifdef DW780
-/* uba_cnfgr */
-#define UBACNFGR_UBINIT 0x00040000 /* unibus init asserted */
-#define UBACNFGR_UBPDN 0x00020000 /* unibus power down */
-#define UBACNFGR_UBIC 0x00010000 /* unibus init complete */
-
-#define UBACNFGR_BITS \
-"\40\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT\30ADPDN\27ADPUP\23UBINIT\22UBPDN\21UBIC"
-
-/* uba_cr */
-#define UBACR_MRD16 0x40000000 /* map reg disable bit 4 */
-#define UBACR_MRD8 0x20000000 /* map reg disable bit 3 */
-#define UBACR_MRD4 0x10000000 /* map reg disable bit 2 */
-#define UBACR_MRD2 0x08000000 /* map reg disable bit 1 */
-#define UBACR_MRD1 0x04000000 /* map reg disable bit 0 */
-#define UBACR_IFS 0x00000040 /* interrupt field switch */
-#define UBACR_BRIE 0x00000020 /* BR interrupt enable */
-#define UBACR_USEFIE 0x00000010 /* UNIBUS to SBI error field IE */
-#define UBACR_SUEFIE 0x00000008 /* SBI to UNIBUS error field IE */
-#define UBACR_CNFIE 0x00000004 /* configuration IE */
-#define UBACR_UPF 0x00000002 /* UNIBUS power fail */
-#define UBACR_ADINIT 0x00000001 /* adapter init */
-
-/* uba_sr */
-#define UBASR_BR7FULL 0x08000000 /* BR7 receive vector reg full */
-#define UBASR_BR6FULL 0x04000000 /* BR6 receive vector reg full */
-#define UBASR_BR5FULL 0x02000000 /* BR5 receive vector reg full */
-#define UBASR_BR4FULL 0x01000000 /* BR4 receive vector reg full */
-#define UBASR_RDTO 0x00000400 /* UNIBUS to SBI read data timeout */
-#define UBASR_RDS 0x00000200 /* read data substitute */
-#define UBASR_CRD 0x00000100 /* corrected read data */
-#define UBASR_CXTER 0x00000080 /* command transmit error */
-#define UBASR_CXTMO 0x00000040 /* command transmit timeout */
-#define UBASR_DPPE 0x00000020 /* data path parity error */
-#define UBASR_IVMR 0x00000010 /* invalid map register */
-#define UBASR_MRPF 0x00000008 /* map register parity failure */
-#define UBASR_LEB 0x00000004 /* lost error */
-#define UBASR_UBSTO 0x00000002 /* UNIBUS select timeout */
-#define UBASR_UBSSYNTO 0x00000001 /* UNIBUS slave sync timeout */
-
-#define UBASR_BITS \
-"\20\13RDTO\12RDS\11CRD\10CXTER\7CXTMO\6DPPE\5IVMR\4MRPF\3LEB\2UBSTO\1UBSSYNTO"
-
-/* uba_brrvr[] */
-#define UBABRRVR_AIRI 0x80000000 /* adapter interrupt request */
-#define UBABRRVR_DIV 0x0000ffff /* device interrupt vector field */
-#endif
-
-/* uba_dpr */
-#ifdef DW780
-#define UBADPR_BNE 0x80000000 /* buffer not empty - purge */
-#define UBADPR_BTE 0x40000000 /* buffer transfer error */
-#define UBADPR_DPF 0x20000000 /* DP function (RO) */
-#define UBADPR_BS 0x007f0000 /* buffer state field */
-#define UBADPR_BUBA 0x0000ffff /* buffered UNIBUS address */
-#endif
-#ifdef DW750
-#define UBADPR_ERROR 0x80000000 /* error occurred */
-#define UBADPR_NXM 0x40000000 /* nxm from memory */
-#define UBADPR_UCE 0x20000000 /* uncorrectable error */
-#define UBADPR_PURGE 0x00000001 /* purge bdp */
-#endif
-
/* uba_mr[] */
#define UBAMR_MRV 0x80000000 /* map register valid */
#define UBAMR_BO 0x02000000 /* byte offset bit */
@@ -179,11 +90,7 @@ struct uba_regs {
/*
* Number of unibus buffered data paths and possible uba's per cpu type.
*/
-#define NBDP8600 15
-#define NBDP780 15
#define NBDPBUA 5
-#define NBDP750 3
-#define NBDP730 0
#define MAXNBDP 15
/*
@@ -206,27 +113,6 @@ struct uba_regs {
#define Q_DMAQPE 0x8000 /* Q22 bus address space parity error */
#endif
-#if VAX730
-#define UMEM730 0xfc0000
-#endif
-
-#if VAX750
-#define UMEM750(i) (0xfc0000-(i)*0x40000)
-#endif
-
-#if VAX780
-#define UMEM780(i) (0x20100000+(i)*0x40000)
-#endif
-
-#if VAX8200 /* BEWARE, argument is node, not ubanum */
-#define UMEM8200(i) (0x20400000+(i)*0x40000)
-#endif
-
-#if VAX8600 || VAX780
-#define UMEMA8600(i) (0x20100000+(i)*0x40000)
-#define UMEMB8600(i) (0x22100000+(i)*0x40000)
-#endif
-
/*
* Macro to offset a UNIBUS device address, often expressed as
* something like 0172520, by forcing it into the last 8K
diff --git a/sys/arch/vax/vax/autoconf.c b/sys/arch/vax/vax/autoconf.c
index 6ff47efb8bd..d7e3cde8d2f 100644
--- a/sys/arch/vax/vax/autoconf.c
+++ b/sys/arch/vax/vax/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.32 2009/03/20 18:39:30 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.33 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.45 1999/10/23 14:56:05 ragge Exp $ */
/*
@@ -48,9 +48,6 @@
#include <machine/param.h>
#include <machine/vmparam.h>
#include <machine/nexus.h>
-#include <machine/ioa.h>
-#include <machine/ka820.h>
-#include <machine/ka750.h>
#include <machine/clock.h>
#include <machine/rpb.h>
#ifdef VAX60
@@ -63,8 +60,6 @@
#include <vax/vax/gencons.h>
-#include <vax/bi/bireg.h>
-
void dumpconf(void); /* machdep.c */
struct cpu_dep *dep_call;
@@ -179,14 +174,7 @@ struct cfdriver mainbus_cd = {
#include "sd.h"
#include "cd.h"
-#if NRL > 0
-#include "rl.h"
-#endif
#include "ra.h"
-#include "hp.h"
-#if NRY > 0
-#include "ry.h"
-#endif
static int ubtest(void *);
static int jmfr(char *, struct device *, int);
@@ -194,7 +182,6 @@ static int booted_qe(struct device *, void *);
static int booted_le(struct device *, void *);
static int booted_ze(struct device *, void *);
static int booted_de(struct device *, void *);
-static int booted_ni(struct device *, void *);
#if NSD > 0 || NCD > 0
static int booted_sd(struct device *, void *);
#endif
@@ -204,9 +191,6 @@ static int booted_rl(struct device *, void *);
#if NRA
static int booted_ra(struct device *, void *);
#endif
-#if NHP
-static int booted_hp(struct device *, void *);
-#endif
#if NRD
static int booted_rd(struct device *, void *);
#endif
@@ -216,7 +200,6 @@ int (*devreg[])(struct device *, void *) = {
booted_le,
booted_ze,
booted_de,
- booted_ni,
#if NSD > 0 || NCD > 0
booted_sd,
#endif
@@ -226,9 +209,6 @@ int (*devreg[])(struct device *, void *) = {
#if NRA
booted_ra,
#endif
-#if NHP
- booted_hp,
-#endif
#if NRD
booted_hd,
#endif
@@ -279,20 +259,6 @@ ubtest(void *aux)
return 0;
}
-#if 1 /* NNI */
-#include <arch/vax/bi/bivar.h>
-int
-booted_ni(struct device *dev, void *aux)
-{
- struct bi_attach_args *ba = aux;
-
- if (jmfr("ni", dev, BDEV_NI) || (kvtophys(ba->ba_ioh) != rpb.csrphy))
- return 0;
-
- return 1;
-}
-#endif /* NNI */
-
#if 1 /* NDE */
int
booted_de(struct device *dev, void *aux)
@@ -413,33 +379,6 @@ booted_ra(struct device *dev, void *aux)
return 0;
}
#endif
-#if NHP
-#include <vax/mba/mbavar.h>
-int
-booted_hp(struct device *dev, void *aux)
-{
- static int mbaaddr;
-
- /* Save last adapter address */
- if (jmfr("mba", dev, BDEV_HP) == 0) {
- struct sbi_attach_args *sa = aux;
-
- mbaaddr = kvtophys(sa->sa_ioh);
- return 0;
- }
-
- if (jmfr("hp", dev, BDEV_HP))
- return 0;
-
- if (((struct mba_attach_args *)aux)->ma_unit != rpb.unit)
- return 0;
-
- if (mbaaddr != rpb.adpphy)
- return 0;
-
- return 1;
-}
-#endif
#if NHD
int
booted_hd(struct device *dev, void *aux)
@@ -456,17 +395,9 @@ booted_hd(struct device *dev, void *aux)
}
#endif
-struct ngcconf {
- struct cfdriver *ng_cf;
- dev_t ng_root;
-};
-
struct nam2blk nam2blk[] = {
{ "ra", 9 },
{ "rx", 12 },
-#ifdef notyet
- { "rl", 14 },
-#endif
{ "hd", 19 },
{ "sd", 20 },
{ "cd", 22 },
diff --git a/sys/arch/vax/vax/cfl.c b/sys/arch/vax/vax/cfl.c
deleted file mode 100644
index 547241a1ee7..00000000000
--- a/sys/arch/vax/vax/cfl.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/* $OpenBSD: cfl.c,v 1.7 2010/06/26 23:24:44 guenther Exp $ */
-/* $NetBSD: cfl.c,v 1.2 1998/04/13 12:10:26 ragge Exp $ */
-/*-
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * Copyright (c) 1982, 1986 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)crl.c 7.5 (Berkeley) 5/9/91
- */
-
-/*
- * Console floppy driver for 11/780.
- * XXX - Does not work. (Not completed)
- * Included here if someone wants to finish it.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/buf.h>
-
-#include <machine/cpu.h>
-#include <machine/mtpr.h>
-#include <machine/sid.h>
-#include <machine/scb.h>
-
-#include <vax/vax/gencons.h>
-
-#define CFL_TRACKS 77
-#define CFL_SECTORS 26
-#define CFL_BYTESPERSEC 128
-#define CFL_MAXSEC (CFL_TRACKS * CFL_SECTORS)
-
-#define FLOP_READSECT 0x900
-#define FLOP_WRITSECT 0x901
-#define FLOP_DATA 0x100
-#define FLOP_COMPLETE 0x200
-
-struct {
- short cfl_state; /* open and busy flags */
- short cfl_active; /* driver state flag */
- struct buf *cfl_buf; /* buffer we're using */
- unsigned char *cfl_xaddr; /* transfer address */
- short cfl_errcnt;
-} cfltab;
-
-#define IDLE 0
-#define OPEN 1
-#define BUSY 2
-
-#define CFL_IDLE 0
-#define CFL_START 1
-#define CFL_SECTOR 2
-#define CFL_DATA 3
-#define CFL_TRACK 4
-#define CFL_NEXT 5
-#define CFL_FINISH 6
-#define CFL_GETIN 7
-
-static void cflstart(void);
-
-int cflopen(dev_t, int, struct proc *);
-int cflclose(dev_t, int, struct proc *);
-int cflrw(dev_t, struct uio *, int);
-
-/*ARGSUSED*/
-int
-cflopen(dev, flag, p)
- dev_t dev;
- int flag;
- struct proc *p;
-{
- if (vax_cputype != VAX_780)
- return (ENXIO);
- if (cfltab.cfl_state != IDLE)
- return (EALREADY);
- cfltab.cfl_state = OPEN;
- cfltab.cfl_buf = geteblk(512);
- return (0);
-}
-
-/*ARGSUSED*/
-int
-cflclose(dev, flag, p)
- dev_t dev;
- int flag;
- struct proc *p;
-{
-
- brelse(cfltab.cfl_buf);
- cfltab.cfl_state = IDLE;
- return 0;
-}
-
-/*ARGSUSED*/
-int
-cflrw(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- register struct buf *bp;
- register int i;
- register int s;
- int error;
-
- if (uio->uio_resid == 0)
- return (0);
- s = spl4();
- while (cfltab.cfl_state == BUSY)
- tsleep((caddr_t)&cfltab, PRIBIO, "cflrw", 0);
- cfltab.cfl_state = BUSY;
- splx(s);
-
- bp = cfltab.cfl_buf;
- error = 0;
- while ((i = imin(CFL_BYTESPERSEC, uio->uio_resid)) > 0) {
- bp->b_blkno = uio->uio_offset>>7;
- if (bp->b_blkno >= CFL_MAXSEC ||
- (uio->uio_offset & 0x7F) != 0) {
- error = EIO;
- break;
- }
- if (uio->uio_rw == UIO_WRITE) {
- error = uiomove(bp->b_data, i, uio);
- if (error)
- break;
- }
- bp->b_flags = uio->uio_rw == UIO_WRITE ? B_WRITE : B_READ;
- s = spl4();
- cflstart();
- while ((bp->b_flags & B_DONE) == 0)
- tsleep((caddr_t)bp, PRIBIO, "cflrw", 0);
- splx(s);
- if (bp->b_flags & B_ERROR) {
- error = EIO;
- break;
- }
- if (uio->uio_rw == UIO_READ) {
- error = uiomove(bp->b_data, i, uio);
- if (error)
- break;
- }
- }
- cfltab.cfl_state = OPEN;
- wakeup((caddr_t)&cfltab);
- return (error);
-}
-
-void
-cflstart()
-{
- register struct buf *bp;
-
- bp = cfltab.cfl_buf;
- cfltab.cfl_errcnt = 0;
- cfltab.cfl_xaddr = (unsigned char *) bp->b_data;
- cfltab.cfl_active = CFL_START;
- bp->b_resid = 0;
-
- if ((mfpr(PR_TXCS) & GC_RDY) == 0)
- /* not ready to receive order */
- return;
-
- cfltab.cfl_active = CFL_SECTOR;
- mtpr(bp->b_flags & B_READ ? FLOP_READSECT : FLOP_WRITSECT, PR_TXDB);
-
-#ifdef lint
- cflintr();
-#endif
-}
-
-void cfltint(int);
-
-void
-cfltint(arg)
- int arg;
-{
- register struct buf *bp = cfltab.cfl_buf;
-
- switch (cfltab.cfl_active) {
- case CFL_START:/* do a read */
- mtpr(bp->b_flags & B_READ ? FLOP_READSECT : FLOP_WRITSECT,
- PR_TXDB);
- cfltab.cfl_active = CFL_SECTOR;
- break;
-
- case CFL_SECTOR:/* send sector */
- mtpr(FLOP_DATA | (int)bp->b_blkno % (CFL_SECTORS + 1), PR_TXDB);
- cfltab.cfl_active = CFL_TRACK;
- break;
-
- case CFL_TRACK:
- mtpr(FLOP_DATA | (int)bp->b_blkno / CFL_SECTORS, PR_TXDB);
- cfltab.cfl_active = CFL_NEXT;
- break;
-
- case CFL_NEXT:
- mtpr(FLOP_DATA | *cfltab.cfl_xaddr++, PR_TXDB);
- if (--bp->b_bcount == 0)
- cfltab.cfl_active = CFL_FINISH;
- break;
-
- }
-}
-
-void cflrint(int);
-
-void
-cflrint(ch)
- int ch;
-{
- struct buf *bp = cfltab.cfl_buf;
-
- switch (cfltab.cfl_active) {
- case CFL_NEXT:
- if ((bp->b_flags & B_READ) == B_READ)
- cfltab.cfl_active = CFL_GETIN;
- else {
- cfltab.cfl_active = CFL_IDLE;
- bp->b_flags |= B_DONE;
- wakeup(bp);
- }
- break;
-
- case CFL_GETIN:
- *cfltab.cfl_xaddr++ = ch & 0377;
- if (--bp->b_bcount==0) {
- cfltab.cfl_active = CFL_IDLE;
- bp->b_flags |= B_DONE;
- wakeup(bp);
- }
- break;
- }
-}
diff --git a/sys/arch/vax/vax/clock.c b/sys/arch/vax/vax/clock.c
index 4233ff11812..cfb9cdc904f 100644
--- a/sys/arch/vax/vax/clock.c
+++ b/sys/arch/vax/vax/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.22 2010/09/20 06:33:48 matthew Exp $ */
+/* $OpenBSD: clock.c,v 1.23 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: clock.c,v 1.35 2000/06/04 06:16:58 matt Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
@@ -216,8 +216,7 @@ numtoyear(num)
return y;
}
-#if VAX750 || VAX780 || VAX8600 || VAX650 || \
- VAX660 || VAX670 || VAX680 || VAX53
+#if VAX650 || VAX660 || VAX670 || VAX680 || VAX53
/*
* Reads the TODR register; returns a (probably) true tick value,
* or CLKREAD_BAD if failed. The year is based on the argument
@@ -257,7 +256,7 @@ generic_clkwrite()
}
#endif
-#if VAX630 || VAX410 || VAX43 || VAX8200 || VAX46 || VAX48 || VAX49
+#if VAX630 || VAX410 || VAX43 || VAX46 || VAX48 || VAX49
volatile short *clk_page; /* where the chip is mapped in virtual memory */
int clk_adrshift; /* how much to multiply the in-page address with */
diff --git a/sys/arch/vax/vax/cmi.c b/sys/arch/vax/vax/cmi.c
deleted file mode 100644
index 6c782679674..00000000000
--- a/sys/arch/vax/vax/cmi.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* $OpenBSD: cmi.c,v 1.4 2006/07/20 19:08:15 miod Exp $ */
-/* $NetBSD: cmi.c,v 1.2 1999/08/14 11:30:48 ragge Exp $ */
-/*
- * Copyright (c) 1999 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#include <machine/nexus.h>
-#include <machine/cpu.h>
-#include <machine/sid.h>
-#include <machine/ka750.h>
-
-static int cmi_print(void *, const char *);
-static int cmi_match(struct device *, struct cfdata *, void *);
-static void cmi_attach(struct device *, struct device *, void *);
-
-struct cfattach cmi_ca = {
- sizeof(struct device), cmi_match, cmi_attach
-};
-
-int
-cmi_print(aux, name)
- void *aux;
- const char *name;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
-
- if (name)
- printf("unknown device 0x%x at %s", sa->type, name);
-
- printf(" tr%d", sa->nexnum);
- return (UNCONF);
-}
-
-
-int
-cmi_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct mainbus_attach_args *maa = aux;
-
- if (maa->maa_bustype == VAX_CMIBUS)
- return 1;
- return 0;
-}
-
-void
-cmi_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct sbi_attach_args sa;
-
- printf("\n");
- /*
- * Probe for memory, can be in the first 4 slots.
- */
-#define NEXPAGES (sizeof(struct nexus) / VAX_NBPG)
- for (sa.nexnum = 0; sa.nexnum < 4; sa.nexnum++) {
- sa.nexaddr = (struct nexus *)vax_map_physmem(NEX750 +
- sizeof(struct nexus) * sa.nexnum, NEXPAGES);
- if (badaddr((caddr_t)sa.nexaddr, 4)) {
- vax_unmap_physmem((vaddr_t)sa.nexaddr, NEXPAGES);
- } else {
- sa.type = NEX_MEM16;
- config_found(self, (void *)&sa, cmi_print);
- }
- }
-
- /*
- * Probe for mba's, can be in slot 4 - 7.
- */
- for (sa.nexnum = 4; sa.nexnum < 7; sa.nexnum++) {
- sa.nexaddr = (struct nexus *)vax_map_physmem(NEX750 +
- sizeof(struct nexus) * sa.nexnum, NEXPAGES);
- if (badaddr((caddr_t)sa.nexaddr, 4)) {
- vax_unmap_physmem((vaddr_t)sa.nexaddr, NEXPAGES);
- } else {
- sa.type = NEX_MBA;
- config_found(self, (void *)&sa, cmi_print);
- }
- }
-
- /*
- * There are always one generic UBA, and maybe an optional.
- */
- sa.nexnum = 8;
- sa.nexaddr = (struct nexus *)vax_map_physmem(NEX750 +
- sizeof(struct nexus) * sa.nexnum, NEXPAGES);
- sa.type = NEX_UBA0;
- config_found(self, (void *)&sa, cmi_print);
-
- sa.nexnum = 9;
- sa.nexaddr = (struct nexus *)vax_map_physmem(NEX750 +
- sizeof(struct nexus) * sa.nexnum, NEXPAGES);
- sa.type = NEX_UBA1;
- if (badaddr((caddr_t)sa.nexaddr, 4))
- vax_unmap_physmem((vaddr_t)sa.nexaddr, NEXPAGES);
- else
- config_found(self, (void *)&sa, cmi_print);
-}
diff --git a/sys/arch/vax/vax/conf.c b/sys/arch/vax/vax/conf.c
index 3744271b5b3..3dbf621635c 100644
--- a/sys/arch/vax/vax/conf.c
+++ b/sys/arch/vax/vax/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.63 2011/04/30 15:24:07 miod Exp $ */
+/* $OpenBSD: conf.c,v 1.64 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: conf.c,v 1.44 1999/10/27 16:38:54 ragge Exp $ */
/*-
@@ -40,56 +40,15 @@
#include <sys/conf.h>
#include <sys/vnode.h>
-#include "hp.h" /* 0 */
-bdev_decl(hp);
-
-#include "ht.h"
-bdev_decl(ht);
-
-#include "rk.h"
-bdev_decl(rk);
-
-#include "te.h"
-bdev_decl(tm);
-
#include "mt.h"
bdev_decl(mt);
-#include "ts.h"
-bdev_decl(ts);
-
-#include "mu.h"
-bdev_decl(mu);
-
-#if defined(VAX750)
-#define NCTU 1
-#else
-#define NCTU 0
-#endif
-bdev_decl(ctu);
#include "rd.h"
#include "ra.h"
bdev_decl(ra);
bdev_decl(rx);
-#include "up.h"
-bdev_decl(up);
-
-#include "tj.h"
-bdev_decl(ut);
-
-#include "rb.h"
-bdev_decl(idc);
-
-#include "uu.h"
-bdev_decl(uu);
-
-#if 0
-#include "rl.h"
-bdev_decl(rl);
-#endif
-
#include "ccd.h"
#include "raid.h"
@@ -108,21 +67,21 @@ bdev_decl(ry);
struct bdevsw bdevsw[] =
{
- bdev_disk_init(NHP,hp), /* 0: RP0?/RM0? */
- bdev_tape_init(NHT,ht), /* 1: TU77 w/ TM03 */
- bdev_disk_init(NUP,up), /* 2: SC-21/SC-31 */
- bdev_disk_init(NRK,rk), /* 3: RK06/07 */
+ bdev_notdef(), /* 0 */
+ bdev_notdef(), /* 1 */
+ bdev_notdef(), /* 2 */
+ bdev_notdef(), /* 3 */
bdev_swap_init(1,sw), /* 4: swap pseudo-device */
- bdev_tape_init(NTE,tm), /* 5: TM11/TE10 */
- bdev_tape_init(NTS,ts), /* 6: TS11 */
- bdev_tape_init(NMU,mu), /* 7: TU78 */
- bdev_tape_init(NCTU,ctu), /* 8: Console TU58 on 730/750 */
+ bdev_notdef(), /* 5 */
+ bdev_notdef(), /* 6 */
+ bdev_notdef(), /* 7 */
+ bdev_notdef(), /* 8 */
bdev_disk_init(NRA,ra), /* 9: MSCP disk */
- bdev_tape_init(NTJ,ut), /* 10: TU45 */
- bdev_disk_init(NRB,idc), /* 11: IDC (RB730) */
+ bdev_notdef(), /* 10 */
+ bdev_notdef(), /* 11 */
bdev_disk_init(NRX,rx), /* 12: RX?? on MSCP */
- bdev_disk_init(NUU,uu), /* 13: TU58 on DL11 */
- bdev_notdef(), /* 14: RL01/02 */
+ bdev_notdef(), /* 13 */
+ bdev_notdef(), /* 14 */
bdev_tape_init(NMT,mt), /* 15: MSCP tape */
bdev_notdef(), /* 16: was: KDB50/RA?? */
bdev_disk_init(NCCD,ccd), /* 17: concatenated disk driver */
@@ -144,20 +103,16 @@ int nblkdev = nitems(bdevsw);
cons_decl(dz);
cons_decl(gen);
-cons_decl(qd);
cons_decl(qsc);
cons_decl(ws);
#include "dz.h"
-#include "qd.h"
#include "qsc.h"
-#include "qv.h"
#include "wsdisplay.h"
#include "wskbd.h"
struct consdev constab[]={
-#if VAX8600 || VAX8200 || VAX780 || VAX750 || VAX650 || VAX630 || VAX660 || \
- VAX670 || VAX680
+#if VAX650 || VAX630 || VAX660 || VAX670 || VAX680
#define NGEN 1
cons_init(gen), /* Generic console type; mtpr/mfpr */
#else
@@ -173,14 +128,6 @@ struct consdev constab[]={
cons_init(qsc), /* SC26C94 serial console on VXT2000 */
#endif
#endif
-#if VAX650 || VAX630
-#if NQV
- cons_init(qv), /* QVSS/QDSS bit-mapped console driver */
-#endif
-#if NQD
- cons_init(qd),
-#endif
-#endif
#if NWSDISPLAY > 0 || NWSKBD > 0
cons_init(ws), /* any other frame buffer console */
#endif
@@ -192,149 +139,29 @@ struct consdev constab[]={
{ 0 }
};
-/* Special for console storage */
-#define dev_type_rw(n) int n(dev_t, int, int, struct proc *)
-
-/* plotters - open, close, write, ioctl, poll*/
-#define cdev_plotter_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
- dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
- 0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev }
-
-/* console mass storage - open, close, read/write */
-#define cdev_cnstore_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
- dev_init(c,n,write), (dev_type_ioctl((*))) enodev, \
- (dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev }
-
-#define cdev_lp_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
- dev_init(c,n,write), (dev_type_ioctl((*))) enodev, \
- (dev_type_stop((*))) enodev, 0, seltrue, (dev_type_mmap((*))) enodev }
-
-/* graphic display adapters */
-#define cdev_graph_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
- dev_init(c,n,write), dev_init(c,n,ioctl), dev_init(c,n,stop), \
- 0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev }
-
-/* Ingres */
-#define cdev_ingres_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) nullop, \
- (dev_type_write((*))) nullop, dev_init(c,n,ioctl), \
- (dev_type_stop((*))) nullop, 0, (dev_type_poll((*))) nullop, \
- (dev_type_mmap((*))) enodev }
-
#define mmread mmrw
#define mmwrite mmrw
cdev_decl(mm);
#include "bio.h"
#include "pty.h"
-cdev_decl(hp);
-cdev_decl(rk);
-cdev_decl(tm);
cdev_decl(mt);
-cdev_decl(ts);
-cdev_decl(mu);
cdev_decl(ra);
-cdev_decl(up);
-cdev_decl(ut);
-cdev_decl(idc);
-cdev_decl(fd);
cdev_decl(gencn);
cdev_decl(rx);
-#if 0
-cdev_decl(rl);
-#endif
cdev_decl(hd);
cdev_decl(ry);
-#include "ct.h"
-cdev_decl(ct);
-#include "dh.h"
-cdev_decl(dh);
-#include "dmf.h"
-cdev_decl(dmf);
-
-#include "np.h"
-cdev_decl(np);
-
-#if VAX8600
-#define NCRL 1
-#else
-#define NCRL 0
-#endif
-#define crlread crlrw
-#define crlwrite crlrw
-cdev_decl(crl);
-
-#if VAX8200
-#define NCRX 1
-#else
-#define NCRX 0
-#endif
-#define crxread crxrw
-#define crxwrite crxrw
-cdev_decl(crx);
-
-#if VAX780
-#define NCFL 1
-#else
-#define NCFL 0
-#endif
-#define cflread cflrw
-#define cflwrite cflrw
-cdev_decl(cfl);
-
cdev_decl(qsc);
cdev_decl(dz);
-#include "vp.h"
-cdev_decl(vp);
-
-#include "lp.h"
-cdev_decl(lp);
-
-#include "va.h"
-cdev_decl(va);
-
-#include "lpa.h"
-cdev_decl(lpa);
-
-#include "dn.h"
-cdev_decl(dn);
-
-#include "ik.h"
-cdev_decl(ik);
-
-#include "ps.h"
-cdev_decl(ps);
-
-#include "ad.h"
-cdev_decl(ad);
-
#include "dhu.h"
cdev_decl(dhu);
-#include "dmz.h"
-cdev_decl(dmz);
-
-cdev_decl(qv);
-cdev_decl(qd);
-
#include "dl.h"
cdev_decl(dl);
-#if defined(INGRES)
-#define NII 1
-#else
-#define NII 0
-#endif
-cdev_decl(ii);
-
#include "bpfilter.h"
#include "tun.h"
@@ -363,46 +190,46 @@ struct cdevsw cdevsw[] =
cdev_tty_init(NDZ,dz), /* 1: DZ11 */
cdev_ctty_init(1,ctty), /* 2: controlling terminal */
cdev_mm_init(1,mm), /* 3: /dev/{null,mem,kmem,...} */
- cdev_disk_init(NHP,hp), /* 4: Massbuss disk */
+ cdev_notdef(), /* 4 */
cdev_notdef(), /* 5 */
- cdev_plotter_init(NVP,vp), /* 6: Versatec plotter */
+ cdev_notdef(), /* 6 */
cdev_notdef(), /* 7 was /dev/drum */
- cdev_cnstore_init(NCFL,cfl), /* 8: 11/780 console floppy */
+ cdev_notdef(), /* 8 */
cdev_disk_init(NRA,ra), /* 9: MSCP disk interface */
- cdev_plotter_init(NVA,va), /* 10: Benson-Varian plotter */
- cdev_disk_init(NRK,rk), /* 11: RK06/07 */
- cdev_tty_init(NDH,dh), /* 12: DH-11/DM-11 */
- cdev_disk_init(NUP,up), /* 13: SC-21/SC-31 */
- cdev_tape_init(NTE,tm), /* 14: TM11/TE10 */
- cdev_lp_init(NLP,lp), /* 15: LP-11 line printer */
- cdev_tape_init(NTS,ts), /* 16: TS11 */
- cdev_tape_init(NTJ,ut), /* 17: TU45 */
- cdev_lp_init(NCT,ct), /* 18: phototypesetter interface */
- cdev_tape_init(NMU,mu), /* 19: TU78 */
+ cdev_notdef(), /* 10 */
+ cdev_notdef(), /* 11 */
+ cdev_notdef(), /* 12 */
+ cdev_notdef(), /* 13 */
+ cdev_notdef(), /* 14 */
+ cdev_notdef(), /* 15 */
+ cdev_notdef(), /* 16 */
+ cdev_notdef(), /* 17 */
+ cdev_notdef(), /* 18 */
+ cdev_notdef(), /* 19 */
cdev_tty_init(NPTY,pts), /* 20: pseudo-tty slave */
cdev_ptc_init(NPTY,ptc), /* 21: pseudo-tty master */
- cdev_tty_init(NDMF,dmf), /* 22: DMF32 */
- cdev_disk_init(NRB,idc), /* 23: IDC (RB730) */
- cdev_lp_init(NDN,dn), /* 24: DN-11 autocall unit */
+ cdev_notdef(), /* 22 */
+ cdev_notdef(), /* 23 */
+ cdev_notdef(), /* 24 */
cdev_tty_init(NGEN,gencn), /* 25: Generic console (mtpr...) */
- cdev_audio_init(NLPA,lpa), /* 26 ??? */
- cdev_graph_init(NPS,ps), /* 27: E/S graphics device */
+ cdev_notdef(), /* 26 */
+ cdev_notdef(), /* 27 */
cdev_lkm_init(NLKM,lkm), /* 28: loadable module driver */
- cdev_ch_init(NAD,ad), /* 29: DT A/D converter */
+ cdev_notdef(), /* 29 */
cdev_disk_init(NRX,rx), /* 30: RX?? on MSCP */
- cdev_graph_init(NIK,ik), /* 31: Ikonas frame buffer */
+ cdev_notdef(), /* 31 */
cdev_notdef(), /* 32: RL01/02 on unibus */
cdev_log_init(1,log), /* 33: /dev/klog */
cdev_tty_init(NDHU,dhu), /* 34: DHU-11 */
- cdev_cnstore_init(NCRL,crl), /* 35: Console RL02 on 8600 */
+ cdev_notdef(), /* 35 */
cdev_notdef(), /* 36 */
- cdev_tty_init(NDMZ,dmz), /* 37: DMZ32 */
+ cdev_notdef(), /* 37 */
cdev_tape_init(NMT,mt), /* 38: MSCP tape */
- cdev_audio_init(NNP,np), /* 39: NP Intelligent Board */
- cdev_graph_init(NQV,qv), /* 40: QVSS graphic display */
- cdev_graph_init(NQD,qd), /* 41: QDSS graphic display */
+ cdev_notdef(), /* 39 */
+ cdev_notdef(), /* 40 */
+ cdev_notdef(), /* 41 */
cdev_pf_init(NPF,pf), /* 42: packet filter */
- cdev_ingres_init(NII,ii), /* 43: Ingres device */
+ cdev_notdef(), /* 43 */
cdev_notdef(), /* 44 was Datakit */
cdev_notdef(), /* 45 was Datakit */
cdev_notdef(), /* 46 was Datakit */
@@ -410,7 +237,7 @@ struct cdevsw cdevsw[] =
cdev_tty_init(NQSC,qsc), /* 48: SC26C94 on VXT2000 */
cdev_systrace_init(NSYSTRACE,systrace), /* 49: system call tracing */
cdev_ksyms_init(NKSYMS,ksyms), /* 50: Kernel symbols device */
- cdev_cnstore_init(NCRX,crx), /* 51: Console RX50 at 8200 */
+ cdev_notdef(), /* 51 */
cdev_notdef(), /* 52: was: KDB50/RA?? */
cdev_fd_init(1,filedesc), /* 53: file descriptor pseudo-device */
cdev_disk_init(NCCD,ccd), /* 54: concatenated disk driver */
@@ -465,33 +292,33 @@ int chrtoblktbl[] = {
NODEV, /* 1 */
NODEV, /* 2 */
NODEV, /* 3 */
- 0, /* 4 */
+ NODEV, /* 4 */
NODEV, /* 5 */
NODEV, /* 6 */
NODEV, /* 7 */
NODEV, /* 8 */
- 9, /* 9 */
+ 9, /* 9 ra */
NODEV, /* 10 */
- 3, /* 11 */
+ NODEV, /* 11 */
NODEV, /* 12 */
- 2, /* 13 */
- 5, /* 14 */
+ NODEV, /* 13 */
+ NODEV, /* 14 */
NODEV, /* 15 */
- 6, /* 16 */
- 10, /* 17 */
+ NODEV, /* 16 */
+ NODEV, /* 17 */
NODEV, /* 18 */
- 7, /* 19 */
+ NODEV, /* 19 */
NODEV, /* 20 */
NODEV, /* 21 */
NODEV, /* 22 */
- 11, /* 23 */
+ NODEV, /* 23 */
NODEV, /* 24 */
NODEV, /* 25 */
NODEV, /* 26 */
NODEV, /* 27 */
NODEV, /* 28 */
NODEV, /* 29 */
- 12, /* 30 */
+ 12, /* 30 rx */
NODEV, /* 31 */
NODEV, /* 32 */
NODEV, /* 33 */
@@ -499,7 +326,7 @@ int chrtoblktbl[] = {
NODEV, /* 35 */
NODEV, /* 36 */
NODEV, /* 37 */
- 15, /* 38 */
+ 15, /* 38 mt */
NODEV, /* 39 */
NODEV, /* 40 */
NODEV, /* 41 */
@@ -515,26 +342,26 @@ int chrtoblktbl[] = {
NODEV, /* 51 */
NODEV, /* 52 */
NODEV, /* 53 */
- 17, /* 54 */
- 18, /* 55 */
+ 17, /* 54 ccd */
+ 18, /* 55 vnd */
NODEV, /* 56 */
NODEV, /* 57 */
- 19, /* 58 */
- 20, /* 59 */
- 21, /* 60 */
- 22, /* 61 */
- 23, /* 62 */
- NODEV, /* 63 */
+ 19, /* 58 hd */
+ 20, /* 59 sd */
+ 21, /* 60 st */
+ 22, /* 61 cd */
+ 23, /* 62 rd */
+ NODEV, /* 63 ch */
NODEV, /* 64 */
- NODEV, /* 65 */
+ NODEV, /* 65 uk */
NODEV, /* 66 */
NODEV, /* 67 */
NODEV, /* 68 */
NODEV, /* 69 */
NODEV, /* 70 */
- 24, /* 71 */
+ 24, /* 71 ry */
NODEV, /* 72 */
- 25, /* 73 */
+ 25, /* 73 raid */
NODEV, /* 74 */
};
int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/vax/vax/crl.c b/sys/arch/vax/vax/crl.c
deleted file mode 100644
index 64ff68cf650..00000000000
--- a/sys/arch/vax/vax/crl.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/* $OpenBSD: crl.c,v 1.9 2010/06/26 23:24:44 guenther Exp $ */
-/* $NetBSD: crl.c,v 1.6 2000/01/24 02:40:33 matt Exp $ */
-/*-
- * Copyright (c) 1982, 1986 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)crl.c 7.5 (Berkeley) 5/9/91
- */
-
-/*
- * TO DO (tef 7/18/85):
- * 1) change printf's to log() instead???
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/buf.h>
-
-#include <machine/cpu.h>
-#include <machine/mtpr.h>
-#include <machine/sid.h>
-#include <machine/scb.h>
-
-#include <vax/vax/crl.h>
-
-struct {
- short crl_state; /* open and busy flags */
- short crl_active; /* driver state flag */
- struct buf *crl_buf; /* buffer we're using */
- ushort *crl_xaddr; /* transfer address */
- short crl_errcnt;
-} crltab;
-
-struct {
- int crl_cs; /* saved controller status */
- int crl_ds; /* saved drive status */
-} crlstat;
-
-void crlintr(void *);
-void crlattach(void);
-static void crlstart(void);
-
-int crlopen(dev_t, int, struct proc *);
-int crlclose(dev_t, int, struct proc *);
-int crlrw(dev_t, struct uio *, int);
-
-
-struct ivec_dsp crl_intr;
-
-void
-crlattach()
-{
- crl_intr = idsptch;
- crl_intr.hoppaddr = crlintr;
- scb->scb_csrint = &crl_intr;
-}
-
-/*ARGSUSED*/
-int
-crlopen(dev, flag, p)
- dev_t dev;
- int flag;
- struct proc *p;
-{
- if (vax_cputype != VAX_8600)
- return (ENXIO);
- if (crltab.crl_state != CRL_IDLE)
- return (EALREADY);
- crltab.crl_state = CRL_OPEN;
- crltab.crl_buf = geteblk(512);
- return (0);
-}
-
-/*ARGSUSED*/
-int
-crlclose(dev, flag, p)
- dev_t dev;
- int flag;
- struct proc *p;
-{
-
- brelse(crltab.crl_buf);
- crltab.crl_state = CRL_IDLE;
- return 0;
-}
-
-/*ARGSUSED*/
-int
-crlrw(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- register struct buf *bp;
- register int i;
- register int s;
- int error;
-
- if (uio->uio_resid == 0)
- return (0);
- s = spl4();
- while (crltab.crl_state & CRL_BUSY)
- tsleep((caddr_t)&crltab, PRIBIO, "crlrw", 0);
- crltab.crl_state |= CRL_BUSY;
- splx(s);
-
- bp = crltab.crl_buf;
- error = 0;
- while ((i = imin(CRLBYSEC, uio->uio_resid)) > 0) {
- bp->b_blkno = uio->uio_offset>>9;
- if (bp->b_blkno >= MAXSEC || (uio->uio_offset & 0x1FF) != 0) {
- error = EIO;
- break;
- }
- if (uio->uio_rw == UIO_WRITE) {
- error = uiomove(bp->b_data, i, uio);
- if (error)
- break;
- }
- bp->b_flags = uio->uio_rw == UIO_WRITE ? B_WRITE : B_READ;
- s = spl4();
- crlstart();
- while ((bp->b_flags & B_DONE) == 0)
- tsleep((caddr_t)bp, PRIBIO, "crlrw", 0);
- splx(s);
- if (bp->b_flags & B_ERROR) {
- error = EIO;
- break;
- }
- if (uio->uio_rw == UIO_READ) {
- error = uiomove(bp->b_data, i, uio);
- if (error)
- break;
- }
- }
- crltab.crl_state &= ~CRL_BUSY;
- wakeup((caddr_t)&crltab);
- return (error);
-}
-
-void
-crlstart()
-{
- register struct buf *bp;
-
- bp = crltab.crl_buf;
- crltab.crl_errcnt = 0;
- crltab.crl_xaddr = (ushort *) bp->b_data;
- bp->b_resid = 0;
-
- if ((mfpr(PR_STXCS) & STXCS_RDY) == 0)
- /* not ready to receive order */
- return;
- if ((bp->b_flags&(B_READ|B_WRITE)) == B_READ) {
- crltab.crl_active = CRL_F_READ;
- mtpr(bp->b_blkno<<8 | STXCS_IE | CRL_F_READ, PR_STXCS);
- } else {
- crltab.crl_active = CRL_F_WRITE;
- mtpr(bp->b_blkno<<8 | STXCS_IE | CRL_F_WRITE, PR_STXCS);
- }
-#ifdef lint
- crlintr(NULL);
-#endif
-}
-
-void
-crlintr(arg)
- void *arg;
-{
- register struct buf *bp;
- int i;
-
- bp = crltab.crl_buf;
- i = mfpr(PR_STXCS);
- switch ((i>>24) & 0xFF) {
-
- case CRL_S_XCMPLT:
- switch (crltab.crl_active) {
-
- case CRL_F_RETSTS:
- crlstat.crl_ds = mfpr(PR_STXDB);
- printf("crlcs=0x%b, crlds=0x%b\n", crlstat.crl_cs,
- CRLCS_BITS, crlstat.crl_ds, CRLDS_BITS);
- break;
-
- case CRL_F_READ:
- case CRL_F_WRITE:
- bp->b_flags |= B_DONE;
- }
- crltab.crl_active = 0;
- wakeup((caddr_t)bp);
- break;
-
- case CRL_S_XCONT:
- switch (crltab.crl_active) {
-
- case CRL_F_WRITE:
- mtpr(*crltab.crl_xaddr++, PR_STXDB);
- mtpr(bp->b_blkno<<8 | STXCS_IE | CRL_F_WRITE, PR_STXCS);
- break;
-
- case CRL_F_READ:
- *crltab.crl_xaddr++ = mfpr(PR_STXDB);
- mtpr(bp->b_blkno<<8 | STXCS_IE | CRL_F_READ, PR_STXCS);
- }
- break;
-
- case CRL_S_ABORT:
- crltab.crl_active = CRL_F_RETSTS;
- mtpr(STXCS_IE | CRL_F_RETSTS, PR_STXCS);
- bp->b_flags |= B_DONE|B_ERROR;
- break;
-
- case CRL_S_RETSTS:
- crlstat.crl_cs = mfpr(PR_STXDB);
- mtpr(STXCS_IE | CRL_S_RETSTS, PR_STXCS);
- break;
-
- case CRL_S_HNDSHK:
- printf("crl: hndshk error\n"); /* dump out some status too? */
- crltab.crl_active = 0;
- bp->b_flags |= B_DONE|B_ERROR;
- wakeup((caddr_t)bp);
- break;
-
- case CRL_S_HWERR:
- printf("crl: hard error sn%d\n", bp->b_blkno);
- crltab.crl_active = CRL_F_ABORT;
- mtpr(STXCS_IE | CRL_F_ABORT, PR_STXCS);
- break;
- }
-}
diff --git a/sys/arch/vax/vax/crl.h b/sys/arch/vax/vax/crl.h
deleted file mode 100644
index 7a2c1a8e4e3..00000000000
--- a/sys/arch/vax/vax/crl.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* $OpenBSD: crl.h,v 1.3 2000/04/27 01:10:11 bjc Exp $ */
-/* $NetBSD: crl.h,v 1.2 1999/04/12 20:57:52 pk Exp $ */
-/*
- * @(#)crl.h 7.1 (Berkeley) 6/5/86
- */
-
-/****************************************************************
- * *
- * Licensed from Digital Equipment Corporation *
- * Copyright (c) *
- * Digital Equipment Corporation *
- * Maynard, Massachusetts *
- * 1985, 1986 *
- * All rights reserved. *
- * *
- * The Information in this software is subject to change *
- * without notice and should not be construed as a commitment *
- * by Digital Equipment Corporation. Digital makes no *
- * representations about the suitability of this software for *
- * any purpose. It is supplied "As Is" without expressed or *
- * implied warranty. *
- * *
- * If the Regents of the University of California or its *
- * licensees modify the software in a manner creating *
- * derivative copyright rights, appropriate copyright *
- * legends may be placed on the derivative work in addition *
- * to that set forth above. *
- ****************************************************************/
-
-/*
- * Console RL02 status of current transfer (read only)
- */
-#define CRL_S_XCMPLT 1 /* transaction complete */
-#define CRL_S_XCONT 2 /* continue transaction */
-#define CRL_S_ABORT 3 /* transation abort */
-#define CRL_S_RETSTS 4 /* return device status */
-#define CRL_S_HNDSHK 0x80 /* handshake err during transaction */
-#define CRL_S_HWERR 0x81 /* hardware err during transaction */
-
-/*
- * Console RL02 function codes
- */
-#define CRL_F_NOOP 0 /* No operation */
-#define CRL_F_RSTSTS 2 /* reset and return device status */
-#define CRL_F_ABORT 3 /* abort transfer */
-#define CRL_F_RETSTS 4 /* read device status */
-#define CRL_F_WRITE 5 /* write block data */
-#define CRL_F_READ 6 /* read block data */
-
-/*
- * Console sectoring information.
- * The console understands the rl02 as having 512 byte sectors.
- */
-#define CRLBYSEC 512 /* bytes/sector */
-#define MAXSEC 20480 /* sectors/rl02 */
-
-/*
- * STXCS bit definitions
- */
-#define STXCS_RDY 0x00000080 /* ready bit */
-#define STXCS_IE 0x00000040 /* interrupt enable */
-
-#define CRLERRS 5 /* number of retries before quitting */
-
-/*
- * The state byte is used to retain exclusivity,
- * and contains the busy flag.
- */
-#define CRL_IDLE 0
-#define CRL_OPEN 1
-#define CRL_BUSY 2
-
-
-#define CRLDS_BITS \
-"\20\20WDE\17CHE\16WL\15SKTO\14SPE\13WGE\12VC\11DSE\
-\10DT\7HS\6CO\5HO\4BH\3STC\2STB\1STA"
-
-#define CRLCS_BITS \
-"\20\20CE\17DE\16NXM\15DLT\14DCRC\13OPI\1DRDY"
diff --git a/sys/arch/vax/vax/crx.c b/sys/arch/vax/vax/crx.c
deleted file mode 100644
index 3fcba586ff8..00000000000
--- a/sys/arch/vax/vax/crx.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/* $OpenBSD: crx.c,v 1.4 2003/06/02 23:27:58 millert Exp $ */
-/* $NetBSD: crx.c,v 1.4 2000/01/24 02:40:33 matt Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)rx50.c 7.5 (Berkeley) 12/16/90
- */
-
-/*
- * Routines to handle the console RX50.
- */
-
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/buf.h>
-#include <sys/errno.h>
-#include <sys/uio.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-
-#include <machine/ka820.h>
-#include <vax/vax/crx.h>
-
-extern struct rx50device *rx50device_ptr;
-#define rxaddr rx50device_ptr
-extern struct ka820port *ka820port_ptr;
-
-#define rx50unit(dev) minor(dev)
-
-cdev_decl(crx);
-
-struct rx50state {
- short rs_flags; /* see below */
- short rs_drive; /* current drive number */
- u_int rs_blkno; /* current block number */
-} rx50state;
-
-/* flags */
-#define RS_0OPEN 0x01 /* drive 0 open -- must be first */
-#define RS_1OPEN 0x02 /* drive 1 open -- must be second */
-#define RS_BUSY 0x04 /* operation in progress */
-#define RS_WANT 0x08 /* wakeup when done */
-#define RS_DONE 0x20 /* I/O operation done */
-#define RS_ERROR 0x40 /* error bit set at interrupt */
-
-#if 0
-#define CRXDEBUG 1
-#endif
-
-/*
- * Open a console RX50.
- */
-/*ARGSUSED*/
-int
-crxopen(dev, flags, fmt, p)
- dev_t dev;
- int flags, fmt;
- struct proc *p;
-{
- int unit;
-
-#if CRXDEBUG
- printf("crxopen(csa%d)\n", minor(dev));
-#endif
- if ((unit = rx50unit(dev)) >= 2)
- return (ENXIO);
-
- /* enforce exclusive access */
- if (rx50state.rs_flags & (1 << unit))
- return (EBUSY);
- rx50state.rs_flags |= 1 << unit;
-
- return (0);
-}
-
-/*
- * Close a console RX50.
- */
-/*ARGSUSED*/
-int
-crxclose(dev, flags, fmt, p)
- dev_t dev;
- int flags, fmt;
- struct proc *p;
-{
-#if CRXDEBUG
- printf("crxclose(csa%d)\n", minor(dev));
-#endif
-
- rx50state.rs_flags &= ~(1 << dev); /* atomic */
- return 0;
-}
-
-/*
- * Perform a read (uio->uio_rw==UIO_READ) or write (uio->uio_rw==UIO_WRITE).
- */
-int crxrw(dev_t, struct uio *, int);
-int
-crxrw(dev, uio, flags)
- dev_t dev;
- register struct uio *uio;
- int flags;
-{
- register struct rx50state *rs;
- register char *cp;
- register int error, i, t;
- char secbuf[512];
- static char driveselect[2] = { RXCMD_DRIVE0, RXCMD_DRIVE1 };
-
-#if CRXDEBUG
- printf("crxrw(csa%d): %s\n",
- minor(dev), uio->uio_rw==UIO_READ?"read":"write");
- printf("crxrw: ka820port = %x\n", ka820port_ptr->csr);
-#endif
- /* enforce whole-sector I/O */
- if ((uio->uio_offset & 511) || (uio->uio_resid & 511))
- return (EINVAL);
-
- rs = &rx50state;
-
- /* lock out others */
- i = spl4();
- while (rs->rs_flags & RS_BUSY) {
- rs->rs_flags |= RS_WANT;
- tsleep((caddr_t) &rx50state, PRIBIO, "crxrw", 0);
- }
- rs->rs_flags |= RS_BUSY;
- rs->rs_drive = rx50unit(dev);
- splx(i);
-
- rxaddr = rx50device_ptr;
- error = 0;
-
- while (uio->uio_resid) {
- rs->rs_blkno = uio->uio_offset >> 9;
- if (rs->rs_blkno >= RX50MAXSEC) {
- if (rs->rs_blkno > RX50MAXSEC)
- error = EINVAL;
- else if (uio->uio_rw == UIO_WRITE)
- error = ENOSPC;
- /* else ``eof'' */
- break;
- }
- rs->rs_flags &= ~(RS_ERROR | RS_DONE);
- if (uio->uio_rw == UIO_WRITE) {
- /* copy the data to the RX50 silo */
- error = uiomove(secbuf, 512, uio);
- if (error)
- break;
- i = rxaddr->rxrda;
- for (cp = secbuf, i = 512; --i >= 0;)
- rxaddr->rxfdb = *cp++;
- i = RXCMD_WRITE;
- } else
- i = RXCMD_READ;
- rxaddr->rxcmd = i | driveselect[rs->rs_drive];
- i = rs->rs_blkno - ((t = rs->rs_blkno / RX50SEC) * RX50SEC);
- rxaddr->rxtrk = t == 79 ? 0 : t + 1;
-#ifdef notdef
- rxaddr->rxsec = "\1\3\5\7\11\1\3\5\7"[(2*t + i) % 5] + (i > 4);
-#else
- rxaddr->rxsec = RX50SKEW(i, t);
-#endif
-#if CRXDEBUG
- printf("crx: going off\n");
- printf("crxrw: ka820port = %x\n", ka820port_ptr->csr);
-#endif
- rxaddr->rxgo = 0; /* start it up */
- ka820port_ptr->csr |= KA820PORT_RXIRQ;
- i = spl4();
- while ((rs->rs_flags & RS_DONE) == 0) {
-#if CRXDEBUG
- printf("crx: sleeping on I/O\n");
- printf("crxopen: ka820port = %x\n", ka820port_ptr->csr);
-#endif
- tsleep((caddr_t) &rs->rs_blkno, PRIBIO, "crxrw", 0);
- }
- splx(i);
- if (rs->rs_flags & RS_ERROR) {
- error = EIO;
- break;
- }
- if (uio->uio_rw == UIO_READ) {
- /* copy the data out of the silo */
- i = rxaddr->rxrda;
- for (cp = secbuf, i = 512; --i >= 0;)
- *cp++ = rxaddr->rxedb;
- error = uiomove(secbuf, 512, uio);
- if (error)
- break;
- }
- }
-
- /* let others in */
-#if CRXDEBUG
- printf("crx: let others in\n");
-#endif
- rs->rs_flags &= ~RS_BUSY;
- if (rs->rs_flags & RS_WANT)
- wakeup((caddr_t) rs);
-
- return (error);
-}
-
-void
-crxintr(arg)
- void *arg;
-{
- register struct rx50state *rs = &rx50state;
-
- /* ignore spurious interrupts */
- if ((rxaddr->rxcmd & RXCMD_DONE) == 0)
- return;
- if ((rs->rs_flags & RS_BUSY) == 0) {
- printf("stray rx50 interrupt ignored (rs_flags: 0x%x, rxcmd: 0x%x)\n",
- rs->rs_flags, rxaddr->rxcmd);
- return;
- }
- if (rxaddr->rxcmd & RXCMD_ERROR) {
- printf(
- "csa%d: hard error sn%d: cmd=%x trk=%x sec=%x csc=%x ict=%x ext=%x\n",
- rs->rs_drive + 1, rs->rs_blkno,
- rxaddr->rxcmd, rxaddr->rxtrk, rxaddr->rxsec,
- rxaddr->rxcsc, rxaddr->rxict, rxaddr->rxext);
- rxaddr->rxcmd = RXCMD_RESET;
- rxaddr->rxgo = 0;
- rs->rs_flags |= RS_ERROR;
- }
- rs->rs_flags |= RS_DONE;
- wakeup((caddr_t) &rs->rs_blkno);
-}
diff --git a/sys/arch/vax/vax/crx.h b/sys/arch/vax/vax/crx.h
deleted file mode 100644
index b733f24c56a..00000000000
--- a/sys/arch/vax/vax/crx.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $OpenBSD: crx.h,v 1.2 2003/06/02 23:27:58 millert Exp $ */
-/* $NetBSD: crx.h,v 1.2 1999/01/19 21:04:48 ragge Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)rx50reg.h 7.2 (Berkeley) 6/28/90
- */
-
-/*
- * RX50 registers.
- */
-
-/*
- * The names below do not quite match the DEC documentation simply because
- * the names in the documentation are so bad.
- */
-struct rx50device {
- u_short rxid; /* identification */
- u_short reserved;
- u_short rxcmd; /* command function reg */
- u_short rxtrk; /* track */
- u_short rxsec; /* sector */
- u_short rxcsc; /* current sector */
- u_short rxict; /* incorrect track (???) */
- u_short rxext; /* extend command register */
- u_short rxedb; /* empty data buffer (read) */
- u_short rxrda; /* reset data address */
- volatile u_short rxgo; /* read to start current cmd */
- u_short rxfdb; /* fill data buffer (write) */
-};
-
-#define RX50SEC 10 /* sectors per track */
-#define RX50MAXSEC 800 /* 10 sectors times 80 tracks */
-
-/* Interrupt vector */
-#define SCB_RX50 0xf0
-
-/*
- * Do the sector skew given the sector and track
- * number (it depends on both!).
- */
-/* (((((s) / 5) + 2 * ((s) + (t))) % 10) + 1) */
-#define RX50SKEW(s, t) (((s) / 5) + "\1\3\5\7\11\1\3\5\7"[((s) + (t)) % 5])
-
-/*
- * Values in the command function register.
- */
-#define RXCMD_ERROR 0x80 /* error bit (composite?) */
-#define RXCMD_READ 0x40 /* read command */
-#define RXCMD_WRITE 0x70 /* write command */
-#define RXCMD_RESET 0x20 /* reset command */
-#define RXCMD_DONE 0x08 /* operation done (status) */
-#define RXCMD_DRIVE0 0x00 /* select drive 0 (csa1) */
-#define RXCMD_DRIVE1 0x02 /* select drive 1 (csa2) */
diff --git a/sys/arch/vax/vax/ctu.c b/sys/arch/vax/vax/ctu.c
deleted file mode 100644
index e7756a79fd0..00000000000
--- a/sys/arch/vax/vax/ctu.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/* $OpenBSD: ctu.c,v 1.10 2007/06/06 17:15:13 deraadt Exp $ */
-/* $NetBSD: ctu.c,v 1.10 2000/03/23 06:46:44 thorpej Exp $ */
-/*
- * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of
- * Lule}, Sweden and its contributors.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Device driver for 11/750 Console TU58.
- *
- * Error checking is almost nonexistent, the driver should be
- * fixed to at least calculate checksum on incoming packets.
- * Writing of tapes does not work, by some unknown reason so far.
- * It is almost useless to try to use this driver when running
- * multiuser, because the serial device don't have any buffers
- * so we will lose interrupts.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/callout.h>
-#include <sys/kernel.h>
-#include <sys/buf.h>
-#include <sys/fcntl.h>
-#include <sys/malloc.h>
-#include <sys/ioctl.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/disklabel.h> /* For disklabel prototype */
-
-#include <machine/mtpr.h>
-#include <machine/rsp.h>
-#include <machine/scb.h>
-#include <machine/trap.h>
-
-enum tu_state {
- SC_UNUSED,
- SC_INIT,
- SC_READY,
- SC_SEND_CMD,
- SC_GET_RESP,
- SC_GET_WCONT,
- SC_GET_END,
- SC_RESTART,
-};
-
-struct tu_softc {
- enum tu_state sc_state;
- int sc_error;
- char sc_rsp[15]; /* Should be struct rsb; but don't work */
- u_char *sc_xfptr; /* Current char to xfer */
- u_char *sc_blk; /* Base of current 128b block */
- int sc_tpblk; /* Start block number */
- int sc_nbytes; /* Number of bytes to xfer */
- int sc_xbytes; /* Number of xfer'd bytes */
- int sc_bbytes; /* Number of xfer'd bytes this block */
- int sc_op; /* Read/write */
- int sc_xmtok; /* set if OK to xmit */
- struct buf_queue sc_q; /* pending I/O requests */
-} tu_sc;
-
-struct ivec_dsp tu_recv, tu_xmit;
-
-void ctutintr(void *);
-void cturintr(void *);
-void ctuattach(void);
-void ctustart(struct buf *);
-void ctuwatch(void *);
-short ctu_cksum(unsigned short *, int);
-
-int ctuopen(dev_t, int, int, struct proc *);
-int ctuclose(dev_t, int, int, struct proc *);
-void ctustrategy(struct buf *);
-int ctuioctl(dev_t, u_long, caddr_t, int, struct proc *);
-int ctudump(dev_t, daddr64_t, caddr_t, size_t);
-
-static struct callout ctu_watch_ch = CALLOUT_INITIALIZER;
-
-void
-ctuattach()
-{
- BUFQ_INIT(&tu_sc.sc_q);
-
- tu_recv = idsptch;
- tu_recv.hoppaddr = cturintr;
- scb->scb_csrint = (void *)&tu_recv;
-
- tu_xmit = idsptch;
- tu_xmit.hoppaddr = ctutintr;
- scb->scb_cstint = (void *)&tu_xmit;
-}
-
-int
-ctuopen(dev, oflags, devtype, p)
- dev_t dev;
- int oflags, devtype;
- struct proc *p;
-{
- int unit, error;
-
- unit = minor(dev);
-
- if (unit)
- return ENXIO;
-
- if (tu_sc.sc_state != SC_UNUSED)
- return EBUSY;
-
- tu_sc.sc_error = 0;
- mtpr(0100, PR_CSRS); /* Enable receive interrupt */
- callout_reset(&ctu_watch_ch, hz, ctuwatch, NULL);
-
- tu_sc.sc_state = SC_INIT;
-
- mtpr(RSP_TYP_INIT, PR_CSTD);
-
- if ((error = tsleep((caddr_t)&tu_sc, (PZERO + 10)|PCATCH,
- "ctuopen", 0)))
- return (error);
-
- if (tu_sc.sc_error)
- return tu_sc.sc_error;
-
- tu_sc.sc_state = SC_READY;
- tu_sc.sc_xmtok = 1;
-
- mtpr(0100, PR_CSTS);
- return 0;
-
-}
-
-int
-ctuclose(dev, oflags, devtype, p)
- dev_t dev;
- int oflags, devtype;
- struct proc *p;
-{
- mtpr(0, PR_CSRS);
- mtpr(0, PR_CSTS);
- tu_sc.sc_state = SC_UNUSED;
- callout_stop(&ctu_watch_ch);
- return 0;
-}
-
-void
-ctustrategy(bp)
- struct buf *bp;
-{
- int s;
-
-#ifdef TUDEBUG
- printf("addr %x, block %x, nblock %x, read %x\n",
- bp->b_data, bp->b_blkno, bp->b_bcount,
- bp->b_flags & B_READ);
-#endif
-
- if (bp->b_blkno >= 512) {
- s = splbio();
- biodone(bp);
- splx(s);
- return;
- }
- bp->b_rawblkno = bp->b_blkno;
- s = splbio();
- disksort_blkno(&tu_sc.sc_q, bp); /* Why not use disksort? */
- if (tu_sc.sc_state == SC_READY)
- ctustart(bp);
- splx(s);
-}
-
-void
-ctustart(bp)
- struct buf *bp;
-{
- struct rsp *rsp = (struct rsp *)tu_sc.sc_rsp;
-
-
- tu_sc.sc_xfptr = tu_sc.sc_blk = bp->b_data;
- tu_sc.sc_tpblk = bp->b_blkno;
- tu_sc.sc_nbytes = bp->b_bcount;
- tu_sc.sc_xbytes = tu_sc.sc_bbytes = 0;
- tu_sc.sc_op = bp->b_flags & B_READ ? RSP_OP_READ : RSP_OP_WRITE;
-
- rsp->rsp_typ = RSP_TYP_COMMAND;
- rsp->rsp_sz = 012;
- rsp->rsp_op = tu_sc.sc_op;
- rsp->rsp_mod = 0;
- rsp->rsp_drv = 0;
- rsp->rsp_sw = rsp->rsp_xx1 = rsp->rsp_xx2 = 0;
- rsp->rsp_cnt = tu_sc.sc_nbytes;
- rsp->rsp_blk = tu_sc.sc_tpblk;
- rsp->rsp_sum = ctu_cksum((unsigned short *)rsp, 6);
- tu_sc.sc_state = SC_SEND_CMD;
- if (tu_sc.sc_xmtok) {
- tu_sc.sc_xmtok = 0;
- ctutintr(NULL);
- }
-}
-
-int
-ctuioctl(dev, cmd, data, fflag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int fflag;
- struct proc *p;
-{
- return 0;
-}
-
-/*
- * Not bloody likely...
- */
-int
-ctudump(dev, blkno, va, size)
- dev_t dev;
- daddr64_t blkno;
- caddr_t va;
- size_t size;
-{
- return 0;
-}
-
-void
-cturintr(arg)
- void *arg;
-{
- int status = mfpr(PR_CSRD);
- struct buf *bp;
-
- bp = BUFQ_FIRST(&tu_sc.sc_q);
- switch (tu_sc.sc_state) {
-
- case SC_UNUSED:
- printf("stray console storage interrupt, got %o\n", status);
- break;
-
- case SC_INIT:
- if (status != RSP_TYP_CONTINUE)
- tu_sc.sc_error = EIO;
- wakeup((void *)&tu_sc);
- break;
- case SC_GET_RESP:
- tu_sc.sc_tpblk++;
- if (tu_sc.sc_xbytes == tu_sc.sc_nbytes) {
- tu_sc.sc_bbytes++;
- if (tu_sc.sc_bbytes == 146) { /* We're finished! */
-#ifdef TUDEBUG
- printf("Xfer ok\n");
-#endif
- BUFQ_REMOVE(&tu_sc.sc_q, bp);
- biodone(bp);
- tu_sc.sc_xmtok = 1;
- tu_sc.sc_state = SC_READY;
- if (BUFQ_FIRST(&tu_sc.sc_q) != NULL)
- ctustart(BUFQ_FIRST(&tu_sc.sc_q));
- }
- break;
- }
- tu_sc.sc_bbytes++;
- if (tu_sc.sc_bbytes < 3) /* Data header */
- break;
- if (tu_sc.sc_bbytes == 132) { /* Finished */
- tu_sc.sc_bbytes = 0;
- break;
- }
- if (tu_sc.sc_bbytes == 131) /* First checksum */
- break;
- tu_sc.sc_xfptr[tu_sc.sc_xbytes++] = status;
- break;
-
- case SC_GET_WCONT:
- if (status != 020)
- printf("SC_GET_WCONT: status %o\n", status);
- else
- ctutintr(NULL);
- tu_sc.sc_xmtok = 0;
- break;
-
- case SC_RESTART:
- ctustart(BUFQ_FIRST(&tu_sc.sc_q));
- break;
-
- default:
- if (status == 4) { /* Protocol error, or something */
- tu_sc.sc_state = SC_RESTART;
- mtpr(RSP_TYP_INIT, PR_CSTD);
- return;
- }
- printf("Unknown receive ctuintr state %d, pack %o\n",
- tu_sc.sc_state, status);
- }
-
-}
-
-void
-ctutintr(arg)
- void *arg;
-{
- int c;
-
- if (tu_sc.sc_xmtok)
- return;
-
- switch (tu_sc.sc_state) {
- case SC_SEND_CMD:
- c = tu_sc.sc_rsp[tu_sc.sc_xbytes++] & 0xff;
- mtpr(c, PR_CSTD);
- if (tu_sc.sc_xbytes > 13) {
- tu_sc.sc_state = (tu_sc.sc_op == RSP_OP_READ ?
- SC_GET_RESP : SC_GET_WCONT);
- tu_sc.sc_xbytes = 0;
- tu_sc.sc_xmtok++;
- }
- break;
-
- case SC_GET_WCONT:
- switch (tu_sc.sc_bbytes) {
- case 0:
- mtpr(1, PR_CSTD); /* This is a data packet */
- break;
-
- case 1:
- mtpr(128, PR_CSTD); /* # of bytes to send */
- break;
-
- case 130:
- mtpr(0, PR_CSTD); /* First checksum */
- break;
-
- case 131:
- mtpr(0, PR_CSTD); /* Second checksum */
- break;
-
- case 132: /* Nothing to send... */
- tu_sc.sc_bbytes = -1;
- if (tu_sc.sc_xbytes == tu_sc.sc_nbytes + 1)
- tu_sc.sc_op = SC_GET_END;
- break;
- default:
- c = tu_sc.sc_rsp[tu_sc.sc_xbytes++] & 0xff;
- mtpr(c, PR_CSTD);
- break;
- }
- tu_sc.sc_bbytes++;
- break;
-
- default:
- printf("Unknown xmit ctuintr state %d\n",tu_sc.sc_state);
- }
-}
-
-short
-ctu_cksum(buf, words)
- unsigned short *buf;
- int words;
-{
- int i, cksum;
-
- for (i = cksum = 0; i < words; i++)
- cksum += buf[i];
-
-hej: if (cksum > 65535) {
- cksum = (cksum & 65535) + (cksum >> 16);
- goto hej;
- }
- return cksum;
-}
-
-int oldtp;
-
-/*
- * Watch so that we don't get blocked unnecessary due to lost int's.
- */
-void
-ctuwatch(arg)
- void *arg;
-{
-
- callout_reset(&ctu_watch_ch, hz, ctuwatch, NULL);
-
- if (tu_sc.sc_state == SC_GET_RESP && tu_sc.sc_tpblk != 0 &&
- tu_sc.sc_tpblk == oldtp && (tu_sc.sc_tpblk % 128 != 0)) {
- printf("tu0: lost recv interrupt\n");
- ctustart(BUFQ_FIRST(&tu_sc.sc_q));
- return;
- }
- if (tu_sc.sc_state == SC_RESTART)
- mtpr(RSP_TYP_INIT, PR_CSTS);
- oldtp = tu_sc.sc_tpblk;
-}
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c
index 2d90272813c..b879278e4b5 100644
--- a/sys/arch/vax/vax/disksubr.c
+++ b/sys/arch/vax/vax/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.65 2011/04/16 03:21:15 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.66 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */
/*
@@ -48,8 +48,6 @@
#include <vax/mscp/mscp.h> /* For disk encoding scheme */
-#include "mba.h"
-
/*
* Attempt to read a disk label from a device
* using the indicated strategy routine.
@@ -162,50 +160,3 @@ disk_printtype(int unit, int type)
printf("%c", (int)MSCP_MID_CHAR(0, type));
printf("%d\n", MSCP_MID_NUM(type));
}
-
-#if NMBA > 0
-/*
- * Be sure that the pages we want to do DMA to is actually there
- * by faking page-faults if necessary. If given a map-register address,
- * also map it in.
- */
-void
-disk_reallymapin(struct buf *bp, pt_entry_t *map, int reg, int flag)
-{
- struct proc *p;
- volatile pt_entry_t *io;
- pt_entry_t *pte;
- struct pcb *pcb;
- int pfnum, npf, o;
- caddr_t addr;
-
- o = (int)bp->b_data & VAX_PGOFSET;
- npf = vax_atop(bp->b_bcount + o) + 1;
- addr = bp->b_data;
- p = bp->b_proc;
-
- /*
- * Get a pointer to the pte pointing out the first virtual address.
- * Use different ways in kernel and user space.
- */
- if ((bp->b_flags & B_PHYS) == 0) {
- pte = kvtopte(addr);
- p = &proc0;
- } else {
- pcb = &p->p_addr->u_pcb;
- pte = uvtopte(addr, pcb);
- }
-
- if (map) {
- io = &map[reg];
- while (--npf > 0) {
- pfnum = (*pte & PG_FRAME);
- if (pfnum == 0)
- panic("mapin zero entry");
- pte++;
- *(int *)io++ = pfnum | flag;
- }
- *(int *)io = 0;
- }
-}
-#endif
diff --git a/sys/arch/vax/vax/findcpu.c b/sys/arch/vax/vax/findcpu.c
index 4c5d1dab0bd..76c93124bc9 100644
--- a/sys/arch/vax/vax/findcpu.c
+++ b/sys/arch/vax/vax/findcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: findcpu.c,v 1.14 2008/08/20 19:00:01 miod Exp $ */
+/* $OpenBSD: findcpu.c,v 1.15 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: findcpu.c,v 1.5 1999/08/23 19:10:43 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@@ -67,16 +67,6 @@ findcpu(void)
vax_boardtype = vax_cputype << 24;
switch (vax_cputype) {
- case VAX_TYP_780:
- vax_bustype = VAX_SBIBUS;
- break;
- case VAX_TYP_750:
- vax_bustype = VAX_CMIBUS;
- break;
- case VAX_TYP_790:
- vax_bustype = VAX_ABUS;
- break;
-
case VAX_TYP_UV2:
case VAX_TYP_CVAX:
case VAX_TYP_RIGEL:
@@ -105,13 +95,6 @@ findcpu(void)
vax_bustype = VAX_VXTBUS;
break;
- case VAX_BTYP_9CC:
- case VAX_BTYP_9RR:
- case VAX_BTYP_1202:
- case VAX_BTYP_1302:
- vax_bustype = VAX_XMIBUS;
- break;
-
case VAX_BTYP_60:
vax_confdata =
((struct cvax_ssc *)CVAX_SSC)->ssc_terminfo;
@@ -127,18 +110,11 @@ findcpu(void)
case VAX_BTYP_1305:
vax_bustype = VAX_IBUS;
break;
- }
- break;
- case VAX_TYP_8SS:
- vax_boardtype = VAX_BTYP_8000;
- vax_bustype = VAX_BIBUS;
- break;
-
- case VAX_TYP_8NN:
- case VAX_TYP_8PS:
- vax_boardtype = VAX_BTYP_8800;
- vax_bustype = VAX_NBIBUS;
+ default:
+ /* CPU not supported, just give up */
+ asm("halt");
+ }
break;
default:
diff --git a/sys/arch/vax/vax/gencons.c b/sys/arch/vax/vax/gencons.c
index 90632e31a14..bd92353e410 100644
--- a/sys/arch/vax/vax/gencons.c
+++ b/sys/arch/vax/vax/gencons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencons.c,v 1.23 2010/06/28 14:13:31 deraadt Exp $ */
+/* $OpenBSD: gencons.c,v 1.24 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: gencons.c,v 1.22 2000/01/24 02:40:33 matt Exp $ */
/*
@@ -291,30 +291,6 @@ gencninit(struct consdev *cndev)
void
gencnputc(dev_t dev, int ch)
{
-#ifdef VAX8800
- /*
- * On KA88 we may get C-S/C-Q from the console.
- * XXX - this will cause a loop at spltty() in kernel and will
- * interfere with other console communication. Fortunately
- * kernel printf's are uncommon.
- */
- if (vax_cputype == VAX_TYP_8NN) {
- int s = spltty();
-
- while (mfpr(PR_RXCS) & GC_DON) {
- if ((mfpr(PR_RXDB) & 0x7f) == 19) {
- while (1) {
- while ((mfpr(PR_RXCS) & GC_DON) == 0)
- ;
- if ((mfpr(PR_RXDB) & 0x7f) == 17)
- break;
- }
- }
- }
- splx(s);
- }
-#endif
-
while ((mfpr(PR_TXCS) & GC_RDY) == 0) /* Wait until xmit ready */
;
mtpr(ch, PR_TXDB); /* xmit character */
diff --git a/sys/arch/vax/vax/gencons.h b/sys/arch/vax/vax/gencons.h
index f85625ef45e..f9ac7881653 100644
--- a/sys/arch/vax/vax/gencons.h
+++ b/sys/arch/vax/vax/gencons.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencons.h,v 1.5 2002/03/14 01:26:48 millert Exp $ */
+/* $OpenBSD: gencons.h,v 1.6 2011/07/06 18:32:59 miod Exp $ */
/* $NetBSD: gencons.h,v 1.9 2000/01/20 00:07:49 matt Exp $ */
/*
@@ -41,8 +41,6 @@
/* PR_TXCS */
#define GC_RDY 0x80 /* Console ready to xmit chr */
#define GC_TIE 0x40 /* xmit interrupt enable */
-#define GC_LT 0x80000 /* VAX8600: Enable logical terminal */
-#define GC_WRT 0x8000 /* VAX8600: Allow mtpr's to console */
/* PR_RXCS */
#define GC_DON 0x80 /* character received */
diff --git a/sys/arch/vax/vax/ka750.c b/sys/arch/vax/vax/ka750.c
deleted file mode 100644
index 5fcdfc42810..00000000000
--- a/sys/arch/vax/vax/ka750.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* $OpenBSD: ka750.c,v 1.11 2008/08/18 23:05:38 miod Exp $ */
-/* $NetBSD: ka750.c,v 1.30 1999/08/14 11:30:48 ragge Exp $ */
-/*
- * Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)ka750.c 7.4 (Berkeley) 5/9/91
- * @(#)autoconf.c 7.20 (Berkeley) 5/9/91
- */
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#include <machine/ka750.h>
-#include <machine/mtpr.h>
-#include <machine/cpu.h>
-#include <machine/clock.h>
-#include <machine/sid.h>
-
-#include <vax/vax/gencons.h>
-
-void ctuattach(void);
-static void ka750_clrf(void);
-static void ka750_conf(void);
-static void ka750_memerr(void);
-static int ka750_mchk(caddr_t);
-
-
-struct cpu_dep ka750_calls = {
- 0,
- ka750_mchk,
- ka750_memerr,
- ka750_conf,
- generic_clkread,
- generic_clkwrite,
- 1, /* ~VUPS */
- 4, /* SCB pages */
- NULL, /* halt call */
- NULL, /* Reboot call */
- ka750_clrf,
- NULL,
- NULL,
- hardclock
-};
-
-static caddr_t mcraddr[4]; /* XXX */
-
-void
-ka750_conf()
-{
- printf("cpu0: KA750, hardware rev %d, ucode rev %d, ",
- V750HARDW(vax_cpudata), V750UCODE(vax_cpudata));
- if (mfpr(PR_ACCS) & 255) {
- printf("FPA present, enabling.\n");
- mtpr(0x8000, PR_ACCS);
- } else
- printf("no FPA\n");
-
- if (mfpr(PR_TODR) == 0) { /* Check for failing battery */
- mtpr(1, PR_TODR);
- printf("WARNING: TODR battery broken\n");
- }
-
- /* Call ctuattach() here so it can setup its vectors. */
- ctuattach();
-}
-
-int ka750_memmatch(struct device *, struct cfdata *, void *);
-void ka750_memenable(struct device *, struct device *, void *);
-
-struct cfattach mem_cmi_ca = {
- sizeof(struct device), ka750_memmatch, ka750_memenable
-};
-
-int
-ka750_memmatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
-
- if (cf->cf_loc[CMICF_TR] != sa->nexnum && cf->cf_loc[CMICF_TR] > -1)
- return 0;
-
- if (sa->type != NEX_MEM16)
- return 0;
-
- return 1;
-}
-
-struct mcr750 {
- int mc_err; /* error bits */
- int mc_inh; /* inhibit crd */
- int mc_inf; /* info bits */
-};
-
-#define M750_ICRD 0x10000000 /* inhibit crd interrupts, in [1] */
-#define M750_UNCORR 0xc0000000 /* uncorrectable error, in [0] */
-#define M750_CORERR 0x20000000 /* correctable error, in [0] */
-
-#define M750_INH(mcr) ((mcr)->mc_inh = 0)
-#define M750_ENA(mcr) ((mcr)->mc_err = (M750_UNCORR|M750_CORERR), \
- (mcr)->mc_inh = M750_ICRD)
-#define M750_ERR(mcr) ((mcr)->mc_err & (M750_UNCORR|M750_CORERR))
-
-#define M750_SYN(err) ((err) & 0x7f)
-#define M750_ADDR(err) (((err) >> 9) & 0x7fff)
-
-/* enable crd interrupts */
-void
-ka750_memenable(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
- struct mcr750 *mcr = (struct mcr750 *)sa->nexaddr;
- int k, l, m, cardinfo;
-
- mcraddr[self->dv_unit] = (caddr_t)sa->nexaddr;
-
- /* We will use this info for error reporting - later! */
- cardinfo = mcr->mc_inf;
- switch ((cardinfo >> 24) & 3) {
- case 0: printf(": L0011 ");
- break;
-
- case 1: printf(": L0016 ");
- m = cardinfo & 0xaaaa;
- for (k = l = 0; k < 16; k++){
- if (m & 1)
- l++;
- m >>= 1;
- }
- printf("with %d M8750",l);
- break;
-
- case 3: printf(": L0022 ");
- m = cardinfo & 0x5555;
- for (k = l = 0; k < 16; k++) {
- if (m & 1)
- l++;
- m>>=1;
- }
- printf("with %d M7199",l);
- m = cardinfo & 0xaaaa;
- if (m) {
- for (k = l = 0; k < 16; k++) {
- if (m & 1)
- l++;
- m >>= 1;
- }
- printf(" and %d M8750",l);
- }
- break;
- }
- printf("\n");
-
-
- M750_ENA((struct mcr750 *)mcraddr[0]);
-}
-
-/* log crd errors */
-void
-ka750_memerr()
-{
- register struct mcr750 *mcr = (struct mcr750 *)mcraddr[0];
- register int err;
-
- if (M750_ERR(mcr)) {
- err = mcr->mc_err; /* careful with i/o space refs */
- printf("mcr0: %s", err & M750_UNCORR ?
- "hard error" : "soft ecc");
- printf(" addr %x syn %x\n", M750_ADDR(err), M750_SYN(err));
- M750_INH(mcr);
- }
-}
-
-char *mc750[]={"0","1","2","3","4","5","6","7","8","9","10","11","12","13",
- "14","15"};
-
-struct mc750frame {
- int mc5_bcnt; /* byte count == 0x28 */
- int mc5_summary; /* summary parameter (as above) */
- int mc5_va; /* virtual address register */
- int mc5_errpc; /* error pc */
- int mc5_mdr;
- int mc5_svmode; /* saved mode register */
- int mc5_rdtimo; /* read lock timeout */
- int mc5_tbgpar; /* tb group parity error register */
- int mc5_cacherr; /* cache error register */
- int mc5_buserr; /* bus error register */
- int mc5_mcesr; /* machine check status register */
- int mc5_pc; /* trapped pc */
- int mc5_psl; /* trapped psl */
-};
-
-#define MC750_TBERR 2 /* type code of cp tbuf par */
-#define MC750_TBPAR 4 /* tbuf par bit in mcesr */
-
-int
-ka750_mchk(cmcf)
- caddr_t cmcf;
-{
- register struct mc750frame *mcf = (struct mc750frame *)cmcf;
- register int type = mcf->mc5_summary;
- int mcsr = mfpr(PR_MCSR);
-
- printf("machine check %x: %s%s\n", type, mc750[type&0xf],
- (type&0xf0) ? " abort" : " fault");
- printf(
-"\tva %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x\n",
- mcf->mc5_va, mcf->mc5_errpc, mcf->mc5_mdr, mcf->mc5_svmode,
- mcf->mc5_rdtimo, mcf->mc5_tbgpar, mcf->mc5_cacherr);
- printf("\tbuserr %x mcesr %x pc %x psl %x mcsr %x\n",
- mcf->mc5_buserr, mcf->mc5_mcesr, mcf->mc5_pc, mcf->mc5_psl,
- mcsr);
- mtpr(0, PR_TBIA);
- mtpr(0xf, PR_MCESR);
- if (type == MC750_TBERR && (mcf->mc5_mcesr&0xe) == MC750_TBPAR) {
- printf("tbuf par: flushing and returning\n");
- return (MCHK_RECOVERED);
- }
- return (MCHK_PANIC);
-}
-
-void
-ka750_clrf()
-{
- int s = splhigh();
-
-#define WAIT while ((mfpr(PR_TXCS) & GC_RDY) == 0) ;
-
- WAIT;
-
- mtpr(GC_CWFL|GC_CONS, PR_TXDB);
-
- WAIT;
- mtpr(GC_CCFL|GC_CONS, PR_TXDB);
-
- WAIT;
- splx(s);
-}
diff --git a/sys/arch/vax/vax/ka780.c b/sys/arch/vax/vax/ka780.c
deleted file mode 100644
index 362eb5a581a..00000000000
--- a/sys/arch/vax/vax/ka780.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/* $OpenBSD: ka780.c,v 1.10 2008/08/18 23:05:38 miod Exp $ */
-/* $NetBSD: ka780.c,v 1.14 1999/08/07 10:36:49 ragge Exp $ */
-/*-
- * Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)ka780.c 7.4 (Berkeley) 5/9/91
- */
-
-/*
- * 780-specific code.
- */
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#include <machine/nexus.h>
-#include <machine/sid.h>
-#include <machine/cpu.h>
-#include <machine/clock.h>
-
-static void ka780_memerr(void);
-static int ka780_mchk(caddr_t);
-static void ka780_conf(void);
-static int mem_sbi_match(struct device *, struct cfdata *, void *);
-static void mem_sbi_attach(struct device *, struct device *, void *);
-
-struct cfattach mem_sbi_ca = {
- sizeof(struct mem_softc), mem_sbi_match, mem_sbi_attach
-};
-
-int
-mem_sbi_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
-
- if (cf->cf_loc[SBICF_TR] != sa->nexnum && cf->cf_loc[SBICF_TR] > -1)
- return 0;
-
- switch (sa->type) {
- case NEX_MEM4:
- case NEX_MEM4I:
- case NEX_MEM16:
- case NEX_MEM16I:
- sa->nexinfo = M780C;
- break;
-
- case NEX_MEM64I:
- case NEX_MEM64L:
- case NEX_MEM64LI:
- case NEX_MEM256I:
- case NEX_MEM256L:
- case NEX_MEM256LI:
- sa->nexinfo = M780EL;
- break;
-
- case NEX_MEM64U:
- case NEX_MEM64UI:
- case NEX_MEM256U:
- case NEX_MEM256UI:
- sa->nexinfo = M780EU;
- break;
-
- default:
- return 0;
- }
- return 1;
-}
-
-
-/*
- * Declaration of 780-specific calls.
- */
-struct cpu_dep ka780_calls = {
- 0,
- ka780_mchk,
- ka780_memerr,
- ka780_conf,
- generic_clkread,
- generic_clkwrite,
- 2, /* ~VUPS */
- 5, /* SCB pages */
- NULL,
- NULL,
- NULL,
- NULL,
- hardclock
-};
-
-/*
- * Memory controller register usage varies per controller.
- */
-struct mcr780 {
- int mc_reg[4];
-};
-
-#define M780_ICRD 0x40000000 /* inhibit crd interrupts, in [2] */
-#define M780_HIER 0x20000000 /* high error rate, in reg[2] */
-#define M780_ERLOG 0x10000000 /* error log request, in reg[2] */
-/* on a 780, memory crd's occur only when bit 15 is set in the SBIER */
-/* register; bit 14 there is an error bit which we also clear */
-/* these bits are in the back of the ``red book'' (or in the VMS code) */
-
-#define M780C_INH(mcr) \
- ((mcr)->mc_reg[2] = (M780_ICRD|M780_HIER|M780_ERLOG)); \
- mtpr(0, PR_SBIER);
-#define M780C_ENA(mcr) \
- ((mcr)->mc_reg[2] = (M780_HIER|M780_ERLOG)); mtpr(3<<14, PR_SBIER);
-#define M780C_ERR(mcr) \
- ((mcr)->mc_reg[2] & (M780_ERLOG))
-
-#define M780C_SYN(mcr) ((mcr)->mc_reg[2] & 0xff)
-#define M780C_ADDR(mcr) (((mcr)->mc_reg[2] >> 8) & 0xfffff)
-
-#define M780EL_INH(mcr) \
- ((mcr)->mc_reg[2] = (M780_ICRD|M780_HIER|M780_ERLOG)); \
- mtpr(0, PR_SBIER);
-#define M780EL_ENA(mcr) \
- ((mcr)->mc_reg[2] = (M780_HIER|M780_ERLOG)); mtpr(3<<14, PR_SBIER);
-#define M780EL_ERR(mcr) \
- ((mcr)->mc_reg[2] & (M780_ERLOG))
-
-#define M780EL_SYN(mcr) ((mcr)->mc_reg[2] & 0x7f)
-#define M780EL_ADDR(mcr) (((mcr)->mc_reg[2] >> 11) & 0x1ffff)
-
-#define M780EU_INH(mcr) \
- ((mcr)->mc_reg[3] = (M780_ICRD|M780_HIER|M780_ERLOG)); \
- mtpr(0, PR_SBIER);
-#define M780EU_ENA(mcr) \
- ((mcr)->mc_reg[3] = (M780_HIER|M780_ERLOG)); mtpr(3<<14, PR_SBIER);
-#define M780EU_ERR(mcr) \
- ((mcr)->mc_reg[3] & (M780_ERLOG))
-
-#define M780EU_SYN(mcr) ((mcr)->mc_reg[3] & 0x7f)
-#define M780EU_ADDR(mcr) (((mcr)->mc_reg[3] >> 11) & 0x1ffff)
-
-/* enable crd interrrupts */
-void
-mem_sbi_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
- struct mem_softc *sc = (void *)self;
- struct mcr780 *mcr = (void *)sa->nexaddr;
-
- sc->sc_memaddr = sa->nexaddr;
- sc->sc_memtype = sa->nexinfo;
- sc->sc_memnr = sa->type;
-
- printf(": ");
- switch (sc->sc_memtype) {
-
- case M780C:
- printf("standard");
- M780C_ENA(mcr);
- break;
-
- case M780EL:
- printf("(el) ");
- M780EL_ENA(mcr);
- if (sc->sc_memnr != NEX_MEM64I && sc->sc_memnr != NEX_MEM256I)
- break;
-
- case M780EU:
- printf("(eu)");
- M780EU_ENA(mcr);
- break;
- }
- printf("\n");
-}
-
-/* log crd errors */
-void
-ka780_memerr()
-{
- extern struct cfdriver mem_cd;
- struct mem_softc *sc;
- register struct mcr780 *mcr;
- register int m;
-
- for (m = 0; m < mem_cd.cd_ndevs; m++) {
- if (mem_cd.cd_devs[m] == 0)
- continue;
-
- sc = (void *)mem_cd.cd_devs[m];
- mcr = (struct mcr780 *)sc->sc_memaddr;
- switch (sc->sc_memtype) {
-
- case M780C:
- if (M780C_ERR(mcr)) {
- printf("%s: soft ecc addr %x syn %x\n",
- sc->sc_dev.dv_xname, M780C_ADDR(mcr),
- M780C_SYN(mcr));
-#ifdef TRENDATA
- memlog(m, mcr);
-#endif
- M780C_INH(mcr);
- }
- break;
-
- case M780EL:
- if (M780EL_ERR(mcr)) {
- printf("%s: soft ecc addr %x syn %x\n",
- sc->sc_dev.dv_xname, M780EL_ADDR(mcr),
- M780EL_SYN(mcr));
- M780EL_INH(mcr);
- }
- if (sc->sc_memnr != NEX_MEM64I &&
- sc->sc_memnr != NEX_MEM256I)
- break;
-
- case M780EU:
- if (M780EU_ERR(mcr)) {
- printf("%s: soft ecc addr %x syn %x\n",
- sc->sc_dev.dv_xname, M780EU_ADDR(mcr),
- M780EU_SYN(mcr));
- M780EU_INH(mcr);
- }
- break;
- }
- }
-}
-
-#ifdef TRENDATA
-/*
- * Figure out what chip to replace on Trendata boards.
- * Assumes all your memory is Trendata or the non-Trendata
- * memory never fails..
- */
-struct {
- u_char m_syndrome;
- char m_chip[4];
-} memlogtab[] = {
- 0x01, "C00", 0x02, "C01", 0x04, "C02", 0x08, "C03",
- 0x10, "C04", 0x19, "L01", 0x1A, "L02", 0x1C, "L04",
- 0x1F, "L07", 0x20, "C05", 0x38, "L00", 0x3B, "L03",
- 0x3D, "L05", 0x3E, "L06", 0x40, "C06", 0x49, "L09",
- 0x4A, "L10", 0x4c, "L12", 0x4F, "L15", 0x51, "L17",
- 0x52, "L18", 0x54, "L20", 0x57, "L23", 0x58, "L24",
- 0x5B, "L27", 0x5D, "L29", 0x5E, "L30", 0x68, "L08",
- 0x6B, "L11", 0x6D, "L13", 0x6E, "L14", 0x70, "L16",
- 0x73, "L19", 0x75, "L21", 0x76, "L22", 0x79, "L25",
- 0x7A, "L26", 0x7C, "L28", 0x7F, "L31", 0x80, "C07",
- 0x89, "U01", 0x8A, "U02", 0x8C, "U04", 0x8F, "U07",
- 0x91, "U09", 0x92, "U10", 0x94, "U12", 0x97, "U15",
- 0x98, "U16", 0x9B, "U19", 0x9D, "U21", 0x9E, "U22",
- 0xA8, "U00", 0xAB, "U03", 0xAD, "U05", 0xAE, "U06",
- 0xB0, "U08", 0xB3, "U11", 0xB5, "U13", 0xB6, "U14",
- 0xB9, "U17", 0xBA, "U18", 0xBC, "U20", 0xBF, "U23",
- 0xC1, "U25", 0xC2, "U26", 0xC4, "U28", 0xC7, "U31",
- 0xE0, "U24", 0xE3, "U27", 0xE5, "U29", 0xE6, "U30"
-};
-
-memlog(m, mcr)
- int m;
- struct mcr780 *mcr;
-{
- register i;
-
- for (i = 0; i < (sizeof (memlogtab) / sizeof (memlogtab[0])); i++)
- if ((u_char)(M780C_SYN(mcr)) == memlogtab[i].m_syndrome) {
- printf (
- "mcr%d: replace %s chip in %s bank of memory board %d (0-15)\n",
- m,
- memlogtab[i].m_chip,
- (M780C_ADDR(mcr) & 0x8000) ? "upper" : "lower",
- (M780C_ADDR(mcr) >> 16));
- return;
- }
- printf ("mcr%d: multiple errors, not traceable\n", m);
- break;
-}
-#endif /* TRENDATA */
-
-char *mc780[]={"0","1","2","3","4","5","6","7","8","9","10","11","12","13",
- "14","15"};
-
-struct mc780frame {
- int mc8_bcnt; /* byte count == 0x28 */
- int mc8_summary; /* summary parameter (as above) */
- int mc8_cpues; /* cpu error status */
- int mc8_upc; /* micro pc */
- int mc8_vaviba; /* va/viba register */
- int mc8_dreg; /* d register */
- int mc8_tber0; /* tbuf error reg 0 */
- int mc8_tber1; /* tbuf error reg 1 */
- int mc8_timo; /* timeout address divided by 4 */
- int mc8_parity; /* parity */
- int mc8_sbier; /* sbi error register */
- int mc8_pc; /* trapped pc */
- int mc8_psl; /* trapped psl */
-};
-
-int
-ka780_mchk(cmcf)
- caddr_t cmcf;
-{
- register struct mc780frame *mcf = (struct mc780frame *)cmcf;
- register int type = mcf->mc8_summary;
- register int sbifs;
-
- printf("machine check %x: %s%s\n", type, mc780[type&0xf],
- (type&0xf0) ? " abort" : " fault");
- printf("\tcpues %x upc %x va/viba %x dreg %x tber %x %x\n",
- mcf->mc8_cpues, mcf->mc8_upc, mcf->mc8_vaviba,
- mcf->mc8_dreg, mcf->mc8_tber0, mcf->mc8_tber1);
- sbifs = mfpr(PR_SBIFS);
- printf("\ttimo %x parity %x sbier %x pc %x psl %x sbifs %x\n",
- mcf->mc8_timo*4, mcf->mc8_parity, mcf->mc8_sbier,
- mcf->mc8_pc, mcf->mc8_psl, sbifs);
- /* THE FUNNY BITS IN THE FOLLOWING ARE FROM THE ``BLACK BOOK'' */
- /* AND SHOULD BE PUT IN AN ``sbi.h'' */
- mtpr(sbifs &~ 0x2000000, PR_SBIFS);
- mtpr(mfpr(PR_SBIER) | 0x70c0, PR_SBIER);
- return (MCHK_PANIC);
-}
-
-struct ka78x {
- unsigned snr:12,
- plant:3,
- eco:8,
- v785:1,
- type:8;
-};
-
-void
-ka780_conf()
-{
- extern char cpu_model[];
- struct ka78x *ka78 = (void *)&vax_cpudata;
-
- /* Enable cache */
- mtpr(0x200000, PR_SBIMT);
-
- printf("cpu: %s, serial number %d(%d), hardware ECO level %d(%d)\n",
- &cpu_model[4], ka78->snr, ka78->plant, ka78->eco >> 4, ka78->eco);
- if (mfpr(PR_ACCS) & 255) {
- printf("cpu: FPA present, enabling.\n");
- mtpr(0x8000, PR_ACCS);
- } else
- printf("cpu: no FPA\n");
-
-}
diff --git a/sys/arch/vax/vax/ka820.c b/sys/arch/vax/vax/ka820.c
deleted file mode 100644
index 1ab61f24bd3..00000000000
--- a/sys/arch/vax/vax/ka820.c
+++ /dev/null
@@ -1,451 +0,0 @@
-/* $OpenBSD: ka820.c,v 1.13 2008/08/18 23:05:38 miod Exp $ */
-/* $NetBSD: ka820.c,v 1.22 2000/06/04 02:19:27 matt Exp $ */
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * 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. 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.
- *
- * @(#)ka820.c 7.4 (Berkeley) 12/16/90
- */
-
-/*
- * KA820 specific CPU code. (Note that the VAX8200 uses a KA820, not
- * a KA8200. Sigh.)
- */
-
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <machine/ka820.h>
-#include <machine/cpu.h>
-#include <machine/mtpr.h>
-#include <machine/nexus.h>
-#include <machine/clock.h>
-#include <machine/scb.h>
-#include <machine/bus.h>
-
-#include <vax/bi/bireg.h>
-#include <vax/bi/bivar.h>
-
-#include <vax/vax/crx.h>
-
-struct ka820port *ka820port_ptr;
-struct rx50device *rx50device_ptr;
-static volatile struct ka820clock *ka820_clkpage;
-
-static int ka820_match(struct device *, struct cfdata *, void *);
-static void ka820_attach(struct device *, struct device *, void *);
-static void ka820_memerr(void);
-static void ka820_conf(void);
-static int ka820_mchk(caddr_t);
-static int ka820_clkread(time_t base);
-static void ka820_clkwrite(void);
-static void rxcdintr(void *);
-static void vaxbierr(void *);
-
-struct cpu_dep ka820_calls = {
- 0,
- ka820_mchk,
- ka820_memerr,
- ka820_conf,
- ka820_clkread,
- ka820_clkwrite,
- 3, /* ~VUPS */
- 5, /* SCB pages */
- NULL,
- NULL,
- NULL,
- NULL,
- hardclock
-};
-
-struct cfattach cpu_bi_ca = {
- sizeof(struct device), ka820_match, ka820_attach
-};
-
-#ifdef notyet
-extern pt_entry_t BRAMmap[];
-extern pt_entry_t EEPROMmap[];
-char bootram[KA820_BRPAGES * VAX_NBPG];
-char eeprom[KA820_EEPAGES * VAX_NBPG];
-#endif
-
-int
-ka820_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct bi_attach_args *ba = aux;
-
- if (bus_space_read_2(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE) != BIDT_KA820)
- return 0;
-
- if (ba->ba_nodenr != mastercpu)
- return 0;
-
- if (cf->cf_loc[BICF_NODE] != BICF_NODE_DEFAULT &&
- cf->cf_loc[BICF_NODE] != ba->ba_nodenr)
- return 0;
-
- return 1;
-}
-
-void
-ka820_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct bi_attach_args *ba = aux;
- register int csr;
- u_short rev;
-
- rev = bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE) >> 16;
- strlcpy(cpu_model, "VAX 8200", sizeof cpu_model);
- cpu_model[6] = rev & 0x8000 ? '5' : '0';
- printf(": ka82%c (%s) cpu rev %d, u patch rev %d, sec patch %d\n",
- cpu_model[6], mastercpu == ba->ba_nodenr ? "master" : "slave",
- ((rev >> 11) & 15), ((rev >> 1) &1023), rev & 1);
-
- /* reset the console and enable the RX50 */
- ka820port_ptr = (void *)vax_map_physmem(KA820_PORTADDR, 1);
- csr = ka820port_ptr->csr;
- csr &= ~KA820PORT_RSTHALT; /* ??? */
- csr |= KA820PORT_CONSCLR | KA820PORT_CRDCLR | KA820PORT_CONSEN |
- KA820PORT_RXIE;
- ka820port_ptr->csr = csr;
- bus_space_write_4(ba->ba_iot, ba->ba_ioh,
- BIREG_INTRDES, ba->ba_intcpu);
- bus_space_write_4(ba->ba_iot, ba->ba_ioh, BIREG_VAXBICSR,
- bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_VAXBICSR) |
- BICSR_SEIE | BICSR_HEIE);
-
-}
-
-void
-ka820_conf()
-{
- /*
- * Setup parameters necessary to read time from clock chip.
- */
- ka820_clkpage = (void *)vax_map_physmem(KA820_CLOCKADDR, 1);
-
- /* Steal the interrupt vectors that are unique for us */
- scb_vecalloc(KA820_INT_RXCD, rxcdintr, NULL, SCB_ISTACK, NULL);
- scb_vecalloc(0x50, vaxbierr, NULL, SCB_ISTACK, NULL);
-
- /* XXX - should be done somewhere else */
- scb_vecalloc(SCB_RX50, crxintr, NULL, SCB_ISTACK, NULL);
- rx50device_ptr = (void *)vax_map_physmem(KA820_RX50ADDR, 1);
-}
-
-void
-vaxbierr(void *arg)
-{
- if (cold == 0)
- panic("vaxbierr");
-}
-
-#ifdef notdef
-/*
- * MS820 support.
- */
-struct ms820regs {
- struct biiregs biic; /* BI interface chip */
- u_long ms_gpr[4]; /* the four gprs (unused) */
- int ms_csr1; /* control/status register 1 */
- int ms_csr2; /* control/status register 2 */
-};
-#endif
-
-#define MEMRD(reg) bus_space_read_4(sc->sc_iot, sc->sc_ioh, (reg))
-#define MEMWR(reg, val) bus_space_write_4(sc->sc_iot, sc->sc_ioh, (reg), (val))
-
-#define MSREG_CSR1 0x100
-#define MSREG_CSR2 0x104
-/*
- * Bits in CSR1.
- */
-#define MS1_ERRSUM 0x80000000 /* error summary (ro) */
-#define MS1_ECCDIAG 0x40000000 /* ecc diagnostic (rw) */
-#define MS1_ECCDISABLE 0x20000000 /* ecc disable (rw) */
-#define MS1_MSIZEMASK 0x1ffc0000 /* mask for memory size (ro) */
-#define MS1_RAMTYMASK 0x00030000 /* mask for ram type (ro) */
-#define MS1_RAMTY64K 0x00000000 /* 64K chips */
-#define MS1_RAMTY256K 0x00010000 /* 256K chips */
-#define MS1_RAMTY1MB 0x00020000 /* 1MB chips */
- /* type 3 reserved */
-#define MS1_CRDINH 0x00008000 /* inhibit crd interrupts (rw) */
-#define MS1_MEMVALID 0x00004000 /* memory has been written (ro) */
-#define MS1_INTLK 0x00002000 /* interlock flag (ro) */
-#define MS1_BROKE 0x00001000 /* broken (rw) */
-#define MS1_MBZ 0x00000880 /* zero */
-#define MS1_MWRITEERR 0x00000400 /* rds during masked write (rw) */
-#define MS1_CNTLERR 0x00000200 /* internal timing busted (rw) */
-#define MS1_INTLV 0x00000100 /* internally interleaved (ro) */
-#define MS1_DIAGC 0x0000007f /* ecc diagnostic bits (rw) */
-
-/*
- * Bits in CSR2.
- */
-#define MS2_RDSERR 0x80000000 /* rds error (rw) */
-#define MS2_HIERR 0x40000000 /* high error rate (rw) */
-#define MS2_CRDERR 0x20000000 /* crd error (rw) */
-#define MS2_ADRSERR 0x10000000 /* rds due to addr par err (rw) */
-#define MS2_MBZ 0x0f000080 /* zero */
-#define MS2_ADDR 0x00fffe00 /* address in error (relative) (ro) */
-#define MS2_INTLVADDR 0x00000100 /* error was in bank 1 (ro) */
-#define MS2_SYN 0x0000007f /* error syndrome (ro, rw diag) */
-
-static int ms820_match(struct device *, struct cfdata *, void *);
-static void ms820_attach(struct device *, struct device *, void *);
-
-struct mem_bi_softc {
- struct device sc_dev;
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
-};
-
-struct cfattach mem_bi_ca = {
- sizeof(struct mem_bi_softc), ms820_match, ms820_attach
-};
-
-static int
-ms820_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct bi_attach_args *ba = aux;
-
- if (bus_space_read_2(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE) != BIDT_MS820)
- return 0;
-
- if (cf->cf_loc[BICF_NODE] != BICF_NODE_DEFAULT &&
- cf->cf_loc[BICF_NODE] != ba->ba_nodenr)
- return 0;
-
- return 1;
-}
-
-static void
-ms820_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct mem_bi_softc *sc = (void *)self;
- struct bi_attach_args *ba = aux;
-
- sc->sc_iot = ba->ba_iot;
- sc->sc_ioh = ba->ba_ioh;
-
- if ((MEMRD(BIREG_VAXBICSR) & BICSR_STS) == 0)
- printf(": failed self test\n");
- else
- printf(": size %dMB, %s chips\n", ((MEMRD(MSREG_CSR1) &
- MS1_MSIZEMASK) >> 20), (MEMRD(MSREG_CSR1) & MS1_RAMTYMASK
- ? MEMRD(MSREG_CSR1) & MS1_RAMTY256K ? "256K":"1M":"64K"));
-
- MEMWR(BIREG_INTRDES, ba->ba_intcpu);
- MEMWR(BIREG_VAXBICSR, MEMRD(BIREG_VAXBICSR) | BICSR_SEIE | BICSR_HEIE);
-
- MEMWR(MSREG_CSR1, MS1_MWRITEERR | MS1_CNTLERR);
- MEMWR(MSREG_CSR2, MS2_RDSERR | MS2_HIERR | MS2_CRDERR | MS2_ADRSERR);
-}
-
-void
-ka820_memerr()
-{
- struct mem_bi_softc *sc;
- int m, hard, csr1, csr2;
- char *type;
-static char b1[] = "\20\40ERRSUM\37ECCDIAG\36ECCDISABLE\20CRDINH\17VALID\
-\16INTLK\15BROKE\13MWRITEERR\12CNTLERR\11INTLV";
-static char b2[] = "\20\40RDS\37HIERR\36CRD\35ADRS";
-
- for (m = 0; m < mem_cd.cd_ndevs; m++) {
- sc = mem_cd.cd_devs[m];
- if (sc == NULL)
- continue;
- csr1 = MEMRD(MSREG_CSR1);
- csr2 = MEMRD(MSREG_CSR2);
- printf("%s: csr1=%b csr2=%b\n", sc->sc_dev.dv_xname,
- csr1, b1, csr2, b2);
- if ((csr1 & MS1_ERRSUM) == 0)
- continue;
- hard = 1;
- if (csr1 & MS1_BROKE)
- type = "broke";
- else if (csr1 & MS1_CNTLERR)
- type = "cntl err";
- else if (csr2 & MS2_ADRSERR)
- type = "address parity err";
- else if (csr2 & MS2_RDSERR)
- type = "rds err";
- else if (csr2 & MS2_CRDERR) {
- hard = 0;
- type = "";
- } else
- type = "mysterious error";
- printf("%s: %s%s%s addr %x bank %x syn %x\n",
- sc->sc_dev.dv_xname, hard ? "hard error: " : "soft ecc",
- type, csr2 & MS2_HIERR ? " (+ other rds or crd err)" : "",
- ((csr2 & MS2_ADDR) + MEMRD(BIREG_SADR)) >> 9,
- (csr2 & MS2_INTLVADDR) != 0, csr2 & MS2_SYN);
- MEMWR(MSREG_CSR1, csr1 | MS1_CRDINH);
- MEMWR(MSREG_CSR2, csr2);
- }
-}
-
-/* these are bits 0 to 6 in the summary field */
-char *mc8200[] = {
- "cpu bad ipl", "ucode lost err",
- "ucode par err", "DAL par err",
- "BI bus err", "BTB tag par",
- "cache tag par",
-};
-#define MC8200_BADIPL 0x01
-#define MC8200_UERR 0x02
-#define MC8200_UPAR 0x04
-#define MC8200_DPAR 0x08
-#define MC8200_BIERR 0x10
-#define MC8200_BTAGPAR 0x20
-#define MC8200_CTAGPAR 0x40
-
-struct mc8200frame {
- int mc82_bcnt; /* byte count == 0x20 */
- int mc82_summary; /* summary parameter */
- int mc82_param1; /* parameter 1 */
- int mc82_va; /* va register */
- int mc82_vap; /* va prime register */
- int mc82_ma; /* memory address */
- int mc82_status; /* status word */
- int mc82_epc; /* error pc */
- int mc82_upc; /* micro pc */
- int mc82_pc; /* current pc */
- int mc82_psl; /* current psl */
-};
-
-int
-ka820_mchk(cmcf)
- caddr_t cmcf;
-{
- register struct mc8200frame *mcf = (struct mc8200frame *)cmcf;
- register int i, type = mcf->mc82_summary;
-
- /* ignore BI bus errors during configuration */
- if (cold && type == MC8200_BIERR) {
- mtpr(PR_MCESR, 0xf);
- return (MCHK_RECOVERED);
- }
-
- /*
- * SOME ERRORS ARE RECOVERABLE
- * do it later
- */
- printf("machine check %x: ", type);
- for (i = 0; i < sizeof (mc8200) / sizeof (mc8200[0]); i++)
- if (type & (1 << i))
- printf(" %s,", mc8200[i]);
- printf(" param1 %x\n", mcf->mc82_param1);
- printf(
-"\tva %x va' %x ma %x pc %x psl %x\n\tstatus %x errpc %x upc %x\n",
- mcf->mc82_va, mcf->mc82_vap, mcf->mc82_ma,
- mcf->mc82_pc, mcf->mc82_psl,
- mcf->mc82_status, mcf->mc82_epc, mcf->mc82_upc);
- return (MCHK_PANIC);
-}
-
-/*
- * Receive a character from logical console.
- */
-void
-rxcdintr(arg)
- void *arg;
-{
- register int c = mfpr(PR_RXCD);
-
- /* not sure what (if anything) to do with these */
- printf("rxcd node %x c=0x%x\n", (c >> 8) & 0xf, c & 0xff);
-}
-
-int
-ka820_clkread(time_t base)
-{
- struct clock_ymdhms c;
- int s;
-
- while (ka820_clkpage->csr0 & KA820CLK_0_BUSY)
- ;
- s = splhigh();
- c.dt_sec = ka820_clkpage->sec;
- c.dt_min = ka820_clkpage->min;
- c.dt_hour = ka820_clkpage->hr;
- c.dt_wday = ka820_clkpage->dayofwk;
- c.dt_day = ka820_clkpage->day;
- c.dt_mon = ka820_clkpage->mon;
- c.dt_year = ka820_clkpage->yr;
- splx(s);
-
- /* strange conversion */
- c.dt_sec = ((c.dt_sec << 7) | (c.dt_sec >> 1)) & 0377;
- c.dt_min = ((c.dt_min << 7) | (c.dt_min >> 1)) & 0377;
- c.dt_hour = ((c.dt_hour << 7) | (c.dt_hour >> 1)) & 0377;
- c.dt_wday = ((c.dt_wday << 7) | (c.dt_wday >> 1)) & 0377;
- c.dt_day = ((c.dt_day << 7) | (c.dt_day >> 1)) & 0377;
- c.dt_mon = ((c.dt_mon << 7) | (c.dt_mon >> 1)) & 0377;
- c.dt_year = ((c.dt_year << 7) | (c.dt_year >> 1)) & 0377;
-
- time.tv_sec = clock_ymdhms_to_secs(&c);
- return CLKREAD_OK;
-}
-
-void
-ka820_clkwrite(void)
-{
- struct clock_ymdhms c;
-
- clock_secs_to_ymdhms(time.tv_sec, &c);
-
- ka820_clkpage->csr1 = KA820CLK_1_SET;
- ka820_clkpage->sec = ((c.dt_sec << 1) | (c.dt_sec >> 7)) & 0377;
- ka820_clkpage->min = ((c.dt_min << 1) | (c.dt_min >> 7)) & 0377;
- ka820_clkpage->hr = ((c.dt_hour << 1) | (c.dt_hour >> 7)) & 0377;
- ka820_clkpage->dayofwk = ((c.dt_wday << 1) | (c.dt_wday >> 7)) & 0377;
- ka820_clkpage->day = ((c.dt_day << 1) | (c.dt_day >> 7)) & 0377;
- ka820_clkpage->mon = ((c.dt_mon << 1) | (c.dt_mon >> 7)) & 0377;
- ka820_clkpage->yr = ((c.dt_year << 1) | (c.dt_year >> 7)) & 0377;
-
- ka820_clkpage->csr1 = KA820CLK_1_GO;
-}
diff --git a/sys/arch/vax/vax/ka860.c b/sys/arch/vax/vax/ka860.c
deleted file mode 100644
index 38c885d5dc1..00000000000
--- a/sys/arch/vax/vax/ka860.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/* $OpenBSD: ka860.c,v 1.10 2008/08/18 23:05:39 miod Exp $ */
-/* $NetBSD: ka860.c,v 1.15 1999/08/07 10:36:49 ragge Exp $ */
-/*
- * Copyright (c) 1986, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * 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. 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.
- *
- * @(#)ka860.c 7.4 (Berkeley) 12/16/90
- */
-
-/*
- * VAX 8600 specific routines.
- * Also contains abus spec's and memory init routines.
- */
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#include <machine/cpu.h>
-#include <machine/clock.h>
-#include <machine/mtpr.h>
-#include <machine/nexus.h>
-#include <machine/ioa.h>
-#include <machine/sid.h>
-
-#include <vax/vax/gencons.h>
-
-static void ka86_memerr(void);
-static int ka86_mchk(caddr_t);
-static void ka86_reboot(int);
-static void ka86_clrf(void);
-static void ka860_init(struct device *);
-
-void crlattach(void);
-
-struct cpu_dep ka860_calls = {
- 0,
- ka86_mchk,
- ka86_memerr,
- 0,
- generic_clkread,
- generic_clkwrite,
- 6, /* ~VUPS */
- 10, /* SCB pages */
- 0, /* Halt call, nothing special */
- ka86_reboot,
- ka86_clrf,
- NULL,
- hardclock
-};
-
-/*
- * 8600 memory register (MERG) bit definitions
- */
-#define M8600_ICRD 0x400 /* inhibit crd interrupts */
-#define M8600_TB_ERR 0xf00 /* translation buffer error mask */
-
-/*
- * MDECC register
- */
-#define M8600_ADDR_PE 0x080000 /* address parity error */
-#define M8600_DBL_ERR 0x100000 /* data double bit error */
-#define M8600_SNG_ERR 0x200000 /* data single bit error */
-#define M8600_BDT_ERR 0x400000 /* bad data error */
-
-/*
- * ESPA register is used to address scratch pad registers in the Ebox.
- * To access a register in the scratch pad, write the ESPA with the address
- * and then read the ESPD register.
- *
- * NOTE: In assmebly code, the mfpr instruction that reads the ESPD
- * register must immedately follow the mtpr instruction that setup
- * the ESPA register -- per the VENUS processor register spec.
- *
- * The scratchpad registers that are supplied for a single bit ECC
- * error are:
- */
-#define SPAD_MSTAT1 0x25 /* scratch pad mstat1 register */
-#define SPAD_MSTAT2 0x26 /* scratch pad mstat2 register */
-#define SPAD_MDECC 0x27 /* scratch pad mdecc register */
-#define SPAD_MEAR 0x2a /* scratch pad mear register */
-
-#define M8600_MEMERR(mdecc) ((mdecc) & 0x780000)
-#define M8600_HRDERR(mdecc) ((mdecc) & 0x580000)
-#define M8600_SYN(mdecc) (((mdecc) >> 9) & 0x3f)
-#define M8600_ADDR(mear) ((mear) & 0x3ffffffc)
-#define M8600_ARRAY(mear) (((mear) >> 22) & 0x0f)
-
-#define M8600_MDECC_BITS \
-"\20\27BAD_DT_ERR\26SNG_BIT_ERR\25DBL_BIT_ERR\24ADDR_PE"
-
-#define M8600_MSTAT1_BITS "\20\30CPR_PE_A\27CPR_PE_B\26ABUS_DT_PE\
-\25ABUS_CTL_MSK_PE\24ABUS_ADR_PE\23ABUS_C/A_CYCLE\22ABUS_ADP_1\21ABUS_ADP_0\
-\20TB_MISS\17BLK_HIT\16C0_TAG_MISS\15CHE_MISS\14TB_VAL_ERR\13TB_PTE_B_PE\
-\12TB_PTE_A_PE\11TB_TAG_PE\10WR_DT_PE_B3\7WR_DT_PE_B2\6WR_DT_PE_B1\
-\5WR_DT_PE_B0\4CHE_RD_DT_PE\3CHE_SEL\2ANY_REFL\1CP_BW_CHE_DT_PE"
-
-#define M8600_MSTAT2_BITS "\20\20CP_BYT_WR\17ABUS_BD_DT_CODE\10MULT_ERR\
-\7CHE_TAG_PE\6CHE_TAG_W_PE\5CHE_WRTN_BIT\4NXM\3CP-IO_BUF_ERR\2MBOX_LOCK"
-
-/* log CRD errors */
-void
-ka86_memerr()
-{
- register int reg11 = 0; /* known to be r11 below */
- int mdecc, mear, mstat1, mstat2, array;
-
- /*
- * Scratchpad registers in the Ebox must be read by
- * storing their ID number in ESPA and then immediately
- * reading ESPD's contents with no other intervening
- * machine instructions!
- *
- * The asm's below have a number of constants which
- * are defined correctly above and in mtpr.h.
- */
-#ifdef lint
- reg11 = 0;
-#else
- asm("mtpr $0x27,$0x4e; mfpr $0x4f,%0":: "r" (reg11));
-#endif
- mdecc = reg11; /* must acknowledge interrupt? */
- if (M8600_MEMERR(mdecc)) {
- asm("mtpr $0x2a,$0x4e; mfpr $0x4f,%0":: "r" (reg11));
- mear = reg11;
- asm("mtpr $0x25,$0x4e; mfpr $0x4f,%0":: "r" (reg11));
- mstat1 = reg11;
- asm("mtpr $0x26,$0x4e; mfpr $0x4f,%0":: "r" (reg11));
- mstat2 = reg11;
- array = M8600_ARRAY(mear);
-
- printf("mcr0: ecc error, addr %x (array %d) syn %x\n",
- M8600_ADDR(mear), array, M8600_SYN(mdecc));
- printf("\tMSTAT1 = %b\n\tMSTAT2 = %b\n",
- mstat1, M8600_MSTAT1_BITS,
- mstat2, M8600_MSTAT2_BITS);
- mtpr(0, PR_EHSR);
- mtpr(mfpr(PR_MERG) | M8600_ICRD, PR_MERG);
- }
-}
-
-#define NMC8600 7
-char *mc8600[] = {
- "unkn type", "fbox error", "ebox error", "ibox error",
- "mbox error", "tbuf error", "mbox 1D error"
-};
-/* codes for above */
-#define MC_FBOX 1
-#define MC_EBOX 2
-#define MC_IBOX 3
-#define MC_MBOX 4
-#define MC_TBUF 5
-#define MC_MBOX1D 6
-
-/* error bits */
-#define MBOX_FE 0x8000 /* Mbox fatal error */
-#define FBOX_SERV 0x10000000 /* Fbox service error */
-#define IBOX_ERR 0x2000 /* Ibox error */
-#define EBOX_ERR 0x1e00 /* Ebox error */
-#define MBOX_1D 0x81d0000 /* Mbox 1D error */
-#define EDP_PE 0x200
-
-struct mc8600frame {
- int mc86_bcnt; /* byte count == 0x58 */
- int mc86_ehmsts;
- int mc86_evmqsav;
- int mc86_ebcs;
- int mc86_edpsr;
- int mc86_cslint;
- int mc86_ibesr;
- int mc86_ebxwd1;
- int mc86_ebxwd2;
- int mc86_ivasav;
- int mc86_vibasav;
- int mc86_esasav;
- int mc86_isasav;
- int mc86_cpc;
- int mc86_mstat1;
- int mc86_mstat2;
- int mc86_mdecc;
- int mc86_merg;
- int mc86_cshctl;
- int mc86_mear;
- int mc86_medr;
- int mc86_accs;
- int mc86_cses;
- int mc86_pc; /* trapped pc */
- int mc86_psl; /* trapped psl */
-};
-
-/* machine check */
-int
-ka86_mchk(cmcf)
- caddr_t cmcf;
-{
- register struct mc8600frame *mcf = (struct mc8600frame *)cmcf;
- register int type;
-
- if (mcf->mc86_ebcs & MBOX_FE)
- mcf->mc86_ehmsts |= MC_MBOX;
- else if (mcf->mc86_ehmsts & FBOX_SERV)
- mcf->mc86_ehmsts |= MC_FBOX;
- else if (mcf->mc86_ebcs & EBOX_ERR) {
- if (mcf->mc86_ebcs & EDP_PE)
- mcf->mc86_ehmsts |= MC_MBOX;
- else
- mcf->mc86_ehmsts |= MC_EBOX;
- } else if (mcf->mc86_ehmsts & IBOX_ERR)
- mcf->mc86_ehmsts |= MC_IBOX;
- else if (mcf->mc86_mstat1 & M8600_TB_ERR)
- mcf->mc86_ehmsts |= MC_TBUF;
- else if ((mcf->mc86_cslint & MBOX_1D) == MBOX_1D)
- mcf->mc86_ehmsts |= MC_MBOX1D;
-
- type = mcf->mc86_ehmsts & 0x7;
- printf("machine check %x: %s\n", type,
- type < NMC8600 ? mc8600[type] : "???");
- printf("\tehm.sts %x evmqsav %x ebcs %x edpsr %x cslint %x\n",
- mcf->mc86_ehmsts, mcf->mc86_evmqsav, mcf->mc86_ebcs,
- mcf->mc86_edpsr, mcf->mc86_cslint);
- printf("\tibesr %x ebxwd %x %x ivasav %x vibasav %x\n",
- mcf->mc86_ibesr, mcf->mc86_ebxwd1, mcf->mc86_ebxwd2,
- mcf->mc86_ivasav, mcf->mc86_vibasav);
- printf("\tesasav %x isasav %x cpc %x mstat %x %x mdecc %x\n",
- mcf->mc86_esasav, mcf->mc86_isasav, mcf->mc86_cpc,
- mcf->mc86_mstat1, mcf->mc86_mstat2, mcf->mc86_mdecc);
- printf("\tmerg %x cshctl %x mear %x medr %x accs %x cses %x\n",
- mcf->mc86_merg, mcf->mc86_cshctl, mcf->mc86_mear,
- mcf->mc86_medr, mcf->mc86_accs, mcf->mc86_cses);
- printf("\tpc %x psl %x\n", mcf->mc86_pc, mcf->mc86_psl);
- mtpr(0, PR_EHSR);
- return (MCHK_PANIC);
-}
-
-struct ka86 {
- unsigned snr:12,
- plant:4,
- eco:7,
- v8650:1,
- type:8;
-};
-
-void
-ka860_init(self)
- struct device *self;
-{
- struct ka86 *ka86 = (void *)&vax_cpudata;
-
- /* Enable cache */
- mtpr(3, PR_CSWP);
-
- printf(": CPU serial number %d(%d), hardware ECO level %d(%d)\n%s: ",
- ka86->snr, ka86->plant, ka86->eco >> 4, ka86->eco, self->dv_xname);
- if (mfpr(PR_ACCS) & 255) {
- printf("FPA present, type %d, serial number %d, enabling.\n",
- mfpr(PR_ACCS) & 255, mfpr(PR_ACCS) >> 16);
- mtpr(0x8000, PR_ACCS);
- } else
- printf("no FPA\n");
- /* enable CRD reports */
- mtpr(mfpr(PR_MERG) & ~M8600_ICRD, PR_MERG);
- crlattach();
-}
-
-/*
- * Clear restart flag.
- */
-void
-ka86_clrf()
-{
- /*
- * We block all interrupts here so that there won't be any
- * interrupts for an ongoing printout.
- */
- int s = splhigh(), old = mfpr(PR_TXCS);
-
-#define WAIT while ((mfpr(PR_TXCS) & GC_RDY) == 0) ;
-
- WAIT;
-
- /* Enable channel to console */
- mtpr(GC_LT|GC_WRT, PR_TXCS);
- WAIT;
-
- /* clear warm start flag */
- mtpr(GC_CWFL, PR_TXDB);
- WAIT;
-
- /* clear cold start flag */
- mtpr(GC_CCFL, PR_TXDB);
- WAIT;
-
- /* restore old state */
- mtpr(old|GC_WRT, PR_TXCS);
- splx(s);
-}
-
-void
-ka86_reboot(howto)
- int howto;
-{
- WAIT;
-
- /* Enable channel to console */
- mtpr(GC_LT|GC_WRT, PR_TXCS);
- WAIT;
-
- mtpr(GC_BTFL, PR_TXDB);
- WAIT;
-
- asm("halt");
-}
-
-static int abus_print(void *, const char *);
-static int abus_match(struct device *, struct cfdata *, void *);
-static void abus_attach(struct device *, struct device *, void *);
-
-struct cfattach abus_ca = {
- sizeof(struct device), abus_match, abus_attach
-};
-
-/*
- * Abus is the master bus on VAX 8600.
- */
-int
-abus_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct mainbus_attach_args *maa = aux;
-
- if (maa->maa_bustype == VAX_ABUS)
- return 1;
- return 0;
-}
-
-void
-abus_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- volatile int tmp;
- volatile struct sbia_regs *sbiar;
- struct ioa *ioa;
- int type, i;
- struct bp_conf bp;
-
- /*
- * Init CPU.
- */
- ka860_init(self);
-
- for (i = 0; i < MAXNIOA; i++) {
- ioa = (struct ioa *)vax_map_physmem((paddr_t)IOA8600(0),
- (IOAMAPSIZ / VAX_NBPG));
- if (badaddr((caddr_t)ioa, 4)) {
- vax_unmap_physmem((vaddr_t)ioa, (IOAMAPSIZ / VAX_NBPG));
- continue;
- }
- tmp = ioa->ioacsr.ioa_csr;
- type = tmp & IOA_TYPMSK;
-
- switch (type) {
-
- case IOA_SBIA:
- bp.type = "sbi";
- bp.num = i;
- config_found(self, &bp, abus_print);
- sbiar = (void *)ioa;
- sbiar->sbi_errsum = -1;
- sbiar->sbi_error = 0x1000;
- sbiar->sbi_fltsts = 0xc0000;
- break;
-
- default:
- printf("IOAdapter %x unsupported\n", type);
- break;
- }
- vax_unmap_physmem((vaddr_t)ioa, (IOAMAPSIZ / VAX_NBPG));
- }
-}
-
-int
-abus_print(aux, hej)
- void *aux;
- const char *hej;
-{
- struct bp_conf *bp = aux;
- if (hej)
- printf("%s at %s", bp->type, hej);
- return (UNCONF);
-}
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index d8064add2f6..9424ff58050 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.116 2011/07/05 04:48:02 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.117 2011/07/06 18:33:00 miod Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -1073,10 +1073,6 @@ char cpu_model[100];
* The strict cpu-dependent information is set up here, in
* form of a pointer to a struct that is specific for each cpu.
*/
-extern struct cpu_dep ka780_calls;
-extern struct cpu_dep ka750_calls;
-extern struct cpu_dep ka860_calls;
-extern struct cpu_dep ka820_calls;
extern struct cpu_dep ka43_calls;
extern struct cpu_dep ka46_calls;
extern struct cpu_dep ka48_calls;
@@ -1113,28 +1109,6 @@ start(struct rpb *prpb)
strlcpy(cpu_model, "VAXstation ", sizeof cpu_model);
switch (vax_boardtype) {
-#if VAX780
- case VAX_BTYP_780:
- dep_call = &ka780_calls;
- strlcpy(cpu_model,"VAX 11/780", sizeof cpu_model);
- if (vax_cpudata & 0x100)
- cpu_model[9] = '5';
- break;
-#endif
-#if VAX750
- case VAX_BTYP_750:
- dep_call = &ka750_calls;
- strlcpy(cpu_model, "VAX 11/750", sizeof cpu_model);
- break;
-#endif
-#if VAX8600
- case VAX_BTYP_790:
- dep_call = &ka860_calls;
- strlcpy(cpu_model,"VAX 8600", sizeof cpu_model);
- if (vax_cpudata & 0x100)
- cpu_model[6] = '5';
- break;
-#endif
#if VAX410
case VAX_BTYP_420: /* They are very similar */
dep_call = &ka410_calls;
@@ -1306,13 +1280,6 @@ start(struct rpb *prpb)
}
break;
#endif
-#if VAX8200
- case VAX_BTYP_8000:
- mastercpu = mfpr(PR_BINID);
- dep_call = &ka820_calls;
- strlcpy(cpu_model, "VAX 8200", sizeof cpu_model);
- break;
-#endif
#ifdef VAX60
case VAX_BTYP_60:
dep_call = &ka60_calls;
diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c
index d289b5b3166..651dafc2f0c 100644
--- a/sys/arch/vax/vax/pmap.c
+++ b/sys/arch/vax/vax/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.52 2011/05/30 22:25:23 oga Exp $ */
+/* $OpenBSD: pmap.c,v 1.53 2011/07/06 18:33:00 miod Exp $ */
/* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */
/*
* Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
@@ -57,10 +57,6 @@
#include <machine/scb.h>
#include <machine/rpb.h>
-/* QDSS console mapping hack */
-#include "qd.h"
-void qdearly(void);
-
#define ISTACK_SIZE (NBPG * 2)
vaddr_t istack;
@@ -195,11 +191,6 @@ pmap_bootstrap()
uvmexp.pagesize = NBPG;
uvm_setpagesize();
- /* QDSS console mapping hack */
-#if NQD > 0
- qdearly();
-#endif
-
/* User page table map. This is big. */
MAPVIRT(ptemapstart, USRPTSIZE);
ptemapend = virtual_avail;
diff --git a/sys/arch/vax/vax/sbi.c b/sys/arch/vax/vax/sbi.c
deleted file mode 100644
index 937b4c5100d..00000000000
--- a/sys/arch/vax/vax/sbi.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $OpenBSD: sbi.c,v 1.12 2006/07/24 17:25:11 miod Exp $ */
-/* $NetBSD: sbi.c,v 1.20 1999/08/07 10:36:50 ragge Exp $ */
-/*
- * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
- * All rights reserved.
- *
- * 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 at Ludd, University of Lule}.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Still to do: Write all SBI error handling.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/systm.h>
-
-#include <machine/sid.h>
-#include <machine/cpu.h>
-#include <machine/nexus.h>
-
-static int sbi_print(void *, const char *);
-static int sbi_match_abus(struct device *, struct cfdata *, void *);
-static int sbi_match_mainbus(struct device *, struct cfdata *, void *);
-static void sbi_attach(struct device *, struct device *, void *);
-
-struct cfdriver sbi_cd = {
- NULL, "sbi", DV_DULL
-};
-
-int
-sbi_print(aux, name)
- void *aux;
- const char *name;
-{
- struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
- int unsupp = 0;
-
- if (name) {
- switch (sa->type) {
- case NEX_MBA:
- printf("mba at %s", name);
- break;
- default:
- printf("unknown device 0x%x at %s", sa->type, name);
- unsupp++;
- }
- }
- printf(" tr%d", sa->nexnum);
- return (unsupp ? UNSUPP : UNCONF);
-}
-
-int
-sbi_match_mainbus(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct mainbus_attach_args *maa = aux;
-
- if (maa->maa_bustype == VAX_SBIBUS)
- return 1;
- return 0;
-}
-
-int
-sbi_match_abus(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct bp_conf *bp = aux;
-
- if (strcmp(bp->type, sbi_cd.cd_name) == 0)
- return 1;
-
- return 0;
-}
-
-void
-sbi_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- u_int nexnum, minnex;
- struct sbi_attach_args sa;
-
- printf("\n");
-
-#define NEXPAGES (sizeof(struct nexus) / VAX_NBPG)
- minnex = self->dv_unit * NNEXSBI;
- for (nexnum = minnex; nexnum < minnex + NNEXSBI; nexnum++) {
- struct nexus *nexusP = 0;
- volatile int tmp;
-
- nexusP = (struct nexus *)vax_map_physmem((paddr_t)NEXA8600 +
- sizeof(struct nexus) * nexnum, NEXPAGES);
- if (badaddr((caddr_t)nexusP, 4)) {
- vax_unmap_physmem((vaddr_t)nexusP, NEXPAGES);
- } else {
- tmp = nexusP->nexcsr.nex_csr; /* no byte reads */
- sa.type = tmp & 255;
-
- sa.nexnum = nexnum;
- sa.nexaddr = nexusP;
- config_found(self, (void *)&sa, sbi_print);
- }
- }
-}
-
-struct cfattach sbi_mainbus_ca = {
- sizeof(struct device), sbi_match_mainbus, sbi_attach
-};
-
-struct cfattach sbi_abus_ca = {
- sizeof(struct device), sbi_match_abus, sbi_attach
-};