Support for VS4000/60.

This commit is contained in:
ragge 1998-08-10 14:47:16 +00:00
parent 2ff84b0fe4
commit c355f4a0ed
5 changed files with 93 additions and 73 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dz_vsbus.c,v 1.5 1998/06/07 20:19:12 ragge Exp $ */
/* $NetBSD: dz_vsbus.c,v 1.6 1998/08/10 14:47:16 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -69,13 +69,13 @@ struct cfattach dz_vsbus_ca = {
static void
rxon()
{
vsbus_intr_enable(INR_SR);
vsbus_intr_enable(inr_sr);
}
static void
txon()
{
vsbus_intr_enable(INR_ST);
vsbus_intr_enable(inr_st);
}
int
@ -95,7 +95,7 @@ dz_vsbus_match(parent, cf, aux)
void *aux;
{
struct vsbus_attach_args *va = aux;
if (va->va_type == INR_SR)
if (va->va_type == inr_sr)
return 1;
return 0;
}
@ -121,8 +121,8 @@ dz_vsbus_attach(parent, self, aux)
sc->sc_txon = txon;
sc->sc_rxon = rxon;
sc->sc_dsr = 0x0f; /* XXX check if VS has modem ctrl bits */
vsbus_intr_attach(INR_SR, dzrint, 0);
vsbus_intr_attach(INR_ST, dzxint, 0);
vsbus_intr_attach(inr_sr, dzrint, 0);
vsbus_intr_attach(inr_st, dzxint, 0);
printf(": DC367");
dzattach(sc);
@ -152,7 +152,9 @@ int
dzcngetc(dev)
dev_t dev;
{
int c;
int c = 0;
int mino = minor(dev);
u_short rbuf;
u_char mask;
mask = vs_cpu->vc_intmsk; /* save old state */
@ -161,7 +163,10 @@ dzcngetc(dev)
do {
while ((dz->csr & 0x80) == 0)
; /* Wait for char */
c = dz->rbuf & 0x7f;
rbuf = dz->rbuf;
if (((rbuf >> 8) & 3) != mino)
continue;
c = rbuf & 0x7f;
} while (c == 17 || c == 19); /* ignore XON/XOFF */
if (c == 13)
@ -184,6 +189,7 @@ dzcnprobe(cndev)
case VAX_BTYP_410:
case VAX_BTYP_420:
case VAX_BTYP_43:
case VAX_BTYP_46:
cndev->cn_dev = makedev(DZMAJOR, 3);
cndev->cn_pri = CN_NORMAL;
break;
@ -214,6 +220,7 @@ dzcnputc(dev,ch)
int ch;
{
int timeout = 1<<15; /* don't hang the machine! */
int mino = minor(dev);
u_short tcr;
u_char mask;
@ -223,7 +230,7 @@ dzcnputc(dev,ch)
mask = vs_cpu->vc_intmsk; /* save old state */
vs_cpu->vc_intmsk = 0; /* disable all interrupts */
tcr = dz->tcr; /* remember which lines to scan */
dz->tcr = 8; /* XXX */
dz->tcr = (1 << mino);
while ((dz->csr & 0x8000) == 0) /* Wait until ready */
if (--timeout < 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ln.c,v 1.6 1998/07/21 17:36:05 drochner Exp $ */
/* $NetBSD: if_ln.c,v 1.7 1998/08/10 14:47:16 ragge Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -237,7 +237,7 @@ lnmatch(parent, cf, aux)
if (lance_csr == 0)
return 0;
#endif
if (va->va_type == INR_NP)
if (va->va_type == inr_ni)
return 2;
return 0;
}
@ -307,8 +307,8 @@ lnattach(parent, self, aux)
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
vsbus_intr_attach(INR_NP, ln_intr, 0);
vsbus_intr_enable(INR_NP);
vsbus_intr_attach(inr_ni, ln_intr, 0);
vsbus_intr_enable(inr_ni);
/*
* Register this device as boot device if we booted from it.

View File

@ -1,4 +1,4 @@
/* $NetBSD: lkc.c,v 1.7 1998/08/05 16:50:39 kleink Exp $ */
/* $NetBSD: lkc.c,v 1.8 1998/08/10 14:47:16 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -83,7 +83,7 @@ lkc_attach(parent, self, aux)
printf("\n");
dz->sc_catch = lkc_catch; /* Catch keyb & mouse chars fast */
*dz->sc_dr.dr_lpr = 0x1c18; /* XXX */
vsbus_intr_enable(INR_SR);
vsbus_intr_enable(inr_sr);
}
int
@ -92,7 +92,7 @@ lkc_catch(line, ch)
{
int hej;
if (line > 1)
if (line > 0)
return 0;
if ((hej = lkc_decode(ch)) == -1)
@ -134,7 +134,7 @@ lkc_decode(ch)
ch = lastchar;
break;
#if DDB
#if defined(DDB)
case 113: /* ESC */
if ((shifted & ctrl) == 0)
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: smg.c,v 1.7 1998/08/05 16:50:39 kleink Exp $ */
/* $NetBSD: smg.c,v 1.8 1998/08/10 14:47:16 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -144,7 +144,7 @@ smg_match(parent, match, aux)
{
struct vsbus_attach_args *va = aux;
if (va->va_type != INR_VF)
if (va->va_type != inr_vf)
return 0;
#ifdef DIAGNOSTIC
if (sm_addr == 0)
@ -352,7 +352,23 @@ smg_ioctl(v, cmd, data, flag, p)
int flag;
struct proc *p;
{
return -1;
struct wsdisplay_fbinfo fb;
switch (cmd) {
case WSDISPLAYIO_GTYPE:
*(u_int *)data = WSDISPLAY_TYPE_PM_MONO;
break;
case WSDISPLAYIO_GINFO:
fb.height = 864;
fb.width = 1024;
return copyout(&fb, data, sizeof(struct wsdisplay_fbinfo));
default:
return -1;
}
return 0;
}
static int
@ -361,7 +377,9 @@ smg_mmap(v, offset, prot)
off_t offset;
int prot;
{
return -1;
if (offset > SMSIZE)
return -1;
return (SMADDR + offset) >> CLSHIFT;
}
int
@ -397,7 +415,7 @@ smg_show_screen(v, cookie)
return;
for (row = 0; row < SM_ROWS; row++)
for (line = 0; line < SM_CHEIGHT; line++)
for (line = 0; line < SM_CHEIGHT; line++) {
for (col = 0; col < SM_COLS; col++) {
u_char s, c = ss->ss_image[row][col];
@ -408,6 +426,9 @@ smg_show_screen(v, cookie)
s ^= 255;
SM_ADDR(row, col, line) = s;
}
if (ss->ss_attr[row][col] & WSATTR_UNDERLINE)
SM_ADDR(row, col, line) = 255;
}
cursor = &sm_addr[(ss->ss_cury * SM_CHEIGHT * SM_COLS) + ss->ss_curx +
((SM_CHEIGHT - 1) * SM_COLS)];
curscr = ss;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vsbus.c,v 1.11 1998/06/04 15:51:12 ragge Exp $ */
/* $NetBSD: vsbus.c,v 1.12 1998/08/10 14:47:17 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -56,6 +56,7 @@
#include <machine/uvax.h>
#include <machine/ka410.h>
#include <machine/ka420.h>
#include <machine/ka43.h>
#include <machine/vsbus.h>
@ -136,18 +137,50 @@ vsbus_attach(parent, self, aux)
* now check for all possible devices on this "bus"
*/
/* Always have network */
va.va_type = INR_NP;
va.va_type = inr_ni;
config_found(self, &va, vsbus_print);
/* Always have serial line */
va.va_type = INR_SR;
va.va_type = inr_sr;
config_found(self, &va, vsbus_print);
/* If sm_addr is set, a monochrome graphics adapter is found */
/* XXX ckeck for color adapter */
if (sm_addr) {
va.va_type = INR_VF;
va.va_type = inr_vf;
config_found(self, &va, vsbus_print);
}
#ifdef notyet
/*
* Check for mass storage devices. This is tricky :-/
* VS2K always has both MFM and SCSI.
* VS3100 has either MFM/SCSI, SCSI/SCSI or neither of them.
* The device registers are at different places for them all.
*/
if (vax_boardtype == VAX_BTYP_410) {
va.va_type = inr_dc;
config_found(self, &va, vsbus_print);
va.va_type = 0x200C0080;
config_found(self, &va, vsbus_print);
return;
}
if ((vax_confdata & KA420_CFG_STCMSK) == KA420_CFG_NONE)
return; /* No ctlrs */
/* Ok, we have at least one scsi ctlr */
va.va_type = 0x200C0080;
config_found(self, &va, vsbus_print);
/* The last one is MFM or SCSI */
if ((vax_confdata & KA420_CFG_STCMSK) == KA420_CFG_RB) {
va.va_type = inr_dc;
config_found(self, &va, vsbus_print);
} else {
va.va_type = 0x200C0180;
config_found(self, &va, vsbus_print);
}
#endif
}
static void stray __P((int));
@ -208,55 +241,14 @@ vsbus_intr_disable(nr)
vs_cpu->vc_intmsk = vs_cpu->vc_intmsk & ~(1<<nr);
}
#ifdef notyet
/*
*
*
* Allocate/free DMA pages and other bus resources.
* VS2000: All DMA and register access must be exclusive.
* VS3100: DMA area may be accessed by anyone anytime.
* MFM/SCSI: Don't touch reg's while DMA is active.
* SCSI/SCSI: Legal to touch any register anytime.
*/
static volatile struct dma_lock {
int dl_locked;
int dl_wanted;
void *dl_owner;
int dl_count;
} dmalock = { 0, 0, NULL, 0 };
int
vsbus_lockDMA(ca)
struct confargs *ca;
{
while (dmalock.dl_locked) {
dmalock.dl_wanted++;
sleep((caddr_t)&dmalock, PRIBIO); /* PLOCK or PRIBIO ? */
dmalock.dl_wanted--;
}
dmalock.dl_locked++;
dmalock.dl_owner = ca;
/*
* no checks yet, no timeouts, nothing...
*/
#ifdef DEBUG
if ((++dmalock.dl_count % 1000) == 0)
printf("%d locks, owner: %s\n", dmalock.dl_count, ca->ca_name);
#endif
return (0);
}
int
vsbus_unlockDMA(ca)
struct confargs *ca;
{
if (dmalock.dl_locked != 1 || dmalock.dl_owner != ca) {
printf("locking-problem: %d, %s\n", dmalock.dl_locked,
(char *)(dmalock.dl_owner ? dmalock.dl_owner : "null"));
dmalock.dl_locked = 0;
return (-1);
}
dmalock.dl_owner = NULL;
dmalock.dl_locked = 0;
if (dmalock.dl_wanted) {
wakeup((caddr_t)&dmalock);
}
return (0);
}