xref: /csrg-svn/sys/vax/include/cpu.h (revision 35044)
123258Smckusick /*
2*35044Skarels  * 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*35044Skarels  *	@(#)cpu.h	7.5 (Berkeley) 07/09/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;
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 {
53*35044Skarels 		u_int	cp_hrev:8,		/* hardware rev level */
54*35044Skarels 			cp_urev:8,		/* ucode rev level */
55*35044Skarels 			:8,
5627250Skridle  			cp_type:8;		/* VAX_630 */
5727250Skridle  	} cpu630;
582550Swnj };
592712Swnj #endif
6026347Skarels /*
6126347Skarels  * Vax CPU types.
6226347Skarels  * Similar types are grouped with their earliest example.
6326347Skarels  */
642550Swnj #define	VAX_780		1
652550Swnj #define	VAX_750		2
666943Ssam #define	VAX_730		3
6734230Skarels #define	VAX_8600	4
6834230Skarels #define	VAX_8200	5
69*35044Skarels #define	VAX_8800	6
7034230Skarels #define	VAX_8500	6	/* same as 8800, 8700 */
7134230Skarels #define	VAX_610		7	/* uVAX I */
7234230Skarels #define	VAX_630		8	/* uVAX II */
732550Swnj 
7427250Skridle #define	VAX_MAX		8
752550Swnj 
7626347Skarels /*
7726347Skarels  * Main IO backplane types.
7826347Skarels  * This gives us a handle on how to do autoconfiguration.
7926347Skarels  */
8026347Skarels #define	IO_SBI780	1
8126347Skarels #define	IO_CMI750	2
8226347Skarels #define	IO_XXX730	3
8326347Skarels #define IO_ABUS		4
8427250Skridle #define IO_QBUS		5
8534230Skarels #define	IO_BI		6
86*35044Skarels #define	IO_NMI		7
8726347Skarels 
882712Swnj #ifndef LOCORE
892550Swnj /*
9034230Skarels  * CPU-dependent operations.
9134230Skarels  */
9234230Skarels struct	clockops {
9334230Skarels 	int	(*clkstartrt)();	/* start real time clock */
9434230Skarels 	int	(*clkread)();		/* set system time from clock */
9534230Skarels 	int	(*clkwrite)();		/* reset clock from system time */
9634230Skarels };
9734230Skarels 
9834230Skarels struct	cpuops {
9934230Skarels 	struct	clockops *cpu_clock;	/* clock operations */
10034230Skarels 	int	(*cpu_memenable)();	/* memory error (CRD intr) enable */
10134230Skarels 	int	(*cpu_memerr)();	/* memory error handler */
10234230Skarels 	int	(*cpu_mchk)();		/* machine check handler */
10334230Skarels 	int	(*cpu_init)();		/* special initialisation, if any */
10434230Skarels };
10534230Skarels 
10634230Skarels /* return values from cpu_mchk */
10734230Skarels #define	MCHK_PANIC	-1
10834230Skarels #define	MCHK_RECOVERED	0
10934230Skarels 
11034230Skarels /*
1112550Swnj  * Per-cpu information for system.
1122550Swnj  */
1132550Swnj struct	percpu {
1143245Swnj 	short	pc_cputype;		/* cpu type code */
11524887Skarels 	short	pc_cpuspeed;		/* relative speed of cpu */
11626347Skarels 	short	pc_nioa;		/* number of IO adaptors/nexus blocks */
11726347Skarels 	struct	iobus *pc_io;		/* descriptions of IO adaptors */
11834230Skarels 	struct	cpuops *pc_ops;		/* per-cpu operations */
11924174Sbloom };
12024174Sbloom 
12129733Skarels /*
12229733Skarels  * Generic description of an I/O "adaptor"
12329733Skarels  * (any top-level I/O bus visible to software
12429733Skarels  * and requiring autoconfiguration).
12529733Skarels  * The remainder of the description
12629733Skarels  * is pointed to by io_details.
12729733Skarels  */
12826347Skarels struct iobus {
12926979Skarels 	int	io_type;		/* io adaptor types */
13026347Skarels 	caddr_t	io_addr;		/* phys address of IO adaptor */
13126347Skarels 	int	io_size;		/* size of an IO space */
13226347Skarels 	caddr_t	io_details;		/* specific to adaptor types */
13326347Skarels };
13426347Skarels 
13526347Skarels /*
13626347Skarels  * Description of a main bus that maps "nexi", ala the 780 SBI.
13726347Skarels  */
13826347Skarels struct nexusconnect {
13924174Sbloom 	short	psb_nnexus;		/* number of nexus slots */
14024174Sbloom 	struct	nexus *psb_nexbase;	/* base of nexus space */
14129733Skarels 	short	psb_ubatype;		/* type of "unibus adaptor" */
14224174Sbloom 	short	psb_nubabdp;		/* number of bdp's per uba */
14334230Skarels 	caddr_t	*psb_umaddr;		/* unibus memory addresses */
1443245Swnj /* the 750 has some slots which don't promise to tell you their types */
1453245Swnj /* if this pointer is non-zero, then you get the type from this array */
1463245Swnj /* rather than from the (much more sensible) low byte of the config register */
14724174Sbloom 	short	*psb_nextype;		/* botch */
1482550Swnj };
1492550Swnj 
15029733Skarels /*
15134230Skarels  * Description of a BI bus configuration.
15234230Skarels  */
15334230Skarels struct bibus {
15434230Skarels 	struct	bi_node *pbi_base;	/* base of node space */
15534230Skarels 	/* that cannot possibly be all! */
15634230Skarels };
15734230Skarels 
15834230Skarels /*
15929733Skarels  * Description of a Q-bus configuration.
16029733Skarels  */
16129733Skarels struct qbus {
16229733Skarels 	int	qb_type;		/* type of "unibus adaptor" */
16329733Skarels 	int	qb_memsize;		/* size of (used) memory, pages */
16429733Skarels 	struct	pte *qb_map;		/* base of map registers */
16529733Skarels 	caddr_t	qb_maddr;		/* "unibus" memory address */
16629733Skarels 	caddr_t	qb_iopage;		/* "unibus" IO page address */
16729733Skarels };
16829733Skarels 
1692550Swnj #ifdef KERNEL
1702550Swnj int	cpu;
17134230Skarels #if VAX8800 || VAX8200
17234230Skarels int	mastercpu;		/* if multiple cpus, this identifies master */
17334230Skarels #endif
1743245Swnj struct	percpu percpu[];
17534230Skarels struct	cpuops *cpuops;
1762550Swnj #endif
17730255Ssam 
17830255Ssam /*
17930255Ssam  * Enable realtime clock (always enabled).
18030255Ssam  */
18130255Ssam #define	enablertclock()
18234230Skarels #endif /* LOCORE */
183