/** ******************************************************************************* * * @file cfg_data.h * @authors fatih.bellachia@lapp.in2p3.fr * @date 30/09/2015 * @version v0r1 * @brief Example of SDR structures. * * The IPMC needs the following information to identify sensor: * - Channel ID * The channel IDs are defined in channel/channel.h * . CHANNEL_I2C_MGT (managed by IPMC) * . CHANNEL_I2C_SENSOR (managed by IPMC) * . CHANNEL_I2C_USER_IO * . CHANNEL_I2C_IPM_IO * * Sensor Record * set BYTE 7 [4:7] channel_num * * - Sensor Number * Unique number identifying the sensor * * Sensor Record * set BYTE 8 [0:7] sensor_number * * - I2C address of sensor * * Compact Sensor Record * set BYTE 31 [0:7] OEM - Reserved for OEM use * * Full Sensor Record * set BYTE 47 [0:7] OEM - Reserved for OEM use * ******************************************************************************* */ /* Includes ------------------------------------------------------------------*/ #include #include // User's header file with specific defines #include "cfg_data.h" // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // MANDATORY records // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // ============================================================================ // Management Controller Device Locator record // Should be the first registered into the SDR database // ============================================================================ #define SDR1_ID_STR_LEN 7 MGMTCtrlDeviceLocatorRecord_t sdr_mgmt_ctrl_locator = { // MANDATORY LF 20110511 /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 Version of the Sensor Model MGMT_CTRL_DEVICE_LOCATOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(MGMTCtrlDeviceLocatorRecord_t, SDR1_ID_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] reserved - set as 0b 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 Channel Number // [7:4] - reserved (NOT IMPLEMENTED, only bits 0:3 specified as a whole byte) 0, // [3:0] - Channel number for the channel that the management controller is on. // Use 0h for the primary BMC. (New byte for IPMI v1.5. Note this // addition causes some of the following byte offsets to be pushed down // when compared to the IPMI v1.0 version of this record.) // BYTE 8 Power State Notification, Global Initialization 0, // [0:1] ctrl_init 0, // [2] log_init_agent_errs - 1b = Log Initialization Agent errors 0, // [3] ctrl_logs_init_errs - 1b = Controller logs Initialization 0, // [4] reserved 0, // [5] reserved 0, // [6] acpi_dev_pwr_st_notify_req - 0b = no ACPI Device Power State notification required 0, // [7] acpi_sys_pwr_st_notify_req - 0b = no ACPI System Power State notification required ADD_DEV_SUPPORT, // 9 - device capabilities - see arch.h { 0, 0, 0 }, // 10-12 - reserved PICMG_ENTITY_FRONT_BOARD, // 13 - entity_id - see PICMG 3.0 $3.4.3.1 ENTITY_0_INSTANCE, // 14 - entity_instance 0, // 15 - reserved for OEM use // BYTE 16 SDR1_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 17+ Sensor ID String bytes { 'F', 'E', 'X', '-', 'H', 'u', 'b' } // device id string }; // ============================================================================ // Hot-Swap sensor device record // ============================================================================ #define HOTSWAP0_ID_STR_LEN 8 CompactSensorRecord_t sdr_hotswap0 = { // MANDATORY LF 20110511 /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model COMPACT_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(CompactSensorRecord_t, HOTSWAP0_ID_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved 0, // [4:7] ch_num SDR_NUM_HOTSWAP0, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] reserved - write as 0b 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 0, // [0:1] event_msg_control 0, // [2:3] sensor_threshold_access 0, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 0, // [7] ignore_sensor ST_HOT_SWAP, // 13 sensor_type = 0xF0 - Board Hot Swap sensor EVT_TYPE_CODE_SENSOR_SPECIFIC, // 14 event_type_code 0xFF, 0x7F, // 15,16 assertion event mask, LSB first 0xFF, 0x7F, // 17,18 deassertion event mask, LSB first 0xFF, 0xFF, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 3, // [6:7] reserved - write as 11b 0, // 22 - sensor_units2 0, // 23 - sensor_units3 // BYTE 24 0, // [0:3] share_count 0, // [4:5] id_str_mod_type - 00b = numeric 0, // [6:7] sensor_direction - 00b = unspecified / not applicable // BYTE 25 0, // [0:6] id_str_mod_offset - ID String Instance Modifier Offset 0, // [7] entity_inst_same - 0b = Entity Instance same for all shared records 0, // 26 positive_hysteresis 0, // 27 negative_hysteresis { 0, 0, 0 }, // 28-30 reserved. Write as 00h 0, // 31 reserved for OEM use // BYTE 32 HOTSWAP0_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 33+ Sensor ID String bytes { 'H', 'o', 't', ' ', 'S', 'w', 'a', 'p' } }; // sdr_hotswap0 // ============================================================================ // Physical IPMB-0 sensor record - PICMG section 3.8.4.1 // ============================================================================ #define SDR2_ID_STR_LEN 15 CompactSensorRecord_t sdr_ipmb0 = { // MANDATORY LF 20110511 /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model COMPACT_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(CompactSensorRecord_t, SDR2_ID_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved 0, // [4:7] ch_num SDR_NUM_IPMB0, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] reserved - write as 0b 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 0, // [0:1] event_msg_control 0, // [2:3] sensor_threshold_access 0, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 0, // [7] ignore_sensor ST_IPMB_0, // 13 sensor_type EVT_TYPE_CODE_SENSOR_SPECIFIC, // 14 event_type_code 0x00, 0x00, // 15,16 assertion event mask, LSB first 0x00, 0x00, // 17,18 deassertion event mask, LSB first 0x00, 0x00, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 3, // [6:7] reserved - write as 11b 0, // 22 sensor_units2 0, // 23 sensor_units3 // BYTE 24 0, // [0:3] share_count 0, // [4:5] id_str_mod_type - 00b = numeric 0, // [6:7] sensor_direction - 00b = unspecified / not applicable // BYTE 25 0, // [0:6] id_str_mod_offset - ID String Instance Modifier Offset 0, // [7] entity_inst_same - 0b = Entity Instance same for all shared records 0, // 26 positive_hysteresis 0, // 27 negative_hysteresis { 0, 0, 0 }, // 28-30 reserved. Write as 00h 0, // 31 oem - Reserved for OEM use // BYTE 32 SDR2_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 33+ Sensor ID String bytes { 'I', 'P', 'M', 'B', '-', '0', ' ', 'P', 'h', 'y', 's', 'i', 'c', 'a', 'l' } // sensor id string }; // ============================================================================ // Payload switch sensor record // ============================================================================ #define POWER_CONVERTER0_ID_STR_LEN 14 CompactSensorRecord_t sdr_power_converter0 = { /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model COMPACT_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(CompactSensorRecord_t, POWER_CONVERTER0_ID_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved 0, // [4:7] ch_num SDR_NUM_POWER_FRU0, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] reserved - write as 0b 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 3, // [0:1] event_msg_control 0, // [2:3] sensor_threshold_access 0, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 1, // [7] ignore_sensor ST_POWER_SUPPLY, // 13 sensor_type = 08h - power converter 0x00, // 14 event_type_code - see table 42.1 0x00, 0x00, // 15,16 assertion event mask, LSB first 0x00, 0x00, // 17,18 deassertion event mask, LSB first 0x00, 0x00, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 0, // [6:7] Analog (numeric) Data Format 0, // 22 sensor_units2 0, // 23 sensor_units3 // BYTE 24 0, // [0:3] share_count 0, // [4:5] id_str_mod_type - 00b = numeric 0, // [6:7] sensor_direction - 00b = unspecified / not applicable // BYTE 25 0, // [0:6] id_str_mod_offset - ID String Instance Modifier Offset 0, // [7] entity_inst_same - 0b = Entity Instance same for all shared records 0, // 26 positive_hysteresis 0, // 27 negative_hysteresis { 0, 0, 0 }, // 28-30 reserved. Write as 00h 0, // 31 reserved for OEM use // BYTE 32 POWER_CONVERTER0_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 33+ Sensor ID String bytes { 'P', 'a', 'y', 'l', 'o', 'a', 'd', ' ', 'S', 'w', 'i', 't', 'c', 'h' } }; // ============================================================================ // FRU device locator record // ============================================================================ #define SDR7_ID_STR_LEN 12 FRUDeviceLocatorRecord_t fru_device_locator1 = { /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model FRU_DEVICE_LOCATOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(FRUDeviceLocatorRecord_t, SDR7_ID_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 Device Access Address 0, // [0] - reserved 0, // [1:7] - Slave address of management controller used to access device. // 0000000b if device is directly on IPMB. // **** filled during init with hardware address /2 **** // BYTE 7 FRU device ID / device slave address // FOR LOGICAL FRU DEVICE (accessed via FRU commands to mgmt. controller): 1, // [0:7] - Number identifying FRU device within given IPM Controller. FFh = reserved. // The primary FRU device for a management controller is always device #0 at // LUN 00b. The primary FRU device is not reported via this FRU Device Locator // record - its presence is identified via the Device Capabilities field in the // Management Controller Device Locator record. // FOR NON-INTELLIGENT FRU DEVICE: // [0] - reserved // [1:7] - 7-bit I2C Slave Address[1] .This is relative to the bus the device is on. // For devices on the IPMB, this is the slave address of the device on the // IPMB. For devices on a private bus, this is the slave address of the device // on the private bus. // [0] - Channel Number ms-bit (For IPMI 1.5. This bit was reserved for IPMI v1.0). // [1:7] - 7-bit I2C Slave Address[1] .This is relative to the bus the device // is on. For devices on the IPMB, this is the slave address of the device // on the IPMB. For devices on a private bus, this is the slave address of // the device on the private bus. // BYTE 8 Logical-Physical / Access LUN / Bus ID 0, // [0:2] - Private bus ID if bus = Private. 000b if device directly on IPMB, or // device is a logical FRU Device. 0, // [3:4] - LUN for Master Write-Read command or FRU Command. 00b if device is a // nonintelligent device directly on IPMB. 0, // [5:6] - reserved. 1, // [7] - logical/physical FRU device // 0b = device is not a logical FRU Device // 1b = device is logical FRU Device (accessed via FRU commands to mgmt.ctrller) // BYTE 9 Channel Number 0, // [0:3] - reserved 0, // [4:7] - Channel number for management controller used to access device. 0000b if // device directly on the primary IPMB, or if controller is on the primary // IPMB. MSBit for channel number is kept in next byte. (For IPMI v1.5. This // byte position was reserved for IPMI v1.0.) /* RECORD BODY BYTES */ 0, // 10 reserved // 11 Device Type, 10h for Logical FRU Device. DTC_FRU_INVENTORY_DEVICE, // See Table 43-12, IPMB/I2C Device Type Codes. // 12 Device Type Modifier DTCM_FRU_INVENTORY_OLD, // See Table 43-12, IPMB/I2C Device Type Codes. PICMG_ENTITY_SHELF_FRU_INFO, // 13 FRU Entity ID // Entity ID for the device associated with this FRU information. ENTITY_1_INSTANCE, // 14 FRU Entity Instance // Instance number for entity. 0, // 15 reserved for OEM use. // 16 ID String Type/Length Code SDR7_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 33+ Sensor ID String bytes { 'M', 'S', 'U', ' ', 'S', 'h', 'e', 'l', 'f', 'F', 'R', 'U' } }; // ============================================================================ // Hot-Swap sensor device record // ============================================================================ #define HOTSWAP1_ID_STR_LEN 16 CompactSensorRecord_t sdr_hotswap1 = { // MANDATORY for each FRU /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model COMPACT_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(CompactSensorRecord_t, HOTSWAP1_ID_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved 0, // [4:7] ch_num SDR_NUM_HOTSWAP1, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_1_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] reserved - write as 0b 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 0, // [0:1] event_msg_control 0, // [2:3] sensor_threshold_access 0, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 0, // [7] ignore_sensor ST_HOT_SWAP, // 13 sensor_type = 0xF0 - Board Hot Swap sensor EVT_TYPE_CODE_SENSOR_SPECIFIC, // 14 event_type_code 0xFF, 0x7F, // 15,16 assertion event mask, LSB first 0xFF, 0x7F, // 17,18 deassertion event mask, LSB first 0xFF, 0xFF, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 3, // [6:7] reserved - write as 11b 0, // 22 - sensor_units2 0, // 23 - sensor_units3 // BYTE 24 0, // [0:3] share_count 0, // [4:5] id_str_mod_type - 00b = numeric 0, // [6:7] sensor_direction - 00b = unspecified / not applicable // BYTE 25 0, // [0:6] id_str_mod_offset - ID String Instance Modifier Offset 0, // [7] entity_inst_same - 0b = Entity Instance same for all shared records 0, // 26 positive_hysteresis 0, // 27 negative_hysteresis { 0, 0, 0 }, // 28-30 reserved. Write as 00h 0, // 31 reserved for OEM use // BYTE 32 HOTSWAP1_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 33+ Sensor ID String bytes { 'S', 'h', 'e', 'l', 'f', 'F', 'R', 'U', ' ', 'H', 'o', 't', 's', 'w', 'a', 'p' } }; // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // USER specific sensor records // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // ============================================================================ // 12V voltage sensor // ============================================================================ #define SDR_LTC4151_12V_VOLTAGE_STR_LEN 12 FullSensorRecord_t sdr_ltc4151_12V_voltage = { /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model FULL_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(FullSensorRecord_t, SDR_LTC4151_12V_VOLTAGE_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved CHANNEL_I2C_SENSOR, // [4:7] channel_num SDR_NUM_LTC4151_12V_VOLTAGE, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] enable thresholds 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 0, // [0:1] event_msg_control 2, // [2:3] sensor_threshold_access 3, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 0, // [7] ignore_sensor ST_VOLTAGE, // 13 sensor_type 0x01, // 14 event_type_code 0xF0, 0x0F, // 15,16 assertion event mask, LSB first 0xF0, 0x0F, // 17,18 deassertion event mask, LSB first 0x3F, 0x00, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 0, // [6:7] Analog (numeric) Data Format - unsigned 4, // 22 sensor_units2 0, // 23 sensor_units3 0, // 24 linearization (0 if linear) 40, // 25 M_lsb (8 bits) 0, // 26 [0:5] M Tolerance 0, // [6:7] M_msb 0, // 27 B_lsb (8 bits) 0, // 28 [0:5] B Accuracy_lsb 0, // [6:7] B_msb 0, // 29 [0:1] Sensor Direction 0, // [2:3] Accuracy exp 0, // [4:7] Accuracy_msb 0, // 30 [0:3] B exponent -2, // [4:7] R exponent 0, // 31 Analog characteristic flags (uchar)0x1E, // 32 Nominal Reading (uchar)0x1E, // 33 Normal Maximum - Given as a raw value (uchar)0x1D, // 34 Normal Minimum - Given as a raw value (uchar)0xFF, // 35 Sensor Maximum Reading (uchar)0x01, // 36 Sensor Minimum Reading (uchar)0x1E, // 37 Upper non-recoverable Threshold (uchar)0x1E, // 38 Upper critical Threshold (uchar)0x1E, // 39 Upper non-critical Threshold (uchar)0x1D, // 40 Lower non-recoverable Threshold (uchar)0x1D, // 41 Lower critical Threshold (uchar)0x1D, // 42 Lower non-critical Threshold 2, // 43 Positive-going Threshold Hysteresis value 2, // 44 Negative-going Threshold Hysteresis value { 0, 0 }, // 45-46 reserved. Write as 00h SDR_LTC4151_I2C_ADDR, // 47 OEM - Reserved for OEM use // BYTE 48 SDR_LTC4151_12V_VOLTAGE_STR_LEN, // [0:4] length of following data, in characters 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 49+ Sensor ID String bytes { '+', '1', '2', 'V', ' ', 'V', 'o', 'l', 't', 'a', 'g', 'e' } // sensor id string }; // ============================================================================ // 12V current sensor // ============================================================================ #define SDR_LTC4151_12V_CURRENT_STR_LEN 12 FullSensorRecord_t sdr_ltc4151_12V_current = { /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model FULL_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(FullSensorRecord_t, SDR_LTC4151_12V_CURRENT_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved CHANNEL_I2C_SENSOR, // [4:7] channel_num SDR_NUM_LTC4151_12V_CURRENT, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] enable thresholds 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 0, // [0:1] event_msg_control 2, // [2:3] sensor_threshold_access 3, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 0, // [7] ignore_sensor ST_CURRENT, // 13 sensor_type 0x01, // 14 event_type_code 0xC0, 0x0F, // 15,16 assertion event mask, LSB first 0xC0, 0x0F, // 17,18 deassertion event mask, LSB first 0x38, 0x00, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 0, // [6:7] Analog (numeric) Data Format - unsigned 5, // 22 sensor_units2 0, // 23 sensor_units3 0, // 24 linearization (0 if linear) 71, // 25 M_lsb (8 bits) 0, // 26 [0:5] M Tolerance 0, // [6:7] M_msb 0, // 27 B_lsb (8 bits) 0, // 28 [0:5] B Accuracy_lsb 0, // [6:7] B_msb 0, // 29 [0:1] Sensor Direction 0, // [2:3] Accuracy exp 0, // [4:7] Accuracy_msb 0, // 30 [0:3] B exponent -3, // [4:7] R exponent 0, // 31 Analog characteristic flags 0, // 32 Nominal Reading (uchar)0xEF, // 33 Normal Maximum - Given as a raw value (uchar)0x00, // 34 Normal Minimum - Given as a raw value (uchar)0xFF, // 35 Sensor Maximum Reading (uchar)0x01, // 36 Sensor Minimum Reading (uchar)0xEF, // 37 Upper non-recoverable Threshold (uchar)0xED, // 38 Upper critical Threshold (uchar)0xEB, // 39 Upper non-critical Threshold (uchar)0x00, // 40 Lower non-recoverable Threshold (uchar)0x00, // 41 Lower critical Threshold (uchar)0x00, // 42 Lower non-critical Threshold 8, // 43 Positive-going Threshold Hysteresis value 8, // 44 Negative-going Threshold Hysteresis value { 0, 0 }, // 45-46 reserved. Write as 00h SDR_LTC4151_I2C_ADDR, // 47 OEM - Reserved for OEM use // BYTE 48 SDR_LTC4151_12V_CURRENT_STR_LEN, // [0:4] length of following data, in characters 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 49+ Sensor ID String bytes { '+', '1', '2', 'V', ' ', 'C', 'u', 'r', 'r', 'e', 'n', 't' } // sensor id string }; // ============================================================================ // BMC watchdog sensor // ============================================================================ #define BMC_WDG_0_ID_STR_LEN 12 EventOnlySensorRecord_t sdr_wdg0 = { /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model EVENT_ONLY_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(EventOnlySensorRecord_t, BMC_WDG_0_ID_STR_LEN), /* RECORD KEY BYTES */ // 6 Sensor Owner ID 0, // [0] - 0b = ID is IPMB Slave Address, 1b = system software ID 0, // [1:7] - 7-bit I2C Slave Address, or 7-bit system software ID // 7 Sensor Owner LUN 0, // [0:1] - Sensor Owner LUN. // LUN in the Sensor Owner that is used to send/receive IPMB messages to // access the sensor. 00b if system software is Sensor Owner. 0, // [2:3] - FRU Inventory Device Owner LUN. // LUN for Write/Read FRU commands to access FRU information. 00b otherwise. 0, // [4:7] - Channel Number. The Channel Number can be used to specify access to sensors // that are located on management controllers that are connected to the BMC via // channels other than the primary IPMB. (Note: In IPMI v1.5 the ordering of // bits 7:2 of this byte have changed to support the 4-bit channel number.) SDR_NUM_WATCHDOG0, // 8 Sensor Number // Unique number identifying the sensor behind a given slave address and LUN. Code // FFh reserved. /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. // (See section 39.1, System- and Device-relative Entity Instance Values for // more information) // 00h-5Fh system-relative Entity Instance. The Entity Instance number must be // unique for each different entity of the same type Entity ID in the // system. // 60h-7Fh device-relative Entity Instance. The Entity Instance number must only // be unique relative to the management controller providing access to // the Entity. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, 0x23, // 11 Sensor Type - Code representing the sensor type. // From Table 42-3, Sensor Type Codes. E.g. Temperature, Voltage, Processor, etc. 0x6F, // 12 Event / Reading Type Code. // From Table 42-1, Event/Reading Type Code Ranges. // BYTE 13 Sensor Record Sharing, Sensor Direction 0, // [0:3] - Share count (number of sensors sharing this record). // Sensor numbers sharing this record are sequential starting with the sensor number // specified by the Sensor Number field for this record. E.g. if the starting sensor // number was 10, and the share count was 3, then sensors 10, 11, and 12 would share // this record. 0, // [4:5] - ID String Instance Modifier Type // (The instance modifier is a character(s) that software can append to the end of // the ID String. This field selects whether the appended character(s) will be // numeric or alpha. The Instance Modified Offset field, below, selects the starting // value for the character.) // 00b = numeric // 01b = alpha 0, // [6:7] - Sensor Direction. // Indicates whether the sensor is monitoring an input or output relative to the // given Entity. E.g. if the sensor is monitoring a current, this can be used to // specify whether it is an input voltage or an output voltage. // 00b = unspecified / not applicable // 01b = input // 10b = output // 11b = reserved // BYTE 14 Entity Instance Sharing 0, // [6:0] - ID String Instance Modifier Offset // Multiple Discrete sensors can share the same sensor data record. The ID String // Instance Modifier and Modifier Offset are used to modify the Sensor ID String // as follows: // Suppose sensor ID is “Temp” for ‘Temperature Sensor’, share count = 3, ID string // instance modifier = numeric, instance modifier offset = 5 - then the sensors could // be identified as: Temp 5, Temp 6, Temp 7 // If the modifier = alpha, offset=0 corresponds to ‘A’, offset=25 corresponds to ‘Z’, // and offset = 26 corresponds to ‘AA’, thus, for offset=26 the sensors could be // identified as: Temp AA, Temp AB, Temp AC (alpha characters are considered to be base // 26 for ASCII) 0, // [7] - // 0b = Entity Instance same for all shared records // 1b = Entity Instance increments for each shared record 0, // 15 reserved. Write as 00h. 0, // 16 Reserved for OEM use. // BYTE 17 ID String Type/Length Code BMC_WDG_0_ID_STR_LEN, // [0:4] length of following data, in characters. 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 18+ Sensor ID String bytes { 'B', 'M', 'C', ' ', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g' } // sensor id string }; // ============================================================================ // Core temperature sensor // ============================================================================ #define SDR_AD7414_TEMP_STR_LEN 9 FullSensorRecord_t sdr_ad7414_temp = { // MANDATORY LF 20110511 /* RECORD HEADER */ 0, 0, // 1-2 Record ID (filled in at startup) SDR_VERSION, // 3 SDR Version - Version of the Sensor Model FULL_SENSOR_RECORD_TYPE, // 4 Record Type Number // BYTE 5 - record_len - Number of remaining record bytes following SDR_LEN(FullSensorRecord_t, SDR_AD7414_TEMP_STR_LEN), /* RECORD KEY BYTES */ // BYTE 6 0, // [0] id_type - 0b = owner_id is IPMB Slave Address, 1b = system software ID 0, // [1:7] owner_id - 7-bit I2C Slave, fill during init // BYTE 7 0, // [0:1] sensor_owner_lun 0, // [2:3] reserved CHANNEL_I2C_SENSOR, // [4:7] channel_num SDR_NUM_AD7414_TEMP, // 8 sensor number /* RECORD BODY BYTES */ PICMG_ENTITY_FRONT_BOARD, // 9 entity_id - see PICMG 3.0 $3.4.3.1 // BYTE 10 // [0:6] entity_instance - 60h-7Fh device-relative Entity Instance. ENTITY_0_INSTANCE, // [7] entity_type - 0b = treat entity as a physical entity, 1b = logical entity ENTITY_TYPE_PHYSICAL, // BYTE 11 - Sensor initialization 1, // [0] sensor scanning enabled 1, // [1] event generation enabled 0, // [2] init sensor type and event/reading type code 0, // [3] enable hysteresis 0, // [4] enable thresholds 1, // [5] enable events 1, // [6] enable scanning 0, // [7] settable // BYTE 12 - Sensor capabilities 0, // [0:1] event_msg_control 2, // [2:3] sensor_threshold_access 3, // [4:5] sensor_hysteresis_support 1, // [6] sensor_manual_support 0, // [7] ignore_sensor ST_TEMPERATURE, // 13 sensor_type 0x01, // 14 event_type_code 0xF0, 0x0F, // 15,16 assertion event mask, LSB first 0xF0, 0x0F, // 17,18 deassertion event mask, LSB first 0x3F, 0x00, // 19,20 reading_mask, LSB first // BYTE 21 0, // [0] percentage - 0b 0, // [1:2] modifier_unit - 00b = none 3, // [3:5] rate_unit - 011b = every second 2, // [6:7] Analog (numeric) Data Format - 2's complement (signed) 1, // 22 sensor_units2 0, // 23 sensor_units3 0, // 24 linearization 1, // 25 M_lsb (8 bits) 0, // 26 [0:5] M Tolerance 0, // [6:7] M_msb 0, // 27 B_lsb (8 bits) 0, // 28 [0:5] B Accuracy_lsb 0, // [6:7] B_msb 0, // 29 [0:1] Sensor Direction 0, // [2:3] Accuracy exp 0, // [4:7] Accuracy_msb 0, // 30 [0:3] B exponent 0, // [4:7] R exponent 0, // 31 Analog characteristic flags 25, // 32 Nominal Reading (uchar) 55, // 33 Normal Maximum - Given as a raw value (uchar) -40, // 34 Normal Minimum - Given as a raw value (uchar) 125, // 35 Sensor Maximum Reading (uchar) -55, // 36 Sensor Minimum Reading (uchar) 75, // 37 Upper non-recoverable Threshold (uchar) 55, // 38 Upper critical Threshold (uchar) 45, // 39 Upper non-critical Threshold (uchar) -55, // 40 Lower non-recoverable Threshold (uchar) -55, // 41 Lower critical Threshold (uchar) -55, // 42 Lower non-critical Threshold 2, // 43 Positive-going Threshold Hysteresis value 2, // 44 Negative-going Threshold Hysteresis value { 0, 0 }, // 45-46 reserved. Write as 00h SDR_AD7414_I2C_ADDR, // 47 OEM - Reserved for OEM use // BYTE 48 SDR_AD7414_TEMP_STR_LEN, // [0:4] length of following data, in characters 0, // [5] reserved 3, // [6:7] id string type, 3 <=> 8-bit ASCII + Latin 1 // BYTE 49+ Sensor ID String bytes { 'C', 'o', 'r', 'e', ' ', 'T', 'e', 'm', 'p' } // sensor id string };