summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4u/sys/safari_pcd.h
blob: 0b0c0b0c5b677cef26bd63511c4575694b236351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 1999-2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_SAFARI_PCD_H
#define	_SYS_SAFARI_PCD_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

/*
 * This file contains definitions of the structure spcd_t, Port Configuration
 * Descriptor, which is part of the information handed off to OBP and
 * the OS by POST in the "golden" I/O SRAM.
 * It is very similar in function to, and borrows heavily from, the spd
 */

#include <sys/types.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define	MAX_BANKS_PER_PORT	4	/* Physical and Logical */
#define	MAX_DIMMS_PER_PORT	8
#define	IOBUS_PER_PORT		2
#define	IOCARD_PER_BUS		4
#define	LINKS_PER_PORT		5
#define	UPADEV_PER_PORT		2
#define	AGENTS_PER_PORT		2

#define	PCD_VERSION 1
#define	PCD_MAGIC ('P'<<24 |'C'<<16 |'D'<<8 | 0)


	/* Types of Safari ports */
#define	SAFPTYPE_NULL	0
#define	SAFPTYPE_CPU	1
#define	SAFPTYPE_sPCI	2
#define	SAFPTYPE_cPCI	3
#define	SAFPTYPE_WCI	4
#define	SAFPTYPE_PCIX	5

	/*
	 * RSV stands for Resource Status Value.
	 * These are the values used in all cases where the status of
	 * a resource is maintained in a byte element of a structure.
	 * These are ordered in terms of preserving interesting information
	 * in POST displays where all configurations are displayed in a
	 * single value.
	 */

typedef uint8_t	spcdrsv_t;

#define	SPCD_RSV_PASS	0x1		/* Passed some sort of test */
#define	SPCD_RSV_FAIL	0xff

typedef struct {
	uint32_t	spcd_magic;	/* PCD_MAGIC */
	uint8_t		spcd_version;	/* structure version: PCD_VERSION */
	uint64_t	spcd_ver_reg;	/* port version register */
	uint16_t	spcd_afreq;	/* actual operating frequency Mhz */

	uint8_t		spcd_ptype;	/* port type. See SAFPTYPE_ below */
	uint8_t		spcd_cache;	/* external cache size (MByte?) */
	spcdrsv_t	spcd_prsv;	/* The entire port status */
	spcdrsv_t	spcd_agent[AGENTS_PER_PORT];
	uint16_t	spcd_cpuid[AGENTS_PER_PORT];

		/* for ports with UPA device */
	spcdrsv_t	spcd_upadev[UPADEV_PER_PORT];

		/* for ports with IO buses */
	spcdrsv_t	spcd_iobus_rsv[IOBUS_PER_PORT];
		/* status of each IO card on port */
	spcdrsv_t	spcd_iocard_rsv[IOBUS_PER_PORT][IOCARD_PER_BUS];

		/* for ports with WIC links */
	spcdrsv_t	spcd_wic_links[LINKS_PER_PORT];
		/* status of each WIC link on port */

	uint32_t	memory_layout_size;	/* size of memory-layout */
	uint8_t		*memory_layout;		/* ptr to memory-layout data */

	char		*sprd_bank_rsv[MAX_BANKS_PER_PORT];
		/* status of each bank */
	char		*sprd_dimm[MAX_DIMMS_PER_PORT];
		/* status of each dimm */
	char		*sprd_ecache_dimm_label[MAX_DIMMS_PER_PORT];
		/* labels for ecache dimms */

} spcd_t;

#ifdef	__cplusplus
}
#endif

#endif /* _SYS_SAFARI_PCD_H */