xref: /titanic_51/usr/src/uts/sun4u/starcat/sys/schpc_msg.h (revision bbaa8b60dd95d714741fc474adad3cf710ef4efd)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_SCHPC_MSG_H
28 #define	_SYS_SCHPC_MSG_H
29 
30 /*
31  * This header file describes the messages that are sent between the
32  * schpc Hot Plug Controller Driver running on the domain and the System
33  * Controller.
34  */
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * Format of the Get Slot Status specific part of
42  * PCI Hot Plug message.
43  */
44 typedef struct {
45 	uint16_t	slot_power_on 		:1, /* Slot Power is on */
46 			slot_powergood		:1, /* Slot Power is good */
47 			slot_powerfault		:1, /* Slot Power has faulted */
48 			slot_empty		:1, /* No occupant in slot */
49 			slot_freq_cap		:2, /* Slot's Freq Capability */
50 			slot_freq_setting	:2, /* Slot Freq setting */
51 			slot_condition		:2, /* Condition of slot */
52 			slot_HEALTHY		:1, /* Value of HEALTHY# sig */
53 			slot_ENUM		:1, /* Value of ENUM# sig */
54 			slot_mode_cap		:1, /* Conven or PCI-X */
55 			slot_mode_setting	:1, /* Conven or PCI-X */
56 			reserved		:2;
57 	uint8_t		slot_replystatus;
58 } pci_getslot_t;
59 
60 /*
61  * Format of the Set Slot Status specific part of
62  * PCI Hot Plug message.
63  */
64 typedef struct {
65 	uint16_t	slot_power_on		:1, /* Connect Slot to bus */
66 			slot_power_off		:1, /* Disconnect from bus */
67 			slot_led_power		:2, /* Slot Power LED */
68 			slot_led_service	:2, /* OK To Remove LED */
69 			slot_led_fault		:2, /* Fault LED */
70 			slot_disable_ENUM	:1, /* Disable ENUM Event */
71 			slot_enable_ENUM	:1, /* Enable ENUM Event */
72 			slot_disable_HEALTHY	:1, /* Disable HEALTHY EVENT */
73 			slot_enable_HEALTHY	:1, /* Enable HEALTHY EVENT */
74 			reserved		:4;
75 	uint8_t		slot_replystatus;
76 } pci_setslot_t;
77 
78 /*
79  * Format of the Slot Event specific part of
80  * the PCI Hot Plug message.
81  */
82 typedef struct {
83 	uint16_t	slot_power		:1, /* Slot Power has changed */
84 			slot_presence		:1, /* occupant has been    */
85 						    /* inserted or removed  */
86 			slot_ENUM		:1, /* ENUM# has changed */
87 			slot_HEALTHY		:1, /* HEALTHY# has changed */
88 			slot_powergood		:1, /* Power is good */
89 			slot_powerfault		:1, /* Power has faulted */
90 			reserved		:10;
91 } pci_slotevent_t;
92 
93 /*
94  * PCI Hot Plug message
95  */
96 typedef struct {
97 	uint8_t		pcimsg_node;
98 	uint8_t		pcimsg_board;
99 	uint8_t		pcimsg_slot;
100 	uint8_t		pcimsg_revision;
101 	uint8_t		pcimsg_command;
102 	union {
103 		pci_setslot_t	pcimsg_setslot;
104 		pci_getslot_t	pcimsg_getslot;
105 		pci_slotevent_t	pcimsg_slotevent;
106 	} pcimsg_type;
107 } pcimsg_t;
108 
109 /*
110  * Keys for the outgoing and incoming mailboxes
111  */
112 #define	KEY_PCSC	0x50435343	/* Outgoing Mailbox 'PCSC' */
113 #define	KEY_SCPC	0x53435043	/* Incoming Mailbox 'SCPC' */
114 
115 /*
116  * default timeout in seconds for mboxsc_getmsg calls
117  */
118 #define	PCSC_TIMEOUT	30
119 
120 /* Commands */
121 #define	PCIMSG_GETSLOTSTATUS	0x1
122 #define	PCIMSG_SETSLOTSTATUS	0x2
123 #define	PCIMSG_SLOTEVENT	0x3
124 
125 /* Message Revisions */
126 #define	PCIMSG_REVISION		0x10
127 #define	PCIMSG_REVISION_1_0	0x10
128 
129 /*
130  * Values for the slot_condition field of the get slot status command.
131  */
132 #define	PCIMSG_SLOTCOND_UNKNOWN		0x0
133 #define	PCIMSG_SLOTCOND_GOOD		0x1
134 #define	PCIMSG_SLOTCOND_REC_FAIL	0x2
135 #define	PCIMSG_SLOTCOND_OCC_FAIL	0x3
136 
137 /*
138  * Values for the slot_freq_cap and slot_freq_setting fields of the get
139  * slot status command.
140  */
141 #define	PCIMSG_FREQ_33MHZ	0x0
142 #define	PCIMSG_FREQ_66MHZ	0x1
143 #define	PCIMSG_FREQ_90MHZ	0x2
144 #define	PCIMSG_FREQ_133MHZ	0x3
145 
146 /*
147  * Values for the slot_mode_cap and slot_mode_setting of the get
148  * slot status command.
149  */
150 #define	PCIMSG_MODE_CONVEN	0x0
151 #define	PCIMSG_MODE_PCIX	0x1
152 
153 /*
154  * Values for the PRSNT signals.
155  */
156 #define	PCIMSG_PRSNT_NOADAPTER	0x0
157 #define	PCIMSG_PRSNT_25W	0x1
158 #define	PCIMSG_PRSNT_15W	0x2
159 #define	PCIMSG_PRSNT_7_5W	0x3
160 
161 /*
162  * Values to turn on and off slot characteristics.
163  */
164 #define	PCIMSG_ON		0x1
165 #define	PCIMSG_OFF		0x0
166 
167 /*
168  * Values to set the power, service and fault LEDs
169  */
170 #define	PCIMSG_LED_OFF		0x00
171 #define	PCIMSG_LED_ON		0x01
172 #define	PCIMSG_LED_FLASH	0x02
173 
174 /*
175  * Return values for the slot_replystatus field for the get/set slot status
176  * commands.
177  */
178 #define	PCIMSG_REPLY_GOOD	0x0
179 #define	PCIMSG_REPLY_FAIL	0x1
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* _SYS_SCHPC_MSG_H */
186