George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
George Keishing | d2795d6 | 2018-02-04 23:12:23 -0600 | [diff] [blame] | 2 | |
| 3 | r""" |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 4 | IPMI raw commands table: |
George Keishing | d2795d6 | 2018-02-04 23:12:23 -0600 | [diff] [blame] | 5 | |
| 6 | - Define IPMI interface index, commands and expected output. |
| 7 | |
| 8 | """ |
| 9 | |
George Keishing | 45511e8 | 2019-10-15 01:26:55 -0500 | [diff] [blame] | 10 | # The currently supported cipher list. |
Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 11 | # Refer: |
| 12 | # openbmc/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipe |
| 13 | # s-phosphor/ipmi/phosphor-ipmi-host/cipher_list.json |
Rahul Maheshwari | 3aeae4e | 2020-04-03 07:45:50 -0500 | [diff] [blame] | 14 | valid_ciphers = ['17'] |
George Keishing | 45511e8 | 2019-10-15 01:26:55 -0500 | [diff] [blame] | 15 | unsupported_ciphers = ['1', '2', '15', '16'] |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 16 | |
George Keishing | d2795d6 | 2018-02-04 23:12:23 -0600 | [diff] [blame] | 17 | IPMI_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 Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 30 | "00 40 02 00", |
| 31 | "40 is scanning enabled and 02 indicates redundancy enabled", |
George Keishing | d2795d6 | 2018-02-04 23:12:23 -0600 | [diff] [blame] | 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 | ], |
Rahul Maheshwari | abe13af | 2018-02-15 22:42:08 -0600 | [diff] [blame] | 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 | ], |
Rahul Maheshwari | 0eb33f0 | 2018-04-10 02:31:54 -0500 | [diff] [blame] | 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 | ] |
Tony Lee | 160aa87 | 2020-02-12 16:11:39 +0800 | [diff] [blame] | 74 | }, |
| 75 | 'SEL_entry': |
| 76 | { |
Tony Lee | 160aa87 | 2020-02-12 16:11:39 +0800 | [diff] [blame] | 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 | ] |
Tony Lee | 3fdd31e | 2020-02-15 11:21:40 +0800 | [diff] [blame] | 84 | }, |
| 85 | 'Self_Test_Results': |
| 86 | { |
| 87 | 'Get': |
| 88 | [ |
| 89 | # raw command, expected output(s), comment |
| 90 | "0x06 0x04", |
| 91 | "56 00", |
| 92 | "56h = Self Test function not implemented in this controller.", |
| 93 | ] |
| 94 | }, |
| 95 | 'Device GUID': |
| 96 | { |
| 97 | 'Get': |
| 98 | [ |
| 99 | # raw command, expected output(s), comment |
| 100 | "0x06 0x08", |
| 101 | "01 70 9b ae da 6f dd 9c b4 4c 36 be 66 c8 49 28", |
| 102 | "Get GUID bytes 1 through 16.", |
| 103 | |
| 104 | ] |
Tony Lee | c03c8e2 | 2020-03-25 13:41:07 +0800 | [diff] [blame] | 105 | }, |
| 106 | 'LAN_Config_Params': |
| 107 | { |
| 108 | 'Get': |
| 109 | [ |
| 110 | # raw command, expected output, comment |
| 111 | "0x0c 0x02", |
| 112 | "11 02", |
| 113 | "11 is Parameter revision, 02 is Configuration parameter data e.g. Cipher Suite Entry count", |
| 114 | ] |
Tony Lee | 6c998f7 | 2020-03-09 18:28:35 +0800 | [diff] [blame] | 115 | }, |
| 116 | 'Payload': |
| 117 | { |
| 118 | 'Get_Payload_Activation_Status': |
| 119 | [ |
| 120 | # raw command, expected output(s), comment |
| 121 | "0x06 0x4a 0x01", |
| 122 | "01 00 00", |
| 123 | "1st byte is instance capacity, last two bytes is activation status of instances", |
| 124 | ], |
| 125 | 'Activate_Payload': |
| 126 | [ |
| 127 | # raw command, expected output(s), comment |
| 128 | "0x06 0x48 0x01 0x01 0xc6 0x00 0x00 0x00", |
| 129 | "00 00 00 00 ff 00 ff 00 6f 02 ff ff", |
| 130 | "Last two bits are payload vlan number, - FFFFh if VLAN addressing is not used", |
| 131 | ], |
| 132 | 'Deactivate_Payload': |
| 133 | [ |
| 134 | # raw command, expected output(s), comment |
| 135 | "0x06 0x49 0x01 0x01 0x00 0x00 0x00 0x00", |
| 136 | "", |
| 137 | "Line feed only", |
| 138 | ], |
| 139 | 'Get_Payload_Instance_Info': |
| 140 | [ |
| 141 | # raw command, expected output(s), comment |
| 142 | "0x06 0x4b 0x01 0x01", |
| 143 | "00 00 00 00 00 00 00 00 00 00 00 00", |
| 144 | "When the payload is activated, the first four bytes are the session ID," |
| 145 | "otherwise it should be 00." |
| 146 | ] |
George Keishing | d2795d6 | 2018-02-04 23:12:23 -0600 | [diff] [blame] | 147 | } |
| 148 | } |