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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
/*
(C) Kontron
*/
#ifndef _IPMI_PICMG_H_
#define _IPMI_PICMG_H_
#include <ipmitool/ipmi.h>
/* PICMG version */
#define PICMG_CPCI_MAJOR_VERSION 1
#define PICMG_ATCA_MAJOR_VERSION 2
#define PICMG_AMC_MAJOR_VERSION 4
/* PICMG commands */
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
#define PICMG_FRU_CONTROL_CMD 0x04
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
#define PICMG_SET_IPMB_CMD 0x09
#define PICMG_SET_FRU_POLICY_CMD 0x0A
#define PICMG_GET_FRU_POLICY_CMD 0x0B
#define PICMG_FRU_ACTIVATION_CMD 0x0C
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
#define PICMG_SET_PORT_STATE_CMD 0x0E
#define PICMG_GET_PORT_STATE_CMD 0x0F
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
#define PICMG_SET_POWER_LEVEL_CMD 0x11
#define PICMG_GET_POWER_LEVEL_CMD 0x12
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
#define PICMG_SET_FAN_LEVEL_CMD 0x15
#define PICMG_GET_FAN_LEVEL_CMD 0x16
#define PICMG_BUSED_RESOURCE_CMD 0x17
/* AMC.0 commands */
#define PICMG_AMC_SET_PORT_STATE_CMD 0x19
#define PICMG_AMC_GET_PORT_STATE_CMD 0x1A
/* AMC.0 R2.0 commands */
#define PICMG_AMC_SET_CLK_STATE_CMD 0x2C
#define PICMG_AMC_GET_CLK_STATE_CMD 0x2D
/* Site Types */
#define PICMG_ATCA_BOARD 0x00
#define PICMG_POWER_ENTRY 0x01
#define PICMG_SHELF_FRU 0x02
#define PICMG_DEDICATED_SHMC 0x03
#define PICMG_FAN_TRAY 0x04
#define PICMG_FAN_FILTER_TRAY 0x05
#define PICMG_ALARM 0x06
#define PICMG_AMC 0x07
#define PICMG_PMC 0x08
#define PICMG_RTM 0x09
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct picmg_set_fru_activation_cmd {
unsigned char picmg_id; /* always 0*/
unsigned char fru_id; /* threshold setting mask */
unsigned char fru_state; /* fru activation/deactivation */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
typedef enum picmg_busres_board_cmd_types {
PICMG_BUSRES_BOARD_CMD_QUERY =0,
PICMG_BUSRES_BOARD_CMD_RELEASE,
PICMG_BUSRES_BOARD_CMD_FORCE,
PICMG_BUSRES_BOARD_CMD_BUS_FREE
} t_picmg_busres_board_cmd_types ;
typedef enum picmg_busres_shmc_cmd_types {
PICMG_BUSRES_SHMC_CMD_REQUEST =0,
PICMG_BUSRES_SHMC_CMD_RELINQUISH,
PICMG_BUSRES_SHMC_CMD_NOTIFY
} t_picmg_busres_shmc_cmd_types ;
typedef enum picmg_busres_resource_id {
PICMG_BUSRES_METAL_TEST_BUS_1=0,
PICMG_BUSRES_METAL_TEST_BUS_2,
PICMG_BUSRES_SYNC_CLOCK_GROUP_1,
PICMG_BUSRES_SYNC_CLOCK_GROUP_2,
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
} t_picmg_busres_resource_id;
/* the LED color capabilities */
static const char* led_color_str[] __attribute__((unused)) = {
"reserved",
"BLUE",
"RED",
"GREEN",
"AMBER",
"ORANGE",
"WHITE",
"reserved"
};
static const char* amc_link_type_str[] __attribute__((unused)) = {
"RESERVED",
"RESERVED1",
"PCI EXPRESS",
"ADVANCED SWITCHING1",
"ADVANCED SWITCHING2",
"ETHERNET",
"RAPIDIO",
"STORAGE",
};
static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = {
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
{
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
{
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
{
"Gen 1 - NSSC",
"Gen 1 - SSC",
"Gen 2 - NSSC",
"Gen 2 - SSC",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
{
"Gen 1 - NSSC",
"Gen 1 - SSC",
"Gen 2 - NSSC",
"Gen 2 - SSC",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
{
"Gen 1 - NSSC",
"Gen 1 - SSC",
"Gen 2 - NSSC",
"Gen 2 - SSC",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
{
"1000BASE-BX (SerDES Gigabit)",
"10GBASE-BX410 Gigabit XAUI",
"", "",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
{
"1.25 Gbaud transmission rate",
"2.5 Gbaud transmission rate",
"3.125 Gbaud transmission rate",
"", "", "", "", "",
"", "", "", "", "", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
{
"Fibre Channel",
"Serial ATA",
"Serial Attached SCSI",
"", "", "", "", "",
"", "", "", "", "", "", "", ""
}
};
struct sAmcPortState {
#ifndef WORDS_BIGENDIAN
unsigned short lane0 : 1;
unsigned short lane1 : 1;
unsigned short lane2 : 1;
unsigned short lane3 : 1;
unsigned short type : 8;
unsigned short type_ext : 4;
unsigned char group_id : 8;
#else
unsigned char group_id : 8;
unsigned short type_ext : 4;
unsigned short type : 8;
unsigned short lane3 : 1;
unsigned short lane2 : 1;
unsigned short lane1 : 1;
unsigned short lane0 : 1;
#endif
unsigned char state;
};
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
uint8_t picmg_discover(struct ipmi_intf *intf);
uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
#endif
|