blob: d6e2d339f78185606fb7a70576a375d2dde87e5f [file] [log] [blame]
George Keishinge7e91712021-09-03 11:28:44 -05001#!/usr/bin/env python3
George Keishingd2795d62018-02-04 23:12:23 -06002
3r"""
George Keishingdcf746b2018-02-06 12:43:44 -06004IPMI raw commands table:
George Keishingd2795d62018-02-04 23:12:23 -06005
6 - Define IPMI interface index, commands and expected output.
7
8"""
9
George Keishing45511e82019-10-15 01:26:55 -050010# The currently supported cipher list.
Joy Onyerikwu004ad3c2018-06-11 16:29:56 -050011# Refer:
12# openbmc/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipe
13# s-phosphor/ipmi/phosphor-ipmi-host/cipher_list.json
Rahul Maheshwari3aeae4e2020-04-03 07:45:50 -050014valid_ciphers = ['17']
George Keishing45511e82019-10-15 01:26:55 -050015unsupported_ciphers = ['1', '2', '15', '16']
George Keishing39967eb2018-04-30 11:36:23 -050016
George Keishingd2795d62018-02-04 23:12:23 -060017IPMI_RAW_CMD = {
18 # Interface name
19 'power_supply_redundancy':
20 {
21 # Command action type
22 'Get':
23 [
24 # raw command, expected output(s), comment
25 "0x04 0x2d 0x0b",
26 "00 00 01 00",
27 "Byte position 3rd LSB e.g. 01 indicates disabled",
28 "00 00 02 00",
29 "Byte position 3rd LSB e.g. 02 indicates enabled",
Steven Sombar27c1ad42018-09-11 14:44:25 -050030 "00 40 02 00",
31 "40 is scanning enabled and 02 indicates redundancy enabled",
George Keishingd2795d62018-02-04 23:12:23 -060032 ],
33 'Enabled':
34 [
35 # raw command, expected output, comment
36 "0x04 0x30 0x0b 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00",
37 "none",
38 "Enabled nibble position 6th LSB e.g. 0x2",
39 ],
40 'Disabled':
41 [
42 # raw command, expected output, comment
43 "0x04 0x30 0x0b 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00",
44 "none",
45 "Enabled nibble position 6th LSB e.g. 0x1",
46 ],
Rahul Maheshwariabe13af2018-02-15 22:42:08 -060047 },
48 'power_reading':
49 {
50 'Get':
51 [
52 # raw command, expected output(s), comment
53 "0x2c 0x02 0xdc 0x01 0x01 0x00",
54 "dc d5 00 d5 00 d5 00 d5 00 00 00 00 00 00 00 00 00 00",
55 "Byte position 2nd LSB e.g. d5 Instantaneous power readings",
56 ],
Rahul Maheshwari0eb33f02018-04-10 02:31:54 -050057 },
58 'conf_param':
59 {
60 'Enabled':
61 [
62 # raw command, expected output, comment
63 "0x2c 0x12 0xdc 0x02 0x00 0x01",
64 "dc",
65 "Enabled nibble position 6th LSB e.g. 0x01",
66 ],
67 'Disabled':
68 [
69 # raw command, expected output, comment
70 "0x2c 0x12 0xdc 0x02 0x00 0x00",
71 "dc",
72 "Disable nibble position 6th LSB e.g. 0x00",
73 ]
Tony Lee160aa872020-02-12 16:11:39 +080074 },
75 'SEL_entry':
76 {
Tony Lee160aa872020-02-12 16:11:39 +080077 'Reserve':
78 [
79 # raw command, expected output, comment
80 "0x0a 0x42",
81 "27 00",
82 "27 is Reservation ID, LSB, 00 Reservation ID, MSB ",
chithrag0a8c8782022-03-01 12:35:00 +000083 ],
84 'Get_SEL_Time':
85 [
86 # raw command
87 '0x0a 0x48',
88 ],
89 'Set_SEL_Time':
90 [
91 # raw command, expected output(s), comment
92 '0x0a 0x49',
93 'rsp=0xd5',
94 'not supported in present state',
95 'rsp=0xc7',
96 'Request data length invalid',
97
98 ],
99 'Create_SEL':
100 [
101 # raw command
102 "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x04",
103 "0x00 0xa0 0x04 0x07",
104 ],
Tony Lee3fdd31e2020-02-15 11:21:40 +0800105 },
106 'Self_Test_Results':
107 {
108 'Get':
109 [
110 # raw command, expected output(s), comment
111 "0x06 0x04",
112 "56 00",
113 "56h = Self Test function not implemented in this controller.",
114 ]
115 },
116 'Device GUID':
117 {
118 'Get':
119 [
120 # raw command, expected output(s), comment
121 "0x06 0x08",
122 "01 70 9b ae da 6f dd 9c b4 4c 36 be 66 c8 49 28",
123 "Get GUID bytes 1 through 16.",
124
125 ]
Tony Leec03c8e22020-03-25 13:41:07 +0800126 },
127 'LAN_Config_Params':
128 {
129 'Get':
130 [
131 # raw command, expected output, comment
132 "0x0c 0x02",
133 "11 02",
134 "11 is Parameter revision, 02 is Configuration parameter data e.g. Cipher Suite Entry count",
chithrag4ad123a2022-04-12 19:26:05 +0000135 ],
136 'Set':
137 [
138 # raw command, expected output, error response
139 "0x0c 0x01",
140 "11 00",
141 "Unknown (0x82)",
142 "Invalid data field in request",
143 ],
Tony Lee6c998f72020-03-09 18:28:35 +0800144 },
145 'Payload':
146 {
147 'Get_Payload_Activation_Status':
148 [
149 # raw command, expected output(s), comment
150 "0x06 0x4a 0x01",
151 "01 00 00",
152 "1st byte is instance capacity, last two bytes is activation status of instances",
153 ],
154 'Activate_Payload':
155 [
156 # raw command, expected output(s), comment
157 "0x06 0x48 0x01 0x01 0xc6 0x00 0x00 0x00",
158 "00 00 00 00 ff 00 ff 00 6f 02 ff ff",
159 "Last two bits are payload vlan number, - FFFFh if VLAN addressing is not used",
160 ],
161 'Deactivate_Payload':
162 [
163 # raw command, expected output(s), comment
164 "0x06 0x49 0x01 0x01 0x00 0x00 0x00 0x00",
165 "",
166 "Line feed only",
167 ],
168 'Get_Payload_Instance_Info':
169 [
170 # raw command, expected output(s), comment
171 "0x06 0x4b 0x01 0x01",
172 "00 00 00 00 00 00 00 00 00 00 00 00",
173 "When the payload is activated, the first four bytes are the session ID,"
174 "otherwise it should be 00."
175 ]
Nagarjune94e5402022-01-19 15:26:27 -0500176 },
177 'BIOS_POST_Code':
178 {
179 'Get':
180 [
181 # raw command, expected output, comment
182 "0x30 0xe9",
183 "",
184 "Response bytes will vary in length depending on state of system",
185 "0x89",
186 "error response byte when host is powered off"
187 ]
nagarjunb22cfb2c412022-03-15 15:49:27 +0530188 },
189 'Device ID':
190 {
191 'Get':
192 [
chithrag8a17c492022-03-01 12:53:44 +0000193 # raw command, error response, error code
194 "0x06 0x01",
195 "Error: Unable to establish IPMI v2 / RMCP+ session",
196 "0xc7",
nagarjunb22cfb2c412022-03-15 15:49:27 +0530197 ]
198 },
199 'Cold Reset':
200 {
201 'reset':
202 [
203 # raw command
204 "0x06 0x02"
205 ]
206 },
207 'lan_parameters':
208 {
209 'get_ip':
210 [
211 # raw command
212 "0x0c 0x02 0x01 0x03 0 0"
213 ],
214 'get_ip_src':
215 [
216 # raw command
217 "0x0c 0x02 0x01 0x04 0 0"
218 ],
219 'get_dot1q':
220 [
221 # raw command
222 "0x0c 0x02 0x01 0x14 0 0"
223 ]
224 },
225 'SDR_Info':
226 {
227 'get':
228 [
229 # raw command
230 "0x04 0x20 1"
231 ]
232 },
233 'Chassis_status':
234 {
235 'get':
236 [
237 # raw command
238 "0x00 0x01"
239 ]
240 },
241 'SEL_Info':
242 {
243 'get':
244 [
245 # raw command
246 "0x0a 0x40"
247 ]
248 },
leetde9356e2022-03-23 01:39:29 +0000249 'Watchdog':
250 {
251 # Command action type
252 'Get':
253 [
254 # raw command, expected output(s), comment
255 "0x06 0x25",
256 "05 00 00 00 64 00",
257 "don't log bit enabled",
258 "85 00 00 00 64 00",
259 "don't log bit disabled",
260 "05 00 00 00 64 00",
261 "stop bit stop",
262 "45 00 00 00 64 00",
263 "stop bit resume",
264 "01 00 00 00 64 00",
265 "timer use FRB2",
266 "02 00 00 00 64 00",
267 "timer use POST",
268 "03 00 00 00 64 00",
269 "timer use OS",
270 "04 00 00 00 64 00",
271 "timer use SMS",
272 "05 00 00 00 64 00",
273 "timer use OEM",
274 "05 00 00 00 64 00",
275 "pre-timeout interrupt None",
276 "05 20 00 00 64 00",
277 "pre-timeout interrupt NMI",
278 "05 00 00 00 64 00",
279 "timeout action None",
280 "05 01 00 00 64 00",
281 "timeout action Reset",
282 "05 02 00 00 64 00",
283 "timeout action PowerDown",
284 "05 03 00 00 64 00",
285 "timeout action PowerCycle",
286 "01 00 00 02 00 00",
287 "timeout flag FRB2",
288 "02 00 00 04 00 00",
289 "timeout flag POST",
290 "03 00 00 08 00 00",
291 "timeout flag OS",
292 "04 00 00 10 00 00",
293 "timeout flag SMS",
294 "05 00 00 20 00 00",
295 "timeout flag OEM",
296 "05 00 00 00 30 35 30 35",
297 "Get should return 13.6 seconds",
298 "05 00 00 00 ff ff ff ff",
299 "Bit 6 not set when timer stopped",
300 "0x06 0x25 0x00",
301 "Get with one extra byte",
302 ],
303 'Set':
304 [
305 # raw command, expected output, comment
306 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
307 "none",
308 "don't log bit enabled",
309 "0x06 0x24 0x85 0x00 0x00 0x00 0x64 0x00",
310 "none",
311 "don't log bit disabled",
312 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
313 "none",
314 "stop bit stop",
315 "0x06 0x24 0x45 0x00 0x00 0x00 0x64 0x00",
316 "none",
317 "stop bit resume",
318 "0x06 0x24 0x01 0x00 0x00 0x00 0x64 0x00",
319 "none",
320 "timer use FRB2",
321 "0x06 0x24 0x02 0x00 0x00 0x00 0x64 0x00",
322 "none",
323 "timer use POST",
324 "0x06 0x24 0x03 0x00 0x00 0x00 0x64 0x00",
325 "none",
326 "timer use OS",
327 "0x06 0x24 0x04 0x00 0x00 0x00 0x64 0x00",
328 "none",
329 "timer use SMS",
330 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
331 "none",
332 "timer use OEM",
333 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
334 "none",
335 "pre-timeout interrupt None",
336 "0x06 0x24 0x05 0x20 0x00 0x00 0x64 0x00",
337 "none",
338 "pre-timeout interrupt NMI",
339 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
340 "none",
341 "timeout action None",
342 "0x06 0x24 0x05 0x01 0x00 0x00 0x64 0x00",
343 "none",
344 "timeout action Reset",
345 "0x06 0x24 0x05 0x02 0x00 0x00 0x64 0x00",
346 "none",
347 "timeout action PowerDown",
348 "0x06 0x24 0x05 0x03 0x00 0x00 0x64 0x00",
349 "none",
350 "timeout action PowerCycle",
351 "0x06 0x24 0x01 0x00 0x00 0x3e 0x00 0x00",
352 "none",
353 "timeout flag FRB2",
354 "0x06 0x24 0x02 0x00 0x00 0x3e 0x00 0x00",
355 "none",
356 "timeout flag POST",
357 "0x06 0x24 0x03 0x00 0x00 0x3e 0x00 0x00",
358 "none",
359 "timeout flag OS",
360 "0x06 0x24 0x04 0x00 0x00 0x3e 0x00 0x00",
361 "none",
362 "timeout flag SMS",
363 "0x06 0x24 0x05 0x00 0x00 0x3e 0x00 0x00",
364 "none",
365 "timeout flag OEM",
366 "0x06 0x24 0x01 0x02 0x00 0x00 0x20 0x00",
367 "none",
368 "Power down",
369 "0x06 0x24 0x01 0x01 0x00 0x00 0x20 0x00",
370 "none",
371 "Hard reset",
372 "0x06 0x24 0x01 0x03 0x00 0x00 0x20 0x00",
373 "none",
374 "Power cycle",
375 "0x06 0x24 0x01 0x00 0x00 0x00 0x20 0x00",
376 "none",
377 "No action",
378 "0x06 0x24 0x05 0x00 0x00 0x3e 0x30 0x35",
379 "none",
380 "Set for 13.6 seconds",
381 "0x06 0x24 0x05 0x00 0x07 0x00 0x50 0x00",
382 "none",
383 "Pre-timeout interval passes",
384 "0x06 0x24 0x05 0x00 0x04 0x00 0x0A 0x00",
385 "none",
386 "Pre-timeout interval fails",
387 "0x06 0x24 0x05 0x00 0x00 0x20 0xFF 0xFF",
388 "none",
389 "Bit 6 not set when timer stopped",
390 "0x06 0x24 0x05 0x00 0x08 0x00 0x64",
391 "none",
392 "Set with one less byte",
393 "0x06 0x24 0x05 0x00 0x08 0x00 0x64 0x00 0x00",
394 "none",
395 "Set with one extra byte",
396 ],
397 'Reset':
398 [
399 # raw command, expected output, comment
400 "0x06 0x22",
401 "none",
402 "Reset watchdog timer",
403 "0x06 0x22 0x00",
404 "none",
405 "Reset watchdog timer with extra byte",
406 "0x06 0x22",
407 "none",
408 "Reset watchdog timer without initialized watchdog",
409 ]
chithragdc5679e2022-03-01 11:51:41 +0000410 },
411 'SOL':
412 {
413 'Set_SOL':
414 [
415 # raw command, expected output(s), comment
416 'Invalid value',
417 'Valid values are serial, 9.6 19.2, 38.4, 57.6 and 115.2',
chithrag782ad282022-03-12 10:12:40 +0000418 ]
419 },
420 'Get SDR':
421 {
422 'Get':
423 [
424 # Get SDR raw command without Reservation ID.
425 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff",
426 # Netfunction and cmd.
427 "0x0a 0x23",
428 # Record ID offset and bytes to read.
429 "0x00 0x00 0x01 0x0f",
430 # Raw command To Get SDR Partial without Reservation ID.
431 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f"
chithragdc5679e2022-03-01 11:51:41 +0000432 ],
chithraga6be41e2022-03-01 13:20:23 +0000433 },
434 'Get':
435 {
436 'POH_Counter':
437 [
438 # raw command, error response
439 '0x00 0x0f',
440 'Error: Unable to establish IPMI v2 / RMCP+ session'
441 ]
chithrag782ad282022-03-12 10:12:40 +0000442 },
443 'Device_SDR':
444 {
445 'Get_Info':
446 [
447 # raw command, expected output(s), comment
448 "0x04 0x20 0x00",
449 "0x04 0x20 0x01",
450 "rsp=0xc7",
451 "Request data length invalid",
452 "rsp=0xd4",
453 "Insufficient privilege level",
454 ],
455 'Get':
456 [
457 # raw command, expected output(s), comment
458 "0x04 0x21",
459 "0x00 0x00 0x00 0xff",
460 "rsp=0xc7",
461 "Request data length invalid",
462 ],
463 'Reserve_Repository':
464 [
465 # raw command, expected output(s), comment
466 "0x04 0x22",
467 "rsp=0xc7",
468 "Request data length invalid",
469 "rsp=0xd4",
470 "Insufficient privilege level",
471 "Reservation cancelled or invalid",
472 ]
chithrag015f7872022-03-21 09:42:01 +0000473 },
474 'System_Info':
475 {
476 'param0_Set_In_Progress':
477 {
478 'Get':
479 [
480 # raw command, expected output(s)
481 "0x06 0x59 0x00 0x00 0x00 0x00",
482 "Request data length invalid",
483 ],
484 'Set':
485 [
486 # raw command, expected output(s)
487 "0x06 0x58 0x00 0x00",
488 "Request data length invalid",
489 "Invalid data field in request",
490 ],
491 },
492 'param1_System_Firmware_Version':
493 {
494 'Get':
495 [
496 # raw command, expected output(s)
497 "0x06 0x59 0x00 0x01 0x00 0x00",
498 "Request data length invalid",
499 ],
500 'Set':
501 [
502 # raw command, expected output(s)
503 "0x06 0x58 0x01 0x00 0x00 0x0e",
504 "Invalid data field in request",
505 ],
506 },
507 'param2_System_Name':
508 {
509 'Get':
510 [
511 # raw command, expected output(s)
512 "0x06 0x59 0x00 0x02 0x00 0x00",
513 "Request data length invalid",
514 ],
515 'Set':
516 [
517 # raw command, expected output(s)
518 "0x06 0x58 0x02 0x00 0x00 0x0e",
519 "Invalid data field in request",
520 ],
521 },
522 'param3_Primary_Operating_System_Name':
523 {
524 'Get':
525 [
526 # raw command, expected output(s)
527 "0x06 0x59 0x00 0x03 0x00 0x00",
528 "Request data length invalid",
529 ],
530 'Set':
531 [
532 # raw command, expected output(s)
533 "0x06 0x58 0x03 0x00 0x00 0x0e",
534 "Invalid data field in request",
535 ],
536 },
537 'param4_Operating_System_Name':
538 {
539 'Get':
540 [
541 # raw command, expected output(s)
542 "0x06 0x59 0x00 0x04 0x00 0x00",
543 "Request data length invalid",
544 ],
545 'Set':
546 [
547 # raw command, expected output(s)
548 "0x06 0x58 0x04 0x00 0x00 0x0e",
549 "Invalid data field in request",
550 ],
551 },
552 'param5_Present_OS_Version_number':
553 {
554 'Get':
555 [
556 # raw command, expected output(s)
557 "0x06 0x59 0x00 0x05 0x00 0x00",
558 "Request data length invalid",
559 ],
560 'Set':
561 [
562 # raw command, expected output(s)
563 "0x06 0x58 0x05 0x00 0x00 0x0e",
564 "Invalid data field in request",
565 ]
566 }
leetde9356e2022-03-23 01:39:29 +0000567 }
George Keishingd2795d62018-02-04 23:12:23 -0600568}