MicroVAX III support added; now runs on VAX 3600/3800/3900 platforms.

This commit is contained in:
ragge 1995-12-13 18:45:52 +00:00
parent 486bcce207
commit 2962c5f6d6
5 changed files with 362 additions and 92 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.4 1995/06/05 16:26:23 ragge Exp $ */ /* $NetBSD: autoconf.c,v 1.5 1995/12/13 18:45:57 ragge Exp $ */
/* /*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden. * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -36,7 +36,6 @@
#include "sys/param.h" #include "sys/param.h"
#include "machine/cpu.h" #include "machine/cpu.h"
#include "machine/sid.h" #include "machine/sid.h"
#include "machine/loconf.h"
#include "sys/types.h" #include "sys/types.h"
#include "sys/device.h" #include "sys/device.h"
#include "sys/reboot.h" #include "sys/reboot.h"
@ -44,12 +43,14 @@
#include "machine/param.h" #include "machine/param.h"
#include "machine/vmparam.h" #include "machine/vmparam.h"
#include "machine/nexus.h" #include "machine/nexus.h"
#include "machine/ka750.h"
#include "machine/../vax/gencons.h" #include "machine/../vax/gencons.h"
#include "vm/vm.h" #include "vm/vm.h"
#define BACKPLANE 0 #define BACKPLANE 0
#define BIBUSS 1 #define BIBUSS 1
#define SBIBUSS 2 #define SBIBUSS 2
struct bp_conf { struct bp_conf {
char *type; char *type;
int num; int num;
@ -61,20 +62,27 @@ extern int cold;
int cpu_notsupp(),cpu_notgen(); int cpu_notsupp(),cpu_notgen();
#ifdef VAX750 #ifdef VAX750
int ka750_mchk(),ka750_memerr(),ka750_clock(),ka750_conf(); int ka750_mchk(),ka750_memerr(),ka750_clock(),ka750_conf();
int ka750_steal_pages();
int nexty750[]={ NEX_MEM16, NEX_MEM16, NEX_MEM16, NEX_MEM16, int nexty750[]={ NEX_MEM16, NEX_MEM16, NEX_MEM16, NEX_MEM16,
NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA, NEX_MBA,
NEX_UBA0, NEX_UBA1, NEX_ANY, NEX_ANY, NEX_UBA0, NEX_UBA1, NEX_ANY, NEX_ANY,
NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY}; NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY};
#endif #endif
#if VAX730 #if VAX730
int ka750_steal_pages();
int nexty730[NNEX730] = { int nexty730[NNEX730] = {
NEX_MEM16, NEX_ANY, NEX_ANY, NEX_ANY, NEX_MEM16, NEX_ANY, NEX_ANY, NEX_ANY,
NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY, NEX_ANY,
}; };
#endif #endif
#if VAX630 #if VAX630
int uvaxII_steal_pages();
int uvaxII_mchk(), uvaxII_memerr(), uvaxII_clock(), uvaxII_conf(); int uvaxII_mchk(), uvaxII_memerr(), uvaxII_clock(), uvaxII_conf();
#endif #endif
#if VAX650
int uvaxIII_steal_pages();
int uvaxIII_mchk(), uvaxIII_memerr(), uvaxIII_clock(), uvaxIII_conf();
#endif
struct cpu_dep cpu_calls[VAX_MAX+1]={ struct cpu_dep cpu_calls[VAX_MAX+1]={
/* Type 0,noexist */ /* Type 0,noexist */
@ -85,12 +93,12 @@ struct cpu_dep cpu_calls[VAX_MAX+1]={
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#endif #endif
#ifdef VAX750 /* Type 2, 11/750 */ #ifdef VAX750 /* Type 2, 11/750 */
cpu_notgen,ka750_clock,ka750_mchk,ka750_memerr,ka750_conf, ka750_steal_pages,ka750_clock,ka750_mchk,ka750_memerr,ka750_conf,
#else #else
cpu_notgen,cpu_notgen,cpu_notgen,cpu_notgen,cpu_notgen, cpu_notgen,cpu_notgen,cpu_notgen,cpu_notgen,cpu_notgen,
#endif #endif
#ifdef VAX730 /* Type 3, 11/{730,725}, ceauciesco-vax */ #ifdef VAX730 /* Type 3, 11/{730,725}, ceauciesco-vax */
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, ka730_steal_pages,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#else #else
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#endif #endif
@ -115,14 +123,16 @@ struct cpu_dep cpu_calls[VAX_MAX+1]={
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#endif #endif
#ifdef VAX630 /* Type 8, KA630 or KA410 (uVAX II) */ #ifdef VAX630 /* Type 8, KA630 or KA410 (uVAX II) */
cpu_notgen,uvaxII_clock,uvaxII_mchk,uvaxII_memerr,uvaxII_conf, uvaxII_steal_pages, uvaxII_clock, uvaxII_mchk, uvaxII_memerr,
uvaxII_conf,
#else #else
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#endif #endif
/* Type 9, not used */ /* Type 9, not used */
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#ifdef VAX650 /* Type 10, KA65X (uVAX III) */ #ifdef VAX650 /* Type 10, KA65X (uVAX III) */
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, uvaxIII_steal_pages, uvaxIII_clock, uvaxIII_mchk, uvaxIII_memerr,
uvaxIII_conf,
#else #else
cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp, cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,cpu_notsupp,
#endif #endif
@ -160,7 +170,7 @@ configure()
*/ */
gencnslask(); /* XXX inte g|ras h{r */ gencnslask(); /* XXX inte g|ras h{r */
swapconf(); swapconf();
cold=0; cold = 0;
mtpr(GC_CCF, PR_TXDB); /* Clear cold start flag in cpu */ mtpr(GC_CCF, PR_TXDB); /* Clear cold start flag in cpu */
} }
@ -170,8 +180,9 @@ printut(aux, hej)
void *aux; void *aux;
char *hej; char *hej;
{ {
if(hej) printf("printut %s\n",hej); if (hej)
return(UNSUPP); printf("printut %s\n",hej);
return (UNSUPP);
} }
int int
@ -180,10 +191,11 @@ backplane_match(parent, cf, aux)
struct cfdata *cf; struct cfdata *cf;
void *aux; void *aux;
{ {
if(cf->cf_unit==0&&strcmp(cf->cf_driver->cd_name,"backplane")==0) if (cf->cf_unit == 0 &&
strcmp(cf->cf_driver->cd_name, "backplane") == 0)
return 1; /* First (and only) backplane */ return 1; /* First (and only) backplane */
return(0); return (0);
} }
void void
@ -192,37 +204,38 @@ backplane_attach(parent, self, hej)
void *hej; void *hej;
{ {
struct bp_conf bp; struct bp_conf bp;
int i,ccpu,cmem,cbi,csbi; int i, ccpu, cmem, cbi, csbi;
printf("\n"); printf("\n");
switch(cpunumber){ switch(cpunumber){
case VAX_750: case VAX_750:
case VAX_650:
case VAX_78032: case VAX_78032:
cmem=cbi=0; cmem = cbi = 0;
ccpu=csbi=1; ccpu = csbi = 1;
break; break;
} }
bp.partyp=BACKPLANE; bp.partyp = BACKPLANE;
bp.type="cpu"; bp.type = "cpu";
for(i=0;i<ccpu;i++){ for (i = 0; i < ccpu; i++) {
bp.num=i; bp.num = i;
config_found(self, &bp, printut); config_found(self, &bp, printut);
} }
bp.type="mem"; bp.type = "mem";
for(i=0;i<cmem;i++){ for (i = 0; i < cmem; i++) {
bp.num=i; bp.num = i;
config_found(self, &bp, printut); config_found(self, &bp, printut);
} }
bp.type="bi"; bp.type = "bi";
for(i=0;i<cbi;i++){ for (i = 0; i < cbi; i++) {
bp.num=i; bp.num = i;
config_found(self, &bp, printut); config_found(self, &bp, printut);
} }
bp.type="sbi"; bp.type = "sbi";
for(i=0;i<csbi;i++){ for(i = 0; i < csbi; i++) {
bp.num=i; bp.num = i;
config_found(self, &bp, printut); config_found(self, &bp, printut);
} }
} }
@ -233,21 +246,17 @@ cpu_match(parent, cf, aux)
struct cfdata *cf; struct cfdata *cf;
void *aux; void *aux;
{ {
struct bp_conf *bp=aux; struct bp_conf *bp = aux;
if(strcmp(cf->cf_driver->cd_name,"cpu")) if (strcmp(cf->cf_driver->cd_name, "cpu"))
return 0; return 0;
switch (cpunumber) { switch (cpunumber) {
#ifdef VAX750 #if VAX750 || VAX630 || VAX650
case VAX_750: case VAX_750:
if(cf->cf_unit==0&&bp->partyp==BACKPLANE)
return 1;
break;
#endif
#ifdef VAX630
case VAX_78032: case VAX_78032:
if(cf->cf_unit==0&&bp->partyp==BACKPLANE) case VAX_650:
if(cf->cf_unit == 0 && bp->partyp == BACKPLANE)
return 1; return 1;
break; break;
#endif #endif
@ -261,32 +270,10 @@ cpu_attach(parent, self, aux)
struct device *parent, *self; struct device *parent, *self;
void *aux; void *aux;
{ {
extern int cpu_type; (*cpu_calls[cpunumber].cpu_conf)(parent, self, aux);
extern char cpu_model[];
switch (cpunumber) {
#ifdef VAX750
case VAX_750:
printf(": 11/750, hardware rev %d, ucode rev %d\n",
V750HARDW(cpu_type), V750UCODE(cpu_type));
printf("cpu0 at backplane0: ");
if(mfpr(PR_ACCS)&0xff){
printf("FPA present, enabling\n");
mtpr(0x8000,PR_ACCS);
} else printf("no FPA\n");
strcpy(cpu_model,"VAX 11/750");
break;
#endif
#if VAX630
case VAX_78032:
printf(": MicroVAXII CPU\n");
strcpy(cpu_model, "MicroVAX 78032/78132");
break;
#endif
};
} }
int nmcr=0; int nmcr = 0;
int int
mem_match(parent, cf, aux) mem_match(parent, cf, aux)
@ -294,11 +281,11 @@ mem_match(parent, cf, aux)
struct cfdata *cf; struct cfdata *cf;
void *aux; void *aux;
{ {
struct sbi_attach_args *sa=(struct sbi_attach_args *)aux; struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
if((cf->cf_loc[0]!=sa->nexnum)&&(cf->cf_loc[0]>-1)) if ((cf->cf_loc[0] != sa->nexnum) && (cf->cf_loc[0] > -1))
return 0; /* memory doesn't match spec's */ return 0; /* memory doesn't match spec's */
switch(sa->type){ switch (sa->type) {
case NEX_MEM16: case NEX_MEM16:
return 1; return 1;
} }
@ -310,12 +297,12 @@ mem_attach(parent, self, aux)
struct device *parent, *self; struct device *parent, *self;
void *aux; void *aux;
{ {
struct sbi_attach_args *sa=(struct sbi_attach_args *)aux; struct sbi_attach_args *sa = (struct sbi_attach_args *)aux;
switch(cpunumber){ switch (cpunumber) {
#ifdef VAX750 #ifdef VAX750
case VAX_750: case VAX_750:
ka750_memenable(sa,self); ka750_memenable(sa, self);
break; break;
#endif #endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.8 1995/11/30 00:59:32 jtc Exp $ */ /* $NetBSD: clock.c,v 1.9 1995/12/13 18:45:56 ragge Exp $ */
/* /*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden. * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
* All rights reserved. * All rights reserved.
@ -111,8 +111,9 @@ inittodr(fs_time)
((tmp_year % 4 && tmp_year != 32) ? 365 : 366); ((tmp_year % 4 && tmp_year != 32) ? 365 : 366);
switch (cpunumber) { switch (cpunumber) {
#if VAX750 #if VAX750 || VAX650
case VAX_750: case VAX_750:
case VAX_650:
year_ticks = mfpr(PR_TODR); year_ticks = mfpr(PR_TODR);
clock_stopped = todrstopped; clock_stopped = todrstopped;
break; break;
@ -131,9 +132,10 @@ inittodr(fs_time)
printf( printf(
"Internal clock not started. Using time from file system.\n"); "Internal clock not started. Using time from file system.\n");
switch (cpunumber) { switch (cpunumber) {
#if VAX750 #if VAX750 || VAX650
case VAX_750: case VAX_750:
/*+1 so the clock won't be stopped */ case VAX_650:
/* +1 so the clock won't be stopped */
mtpr((fs_time - year) * 100 + 1, PR_TODR); mtpr((fs_time - year) * 100 + 1, PR_TODR);
break; break;
#endif #endif
@ -152,7 +154,8 @@ inittodr(fs_time)
} else if (year_ticks / 100 < fs_time - year) { } else if (year_ticks / 100 < fs_time - year) {
printf( printf(
"WARNING: Clock has lost time - CHECK AND RESET THE DATE.\n"); "WARNING: Clock has lost time - CHECK AND RESET THE DATE.\n");
} else sluttid = year + (year_ticks / 100); } else
sluttid = year + (year_ticks / 100);
time.tv_sec = sluttid; time.tv_sec = sluttid;
} }
@ -191,20 +194,16 @@ resettodr()
* (the x and y variables are used to confuse the optimizer enough to ensure * (the x and y variables are used to confuse the optimizer enough to ensure
* that the code actually loops:-) * that the code actually loops:-)
*/ */
int void
todr() delay(i)
int i;
{ {
int delaycnt, x = 4, y = 4; volatile int n;
static int todr_val;
if (cpunumber != VAX_78032) n = i;
return (mfpr(PR_TODR));
/* while (--n)
* Loop for approximately 10msec and then return todr_val + 1. ;
*/
delaycnt = 5000; return;
while (delaycnt > 0)
delaycnt = delaycnt - x + 3 + y - 4;
return (++todr_val);
} }

277
sys/arch/vax/vax/ka650.c Normal file
View File

@ -0,0 +1,277 @@
/* $NetBSD: ka650.c,v 1.1 1995/12/13 18:45:52 ragge Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Mt. Xinu.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ka650.c 7.7 (Berkeley) 12/16/90
*/
/*
* vax650-specific code.
*/
#include "sys/param.h"
#include "sys/time.h"
#include "sys/kernel.h"
#include "sys/systm.h"
#include "sys/device.h"
#include "vm/vm.h"
#include "vm/vm_kern.h"
#include "machine/ka650.h"
#include "machine/cpu.h"
#include "machine/psl.h"
#include "machine/mtpr.h"
#include "machine/nexus.h"
struct ka650_merr *ka650merr_ptr;
struct ka650_cbd *ka650cbd_ptr;
struct ka650_ssc *ka650ssc_ptr;
struct ka650_ipcr *ka650ipcr_ptr;
int *KA650_CACHE_ptr;
static int subtyp;
/*
* uvaxIII_conf() is called by cpu_attach to do the cpu_specific setup.
*/
void
uvaxIII_conf(parent, self, aux)
struct device *parent, *self;
void *aux;
{
extern char cpu_model[];
/*
* There are lots of different MicroVAX III models, we should
* check which here. but that later...
*/
strcpy(cpu_model,"MicroVAX III");
ka650encache();
if (ctob(physmem) > ka650merr_ptr->merr_qbmbr) {
printf("physmem(0x%x) > qbmbr(0x%x)\n",
ctob(physmem), ka650merr_ptr->merr_qbmbr);
panic("qbus map unprotected");
}
}
uvaxIII_steal_pages()
{
extern vm_offset_t avail_start, virtual_avail, avail_end;
int junk, *jon;
/*
* MicroVAX III: We steal away 64 pages from top of memory,
* map in SCB, interrupt vectors, Qbus map registers, memory
* error registers, cache control registers, SSC registers,
* interprocessor registers and cache diag space.
*/
avail_end -= 64 * NBPG;
MAPPHYS(junk, 2, VM_PROT_READ|VM_PROT_WRITE); /* SCB & vectors */
MAPVIRT(nexus, btoc(0x400000)); /* Qbus map registers */
pmap_map((vm_offset_t)nexus, 0x20088000, 0x20090000,
VM_PROT_READ|VM_PROT_WRITE);
MAPVIRT(ka650merr_ptr, 1); /* mem err & mem config regs */
pmap_map((vm_offset_t)ka650merr_ptr, (vm_offset_t)KA650_MERR,
KA650_MERR + NBPG, VM_PROT_READ|VM_PROT_WRITE);
MAPVIRT(ka650cbd_ptr, 1); /* cache control & boot/diag regs */
pmap_map((vm_offset_t)ka650cbd_ptr, (vm_offset_t)KA650_CBD,
KA650_CBD + NBPG, VM_PROT_READ|VM_PROT_WRITE);
MAPVIRT(ka650ssc_ptr, 1); /* SSC regs (& console prog mail box) */
pmap_map((vm_offset_t)ka650ssc_ptr, (vm_offset_t)KA650_SSC,
KA650_SSC + NBPG, VM_PROT_READ|VM_PROT_WRITE);
MAPVIRT(ka650ipcr_ptr, 1); /* InterProcessor Com Regs */
pmap_map((vm_offset_t)ka650ipcr_ptr, (vm_offset_t)KA650_IPCR,
KA650_IPCR + NBPG, VM_PROT_READ|VM_PROT_WRITE);
MAPVIRT(KA650_CACHE_ptr, 128); /* Cache Diagnostic space (for flush) */
pmap_map((vm_offset_t)KA650_CACHE_ptr, (vm_offset_t)KA650_CACHE,
KA650_CACHE + KA650_CACHESIZE, VM_PROT_READ|VM_PROT_WRITE);
jon = (int *)0x20040004;
subtyp = *jon;
return 0;
}
uvaxIII_clock()
{
mtpr(0x40, PR_ICCS); /* Start clock and enable interrupt */
return 1;
}
uvaxIII_memerr()
{
printf("memory err!\n");
#if 0 /* XXX Fix this */
register char *cp = (char *)0;
register int m;
extern u_int cache2tag;
if (ka650cbd.cbd_cacr & CACR_CPE) {
printf("cache 2 tag parity error: ");
if (time.tv_sec - cache2tag < 7) {
ka650discache();
printf("cacheing disabled\n");
} else {
cache2tag = time.tv_sec;
printf("flushing cache\n");
ka650encache();
}
}
m = ka650merr.merr_errstat;
ka650merr.merr_errstat = MEM_EMASK;
if (m & MEM_CDAL) {
cp = "Bus Parity";
} else if (m & MEM_RDS) {
cp = "Hard ECC";
} else if (m & MEM_CRD) {
cp = "Soft ECC";
}
if (cp) {
printf("%sMemory %s Error: page 0x%x\n",
(m & MEM_DMA) ? "DMA " : "", cp,
(m & MEM_PAGE) >> MEM_PAGESHFT);
}
#endif
}
#define NMC650 15
char *mc650[] = {
0, "FPA proto err", "FPA resv inst",
"FPA Ill Stat 2", "FPA Ill Stat 1", "PTE in P0, TB miss",
"PTE in P1, TB miss", "PTE in P0, Mod", "PTE in P1, Mod",
"Illegal intr IPL", "MOVC state error", "bus read error",
"SCB read error", "bus write error", "PCB write error"
};
u_int cache1tag;
u_int cache1data;
u_int cdalerr;
u_int cache2tag;
struct mc650frame {
int mc65_bcnt; /* byte count == 0xc */
int mc65_summary; /* summary parameter */
int mc65_mrvaddr; /* most recent vad */
int mc65_istate1; /* internal state */
int mc65_istate2; /* internal state */
int mc65_pc; /* trapped pc */
int mc65_psl; /* trapped psl */
};
uvaxIII_mchk(cmcf)
caddr_t cmcf;
{
register struct mc650frame *mcf = (struct mc650frame *)cmcf;
register u_int type = mcf->mc65_summary;
register u_int i;
printf("machine check %x", type);
if (type >= 0x80 && type <= 0x83)
type -= (0x80 + 11);
if (type < NMC650 && mc650[type])
printf(": %s", mc650[type]);
printf("\n\tvap %x istate1 %x istate2 %x pc %x psl %x\n",
mcf->mc65_mrvaddr, mcf->mc65_istate1, mcf->mc65_istate2,
mcf->mc65_pc, mcf->mc65_psl);
printf("dmaser=0x%b qbear=0x%x dmaear=0x%x\n",
ka650merr_ptr->merr_dser, DMASER_BITS, ka650merr_ptr->merr_qbear,
ka650merr_ptr->merr_dear);
ka650merr_ptr->merr_dser = DSER_CLEAR;
i = mfpr(PR_CAER);
mtpr(CAER_MCC | CAER_DAT | CAER_TAG, PR_CAER);
if (i & CAER_MCC) {
printf("cache 1 ");
if (i & CAER_DAT) {
printf("data");
i = cache1data;
cache1data = time.tv_sec;
}
if (i & CAER_TAG) {
printf("tag");
i = cache1tag;
cache1tag = time.tv_sec;
}
} else if ((i & CAER_MCD) || (ka650merr_ptr->merr_errstat & MEM_CDAL)) {
printf("CDAL");
i = cdalerr;
cdalerr = time.tv_sec;
}
if (time.tv_sec - i < 7) {
ka650discache();
printf(" parity error: cacheing disabled\n");
} else {
printf(" parity error: flushing cache\n");
ka650encache();
}
/*
* May be able to recover if type is 1-4, 0x80 or 0x81, but
* only if FPD is set in the saved PSL, or bit VCR in Istate2
* is clear.
*/
if ((type > 0 && type < 5) || type == 11 || type == 12) {
if ((mcf->mc65_psl & PSL_FPD)
|| !(mcf->mc65_istate2 & IS2_VCR)) {
uvaxIII_memerr();
return 0;
}
}
return -1;
}
/*
* Make sure both caches are off and not in diagnostic mode. Clear the
* 2nd level cache (by writing to each quadword entry), then enable it.
* Enable 1st level cache too.
*/
ka650encache()
{
register int i;
ka650discache();
for (i = 0; i < (KA650_CACHESIZE / sizeof(KA650_CACHE_ptr[0])); i += 2)
KA650_CACHE_ptr[i] = 0;
ka650cbd_ptr->cbd_cacr = CACR_CEN;
mtpr(CADR_SEN2 | CADR_SEN1 | CADR_CENI | CADR_CEND, PR_CADR);
}
ka650discache()
{
mtpr(0, PR_CADR);
ka650cbd_ptr->cbd_cacr = CACR_CPE;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.20 1995/11/10 19:05:49 ragge Exp $ */ /* $NetBSD: machdep.c,v 1.21 1995/12/13 18:45:54 ragge Exp $ */
/* /*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden. * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -87,7 +87,7 @@
#include <sys/syscallargs.h> #include <sys/syscallargs.h>
#include "ppp.h" /* For NERISR_PPP */ #include "ppp.h" /* For NERISR_PPP */
extern int virtual_avail, virtual_end;
/* /*
* We do these external declarations here, maybe they should be done * We do these external declarations here, maybe they should be done
* somewhere else... * somewhere else...
@ -130,15 +130,15 @@ cpu_startup()
vm_offset_t minaddr, maxaddr; vm_offset_t minaddr, maxaddr;
vm_size_t size; vm_size_t size;
extern int cpu_type, boothowto, startpmapdebug; extern int cpu_type, boothowto, startpmapdebug;
extern unsigned int avail_end; extern unsigned int avail_start, avail_end;
/* /*
* Initialize error message buffer. * Initialize error message buffer.
*/ */
msgbufmapped = 1; msgbufmapped = 1;
#ifdef VAX750 #if VAX750 || VAX650
if (cpunumber == VAX_750) if (cpunumber == VAX_750 || cpunumber == VAX_650)
if (!mfpr(PR_TODR)) if (!mfpr(PR_TODR))
mtpr(todrstopped = 1, PR_TODR); mtpr(todrstopped = 1, PR_TODR);
#endif #endif
@ -158,6 +158,7 @@ cpu_startup()
* Find out how much space we need, allocate it, and then give * Find out how much space we need, allocate it, and then give
* everything true virtual addresses. * everything true virtual addresses.
*/ */
sz = (int) allocsys((caddr_t) 0); sz = (int) allocsys((caddr_t) 0);
if ((v = (caddr_t) kmem_alloc(kernel_map, round_page(sz))) == 0) if ((v = (caddr_t) kmem_alloc(kernel_map, round_page(sz))) == 0)
panic("startup: no room for tables"); panic("startup: no room for tables");
@ -209,7 +210,6 @@ cpu_startup()
* Finally, allocate mbuf pool. Since mclrefcnt is an off-size we * Finally, allocate mbuf pool. Since mclrefcnt is an off-size we
* use the more space efficient malloc in place of kmem_alloc. * use the more space efficient malloc in place of kmem_alloc.
*/ */
mclrefcnt = (char *) malloc(NMBCLUSTERS + CLBYTES / MCLBYTES, mclrefcnt = (char *) malloc(NMBCLUSTERS + CLBYTES / MCLBYTES,
M_MBUF, M_NOWAIT); M_MBUF, M_NOWAIT);
bzero(mclrefcnt, NMBCLUSTERS + CLBYTES / MCLBYTES); bzero(mclrefcnt, NMBCLUSTERS + CLBYTES / MCLBYTES);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbi.c,v 1.3 1995/11/10 19:14:43 ragge Exp $ */ /* $NetBSD: sbi.c,v 1.4 1995/12/13 18:45:53 ragge Exp $ */
/* /*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden. * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* All rights reserved. * All rights reserved.
@ -120,6 +120,12 @@ sbi_attach(parent, self, aux)
}; };
break; break;
#endif #endif
#ifdef VAX650
case VAX_650:
maxnex = NNEX630; /* XXX */
printf(": Q22\n");
break;
#endif
#if VAX780 || VAX8600 #if VAX780 || VAX8600
case VAX_780: case VAX_780:
case VAX_8600: case VAX_8600:
@ -153,8 +159,9 @@ sbi_attach(parent, self, aux)
break; break;
} }
#endif #endif
#ifdef VAX630 #if VAX630 || VAX650
case VAX_78032: case VAX_78032:
case VAX_650:
sa.type = NEX_UBA0; sa.type = NEX_UBA0;
break; break;
#endif #endif