xref: /titanic_52/usr/src/uts/sun4u/sys/safari_pcd.h (revision fa9e4066f08beec538e775443c5be79dd423fcab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1999-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_SAFARI_PCD_H
28 #define	_SYS_SAFARI_PCD_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * This file contains definitions of the structure spcd_t, Port Configuration
34  * Descriptor, which is part of the information handed off to OBP and
35  * the OS by POST in the "golden" I/O SRAM.
36  * It is very similar in function to, and borrows heavily from, the spd
37  */
38 
39 #include <sys/types.h>
40 
41 #ifdef	__cplusplus
42 extern "C" {
43 #endif
44 
45 #define	MAX_BANKS_PER_PORT	4	/* Physical and Logical */
46 #define	MAX_DIMMS_PER_PORT	8
47 #define	IOBUS_PER_PORT		2
48 #define	IOCARD_PER_BUS		4
49 #define	LINKS_PER_PORT		5
50 #define	UPADEV_PER_PORT		2
51 #define	AGENTS_PER_PORT		2
52 
53 #define	PCD_VERSION 1
54 #define	PCD_MAGIC ('P'<<24 |'C'<<16 |'D'<<8 | 0)
55 
56 
57 	/* Types of Safari ports */
58 #define	SAFPTYPE_NULL	0
59 #define	SAFPTYPE_CPU	1
60 #define	SAFPTYPE_sPCI	2
61 #define	SAFPTYPE_cPCI	3
62 #define	SAFPTYPE_WCI	4
63 #define	SAFPTYPE_PCIX	5
64 
65 	/*
66 	 * RSV stands for Resource Status Value.
67 	 * These are the values used in all cases where the status of
68 	 * a resource is maintained in a byte element of a structure.
69 	 * These are ordered in terms of preserving interesting information
70 	 * in POST displays where all configurations are displayed in a
71 	 * single value.
72 	 */
73 
74 typedef uint8_t	spcdrsv_t;
75 
76 #define	SPCD_RSV_PASS	0x1		/* Passed some sort of test */
77 #define	SPCD_RSV_FAIL	0xff
78 
79 typedef struct {
80 	uint32_t	spcd_magic;	/* PCD_MAGIC */
81 	uint8_t		spcd_version;	/* structure version: PCD_VERSION */
82 	uint64_t	spcd_ver_reg;	/* port version register */
83 	uint16_t	spcd_afreq;	/* actual operating frequency Mhz */
84 
85 	uint8_t		spcd_ptype;	/* port type. See SAFPTYPE_ below */
86 	uint8_t		spcd_cache;	/* external cache size (MByte?) */
87 	spcdrsv_t	spcd_prsv;	/* The entire port status */
88 	spcdrsv_t	spcd_agent[AGENTS_PER_PORT];
89 	uint16_t	spcd_cpuid[AGENTS_PER_PORT];
90 
91 		/* for ports with UPA device */
92 	spcdrsv_t	spcd_upadev[UPADEV_PER_PORT];
93 
94 		/* for ports with IO buses */
95 	spcdrsv_t	spcd_iobus_rsv[IOBUS_PER_PORT];
96 		/* status of each IO card on port */
97 	spcdrsv_t	spcd_iocard_rsv[IOBUS_PER_PORT][IOCARD_PER_BUS];
98 
99 		/* for ports with WIC links */
100 	spcdrsv_t	spcd_wic_links[LINKS_PER_PORT];
101 		/* status of each WIC link on port */
102 
103 	uint32_t	memory_layout_size;	/* size of memory-layout */
104 	uint8_t		*memory_layout;		/* ptr to memory-layout data */
105 
106 	char		*sprd_bank_rsv[MAX_BANKS_PER_PORT];
107 		/* status of each bank */
108 	char		*sprd_dimm[MAX_DIMMS_PER_PORT];
109 		/* status of each dimm */
110 	char		*sprd_ecache_dimm_label[MAX_DIMMS_PER_PORT];
111 		/* labels for ecache dimms */
112 
113 } spcd_t;
114 
115 #ifdef	__cplusplus
116 }
117 #endif
118 
119 #endif /* _SYS_SAFARI_PCD_H */
120