blob: b9e057c71d3436a64b3722bde6081f68123d3d2e [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 [
chithragd7e009b2022-03-01 12:20:57 +000091 # raw command, expected output(s)
chithrag0a8c8782022-03-01 12:35:00 +000092 '0x0a 0x49',
93 'rsp=0xd5',
94 'not supported in present state',
95 'rsp=0xc7',
96 'Request data length invalid',
chithragd7e009b2022-03-01 12:20:57 +000097 ],
98 'Clear_SEL':
99 [
100 # raw command, expected output(s)
101 "0x0a 0x47",
102 "0x43 0x4c 0x52 0xaa",
103 "sel clear",
104 "Clearing SEL",
105 "rsp=0xc5",
106 "Reservation cancelled or invalid",
107 "0x43 0x4c 0x52 0x00",
108 ],
109 'SEL_info':
110 [
111 # raw command
112 "0x0a 0x40"
chithrag0a8c8782022-03-01 12:35:00 +0000113 ],
114 'Create_SEL':
115 [
116 # raw command
117 "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x04",
118 "0x00 0xa0 0x04 0x07",
119 ],
chithragd7e009b2022-03-01 12:20:57 +0000120 'Get_SEL_Entry':
121 [
122 # raw command
123 "0x0a 0x43 0x00 0x00",
124 "0x00 0xff",
125 ],
Tony Lee3fdd31e2020-02-15 11:21:40 +0800126 },
127 'Self_Test_Results':
128 {
129 'Get':
130 [
131 # raw command, expected output(s), comment
132 "0x06 0x04",
133 "56 00",
134 "56h = Self Test function not implemented in this controller.",
135 ]
136 },
137 'Device GUID':
138 {
139 'Get':
140 [
141 # raw command, expected output(s), comment
142 "0x06 0x08",
143 "01 70 9b ae da 6f dd 9c b4 4c 36 be 66 c8 49 28",
144 "Get GUID bytes 1 through 16.",
145
146 ]
Tony Leec03c8e22020-03-25 13:41:07 +0800147 },
148 'LAN_Config_Params':
149 {
150 'Get':
151 [
152 # raw command, expected output, comment
153 "0x0c 0x02",
154 "11 02",
155 "11 is Parameter revision, 02 is Configuration parameter data e.g. Cipher Suite Entry count",
chithrag4ad123a2022-04-12 19:26:05 +0000156 ],
157 'Set':
158 [
159 # raw command, expected output, error response
160 "0x0c 0x01",
161 "11 00",
162 "Unknown (0x82)",
163 "Invalid data field in request",
164 ],
Tony Lee6c998f72020-03-09 18:28:35 +0800165 },
166 'Payload':
167 {
168 'Get_Payload_Activation_Status':
169 [
170 # raw command, expected output(s), comment
171 "0x06 0x4a 0x01",
172 "01 00 00",
173 "1st byte is instance capacity, last two bytes is activation status of instances",
174 ],
175 'Activate_Payload':
176 [
177 # raw command, expected output(s), comment
178 "0x06 0x48 0x01 0x01 0xc6 0x00 0x00 0x00",
179 "00 00 00 00 ff 00 ff 00 6f 02 ff ff",
180 "Last two bits are payload vlan number, - FFFFh if VLAN addressing is not used",
181 ],
182 'Deactivate_Payload':
183 [
184 # raw command, expected output(s), comment
185 "0x06 0x49 0x01 0x01 0x00 0x00 0x00 0x00",
186 "",
187 "Line feed only",
188 ],
189 'Get_Payload_Instance_Info':
190 [
191 # raw command, expected output(s), comment
192 "0x06 0x4b 0x01 0x01",
193 "00 00 00 00 00 00 00 00 00 00 00 00",
194 "When the payload is activated, the first four bytes are the session ID,"
195 "otherwise it should be 00."
nagarjunb22a2255de2022-05-25 19:15:10 +0530196 ],
197 'Get_User_Access_Payload':
198 [
199 # raw command,
200 "0x06 0x4d"
201 ],
202 'Set_User_Access_Payload':
203 [
204 # raw command,
205 "0x06 0x4c"
206 ],
nagarjunb2293e6e242022-06-10 21:36:19 +0530207 'Get_Channel_Payload_Version':
208 [
209 # raw command,
210 "0x06 0x4F"
211 ],
212 'Get_Channel_Payload_Support':
213 [
214 # raw command,
215 "0x06 0x4E"
216 ],
Nagarjune94e5402022-01-19 15:26:27 -0500217 },
218 'BIOS_POST_Code':
219 {
220 'Get':
221 [
222 # raw command, expected output, comment
223 "0x30 0xe9",
224 "",
225 "Response bytes will vary in length depending on state of system",
226 "0x89",
227 "error response byte when host is powered off"
228 ]
nagarjunb22cfb2c412022-03-15 15:49:27 +0530229 },
230 'Device ID':
231 {
232 'Get':
233 [
chithrag8a17c492022-03-01 12:53:44 +0000234 # raw command, error response, error code
235 "0x06 0x01",
236 "Error: Unable to establish IPMI v2 / RMCP+ session",
237 "0xc7",
nagarjunb22cfb2c412022-03-15 15:49:27 +0530238 ]
239 },
240 'Cold Reset':
241 {
242 'reset':
243 [
244 # raw command
245 "0x06 0x02"
246 ]
247 },
248 'lan_parameters':
249 {
250 'get_ip':
251 [
252 # raw command
253 "0x0c 0x02 0x01 0x03 0 0"
254 ],
255 'get_ip_src':
256 [
257 # raw command
258 "0x0c 0x02 0x01 0x04 0 0"
259 ],
260 'get_dot1q':
261 [
262 # raw command
263 "0x0c 0x02 0x01 0x14 0 0"
264 ]
265 },
266 'SDR_Info':
267 {
268 'get':
269 [
270 # raw command
271 "0x04 0x20 1"
272 ]
273 },
274 'Chassis_status':
275 {
276 'get':
277 [
278 # raw command
279 "0x00 0x01"
280 ]
281 },
282 'SEL_Info':
283 {
284 'get':
285 [
286 # raw command
287 "0x0a 0x40"
288 ]
289 },
leetde9356e2022-03-23 01:39:29 +0000290 'Watchdog':
291 {
292 # Command action type
293 'Get':
294 [
295 # raw command, expected output(s), comment
296 "0x06 0x25",
297 "05 00 00 00 64 00",
298 "don't log bit enabled",
299 "85 00 00 00 64 00",
300 "don't log bit disabled",
301 "05 00 00 00 64 00",
302 "stop bit stop",
303 "45 00 00 00 64 00",
304 "stop bit resume",
305 "01 00 00 00 64 00",
306 "timer use FRB2",
307 "02 00 00 00 64 00",
308 "timer use POST",
309 "03 00 00 00 64 00",
310 "timer use OS",
311 "04 00 00 00 64 00",
312 "timer use SMS",
313 "05 00 00 00 64 00",
314 "timer use OEM",
315 "05 00 00 00 64 00",
316 "pre-timeout interrupt None",
317 "05 20 00 00 64 00",
318 "pre-timeout interrupt NMI",
319 "05 00 00 00 64 00",
320 "timeout action None",
321 "05 01 00 00 64 00",
322 "timeout action Reset",
323 "05 02 00 00 64 00",
324 "timeout action PowerDown",
325 "05 03 00 00 64 00",
326 "timeout action PowerCycle",
327 "01 00 00 02 00 00",
328 "timeout flag FRB2",
329 "02 00 00 04 00 00",
330 "timeout flag POST",
331 "03 00 00 08 00 00",
332 "timeout flag OS",
333 "04 00 00 10 00 00",
334 "timeout flag SMS",
335 "05 00 00 20 00 00",
336 "timeout flag OEM",
337 "05 00 00 00 30 35 30 35",
338 "Get should return 13.6 seconds",
339 "05 00 00 00 ff ff ff ff",
340 "Bit 6 not set when timer stopped",
341 "0x06 0x25 0x00",
342 "Get with one extra byte",
343 ],
344 'Set':
345 [
346 # raw command, expected output, comment
347 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
348 "none",
349 "don't log bit enabled",
350 "0x06 0x24 0x85 0x00 0x00 0x00 0x64 0x00",
351 "none",
352 "don't log bit disabled",
353 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
354 "none",
355 "stop bit stop",
356 "0x06 0x24 0x45 0x00 0x00 0x00 0x64 0x00",
357 "none",
358 "stop bit resume",
359 "0x06 0x24 0x01 0x00 0x00 0x00 0x64 0x00",
360 "none",
361 "timer use FRB2",
362 "0x06 0x24 0x02 0x00 0x00 0x00 0x64 0x00",
363 "none",
364 "timer use POST",
365 "0x06 0x24 0x03 0x00 0x00 0x00 0x64 0x00",
366 "none",
367 "timer use OS",
368 "0x06 0x24 0x04 0x00 0x00 0x00 0x64 0x00",
369 "none",
370 "timer use SMS",
371 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
372 "none",
373 "timer use OEM",
374 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
375 "none",
376 "pre-timeout interrupt None",
377 "0x06 0x24 0x05 0x20 0x00 0x00 0x64 0x00",
378 "none",
379 "pre-timeout interrupt NMI",
380 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
381 "none",
382 "timeout action None",
383 "0x06 0x24 0x05 0x01 0x00 0x00 0x64 0x00",
384 "none",
385 "timeout action Reset",
386 "0x06 0x24 0x05 0x02 0x00 0x00 0x64 0x00",
387 "none",
388 "timeout action PowerDown",
389 "0x06 0x24 0x05 0x03 0x00 0x00 0x64 0x00",
390 "none",
391 "timeout action PowerCycle",
392 "0x06 0x24 0x01 0x00 0x00 0x3e 0x00 0x00",
393 "none",
394 "timeout flag FRB2",
395 "0x06 0x24 0x02 0x00 0x00 0x3e 0x00 0x00",
396 "none",
397 "timeout flag POST",
398 "0x06 0x24 0x03 0x00 0x00 0x3e 0x00 0x00",
399 "none",
400 "timeout flag OS",
401 "0x06 0x24 0x04 0x00 0x00 0x3e 0x00 0x00",
402 "none",
403 "timeout flag SMS",
404 "0x06 0x24 0x05 0x00 0x00 0x3e 0x00 0x00",
405 "none",
406 "timeout flag OEM",
407 "0x06 0x24 0x01 0x02 0x00 0x00 0x20 0x00",
408 "none",
409 "Power down",
410 "0x06 0x24 0x01 0x01 0x00 0x00 0x20 0x00",
411 "none",
412 "Hard reset",
413 "0x06 0x24 0x01 0x03 0x00 0x00 0x20 0x00",
414 "none",
415 "Power cycle",
416 "0x06 0x24 0x01 0x00 0x00 0x00 0x20 0x00",
417 "none",
418 "No action",
419 "0x06 0x24 0x05 0x00 0x00 0x3e 0x30 0x35",
420 "none",
421 "Set for 13.6 seconds",
422 "0x06 0x24 0x05 0x00 0x07 0x00 0x50 0x00",
423 "none",
424 "Pre-timeout interval passes",
425 "0x06 0x24 0x05 0x00 0x04 0x00 0x0A 0x00",
426 "none",
427 "Pre-timeout interval fails",
428 "0x06 0x24 0x05 0x00 0x00 0x20 0xFF 0xFF",
429 "none",
430 "Bit 6 not set when timer stopped",
431 "0x06 0x24 0x05 0x00 0x08 0x00 0x64",
432 "none",
433 "Set with one less byte",
434 "0x06 0x24 0x05 0x00 0x08 0x00 0x64 0x00 0x00",
435 "none",
436 "Set with one extra byte",
437 ],
438 'Reset':
439 [
440 # raw command, expected output, comment
441 "0x06 0x22",
442 "none",
443 "Reset watchdog timer",
444 "0x06 0x22 0x00",
445 "none",
446 "Reset watchdog timer with extra byte",
447 "0x06 0x22",
448 "none",
449 "Reset watchdog timer without initialized watchdog",
450 ]
chithragdc5679e2022-03-01 11:51:41 +0000451 },
452 'SOL':
453 {
454 'Set_SOL':
455 [
456 # raw command, expected output(s), comment
457 'Invalid value',
458 'Valid values are serial, 9.6 19.2, 38.4, 57.6 and 115.2',
chithrag782ad282022-03-12 10:12:40 +0000459 ]
460 },
461 'Get SDR':
462 {
463 'Get':
464 [
465 # Get SDR raw command without Reservation ID.
466 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff",
467 # Netfunction and cmd.
468 "0x0a 0x23",
469 # Record ID offset and bytes to read.
nagarjunb228ea859e2022-07-12 21:39:51 +0530470 "0x01 0x0f",
chithrag782ad282022-03-12 10:12:40 +0000471 # Raw command To Get SDR Partial without Reservation ID.
472 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f"
chithragdc5679e2022-03-01 11:51:41 +0000473 ],
chithraga6be41e2022-03-01 13:20:23 +0000474 },
475 'Get':
476 {
477 'POH_Counter':
478 [
479 # raw command, error response
480 '0x00 0x0f',
481 'Error: Unable to establish IPMI v2 / RMCP+ session'
482 ]
chithrag782ad282022-03-12 10:12:40 +0000483 },
484 'Device_SDR':
485 {
486 'Get_Info':
487 [
488 # raw command, expected output(s), comment
489 "0x04 0x20 0x00",
490 "0x04 0x20 0x01",
491 "rsp=0xc7",
492 "Request data length invalid",
493 "rsp=0xd4",
494 "Insufficient privilege level",
495 ],
496 'Get':
497 [
498 # raw command, expected output(s), comment
499 "0x04 0x21",
500 "0x00 0x00 0x00 0xff",
501 "rsp=0xc7",
502 "Request data length invalid",
503 ],
504 'Reserve_Repository':
505 [
506 # raw command, expected output(s), comment
507 "0x04 0x22",
508 "rsp=0xc7",
509 "Request data length invalid",
510 "rsp=0xd4",
511 "Insufficient privilege level",
512 "Reservation cancelled or invalid",
513 ]
chithrag015f7872022-03-21 09:42:01 +0000514 },
515 'System_Info':
516 {
517 'param0_Set_In_Progress':
518 {
519 'Get':
520 [
521 # raw command, expected output(s)
522 "0x06 0x59 0x00 0x00 0x00 0x00",
523 "Request data length invalid",
524 ],
525 'Set':
526 [
527 # raw command, expected output(s)
528 "0x06 0x58 0x00 0x00",
529 "Request data length invalid",
530 "Invalid data field in request",
531 ],
532 },
533 'param1_System_Firmware_Version':
534 {
535 'Get':
536 [
537 # raw command, expected output(s)
538 "0x06 0x59 0x00 0x01 0x00 0x00",
539 "Request data length invalid",
540 ],
541 'Set':
542 [
543 # raw command, expected output(s)
544 "0x06 0x58 0x01 0x00 0x00 0x0e",
545 "Invalid data field in request",
546 ],
547 },
548 'param2_System_Name':
549 {
550 'Get':
551 [
552 # raw command, expected output(s)
553 "0x06 0x59 0x00 0x02 0x00 0x00",
554 "Request data length invalid",
555 ],
556 'Set':
557 [
558 # raw command, expected output(s)
559 "0x06 0x58 0x02 0x00 0x00 0x0e",
560 "Invalid data field in request",
561 ],
562 },
563 'param3_Primary_Operating_System_Name':
564 {
565 'Get':
566 [
567 # raw command, expected output(s)
568 "0x06 0x59 0x00 0x03 0x00 0x00",
569 "Request data length invalid",
570 ],
571 'Set':
572 [
573 # raw command, expected output(s)
574 "0x06 0x58 0x03 0x00 0x00 0x0e",
575 "Invalid data field in request",
576 ],
577 },
578 'param4_Operating_System_Name':
579 {
580 'Get':
581 [
582 # raw command, expected output(s)
583 "0x06 0x59 0x00 0x04 0x00 0x00",
584 "Request data length invalid",
585 ],
586 'Set':
587 [
588 # raw command, expected output(s)
589 "0x06 0x58 0x04 0x00 0x00 0x0e",
590 "Invalid data field in request",
591 ],
592 },
593 'param5_Present_OS_Version_number':
594 {
595 'Get':
596 [
597 # raw command, expected output(s)
598 "0x06 0x59 0x00 0x05 0x00 0x00",
599 "Request data length invalid",
600 ],
601 'Set':
602 [
603 # raw command, expected output(s)
604 "0x06 0x58 0x05 0x00 0x00 0x0e",
605 "Invalid data field in request",
606 ]
607 }
nagarjunb2298450742022-04-19 12:00:02 +0530608 },
609 'Get Channel Auth Cap':
610 {
611 'get':
612 [
613 # raw command
614 "0x06 0x38",
615 ]
616 },
nagarjunb227fabf792022-04-19 11:09:29 +0530617 'Cipher Suite':
618 {
619 'get':
620 [
621 # raw command, supported algorithm
622 "0x06 0x54",
623 "03 44 81",
624 # 03 - HMAC-SHA256
625 # 44 - sha256_128
626 # 81 - aes_cbc_128
627 ]
628 },
nagarjunb2287138e62022-04-19 16:49:16 +0530629 'SDR':
630 {
631 'Get':
632 [
633 # Get SDR raw command without Reservation ID.
634 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff",
635 # Netfunction and command.
636 "0x0a 0x23",
637 # Record ID offset and bytes to read.
638 "0x00 0x00 0x01 0x0f",
639 # Raw command To Get SDR Partial without reservation ID.
640 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f"
641 ],
642 'Reserve SDR Repository':
643 [
644 # raw command, expected output(s), comment
645 "0x0a 0x22",
646 ],
647 'SDR Repository Info':
648 [
649 # raw command.
650 "0x0a 0x20",
651 ],
652 'Get SDR allocation Info':
653 [
654 # raw command.
655 "0x0a 0x21"
656 ],
657 'Delete SDR':
658 [
659 # raw command.
660 "0x0a 0x26"
661 ],
662 'Partially Add SDR':
663 [
664 # raw command.
665 "0x0a 0x25"
666 ]
667 },
ganesanbc288aff2022-05-19 19:55:47 +0530668 'FRU':
669 {
670 'Inventory_Area_Info':
671 [
672 # raw command, expected output(s), comment
673 "0x0a 0x10",
674 "Invalid data field in request",
675 "Request data length invalid"
676 ],
677 'Read':
678 [
679 # raw command
680 "0x0a 0x11",
681 ],
682 'Write':
683 [
684 # raw command
685 "0x0a 0x12",
686 ],
687 },
George Keishingd2795d62018-02-04 23:12:23 -0600688}