xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/sn/gda.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
3*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
4*4882a593Smuzhiyun  * for more details.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Derived from IRIX <sys/SN/gda.h>.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
9*4882a593Smuzhiyun  *
10*4882a593Smuzhiyun  * gda.h -- Contains the data structure for the global data area,
11*4882a593Smuzhiyun  *	The GDA contains information communicated between the
12*4882a593Smuzhiyun  *	PROM, SYMMON, and the kernel.
13*4882a593Smuzhiyun  */
14*4882a593Smuzhiyun #ifndef _ASM_SN_GDA_H
15*4882a593Smuzhiyun #define _ASM_SN_GDA_H
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun #include <asm/sn/addrs.h>
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #define GDA_MAGIC	0x58464552
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun /*
22*4882a593Smuzhiyun  * GDA Version History
23*4882a593Smuzhiyun  *
24*4882a593Smuzhiyun  * Version #	| Change
25*4882a593Smuzhiyun  * -------------+-------------------------------------------------------
26*4882a593Smuzhiyun  *	1	| Initial SN0 version
27*4882a593Smuzhiyun  *	2	| Prom sets g_partid field to the partition number. 0 IS
28*4882a593Smuzhiyun  *		| a valid partition #.
29*4882a593Smuzhiyun  */
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #define GDA_VERSION	2	/* Current GDA version # */
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #define G_MAGICOFF	0
34*4882a593Smuzhiyun #define G_VERSIONOFF	4
35*4882a593Smuzhiyun #define G_PROMOPOFF	6
36*4882a593Smuzhiyun #define G_MASTEROFF	8
37*4882a593Smuzhiyun #define G_VDSOFF	12
38*4882a593Smuzhiyun #define G_HKDNORMOFF	16
39*4882a593Smuzhiyun #define G_HKDUTLBOFF	24
40*4882a593Smuzhiyun #define G_HKDXUTLBOFF	32
41*4882a593Smuzhiyun #define G_PARTIDOFF	40
42*4882a593Smuzhiyun #define G_TABLEOFF	128
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun #ifndef __ASSEMBLY__
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun typedef struct gda {
47*4882a593Smuzhiyun 	u32	g_magic;	/* GDA magic number */
48*4882a593Smuzhiyun 	u16	g_version;	/* Version of this structure */
49*4882a593Smuzhiyun 	u16	g_masterid;	/* The NASID:CPUNUM of the master cpu */
50*4882a593Smuzhiyun 	u32	g_promop;	/* Passes requests from the kernel to prom */
51*4882a593Smuzhiyun 	u32	g_vds;		/* Store the virtual dipswitches here */
52*4882a593Smuzhiyun 	void	**g_hooked_norm;/* ptr to pda loc for norm hndlr */
53*4882a593Smuzhiyun 	void	**g_hooked_utlb;/* ptr to pda loc for utlb hndlr */
54*4882a593Smuzhiyun 	void	**g_hooked_xtlb;/* ptr to pda loc for xtlb hndlr */
55*4882a593Smuzhiyun 	int	g_partid;	/* partition id */
56*4882a593Smuzhiyun 	int	g_symmax;	/* Max symbols in name table. */
57*4882a593Smuzhiyun 	void	*g_dbstab;	/* Address of idbg symbol table */
58*4882a593Smuzhiyun 	char	*g_nametab;	/* Address of idbg name table */
59*4882a593Smuzhiyun 	void	*g_ktext_repmask;
60*4882a593Smuzhiyun 				/* Pointer to a mask of nodes with copies
61*4882a593Smuzhiyun 				 * of the kernel. */
62*4882a593Smuzhiyun 	char	g_padding[56];	/* pad out to 128 bytes */
63*4882a593Smuzhiyun 	nasid_t g_nasidtable[MAX_NUMNODES]; /* NASID of each node */
64*4882a593Smuzhiyun } gda_t;
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun #define GDA ((gda_t*) GDA_ADDR(get_nasid()))
67*4882a593Smuzhiyun 
68*4882a593Smuzhiyun #endif /* !__ASSEMBLY__ */
69*4882a593Smuzhiyun /*
70*4882a593Smuzhiyun  * Define:	PART_GDA_VERSION
71*4882a593Smuzhiyun  * Purpose:	Define the minimum version of the GDA required, lower
72*4882a593Smuzhiyun  *		revisions assume GDA is NOT set up, and read partition
73*4882a593Smuzhiyun  *		information from the board info.
74*4882a593Smuzhiyun  */
75*4882a593Smuzhiyun #define PART_GDA_VERSION	2
76*4882a593Smuzhiyun 
77*4882a593Smuzhiyun /*
78*4882a593Smuzhiyun  * The following requests can be sent to the PROM during startup.
79*4882a593Smuzhiyun  */
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun #define PROMOP_MAGIC		0x0ead0000
82*4882a593Smuzhiyun #define PROMOP_MAGIC_MASK	0x0fff0000
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun #define PROMOP_BIST_SHIFT	11
85*4882a593Smuzhiyun #define PROMOP_BIST_MASK	(0x3 << 11)
86*4882a593Smuzhiyun 
87*4882a593Smuzhiyun #define PROMOP_REG		PI_ERR_STACK_ADDR_A
88*4882a593Smuzhiyun 
89*4882a593Smuzhiyun #define PROMOP_INVALID		(PROMOP_MAGIC | 0x00)
90*4882a593Smuzhiyun #define PROMOP_HALT		(PROMOP_MAGIC | 0x10)
91*4882a593Smuzhiyun #define PROMOP_POWERDOWN	(PROMOP_MAGIC | 0x20)
92*4882a593Smuzhiyun #define PROMOP_RESTART		(PROMOP_MAGIC | 0x30)
93*4882a593Smuzhiyun #define PROMOP_REBOOT		(PROMOP_MAGIC | 0x40)
94*4882a593Smuzhiyun #define PROMOP_IMODE		(PROMOP_MAGIC | 0x50)
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun #define PROMOP_CMD_MASK		0x00f0
97*4882a593Smuzhiyun #define PROMOP_OPTIONS_MASK	0xfff0
98*4882a593Smuzhiyun 
99*4882a593Smuzhiyun #define PROMOP_SKIP_DIAGS	0x0100		/* don't bother running diags */
100*4882a593Smuzhiyun #define PROMOP_SKIP_MEMINIT	0x0200		/* don't bother initing memory */
101*4882a593Smuzhiyun #define PROMOP_SKIP_DEVINIT	0x0400		/* don't bother initing devices */
102*4882a593Smuzhiyun #define PROMOP_BIST1		0x0800		/* keep track of which BIST ran */
103*4882a593Smuzhiyun #define PROMOP_BIST2		0x1000		/* keep track of which BIST ran */
104*4882a593Smuzhiyun 
105*4882a593Smuzhiyun #endif /* _ASM_SN_GDA_H */
106