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
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.
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]
23 * Copyright (c) 1999, 2000 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _MONTECARLO_SYS_MCT_TOPOLOGY_H
28 #define _MONTECARLO_SYS_MCT_TOPOLOGY_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 * MonteCarlo / Tonga topology structures and types for the scsb driver
39 * and its kstat structure "env_topology", to be available to applications
40 * like envmond and snmp agents.
43 * SCB information also defined in scsb.h, which file is not available to
46 #define SCB_P10_NOK_LED_REGS 4
47 #define SCB_P10_OK_LED_REGS 4
48 #define SCB_P10_BLINK_LED_REGS 2
49 #define SCB_P10_LED_REGS 10
50 #define SCB_P15_NOK_LED_REGS 3
51 #define SCB_P15_OK_LED_REGS 3
52 #define SCB_P15_BLINK_LED_REGS 3
53 #define SCB_P15_LED_REGS 9
55 /* Save this existing definition, but use it as the MAX */
56 #define SCSB_LEDDATA_REGISTERS SCB_P10_LED_REGS
58 #define MC_MAX_SLOTS 8 /* CPU, ALRM, cPCI Slots */
69 #define TG_MAX_SLOTS 5 /* CPU, ALRM, cPCI Slots */
81 * Maximum number of FRUs in MCT systems,
82 * used for sizeof fru_id_table[] and index check
84 #define MCT_MAX_FRUS 32
87 * The I2C addresses of System I2C devices
88 * from "MonteCarlo: Programming Interface Specifications" Version 0.9
90 #define MCT_I2C_CPUPWR 0x72
91 #define MCT_I2C_FAN1 0x74
92 #define MCT_I2C_FAN2 0x76
93 #define MCT_I2C_FAN3 0x78
94 #define MCT_I2C_PS1 0x7c
95 #define MCT_I2C_PS2 0x7e
96 #define MCT_I2C_SCB 0x80
97 #define MCT_I2C_CPUTEMP 0x9e
102 #define SCTRL_MPID_MASK 0xf
103 #define SCTRL_MPID_HALF 0x0
104 #define SCTRL_MPID_QUARTER 0x1
105 #define SCTRL_MPID_QUARTER_NODSK 0x3
108 * Interrupt Event Codes
109 * Also used by "scsb" to locate fruid_table index,
110 * so the order is very important.
112 #define SCTRL_EVENT_NONE 0x0000
113 #define SCTRL_EVENT_SLOT1 0x00000001
114 #define SCTRL_EVENT_SLOT2 0x00000002
115 #define SCTRL_EVENT_SLOT3 0x00000004
116 #define SCTRL_EVENT_SLOT4 0x00000008
117 #define SCTRL_EVENT_SLOT5 0x00000010
118 #define SCTRL_EVENT_SLOT6 0x00000020
119 #define SCTRL_EVENT_SLOT7 0x00000040
120 #define SCTRL_EVENT_SLOT8 0x00000080
121 #define SCTRL_EVENT_SLOT9 0x00000100
122 #define SCTRL_EVENT_SLOT10 0x00000200
123 #define SCTRL_EVENT_PDU1 0x00000400
124 #define SCTRL_EVENT_PDU2 0x00000800
125 #define SCTRL_EVENT_PS1 0x00001000
126 #define SCTRL_EVENT_PS2 0x00002000
127 #define SCTRL_EVENT_DISK1 0x00004000
128 #define SCTRL_EVENT_DISK2 0x00008000
129 #define SCTRL_EVENT_DISK3 0x00010000
130 #define SCTRL_EVENT_FAN1 0x00020000
131 #define SCTRL_EVENT_FAN2 0x00040000
132 #define SCTRL_EVENT_FAN3 0x00080000
133 #define SCTRL_EVENT_ALARM 0x00100000
134 #define SCTRL_EVENT_SCB 0x00200000
135 #define SCTRL_EVENT_SSB 0x00400000
136 #define SCTRL_EVENT_CRTM 0x00800000
137 #define SCTRL_EVENT_CFTM 0x01000000
138 #define SCTRL_EVENT_PRTM 0x02000000
139 #define SCTRL_EVENT_PWRDWN 0x04000000
140 #define SCTRL_EVENT_REPLACE 0x08000000
141 #define SCTRL_EVENT_ALARM_INT 0x10000000
142 #define SCTRL_EVENT_ALARM_INSERTION 0x20000000
143 #define SCTRL_EVENT_ALARM_REMOVAL 0x40000000
144 #define SCTRL_EVENT_OTHER 0x80000000
148 typedef uchar_t topo_id_t
;
149 typedef uchar_t fru_id_t
;
150 typedef uint16_t fru_version_t
;
151 typedef uint16_t fru_max_t
;
152 typedef uint16_t scsb_unum_t
;
161 * Known MC/Tg Slot occupants, and UNKN for unknown
162 * NOTE: the CTC occupant is the CFTM FRU type on MonteCarlo
177 } mct_slot_occupant_t
;
194 #define SCSB_UNIT_TYPES 11 /* w/o MIDPLANE */
196 typedef enum scsb_fru_status
{
203 SWAP_NOT
, SWAP_BASIC
, SWAP_FULL
, SWAP_HA
206 typedef struct fru_options
{
208 cpci_swap_type_t swap_type
;
209 struct fru_options
*next
;
212 typedef struct fru_i2c_info
{
221 typedef struct fru_info
{
222 scsb_fru_status_t fru_status
; /* FRU present status */
223 scsb_unum_t fru_unit
; /* FRU external unit number */
224 scsb_utype_t fru_type
; /* also an index to FRU lists */
225 fru_id_t fru_id
; /* I2C address, SCSIID, Slot Num */
226 fru_version_t fru_version
; /* version number where possible */
227 fru_options_t
*type_list
; /* list of possible boards for slots */
228 fru_i2c_info_t
*i2c_info
; /* for I2C devices */
229 struct fru_info
*next
;
233 fru_info_t mid_plane
; /* one always present */
234 fru_max_t max_units
[SCSB_UNIT_TYPES
];
235 fru_info_t
*fru_info_list
[SCSB_UNIT_TYPES
];
241 #define SCSB_KS_LEDDATA "scsb_leddata"
242 #define SCSB_KS_STATE "scsb_state"
243 #define SCSB_KS_EVC_REGISTER "scsb_evc_register"
244 #define SCSB_KS_TOPOLOGY "env_topology"
246 typedef struct ks_fru_info
{
247 scsb_fru_status_t fru_status
; /* FRU presence/availability status */
248 scsb_unum_t fru_unit
; /* FRU external unit number */
249 scsb_utype_t fru_type
; /* and occupant type for solts */
250 fru_id_t fru_id
; /* I2C address, SCSIID, Slot Num */
251 fru_version_t fru_version
; /* version number where possible */
252 fru_health_t fru_health
; /* From NOK LED, if available */
255 typedef union scsb_leddata
{
256 uchar_t scb_led_regs
[SCSB_LEDDATA_REGISTERS
];
259 uchar_t nok_leds
[SCB_P10_NOK_LED_REGS
];
260 uchar_t ok_leds
[SCB_P10_OK_LED_REGS
];
261 uchar_t blink_leds
[SCB_P10_BLINK_LED_REGS
];
264 uchar_t nok_leds
[SCB_P15_NOK_LED_REGS
];
265 uchar_t ok_leds
[SCB_P15_OK_LED_REGS
];
266 uchar_t blink_leds
[SCB_P15_BLINK_LED_REGS
];
272 uint8_t scb_present
; /* SCB is present */
273 uint8_t ssb_present
; /* SSB is present */
274 uint8_t scsb_frozen
; /* SCB swap state */
275 uint8_t scsb_mode
; /* driver access mode */
280 uint32_t event_code
; /* event code bit map */
284 ks_fru_info_t mid_plane
;
285 fru_max_t max_units
[SCSB_UNIT_TYPES
];
286 ks_fru_info_t mct_slots
[MC_MAX_SLOTS
];
287 ks_fru_info_t mct_pdu
[MC_MAX_PDU
];
288 ks_fru_info_t mct_ps
[MC_MAX_PS
];
289 ks_fru_info_t mct_disk
[MC_MAX_DISK
];
290 ks_fru_info_t mct_fan
[MC_MAX_FAN
];
291 ks_fru_info_t mct_scb
[MC_MAX_SCB
];
292 ks_fru_info_t mct_ssb
[MC_MAX_SCB
];
293 ks_fru_info_t mct_alarm
[MC_MAX_AC
];
294 ks_fru_info_t mct_cftm
[MC_MAX_CFTM
];
295 ks_fru_info_t mct_crtm
[MC_MAX_CRTM
];
296 ks_fru_info_t mct_prtm
[MC_MAX_PRTM
];
303 #endif /* _MONTECARLO_SYS_MCT_TOPOLOGY_H */