From 6692a5c8d026b014a1926f7a262176e6546c1594 Mon Sep 17 00:00:00 2001 From: Jim Bloom Date: Tue, 6 Aug 1985 01:58:11 -0800 Subject: [PATCH] add support for 8600 SCCS-vsn: sys/vax/include/cpu.h 6.4 SCCS-vsn: sys/vax/vax/cpudata.c 6.4 SCCS-vsn: sys/vax/vax/locore.s 6.29 SCCS-vsn: sys/vax/vax/machdep.c 6.19 SCCS-vsn: sys/vax/include/mtpr.h 6.3 SCCS-vsn: sys/vax/vax/nexus.h 6.3 SCCS-vsn: sys/vax/include/pte.h 6.6 --- usr/src/sys/vax/include/cpu.h | 42 +++++++-- usr/src/sys/vax/include/mtpr.h | 26 +++++- usr/src/sys/vax/include/pte.h | 3 +- usr/src/sys/vax/vax/cpudata.c | 51 ++++++++++- usr/src/sys/vax/vax/locore.s | 59 +++++++++++-- usr/src/sys/vax/vax/machdep.c | 150 ++++++++++++++++++++++++++++----- usr/src/sys/vax/vax/nexus.h | 11 ++- 7 files changed, 295 insertions(+), 47 deletions(-) diff --git a/usr/src/sys/vax/include/cpu.h b/usr/src/sys/vax/include/cpu.h index 64a49ceb3a..04f406d095 100644 --- a/usr/src/sys/vax/include/cpu.h +++ b/usr/src/sys/vax/include/cpu.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)cpu.h 6.3 (Berkeley) %G% + * @(#)cpu.h 6.4 (Berkeley) %G% */ #ifndef LOCORE @@ -16,6 +16,12 @@ union cpusid { u_int :24, cp_type:8; } cpuany; + struct cpu8600 { + u_int cp_sno:12, /* serial number */ + cp_plant:4, /* plant number */ + cp_eco:8, /* eco level */ + cp_type:8; /* VAX_8600 */ + } cpu8600; struct cpu780 { u_int cp_sno:12, /* serial number */ cp_plant:3, /* plant number */ @@ -39,8 +45,9 @@ union cpusid { #define VAX_780 1 #define VAX_750 2 #define VAX_730 3 +#define VAX_8600 4 -#define VAX_MAX 3 +#define VAX_MAX 4 #ifndef LOCORE /* @@ -48,22 +55,41 @@ union cpusid { */ struct percpu { short pc_cputype; /* cpu type code */ - short pc_nnexus; /* number of nexus slots */ - struct nexus *pc_nexbase; /* base of nexus space */ + short pc_nioa; /* number of IO adaptors/SBI's */ + caddr_t *pc_ioaaddr; /* phys addresses of IO adaptors */ + int pc_ioasize; /* size of a IO adaptor */ + short *pc_ioatype; /* io adaptor types if no cfg reg */ +}; + +struct persbi { + short psb_nnexus; /* number of nexus slots */ + struct nexus *psb_nexbase; /* base of nexus space */ /* we should be able to have just one address for the unibus memories */ /* and calculate successive addresses by adding to the base, but the 750 */ /* doesn't obey the sensible rule: uba1 has a lower address than uba0! */ - caddr_t *pc_umaddr; /* unibus memory addresses */ - short pc_nubabdp; /* number of bdp's per uba */ - short pc_haveubasr; /* have uba status register */ + caddr_t *psb_umaddr; /* unibus memory addresses */ + short psb_nubabdp; /* number of bdp's per uba */ + short psb_haveubasr; /* have uba status register */ /* the 750 has some slots which don't promise to tell you their types */ /* if this pointer is non-zero, then you get the type from this array */ /* rather than from the (much more sensible) low byte of the config register */ - short *pc_nextype; /* botch */ + short *psb_nextype; /* botch */ }; #ifdef KERNEL int cpu; struct percpu percpu[]; +#if VAX730 +struct persbi xxx730; +#endif +#if VAX750 +struct persbi cmi750; +#endif +#if VAX780 +struct persbi sbi780; +#endif +#if VAX8600 +struct persbi sbi8600[]; +#endif #endif #endif diff --git a/usr/src/sys/vax/include/mtpr.h b/usr/src/sys/vax/include/mtpr.h index c9ab1453bf..d45e18a5f3 100644 --- a/usr/src/sys/vax/include/mtpr.h +++ b/usr/src/sys/vax/include/mtpr.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)mtpr.h 6.2 (Berkeley) %G% + * @(#)mtpr.h 6.3 (Berkeley) %G% */ /* @@ -41,8 +41,30 @@ #define PMR 0x3d /* performance monitor enable */ #define SID 0x3e /* system identification */ -#if defined(VAX780) +#if defined(VAX780) || defined(VAX8600) #define ACCS 0x28 /* accelerator control and status */ +#endif + +#if defined(VAX8600) +#define TBCHK 0x3f /* Translation Buffer Check */ +#define PAMACC 0x40 /* PAMM access */ +#define PAMLOC 0x41 /* PAMM location */ +#define CSWP 0x42 /* Cache sweep */ +#define MDECC 0x43 /* MBOX data ecc register */ +#define MENA 0x44 /* MBOX error enable register */ +#define MDCTL 0x45 /* MBOX data control register */ +#define MCCTL 0x46 /* MBOX mcc control register */ +#define MERG 0x47 /* MBOX error generator register */ +#define CRBT 0x48 /* Console reboot */ +#define DFI 0x49 /* Diag fault insertion register */ +#define EHSR 0x4a /* Error handling status register */ +#define STXCS 0x4c /* Console block storage C/S */ +#define STXDB 0x4d /* Console block storage D/B */ +#define ESPA 0x4e /* EBOX scratchpad address */ +#define ESPD 0x4f /* EBOX sratchpad data */ +#endif + +#if defined(VAX780) #define ACCR 0x29 /* accelerator maintenance */ #define WCSA 0x2c /* WCS address */ #define WCSD 0x2d /* WCS data */ diff --git a/usr/src/sys/vax/include/pte.h b/usr/src/sys/vax/include/pte.h index a375c11e9d..a4636c7b08 100644 --- a/usr/src/sys/vax/include/pte.h +++ b/usr/src/sys/vax/include/pte.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)pte.h 6.5 (Berkeley) %G% + * @(#)pte.h 6.6 (Berkeley) %G% */ /* @@ -86,5 +86,6 @@ extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; extern struct pte Nexmap[][16]; +extern struct pte Ioamap[][1]; #endif #endif diff --git a/usr/src/sys/vax/vax/cpudata.c b/usr/src/sys/vax/vax/cpudata.c index 1b781ae6d8..33cdaac469 100644 --- a/usr/src/sys/vax/vax/cpudata.c +++ b/usr/src/sys/vax/vax/cpudata.c @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)cpudata.c 6.3 (Berkeley) %G% + * @(#)cpudata.c 6.4 (Berkeley) %G% */ #include "pte.h" @@ -12,6 +12,7 @@ #include "cpu.h" #include "nexus.h" +#include "ioa.h" #include "../vaxuba/ubareg.h" /* @@ -23,6 +24,16 @@ * unibus memory for each of the possible unibus adapters. Note that the * unibus memory addresses are actually indexed by the unibus adapter type code. */ +#if VAX8600 +caddr_t umaddr8600a[4] = { + (caddr_t) UMEMA8600(0), (caddr_t) UMEMA8600(1), + (caddr_t) UMEMA8600(2), (caddr_t) UMEMA8600(3), +}; +caddr_t umaddr8600b[4] = { + (caddr_t) UMEMB8600(0), (caddr_t) UMEMB8600(1), + (caddr_t) UMEMB8600(2), (caddr_t) UMEMB8600(3), +}; +#endif #if VAX780 caddr_t umaddr780[4] = { (caddr_t) UMEM780(0), (caddr_t) UMEM780(1), @@ -59,15 +70,47 @@ short nexty730[NNEX730] = { }; #endif +#if VAX8600 +struct persbi sbi8600[2] = { + { NNEX8600, NEXA8600, umaddr8600a, NBDP8600, 1, 0 }, + { NNEX8600, NEXB8600, umaddr8600b, NBDP8600, 1, 0 }, +}; +caddr_t ioaaddr8600[] = { IOA8600(0), IOA8600(1) }; +#endif + +#if VAX780 +struct persbi sbi780 = { + NNEX780, NEX780, umaddr780, NBDP780, 1, 0, +}; +short ioa780[] = { IOA_SBI780 }; +#endif + +#if VAX750 +struct persbi cmi750 = { + NNEX750, NEX750, umaddr750, NBDP750, 0, nexty750, +}; +short ioa750[] = { IOA_CMI750 }; +#endif + +#if VAX730 +struct persbi xxx730 = { + NNEX730, NEX730, umaddr730, NBDP730, 0, nexty730, +}; +short ioa730[] = { IOA_XXX730 }; +#endif + struct percpu percpu[] = { +#if VAX8600 + { VAX_8600, 2, ioaaddr8600, 512, (short *)0 }, +#endif #if VAX780 - VAX_780, NNEX780, NEX780, umaddr780, NBDP780, 1, 0, + { VAX_780, 1, (caddr_t *)0, 0, ioa780 }, #endif #if VAX750 - VAX_750, NNEX750, NEX750, umaddr750, NBDP750, 0, nexty750, + { VAX_750, 1, (caddr_t *)0, 0, ioa750 }, #endif #if VAX730 - VAX_730, NNEX730, NEX730, umaddr730, NBDP730, 0, nexty730, + { VAX_730, 1, (caddr_t *)0, 0, ioa730 }, #endif 0, }; diff --git a/usr/src/sys/vax/vax/locore.s b/usr/src/sys/vax/vax/locore.s index 59a55a34ed..17127eabcf 100644 --- a/usr/src/sys/vax/vax/locore.s +++ b/usr/src/sys/vax/vax/locore.s @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)locore.s 6.28 (Berkeley) %G% + * @(#)locore.s 6.29 (Berkeley) %G% */ #include "psl.h" @@ -18,6 +18,7 @@ #include "nexus.h" #include "cons.h" #include "clock.h" +#include "ioa.h" #include "../vaxuba/ubareg.h" #include "dz.h" @@ -104,11 +105,17 @@ SCBVEC(machcheck): .word 8f-0b # 1 is 780 .word 5f-0b # 2 is 750 .word 5f-0b # 3 is 730 + .word 7f-0b # 4 is 8600 5: #if defined(VAX750) || defined(VAX730) mtpr $0xf,$MCESR #endif brb 1f +7: +#if VAX8600 + mtpr $0,$EHSR +#endif + brb 1f 8: #if VAX780 mtpr $0,$SBIFS @@ -159,6 +166,16 @@ SCBVEC(mba0int): #define rUBA r4 /* r2,r5 are scratch */ +#if NUBA > 4 +SCBVEC(ua7int): + PUSHR; movl $7,rUBANUM; moval _uba_hd+(7*UH_SIZE),rUBAHD; brb 1f +SCBVEC(ua6int): + PUSHR; movl $6,rUBANUM; moval _uba_hd+(6*UH_SIZE),rUBAHD; brb 1f +SCBVEC(ua5int): + PUSHR; movl $5,rUBANUM; moval _uba_hd+(5*UH_SIZE),rUBAHD; brb 1f +SCBVEC(ua4int): + PUSHR; movl $4,rUBANUM; moval _uba_hd+(4*UH_SIZE),rUBAHD; brb 1f +#endif SCBVEC(ua3int): PUSHR; movl $3,rUBANUM; moval _uba_hd+(3*UH_SIZE),rUBAHD; brb 1f SCBVEC(ua2int): @@ -234,25 +251,49 @@ SCBVEC(netintr): POPR incl _cnt+V_SOFT rei -#if defined(VAX750) || defined(VAX730) +#if defined(VAX750) || defined(VAX730) || defined(VAX8600) SCBVEC(consdin): PUSHR; incl _intrcnt+I_TUR -#if defined(VAX750) && !defined(VAX730) && !defined(MRSP) + casel _cpu,$VAX_750,$VAX_8600 +0: + .word 5f-0b # 2 is VAX_750 + .word 3f-0b # 3 is VAX_730 + .word 6f-0b # 4 is VAX_8600 + halt +5: +#if defined(VAX750) && !defined(MRSP) jsb tudma #endif - calls $0,_turintr; +3: +#if defined(VAX750) || defined(VAX730) + calls $0,_turintr + brb 2f +#else + halt +#endif +6: +#if VAX8600 + calls $0, _crlintr +#else + halt +#endif +2: POPR; incl _cnt+V_INTR; rei +#else +SCBVEC(consdin): + halt +#endif + +#if defined(VAX750) || defined(VAX730) SCBVEC(consdout): PUSHR; calls $0,_tuxintr; POPR incl _cnt+V_INTR incl _intrcnt+I_TUX rei #else -SCBVEC(consdin): - halt SCBVEC(consdout): halt #endif @@ -378,7 +419,7 @@ uudma: rsb # continue processing in uurintr #endif -#if defined(VAX750) && !defined(VAX730) && !defined(MRSP) +#if defined(VAX750) && !defined(MRSP) /* * Pseudo DMA routine for VAX-11/750 console tu58 * (without MRSP) @@ -570,7 +611,8 @@ _/**/mname: .globl _/**/mname; \ SYSMAP(Sysmap ,Sysbase ,SYSPTSIZE ) SYSMAP(UMBAbeg ,umbabeg ,0 ) SYSMAP(Nexmap ,nexus ,16*MAXNNEXUS ) - SYSMAP(UMEMmap ,umem ,512*NUBA ) + SYSMAP(UMEMmap ,umem ,UBAPAGES*NUBA ) + SYSMAP(Ioamap ,ioa ,MAXNIOA*IOAMAPSIZ/NBPG ) SYSMAP(UMBAend ,umbaend ,0 ) SYSMAP(Usrptmap ,usrpt ,USRPTSIZE ) SYSMAP(Forkmap ,forkutl ,UPAGES ) @@ -608,6 +650,7 @@ _cpu: .long 0 .globl start start: .word 0 + mtpr $0,$ICCS /* set system control block base and system page table params */ mtpr $_scb-0x80000000,$SCBB mtpr $_Sysmap-0x80000000,$SBR diff --git a/usr/src/sys/vax/vax/machdep.c b/usr/src/sys/vax/vax/machdep.c index 9c896c432f..d0d66c1bea 100644 --- a/usr/src/sys/vax/vax/machdep.c +++ b/usr/src/sys/vax/vax/machdep.c @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)machdep.c 6.18 (Berkeley) %G% + * @(#)machdep.c 6.19 (Berkeley) %G% */ #include "reg.h" @@ -122,11 +122,10 @@ startup(firstaddr) * We allocate 1/2 as many swap buffer headers as file i/o buffers. */ if (bufpages == 0) - if (physmem < (2 * 1024 * 1024)) + if (physmem < (2 * 1024 * CLSIZE)) bufpages = physmem / 10 / CLSIZE; else - bufpages = - ((2 * 1024 * 1024) / 5 + physmem / 5) / CLSIZE; + bufpages = ((2 * 1024 * CLSIZE + physmem) / 20) / CLSIZE; if (nbuf == 0) { nbuf = bufpages / 2; if (nbuf < 16) @@ -241,7 +240,27 @@ startup(firstaddr) * Configure the system. */ configure(); + switch (cpu) { + case VAX_780: + setcache(0x200000); + break; + case VAX_750: + case VAX_730: + setcache(0); + break; + case VAX_8600: + setcache(3); + break; + } + +#if VAX8600 + /* + * Enable Fbox on 8600 if it exists + */ + if ((cpu == VAX_8600) && ((mfpr(ACCS) & 0xff) != 0)) + mtpr(ACCS, 0x8000); +#endif /* * Clear restart inhibit flags. */ @@ -381,7 +400,7 @@ sendsig(p, sig, mask) * Return to previous pc and psl as specified by * context left by sendsig. Check carefully to * make sure that the user has not modified the - * psl to gain improper privileges or to cause + * psl to gain improper priviledges or to cause * a machine fault. */ sigreturn() @@ -783,6 +802,13 @@ dumpsys() * Machine check error recovery code. * Print out the machine check frame and then give up. */ +#if VAX8600 +#define NMC8600 6 +char *mc8600[] = { + "unkn type", "fbox error", "ebox error", "ibox error", + "mbox error", "tbuf error" +}; +#endif #if defined(VAX780) || defined(VAX750) char *mc780[] = { "cp read", "ctrl str par", "cp tbuf par", "cp cache par", @@ -842,6 +868,33 @@ struct mc730frame { int mc3_pc; /* trapped pc */ int mc3_psl; /* trapped psl */ }; +struct mc8600frame { + int mc6_bcnt; /* byte count == 0x58 */ + int mc6_ehmsts; + int mc6_evmqsav; + int mc6_ebcs; + int mc6_edpsr; + int mc6_cslint; + int mc6_ibesr; + int mc6_ebxwd1; + int mc6_ebxwd2; + int mc6_ivasav; + int mc6_vibasav; + int mc6_esasav; + int mc6_isasav; + int mc6_cpc; + int mc6_mstat1; + int mc6_mstat2; + int mc6_mdecc; + int mc6_merg; + int mc6_cshctl; + int mc6_mear; + int mc6_medr; + int mc6_accs; + int mc6_cses; + int mc6_pc; /* trapped pc */ + int mc6_psl; /* trapped psl */ +}; machinecheck(cmcf) caddr_t cmcf; @@ -850,30 +903,51 @@ machinecheck(cmcf) printf("machine check %x: ", type); switch (cpu) { -#if VAX780 - case VAX_780: -#endif -#if VAX750 - case VAX_750: -#endif -#if defined(VAX780) || defined(VAX750) - printf("%s%s\n", mc780[type&0xf], - (type&0xf0) ? " abort" : " fault"); - break; -#endif -#if VAX730 - case VAX_730: - if (type < NMC730) - printf("%s", mc730[type]); +#if VAX8600 + case VAX_8600: { + register struct mc8600frame *mcf = (struct mc8600frame *)cmcf; + + if (mcf->mc6_ebcs & 0x8000) + mcf->mc6_ehmsts |= 0x4; + else if (mcf->mc6_ehmsts & 0x10000000) + mcf->mc6_ehmsts |= 0x1; + else if (mcf->mc6_ebcs & 0x1e00) + if (mcf->mc6_ebcs & 0x200) + mcf->mc6_ehmsts |= 0x4; + else + mcf->mc6_ehmsts |= 0x2; + else if (mcf->mc6_ehmsts & 0x2000) + mcf->mc6_ehmsts |= 0x3; + if (!(mcf->mc6_ehmsts & 0xf) && (mcf->mc6_mstat1 & 0xf00)) + mcf->mc6_ehmsts |= 0x5; + type = mcf->mc6_ehmsts & 0x7; + if (type < NMC8600) + printf("machine check %x: %s", type, mc8600[type]); printf("\n"); + printf("\tehm.sts %x evmqsav %x ebcs %x edpsr %x cslint %x\n", + mcf->mc6_ehmsts, mcf->mc6_evmqsav, mcf->mc6_ebcs, + mcf->mc6_edpsr, mcf->mc6_cslint); + printf("\tibesr %x ebxwd %x %x ivasav %x vibasav %x\n", + mcf->mc6_ibesr, mcf->mc6_ebxwd1, mcf->mc6_ebxwd2, + mcf->mc6_ivasav, mcf->mc6_vibasav); + printf("\tesasav %x isasav %x cpc %x mstat %x %x mdecc %x\n", + mcf->mc6_esasav, mcf->mc6_isasav, mcf->mc6_cpc, + mcf->mc6_mstat1, mcf->mc6_mstat2, mcf->mc6_mdecc); + printf("\tmerg %x cshctl %x mear %x medr %x accs %x cses %x\n", + mcf->mc6_merg, mcf->mc6_cshctl, mcf->mc6_mear, + mcf->mc6_medr, mcf->mc6_accs, mcf->mc6_cses); + printf("\tpc %x psl %x\n", mcf->mc6_pc, mcf->mc6_psl); + mtpr(EHSR, 0); break; + }; #endif - } - switch (cpu) { #if VAX780 case VAX_780: { register struct mc780frame *mcf = (struct mc780frame *)cmcf; + register int sbifs; + printf("%s%s\n", 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); @@ -891,8 +965,10 @@ machinecheck(cmcf) #if VAX750 case VAX_750: { register struct mc750frame *mcf = (struct mc750frame *)cmcf; - int mcsr = mfpr(MCSR); + int mcsr = mfpr(MCSR); + printf("%s%s\n", mc780[type&0xf], + (type&0xf0) ? " abort" : " fault"); mtpr(TBIA, 0); mtpr(MCESR, 0xf); printf("\tva %x errpc %x mdr %x smr %x rdtimo %x tbgpar %x cacherr %x\n", @@ -911,6 +987,10 @@ machinecheck(cmcf) #if VAX730 case VAX_730: { register struct mc730frame *mcf = (struct mc730frame *)cmcf; + + if (type < NMC730) + printf("%s", mc730[type]); + printf("\n"); printf("params %x,%x pc %x psl %x mcesr %x\n", mcf->mc3_parm[0], mcf->mc3_parm[1], mcf->mc3_pc, mcf->mc3_psl, mfpr(MCESR)); @@ -954,3 +1034,27 @@ physstrat(bp, strat, prio) sleep((caddr_t)bp, prio); splx(s); } + +setcache(val) +int val; +{ + switch(cpu) { +#if VAX780 + case VAX_780: + mtpr(SBIMT, val); + break; +#endif +#if VAX750 + case VAX_750: + mtpr(CADR, val); + break; +#endif +#if VAX8600 + case VAX_8600: + mtpr(CSWP, val); + break; +#endif + default: + break; + } +} diff --git a/usr/src/sys/vax/vax/nexus.h b/usr/src/sys/vax/vax/nexus.h index af016ec3ca..0d2c5ee87a 100644 --- a/usr/src/sys/vax/vax/nexus.h +++ b/usr/src/sys/vax/vax/nexus.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)nexus.h 6.2 (Berkeley) %G% + * @(#)nexus.h 6.3 (Berkeley) %G% */ /* @@ -15,6 +15,11 @@ * At boot time the system looks through the array of available * slots and finds the interconnects for the machine. */ +#if VAX8600 +#define NNEX8600 16 +#define NEXA8600 ((struct nexus *)(0x20000000)) +#define NEXB8600 ((struct nexus *)(0x22000000)) +#endif #if VAX780 #define NNEX780 16 #define NEX780 ((struct nexus *)0x20000000) @@ -29,7 +34,11 @@ #endif #define NEXSIZE 0x2000 +#if VAX8600 +#define MAXNNEXUS 32 +#else #define MAXNNEXUS 16 +#endif #ifndef LOCORE struct nexus { -- 2.20.1