A bunch of new CPUs that are supported, from Michael Kukat

(michael@unixiron.org). Among them are 4000/400, 4000/500 and 4000/105A.
This commit is contained in:
ragge 2001-01-28 21:01:52 +00:00
parent 5538893eda
commit e4d9af4b42
12 changed files with 263 additions and 300 deletions

View File

@ -1,11 +1,11 @@
# $NetBSD: GENERIC,v 1.84 2000/12/19 15:51:50 tsutsui Exp $
# $NetBSD: GENERIC,v 1.85 2001/01/28 21:01:52 ragge Exp $
#
# GENERIC VAX configuration file; all supported devices.
#
include "arch/vax/conf/std.vax"
#ident "GENERIC-$Revision: 1.84 $"
#ident "GENERIC-$Revision: 1.85 $"
# Here are all different supported CPU types listed.
#options "VAX8800" # VAX 8500, 8530, 8550, 8700, 8800
@ -18,13 +18,13 @@ options "VAX630" # MV II
options "VAX650" # MV III, 3300, 3400, 3500, 3600, 3800, 3900
options "VAX660" # VAX 4000/200
options "VAX670" # VAX 4000/300
#options "VAX680" # VAX 4000/500
options "VAX680" # VAX 4000/500
options "VAX410" # VS 2000
options "VAX43" # VS 3100/76
options "VAX46" # VS 4000/60
options "VAX48" # VS 4000 VLC
options "VAX49" # VS 4000/90
#options "VAX53" # VAX 4000/105A
options "VAX53" # VAX 4000/105A
# Max users on system; this is just a hint
maxusers 8
@ -142,7 +142,8 @@ rd* at hdc0 drive? # RD5x disks
uba0 at ibus0 # Qbus adapter
ze0 at ibus0 # SGEC on-board ethernet
le0 at ibus0 # LANCE ethernet (MV3400)
#dz0 at ibus0 # VAX 4000/105A serial lines
dz0 at ibus0 # VAX 4000/105A serial lines
#asc0 at ibus0 # VAX 4000/105A SCSI-ctlr
#shac0 at ibus0 # DSSI controller
# Devices connected at VAXBI
@ -215,8 +216,8 @@ wsmouse* at lkms?
pseudo-device loop 1
pseudo-device pty # pseudo-terminals
pseudo-device bpfilter 8 # Not supported by de yet.
pseudo-device sl 2
pseudo-device ppp 2
#pseudo-device sl 2
#pseudo-device ppp 2
pseudo-device tun 2
#pseudo-device gre 2 # generic L3 over IP tunnel
pseudo-device gif 4 # IPv[46] over IPv[46] tunnel (RFC1933)

View File

@ -1,4 +1,4 @@
# $NetBSD: INSTALL,v 1.13 2000/12/19 15:51:50 tsutsui Exp $
# $NetBSD: INSTALL,v 1.14 2001/01/28 21:01:52 ragge Exp $
#
# INSTALL kernel; all supported devices but nothing fancy.
#
@ -16,11 +16,13 @@ options "VAX630" # MV II
options "VAX650" # MV III, 3600, 3800, 3900
options "VAX660" # VAX 4000/200
options "VAX670" # VAX 4000/300
options "VAX680" # VAX 4000/[45]00
options "VAX410" # VS 2000
options "VAX43" # VS 3100/76
options "VAX46" # VS 4000/60
options "VAX48" # VS 4000 VLC
options "VAX49" # VS 4000/90
options "VAX53" # VAX 4000/105A
# Max users on system; this is just a hint
maxusers 8
@ -133,6 +135,8 @@ hp* at mba? drive? # RM/RP disk drives
# Devices on internal MicroVAX bus
uba0 at ibus? # Q-Bus adapter
dz0 at ibus? # VAX 4000/105A serial lines
#asc0 at ibus? # VAX 4000/105A SCSI ctlr
# Disk controllers at Unibus
uda0 at uba? csr 0172150 # UDA50/RQDX?

View File

@ -1,4 +1,4 @@
# $NetBSD: files.vax,v 1.78 2001/01/17 00:07:39 fvdl Exp $
# $NetBSD: files.vax,v 1.79 2001/01/28 21:01:52 ragge Exp $
#
# new style config file for vax architecture
#
@ -150,7 +150,10 @@ attach ts at uba
file arch/vax/uba/ts.c ts needs-flag
attach dz at vsbus with dz_vsbus
file arch/vax/vsa/dz_ibus.c dz_vsbus | smg
file arch/vax/vsa/dz_vsbus.c dz_vsbus | smg
attach dz at ibus with dz_ibus
file arch/vax/vsa/dz_ibus.c dz_ibus
# RD-type disks at VS2000's onboard MFM-controller
device hdc { drive = -1 }

View File

@ -1,4 +1,4 @@
/* $NetBSD: sid.h,v 1.14 2000/05/22 15:40:06 matt Exp $ */
/* $NetBSD: sid.h,v 1.15 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -155,8 +155,9 @@
#define VAX_TYP_NVAX 19
#define VAX_TYP_V13 19
#define VAX_BTYP_680 0x13000001 /* VAX 4000 model 500 */
#define VAX_BTYP_1301 0x13000001 /* VAX 4000 model 100 */
#define VAX_BTYP_680 0x13000001 /* VAX 4000 model [45]00 */
#define VAX_STYP_675 0x0c /* VAX 4000 model 400 */
#define VAX_STYP_680 0x06 /* VAX 4000 model 500 */
#define VAX_BTYP_1302 0x13000002
#define VAX_BTYP_53 0x13000003 /* VAX 4000 model 105A */
#define VAX_BTYP_49 0x13000004 /* MicroVAX 3100 model 90 */

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.50 2000/12/30 20:15:02 matt Exp $ */
/* $NetBSD: conf.c,v 1.51 2001/01/28 21:01:53 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@ -155,6 +155,7 @@ int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
*/
#include <dev/cons.h>
#include "smg.h"
#include "wskbd.h"
#if NSMG > 0
#if NWSKBD > 0
@ -173,11 +174,11 @@ smgcngetc(dev_t dev)
cons_decl(gen);
cons_decl(dz);
cons_decl(idz);
cons_decl(qd);
cons_decl(smg);
#include "qv.h"
#include "qd.h"
#include "smg.h"
struct consdev constab[]={
#if VAX8600 || VAX8200 || VAX780 || VAX750 || VAX650 || VAX630 || VAX660 || \
@ -187,9 +188,12 @@ struct consdev constab[]={
#else
#define NGEN 0
#endif
#if VAX410 || VAX43 || VAX46 || VAX48 || VAX49 || VAX53
#if VAX410 || VAX43 || VAX46 || VAX48 || VAX49
cons_init(dz), /* DZ11-like serial console on VAXstations */
#endif
#if VAX53
cons_init(idz), /* DZ11-like serial console on VAX/MicroVAX */
#endif
#if VAX650 || VAX630
#if NQV
cons_init(qv), /* QVSS/QDSS bit-mapped console driver */

View File

@ -1,4 +1,4 @@
/* $NetBSD: gencons.c,v 1.28 2000/11/02 00:42:41 eeh Exp $ */
/* $NetBSD: gencons.c,v 1.29 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@ -244,6 +244,7 @@ gencnprobe(struct consdev *cndev)
(vax_boardtype == VAX_BTYP_630) ||
(vax_boardtype == VAX_BTYP_660) ||
(vax_boardtype == VAX_BTYP_670) ||
(vax_boardtype == VAX_BTYP_680) ||
(vax_boardtype == VAX_BTYP_650)) {
cndev->cn_dev = makedev(25, 0);
cndev->cn_pri = CN_NORMAL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibus.c,v 1.5 2000/06/04 18:02:35 ragge Exp $ */
/* $NetBSD: ibus.c,v 1.6 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -70,6 +70,8 @@ ibus_match(struct device *parent, struct cfdata *cf, void *aux)
#define MVNIADDR 0x20084400
#define SGECADDR 0x20008000
#define SHACADDR 0x20004200
#define DZADDR 0x25000000
#define SCSIADDR 0x26000080
void
ibus_attach(struct device *parent, struct device *self, void *aux)
@ -83,6 +85,15 @@ ibus_attach(struct device *parent, struct device *self, void *aux)
ibus_dma_init(sc);
}
#endif
/*
* Maybe it has the dz serial lines
*/
bp.type = "dz";
va = vax_map_physmem(DZADDR, 1);
if (badaddr((caddr_t)va, 2) == 0)
config_found(self, &bp, ibus_print);
vax_unmap_physmem(va, 1);
/*
* There may be a SGEC. Is badaddr() enough here?
*/
@ -109,6 +120,16 @@ ibus_attach(struct device *parent, struct device *self, void *aux)
if (badaddr((caddr_t)va + 0x48, 4) == 0)
config_found(self, &bp, ibus_print);
vax_unmap_physmem(va, 1);
/*
* NCR SCSI controller could be there
*/
bp.type = "asc";
va = vax_map_physmem(SCSIADDR, 1);
if (badaddr((caddr_t)va + 0x48, 2) == 0)
config_found(self, &bp, ibus_print);
vax_unmap_physmem(va, 1);
/*
* All MV's have a Qbus.
*/

View File

@ -63,7 +63,7 @@ struct cpu_dep ka49_calls = {
ka49_conf,
chip_clkread,
chip_clkwrite,
16, /* ~VUPS */
32, /* ~VUPS */
2, /* SCB pages */
ka49_halt,
ka49_reboot,

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka53.c,v 1.2 2000/06/04 02:19:27 matt Exp $ */
/* $NetBSD: ka53.c,v 1.3 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -30,6 +30,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Done by Michael Kukat (michael@unixiron.org) */
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
@ -46,19 +48,17 @@ static void ka53_memerr(void);
static int ka53_mchk(caddr_t);
static void ka53_halt(void);
static void ka53_reboot(int);
#ifdef notyet
static void ka53_softmem(int);
static void ka53_hardmem(int);
static void ka53_softmem(void *);
static void ka53_hardmem(void *);
static void ka53_steal_pages(void);
static void ka53_cache_enable(void);
#endif
static void ka53_halt(void);
/*
* Declaration of 680-specific calls.
* Declaration of 53-specific calls.
*/
struct cpu_dep ka53_calls = {
0, /*ka53_steal_pages,*/
ka53_steal_pages,
ka53_mchk,
ka53_memerr,
ka53_conf,
@ -68,21 +68,30 @@ struct cpu_dep ka53_calls = {
2, /* SCB pages */
ka53_halt,
ka53_reboot,
NULL,
NULL,
CPU_RAISEIPL,
};
void
ka53_conf()
{
/* Don't ask why, but we seem to need this... */
volatile int *hej = (void *)mfpr(PR_ISP);
*hej = *hej;
hej[-1] = hej[-1];
printf("cpu0: KA53, ucode rev %d\n", vax_cpudata & 0xff);
}
/*
* Why may we get memory errors during startup???
*/
/*
void
ka53_hardmem(int arg)
ka53_hardmem(void *arg)
{
if (cold == 0)
printf("Hard memory error\n");
@ -90,13 +99,12 @@ ka53_hardmem(int arg)
}
void
ka53_softmem(int arg)
ka53_softmem(void *arg)
{
if (cold == 0)
printf("Soft memory error\n");
splhigh();
}
*/
/*
* KA53-specific IPRs. KA53 has the funny habit to control all caches
@ -121,7 +129,6 @@ ka53_softmem(int arg)
#define PCCTL_I_EN 0x02
#define PCCTL_D_EN 0x01
#if 0
void
ka53_cache_enable()
{
@ -186,7 +193,6 @@ ka53_cache_enable()
}
mtpr(ICSR_ENABLE, PR_ICSR);
}
#endif
void
ka53_memerr()
@ -202,7 +208,6 @@ ka53_mchk(caddr_t addr)
return 0;
}
#if 0
void
ka53_steal_pages()
{
@ -218,7 +223,6 @@ ka53_steal_pages()
/* Turn on caches (to speed up execution a bit) */
ka53_cache_enable();
}
#endif
static void
ka53_halt()

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka680.c,v 1.2 2000/06/04 02:19:27 matt Exp $ */
/* $NetBSD: ka680.c,v 1.3 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -30,75 +30,34 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Done by Michael Kukat (michael@unixiron.org) */
#include <sys/param.h>
#include <sys/types.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <machine/clock.h>
#include <machine/pte.h>
#include <machine/cpu.h>
#include <machine/scb.h>
#include <machine/sid.h>
#include <machine/mtpr.h>
#include <machine/sid.h>
#include <machine/nexus.h>
#include <machine/uvax.h>
#include <machine/ka680.h>
#include <machine/clock.h>
#include <machine/scb.h>
static void ka680_conf(void);
static void ka680_memerr(void);
static int ka680_mchk(caddr_t);
static void ka680_halt(void);
static void ka680_reboot(int);
#ifdef notyet
static void ka680_softmem(int);
static void ka680_hardmem(int);
#endif
static void ka680_steal_pages(void);
static void ka680_cache_enable(void);
static void ka680_halt(void);
/*
* Declaration of 680-specific calls.
*/
struct cpu_dep ka680_calls = {
ka680_steal_pages,
ka680_mchk,
ka680_memerr,
ka680_conf,
generic_clkread,
generic_clkwrite,
24, /* ~VUPS */
2, /* SCB pages */
ka680_halt,
ka680_reboot,
};
void
ka680_conf()
{
printf("cpu0: KA680, ucode rev %d\n", vax_cpudata & 0xff);
}
/*
* Why may we get memory errors during startup???
*/
#ifdef notyet
void
ka680_hardmem(int arg)
{
if (cold == 0)
printf("Hard memory error\n");
splhigh();
}
void
ka680_softmem(int arg)
{
if (cold == 0)
printf("Soft memory error\n");
splhigh();
}
#endif
static void ka680_conf __P((void));
static void ka680_cache_enable __P((void));
static void ka680_softmem __P((void *));
static void ka680_hardmem __P((void *));
static void ka680_steal_pages __P((void));
static void ka680_memerr __P((void));
static int ka680_mchk __P((caddr_t));
static void ka680_halt __P((void));
static void ka680_reboot __P((int));
/*
* KA680-specific IPRs. KA680 has the funny habit to control all caches
* via IPRs.
@ -122,13 +81,51 @@ ka680_softmem(int arg)
#define PCCTL_I_EN 0x02
#define PCCTL_D_EN 0x01
/*
* Declaration of KA680-specific calls.
*/
struct cpu_dep ka680_calls = {
ka680_steal_pages,
ka680_mchk,
ka680_memerr,
ka680_conf,
generic_clkread,
generic_clkwrite,
24, /* ~VUPS */
2, /* SCB pages */
ka680_halt,
ka680_reboot,
NULL,
NULL,
CPU_RAISEIPL,
};
void
ka680_conf()
{
char *cpuname;
/* Don't ask why, but we seem to need this... */
volatile int *hej = (void *)mfpr(PR_ISP);
*hej = *hej;
hej[-1] = hej[-1];
switch((vax_siedata & 0xff00) >> 8) {
case VAX_STYP_675: cpuname = "KA675"; break;
case VAX_STYP_680: cpuname = "KA680"; break;
default: cpuname = "unknown NVAX";
}
printf("cpu0: %s, ucode rev %d\n", cpuname, vax_cpudata & 0xff);
}
void
ka680_cache_enable()
{
int start, slut;
return;
/*
* Turn caches off.
*/
@ -178,13 +175,48 @@ ka680_cache_enable()
mtpr(PCCTL_P_EN|PCCTL_I_EN|PCCTL_D_EN, PR_PCCTL);
/* Enable the VIC */
start = 0;
slut = 0x800;
for (; start < slut; start += 0x20) {
mtpr(start, PR_VMAR);
mtpr(0, PR_VTAG);
if(((vax_siedata & 0xff00) >> 8) == VAX_STYP_680) {
start = 0;
slut = 0x800;
for (; start < slut; start += 0x20) {
mtpr(start, PR_VMAR);
mtpr(0, PR_VTAG);
}
mtpr(ICSR_ENABLE, PR_ICSR);
}
mtpr(ICSR_ENABLE, PR_ICSR);
}
/*
* Why may we get memory errors during startup???
*/
void
ka680_hardmem(void *arg)
{
if (cold == 0)
printf("Hard memory error\n");
splhigh();
}
void
ka680_softmem(void *arg)
{
if (cold == 0)
printf("Soft memory error\n");
splhigh();
}
void
ka680_steal_pages()
{
/*
* Get the soft and hard memory error vectors now.
*/
scb_vecalloc(0x54, ka680_softmem, NULL, 0, NULL);
scb_vecalloc(0x60, ka680_hardmem, NULL, 0, NULL);
/* Turn on caches (to speed up execution a bit) */
ka680_cache_enable();
}
void
@ -196,27 +228,10 @@ ka680_memerr()
int
ka680_mchk(caddr_t addr)
{
mtpr(0x00, PR_MCESR);
printf("Machine Check\n");
panic("Machine check");
return 0;
}
void
ka680_steal_pages()
{
/*
* Get the soft and hard memory error vectors now.
*/
#ifdef notyet
scb_vecalloc(0x54, ka680_softmem, NULL, 0, NULL);
scb_vecalloc(0x60, ka680_hardmem, NULL, 0, NULL);
#endif
/* Turn on caches (to speed up execution a bit) */
ka680_cache_enable();
}
static void
ka680_halt()
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.c,v 1.53 2000/11/21 05:49:08 chs Exp $ */
/* $NetBSD: locore.c,v 1.54 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -219,7 +219,14 @@ _start(struct rpb *prpb)
#if VAX680
case VAX_BTYP_680:
dep_call = &ka680_calls;
strcpy(cpu_model,"VAX 4000/500");
switch((vax_siedata & 0xff00) >> 8) {
case VAX_STYP_675:
strcpy(cpu_model,"VAX 4000/400"); break;
case VAX_STYP_680:
strcpy(cpu_model,"VAX 4000/500"); break;
default:
strcpy(cpu_model,"unknown NVAX");
}
break;
#endif
#if VAX8200

View File

@ -1,4 +1,4 @@
/* $NetBSD: dz_ibus.c,v 1.22 2000/12/30 20:11:54 matt Exp $ */
/* $NetBSD: dz_ibus.c,v 1.23 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -13,8 +13,8 @@
* 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.
* 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
*
@ -50,6 +50,7 @@
#include <machine/vsbus.h>
#include <machine/cpu.h>
#include <machine/scb.h>
#include <machine/nexus.h>
#include <arch/vax/vax/gencons.h>
@ -57,24 +58,17 @@
#include <dev/qbus/dzvar.h>
#include "ioconf.h"
#include "dzkbd.h"
#include "dzms.h"
#if NDZKBD > 0 || NDZMS > 0
#include <dev/dec/dzkbdvar.h>
#define DZADDR 0x25000000
#define DZVEC 0x154
#if 0
static struct dz_linestate dz_conslinestate = { NULL, -1, NULL, NULL, NULL };
#endif
#endif
static int dz_ibus_match(struct device *, struct cfdata *, void *);
static void dz_ibus_attach(struct device *, struct device *, void *);
static int dz_vsbus_match(struct device *, struct cfdata *, void *);
static void dz_vsbus_attach(struct device *, struct device *, void *);
static vaddr_t idz_regs; /* Used for console */
static vaddr_t dz_regs; /* Used for console */
struct cfattach dz_vsbus_ca = {
sizeof(struct dz_softc), dz_vsbus_match, dz_vsbus_attach
struct cfattach dz_ibus_ca = {
sizeof(struct dz_softc), dz_ibus_match, dz_ibus_attach
};
#define REG(name) short name; short X##name##X;
@ -87,70 +81,39 @@ static volatile struct ss_dz {/* base address of DZ-controller: 0x200A0000 */
REG(lpr1); /* 14 Lpr0: */
REG(lpr2); /* 18 Lpr0: */
REG(lpr3); /* 1C Lpr0: */
} *dz;
} *idz;
#undef REG
cons_decl(dz);
cdev_decl(dz);
#if NDZKBD > 0 || NDZMS > 0
static int
dz_print(void *aux, const char *name)
{
#if 0
#if NDZKBD > 0 || NDZMS > 0
struct dz_attach_args *dz_args = aux;
if (name == NULL) {
printf (" line %d", dz_args->line);
if (dz_args->hwflags & DZ_HWFLAG_CONSOLE)
printf (" (console)");
}
return (QUIET);
#else
if (name)
printf ("lkc at %s", name);
return (UNCONF);
#endif
#endif
return (UNCONF);
}
#endif
cons_decl(idz);
static int
dz_vsbus_match(struct device *parent, struct cfdata *cf, void *aux)
dz_ibus_match(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct vsbus_attach_args *va = aux;
struct ss_dz *dzP;
short i;
struct bp_conf *bp = aux;
dzP = (struct ss_dz *)va->va_addr;
i = dzP->tcr;
dzP->csr = DZ_CSR_MSE|DZ_CSR_TXIE;
dzP->tcr = 0;
DELAY(1000);
dzP->tcr = 1;
DELAY(100000);
dzP->tcr = i;
/* If the device doesn't exist, no interrupt has been generated */
return 1;
if (strcmp(bp->type, "dz") == 0)
return 1;
return 0;
}
static void
dz_vsbus_attach(struct device *parent, struct device *self, void *aux)
dz_ibus_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
struct dz_softc *sc = (void *)self;
struct vsbus_attach_args *va = aux;
#if NDZKBD > 0 || NDZMS > 0
struct dzkm_attach_args daa;
#endif
struct dz_softc *sc = (void *)self;
struct ss_dz *dzP;
int i, vec, br;
/*
* XXX - This is evil and ugly, but...
* due to the nature of how bus_space_* works on VAX, this will
* be perfectly good until everything is converted.
*/
sc->sc_ioh = dz_regs;
sc->sc_ioh = idz_regs;
sc->sc_dr.dr_csr = 0;
sc->sc_dr.dr_rbuf = 4;
sc->sc_dr.dr_dtr = 9;
@ -162,46 +125,41 @@ dz_vsbus_attach(struct device *parent, struct device *self, void *aux)
sc->sc_type = DZ_DZV;
scb_vecref(0, 0);
dzP = (struct ss_dz *)idz_regs;
i = dzP->tcr;
dzP->csr = DZ_CSR_MSE|DZ_CSR_TXIE;
dzP->tcr = 0;
DELAY(1000);
dzP->tcr = 1;
DELAY(100000);
dzP->tcr = i;
i = scb_vecref(&vec, &br);
printf(": vec %o ipl %x", vec, br);
if(i == 0 || vec == 0) printf(" -> NO INT!");
sc->sc_dsr = 0x0f; /* XXX check if VS has modem ctrl bits */
scb_vecalloc(va->va_cvec, dzxint, sc, SCB_ISTACK, &sc->sc_tintrcnt);
scb_vecalloc(va->va_cvec - 4, dzrint, sc, SCB_ISTACK, &sc->sc_rintrcnt);
scb_vecalloc(DZVEC, dzxint, sc, SCB_ISTACK, &sc->sc_tintrcnt);
scb_vecalloc(DZVEC - 4, dzrint, sc, SCB_ISTACK, &sc->sc_rintrcnt);
printf("\n%s: 4 lines", self->dv_xname);
dzattach(sc, NULL);
#if NDZKBD > 0
/* Don't change speed if this is the console */
if (cn_tab->cn_dev != makedev(getmajor(dzopen), 0))
dz->rbuf = DZ_LPR_RX_ENABLE | (DZ_LPR_B4800 << 8)
| DZ_LPR_8_BIT_CHAR;
daa.daa_line = 0;
daa.daa_flags = (cn_tab->cn_pri == CN_INTERNAL ? DZKBD_CONSOLE : 0);
config_found(self, &daa, dz_print);
#endif
#if NDZMS > 0
dz->rbuf = DZ_LPR_RX_ENABLE | (DZ_LPR_B4800 << 8) | DZ_LPR_7_BIT_CHAR \
| DZ_LPR_PARENB | DZ_LPR_OPAR | 1 /* line */;
daa.daa_line = 1;
daa.daa_flags = 0;
config_found(self, &daa, dz_print);
#endif
dzrint(sc);
dzxint(sc);
}
int
dzcngetc(dev_t dev)
idzcngetc(dev)
dev_t dev;
{
int c = 0;
int mino = minor(dev);
u_short rbuf;
do {
while ((dz->csr & 0x80) == 0)
while ((idz->csr & 0x80) == 0)
; /* Wait for char */
rbuf = dz->rbuf;
rbuf = idz->rbuf;
if (((rbuf >> 8) & 3) != mino)
continue;
c = rbuf & 0x7f;
@ -213,126 +171,70 @@ dzcngetc(dev_t dev)
return (c);
}
#define DZMAJOR 1
void
dzcnprobe(struct consdev *cndev)
idzcnprobe(cndev)
struct consdev *cndev;
{
extern vaddr_t iospace;
int diagcons;
paddr_t ioaddr = 0x200A0000;
paddr_t ioaddr = DZADDR;
switch (vax_boardtype) {
case VAX_BTYP_410:
case VAX_BTYP_420:
case VAX_BTYP_43:
diagcons = (vax_confdata & 0x20 ? 3 : 0);
break;
/* not fine... but for now only KA53 is known to have dz@ibus */
case VAX_BTYP_46:
case VAX_BTYP_48:
diagcons = (vax_confdata & 0x100 ? 3 : 0);
break;
case VAX_BTYP_49:
ioaddr = 0x25000000;
diagcons = 3;
break;
default:
if(vax_boardtype != VAX_BTYP_53) {
cndev->cn_pri = CN_DEAD;
return;
}
if (diagcons)
cndev->cn_pri = CN_REMOTE;
else
cndev->cn_pri = CN_NORMAL;
cndev->cn_dev = makedev(getmajor(dzopen), diagcons);
(vaddr_t)dz = dz_regs = iospace;
diagcons = 3;
cndev->cn_pri = CN_NORMAL;
cndev->cn_dev = makedev(DZMAJOR, diagcons);
idz_regs = iospace;
ioaccess(iospace, ioaddr, 1);
}
void
dzcninit(struct consdev *cndev)
idzcninit(cndev)
struct consdev *cndev;
{
dz = (void*)dz_regs;
idz = (void*)idz_regs;
dz->csr = 0; /* Disable scanning until initting is done */
dz->tcr = (1 << minor(cndev->cn_dev)); /* Turn on xmitter */
dz->csr = 0x20; /* Turn scanning back on */
idz->csr = 0; /* Disable scanning until initting is done */
idz->tcr = (1 << minor(cndev->cn_dev)); /* Turn on xmitter */
idz->csr = 0x20; /* Turn scanning back on */
}
void
dzcnputc(dev_t dev, int ch)
idzcnputc(dev,ch)
dev_t dev;
int ch;
{
int timeout = 1<<15; /* don't hang the machine! */
int timeout = 1<<15; /* don't hang the machine! */
int mino = minor(dev);
u_short tcr;
if (mfpr(PR_MAPEN) == 0)
return;
tcr = dz->tcr; /* remember which lines to scan */
dz->tcr = (1 << mino);
tcr = idz->tcr; /* remember which lines to scan */
idz->tcr = (1 << mino);
while ((dz->csr & 0x8000) == 0) /* Wait until ready */
while ((idz->csr & 0x8000) == 0) /* Wait until ready */
if (--timeout < 0)
break;
dz->tdr = ch; /* Put the character */
idz->tdr = ch; /* Put the character */
timeout = 1<<15;
while ((dz->csr & 0x8000) == 0) /* Wait until ready */
while ((idz->csr & 0x8000) == 0) /* Wait until ready */
if (--timeout < 0)
break;
dz->tcr = tcr;
idz->tcr = tcr;
}
void
dzcnpollc(dev_t dev, int pollflag)
void
idzcnpollc(dev_t dev, int pollflag)
{
static u_char mask;
if (pollflag)
mask = vsbus_setmask(0);
else
vsbus_setmask(mask);
}
#if NDZKBD > 0 || NDZMS > 0
int
dzgetc(struct dz_linestate *ls)
{
int line = ls->dz_line;
u_short rbuf;
for (;;) {
for(; (dz->csr & DZ_CSR_RX_DONE) == 0;);
rbuf = dz->rbuf;
if (((rbuf >> 8) & 3) == line)
return (rbuf & 0xff);
}
}
void
dzputc(struct dz_linestate *ls, int ch)
{
int line = 0; /* = ls->dz_line; */
u_short tcr;
int s;
/* if the dz has already been attached, the MI
driver will do the transmitting: */
if (ls && ls->dz_sc) {
s = spltty();
putc(ch, &ls->dz_sc->sc_dz[line].dz_tty->t_outq);
tcr = dz->tcr;
if (!(tcr & (1 << line)))
dz->tcr = tcr | (1 << line);
dzxint(ls->dz_sc);
splx(s);
return;
}
/* use dzcnputc to do the transmitting: */
dzcnputc(makedev(getmajor(dzopen), line), ch);
}
#endif /* NDZKBD > 0 || NDZMS > 0 */