Sridevi Ramesh | 70e1418 | 2019-08-27 04:04:27 -0500 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | r""" |
| 4 | Contains PLDM-related constants. |
| 5 | """ |
| 6 | |
| 7 | |
| 8 | PLDM_TYPE_BASE = '00' |
| 9 | PLDM_TYPE_PLATFORM = '02' |
| 10 | PLDM_TYPE_BIOS = '03' |
| 11 | PLDM_TYPE_OEM = '3F' |
| 12 | |
| 13 | PLDM_BASE_CMD = { |
| 14 | 'GET_TID': '2', |
| 15 | 'GET_PLDM_VERSION': '3', |
| 16 | 'GET_PLDM_TYPES': '4', |
| 17 | 'GET_PLDM_COMMANDS': '5'} |
| 18 | |
| 19 | PLDM_SUCCESS = '00' |
| 20 | PLDM_ERROR = '01' |
| 21 | PLDM_ERROR_INVALID_DATA = '02' |
| 22 | PLDM_ERROR_INVALID_LENGTH = '03' |
| 23 | PLDM_ERROR_NOT_READY = '04' |
| 24 | PLDM_ERROR_UNSUPPORTED_PLDM_CMD = '05' |
| 25 | PLDM_ERROR_INVALID_PLDM_TYPE = '20' |
| 26 | |
| 27 | BIOS_TABLE_UNAVAILABLE = '83', |
| 28 | INVALID_BIOS_TABLE_DATA_INTEGRITY_CHECK = '84', |
| 29 | INVALID_BIOS_TABLE_TYPE = '85' |
| 30 | |
| 31 | PLDM_BIOS_CMD = { |
| 32 | 'GET_BIOS_TABLE': '01', |
| 33 | 'SET_BIOS_ATTRIBUTE_CURRENT_VALUE': '07', |
| 34 | 'GET_BIOS_ATTRIBUTE_CURRENT_VALUE_BY_HANDLE': '08', |
| 35 | 'GET_DATE_TIME': '0c'} |
| 36 | |
| 37 | PLDM_PLATFORM_CMD = { |
| 38 | 'SET_STATE_EFFECTER_STATES': '39', |
| 39 | 'GET_PDR': '51'} |
| 40 | |
| 41 | PLDM_PDR_TYPES = { |
| 42 | 'STATE_EFFECTER_PDR': '11'} |
| 43 | |
| 44 | # PLDM OEM related variables. |
| 45 | PLDM_FILEIO_CMD = { |
| 46 | 'GET_FILE_TABLE': '1', |
| 47 | 'READ_FILE': '4', |
| 48 | 'WRITE_FILE': '5', |
| 49 | 'READ_FILE_INTO_MEMORY': '6', |
| 50 | 'WRITE_FILE_FROM_MEMORY': '7'} |
| 51 | |
| 52 | PLDM_FILEIO_COMPLETION_CODES = { |
| 53 | 'INVALID_FILE_HANDLE': '80', |
| 54 | 'DATA_OUT_OF_RANGE': '81', |
| 55 | 'INVALID_READ_LENGTH': '82', |
| 56 | 'INVALID_WRITE_LENGTH': '83', |
| 57 | 'FILE_TABLE_UNAVAILABLE': '84', |
| 58 | 'INVALID_FILE_TABLE_TYPE': '85'} |