annotate usr/src/lib/fm/topo/modules/SUNW,SPARC-Enterprise/ioboard/opl_topo.h @ 3942:c202da1d3c1c

6513538 Need to update ON dictionaries for faults that go from SP to Solaris 6536564 Oberon bus addresses seem to have changed from decimal to hex, breaks IO FMA
author hueston
date Sat, 31 Mar 2007 20:04:53 -0700
parents 46d280f5351d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
1 /*
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
2 * CDDL HEADER START
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
3 *
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
5 * Common Development and Distribution License (the "License").
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
6 * You may not use this file except in compliance with the License.
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
7 *
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
10 * See the License for the specific language governing permissions
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
11 * and limitations under the License.
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
12 *
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
18 *
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
19 * CDDL HEADER END
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
20 */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
21
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
22 /*
3942
c202da1d3c1c 6513538 Need to update ON dictionaries for faults that go from SP to Solaris
hueston
parents: 3062
diff changeset
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
24 * Use is subject to license terms.
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
25 */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
26
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
27 #ifndef _OPL_TOPO_H
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
28 #define _OPL_TOPO_H
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
29
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
30 #pragma ident "%Z%%M% %I% %E% SMI"
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
31
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 2499
diff changeset
32 #include <fm/topo_hc.h>
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 2499
diff changeset
33 #include <fm/topo_mod.h>
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 2499
diff changeset
34
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
35 #ifdef __cplusplus
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
36 extern "C" {
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
37 #endif
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
38
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 2499
diff changeset
39 #define PCI_BUS_VERS 1
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
40
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
41 /*
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
42 * OPL uses the Jupiter Bus Bindings (see FWARC/2005/076) which specifies
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
43 * the hostbridge port id (the part of the bus address before the comma) as
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
44 * [10:9] = 00
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
45 * [8] = LSB_ID[4] = 0
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
46 * [7:4] = LSB_ID[3:0]
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
47 * [3] = IO_Channel#[2] = 0
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
48 * [2:1] = IO_Channel#[1:0]
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
49 * [0] = PCI Leaf Number (0=leaf-A, 1=leaf-B)
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
50 * where the LSB_ID is the logical system board, the IO_Channel is the
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
51 * hostbridge, and the PCI leaf is the root complex. The definitions
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
52 * allow up to 32 system boards, 8 hostbridges per system board, and
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
53 * two root complexes per hostbridge.
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
54 */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
55
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
56 /* Common OPL limits */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
57 #define OPL_IOB_MAX 32 /* Max 32 IOBs per machine */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
58 #define OPL_HB_MAX 8 /* Max 8 hostbridges per IOB */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
59 #define OPL_RC_MAX 2 /* Max 2 root complexes per hostbridge */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
60 #define OPL_BUS_MAX 4 /* Max PCI-Ex buses under root complex */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
61
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
62 /* Macros for manipulating px driver bus address. */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
63 #define OPL_PX_DRV "px" /* Oberon driver name */
3942
c202da1d3c1c 6513538 Need to update ON dictionaries for faults that go from SP to Solaris
hueston
parents: 3062
diff changeset
64 #define OPL_PX_STR2BA(s) strtol(s, NULL, 16) /* Convert ba string to int */
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
65 #define OPL_PX_LSB(a) (((a) >> 4) & 0x1f) /* Extract board from ba */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
66 #define OPL_PX_HB(a) (((a) >> 1) & 0x07) /* Extract hb from ba */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
67 #define OPL_PX_RC(a) ((a) & 0x01) /* Extract rc from ba */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
68 #define OPL_SLOT_NAMES "slot-names" /* Slot name property */
2499
685e75c0930b 6444116 fmd dumped core during DR in Sol11
hueston
parents: 1898
diff changeset
69 #define OPL_PX_DEVTYPE "pciex" /* Oberon is PCI-Ex devtype */
685e75c0930b 6444116 fmd dumped core during DR in Sol11
hueston
parents: 1898
diff changeset
70 #define OPL_PX_BDF "0x08" /* BDF is always 0/1/0 */
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
71
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
72 /* Macros for manipulating mc-opl driver bus address. */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
73 #define OPL_MC_DRV "mc-opl" /* Driver name */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
74 #define OPL_MC_STR2BA(s) strtol(s, NULL, 16) /* Convert ba string to int */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
75 #define OPL_MC_LSB(a) (((a) >> 4) & 0x1f) /* Extract board from ba */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
76 #define OPL_PHYSICAL_BD "physical-board#" /* Physical board for the mc */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
77
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
78 /* Structure listing devices on an ioboard */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
79 typedef struct {
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
80 int count;
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
81 di_node_t rcs[OPL_HB_MAX][OPL_RC_MAX];
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
82 } ioboard_contents_t;
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
83
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
84 /* Shared device tree root node */
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
85 int opl_hb_enum(topo_mod_t *mp, const ioboard_contents_t *iob,
3062
46d280f5351d 6396916 verification of dtd file name is wrong
cindi
parents: 2499
diff changeset
86 tnode_t *parent, int brd);
1898
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
87
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
88 #ifdef __cplusplus
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
89 }
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
90 #endif
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
91
b6c22f4eb364 6393267 Need a libtopo enumerator for OPL
hueston
parents:
diff changeset
92 #endif /* _OPL_TOPO_H */