Preliminary support for the VS4000/90 SGMAP. Needed for SCSI. Does not
quite work right yet.
This commit is contained in:
parent
6fb4d43f97
commit
2d153651e5
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sgmap.h,v 1.2 2000/04/10 03:49:56 matt Exp $ */
|
||||
/* $NetBSD: sgmap.h,v 1.3 2000/05/17 21:22:18 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -59,6 +59,8 @@ struct vax_sgmap {
|
||||
bus_addr_t aps_sgvabase; /* base of the sgva space */
|
||||
bus_size_t aps_sgvasize; /* size of the sgva space */
|
||||
bus_addr_t aps_pa; /* Address in region */
|
||||
unsigned int aps_flags; /* flags */
|
||||
#define SGMAP_KA49 0x01 /* KA49 SGMAP is weird */
|
||||
};
|
||||
|
||||
void vax_sgmap_init __P((bus_dma_tag_t, struct vax_sgmap *,
|
||||
|
@ -38,6 +38,10 @@
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/scb.h>
|
||||
|
||||
#define KA49_CPMBX 0x38
|
||||
#define KA49_HLT_HALT 0x03
|
||||
#define KA49_HLT_BOOT 0x02
|
||||
|
||||
static void ka49_conf __P((void));
|
||||
static void ka49_memerr __P((void));
|
||||
static int ka49_mchk __P((caddr_t));
|
||||
@ -225,6 +229,7 @@ ka49_steal_pages()
|
||||
static void
|
||||
ka49_halt()
|
||||
{
|
||||
((u_int8_t *) clk_page)[KA49_CPMBX] = KA49_HLT_HALT;
|
||||
asm("halt");
|
||||
}
|
||||
|
||||
@ -232,5 +237,6 @@ static void
|
||||
ka49_reboot(arg)
|
||||
int arg;
|
||||
{
|
||||
((u_int8_t *) clk_page)[KA49_CPMBX] = KA49_HLT_BOOT;
|
||||
asm("halt");
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sgmap.c,v 1.5 2000/04/10 03:49:57 matt Exp $ */
|
||||
/* $NetBSD: sgmap.c,v 1.6 2000/05/17 21:22:20 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -249,7 +249,19 @@ vax_sgmap_load(t, map, buf, buflen, p, flags, sgmap)
|
||||
/*
|
||||
* Load the current PTE with this page.
|
||||
*/
|
||||
*pte = (pa >> VAX_PGSHIFT) | PG_V;
|
||||
if (sgmap->aps_flags & SGMAP_KA49) {
|
||||
unsigned long pte0 = (pa & ~VAX_PGOFSET);
|
||||
unsigned long tmp = pte0 >> VAX_PGSHIFT;
|
||||
int cnt;
|
||||
|
||||
for (cnt = 0; tmp != 0; tmp >>= 1) {
|
||||
cnt += (tmp & 1);
|
||||
}
|
||||
*pte = pte0 | PG_V | ((cnt & 1) ? 0 : 0x10000000);
|
||||
printf("%p: 0x%08lx\n", pte, *pte);
|
||||
} else {
|
||||
*pte = (pa >> VAX_PGSHIFT) | PG_V;
|
||||
}
|
||||
}
|
||||
/* The VS4000 SCSI prefetcher doesn't like to end on a page boundary
|
||||
* so add an extra page to quiet it down.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: asc_vsbus.c,v 1.12 2000/04/24 21:59:22 matt Exp $ */
|
||||
/* $NetBSD: asc_vsbus.c,v 1.13 2000/05/17 21:22:20 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.12 2000/04/24 21:59:22 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.13 2000/05/17 21:22:20 matt Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -93,8 +93,8 @@ struct asc_vsbus_softc {
|
||||
|
||||
#define ASC_REG_KA46_ADR 0x0000
|
||||
#define ASC_REG_KA46_DIR 0x000C
|
||||
#define ASC_REG_KA49_ADR 0x0004
|
||||
#define ASC_REG_KA49_DIR 0x0008
|
||||
#define ASC_REG_KA49_ADR 0x0000
|
||||
#define ASC_REG_KA49_DIR 0x0004
|
||||
#define ASC_REG_NCR 0x0080
|
||||
#define ASC_REG_END 0x00B0
|
||||
|
||||
@ -184,6 +184,7 @@ asc_vsbus_match( struct device *parent, struct cfdata *cf, void *aux)
|
||||
DELAY(10000);
|
||||
|
||||
dummy = ncr_regs[NCR_INTR << 2] & 0xFF;
|
||||
printf("ncr intr = %d\n", dummy);
|
||||
return (dummy & NCRINTR_SBR) != 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vsbus_dma.c,v 1.4 2000/04/23 16:38:54 matt Exp $ */
|
||||
/* $NetBSD: vsbus_dma.c,v 1.5 2000/05/17 21:22:20 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -129,9 +129,10 @@ vsbus_dma_init(sc, ptecnt)
|
||||
memset(pte, 0, mapsize);
|
||||
*(int *) (sc->sc_vsregs + 8) = segs->ds_addr; /* set MAP BASE 0x2008008 */
|
||||
} else {
|
||||
sc->sc_sgmap.aps_flags |= SGMAP_KA49;
|
||||
pte = (struct pte *) vax_map_physmem(KA49_SCSIMAP, mapsize / VAX_NBPG);
|
||||
for (; ptecnt > 0; ) {
|
||||
((u_int32_t *) pte)[--ptecnt] = 0;
|
||||
for (nsegs = ptecnt; nsegs > 0; ) {
|
||||
((u_int32_t *) pte)[--nsegs] = 0x88000000;
|
||||
}
|
||||
segs->ds_addr = KA49_SCSIMAP;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user