1#!/usr/bin/env python3 2 3r""" 4IPMI raw commands table: 5 6 - Define IPMI interface index, commands and expected output. 7 8""" 9 10# The currently supported cipher list. 11# Refer: 12# openbmc/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipe 13# s-phosphor/ipmi/phosphor-ipmi-host/cipher_list.json 14valid_ciphers = ['17'] 15unsupported_ciphers = ['1', '2', '15', '16'] 16 17IPMI_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", 30 "00 40 02 00", 31 "40 is scanning enabled and 02 indicates redundancy enabled", 32 ], 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 ], 47 }, 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 ], 57 }, 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 ] 74 }, 75 'SEL_entry': 76 { 77 'Reserve': 78 [ 79 # raw command, expected output, comment 80 "0x0a 0x42", 81 "27 00", 82 "27 is Reservation ID, LSB, 00 Reservation ID, MSB ", 83 ], 84 'Get_SEL_Time': 85 [ 86 # raw command 87 '0x0a 0x48', 88 ], 89 'Set_SEL_Time': 90 [ 91 # raw command, expected output(s) 92 '0x0a 0x49', 93 'rsp=0xd5', 94 'not supported in present state', 95 'rsp=0xc7', 96 'Request data length invalid', 97 ], 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" 113 ], 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 ], 120 'Get_SEL_Entry': 121 [ 122 # raw command 123 "0x0a 0x43 0x00 0x00", 124 "0x00 0xff", 125 ], 126 }, 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 ] 147 }, 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", 156 ], 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 ], 165 }, 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." 196 ], 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 ], 207 }, 208 'BIOS_POST_Code': 209 { 210 'Get': 211 [ 212 # raw command, expected output, comment 213 "0x30 0xe9", 214 "", 215 "Response bytes will vary in length depending on state of system", 216 "0x89", 217 "error response byte when host is powered off" 218 ] 219 }, 220 'Device ID': 221 { 222 'Get': 223 [ 224 # raw command, error response, error code 225 "0x06 0x01", 226 "Error: Unable to establish IPMI v2 / RMCP+ session", 227 "0xc7", 228 ] 229 }, 230 'Cold Reset': 231 { 232 'reset': 233 [ 234 # raw command 235 "0x06 0x02" 236 ] 237 }, 238 'lan_parameters': 239 { 240 'get_ip': 241 [ 242 # raw command 243 "0x0c 0x02 0x01 0x03 0 0" 244 ], 245 'get_ip_src': 246 [ 247 # raw command 248 "0x0c 0x02 0x01 0x04 0 0" 249 ], 250 'get_dot1q': 251 [ 252 # raw command 253 "0x0c 0x02 0x01 0x14 0 0" 254 ] 255 }, 256 'SDR_Info': 257 { 258 'get': 259 [ 260 # raw command 261 "0x04 0x20 1" 262 ] 263 }, 264 'Chassis_status': 265 { 266 'get': 267 [ 268 # raw command 269 "0x00 0x01" 270 ] 271 }, 272 'SEL_Info': 273 { 274 'get': 275 [ 276 # raw command 277 "0x0a 0x40" 278 ] 279 }, 280 'Watchdog': 281 { 282 # Command action type 283 'Get': 284 [ 285 # raw command, expected output(s), comment 286 "0x06 0x25", 287 "05 00 00 00 64 00", 288 "don't log bit enabled", 289 "85 00 00 00 64 00", 290 "don't log bit disabled", 291 "05 00 00 00 64 00", 292 "stop bit stop", 293 "45 00 00 00 64 00", 294 "stop bit resume", 295 "01 00 00 00 64 00", 296 "timer use FRB2", 297 "02 00 00 00 64 00", 298 "timer use POST", 299 "03 00 00 00 64 00", 300 "timer use OS", 301 "04 00 00 00 64 00", 302 "timer use SMS", 303 "05 00 00 00 64 00", 304 "timer use OEM", 305 "05 00 00 00 64 00", 306 "pre-timeout interrupt None", 307 "05 20 00 00 64 00", 308 "pre-timeout interrupt NMI", 309 "05 00 00 00 64 00", 310 "timeout action None", 311 "05 01 00 00 64 00", 312 "timeout action Reset", 313 "05 02 00 00 64 00", 314 "timeout action PowerDown", 315 "05 03 00 00 64 00", 316 "timeout action PowerCycle", 317 "01 00 00 02 00 00", 318 "timeout flag FRB2", 319 "02 00 00 04 00 00", 320 "timeout flag POST", 321 "03 00 00 08 00 00", 322 "timeout flag OS", 323 "04 00 00 10 00 00", 324 "timeout flag SMS", 325 "05 00 00 20 00 00", 326 "timeout flag OEM", 327 "05 00 00 00 30 35 30 35", 328 "Get should return 13.6 seconds", 329 "05 00 00 00 ff ff ff ff", 330 "Bit 6 not set when timer stopped", 331 "0x06 0x25 0x00", 332 "Get with one extra byte", 333 ], 334 'Set': 335 [ 336 # raw command, expected output, comment 337 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 338 "none", 339 "don't log bit enabled", 340 "0x06 0x24 0x85 0x00 0x00 0x00 0x64 0x00", 341 "none", 342 "don't log bit disabled", 343 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 344 "none", 345 "stop bit stop", 346 "0x06 0x24 0x45 0x00 0x00 0x00 0x64 0x00", 347 "none", 348 "stop bit resume", 349 "0x06 0x24 0x01 0x00 0x00 0x00 0x64 0x00", 350 "none", 351 "timer use FRB2", 352 "0x06 0x24 0x02 0x00 0x00 0x00 0x64 0x00", 353 "none", 354 "timer use POST", 355 "0x06 0x24 0x03 0x00 0x00 0x00 0x64 0x00", 356 "none", 357 "timer use OS", 358 "0x06 0x24 0x04 0x00 0x00 0x00 0x64 0x00", 359 "none", 360 "timer use SMS", 361 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 362 "none", 363 "timer use OEM", 364 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 365 "none", 366 "pre-timeout interrupt None", 367 "0x06 0x24 0x05 0x20 0x00 0x00 0x64 0x00", 368 "none", 369 "pre-timeout interrupt NMI", 370 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 371 "none", 372 "timeout action None", 373 "0x06 0x24 0x05 0x01 0x00 0x00 0x64 0x00", 374 "none", 375 "timeout action Reset", 376 "0x06 0x24 0x05 0x02 0x00 0x00 0x64 0x00", 377 "none", 378 "timeout action PowerDown", 379 "0x06 0x24 0x05 0x03 0x00 0x00 0x64 0x00", 380 "none", 381 "timeout action PowerCycle", 382 "0x06 0x24 0x01 0x00 0x00 0x3e 0x00 0x00", 383 "none", 384 "timeout flag FRB2", 385 "0x06 0x24 0x02 0x00 0x00 0x3e 0x00 0x00", 386 "none", 387 "timeout flag POST", 388 "0x06 0x24 0x03 0x00 0x00 0x3e 0x00 0x00", 389 "none", 390 "timeout flag OS", 391 "0x06 0x24 0x04 0x00 0x00 0x3e 0x00 0x00", 392 "none", 393 "timeout flag SMS", 394 "0x06 0x24 0x05 0x00 0x00 0x3e 0x00 0x00", 395 "none", 396 "timeout flag OEM", 397 "0x06 0x24 0x01 0x02 0x00 0x00 0x20 0x00", 398 "none", 399 "Power down", 400 "0x06 0x24 0x01 0x01 0x00 0x00 0x20 0x00", 401 "none", 402 "Hard reset", 403 "0x06 0x24 0x01 0x03 0x00 0x00 0x20 0x00", 404 "none", 405 "Power cycle", 406 "0x06 0x24 0x01 0x00 0x00 0x00 0x20 0x00", 407 "none", 408 "No action", 409 "0x06 0x24 0x05 0x00 0x00 0x3e 0x30 0x35", 410 "none", 411 "Set for 13.6 seconds", 412 "0x06 0x24 0x05 0x00 0x07 0x00 0x50 0x00", 413 "none", 414 "Pre-timeout interval passes", 415 "0x06 0x24 0x05 0x00 0x04 0x00 0x0A 0x00", 416 "none", 417 "Pre-timeout interval fails", 418 "0x06 0x24 0x05 0x00 0x00 0x20 0xFF 0xFF", 419 "none", 420 "Bit 6 not set when timer stopped", 421 "0x06 0x24 0x05 0x00 0x08 0x00 0x64", 422 "none", 423 "Set with one less byte", 424 "0x06 0x24 0x05 0x00 0x08 0x00 0x64 0x00 0x00", 425 "none", 426 "Set with one extra byte", 427 ], 428 'Reset': 429 [ 430 # raw command, expected output, comment 431 "0x06 0x22", 432 "none", 433 "Reset watchdog timer", 434 "0x06 0x22 0x00", 435 "none", 436 "Reset watchdog timer with extra byte", 437 "0x06 0x22", 438 "none", 439 "Reset watchdog timer without initialized watchdog", 440 ] 441 }, 442 'SOL': 443 { 444 'Set_SOL': 445 [ 446 # raw command, expected output(s), comment 447 'Invalid value', 448 'Valid values are serial, 9.6 19.2, 38.4, 57.6 and 115.2', 449 ] 450 }, 451 'Get SDR': 452 { 453 'Get': 454 [ 455 # Get SDR raw command without Reservation ID. 456 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff", 457 # Netfunction and cmd. 458 "0x0a 0x23", 459 # Record ID offset and bytes to read. 460 "0x00 0x00 0x01 0x0f", 461 # Raw command To Get SDR Partial without Reservation ID. 462 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f" 463 ], 464 }, 465 'Get': 466 { 467 'POH_Counter': 468 [ 469 # raw command, error response 470 '0x00 0x0f', 471 'Error: Unable to establish IPMI v2 / RMCP+ session' 472 ] 473 }, 474 'Device_SDR': 475 { 476 'Get_Info': 477 [ 478 # raw command, expected output(s), comment 479 "0x04 0x20 0x00", 480 "0x04 0x20 0x01", 481 "rsp=0xc7", 482 "Request data length invalid", 483 "rsp=0xd4", 484 "Insufficient privilege level", 485 ], 486 'Get': 487 [ 488 # raw command, expected output(s), comment 489 "0x04 0x21", 490 "0x00 0x00 0x00 0xff", 491 "rsp=0xc7", 492 "Request data length invalid", 493 ], 494 'Reserve_Repository': 495 [ 496 # raw command, expected output(s), comment 497 "0x04 0x22", 498 "rsp=0xc7", 499 "Request data length invalid", 500 "rsp=0xd4", 501 "Insufficient privilege level", 502 "Reservation cancelled or invalid", 503 ] 504 }, 505 'System_Info': 506 { 507 'param0_Set_In_Progress': 508 { 509 'Get': 510 [ 511 # raw command, expected output(s) 512 "0x06 0x59 0x00 0x00 0x00 0x00", 513 "Request data length invalid", 514 ], 515 'Set': 516 [ 517 # raw command, expected output(s) 518 "0x06 0x58 0x00 0x00", 519 "Request data length invalid", 520 "Invalid data field in request", 521 ], 522 }, 523 'param1_System_Firmware_Version': 524 { 525 'Get': 526 [ 527 # raw command, expected output(s) 528 "0x06 0x59 0x00 0x01 0x00 0x00", 529 "Request data length invalid", 530 ], 531 'Set': 532 [ 533 # raw command, expected output(s) 534 "0x06 0x58 0x01 0x00 0x00 0x0e", 535 "Invalid data field in request", 536 ], 537 }, 538 'param2_System_Name': 539 { 540 'Get': 541 [ 542 # raw command, expected output(s) 543 "0x06 0x59 0x00 0x02 0x00 0x00", 544 "Request data length invalid", 545 ], 546 'Set': 547 [ 548 # raw command, expected output(s) 549 "0x06 0x58 0x02 0x00 0x00 0x0e", 550 "Invalid data field in request", 551 ], 552 }, 553 'param3_Primary_Operating_System_Name': 554 { 555 'Get': 556 [ 557 # raw command, expected output(s) 558 "0x06 0x59 0x00 0x03 0x00 0x00", 559 "Request data length invalid", 560 ], 561 'Set': 562 [ 563 # raw command, expected output(s) 564 "0x06 0x58 0x03 0x00 0x00 0x0e", 565 "Invalid data field in request", 566 ], 567 }, 568 'param4_Operating_System_Name': 569 { 570 'Get': 571 [ 572 # raw command, expected output(s) 573 "0x06 0x59 0x00 0x04 0x00 0x00", 574 "Request data length invalid", 575 ], 576 'Set': 577 [ 578 # raw command, expected output(s) 579 "0x06 0x58 0x04 0x00 0x00 0x0e", 580 "Invalid data field in request", 581 ], 582 }, 583 'param5_Present_OS_Version_number': 584 { 585 'Get': 586 [ 587 # raw command, expected output(s) 588 "0x06 0x59 0x00 0x05 0x00 0x00", 589 "Request data length invalid", 590 ], 591 'Set': 592 [ 593 # raw command, expected output(s) 594 "0x06 0x58 0x05 0x00 0x00 0x0e", 595 "Invalid data field in request", 596 ] 597 } 598 }, 599 'Get Channel Auth Cap': 600 { 601 'get': 602 [ 603 # raw command 604 "0x06 0x38", 605 ] 606 }, 607 'Cipher Suite': 608 { 609 'get': 610 [ 611 # raw command, supported algorithm 612 "0x06 0x54", 613 "03 44 81", 614 # 03 - HMAC-SHA256 615 # 44 - sha256_128 616 # 81 - aes_cbc_128 617 ] 618 }, 619 'SDR': 620 { 621 'Get': 622 [ 623 # Get SDR raw command without Reservation ID. 624 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff", 625 # Netfunction and command. 626 "0x0a 0x23", 627 # Record ID offset and bytes to read. 628 "0x00 0x00 0x01 0x0f", 629 # Raw command To Get SDR Partial without reservation ID. 630 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f" 631 ], 632 'Reserve SDR Repository': 633 [ 634 # raw command, expected output(s), comment 635 "0x0a 0x22", 636 ], 637 'SDR Repository Info': 638 [ 639 # raw command. 640 "0x0a 0x20", 641 ], 642 'Get SDR allocation Info': 643 [ 644 # raw command. 645 "0x0a 0x21" 646 ], 647 'Delete SDR': 648 [ 649 # raw command. 650 "0x0a 0x26" 651 ], 652 'Partially Add SDR': 653 [ 654 # raw command. 655 "0x0a 0x25" 656 ] 657 }, 658} 659