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 # Command action type 21 "Get": [ 22 # raw command, expected output(s), comment 23 "0x04 0x2d 0x0b", 24 "00 00 01 00", 25 "Byte position 3rd LSB e.g. 01 indicates disabled", 26 "00 00 02 00", 27 "Byte position 3rd LSB e.g. 02 indicates enabled", 28 "00 40 02 00", 29 "40 is scanning enabled and 02 indicates redundancy enabled", 30 ], 31 "Enabled": [ 32 # raw command, expected output, comment 33 "0x04 0x30 0x0b 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00", 34 "none", 35 "Enabled nibble position 6th LSB e.g. 0x2", 36 ], 37 "Disabled": [ 38 # raw command, expected output, comment 39 "0x04 0x30 0x0b 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00", 40 "none", 41 "Enabled nibble position 6th LSB e.g. 0x1", 42 ], 43 }, 44 "power_reading": { 45 "Get": [ 46 # raw command, expected output(s), comment 47 "0x2c 0x02 0xdc 0x01 0x01 0x00", 48 "dc d5 00 d5 00 d5 00 d5 00 00 00 00 00 00 00 00 00 00", 49 "Byte position 2nd LSB e.g. d5 Instantaneous power readings", 50 ], 51 }, 52 "conf_param": { 53 "Enabled": [ 54 # raw command, expected output, comment 55 "0x2c 0x12 0xdc 0x02 0x00 0x01", 56 "dc", 57 "Enabled nibble position 6th LSB e.g. 0x01", 58 ], 59 "Disabled": [ 60 # raw command, expected output, comment 61 "0x2c 0x12 0xdc 0x02 0x00 0x00", 62 "dc", 63 "Disable nibble position 6th LSB e.g. 0x00", 64 ], 65 }, 66 "SEL_entry": { 67 "Reserve": [ 68 # raw command, expected output, comment 69 "0x0a 0x42", 70 "27 00", 71 "27 is Reservation ID, LSB, 00 Reservation ID, MSB ", 72 ], 73 "Get_SEL_Time": [ 74 # raw command 75 "0x0a 0x48", 76 ], 77 "Set_SEL_Time": [ 78 # raw command, expected output(s) 79 "0x0a 0x49", 80 "rsp=0xd5", 81 "not supported in present state", 82 "rsp=0xc7", 83 "Request data length invalid", 84 ], 85 "Clear_SEL": [ 86 # raw command, expected output(s) 87 "0x0a 0x47", 88 "0x43 0x4c 0x52 0xaa", 89 "sel clear", 90 "Clearing SEL", 91 "rsp=0xc5", 92 "Reservation cancelled or invalid", 93 "0x43 0x4c 0x52 0x00", 94 ], 95 "SEL_info": [ 96 # raw command 97 "0x0a 0x40" 98 ], 99 "Create_SEL": [ 100 # raw command 101 "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x04", 102 "0x00 0xa0 0x04 0x07", 103 ], 104 "Get_SEL_Entry": [ 105 # raw command 106 "0x0a 0x43 0x00 0x00", 107 "0x00 0xff", 108 ], 109 }, 110 "Self_Test_Results": { 111 "Get": [ 112 # raw command, expected output(s), comment 113 "0x06 0x04", 114 "56 00", 115 "56h = Self Test function not implemented in this controller.", 116 ] 117 }, 118 "Device GUID": { 119 "Get": [ 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 }, 126 "LAN_Config_Params": { 127 "Get": [ 128 # raw command, expected output, comment 129 "0x0c 0x02", 130 "11 02", 131 ( 132 "11 is Parameter revision, 02 is Configuration parameter data" 133 " e.g. Cipher Suite Entry count" 134 ), 135 ], 136 "Set": [ 137 # raw command, expected output, error response 138 "0x0c 0x01", 139 "11 00", 140 "Unknown (0x82)", 141 "Invalid data field in request", 142 ], 143 }, 144 "Payload": { 145 "Get_Payload_Activation_Status": [ 146 # raw command, expected output(s), comment 147 "0x06 0x4a 0x01", 148 "01 00 00", 149 ( 150 "1st byte is instance capacity, last two bytes is activation" 151 " status of instances" 152 ), 153 ], 154 "Activate_Payload": [ 155 # raw command, expected output(s), comment 156 "0x06 0x48 0x01 0x01 0xc6 0x00 0x00 0x00", 157 "00 00 00 00 ff 00 ff 00 6f 02 ff ff", 158 ( 159 "Last two bits are payload vlan number, - FFFFh if VLAN" 160 " addressing is not used" 161 ), 162 ], 163 "Deactivate_Payload": [ 164 # raw command, expected output(s), comment 165 "0x06 0x49 0x01 0x01 0x00 0x00 0x00 0x00", 166 "", 167 "Line feed only", 168 ], 169 "Get_Payload_Instance_Info": [ 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 ( 174 "When the payload is activated, the first four bytes are the" 175 " session ID,otherwise it should be 00." 176 ), 177 ], 178 "Get_User_Access_Payload": [ 179 # raw command, 180 "0x06 0x4d" 181 ], 182 "Set_User_Access_Payload": [ 183 # raw command, 184 "0x06 0x4c" 185 ], 186 "Get_Channel_Payload_Version": [ 187 # raw command, 188 "0x06 0x4F" 189 ], 190 "Get_Channel_Payload_Support": [ 191 # raw command, 192 "0x06 0x4E" 193 ], 194 }, 195 "BIOS_POST_Code": { 196 "Get": [ 197 # raw command, expected output, comment 198 "0x30 0xe9", 199 "", 200 "Response bytes will vary in length depending on state of system", 201 "0x89", 202 "error response byte when host is powered off", 203 ] 204 }, 205 "Device ID": { 206 "Get": [ 207 # raw command, error response, error code 208 "0x06 0x01", 209 "Error: Unable to establish IPMI v2 / RMCP+ session", 210 "0xc7", 211 ] 212 }, 213 "Cold Reset": { 214 "reset": [ 215 # raw command 216 "0x06 0x02" 217 ] 218 }, 219 "lan_parameters": { 220 "get_ip": [ 221 # raw command 222 "0x0c 0x02 0x01 0x03 0 0" 223 ], 224 "get_ip_src": [ 225 # raw command 226 "0x0c 0x02 0x01 0x04 0 0" 227 ], 228 "get_dot1q": [ 229 # raw command 230 "0x0c 0x02 0x01 0x14 0 0" 231 ], 232 }, 233 "SDR_Info": { 234 "get": [ 235 # raw command 236 "0x04 0x20 1" 237 ] 238 }, 239 "Chassis_status": { 240 "get": [ 241 # raw command 242 "0x00 0x01" 243 ] 244 }, 245 "SEL_Info": { 246 "get": [ 247 # raw command 248 "0x0a 0x40" 249 ] 250 }, 251 "Watchdog": { 252 # Command action type 253 "Get": [ 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 # raw command, expected output, comment 305 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 306 "none", 307 "don't log bit enabled", 308 "0x06 0x24 0x85 0x00 0x00 0x00 0x64 0x00", 309 "none", 310 "don't log bit disabled", 311 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 312 "none", 313 "stop bit stop", 314 "0x06 0x24 0x45 0x00 0x00 0x00 0x64 0x00", 315 "none", 316 "stop bit resume", 317 "0x06 0x24 0x01 0x00 0x00 0x00 0x64 0x00", 318 "none", 319 "timer use FRB2", 320 "0x06 0x24 0x02 0x00 0x00 0x00 0x64 0x00", 321 "none", 322 "timer use POST", 323 "0x06 0x24 0x03 0x00 0x00 0x00 0x64 0x00", 324 "none", 325 "timer use OS", 326 "0x06 0x24 0x04 0x00 0x00 0x00 0x64 0x00", 327 "none", 328 "timer use SMS", 329 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 330 "none", 331 "timer use OEM", 332 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 333 "none", 334 "pre-timeout interrupt None", 335 "0x06 0x24 0x05 0x20 0x00 0x00 0x64 0x00", 336 "none", 337 "pre-timeout interrupt NMI", 338 "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00", 339 "none", 340 "timeout action None", 341 "0x06 0x24 0x05 0x01 0x00 0x00 0x64 0x00", 342 "none", 343 "timeout action Reset", 344 "0x06 0x24 0x05 0x02 0x00 0x00 0x64 0x00", 345 "none", 346 "timeout action PowerDown", 347 "0x06 0x24 0x05 0x03 0x00 0x00 0x64 0x00", 348 "none", 349 "timeout action PowerCycle", 350 "0x06 0x24 0x01 0x00 0x00 0x3e 0x00 0x00", 351 "none", 352 "timeout flag FRB2", 353 "0x06 0x24 0x02 0x00 0x00 0x3e 0x00 0x00", 354 "none", 355 "timeout flag POST", 356 "0x06 0x24 0x03 0x00 0x00 0x3e 0x00 0x00", 357 "none", 358 "timeout flag OS", 359 "0x06 0x24 0x04 0x00 0x00 0x3e 0x00 0x00", 360 "none", 361 "timeout flag SMS", 362 "0x06 0x24 0x05 0x00 0x00 0x3e 0x00 0x00", 363 "none", 364 "timeout flag OEM", 365 "0x06 0x24 0x01 0x02 0x00 0x00 0x20 0x00", 366 "none", 367 "Power down", 368 "0x06 0x24 0x01 0x01 0x00 0x00 0x20 0x00", 369 "none", 370 "Hard reset", 371 "0x06 0x24 0x01 0x03 0x00 0x00 0x20 0x00", 372 "none", 373 "Power cycle", 374 "0x06 0x24 0x01 0x00 0x00 0x00 0x20 0x00", 375 "none", 376 "No action", 377 "0x06 0x24 0x05 0x00 0x00 0x3e 0x30 0x35", 378 "none", 379 "Set for 13.6 seconds", 380 "0x06 0x24 0x05 0x00 0x07 0x00 0x50 0x00", 381 "none", 382 "Pre-timeout interval passes", 383 "0x06 0x24 0x05 0x00 0x04 0x00 0x0A 0x00", 384 "none", 385 "Pre-timeout interval fails", 386 "0x06 0x24 0x05 0x00 0x00 0x20 0xFF 0xFF", 387 "none", 388 "Bit 6 not set when timer stopped", 389 "0x06 0x24 0x05 0x00 0x08 0x00 0x64", 390 "none", 391 "Set with one less byte", 392 "0x06 0x24 0x05 0x00 0x08 0x00 0x64 0x00 0x00", 393 "none", 394 "Set with one extra byte", 395 ], 396 "Reset": [ 397 # raw command, expected output, comment 398 "0x06 0x22", 399 "none", 400 "Reset watchdog timer", 401 "0x06 0x22 0x00", 402 "none", 403 "Reset watchdog timer with extra byte", 404 "0x06 0x22", 405 "none", 406 "Reset watchdog timer without initialized watchdog", 407 ], 408 }, 409 "SOL": { 410 "Set_SOL": [ 411 # raw command, expected output(s), comment 412 "Invalid value", 413 "Valid values are serial, 9.6 19.2, 38.4, 57.6 and 115.2", 414 ] 415 }, 416 "Get SDR": { 417 "Get": [ 418 # Get SDR raw command without Reservation ID. 419 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff", 420 # Netfunction and cmd. 421 "0x0a 0x23", 422 # Record ID offset and bytes to read. 423 "0x01 0x0f", 424 # Raw command To Get SDR Partial without Reservation ID. 425 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f", 426 ], 427 }, 428 "Get": { 429 "POH_Counter": [ 430 # raw command, error response 431 "0x00 0x0f", 432 "Error: Unable to establish IPMI v2 / RMCP+ session", 433 ] 434 }, 435 "Device_SDR": { 436 "Get_Info": [ 437 # raw command, expected output(s), comment 438 "0x04 0x20 0x00", 439 "0x04 0x20 0x01", 440 "rsp=0xc7", 441 "Request data length invalid", 442 "rsp=0xd4", 443 "Insufficient privilege level", 444 ], 445 "Get": [ 446 # raw command, expected output(s), comment 447 "0x04 0x21", 448 "0x00 0x00 0x00 0xff", 449 "rsp=0xc7", 450 "Request data length invalid", 451 ], 452 "Reserve_Repository": [ 453 # raw command, expected output(s), comment 454 "0x04 0x22", 455 "rsp=0xc7", 456 "Request data length invalid", 457 "rsp=0xd4", 458 "Insufficient privilege level", 459 "Reservation cancelled or invalid", 460 ], 461 }, 462 "System_Info": { 463 "param0_Set_In_Progress": { 464 "Get": [ 465 # raw command, expected output(s) 466 "0x06 0x59 0x00 0x00 0x00 0x00", 467 "Request data length invalid", 468 ], 469 "Set": [ 470 # raw command, expected output(s) 471 "0x06 0x58 0x00", 472 "Request data length invalid", 473 "Invalid data field in request", 474 ], 475 }, 476 "param1_System_Firmware_Version": { 477 "Get": [ 478 # raw command, expected output(s) 479 "0x06 0x59 0x00 0x01 0x00 0x00", 480 "Request data length invalid", 481 ], 482 "Set": [ 483 # raw command, expected output(s) 484 "0x06 0x58 0x01 0x00 0x00 0x0e", 485 "Invalid data field in request", 486 ], 487 }, 488 "param2_System_Name": { 489 "Get": [ 490 # raw command, expected output(s) 491 "0x06 0x59 0x00 0x02 0x00 0x00", 492 "Request data length invalid", 493 ], 494 "Set": [ 495 # raw command, expected output(s) 496 "0x06 0x58 0x02 0x00 0x00 0x0e", 497 "Invalid data field in request", 498 ], 499 }, 500 "param3_Primary_Operating_System_Name": { 501 "Get": [ 502 # raw command, expected output(s) 503 "0x06 0x59 0x00 0x03 0x00 0x00", 504 "Request data length invalid", 505 ], 506 "Set": [ 507 # raw command, expected output(s) 508 "0x06 0x58 0x03 0x00 0x00 0x0e", 509 "Invalid data field in request", 510 ], 511 }, 512 "param4_Operating_System_Name": { 513 "Get": [ 514 # raw command, expected output(s) 515 "0x06 0x59 0x00 0x04 0x00 0x00", 516 "Request data length invalid", 517 ], 518 "Set": [ 519 # raw command, expected output(s) 520 "0x06 0x58 0x04 0x00 0x00 0x0e", 521 "Invalid data field in request", 522 ], 523 }, 524 "param5_Present_OS_Version_number": { 525 "Get": [ 526 # raw command, expected output(s) 527 "0x06 0x59 0x00 0x05 0x00 0x00", 528 "Request data length invalid", 529 ], 530 "Set": [ 531 # raw command, expected output(s) 532 "0x06 0x58 0x05 0x00 0x00 0x0e", 533 "Invalid data field in request", 534 ], 535 }, 536 }, 537 "Get Channel Auth Cap": { 538 "get": [ 539 # raw command 540 "0x06 0x38", 541 ] 542 }, 543 "Cipher Suite": { 544 "get": [ 545 # raw command, supported algorithm 546 "0x06 0x54", 547 "03 44 81", 548 # 03 - HMAC-SHA256 549 # 44 - sha256_128 550 # 81 - aes_cbc_128 551 ] 552 }, 553 "SDR": { 554 "Get": [ 555 # Get SDR raw command without Reservation ID. 556 "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff", 557 # Netfunction and command. 558 "0x0a 0x23", 559 # Record ID offset and bytes to read. 560 "0x00 0x00 0x01 0x0f", 561 # Raw command To Get SDR Partial without reservation ID. 562 "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f", 563 ], 564 "Reserve SDR Repository": [ 565 # raw command, expected output(s), comment 566 "0x0a 0x22", 567 ], 568 "SDR Repository Info": [ 569 # raw command. 570 "0x0a 0x20", 571 ], 572 "Get SDR allocation Info": [ 573 # raw command. 574 "0x0a 0x21" 575 ], 576 "Delete SDR": [ 577 # raw command. 578 "0x0a 0x26" 579 ], 580 "Partially Add SDR": [ 581 # raw command. 582 "0x0a 0x25" 583 ], 584 }, 585 "FRU": { 586 "Inventory_Area_Info": [ 587 # raw command, expected output(s), comment 588 "0x0a 0x10", 589 "Invalid data field in request", 590 "Request data length invalid", 591 ], 592 "Read": [ 593 # raw command 594 "0x0a 0x11", 595 ], 596 "Write": [ 597 # raw command 598 "0x0a 0x12", 599 ], 600 }, 601} 602