/* * config sensor sdr in here. * Author:Jimbo */ #include #include #include "com_IPMI_SDRRecord.h" /* * sdr table */ const MgmtCtrlrDevLocator_T bmc_sdr = { /* SDR Record Header */ { 0x01, //Record ID 0x51, //SDR Version MGMT_CTRL_DEV_LOCATOR_SDR_REC, //Record Type 11+MAX_ID_STR_LEN, //Record Length = 11+string length }, /* Record Key Bytes*/ 0x20, /* Slave address - 0x20 Primary BMC */ 0x00, /* ChannelNumber - 0x00 Primary BMC */ /* Record Body Bytes*/ 0x0, /* power state notification */ 0xff, /* Device Capablities */ {0, 0, 0,}, /* RESERVED */ 0x0, /* Entity ID */ 0x1, /* Entity Instance */ 0x0, /* OEM */ 0xc0 +MAX_ID_STR_LEN, /* ID String Type / Length Code */ "STM32F429_BMC" }; /***************** Attation ************************ * , must be modified!!! **************************************************/ const FullSensorRec_T full_sdr_tbl[] = { /* * sensor number: 1 * sensor name: +12V * brief: ltc4280 */ { /* SDR Record Header */ { 0x02, //Record ID 0x51, //SDR Version FULL_SDR_REC, //Record Type 43+MAX_ID_STR_LEN, //Record Length = 43+string length }, /* Record Key Bytes */ 0x20, //Sensor Owner ID 0x0, //Sensor Owner LUN 0x01, //Sensor Number /* Record Body Bytes */ 0x7, //Entity ID 0x1, //Entity Instance 0x7f, //Entity Initialization 0x68, //Sensor Capabilities 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan 0x01, //Event / Reading Type 0x7a95, //Lower Threshold Reading Mask 0x7a95, //Upper Threshold Reading Mask 0x3f3f, //Settable / Readable Threshold Mask /* [7:6] - Analog (numeric) Data Format** 00b = unsigned 01b = 1's complement(singed) 10b = 2's complement(singed) 11b = Does not return analog (numeric) reading [5:3] - Rate unit 000b = none 001b = per µS 010b = per ms 011b = per s 100b = per minute 101b = per hour 110b = per day 111b = reserved [2:1] - Modifier unit 00b = none 01b = Basic Unit / Modifier Unit 10b = Basic Unit * Modifier Unit 11b = reserved [0] - Percentage 0b = no, 1b = yes */ (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1 /* 0 unspecified 1 degrees C 2 degrees F 3 degrees K 4 Volts 5 Amps */ 0x4, //Sensor Units 2 - Base Unit 0x0, //Sensor Units 3 - Modifier Unit 0x0, //Linerization /* M = 0x12e x 10^-4 */ 0x3d, //M_LSB /* [7:6] - M: MS 2 bits [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts) */ ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance 0x0, //B_LSB /* [7:6] - B: MS 2 bits Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent: [5:0] - Accuracy: LS 6 bits */ ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent (uint8_t)(0xfd<<4)+(0x0&0x0F), //R exponent,B exponent 0x0, //Analog Characteristics Flags 0x7f, //Nominal Reading 0xff, //Normal Maximum 0x00, //Normal Minimum 0xff, //Sensor Maximum Reading 0x00, //Sensor Minimum Reading 0xff, //Upper Non-Recoverable Threshold 0xff, //Upper Critical Threshold 0xff, //Upper Non-Critical Threshold 0x00, //Lower Non-Recoverable Threshold 0x00, //Lower Critical Threshold 0x00, //Lower Non-Critical threshold 0x0, //Positive - threshold Hysteresis value 0x0, //Negative - threshold Hysteresis value 0x0, //Reserved 0x0, //Reserved 0x0, //OEM 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code "+12V" }, /* * sensor number: 2 * sensor name: +12V_Current * brief: ltc4280 */ { /* SDR Record Header */ { 0x03, //Record ID 0x51, //SDR Version FULL_SDR_REC, //Record Type 43+MAX_ID_STR_LEN, //Record Length = 43+string length }, /* Record Key Bytes */ 0x20, //Sensor Owner ID 0x0, //Sensor Owner LUN 0x02, //Sensor Number /* Record Body Bytes */ 0x7, //Entity ID 0x1, //Entity Instance 0x7f, //Entity Initialization 0x68, //Sensor Capabilities 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan 0x01, //Event / Reading Type 0x7a95, //Lower Threshold Reading Mask 0x7a95, //Upper Threshold Reading Mask 0x3f3f, //Settable / Readable Threshold Mask /* [7:6] - Analog (numeric) Data Format** 00b = unsigned 01b = 1's complement(singed) 10b = 2's complement(singed) 11b = Does not return analog (numeric) reading [5:3] - Rate unit 000b = none 001b = per µS 010b = per ms 011b = per s 100b = per minute 101b = per hour 110b = per day 111b = reserved [2:1] - Modifier unit 00b = none 01b = Basic Unit / Modifier Unit 10b = Basic Unit * Modifier Unit 11b = reserved [0] - Percentage 0b = no, 1b = yes */ (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1 /* 0 unspecified 1 degrees C 2 degrees F 3 degrees K 4 Volts 5 Amps */ 0x5, //Sensor Units 2 - Base Unit 0x0, //Sensor Units 3 - Modifier Unit 0x0, //Linerization /* M = 0x12e x 10^-4 */ 0x2e, //M_LSB /* [7:6] - M: MS 2 bits [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts) */ ((0x12e>>2)&0xC0)+(0x0&0x3F), //M,Tolerance 0x0, //B_LSB /* [7:6] - B: MS 2 bits Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent: [5:0] - Accuracy: LS 6 bits */ ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent (uint8_t)(0xfc<<4)+(0x0&0x0F), //R exponent,B exponent 0x0, //Analog Characteristics Flags 0x7f, //Nominal Reading 0xff, //Normal Maximum 0x00, //Normal Minimum 0xff, //Sensor Maximum Reading 0x00, //Sensor Minimum Reading 0xff, //Upper Non-Recoverable Threshold 0xff, //Upper Critical Threshold 0xff, //Upper Non-Critical Threshold 0x0, //Lower Non-Recoverable Threshold 0x0, //Lower Critical Threshold 0x0, //Lower Non-Critical threshold 0x0, //Positive - threshold Hysteresis value 0x0, //Negative - threshold Hysteresis value 0x0, //Reserved 0x0, //Reserved 0x0, //OEM 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code "+12V_Current" }, /* * sensor number: 3 * sensor name: Temp_Board * brief: G780 local */ { /* SDR Record Header */ { 0x04, //Record ID 0x51, //SDR Version FULL_SDR_REC, //Record Type 43+MAX_ID_STR_LEN, //Record Length = 43+string length }, /* Record Key Bytes */ 0x20, //Sensor Owner ID 0x0, //Sensor Owner LUN 0x03, //Sensor Number /* Record Body Bytes */ 0x7, //Entity ID 0x1, //Entity Instance 0x7f, //Entity Initialization 0x68, //Sensor Capabilities 0x01, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan 0x01, //Event / Reading Type 0x7a95, //Lower Threshold Reading Mask 0x7a95, //Upper Threshold Reading Mask 0x3f3f, //Settable / Readable Threshold Mask /* [7:6] - Analog (numeric) Data Format** 00b = unsigned 01b = 1's complement(singed) 10b = 2's complement(singed) 11b = Does not return analog (numeric) reading [5:3] - Rate unit 000b = none 001b = per µS 010b = per ms 011b = per s 100b = per minute 101b = per hour 110b = per day 111b = reserved [2:1] - Modifier unit 00b = none 01b = Basic Unit / Modifier Unit 10b = Basic Unit * Modifier Unit 11b = reserved [0] - Percentage 0b = no, 1b = yes */ (0x2<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1 /* 0 unspecified 1 degrees C 2 degrees F 3 degrees K 4 Volts 5 Amps */ 0x1, //Sensor Units 2 - Base Unit 0x0, //Sensor Units 3 - Modifier Unit 0x0, //Linerization 0x1, //M_LSB /* [7:6] - M: MS 2 bits [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts) */ ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance 0x0, //B_LSB /* [7:6] - B: MS 2 bits Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent: [5:0] - Accuracy: LS 6 bits */ ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent (0x0<<4)+(0x0&0x0F), //R exponent,B exponent 0x0, //Analog Characteristics Flags 0x7f, //Nominal Reading 0x7f, //Normal Maximum 0x80, //Normal Minimum 0x7f, //Sensor Maximum Reading 0x80, //Sensor Minimum Reading 0x7f, //Upper Non-Recoverable Threshold 0x7f, //Upper Critical Threshold 0x7f, //Upper Non-Critical Threshold 0x80, //Lower Non-Recoverable Threshold 0x80, //Lower Critical Threshold 0x80, //Lower Non-Critical threshold 0x0, //Positive - threshold Hysteresis value 0x0, //Negative - threshold Hysteresis value 0x0, //Reserved 0x0, //Reserved 0x0, //OEM 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code "Temp_Board" }, /* * sensor number: 4 * sensor name: Temp_FPGA * brief: G780 remote */ { /* SDR Record Header */ { 0x05, //Record ID 0x51, //SDR Version FULL_SDR_REC, //Record Type 43+MAX_ID_STR_LEN, //Record Length = 43+string length }, /* Record Key Bytes */ 0x20, //Sensor Owner ID 0x0, //Sensor Owner LUN 0x04, //Sensor Number /* Record Body Bytes */ 0x7, //Entity ID 0x1, //Entity Instance 0x7f, //Entity Initialization 0x68, //Sensor Capabilities 0x01, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan 0x01, //Event / Reading Type 0x7a95, //Lower Threshold Reading Mask 0x7a95, //Upper Threshold Reading Mask 0x3f3f, //Settable / Readable Threshold Mask /* [7:6] - Analog (numeric) Data Format** 00b = unsigned 01b = 1's complement(singed) 10b = 2's complement(singed) 11b = Does not return analog (numeric) reading [5:3] - Rate unit 000b = none 001b = per µS 010b = per ms 011b = per s 100b = per minute 101b = per hour 110b = per day 111b = reserved [2:1] - Modifier unit 00b = none 01b = Basic Unit / Modifier Unit 10b = Basic Unit * Modifier Unit 11b = reserved [0] - Percentage 0b = no, 1b = yes */ (0x2<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1 /* 0 unspecified 1 degrees C 2 degrees F 3 degrees K 4 Volts 5 Amps */ 0x1, //Sensor Units 2 - Base Unit 0x0, //Sensor Units 3 - Modifier Unit 0x0, //Linerization 0x1, //M_LSB /* [7:6] - M: MS 2 bits [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts) */ ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance 0x0, //B_LSB /* [7:6] - B: MS 2 bits Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent: [5:0] - Accuracy: LS 6 bits */ ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent (0x0<<4)+(0x0&0x0F), //R exponent,B exponent 0x0, //Analog Characteristics Flags 0x7f, //Nominal Reading 0x7f, //Normal Maximum 0x80, //Normal Minimum 0x7f, //Sensor Maximum Reading 0x80, //Sensor Minimum Reading 0x7f, //Upper Non-Recoverable Threshold 0x7f, //Upper Critical Threshold 0x7f, //Upper Non-Critical Threshold 0x80, //Lower Non-Recoverable Threshold 0x80, //Lower Critical Threshold 0x80, //Lower Non-Critical threshold 0x0, //Positive - threshold Hysteresis value 0x0, //Negative - threshold Hysteresis value 0x0, //Reserved 0x0, //Reserved 0x0, //OEM 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code "Temp_FPGA" }, /* * sensor number: 5 * sensor name: +1.5V * brief: adc_ch1 */ { /* SDR Record Header */ { 0x06, //Record ID 0x51, //SDR Version FULL_SDR_REC, //Record Type 43+MAX_ID_STR_LEN, //Record Length = 43+string length }, /* Record Key Bytes */ 0x20, //Sensor Owner ID 0x0, //Sensor Owner LUN 0x05, //Sensor Number /* Record Body Bytes */ 0x7, //Entity ID 0x1, //Entity Instance 0x7f, //Entity Initialization 0x68, //Sensor Capabilities 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan 0x01, //Event / Reading Type 0x7a95, //Lower Threshold Reading Mask 0x7a95, //Upper Threshold Reading Mask 0x3f3f, //Settable / Readable Threshold Mask /* [7:6] - Analog (numeric) Data Format** 00b = unsigned 01b = 1's complement(singed) 10b = 2's complement(singed) 11b = Does not return analog (numeric) reading [5:3] - Rate unit 000b = none 001b = per µS 010b = per ms 011b = per s 100b = per minute 101b = per hour 110b = per day 111b = reserved [2:1] - Modifier unit 00b = none 01b = Basic Unit / Modifier Unit 10b = Basic Unit * Modifier Unit 11b = reserved [0] - Percentage 0b = no, 1b = yes */ (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1 /* 0 unspecified 1 degrees C 2 degrees F 3 degrees K 4 Volts 5 Amps */ 0x4, //Sensor Units 2 - Base Unit 0x0, //Sensor Units 3 - Modifier Unit 0x0, //Linerization 0x81, //M_LSB /* [7:6] - M: MS 2 bits [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts) */ ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance 0x0, //B_LSB /* [7:6] - B: MS 2 bits Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent: [5:0] - Accuracy: LS 6 bits */ ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent (uint8_t)(0xfc<<4)+(0x0&0x0F), //R exponent,B exponent 0x0, //Analog Characteristics Flags 0x7f, //Nominal Reading 0xff, //Normal Maximum 0x00, //Normal Minimum 0xff, //Sensor Maximum Reading 0x00, //Sensor Minimum Reading 0xff, //Upper Non-Recoverable Threshold 0xff, //Upper Critical Threshold 0xff, //Upper Non-Critical Threshold 0x00, //Lower Non-Recoverable Threshold 0x00, //Lower Critical Threshold 0x00, //Lower Non-Critical threshold 0x0, //Positive - threshold Hysteresis value 0x0, //Negative - threshold Hysteresis value 0x0, //Reserved 0x0, //Reserved 0x0, //OEM 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code "+1.5V" }, /* * sensor number: 6 * sensor name: +0.75V * brief: adc_ch2 */ { /* SDR Record Header */ { 0x07, //Record ID 0x51, //SDR Version FULL_SDR_REC, //Record Type 43+MAX_ID_STR_LEN, //Record Length = 43+string length }, /* Record Key Bytes */ 0x20, //Sensor Owner ID 0x0, //Sensor Owner LUN 0x06, //Sensor Number /* Record Body Bytes */ 0x7, //Entity ID 0x1, //Entity Instance 0x7f, //Entity Initialization 0x68, //Sensor Capabilities 0x02, //Sensor Type: 01-temperature, 02-voltage, 03-current, 04-fan 0x01, //Event / Reading Type 0x7a95, //Lower Threshold Reading Mask 0x7a95, //Upper Threshold Reading Mask 0x3f3f, //Settable / Readable Threshold Mask /* [7:6] - Analog (numeric) Data Format** 00b = unsigned 01b = 1's complement(singed) 10b = 2's complement(singed) 11b = Does not return analog (numeric) reading [5:3] - Rate unit 000b = none 001b = per µS 010b = per ms 011b = per s 100b = per minute 101b = per hour 110b = per day 111b = reserved [2:1] - Modifier unit 00b = none 01b = Basic Unit / Modifier Unit 10b = Basic Unit * Modifier Unit 11b = reserved [0] - Percentage 0b = no, 1b = yes */ (0x0<<6)+(0x0<<3)+(0x0<<1)+0x0, //Sensor Units 1 /* 0 unspecified 1 degrees C 2 degrees F 3 degrees K 4 Volts 5 Amps */ 0x4, //Sensor Units 2 - Base Unit 0x0, //Sensor Units 3 - Modifier Unit 0x0, //Linerization 0x81, //M_LSB /* [7:6] - M: MS 2 bits [5:0] - Tolerance: 6 bits, unsigned (Tolerance in +/- ½ raw counts) */ ((0x0>>2)&0xC0)+(0x0&0x3F), //M,Tolerance 0x0, //B_LSB /* [7:6] - B: MS 2 bits Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent: [5:0] - Accuracy: LS 6 bits */ ((0x0>>2)&0xC0)+(0x0&0x3F), //B,Accuracy ((0x0>>2)&0xF0)+(0x0&0x0C)+0x0, //Accuracy,Accuracy exponent (uint8_t)(0xfc<<4)+(0x0&0x0F), //R exponent,B exponent 0x0, //Analog Characteristics Flags 0x7f, //Nominal Reading 0xff, //Normal Maximum 0x00, //Normal Minimum 0xff, //Sensor Maximum Reading 0x00, //Sensor Minimum Reading 0xff, //Upper Non-Recoverable Threshold 0xff, //Upper Critical Threshold 0xff, //Upper Non-Critical Threshold 0x00, //Lower Non-Recoverable Threshold 0x00, //Lower Critical Threshold 0x00, //Lower Non-Critical threshold 0x0, //Positive - threshold Hysteresis value 0x0, //Negative - threshold Hysteresis value 0x0, //Reserved 0x0, //Reserved 0x0, //OEM 0xC0+MAX_ID_STR_LEN, //ID String Type / Length Code "+0.75V" }, }; const CompactSensorRec_T Compact_sdr_tbl[] = { {0}, //dummy sensor, make compiler happy. };