xref: /csrg-svn/sys/vax/include/cpu.h (revision 52628)
123258Smckusick /*
235044Skarels  * Copyright (c) 1982, 1986, 1988 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*52628Skarels  *	@(#)cpu.h	7.7 (Berkeley) 02/20/92
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;
2534230Skarels 	struct cpu8200 {
2634230Skarels 		u_int	cp_urev:8,		/* ucode rev */
2734230Skarels 			cp_secp:1,		/* secondary patch? */
2834230Skarels 			cp_patch:10,		/* patch number */
2934230Skarels 			cp_hrev:4,		/* hardware rev */
3034230Skarels 			cp_5:1,			/* true iff KA825 */
3134230Skarels 			cp_type:8;		/* VAX_8200 */
3234230Skarels 	} cpu8200;
332550Swnj 	struct cpu780 {
342550Swnj 		u_int	cp_sno:12,		/* serial number */
352550Swnj 			cp_plant:3,		/* plant number */
3634230Skarels 			cp_eco:8,		/* eco level */
3734230Skarels 			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 {
5335044Skarels 		u_int	cp_hrev:8,		/* hardware rev level */
5435044Skarels 			cp_urev:8,		/* ucode rev level */
5535044Skarels 			:8,
5627250Skridle  			cp_type:8;		/* VAX_630 */
5727250Skridle  	} cpu630;
5835398Stef 	struct cpu650 {
5935398Stef 		u_int	cp_urev:8,		/* ucode rev level */
6035398Stef 			:16,			/* reserved */
6135398Stef 			cp_type:8;		/* VAX_650 */
6235398Stef 	} cpu650;
632550Swnj };
642712Swnj #endif
6526347Skarels /*
6626347Skarels  * Vax CPU types.
6726347Skarels  * Similar types are grouped with their earliest example.
6826347Skarels  */
692550Swnj #define	VAX_780		1
702550Swnj #define	VAX_750		2
716943Ssam #define	VAX_730		3
7234230Skarels #define	VAX_8600	4
7334230Skarels #define	VAX_8200	5
7435044Skarels #define	VAX_8800	6
7534230Skarels #define	VAX_8500	6	/* same as 8800, 8700 */
7634230Skarels #define	VAX_610		7	/* uVAX I */
7734230Skarels #define	VAX_630		8	/* uVAX II */
7835398Stef #define	VAX_650		10	/* uVAX 3000 */
792550Swnj 
8035398Stef #define	VAX_MAX		10
812550Swnj 
8226347Skarels /*
8326347Skarels  * Main IO backplane types.
8426347Skarels  * This gives us a handle on how to do autoconfiguration.
8526347Skarels  */
8626347Skarels #define	IO_SBI780	1
8726347Skarels #define	IO_CMI750	2
8826347Skarels #define	IO_XXX730	3
8926347Skarels #define IO_ABUS		4
9027250Skridle #define IO_QBUS		5
9134230Skarels #define	IO_BI		6
9235044Skarels #define	IO_NMI		7
9326347Skarels 
942712Swnj #ifndef LOCORE
952550Swnj /*
9634230Skarels  * CPU-dependent operations.
9734230Skarels  */
9834230Skarels struct	clockops {
9934230Skarels 	int	(*clkstartrt)();	/* start real time clock */
10034230Skarels 	int	(*clkread)();		/* set system time from clock */
10134230Skarels 	int	(*clkwrite)();		/* reset clock from system time */
10234230Skarels };
10334230Skarels 
10434230Skarels struct	cpuops {
10534230Skarels 	struct	clockops *cpu_clock;	/* clock operations */
10634230Skarels 	int	(*cpu_memenable)();	/* memory error (CRD intr) enable */
10734230Skarels 	int	(*cpu_memerr)();	/* memory error handler */
10834230Skarels 	int	(*cpu_mchk)();		/* machine check handler */
10934230Skarels 	int	(*cpu_init)();		/* special initialisation, if any */
11034230Skarels };
11134230Skarels 
11234230Skarels /* return values from cpu_mchk */
11334230Skarels #define	MCHK_PANIC	-1
11434230Skarels #define	MCHK_RECOVERED	0
11534230Skarels 
11634230Skarels /*
1172550Swnj  * Per-cpu information for system.
1182550Swnj  */
1192550Swnj struct	percpu {
1203245Swnj 	short	pc_cputype;		/* cpu type code */
12124887Skarels 	short	pc_cpuspeed;		/* relative speed of cpu */
12226347Skarels 	short	pc_nioa;		/* number of IO adaptors/nexus blocks */
12326347Skarels 	struct	iobus *pc_io;		/* descriptions of IO adaptors */
12434230Skarels 	struct	cpuops *pc_ops;		/* per-cpu operations */
12524174Sbloom };
12624174Sbloom 
12729733Skarels /*
12829733Skarels  * Generic description of an I/O "adaptor"
12929733Skarels  * (any top-level I/O bus visible to software
13029733Skarels  * and requiring autoconfiguration).
13129733Skarels  * The remainder of the description
13229733Skarels  * is pointed to by io_details.
13329733Skarels  */
13426347Skarels struct iobus {
13526979Skarels 	int	io_type;		/* io adaptor types */
13626347Skarels 	caddr_t	io_addr;		/* phys address of IO adaptor */
13726347Skarels 	int	io_size;		/* size of an IO space */
13826347Skarels 	caddr_t	io_details;		/* specific to adaptor types */
13926347Skarels };
14026347Skarels 
14126347Skarels /*
14226347Skarels  * Description of a main bus that maps "nexi", ala the 780 SBI.
14326347Skarels  */
14426347Skarels struct nexusconnect {
14524174Sbloom 	short	psb_nnexus;		/* number of nexus slots */
14624174Sbloom 	struct	nexus *psb_nexbase;	/* base of nexus space */
14729733Skarels 	short	psb_ubatype;		/* type of "unibus adaptor" */
14824174Sbloom 	short	psb_nubabdp;		/* number of bdp's per uba */
14934230Skarels 	caddr_t	*psb_umaddr;		/* unibus memory addresses */
1503245Swnj /* the 750 has some slots which don't promise to tell you their types */
1513245Swnj /* if this pointer is non-zero, then you get the type from this array */
1523245Swnj /* rather than from the (much more sensible) low byte of the config register */
15324174Sbloom 	short	*psb_nextype;		/* botch */
1542550Swnj };
1552550Swnj 
15629733Skarels /*
15734230Skarels  * Description of a BI bus configuration.
15834230Skarels  */
15934230Skarels struct bibus {
16034230Skarels 	struct	bi_node *pbi_base;	/* base of node space */
16134230Skarels 	/* that cannot possibly be all! */
16234230Skarels };
16334230Skarels 
16434230Skarels /*
16529733Skarels  * Description of a Q-bus configuration.
16629733Skarels  */
16729733Skarels struct qbus {
16829733Skarels 	int	qb_type;		/* type of "unibus adaptor" */
16929733Skarels 	int	qb_memsize;		/* size of (used) memory, pages */
17029733Skarels 	struct	pte *qb_map;		/* base of map registers */
17129733Skarels 	caddr_t	qb_maddr;		/* "unibus" memory address */
17229733Skarels 	caddr_t	qb_iopage;		/* "unibus" IO page address */
17329733Skarels };
17429733Skarels 
175*52628Skarels #ifndef _MTPR_H_
176*52628Skarels #include "mtpr.h"
177*52628Skarels #endif
178*52628Skarels 
1792550Swnj #ifdef KERNEL
1802550Swnj int	cpu;
18134230Skarels #if VAX8800 || VAX8200
18234230Skarels int	mastercpu;		/* if multiple cpus, this identifies master */
18334230Skarels #endif
1843245Swnj struct	percpu percpu[];
18534230Skarels struct	cpuops *cpuops;
1862550Swnj #endif
18730255Ssam 
18830255Ssam /*
18930255Ssam  * Enable realtime clock (always enabled).
19030255Ssam  */
19130255Ssam #define	enablertclock()
19234230Skarels #endif /* LOCORE */
193