xref: /csrg-svn/sys/vax/include/cpu.h (revision 34230)
123258Smckusick /*
229178Smckusick  * Copyright (c) 1982, 1986 Regents of the University of California.
323258Smckusick  * All rights reserved.  The Berkeley software License Agreement
423258Smckusick  * specifies the terms and conditions for redistribution.
523258Smckusick  *
6*34230Skarels  *	@(#)cpu.h	7.4 (Berkeley) 05/07/88
723258Smckusick  */
82550Swnj 
92712Swnj #ifndef LOCORE
102550Swnj /*
112550Swnj  * Cpu identification, from SID register.
122550Swnj  */
132550Swnj union cpusid {
142550Swnj 	int	cpusid;
152550Swnj 	struct cpuany {
162550Swnj 		u_int	:24,
172550Swnj 			cp_type:8;
182550Swnj 	} cpuany;
1924174Sbloom 	struct cpu8600 {
2024174Sbloom 		u_int	cp_sno:12,		/* serial number */
2124174Sbloom 			cp_plant:4,		/* plant number */
2224174Sbloom 			cp_eco:8,		/* eco level */
2324174Sbloom 			cp_type:8;		/* VAX_8600 */
2424174Sbloom 	} cpu8600;
25*34230Skarels 	struct cpu8200 {
26*34230Skarels 		u_int	cp_urev:8,		/* ucode rev */
27*34230Skarels 			cp_secp:1,		/* secondary patch? */
28*34230Skarels 			cp_patch:10,		/* patch number */
29*34230Skarels 			cp_hrev:4,		/* hardware rev */
30*34230Skarels 			cp_5:1,			/* true iff KA825 */
31*34230Skarels 			cp_type:8;		/* VAX_8200 */
32*34230Skarels 	} cpu8200;
332550Swnj 	struct cpu780 {
342550Swnj 		u_int	cp_sno:12,		/* serial number */
352550Swnj 			cp_plant:3,		/* plant number */
36*34230Skarels 			cp_eco:8,		/* eco level */
37*34230Skarels 			cp_5:1,			/* true iff 785 */
382550Swnj 			cp_type:8;		/* VAX_780 */
392550Swnj 	} cpu780;
402550Swnj 	struct cpu750 {
412550Swnj 		u_int	cp_hrev:8,		/* hardware rev level */
422550Swnj 			cp_urev:8,		/* ucode rev level */
432550Swnj 			:8,
442550Swnj 			cp_type:8;		/* VAX_750 */
452550Swnj 	} cpu750;
4624173Sbloom 	struct cpu730 {
4724173Sbloom 		u_int	:8,			/* reserved */
4824173Sbloom 			cp_urev:8,		/* ucode rev level */
4924173Sbloom 			:8,			/* reserved */
5024173Sbloom 			cp_type:8;		/* VAX_730 */
5124173Sbloom 	} cpu730;
5227250Skridle  	struct cpu630 {
5327250Skridle  		u_int	:24,			/* reserved */
5427250Skridle  			cp_type:8;		/* VAX_630 */
5527250Skridle  	} cpu630;
562550Swnj };
572712Swnj #endif
5826347Skarels /*
5926347Skarels  * Vax CPU types.
6026347Skarels  * Similar types are grouped with their earliest example.
6126347Skarels  */
622550Swnj #define	VAX_780		1
632550Swnj #define	VAX_750		2
646943Ssam #define	VAX_730		3
65*34230Skarels #define	VAX_8600	4
66*34230Skarels #define	VAX_8200	5
67*34230Skarels #define	VAX_8800	6	/* not positive */
68*34230Skarels #define	VAX_8500	6	/* same as 8800, 8700 */
69*34230Skarels #define	VAX_610		7	/* uVAX I */
70*34230Skarels #define	VAX_630		8	/* uVAX II */
712550Swnj 
7227250Skridle #define	VAX_MAX		8
732550Swnj 
7426347Skarels /*
7526347Skarels  * Main IO backplane types.
7626347Skarels  * This gives us a handle on how to do autoconfiguration.
7726347Skarels  */
7826347Skarels #define	IO_SBI780	1
7926347Skarels #define	IO_CMI750	2
8026347Skarels #define	IO_XXX730	3
8126347Skarels #define IO_ABUS		4
8227250Skridle #define IO_QBUS		5
83*34230Skarels #define	IO_BI		6
8426347Skarels 
852712Swnj #ifndef LOCORE
862550Swnj /*
87*34230Skarels  * CPU-dependent operations.
88*34230Skarels  */
89*34230Skarels struct	clockops {
90*34230Skarels 	int	(*clkstartrt)();	/* start real time clock */
91*34230Skarels 	int	(*clkread)();		/* set system time from clock */
92*34230Skarels 	int	(*clkwrite)();		/* reset clock from system time */
93*34230Skarels };
94*34230Skarels 
95*34230Skarels struct	cpuops {
96*34230Skarels 	struct	clockops *cpu_clock;	/* clock operations */
97*34230Skarels 	int	(*cpu_memenable)();	/* memory error (CRD intr) enable */
98*34230Skarels 	int	(*cpu_memerr)();	/* memory error handler */
99*34230Skarels 	int	(*cpu_mchk)();		/* machine check handler */
100*34230Skarels 	int	(*cpu_init)();		/* special initialisation, if any */
101*34230Skarels };
102*34230Skarels 
103*34230Skarels /* return values from cpu_mchk */
104*34230Skarels #define	MCHK_PANIC	-1
105*34230Skarels #define	MCHK_RECOVERED	0
106*34230Skarels 
107*34230Skarels /*
1082550Swnj  * Per-cpu information for system.
1092550Swnj  */
1102550Swnj struct	percpu {
1113245Swnj 	short	pc_cputype;		/* cpu type code */
11224887Skarels 	short	pc_cpuspeed;		/* relative speed of cpu */
11326347Skarels 	short	pc_nioa;		/* number of IO adaptors/nexus blocks */
11426347Skarels 	struct	iobus *pc_io;		/* descriptions of IO adaptors */
115*34230Skarels 	struct	cpuops *pc_ops;		/* per-cpu operations */
11624174Sbloom };
11724174Sbloom 
11829733Skarels /*
11929733Skarels  * Generic description of an I/O "adaptor"
12029733Skarels  * (any top-level I/O bus visible to software
12129733Skarels  * and requiring autoconfiguration).
12229733Skarels  * The remainder of the description
12329733Skarels  * is pointed to by io_details.
12429733Skarels  */
12526347Skarels struct iobus {
12626979Skarels 	int	io_type;		/* io adaptor types */
12726347Skarels 	caddr_t	io_addr;		/* phys address of IO adaptor */
12826347Skarels 	int	io_size;		/* size of an IO space */
12926347Skarels 	caddr_t	io_details;		/* specific to adaptor types */
13026347Skarels };
13126347Skarels 
13226347Skarels /*
13326347Skarels  * Description of a main bus that maps "nexi", ala the 780 SBI.
13426347Skarels  */
13526347Skarels struct nexusconnect {
13624174Sbloom 	short	psb_nnexus;		/* number of nexus slots */
13724174Sbloom 	struct	nexus *psb_nexbase;	/* base of nexus space */
13829733Skarels 	short	psb_ubatype;		/* type of "unibus adaptor" */
13924174Sbloom 	short	psb_nubabdp;		/* number of bdp's per uba */
140*34230Skarels 	caddr_t	*psb_umaddr;		/* unibus memory addresses */
1413245Swnj /* the 750 has some slots which don't promise to tell you their types */
1423245Swnj /* if this pointer is non-zero, then you get the type from this array */
1433245Swnj /* rather than from the (much more sensible) low byte of the config register */
14424174Sbloom 	short	*psb_nextype;		/* botch */
1452550Swnj };
1462550Swnj 
14729733Skarels /*
148*34230Skarels  * Description of a BI bus configuration.
149*34230Skarels  */
150*34230Skarels struct bibus {
151*34230Skarels 	struct	bi_node *pbi_base;	/* base of node space */
152*34230Skarels 	/* that cannot possibly be all! */
153*34230Skarels };
154*34230Skarels 
155*34230Skarels /*
15629733Skarels  * Description of a Q-bus configuration.
15729733Skarels  */
15829733Skarels struct qbus {
15929733Skarels 	int	qb_type;		/* type of "unibus adaptor" */
16029733Skarels 	int	qb_memsize;		/* size of (used) memory, pages */
16129733Skarels 	struct	pte *qb_map;		/* base of map registers */
16229733Skarels 	caddr_t	qb_maddr;		/* "unibus" memory address */
16329733Skarels 	caddr_t	qb_iopage;		/* "unibus" IO page address */
16429733Skarels };
16529733Skarels 
1662550Swnj #ifdef KERNEL
1672550Swnj int	cpu;
168*34230Skarels #if VAX8800 || VAX8200
169*34230Skarels int	mastercpu;		/* if multiple cpus, this identifies master */
170*34230Skarels #endif
1713245Swnj struct	percpu percpu[];
172*34230Skarels struct	cpuops *cpuops;
1732550Swnj #endif
17430255Ssam 
17530255Ssam /*
17630255Ssam  * Enable realtime clock (always enabled).
17730255Ssam  */
17830255Ssam #define	enablertclock()
179*34230Skarels #endif /* LOCORE */
180