From f3ffb7f542ef45924ca0d2cbc50c2f8986ec82f9 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 27 Jun 2019 14:22:10 -0300 Subject: [PATCH 01/21] [modules/sdr] Fix typo in threshold variable name --- modules/sdr.c | 8 ++++---- modules/sdr.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index e32b104a7..2b2a38b34 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -722,7 +722,7 @@ void check_sensor_event( sensor_t * sensor ) if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_nonrecover_thr)){ ev = IPMI_THRESHOLD_LNR_GH; - sensor->asserted_event.lower_non_recorverable_go_high = 1; + sensor->asserted_event.lower_non_recoverable_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW_NON_REC; } @@ -751,7 +751,7 @@ void check_sensor_event( sensor_t * sensor ) else{ if(sensor->readout_value <= sdr->lower_nonrecover_thr){ ev = IPMI_THRESHOLD_LNR_GH; - sensor->asserted_event.lower_non_recorverable_go_high = 1; + sensor->asserted_event.lower_non_recoverable_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW_NON_REC; } @@ -784,7 +784,7 @@ void check_sensor_event( sensor_t * sensor ) if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_nonrecover_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_recoverable_go_high){ ev = IPMI_THRESHOLD_LNR_GH; - sensor->asserted_event.lower_non_recorverable_go_high = 0; + sensor->asserted_event.lower_non_recoverable_go_high = 0; ev_type = DEASSERTION_EVENT; } sensor->state = SENSOR_STATE_LOW_CRIT; @@ -807,7 +807,7 @@ void check_sensor_event( sensor_t * sensor ) if(sensor->readout_value >= (sdr->lower_nonrecover_thr + (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_non_recoverable_go_high){ ev = IPMI_THRESHOLD_LNR_GH; - sensor->asserted_event.lower_non_recorverable_go_high = 0; + sensor->asserted_event.lower_non_recoverable_go_high = 0; ev_type = DEASSERTION_EVENT; } sensor->state = SENSOR_STATE_LOW_CRIT; diff --git a/modules/sdr.h b/modules/sdr.h index d288701e2..eb2560c5a 100644 --- a/modules/sdr.h +++ b/modules/sdr.h @@ -192,7 +192,7 @@ typedef struct sensor_t { uint16_t upper_critical_go_low:1; uint16_t upper_non_critical_go_high:1; uint16_t upper_non_critical_go_low:1; - uint16_t lower_non_recorverable_go_high:1; + uint16_t lower_non_recoverable_go_high:1; uint16_t lower_non_recoverable_go_low:1; uint16_t lower_critical_go_high:1; uint16_t lower_critical_go_low:1; From a69e56be0114232cf49bcef77f4359fe9bc8a431 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 27 Jun 2019 14:25:19 -0300 Subject: [PATCH 02/21] [modules/sdr] Include trigger values in event message --- modules/sdr.c | 167 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 115 insertions(+), 52 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index 2b2a38b34..31c8ec805 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -440,7 +440,20 @@ IPMI_HANDLER(ipmi_se_get_sensor_threshold, NETFN_SE, IPMI_GET_SENSOR_THRESHOLD_C void check_sensor_event( sensor_t * sensor ) { /** Should be rewritten to be compliant with RTM management !! */ - uint8_t ev = 0xFF; + /* Event message: [0] - Event Data 1 + [7:6] 00b = unspecified byte 2 + 01b = trigger reading in byte 2 + 10b = OEM code in byte 2 + 11b = sensor-specific event extension code in byte 2 + [5:4] 00b = unspecified byte 3 + 01b = trigger threshold value in byte 3 + 10b = OEM code in byte 3 + 11b = sensor-specific event extension code in byte 3 + [3:0] Offset from Event/Reading Code for threshold event. + [1] - Event data 2 -> Reading that triggered the event + [2] - Event data 3 -> Threshold value that triggered the event + */ + uint8_t ev[3] = {0x0F, 0xFF, 0xFF}; uint8_t ev_type; configASSERT(sensor); @@ -458,7 +471,8 @@ void check_sensor_event( sensor_t * sensor ) if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->upper_nonrecover_thr) - (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_recoverable_go_high){ - ev = IPMI_THRESHOLD_UNR_GH; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -466,22 +480,24 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) <= ((int8_t)sdr->upper_nonrecover_thr) && !sensor->asserted_event.upper_non_recoverable_go_low){ - ev = IPMI_THRESHOLD_UNR_GL; + ev[0] = IPMI_THRESHOLD_UNR_GL; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_low = 1; ev_type = ASSERTION_EVENT; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->upper_nonrecover_thr) + (1+((int8_t)sdr->neg_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_recoverable_go_low){ - ev = IPMI_THRESHOLD_UNR_GL; + ev[0] = IPMI_THRESHOLD_UNR_GL; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_low = 0; - } } } else{ if(sensor->readout_value <= (sdr->upper_nonrecover_thr - (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_non_recoverable_go_high){ - ev = IPMI_THRESHOLD_UNR_GH; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -489,13 +505,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && sensor->readout_value <= sdr->upper_nonrecover_thr && !sensor->asserted_event.upper_non_recoverable_go_low){ - ev = IPMI_THRESHOLD_UNR_GL; + ev[0] = IPMI_THRESHOLD_UNR_GL; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_low = 1; ev_type = ASSERTION_EVENT; } else if(sensor->readout_value >= (sdr->upper_nonrecover_thr + (1+sdr->neg_thr_hysteresis))){ if(sensor->asserted_event.upper_non_recoverable_go_low){ - ev = IPMI_THRESHOLD_UNR_GL; + ev[0] = IPMI_THRESHOLD_UNR_GL; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -506,14 +524,16 @@ void check_sensor_event( sensor_t * sensor ) case SENSOR_STATE_HIGH_CRIT: if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) >= ((int8_t)sdr->upper_nonrecover_thr)){ - ev = IPMI_THRESHOLD_UNR_GH; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_HIGH_NON_REC; } else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->upper_critical_thr) - (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_critical_go_high){ - ev = IPMI_THRESHOLD_UC_GH; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -521,13 +541,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) <= ((int8_t)sdr->upper_critical_thr) && !sensor->asserted_event.upper_critical_go_low){ - ev = IPMI_THRESHOLD_UC_GL; + ev[0] = IPMI_THRESHOLD_UC_GL; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->upper_critical_thr) + (1+((int8_t)sdr->neg_thr_hysteresis)))){ if(sensor->asserted_event.upper_critical_go_low){ - ev = IPMI_THRESHOLD_UC_GL; + ev[0] = IPMI_THRESHOLD_UC_GL; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -535,14 +557,16 @@ void check_sensor_event( sensor_t * sensor ) } else{ if(sensor->readout_value >= sdr->upper_nonrecover_thr){ - ev = IPMI_THRESHOLD_UNR_GH; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_HIGH_NON_REC; } else if(sensor->readout_value <= (sdr->upper_critical_thr - (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_critical_go_high){ - ev = IPMI_THRESHOLD_UC_GH; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -550,13 +574,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && sensor->readout_value <= sdr->upper_critical_thr && !sensor->asserted_event.upper_critical_go_low){ - ev = IPMI_THRESHOLD_UC_GL; + ev[0] = IPMI_THRESHOLD_UC_GL; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(sensor->readout_value >= (sdr->upper_critical_thr + (1+sdr->neg_thr_hysteresis))){ if(sensor->asserted_event.upper_critical_go_low){ - ev = IPMI_THRESHOLD_UC_GL; + ev[0] = IPMI_THRESHOLD_UC_GL; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -568,14 +594,16 @@ void check_sensor_event( sensor_t * sensor ) case SENSOR_STATE_HIGH: if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) >= ((int8_t)sdr->upper_critical_thr)){ - ev = IPMI_THRESHOLD_UC_GH; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_HIGH_CRIT; } else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->upper_noncritical_thr) - (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_critical_go_high){ - ev = IPMI_THRESHOLD_UNC_GH; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -583,13 +611,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) <= ((int8_t)sdr->upper_noncritical_thr) && !sensor->asserted_event.upper_non_critical_go_low){ - ev = IPMI_THRESHOLD_UNC_GL; + ev[0] = IPMI_THRESHOLD_UNC_GL; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->upper_noncritical_thr) + (1+((int8_t)sdr->neg_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_critical_go_low){ - ev = IPMI_THRESHOLD_UNC_GL; + ev[0] = IPMI_THRESHOLD_UNC_GL; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -597,14 +627,16 @@ void check_sensor_event( sensor_t * sensor ) } else{ if(sensor->readout_value >= sdr->upper_critical_thr){ - ev = IPMI_THRESHOLD_UC_GH; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; sensor->asserted_event.upper_critical_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_HIGH_CRIT; } else if(sensor->readout_value <= (sdr->upper_noncritical_thr - (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_non_critical_go_high){ - ev = IPMI_THRESHOLD_UNC_GH; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -612,13 +644,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && sensor->readout_value <= sdr->upper_noncritical_thr && !sensor->asserted_event.upper_non_critical_go_low){ - ev = IPMI_THRESHOLD_UNC_GL; + ev[0] = IPMI_THRESHOLD_UNC_GL; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(sensor->readout_value >= (sdr->upper_noncritical_thr + (1+sdr->neg_thr_hysteresis))){ if(sensor->asserted_event.upper_non_critical_go_low){ - ev = IPMI_THRESHOLD_UNC_GL; + ev[0] = IPMI_THRESHOLD_UNC_GL; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -629,28 +663,32 @@ void check_sensor_event( sensor_t * sensor ) case SENSOR_STATE_NORMAL: if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) >= ((int8_t)sdr->upper_noncritical_thr)){ - ev = IPMI_THRESHOLD_UNC_GH; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_HIGH; } else if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_noncritical_thr)){ - ev = IPMI_THRESHOLD_LNC_GL; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW; } } else{ if(sensor->readout_value >= sdr->upper_noncritical_thr){ - ev = IPMI_THRESHOLD_UNC_GH; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; sensor->asserted_event.upper_non_critical_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_HIGH; } else if(sensor->readout_value <= sdr->lower_noncritical_thr){ - ev = IPMI_THRESHOLD_LNC_GL; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW; } @@ -660,14 +698,16 @@ void check_sensor_event( sensor_t * sensor ) case SENSOR_STATE_LOW: if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_critical_thr)){ - ev = IPMI_THRESHOLD_LC_GH; + ev[0] = IPMI_THRESHOLD_LC_GH; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW_CRIT; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_noncritical_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_critical_go_high){ - ev = IPMI_THRESHOLD_LNC_GH; + ev[0] = IPMI_THRESHOLD_LNC_GH; + ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -675,13 +715,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) >= ((int8_t)sdr->lower_noncritical_thr)){ - ev = IPMI_THRESHOLD_LNC_GL; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->lower_noncritical_thr) - (1+((int8_t)sdr->neg_thr_hysteresis)))){ if(sensor->asserted_event.lower_non_critical_go_low){ - ev = IPMI_THRESHOLD_LNC_GL; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -689,14 +731,16 @@ void check_sensor_event( sensor_t * sensor ) } else{ if(sensor->readout_value <= sdr->lower_critical_thr){ - ev = IPMI_THRESHOLD_LC_GH; + ev[0] = IPMI_THRESHOLD_LC_GH; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW_CRIT; } else if(sensor->readout_value >= (sdr->lower_noncritical_thr + (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_non_critical_go_high){ - ev = IPMI_THRESHOLD_LNC_GH; + ev[0] = IPMI_THRESHOLD_LNC_GH; + ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -704,13 +748,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && sensor->readout_value >= sdr->lower_noncritical_thr){ - ev = IPMI_THRESHOLD_LNC_GL; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(sensor->readout_value <= (sdr->lower_noncritical_thr - (1+sdr->neg_thr_hysteresis))){ if(sensor->asserted_event.lower_non_critical_go_low){ - ev = IPMI_THRESHOLD_LNC_GL; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -721,14 +767,16 @@ void check_sensor_event( sensor_t * sensor ) case SENSOR_STATE_LOW_CRIT: if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_nonrecover_thr)){ - ev = IPMI_THRESHOLD_LNR_GH; + ev[0] = IPMI_THRESHOLD_LNR_GH; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW_NON_REC; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_critical_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_critical_go_high){ - ev = IPMI_THRESHOLD_LC_GH; + ev[0] = IPMI_THRESHOLD_LC_GH; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -736,13 +784,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) >= ((int8_t)sdr->lower_critical_thr)){ - ev = IPMI_THRESHOLD_LC_GL; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->lower_critical_thr) - (1+((int8_t)sdr->neg_thr_hysteresis)))){ if(sensor->asserted_event.lower_critical_go_low){ - ev = IPMI_THRESHOLD_LC_GL; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -750,14 +800,16 @@ void check_sensor_event( sensor_t * sensor ) } else{ if(sensor->readout_value <= sdr->lower_nonrecover_thr){ - ev = IPMI_THRESHOLD_LNR_GH; + ev[0] = IPMI_THRESHOLD_LNR_GH; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_high = 1; ev_type = ASSERTION_EVENT; sensor->state = SENSOR_STATE_LOW_NON_REC; } else if(sensor->readout_value >= (sdr->lower_critical_thr + (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_critical_go_high){ - ev = IPMI_THRESHOLD_LC_GH; + ev[0] = IPMI_THRESHOLD_LC_GH; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -765,13 +817,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && sensor->readout_value >= sdr->lower_critical_thr){ - ev = IPMI_THRESHOLD_LC_GL; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_low = 1; ev_type = ASSERTION_EVENT; } else if(sensor->readout_value <= (sdr->lower_critical_thr - (1+sdr->neg_thr_hysteresis))){ if(sensor->asserted_event.lower_critical_go_low){ - ev = IPMI_THRESHOLD_LC_GL; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -783,7 +837,8 @@ void check_sensor_event( sensor_t * sensor ) if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_nonrecover_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ if(sensor->asserted_event.upper_non_recoverable_go_high){ - ev = IPMI_THRESHOLD_LNR_GH; + ev[0] = IPMI_THRESHOLD_LNR_GH; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -791,13 +846,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) >= ((int8_t)sdr->lower_nonrecover_thr)){ - ev = IPMI_THRESHOLD_LNR_GL; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_low = 1; ev_type = ASSERTION_EVENT; } else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->lower_critical_thr) - (1+((int8_t)sdr->neg_thr_hysteresis)))){ if(sensor->asserted_event.lower_non_recoverable_go_low){ - ev = IPMI_THRESHOLD_LNR_GL; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -806,7 +863,8 @@ void check_sensor_event( sensor_t * sensor ) else{ if(sensor->readout_value >= (sdr->lower_nonrecover_thr + (1+sdr->pos_thr_hysteresis))){ if(sensor->asserted_event.upper_non_recoverable_go_high){ - ev = IPMI_THRESHOLD_LNR_GH; + ev[0] = IPMI_THRESHOLD_LNR_GH; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_high = 0; ev_type = DEASSERTION_EVENT; } @@ -814,13 +872,15 @@ void check_sensor_event( sensor_t * sensor ) } if(sensor->old_state != sensor->state && sensor->readout_value >= sdr->lower_nonrecover_thr){ - ev = IPMI_THRESHOLD_LNR_GL; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_low = 1; ev_type = ASSERTION_EVENT; } else if(sensor->readout_value <= (sdr->lower_critical_thr - (1+sdr->neg_thr_hysteresis))){ if(sensor->asserted_event.lower_non_recoverable_go_low){ - ev = IPMI_THRESHOLD_LNR_GL; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_low = 0; ev_type = DEASSERTION_EVENT; } @@ -831,8 +891,11 @@ void check_sensor_event( sensor_t * sensor ) sensor->old_state = sensor->state; - if ((ev != 0xFF)) { - ipmi_event_send(sensor, ev_type, &ev, 1); + if ((ev[0] != 0x0F)) { + /* Indicate that threshold and trigger values are indicated in bytes 2 and 3 */ + ev[0] |= 0x50; + ev[1] = sensor->readout_value; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); } } From 0745d4b5a68e963e314723813e69bcb0d8a29fde Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 27 Jun 2019 14:26:15 -0300 Subject: [PATCH 03/21] [modules/sdr] Remove asserts from event function Just silently return if the passed sensor argument is invalid. An assertion here will just cause unnecessary trouble, the caller should be the one handling this type of error --- modules/sdr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index 31c8ec805..9473102c2 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -456,14 +456,11 @@ void check_sensor_event( sensor_t * sensor ) uint8_t ev[3] = {0x0F, 0xFF, 0xFF}; uint8_t ev_type; - configASSERT(sensor); + if (sensor == NULL) return; SDR_type_01h_t * sdr = ( SDR_type_01h_t * ) sensor->sdr; - configASSERT(sdr); - if( sdr->hdr.rectype != TYPE_01 ) { - return; - } + if( sdr == NULL || sdr->hdr.rectype != TYPE_01 ) return; /** Compare value with threshold */ switch(sensor->state) { From 1d1ad43fd740ea433805ab185cfd6eb2683a20bb Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 27 Jun 2019 15:33:52 -0300 Subject: [PATCH 04/21] [modules/sdr] Fix event assertion comparison This function was comparing wheter a different assertion event had already happened in order to issue a deassertion event --- modules/sdr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index 9473102c2..704a86744 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -487,6 +487,7 @@ void check_sensor_event( sensor_t * sensor ) ev[0] = IPMI_THRESHOLD_UNR_GL; ev[2] = sdr->upper_nonrecover_thr; sensor->asserted_event.upper_non_recoverable_go_low = 0; + ev_type = DEASSERTION_EVENT; } } } @@ -702,7 +703,7 @@ void check_sensor_event( sensor_t * sensor ) sensor->state = SENSOR_STATE_LOW_CRIT; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_noncritical_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.upper_non_critical_go_high){ + if(sensor->asserted_event.lower_non_critical_go_high){ ev[0] = IPMI_THRESHOLD_LNC_GH; ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_high = 0; @@ -735,7 +736,7 @@ void check_sensor_event( sensor_t * sensor ) sensor->state = SENSOR_STATE_LOW_CRIT; } else if(sensor->readout_value >= (sdr->lower_noncritical_thr + (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.upper_non_critical_go_high){ + if(sensor->asserted_event.lower_non_critical_go_high){ ev[0] = IPMI_THRESHOLD_LNC_GH; ev[2] = sdr->lower_noncritical_thr; sensor->asserted_event.lower_non_critical_go_high = 0; @@ -771,7 +772,7 @@ void check_sensor_event( sensor_t * sensor ) sensor->state = SENSOR_STATE_LOW_NON_REC; } else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_critical_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.upper_critical_go_high){ + if(sensor->asserted_event.lower_critical_go_high){ ev[0] = IPMI_THRESHOLD_LC_GH; ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_high = 0; @@ -804,7 +805,7 @@ void check_sensor_event( sensor_t * sensor ) sensor->state = SENSOR_STATE_LOW_NON_REC; } else if(sensor->readout_value >= (sdr->lower_critical_thr + (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.upper_critical_go_high){ + if(sensor->asserted_event.lower_critical_go_high){ ev[0] = IPMI_THRESHOLD_LC_GH; ev[2] = sdr->lower_critical_thr; sensor->asserted_event.lower_critical_go_high = 0; @@ -833,7 +834,7 @@ void check_sensor_event( sensor_t * sensor ) case SENSOR_STATE_LOW_NON_REC: if(sensor->signed_flag){ if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_nonrecover_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.upper_non_recoverable_go_high){ + if(sensor->asserted_event.lower_non_recoverable_go_low){ ev[0] = IPMI_THRESHOLD_LNR_GH; ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_high = 0; @@ -859,7 +860,7 @@ void check_sensor_event( sensor_t * sensor ) } else{ if(sensor->readout_value >= (sdr->lower_nonrecover_thr + (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.upper_non_recoverable_go_high){ + if(sensor->asserted_event.lower_non_recoverable_go_high){ ev[0] = IPMI_THRESHOLD_LNR_GH; ev[2] = sdr->lower_nonrecover_thr; sensor->asserted_event.lower_non_recoverable_go_high = 0; From 523bd29429462852c8e892e7630140932c227d05 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Mon, 1 Jul 2019 14:57:49 -0300 Subject: [PATCH 05/21] [port/board/afc-bpm/v3_1] Update INA220 thresholds --- port/board/afc-bpm/v3_1/sdr_list.c | 137 +++++++++++++++-------------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/port/board/afc-bpm/v3_1/sdr_list.c b/port/board/afc-bpm/v3_1/sdr_list.c index 36735f1a1..451aec864 100644 --- a/port/board/afc-bpm/v3_1/sdr_list.c +++ b/port/board/afc-bpm/v3_1/sdr_list.c @@ -178,7 +178,7 @@ const SDR_type_01h_t SDR_FMC1_12V = { .sensor_min_reading = 0x00, /* Sensor Minimum reading */ .upper_nonrecover_thr = 205, /* Upper non-recoverable Threshold */ .upper_critical_thr = 200, /* Upper critical Threshold */ - .upper_noncritical_thr = 190, /* Upper non critical Threshold */ + .upper_noncritical_thr = 195, /* Upper non critical Threshold */ .lower_nonrecover_thr = 170, /* Lower non-recoverable Threshold */ .lower_critical_thr = 175, /* Lower critical Threshold */ .lower_noncritical_thr = 180, /* Lower non-critical Threshold */ @@ -238,8 +238,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ .lower_critical_thr = 32, /* Lower critical Threshold */ .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ - .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ .OEM = 0x00, /* OEM reserved */ @@ -395,6 +395,7 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ .nominal_reading = 39, /* Nominal reading */ + .nominal_reading = 39, /* Nominal reading */ .normal_max = 47, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ @@ -405,8 +406,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ .lower_critical_thr = 32, /* Lower critical Threshold */ .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ - .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ .OEM = 0x00, /* OEM reserved */ @@ -490,8 +491,8 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ .sensorinit = 0x7F, /* init: event generation + scanning enabled */ - .sensorcap = 0x56, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ 0x0F }, /* MSB assert event mask */ @@ -510,17 +511,17 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 156, /* Normal maximum - 5A per sensor */ + .nominal_reading = 32, /* Nominal reading = 1A */ + .normal_max = 125, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -546,8 +547,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ .sensorinit = 0x7F, /* init: event generation + scanning enabled */ - .sensorcap = 0x56, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ 0x0F }, /* MSB assert event mask */ @@ -559,24 +560,24 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ .linearization = 0x00, /* Linearization */ - .M = 32, /* M -> Current LSB*20 */ + .M = 32, /* M */ .M_tol = 0x00, /* M - Tolerance */ .B = 0x00, /* B */ .B_accuracy = 0x00, /* B - Accuracy */ .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ + .nominal_reading = 39, /* Nominal reading - 1.24A */ + .normal_max = 47, /* Normal maximum - 1.5A*/ + .normal_min = 0, /* Normal minimum - 0A */ .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ .sensor_min_reading = 0x80, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -603,8 +604,8 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .entityinstance = 0x00, /* entity instance -> SDR_Init */ .sensorinit = 0x7F, /* init: event generation + scanning enabled */ .sensorcap = 0x56, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ - .event_reading_type = 0x01, /* sensor reading*/ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ + .event_reading_type = 0x01, /* sensor reading */ .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ 0x0F }, /* MSB assert event mask */ .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ @@ -622,16 +623,16 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ .nominal_reading = 85, /* Nominal reading */ - .normal_max = 125, /* Normal maximum */ - .normal_min = 30, /* Normal minimum */ + .normal_max = 94, /* Normal maximum - 3A */ + .normal_min = 32, /* Normal minimum - 1A */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 110, /* Upper critical Threshold */ - .upper_noncritical_thr = 95, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 10, /* Lower critical Threshold */ - .lower_noncritical_thr = 30, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -658,8 +659,8 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .entityinstance = 0x00, /* entity instance -> SDR_Init */ .sensorinit = 0x7F, /* init: event generation + scanning enabled */ .sensorcap = 0x56, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ - .event_reading_type = 0x01, /* sensor reading*/ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ + .event_reading_type = 0x01, /* sensor reading */ .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ 0x0F }, /* MSB assert event mask */ .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ @@ -677,17 +678,17 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 200, /* Normal maximum */ + .nominal_reading = 32, /* Nominal reading = 1A */ + .normal_max = 125, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -733,17 +734,17 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .nominal_reading = 39, /* Nominal reading - 1.24A */ + .normal_max = 47, /* Normal maximum - 1.5A*/ + .normal_min = 0, /* Normal minimum - 0A */ + .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ + .sensor_min_reading = 0x80, /* Sensor Minimum reading */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -769,8 +770,8 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ .sensorinit = 0x7F, /* init: event generation + scanning enabled */ - .sensorcap = 0x56, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ 0x0F }, /* MSB assert event mask */ @@ -789,16 +790,16 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ .nominal_reading = 85, /* Nominal reading */ - .normal_max = 125, /* Normal maximum */ - .normal_min = 30, /* Normal minimum */ + .normal_max = 94, /* Normal maximum - 3A */ + .normal_min = 32, /* Normal minimum - 1A */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 110, /* Upper critical Threshold */ - .upper_noncritical_thr = 95, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 10, /* Lower critical Threshold */ - .lower_noncritical_thr = 30, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ From 5d55fb9b37069dd6bbd4261af5760d4e7444d591 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 16 Jul 2019 14:27:35 -0300 Subject: [PATCH 06/21] [modules/sdr] Include event scan flag to enable/disable sensors --- modules/sdr.c | 35 ++++++++++++++--------------------- modules/sdr.h | 3 +++ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index 704a86744..daaf0b2e4 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -115,6 +115,7 @@ sensor_t * sdr_insert_entry( SDR_TYPE type, void * sdr, TaskHandle_t *monitor_ta entry->entityinstance = 0x60 | ((ipmb_addr - 0x70) >> 1); entry->readout_value = 0; entry->state = SENSOR_STATE_LOW_NON_REC; + entry->event_scan = 0xC0; /* Start with sensor enabled */ /* Link the sdr list */ if (sdr_tail) { @@ -193,6 +194,16 @@ void sdr_pop( void ) } } +void sensor_enable(sensor_t *sensor) +{ + sensor->event_scan = 0xC0; +} + +void sensor_disable(sensor_t *sensor) +{ + sensor->event_scan = 0x00; +} + /******************************/ /* IPMI SDR Commands handlers */ /******************************/ @@ -363,34 +374,16 @@ IPMI_HANDLER(ipmi_se_get_sensor_reading, NETFN_SE, IPMI_GET_SENSOR_READING_CMD, if (*(cur_sensor->task_handle) == vTaskHotSwap_Handle) { rsp->data[len++] = 0x00; - rsp->data[len++] = 0xC0; + rsp->data[len++] = cur_sensor->event_scan; /* Current State Mask */ rsp->data[len++] = cur_sensor->readout_value; } else { rsp->data[len++] = cur_sensor->readout_value; - rsp->data[len++] = 0xC0; + rsp->data[len++] = cur_sensor->event_scan; /* Present threshold status ( [7:6] Reserved, return as 1b )*/ rsp->data[len] = 0xC0; - - if (cur_sensor->state == SENSOR_STATE_LOW) { - rsp->data[len] |= 0x01; - } - if (cur_sensor->state == SENSOR_STATE_LOW_CRIT) { - rsp->data[len] |= 0x02; - } - if (cur_sensor->state == SENSOR_STATE_LOW_NON_REC) { - rsp->data[len] |= 0x04; - } - if (cur_sensor->state == SENSOR_STATE_HIGH) { - rsp->data[len] |= 0x08; - } - if (cur_sensor->state == SENSOR_STATE_HIGH_CRIT) { - rsp->data[len] |= 0x10; - } - if (cur_sensor->state == SENSOR_STATE_HIGH_NON_REC) { - rsp->data[len] |= 0x20; - } + rsp->data[len] |= cur_sensor->state; len++; } diff --git a/modules/sdr.h b/modules/sdr.h index eb2560c5a..5ef6bbd79 100644 --- a/modules/sdr.h +++ b/modules/sdr.h @@ -182,6 +182,7 @@ typedef struct sensor_t { uint16_t readout_value; uint8_t chipid; uint8_t signed_flag; + uint8_t event_scan; uint8_t ownerID; /* This field is repeated here because its value is assigned during initialization, so it can't be const */ uint8_t entityinstance; /* This field is repeated here because its value is assigned during initialization, so it can't be const */ TaskHandle_t * task_handle; @@ -219,6 +220,8 @@ void amc_sdr_init( void ); void rtm_sdr_init( void ); #endif void sensor_init( void ); +void sensor_enable(sensor_t *sensor); +void sensor_disable(sensor_t *sensor); void check_sensor_event( sensor_t * sensor ); sensor_t * sdr_insert_entry( SDR_TYPE type, void * sdr, TaskHandle_t *monitor_task, uint8_t diag_id, uint8_t slave_addr); From 6ad66b070eb3a0d8b5903438b2d5b04aa64e6a34 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 16 Jul 2019 14:30:16 -0300 Subject: [PATCH 07/21] [modules/sdr] Update Sensor event checking function Based on CERN's MMC implementation v5.0 Separates sensor state and event checking and performs the value comparison in a generic function --- modules/sdr.c | 542 +++++++++----------------------------- modules/sdr.h | 9 +- modules/sensors/ina220.c | 1 + modules/sensors/lm75.c | 1 + modules/sensors/max6642.c | 3 +- 5 files changed, 140 insertions(+), 416 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index daaf0b2e4..d3b205e05 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -41,6 +41,27 @@ volatile uint8_t sdr_count = 0; static uint16_t reservationID; static uint32_t sdr_change_count; +uint8_t compare_val(uint8_t val1, uint8_t val2, uint8_t comp, uint8_t sign) +{ + if(sign == SIGNED) { + switch(comp) { + case UPPER_EQ: + return (((int8_t)val1) >= ((int8_t)val2)); + case LOWER_EQ: + return (((int8_t)val1) <= ((int8_t)val2)); + } + } else { + switch(comp){ + case UPPER_EQ: + return ((val1) >= (val2)); + case LOWER_EQ: + return ((val1) <= (val2)); + } + } + + return 0x00; +} + size_t sdr_get_size_by_type(SDR_TYPE type) { switch (type) { @@ -429,6 +450,31 @@ IPMI_HANDLER(ipmi_se_get_sensor_threshold, NETFN_SE, IPMI_GET_SENSOR_THRESHOLD_C rsp->completion_code = IPMI_CC_OK; } +/* Sensor state checking function adapted from CERN MMCv2 implementation, credits in this file header */ +void sensor_state_check( sensor_t *sensor ) +{ + if (sensor == NULL) return; + + SDR_type_01h_t * sdr = (SDR_type_01h_t *) sensor->sdr; + if(sdr == NULL || sdr->hdr.rectype != TYPE_01) return; + + if(compare_val(sensor->readout_value, sdr->lower_noncritical_thr, UPPER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->upper_noncritical_thr, LOWER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_NORMAL; + } else if(compare_val(sensor->readout_value, sdr->upper_noncritical_thr, UPPER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->upper_critical_thr, LOWER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_HIGH; + } else if(compare_val(sensor->readout_value, sdr->upper_critical_thr, UPPER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->upper_nonrecover_thr, LOWER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_HIGH_CRIT; + } else if(compare_val(sensor->readout_value, sdr->upper_nonrecover_thr, UPPER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_HIGH_NON_REC; + } else if(compare_val(sensor->readout_value, sdr->lower_noncritical_thr, LOWER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->lower_critical_thr, UPPER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_LOW; + } else if(compare_val(sensor->readout_value, sdr->lower_critical_thr, LOWER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->lower_nonrecover_thr, UPPER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_LOW_CRIT; + } else if(compare_val(sensor->readout_value, sdr->lower_nonrecover_thr, LOWER_EQ, sensor->signed_flag)) { + sensor->state = SENSOR_STATE_LOW_NON_REC; + } +} + /* Sensor alarm checking function adapted from CERN MMCv2 implementation, credits in this file header */ void check_sensor_event( sensor_t * sensor ) { @@ -451,436 +497,104 @@ void check_sensor_event( sensor_t * sensor ) if (sensor == NULL) return; - SDR_type_01h_t * sdr = ( SDR_type_01h_t * ) sensor->sdr; - - if( sdr == NULL || sdr->hdr.rectype != TYPE_01 ) return; - - /** Compare value with threshold */ - switch(sensor->state) { - case SENSOR_STATE_HIGH_NON_REC: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->upper_nonrecover_thr) - (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.upper_non_recoverable_go_high){ - ev[0] = IPMI_THRESHOLD_UNR_GH; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_HIGH_CRIT; - } + SDR_type_01h_t * sdr = (SDR_type_01h_t *) sensor->sdr; - if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) <= ((int8_t)sdr->upper_nonrecover_thr) && !sensor->asserted_event.upper_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_UNR_GL; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->upper_nonrecover_thr) + (1+((int8_t)sdr->neg_thr_hysteresis)))){ - if(sensor->asserted_event.upper_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_UNR_GL; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - else{ - if(sensor->readout_value <= (sdr->upper_nonrecover_thr - (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.upper_non_recoverable_go_high){ - ev[0] = IPMI_THRESHOLD_UNR_GH; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_HIGH_CRIT; - } + if(sdr == NULL || sdr->hdr.rectype != TYPE_01) return; - if(sensor->old_state != sensor->state && sensor->readout_value <= sdr->upper_nonrecover_thr && !sensor->asserted_event.upper_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_UNR_GL; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(sensor->readout_value >= (sdr->upper_nonrecover_thr + (1+sdr->neg_thr_hysteresis))){ - if(sensor->asserted_event.upper_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_UNR_GL; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - break; - - case SENSOR_STATE_HIGH_CRIT: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) >= ((int8_t)sdr->upper_nonrecover_thr)){ - ev[0] = IPMI_THRESHOLD_UNR_GH; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_HIGH_NON_REC; - } - else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->upper_critical_thr) - (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.upper_critical_go_high){ - ev[0] = IPMI_THRESHOLD_UC_GH; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_HIGH; - } - - if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) <= ((int8_t)sdr->upper_critical_thr) && !sensor->asserted_event.upper_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UC_GL; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->upper_critical_thr) + (1+((int8_t)sdr->neg_thr_hysteresis)))){ - if(sensor->asserted_event.upper_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UC_GL; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - else{ - if(sensor->readout_value >= sdr->upper_nonrecover_thr){ - ev[0] = IPMI_THRESHOLD_UNR_GH; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_HIGH_NON_REC; - } - else if(sensor->readout_value <= (sdr->upper_critical_thr - (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.upper_critical_go_high){ - ev[0] = IPMI_THRESHOLD_UC_GH; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_HIGH; - } - - if(sensor->old_state != sensor->state && sensor->readout_value <= sdr->upper_critical_thr && !sensor->asserted_event.upper_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UC_GL; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(sensor->readout_value >= (sdr->upper_critical_thr + (1+sdr->neg_thr_hysteresis))){ - if(sensor->asserted_event.upper_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UC_GL; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } + /* Only check enabled sensors */ + if (!(sensor->event_scan & 0xC0)) return; - break; + /** Compare threshold with the upper thresholds */ - case SENSOR_STATE_HIGH: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) >= ((int8_t)sdr->upper_critical_thr)){ - ev[0] = IPMI_THRESHOLD_UC_GH; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_HIGH_CRIT; - } - else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->upper_noncritical_thr) - (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.upper_non_critical_go_high){ - ev[0] = IPMI_THRESHOLD_UNC_GH; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_NORMAL; - } + /** Upper non-critical threshold going-high */ + if(!sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, sdr->upper_noncritical_thr, UPPER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; + sensor->asserted_event.upper_non_critical_go_high = 1; + } - if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) <= ((int8_t)sdr->upper_noncritical_thr) && !sensor->asserted_event.upper_non_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UNC_GL; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->upper_noncritical_thr) + (1+((int8_t)sdr->neg_thr_hysteresis)))){ - if(sensor->asserted_event.upper_non_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UNC_GL; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - else{ - if(sensor->readout_value >= sdr->upper_critical_thr){ - ev[0] = IPMI_THRESHOLD_UC_GH; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_HIGH_CRIT; - } - else if(sensor->readout_value <= (sdr->upper_noncritical_thr - (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.upper_non_critical_go_high){ - ev[0] = IPMI_THRESHOLD_UNC_GH; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_NORMAL; - } + if(sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_noncritical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; + sensor->asserted_event.upper_non_critical_go_high = 0; + } - if(sensor->old_state != sensor->state && sensor->readout_value <= sdr->upper_noncritical_thr && !sensor->asserted_event.upper_non_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UNC_GL; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(sensor->readout_value >= (sdr->upper_noncritical_thr + (1+sdr->neg_thr_hysteresis))){ - if(sensor->asserted_event.upper_non_critical_go_low){ - ev[0] = IPMI_THRESHOLD_UNC_GL; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - break; - - case SENSOR_STATE_NORMAL: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) >= ((int8_t)sdr->upper_noncritical_thr)){ - ev[0] = IPMI_THRESHOLD_UNC_GH; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_HIGH; - } + /** Upper critical threshold going-high */ + if(!sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, sdr->upper_critical_thr, UPPER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; + sensor->asserted_event.upper_critical_go_high = 1; + } - else if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_noncritical_thr)){ - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_LOW; - } - } - else{ - if(sensor->readout_value >= sdr->upper_noncritical_thr){ - ev[0] = IPMI_THRESHOLD_UNC_GH; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_HIGH; - } + if(sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_critical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; + sensor->asserted_event.upper_critical_go_high = 0; + } - else if(sensor->readout_value <= sdr->lower_noncritical_thr){ - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_LOW; - } - } - break; - - case SENSOR_STATE_LOW: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_critical_thr)){ - ev[0] = IPMI_THRESHOLD_LC_GH; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_LOW_CRIT; - } - else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_noncritical_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.lower_non_critical_go_high){ - ev[0] = IPMI_THRESHOLD_LNC_GH; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_NORMAL; - } + /** Upper non-recoverable threshold going-high */ + if(!sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->upper_nonrecover_thr, UPPER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; + sensor->asserted_event.upper_non_recoverable_go_high = 1; + } - if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) >= ((int8_t)sdr->lower_noncritical_thr)){ - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->lower_noncritical_thr) - (1+((int8_t)sdr->neg_thr_hysteresis)))){ - if(sensor->asserted_event.lower_non_critical_go_low){ - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - else{ - if(sensor->readout_value <= sdr->lower_critical_thr){ - ev[0] = IPMI_THRESHOLD_LC_GH; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_LOW_CRIT; - } - else if(sensor->readout_value >= (sdr->lower_noncritical_thr + (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.lower_non_critical_go_high){ - ev[0] = IPMI_THRESHOLD_LNC_GH; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_NORMAL; - } + if(sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->upper_nonrecover_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; + sensor->asserted_event.upper_non_recoverable_go_high = 0; + } - if(sensor->old_state != sensor->state && sensor->readout_value >= sdr->lower_noncritical_thr){ - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(sensor->readout_value <= (sdr->lower_noncritical_thr - (1+sdr->neg_thr_hysteresis))){ - if(sensor->asserted_event.lower_non_critical_go_low){ - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - break; - - case SENSOR_STATE_LOW_CRIT: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) <= ((int8_t)sdr->lower_nonrecover_thr)){ - ev[0] = IPMI_THRESHOLD_LNR_GH; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_LOW_NON_REC; - } - else if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_critical_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.lower_critical_go_high){ - ev[0] = IPMI_THRESHOLD_LC_GH; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_LOW; - } + /** Lower non-critical threshold going-high */ + if(!sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, sdr->lower_noncritical_thr, LOWER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; + sensor->asserted_event.lower_non_critical_go_low = 1; + } - if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) >= ((int8_t)sdr->lower_critical_thr)){ - ev[0] = IPMI_THRESHOLD_LC_GL; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->lower_critical_thr) - (1+((int8_t)sdr->neg_thr_hysteresis)))){ - if(sensor->asserted_event.lower_critical_go_low){ - ev[0] = IPMI_THRESHOLD_LC_GL; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - else{ - if(sensor->readout_value <= sdr->lower_nonrecover_thr){ - ev[0] = IPMI_THRESHOLD_LNR_GH; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_high = 1; - ev_type = ASSERTION_EVENT; - sensor->state = SENSOR_STATE_LOW_NON_REC; - } - else if(sensor->readout_value >= (sdr->lower_critical_thr + (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.lower_critical_go_high){ - ev[0] = IPMI_THRESHOLD_LC_GH; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_LOW; - } + if(sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_noncritical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; + sensor->asserted_event.lower_non_critical_go_low = 0; + } - if(sensor->old_state != sensor->state && sensor->readout_value >= sdr->lower_critical_thr){ - ev[0] = IPMI_THRESHOLD_LC_GL; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(sensor->readout_value <= (sdr->lower_critical_thr - (1+sdr->neg_thr_hysteresis))){ - if(sensor->asserted_event.lower_critical_go_low){ - ev[0] = IPMI_THRESHOLD_LC_GL; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - break; - - case SENSOR_STATE_LOW_NON_REC: - if(sensor->signed_flag){ - if(((int8_t)sensor->readout_value) >= (((int8_t)sdr->lower_nonrecover_thr) + (1+((int8_t)sdr->pos_thr_hysteresis)))){ - if(sensor->asserted_event.lower_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_LNR_GH; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_LOW_CRIT; - } + /** Lower critical threshold going-high */ + if(!sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, sdr->lower_critical_thr, LOWER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; + sensor->asserted_event.lower_critical_go_low = 1; + } - if(sensor->old_state != sensor->state && ((int8_t)sensor->readout_value) >= ((int8_t)sdr->lower_nonrecover_thr)){ - ev[0] = IPMI_THRESHOLD_LNR_GL; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(((int8_t)sensor->readout_value) <= (((int8_t)sdr->lower_critical_thr) - (1+((int8_t)sdr->neg_thr_hysteresis)))){ - if(sensor->asserted_event.lower_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_LNR_GL; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - else{ - if(sensor->readout_value >= (sdr->lower_nonrecover_thr + (1+sdr->pos_thr_hysteresis))){ - if(sensor->asserted_event.lower_non_recoverable_go_high){ - ev[0] = IPMI_THRESHOLD_LNR_GH; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_high = 0; - ev_type = DEASSERTION_EVENT; - } - sensor->state = SENSOR_STATE_LOW_CRIT; - } + if(sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_critical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; + sensor->asserted_event.lower_critical_go_low = 0; + } - if(sensor->old_state != sensor->state && sensor->readout_value >= sdr->lower_nonrecover_thr){ - ev[0] = IPMI_THRESHOLD_LNR_GL; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_low = 1; - ev_type = ASSERTION_EVENT; - } - else if(sensor->readout_value <= (sdr->lower_critical_thr - (1+sdr->neg_thr_hysteresis))){ - if(sensor->asserted_event.lower_non_recoverable_go_low){ - ev[0] = IPMI_THRESHOLD_LNR_GL; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_low = 0; - ev_type = DEASSERTION_EVENT; - } - } - } - break; + /** Lower non-recoverable threshold going-high */ + if(!sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->lower_nonrecover_thr, LOWER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; + sensor->asserted_event.lower_non_recoverable_go_high = 1; } - sensor->old_state = sensor->state; + if(sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->lower_nonrecover_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; + sensor->asserted_event.lower_non_recoverable_go_high = 0; + } if ((ev[0] != 0x0F)) { /* Indicate that threshold and trigger values are indicated in bytes 2 and 3 */ diff --git a/modules/sdr.h b/modules/sdr.h index 5ef6bbd79..1b812a0f7 100644 --- a/modules/sdr.h +++ b/modules/sdr.h @@ -64,6 +64,13 @@ #define IPMI_THRESHOLD_UNR_GL 0x0A // upper non recoverable going low #define IPMI_THRESHOLD_UNR_GH 0x0B // upper non recoverable going high +/* Constants for comparison function */ +#define UNSIGNED 0x00 +#define SIGNED 0x01 + +#define LOWER_EQ 0x00 +#define UPPER_EQ 0x01 + typedef enum { TYPE_01 = 0x1, @@ -223,7 +230,7 @@ void sensor_init( void ); void sensor_enable(sensor_t *sensor); void sensor_disable(sensor_t *sensor); void check_sensor_event( sensor_t * sensor ); - +void sensor_state_check( sensor_t *sensor ); sensor_t * sdr_insert_entry( SDR_TYPE type, void * sdr, TaskHandle_t *monitor_task, uint8_t diag_id, uint8_t slave_addr); void sdr_remove_entry( sensor_t * entry ); void sdr_pop( void ); diff --git a/modules/sensors/ina220.c b/modules/sensors/ina220.c index 39b2d9254..f7b4df98f 100644 --- a/modules/sensors/ina220.c +++ b/modules/sensors/ina220.c @@ -100,6 +100,7 @@ void vTaskINA220( void *Parameters ) } /* Check for threshold events */ + sensor_state_check(ina220_sensor); check_sensor_event(ina220_sensor); vTaskDelayUntil( &xLastWakeTime, xFrequency ); diff --git a/modules/sensors/lm75.c b/modules/sensors/lm75.c index b2b782a28..04b8389ec 100644 --- a/modules/sensors/lm75.c +++ b/modules/sensors/lm75.c @@ -77,6 +77,7 @@ void vTaskLM75( void* Parameters ) } /* Check for threshold events */ i2c_give(i2c_interf); + sensor_state_check(temp_sensor); check_sensor_event(temp_sensor); } } diff --git a/modules/sensors/max6642.c b/modules/sensors/max6642.c index 1d111235a..6582cc4ff 100644 --- a/modules/sensors/max6642.c +++ b/modules/sensors/max6642.c @@ -67,7 +67,8 @@ void vTaskMAX6642( void* Parameters ) max6642_read_remote( temp_sensor, (uint8_t *) &(temp_sensor->readout_value) ); /* Check for threshold events */ - check_sensor_event( temp_sensor ); + sensor_state_check(temp_sensor); + check_sensor_event(temp_sensor); } vTaskDelay(xFrequency); } From 92a73ca5de2020f8467385767441ac32e1325ddf Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 16 Jul 2019 15:01:03 -0300 Subject: [PATCH 08/21] [afc-bpm/*/sdr_list] Remove RTM Hotswap SDR entry This entry should be defined on the RTM board sdr_list.c file, not here --- modules/sdr.h | 8 +++--- port/board/afc-bpm/v3_0/sdr_list.c | 41 --------------------------- port/board/afc-bpm/v3_1/sdr_list.c | 45 ------------------------------ 3 files changed, 4 insertions(+), 90 deletions(-) diff --git a/modules/sdr.h b/modules/sdr.h index 1b812a0f7..9d6e09ada 100644 --- a/modules/sdr.h +++ b/modules/sdr.h @@ -98,8 +98,8 @@ typedef struct { uint8_t sensorcap; uint8_t sensortype; uint8_t event_reading_type; - uint8_t assertion_event_mask[2]; - uint8_t deassertion_event_mask[2]; + uint16_t assertion_event_mask; + uint16_t deassertion_event_mask; uint8_t settable_threshold_mask; uint8_t readable_threshold_mask; uint8_t sensor_units_1; @@ -146,8 +146,8 @@ typedef struct { uint8_t sensorcap; uint8_t sensortype; uint8_t event_reading_type; - uint8_t assertion_event_mask[2]; - uint8_t deassertion_event_mask[2]; + uint16_t assertion_event_mask; + uint16_t deassertion_event_mask; uint8_t settable_threshold_mask; uint8_t readable_threshold_mask; uint8_t sensor_units_1; diff --git a/port/board/afc-bpm/v3_0/sdr_list.c b/port/board/afc-bpm/v3_0/sdr_list.c index daaa35b45..aba0ef8eb 100644 --- a/port/board/afc-bpm/v3_0/sdr_list.c +++ b/port/board/afc-bpm/v3_0/sdr_list.c @@ -90,47 +90,6 @@ const SDR_type_02h_t SDR_HOTSWAP_AMC = { .IDstring = "HOTSWAP AMC" /* sensor string */ }; -#ifdef MODULE_RTM -const SDR_type_02h_t SDR_HOTSWAP_RTM = { - - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ - .hdr.recID_MSB = 0x00, - .hdr.SDRversion = 0x51, - .hdr.rectype = TYPE_02, - .hdr.reclength = sizeof(SDR_type_02h_t) - sizeof(SDR_entry_hdr_t), - - .ownerID = 0x00, /* i2c address, -> SDR_Init */ - .ownerLUN = 0x00, /* sensor owner LUN */ - .sensornum = 0x00, /* Filled by sdr_insert_entry() */ - -/* record body bytes */ - .entityID = 0xC0, /* entity id: RTM */ - .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x03, /* init: event generation + scanning enabled */ - .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ - .event_reading_type = 0x6f, /* sensor reading*/ - .assertion_event_mask = { 0x00, /* LSB assert event mask: 3 bit value */ - 0x00 }, /* MSB assert event mask */ - .deassertion_event_mask = { 0x00, /* LSB deassert event mask: 3 bit value */ - 0x00 }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ - .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ - .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ - .sensor_units_2 = 0x00, /* sensor units 2 :*/ - .sensor_units_3 = 0x00, /* sensor units 3 :*/ - .record_sharing[0] = 0x00, - .record_sharing[1] = 0x00, - .pos_thr_hysteresis = 0x00, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 0x00, /* negative going Threshold hysteresis value */ - .reserved1 = 0x00, /* reserved */ - .reserved2 = 0x00, /* reserved */ - .reserved3 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ - .IDtypelen = 0xc0 | STR_SIZE("HOTSWAP RTM"), /* 8 bit ASCII, number of bytes */ - .IDstring = "HOTSWAP RTM" /* sensor string */ -}; -#endif #endif #ifdef MODULE_INA220_VOLTAGE diff --git a/port/board/afc-bpm/v3_1/sdr_list.c b/port/board/afc-bpm/v3_1/sdr_list.c index 451aec864..ff85c3c91 100644 --- a/port/board/afc-bpm/v3_1/sdr_list.c +++ b/port/board/afc-bpm/v3_1/sdr_list.c @@ -89,48 +89,6 @@ const SDR_type_02h_t SDR_HOTSWAP_AMC = { .IDtypelen = 0xc0 | STR_SIZE("HOTSWAP AMC"), /* 8 bit ASCII, number of bytes */ .IDstring = "HOTSWAP AMC" /* sensor string */ }; - -#ifdef MODULE_RTM -const SDR_type_02h_t SDR_HOTSWAP_RTM = { - - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ - .hdr.recID_MSB = 0x00, - .hdr.SDRversion = 0x51, - .hdr.rectype = TYPE_02, - .hdr.reclength = sizeof(SDR_type_02h_t) - sizeof(SDR_entry_hdr_t), - - .ownerID = 0x00, /* i2c address, -> SDR_Init */ - .ownerLUN = 0x00, /* sensor owner LUN */ - .sensornum = 0x00, /* Filled by sdr_insert_entry() */ - -/* record body bytes */ - .entityID = 0xC0, /* entity id: RTM */ - .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x03, /* init: event generation + scanning enabled */ - .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ - .event_reading_type = 0x6f, /* sensor reading*/ - .assertion_event_mask = { 0x00, /* LSB assert event mask: 3 bit value */ - 0x00 }, /* MSB assert event mask */ - .deassertion_event_mask = { 0x00, /* LSB deassert event mask: 3 bit value */ - 0x00 }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ - .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ - .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ - .sensor_units_2 = 0x00, /* sensor units 2 :*/ - .sensor_units_3 = 0x00, /* sensor units 3 :*/ - .record_sharing[0] = 0x00, - .record_sharing[1] = 0x00, - .pos_thr_hysteresis = 0x00, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 0x00, /* negative going Threshold hysteresis value */ - .reserved1 = 0x00, /* reserved */ - .reserved2 = 0x00, /* reserved */ - .reserved3 = 0x00, /* reserved */ - .OEM = 0x00, /* OEM reserved */ - .IDtypelen = 0xc0 | STR_SIZE("HOTSWAP RTM"), /* 8 bit ASCII, number of bytes */ - .IDstring = "HOTSWAP RTM" /* sensor string */ -}; -#endif #endif #ifdef MODULE_INA220_VOLTAGE @@ -1094,9 +1052,6 @@ void amc_sdr_init( void ) { /* Hotswap Sensor */ sdr_insert_entry( TYPE_02, (void *) &SDR_HOTSWAP_AMC, &vTaskHotSwap_Handle, 0, 0 ); -#ifdef MODULE_RTM - sdr_insert_entry( TYPE_02, (void *) &SDR_HOTSWAP_RTM, &vTaskHotSwap_Handle, 0, 0 ); -#endif /* INA220 sensors */ #ifdef MODULE_INA220_VOLTAGE From 4f7b413e03df91d0d2a86583c189fb02f0e69a01 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 16 Jul 2019 15:03:34 -0300 Subject: [PATCH 09/21] [modules/sdr] Check (de)assertion event mask to generate events This implicates changing the (de)assertion mask event bytes to a single 16-bit field 0x7A95 -> Enables Upper going-high and Lower going-low threshold events --- modules/sdr.c | 148 ++++++----- port/board/afc-bpm/v3_0/sdr_list.c | 393 +++++++++++++---------------- port/board/afc-bpm/v3_1/sdr_list.c | 109 +++----- port/board/afc-timing/sdr_list.c | 176 +++++-------- port/board/rtm-8sfp/sdr_list.c | 26 +- 5 files changed, 374 insertions(+), 478 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index d3b205e05..34e76c03e 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -507,93 +507,117 @@ void check_sensor_event( sensor_t * sensor ) /** Compare threshold with the upper thresholds */ /** Upper non-critical threshold going-high */ - if(!sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, sdr->upper_noncritical_thr, UPPER_EQ, sensor->signed_flag)){ - ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNC_GH; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_high = 1; + if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_UNC_GH)) { + if(!sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, sdr->upper_noncritical_thr, UPPER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; + sensor->asserted_event.upper_non_critical_go_high = 1; + } } - if(sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_noncritical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ - ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNC_GH; - ev[2] = sdr->upper_noncritical_thr; - sensor->asserted_event.upper_non_critical_go_high = 0; + if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_UNC_GH)) { + if(sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_noncritical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[2] = sdr->upper_noncritical_thr; + sensor->asserted_event.upper_non_critical_go_high = 0; + } } /** Upper critical threshold going-high */ - if(!sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, sdr->upper_critical_thr, UPPER_EQ, sensor->signed_flag)){ - ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UC_GH; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_high = 1; + if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_UC_GH)) { + if(!sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, sdr->upper_critical_thr, UPPER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; + sensor->asserted_event.upper_critical_go_high = 1; + } } - if(sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_critical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ - ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UC_GH; - ev[2] = sdr->upper_critical_thr; - sensor->asserted_event.upper_critical_go_high = 0; + if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_UC_GH)) { + if(sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_critical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UC_GH; + ev[2] = sdr->upper_critical_thr; + sensor->asserted_event.upper_critical_go_high = 0; + } } /** Upper non-recoverable threshold going-high */ - if(!sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->upper_nonrecover_thr, UPPER_EQ, sensor->signed_flag)){ - ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNR_GH; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_high = 1; + if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_UNR_GH)) { + if(!sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->upper_nonrecover_thr, UPPER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; + sensor->asserted_event.upper_non_recoverable_go_high = 1; + } } - if(sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->upper_nonrecover_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ - ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNR_GH; - ev[2] = sdr->upper_nonrecover_thr; - sensor->asserted_event.upper_non_recoverable_go_high = 0; + if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_UNR_GH)) { + if(sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->upper_nonrecover_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[2] = sdr->upper_nonrecover_thr; + sensor->asserted_event.upper_non_recoverable_go_high = 0; + } } /** Lower non-critical threshold going-high */ - if(!sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, sdr->lower_noncritical_thr, LOWER_EQ, sensor->signed_flag)){ - ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_low = 1; + if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_LNC_GL)) { + if(!sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, sdr->lower_noncritical_thr, LOWER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; + sensor->asserted_event.lower_non_critical_go_low = 1; + } } - if(sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_noncritical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ - ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNC_GL; - ev[2] = sdr->lower_noncritical_thr; - sensor->asserted_event.lower_non_critical_go_low = 0; + if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_LNC_GL)) { + if(sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_noncritical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[2] = sdr->lower_noncritical_thr; + sensor->asserted_event.lower_non_critical_go_low = 0; + } } /** Lower critical threshold going-high */ - if(!sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, sdr->lower_critical_thr, LOWER_EQ, sensor->signed_flag)){ - ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LC_GL; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_low = 1; + if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_LC_GL)) { + if(!sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, sdr->lower_critical_thr, LOWER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; + sensor->asserted_event.lower_critical_go_low = 1; + } } - if(sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_critical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ - ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LC_GL; - ev[2] = sdr->lower_critical_thr; - sensor->asserted_event.lower_critical_go_low = 0; + if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_LC_GL)) { + if(sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_critical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LC_GL; + ev[2] = sdr->lower_critical_thr; + sensor->asserted_event.lower_critical_go_low = 0; + } } /** Lower non-recoverable threshold going-high */ - if(!sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->lower_nonrecover_thr, LOWER_EQ, sensor->signed_flag)){ - ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNR_GL; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_high = 1; - } - - if(sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->lower_nonrecover_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ - ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNR_GL; - ev[2] = sdr->lower_nonrecover_thr; - sensor->asserted_event.lower_non_recoverable_go_high = 0; + if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_LNR_GL)) { + if(!sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->lower_nonrecover_thr, LOWER_EQ, sensor->signed_flag)){ + ev_type = ASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; + sensor->asserted_event.lower_non_recoverable_go_high = 1; + } + } + + if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_LNR_GL)) { + if(sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->lower_nonrecover_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ + ev_type = DEASSERTION_EVENT; + ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[2] = sdr->lower_nonrecover_thr; + sensor->asserted_event.lower_non_recoverable_go_high = 0; + } } if ((ev[0] != 0x0F)) { diff --git a/port/board/afc-bpm/v3_0/sdr_list.c b/port/board/afc-bpm/v3_0/sdr_list.c index aba0ef8eb..e1138afd8 100644 --- a/port/board/afc-bpm/v3_0/sdr_list.c +++ b/port/board/afc-bpm/v3_0/sdr_list.c @@ -69,10 +69,8 @@ const SDR_type_02h_t SDR_HOTSWAP_AMC = { .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ .event_reading_type = 0x6f, /* sensor reading*/ - .assertion_event_mask = { 0x00, /* LSB assert event mask: 3 bit value */ - 0x00 }, /* MSB assert event mask */ - .deassertion_event_mask = { 0x00, /* LSB deassert event mask: 3 bit value */ - 0x00 }, /* MSB deassert event mask */ + .assertion_event_mask = 0x0000, /* assertion event mask */ + .deassertion_event_mask = 0x0000, /* deassertion event mask */ .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ @@ -109,16 +107,14 @@ const SDR_type_01h_t SDR_FMC1_12V = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -137,7 +133,7 @@ const SDR_type_01h_t SDR_FMC1_12V = { .sensor_min_reading = 0x00, /* Sensor Minimum reading */ .upper_nonrecover_thr = 205, /* Upper non-recoverable Threshold */ .upper_critical_thr = 200, /* Upper critical Threshold */ - .upper_noncritical_thr = 190, /* Upper non critical Threshold */ + .upper_noncritical_thr = 195, /* Upper non critical Threshold */ .lower_nonrecover_thr = 170, /* Lower non-recoverable Threshold */ .lower_critical_thr = 175, /* Lower critical Threshold */ .lower_noncritical_thr = 180, /* Lower non-critical Threshold */ @@ -152,7 +148,6 @@ const SDR_type_01h_t SDR_FMC1_12V = { /* FMC1 PVADJ */ const SDR_type_01h_t SDR_FMC1_VADJ = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -166,16 +161,14 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -198,8 +191,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ .lower_critical_thr = 32, /* Lower critical Threshold */ .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ - .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ .OEM = 0x00, /* OEM reserved */ @@ -209,7 +202,6 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { /* FMC1 P3V3 */ const SDR_type_01h_t SDR_FMC1_P3V3 = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -223,16 +215,14 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -265,7 +255,6 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { /* FMC2 12V */ const SDR_type_01h_t SDR_FMC2_12V = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -279,16 +268,14 @@ const SDR_type_01h_t SDR_FMC2_12V = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -322,7 +309,6 @@ const SDR_type_01h_t SDR_FMC2_12V = { /* FMC2 PVADJ */ const SDR_type_01h_t SDR_FMC2_VADJ = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -336,16 +322,14 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -368,8 +352,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ .lower_critical_thr = 32, /* Lower critical Threshold */ .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ - .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ .OEM = 0x00, /* OEM reserved */ @@ -393,16 +377,14 @@ const SDR_type_01h_t SDR_FMC2_P3V3 = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -452,16 +434,14 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -473,17 +453,17 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 156, /* Normal maximum - 5A per sensor */ + .nominal_reading = 32, /* Nominal reading = 1A */ + .normal_max = 125, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -495,7 +475,6 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { /* FMC1 PVADJ Current */ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -509,38 +488,36 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ .linearization = 0x00, /* Linearization */ - .M = 32, /* M -> Current LSB*20 */ + .M = 32, /* M */ .M_tol = 0x00, /* M - Tolerance */ .B = 0x00, /* B */ .B_accuracy = 0x00, /* B - Accuracy */ .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ + .nominal_reading = 39, /* Nominal reading - 1.24A */ + .normal_max = 47, /* Normal maximum - 1.5A*/ + .normal_min = 0, /* Normal minimum - 0A */ .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ .sensor_min_reading = 0x80, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -552,7 +529,6 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { /* FMC1 P3V3 Current */ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -566,16 +542,14 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ - .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ + .event_reading_type = 0x01, /* sensor reading */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -586,17 +560,17 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 52, /* Nominal reading */ - .normal_max = 59, /* Normal maximum */ - .normal_min = 45, /* Normal minimum */ + .nominal_reading = 85, /* Nominal reading */ + .normal_max = 94, /* Normal maximum - 3A */ + .normal_min = 32, /* Normal minimum - 1A */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -608,7 +582,6 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { /* FMC2 12V Current */ const SDR_type_01h_t SDR_FMC2_12V_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -622,16 +595,14 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ - .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ + .event_reading_type = 0x01, /* sensor reading */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -643,17 +614,17 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 200, /* Normal maximum */ + .nominal_reading = 32, /* Nominal reading = 1A */ + .normal_max = 125, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -665,7 +636,6 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { /* FMC2 PVADJ Current */ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -679,16 +649,14 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -700,17 +668,17 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .nominal_reading = 39, /* Nominal reading - 1.24A */ + .normal_max = 47, /* Normal maximum - 1.5A*/ + .normal_min = 0, /* Normal minimum - 0A */ + .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ + .sensor_min_reading = 0x80, /* Sensor Minimum reading */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -722,7 +690,6 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { /* FMC2 P3V3 Current */ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -736,16 +703,14 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -756,17 +721,17 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 52, /* Nominal reading */ - .normal_max = 59, /* Normal maximum */ - .normal_min = 45, /* Normal minimum */ + .nominal_reading = 85, /* Nominal reading */ + .normal_max = 94, /* Normal maximum - 3A */ + .normal_min = 32, /* Normal minimum - 1A */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -780,7 +745,6 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { #ifdef MODULE_LM75 /* LM75 SDR List */ const SDR_type_01h_t SDR_LM75_uC = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -794,16 +758,14 @@ const SDR_type_01h_t SDR_LM75_uC = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -836,7 +798,6 @@ const SDR_type_01h_t SDR_LM75_uC = { }; const SDR_type_01h_t SDR_LM75_ADN4604 = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -850,16 +811,14 @@ const SDR_type_01h_t SDR_LM75_ADN4604 = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -892,7 +851,6 @@ const SDR_type_01h_t SDR_LM75_ADN4604 = { }; const SDR_type_01h_t SDR_LM75_DCDC = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -906,16 +864,14 @@ const SDR_type_01h_t SDR_LM75_DCDC = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -948,7 +904,6 @@ const SDR_type_01h_t SDR_LM75_DCDC = { }; const SDR_type_01h_t SDR_LM75_RAM = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -962,16 +917,14 @@ const SDR_type_01h_t SDR_LM75_RAM = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -1006,7 +959,6 @@ const SDR_type_01h_t SDR_LM75_RAM = { #ifdef MODULE_MAX6642 const SDR_type_01h_t SDR_MAX6642_FPGA = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -1020,16 +972,14 @@ const SDR_type_01h_t SDR_MAX6642_FPGA = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x0, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -1093,6 +1043,7 @@ void amc_sdr_init( void ) #endif #ifdef MODULE_MAX6642 + /* FPGA Die Temperature */ sdr_insert_entry( TYPE_01, (void *) &SDR_MAX6642_FPGA, &vTaskMAX6642_Handle, 0, CHIP_ID_MAX6642 ); #endif diff --git a/port/board/afc-bpm/v3_1/sdr_list.c b/port/board/afc-bpm/v3_1/sdr_list.c index ff85c3c91..79002fa1e 100644 --- a/port/board/afc-bpm/v3_1/sdr_list.c +++ b/port/board/afc-bpm/v3_1/sdr_list.c @@ -69,10 +69,8 @@ const SDR_type_02h_t SDR_HOTSWAP_AMC = { .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ .event_reading_type = 0x6f, /* sensor reading*/ - .assertion_event_mask = { 0x00, /* LSB assert event mask: 3 bit value */ - 0x00 }, /* MSB assert event mask */ - .deassertion_event_mask = { 0x00, /* LSB deassert event mask: 3 bit value */ - 0x00 }, /* MSB deassert event mask */ + .assertion_event_mask = 0x0000, /* assertion event mask */ + .deassertion_event_mask = 0x0000, /* deassertion event mask */ .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ @@ -112,10 +110,8 @@ const SDR_type_01h_t SDR_FMC1_12V = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -168,10 +164,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -224,10 +218,8 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -279,10 +271,8 @@ const SDR_type_01h_t SDR_FMC2_12V = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -335,10 +325,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -353,7 +341,6 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ .nominal_reading = 39, /* Nominal reading */ - .nominal_reading = 39, /* Nominal reading */ .normal_max = 47, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ @@ -393,10 +380,8 @@ const SDR_type_01h_t SDR_FMC2_P3V3 = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -452,10 +437,8 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -508,10 +491,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -564,10 +545,8 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading */ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -619,10 +598,8 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading */ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -675,10 +652,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -731,10 +706,8 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -788,10 +761,8 @@ const SDR_type_01h_t SDR_LM75_uC = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -843,10 +814,8 @@ const SDR_type_01h_t SDR_LM75_ADN4604 = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -898,10 +867,8 @@ const SDR_type_01h_t SDR_LM75_DCDC = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -953,10 +920,8 @@ const SDR_type_01h_t SDR_LM75_RAM = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ @@ -1010,10 +975,8 @@ const SDR_type_01h_t SDR_MAX6642_FPGA = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x0, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ diff --git a/port/board/afc-timing/sdr_list.c b/port/board/afc-timing/sdr_list.c index 420d2e488..12c8bb703 100644 --- a/port/board/afc-timing/sdr_list.c +++ b/port/board/afc-timing/sdr_list.c @@ -69,10 +69,8 @@ const SDR_type_02h_t SDR_HOTSWAP_AMC = { .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ .event_reading_type = 0x6f, /* sensor reading*/ - .assertion_event_mask = { 0x00, /* LSB assert event mask: 3 bit value */ - 0x00 }, /* MSB assert event mask */ - .deassertion_event_mask = { 0x00, /* LSB deassert event mask: 3 bit value */ - 0x00 }, /* MSB deassert event mask */ + .assertion_event_mask = 0x0000, /* assertion event mask */ + .deassertion_event_mask = 0x0000, /* deassertion event mask */ .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ @@ -113,12 +111,10 @@ const SDR_type_01h_t SDR_FMC1_12V = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -170,12 +166,10 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -227,12 +221,10 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -283,12 +275,10 @@ const SDR_type_01h_t SDR_FMC2_12V = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -340,12 +330,10 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -397,12 +385,10 @@ const SDR_type_01h_t SDR_FMC2_P3V3 = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x04, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -456,12 +442,10 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -513,12 +497,10 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -570,12 +552,10 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -626,12 +606,10 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -683,12 +661,10 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -740,12 +716,10 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -798,12 +772,10 @@ const SDR_type_01h_t SDR_LM75_uC = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -854,12 +826,10 @@ const SDR_type_01h_t SDR_LM75_ADN4604 = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -910,12 +880,10 @@ const SDR_type_01h_t SDR_LM75_DCDC = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -966,12 +934,10 @@ const SDR_type_01h_t SDR_LM75_RAM = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -1024,12 +990,10 @@ const SDR_type_01h_t SDR_MAX6642_FPGA = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ diff --git a/port/board/rtm-8sfp/sdr_list.c b/port/board/rtm-8sfp/sdr_list.c index e7ab83791..94aad3c6a 100644 --- a/port/board/rtm-8sfp/sdr_list.c +++ b/port/board/rtm-8sfp/sdr_list.c @@ -46,10 +46,8 @@ const SDR_type_02h_t SDR_HOTSWAP_RTM = { .sensorcap = 0xc1, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_HOT_SWAP, /* sensor type: HOT SWAP*/ .event_reading_type = 0x6f, /* sensor reading*/ - .assertion_event_mask = { 0x00, /* LSB assert event mask: 3 bit value */ - 0x00 }, /* MSB assert event mask */ - .deassertion_event_mask = { 0x00, /* LSB deassert event mask: 3 bit value */ - 0x00 }, /* MSB deassert event mask */ + .assertion_event_mask = 0x0000, /* assertion event mask */ + .deassertion_event_mask = 0x0000, /* deassertion event mask */ .readable_threshold_mask = 0x00, /* LSB: readable Threshold mask: no thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: no thresholds are setable: */ .sensor_units_1 = 0xc0, /* sensor units 1 : Does not return analog reading*/ @@ -88,12 +86,10 @@ const SDR_type_01h_t SDR_LM75_RTM_1 = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ @@ -144,12 +140,10 @@ const SDR_type_01h_t SDR_LM75_RTM_2 = { .sensorcap = 0x68, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = { 0xFF, /* LSB assert event mask: 3 bit value */ - 0x0F }, /* MSB assert event mask */ - .deassertion_event_mask = { 0xFF, /* LSB deassert event mask: 3 bit value */ - 0x0F }, /* MSB deassert event mask */ - .readable_threshold_mask = 0x3F, /* LSB: readabled Threshold mask: all thresholds are readabled: */ - .settable_threshold_mask = 0x3F, /* MSB: setabled Threshold mask: all thresholds are setabled: */ + .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ + .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ From 013679461add3f7ad57e4ebea2462ba0a579f33b Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 16 Jul 2019 15:19:21 -0300 Subject: [PATCH 10/21] [port/board/afc-timing/sdr_list] Update threshold values Following the update on afc-bpm board on 523bd29 --- port/board/afc-timing/sdr_list.c | 214 +++++++++++++++---------------- 1 file changed, 100 insertions(+), 114 deletions(-) diff --git a/port/board/afc-timing/sdr_list.c b/port/board/afc-timing/sdr_list.c index 12c8bb703..3d7d69cb6 100644 --- a/port/board/afc-timing/sdr_list.c +++ b/port/board/afc-timing/sdr_list.c @@ -107,8 +107,8 @@ const SDR_type_01h_t SDR_FMC1_12V = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -133,7 +133,7 @@ const SDR_type_01h_t SDR_FMC1_12V = { .sensor_min_reading = 0x00, /* Sensor Minimum reading */ .upper_nonrecover_thr = 205, /* Upper non-recoverable Threshold */ .upper_critical_thr = 200, /* Upper critical Threshold */ - .upper_noncritical_thr = 190, /* Upper non critical Threshold */ + .upper_noncritical_thr = 195, /* Upper non critical Threshold */ .lower_nonrecover_thr = 170, /* Lower non-recoverable Threshold */ .lower_critical_thr = 175, /* Lower critical Threshold */ .lower_noncritical_thr = 180, /* Lower non-critical Threshold */ @@ -148,7 +148,6 @@ const SDR_type_01h_t SDR_FMC1_12V = { /* FMC1 PVADJ */ const SDR_type_01h_t SDR_FMC1_VADJ = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -162,8 +161,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -192,8 +191,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ .lower_critical_thr = 32, /* Lower critical Threshold */ .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ - .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ .OEM = 0x00, /* OEM reserved */ @@ -203,7 +202,6 @@ const SDR_type_01h_t SDR_FMC1_VADJ = { /* FMC1 P3V3 */ const SDR_type_01h_t SDR_FMC1_P3V3 = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -217,8 +215,8 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -257,7 +255,6 @@ const SDR_type_01h_t SDR_FMC1_P3V3 = { /* FMC2 12V */ const SDR_type_01h_t SDR_FMC2_12V = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -271,8 +268,8 @@ const SDR_type_01h_t SDR_FMC2_12V = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: Voltage*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -312,7 +309,6 @@ const SDR_type_01h_t SDR_FMC2_12V = { /* FMC2 PVADJ */ const SDR_type_01h_t SDR_FMC2_VADJ = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -326,8 +322,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -356,8 +352,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ = { .lower_nonrecover_thr = 28, /* Lower non-recoverable Threshold */ .lower_critical_thr = 32, /* Lower critical Threshold */ .lower_noncritical_thr = 36, /* Lower non-critical Threshold */ - .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ - .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ + .pos_thr_hysteresis = 1, /* positive going Threshold hysteresis value */ + .neg_thr_hysteresis = 1, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ .reserved2 = 0x00, /* reserved */ .OEM = 0x00, /* OEM reserved */ @@ -381,8 +377,8 @@ const SDR_type_01h_t SDR_FMC2_P3V3 = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_VOLTAGE, /* sensor type: VOLTAGE*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -438,9 +434,9 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ @@ -457,17 +453,17 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 156, /* Normal maximum - 5A per sensor */ + .nominal_reading = 32, /* Nominal reading = 1A */ + .normal_max = 125, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -479,7 +475,6 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { /* FMC1 PVADJ Current */ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -493,9 +488,9 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ @@ -505,24 +500,24 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .sensor_units_2 = 0x05, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ .linearization = 0x00, /* Linearization */ - .M = 32, /* M -> Current LSB*20 */ + .M = 32, /* M */ .M_tol = 0x00, /* M - Tolerance */ .B = 0x00, /* B */ .B_accuracy = 0x00, /* B - Accuracy */ .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ + .nominal_reading = 39, /* Nominal reading - 1.24A */ + .normal_max = 47, /* Normal maximum - 1.5A*/ + .normal_min = 0, /* Normal minimum - 0A */ .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ .sensor_min_reading = 0x80, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -534,7 +529,6 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { /* FMC1 P3V3 Current */ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -548,10 +542,10 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ - .event_reading_type = 0x01, /* sensor reading*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ + .event_reading_type = 0x01, /* sensor reading */ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ @@ -567,16 +561,16 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ .nominal_reading = 85, /* Nominal reading */ - .normal_max = 125, /* Normal maximum */ - .normal_min = 30, /* Normal minimum */ + .normal_max = 94, /* Normal maximum - 3A */ + .normal_min = 32, /* Normal minimum - 1A */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 110, /* Upper critical Threshold */ - .upper_noncritical_thr = 95, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 10, /* Lower critical Threshold */ - .lower_noncritical_thr = 30, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -588,7 +582,6 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { /* FMC2 12V Current */ const SDR_type_01h_t SDR_FMC2_12V_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -602,10 +595,10 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Voltage*/ - .event_reading_type = 0x01, /* sensor reading*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ + .event_reading_type = 0x01, /* sensor reading */ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ @@ -621,17 +614,17 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .acc_exp_sensor_dir = 0x02, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp = -3 , B-Exp = 0 */ .analog_flags = 0x03, /* Analogue characteristics flags */ - .nominal_reading = 190, /* Nominal reading = 12.285V */ - .normal_max = 200, /* Normal maximum */ + .nominal_reading = 32, /* Nominal reading = 1A */ + .normal_max = 125, /* Normal maximum */ .normal_min = 0, /* Normal minimum */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -643,7 +636,6 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { /* FMC2 PVADJ Current */ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -657,8 +649,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -676,17 +668,17 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .acc_exp_sensor_dir = 0x00, /* Sensor direction */ .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ - .nominal_reading = 39, /* Nominal reading */ - .normal_max = 47, /* Normal maximum */ - .normal_min = 0, /* Normal minimum */ - .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ - .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 100, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 90, /* Upper critical Threshold */ - .upper_noncritical_thr = 80, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -60, /* Lower non-recoverable Threshold */ - .lower_critical_thr = -50, /* Lower critical Threshold */ - .lower_noncritical_thr = 10, /* Lower non-critical Threshold */ + .nominal_reading = 39, /* Nominal reading - 1.24A */ + .normal_max = 47, /* Normal maximum - 1.5A*/ + .normal_min = 0, /* Normal minimum - 0A */ + .sensor_max_reading = 0x7F, /* Sensor Maximum reading */ + .sensor_min_reading = 0x80, /* Sensor Minimum reading */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -698,7 +690,6 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { /* FMC2 P3V3 Current */ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -712,9 +703,9 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ - .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: VOLTAGE*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm */ + .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ @@ -731,16 +722,16 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .Rexp_Bexp = 0xD0, /* R-Exp , B-Exp */ .analog_flags = 0x00, /* Analogue characteristics flags */ .nominal_reading = 85, /* Nominal reading */ - .normal_max = 125, /* Normal maximum */ - .normal_min = 30, /* Normal minimum */ + .normal_max = 94, /* Normal maximum - 3A */ + .normal_min = 32, /* Normal minimum - 1A */ .sensor_max_reading = 0xFF, /* Sensor Maximum reading */ .sensor_min_reading = 0x00, /* Sensor Minimum reading */ - .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold */ - .upper_critical_thr = 110, /* Upper critical Threshold */ - .upper_noncritical_thr = 95, /* Upper non critical Threshold */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold */ - .lower_critical_thr = 10, /* Lower critical Threshold */ - .lower_noncritical_thr = 30, /* Lower non-critical Threshold */ + .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ + .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ + .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ + .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -754,7 +745,6 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { #ifdef MODULE_LM75 /* LM75 SDR List */ const SDR_type_01h_t SDR_LM75_uC = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -768,8 +758,8 @@ const SDR_type_01h_t SDR_LM75_uC = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -808,7 +798,6 @@ const SDR_type_01h_t SDR_LM75_uC = { }; const SDR_type_01h_t SDR_LM75_ADN4604 = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -822,8 +811,8 @@ const SDR_type_01h_t SDR_LM75_ADN4604 = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -862,7 +851,6 @@ const SDR_type_01h_t SDR_LM75_ADN4604 = { }; const SDR_type_01h_t SDR_LM75_DCDC = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -876,8 +864,8 @@ const SDR_type_01h_t SDR_LM75_DCDC = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -916,7 +904,6 @@ const SDR_type_01h_t SDR_LM75_DCDC = { }; const SDR_type_01h_t SDR_LM75_RAM = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -930,8 +917,8 @@ const SDR_type_01h_t SDR_LM75_RAM = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ @@ -972,7 +959,6 @@ const SDR_type_01h_t SDR_LM75_RAM = { #ifdef MODULE_MAX6642 const SDR_type_01h_t SDR_MAX6642_FPGA = { - .hdr.recID_LSB = 0x00, /* Filled by sdr_insert_entry() */ .hdr.recID_MSB = 0x00, .hdr.SDRversion = 0x51, @@ -986,14 +972,14 @@ const SDR_type_01h_t SDR_MAX6642_FPGA = { /* record body bytes */ .entityID = 0xC1, /* entity id: AMC Module */ .entityinstance = 0x00, /* entity instance -> SDR_Init */ - .sensorinit = 0x7f, /* init: event generation + scanning enabled */ - .sensorcap = 0x68, /* capabilities: auto re-arm,*/ + .sensorinit = 0x7F, /* init: event generation + scanning enabled */ + .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_TEMPERATURE, /* sensor type */ .event_reading_type = 0x01, /* sensor reading*/ .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ - .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ + .settable_threshold_mask = 0x0, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x00, /* sensor units 1 :*/ .sensor_units_2 = 0x01, /* sensor units 2 :*/ .sensor_units_3 = 0x00, /* sensor units 3 :*/ From 7172fca6c09a93a6fc87e9695e74c909576fd593 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 18 Jul 2019 18:11:58 -0300 Subject: [PATCH 11/21] [modules/hpm] Fix HPM data block size calculation Before the block size was being passed as the max size of the array (20 bytes), not the actual length of useful data sent. This was causing the HPM to report an invalid image size --- modules/hpm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/hpm.c b/modules/hpm.c index 55fb33abd..fbf6328b2 100644 --- a/modules/hpm.c +++ b/modules/hpm.c @@ -293,6 +293,7 @@ IPMI_HANDLER(ipmi_picmg_upload_firmware_block, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_ { uint8_t len = rsp->data_len = 0; uint8_t block_data[HPM_BLOCK_SIZE]; + uint8_t block_sz = req->data_len-2; if (active_id > 7) { /* Component ID out of range */ @@ -303,13 +304,13 @@ IPMI_HANDLER(ipmi_picmg_upload_firmware_block, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_ return; } - memcpy(&block_data[0], &req->data[2], req->data_len-2); + memcpy(&block_data[0], &req->data[2], block_sz); /* TODO: perform checksum of the block */ if (hpm_components[active_id].hpm_upload_block_f) { /* WARNING: This function can't block! */ - rsp->completion_code = hpm_components[active_id].hpm_upload_block_f(&block_data[0], sizeof(block_data)); + rsp->completion_code = hpm_components[active_id].hpm_upload_block_f(&block_data[0], block_sz); } else { rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR; } From 6dec46f11ca7d061e68d8d3030f8a8dd086552e8 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 18 Jul 2019 18:18:56 -0300 Subject: [PATCH 12/21] [port/lpc7xx/lpc17_hpm] Fix magic word writing on FLASH The last page were being completely overwritten, which can cause bugs if there's any useful information on this page. Now just copy the whole page, write the last 4 bytes and write everything back. Also, if there's an error with the image size comparison return before writing the bootloader magic word --- port/ucontroller/nxp/lpc17xx/lpc17_hpm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c index 74c560c9f..14fa8ca35 100644 --- a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c +++ b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c @@ -32,6 +32,7 @@ #include "modules/ipmi.h" #include "boot/boot.h" #include "modules/watchdog.h" +#include "string.h" uint32_t ipmc_page_addr = 0; uint32_t ipmc_image_size = 0; @@ -108,19 +109,18 @@ uint8_t ipmc_hpm_finish_upload( uint32_t image_size ) ipmc_page_addr = 0; } - for(uint16_t i=0; i<(sizeof(ipmc_page)/sizeof(uint32_t)); i++) { - ipmc_page[i] = 0xFFFFFFFF; + if (ipmc_image_size != image_size) { + /* HPM CC: Number of bytes received does not match the size provided in the "Finish firmware upload" request */ + return 0x81; } + /* Copy the last page (we'll change only the last word) */ + memcpy(ipmc_page, (uint32_t *) (UPGRADE_FLASH_END_ADDR-IPMC_UPDATE_ADDRESS_OFFSET-256), sizeof(ipmc_page)); - /* BUG: This will overwrite the last page in the flash */ /* TODO: Write actual firmware ID */ + /* Write bootloader magic word */ ipmc_page[63] = 0x55555555; - ipmc_program_page( UPGRADE_FLASH_END_ADDR-IPMC_UPDATE_ADDRESS_OFFSET-256, ipmc_page, sizeof(ipmc_page)); + ipmc_program_page( UPGRADE_FLASH_END_ADDR-256, ipmc_page, sizeof(ipmc_page)); - if (ipmc_image_size != image_size) { - /* HPM CC: Number of bytes received does not match the size provided in the "Finish firmware upload" request */ - return 0x81; - } return IPMI_CC_OK; } From e9c35e70ab53979506d918170feb6619a965976d Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Thu, 18 Jul 2019 09:57:13 -0300 Subject: [PATCH 13/21] [port/board/afc-bpm/*/sdr_list] Remove lower thresholds for current sensors Low current on current sensors don't mean anything useful on this board --- port/board/afc-bpm/v3_1/sdr_list.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/port/board/afc-bpm/v3_1/sdr_list.c b/port/board/afc-bpm/v3_1/sdr_list.c index 79002fa1e..bf881dbdf 100644 --- a/port/board/afc-bpm/v3_1/sdr_list.c +++ b/port/board/afc-bpm/v3_1/sdr_list.c @@ -437,8 +437,8 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -491,8 +491,8 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -545,8 +545,8 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading */ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -598,8 +598,8 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: Current */ .event_reading_type = 0x01, /* sensor reading */ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -652,8 +652,8 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm,*/ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: voltage*/ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ @@ -706,8 +706,8 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .sensorcap = 0x56, /* capabilities: auto re-arm */ .sensortype = SENSOR_TYPE_CURRENT, /* sensor type: CURRENT */ .event_reading_type = 0x01, /* sensor reading*/ - .assertion_event_mask = 0x7A95, /* assertion event mask (All upper going-high and lower going-low events) */ - .deassertion_event_mask = 0x7A95, /* deassertion event mask (All upper going-high and lower going-low events) */ + .assertion_event_mask = 0x0A80, /* assertion event mask (All upper going-high and lower going-low events) */ + .deassertion_event_mask = 0x7A80, /* deassertion event mask (All upper going-high and lower going-low events) */ .readable_threshold_mask = 0x3F, /* LSB: readable Threshold mask: all thresholds are readable: */ .settable_threshold_mask = 0x00, /* MSB: setable Threshold mask: none of the thresholds are setable: */ .sensor_units_1 = 0x80, /* sensor units 1 :*/ From 2e6ce67d83f3b99099b234dd4824b75620354ef1 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 23 Jul 2019 14:01:58 -0300 Subject: [PATCH 14/21] [port/lpc17xx/lpc17_hpm] Fix bootloader magic work address calc --- port/ucontroller/nxp/lpc17xx/lpc17_hpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c index 14fa8ca35..e7d14b265 100644 --- a/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c +++ b/port/ucontroller/nxp/lpc17xx/lpc17_hpm.c @@ -114,12 +114,12 @@ uint8_t ipmc_hpm_finish_upload( uint32_t image_size ) return 0x81; } /* Copy the last page (we'll change only the last word) */ - memcpy(ipmc_page, (uint32_t *) (UPGRADE_FLASH_END_ADDR-IPMC_UPDATE_ADDRESS_OFFSET-256), sizeof(ipmc_page)); + memcpy(ipmc_page, (uint32_t *) (UPGRADE_FLASH_END_ADDR-256), sizeof(ipmc_page)); /* TODO: Write actual firmware ID */ /* Write bootloader magic word */ ipmc_page[63] = 0x55555555; - ipmc_program_page( UPGRADE_FLASH_END_ADDR-256, ipmc_page, sizeof(ipmc_page)); + ipmc_program_page( UPGRADE_FLASH_END_ADDR-IPMC_UPDATE_ADDRESS_OFFSET-256, ipmc_page, sizeof(ipmc_page)); return IPMI_CC_OK; } From 03779af31494fbb4cd7e951c0b5a67415c3c8933 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 23 Jul 2019 14:02:57 -0300 Subject: [PATCH 15/21] [modules/sdr] Only check the state of enabled sensors --- modules/sdr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/sdr.c b/modules/sdr.c index 34e76c03e..71f900803 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -458,6 +458,9 @@ void sensor_state_check( sensor_t *sensor ) SDR_type_01h_t * sdr = (SDR_type_01h_t *) sensor->sdr; if(sdr == NULL || sdr->hdr.rectype != TYPE_01) return; + /* Only check enabled sensors */ + if (!(sensor->event_scan & 0xC0)) return; + if(compare_val(sensor->readout_value, sdr->lower_noncritical_thr, UPPER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->upper_noncritical_thr, LOWER_EQ, sensor->signed_flag)) { sensor->state = SENSOR_STATE_NORMAL; } else if(compare_val(sensor->readout_value, sdr->upper_noncritical_thr, UPPER_EQ, sensor->signed_flag) && compare_val(sensor->readout_value, sdr->upper_critical_thr, LOWER_EQ, sensor->signed_flag)) { From 2612f88f64438b75ddfae5b74c85ee7a4b73eb94 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 23 Jul 2019 16:49:44 -0300 Subject: [PATCH 16/21] [port/board/afc*/sdr_list] Update current sensors thresholds --- port/board/afc-bpm/v3_1/sdr_list.c | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/port/board/afc-bpm/v3_1/sdr_list.c b/port/board/afc-bpm/v3_1/sdr_list.c index bf881dbdf..6f0915d91 100644 --- a/port/board/afc-bpm/v3_1/sdr_list.c +++ b/port/board/afc-bpm/v3_1/sdr_list.c @@ -460,9 +460,9 @@ const SDR_type_01h_t SDR_FMC1_12V_CURR = { .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -514,9 +514,9 @@ const SDR_type_01h_t SDR_FMC1_VADJ_CURR = { .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ - .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ - .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -567,9 +567,9 @@ const SDR_type_01h_t SDR_FMC1_P3V3_CURR = { .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -621,9 +621,9 @@ const SDR_type_01h_t SDR_FMC2_12V_CURR = { .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ .upper_noncritical_thr = 95, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 15, /* Lower non-critical Threshold - 0.5A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.5A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -675,9 +675,9 @@ const SDR_type_01h_t SDR_FMC2_VADJ_CURR = { .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -10, /* Lower non-recoverable Threshold - -0.32A */ - .lower_critical_thr = 0, /* Lower critical Threshold - 0A */ - .lower_noncritical_thr = 5, /* Lower non-critical Threshold - 0.16A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.32A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 0.16A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ @@ -728,9 +728,9 @@ const SDR_type_01h_t SDR_FMC2_P3V3_CURR = { .upper_nonrecover_thr = 125, /* Upper non-recoverable Threshold - 4A */ .upper_critical_thr = 110, /* Upper critical Threshold - 3.5A */ .upper_noncritical_thr = 94, /* Upper non critical Threshold - 3A */ - .lower_nonrecover_thr = -5, /* Lower non-recoverable Threshold - -0.1A */ - .lower_critical_thr = 10, /* Lower critical Threshold - 0.32A */ - .lower_noncritical_thr = 32, /* Lower non-critical Threshold - 1A */ + .lower_nonrecover_thr = -15, /* Lower non-recoverable Threshold - -0.1A */ + .lower_critical_thr = -10, /* Lower critical Threshold - 0.32A */ + .lower_noncritical_thr = -5, /* Lower non-critical Threshold - 1A */ .pos_thr_hysteresis = 2, /* positive going Threshold hysteresis value */ .neg_thr_hysteresis = 2, /* negative going Threshold hysteresis value */ .reserved1 = 0x00, /* reserved */ From 3e2a885ead542f141b2c7b4b457cd3c058234e3e Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Tue, 23 Jul 2019 16:50:43 -0300 Subject: [PATCH 17/21] [modules/sensors/ina220] Delay task after reading all sensors --- modules/sensors/ina220.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sensors/ina220.c b/modules/sensors/ina220.c index f7b4df98f..be0890cfa 100644 --- a/modules/sensors/ina220.c +++ b/modules/sensors/ina220.c @@ -103,8 +103,8 @@ void vTaskINA220( void *Parameters ) sensor_state_check(ina220_sensor); check_sensor_event(ina220_sensor); - vTaskDelayUntil( &xLastWakeTime, xFrequency ); } + vTaskDelayUntil( &xLastWakeTime, xFrequency ); } } From 5e4bdf48e65a0d555c5d2b518fa9bbe0c0f49a99 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Mon, 29 Jul 2019 08:06:07 -0300 Subject: [PATCH 18/21] [modules/main] Add missing comma on printf --- modules/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/main.c b/modules/main.c index 54d40d4c9..bf263942d 100755 --- a/modules/main.c +++ b/modules/main.c @@ -49,7 +49,7 @@ int main( void ) #endif printf("openMMC Starting!\n"); - printf("Build date: %s %s\n" __DATE__, __TIME__); + printf("Build date: %s %s\n", __DATE__, __TIME__); printf("Version: %s\n", g_GIT_TAG); printf("SHA1: %s\n", g_GIT_SHA1); From b7df63b53ba28ddb83d9c31370c71de9f359cfbe Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Mon, 29 Jul 2019 08:29:05 -0300 Subject: [PATCH 19/21] [modules/ipmb] Properly block when trying to send IPMI request --- modules/ipmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ipmb.c b/modules/ipmb.c index 504e3201d..de2f32af8 100644 --- a/modules/ipmb.c +++ b/modules/ipmb.c @@ -260,7 +260,7 @@ ipmb_error ipmb_send_request ( ipmi_msg * req ) req_cfg->retries = 0; /* Blocks here until is able put message in tx queue */ - if (xQueueSend( ipmb_txqueue, &req_cfg, 1) != pdTRUE ){ + if (xQueueSend( ipmb_txqueue, &req_cfg, portMAX_DELAY) != pdTRUE ){ vPortFree( req_cfg ); return ipmb_error_failure; } From 2154651c9fb53a96bb7cb0ef1630466a75693a89 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Mon, 29 Jul 2019 08:31:09 -0300 Subject: [PATCH 20/21] [modules/ipmb] Increase IPMI TX and RX queue lenghts --- modules/ipmb.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ipmb.h b/modules/ipmb.h index be8d169eb..82e060691 100644 --- a/modules/ipmb.h +++ b/modules/ipmb.h @@ -48,11 +48,12 @@ /** * @brief Maximum count of messages to be sent */ -#define IPMB_TXQUEUE_LEN 2 +#define IPMB_TXQUEUE_LEN 10 + /** - * @brief Maximum count if received messages to be delivered to client task + * @brief Maximum count of received messages to be delivered to client task */ -#define IPMB_CLIENT_QUEUE_LEN 2 +#define IPMB_CLIENT_QUEUE_LEN 10 /** * @brief Maximum retries made by IPMB TX Task when sending a message From b393759e02e275f54462205c181d67cb7a8a4b86 Mon Sep 17 00:00:00 2001 From: Henrique Silva Date: Mon, 29 Jul 2019 08:52:45 -0300 Subject: [PATCH 21/21] [modules/sdr] Send threshold event right after trigger comparison We can have multiple assertions/deassertions in one check, so we should send all the events accordingly --- modules/sdr.c | 58 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/modules/sdr.c b/modules/sdr.c index 71f900803..33d40674e 100644 --- a/modules/sdr.c +++ b/modules/sdr.c @@ -507,14 +507,19 @@ void check_sensor_event( sensor_t * sensor ) /* Only check enabled sensors */ if (!(sensor->event_scan & 0xC0)) return; + /* The 0x50 OR'ed in ev[0] indicates that the sensor read value and threshold + * that triggered the event will be present in bytes 1 and 2, respectively */ + /** Compare threshold with the upper thresholds */ /** Upper non-critical threshold going-high */ if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_UNC_GH)) { if(!sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, sdr->upper_noncritical_thr, UPPER_EQ, sensor->signed_flag)){ ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[0] = 0x50 | IPMI_THRESHOLD_UNC_GH; + ev[1] = sensor->readout_value; ev[2] = sdr->upper_noncritical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.upper_non_critical_go_high = 1; } } @@ -522,8 +527,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_UNC_GH)) { if(sensor->asserted_event.upper_non_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_noncritical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNC_GH; + ev[0] = 0x50 | IPMI_THRESHOLD_UNC_GH; + ev[1] = sensor->readout_value; ev[2] = sdr->upper_noncritical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.upper_non_critical_go_high = 0; } } @@ -532,8 +539,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_UC_GH)) { if(!sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, sdr->upper_critical_thr, UPPER_EQ, sensor->signed_flag)){ ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UC_GH; + ev[0] = 0x50 | IPMI_THRESHOLD_UC_GH; + ev[1] = sensor->readout_value; ev[2] = sdr->upper_critical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.upper_critical_go_high = 1; } } @@ -541,8 +550,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_UC_GH)) { if(sensor->asserted_event.upper_critical_go_high && compare_val(sensor->readout_value, (sdr->upper_critical_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UC_GH; + ev[0] = 0x50 | IPMI_THRESHOLD_UC_GH; + ev[1] = sensor->readout_value; ev[2] = sdr->upper_critical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.upper_critical_go_high = 0; } } @@ -551,8 +562,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_UNR_GH)) { if(!sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->upper_nonrecover_thr, UPPER_EQ, sensor->signed_flag)){ ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[0] = 0x50 | IPMI_THRESHOLD_UNR_GH; + ev[1] = sensor->readout_value; ev[2] = sdr->upper_nonrecover_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.upper_non_recoverable_go_high = 1; } } @@ -560,8 +573,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_UNR_GH)) { if(sensor->asserted_event.upper_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->upper_nonrecover_thr - sdr->neg_thr_hysteresis), LOWER_EQ, sensor->signed_flag)){ ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_UNR_GH; + ev[0] = 0x50 | IPMI_THRESHOLD_UNR_GH; + ev[1] = sensor->readout_value; ev[2] = sdr->upper_nonrecover_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.upper_non_recoverable_go_high = 0; } } @@ -570,8 +585,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_LNC_GL)) { if(!sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, sdr->lower_noncritical_thr, LOWER_EQ, sensor->signed_flag)){ ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[0] = 0x50 | IPMI_THRESHOLD_LNC_GL; + ev[1] = sensor->readout_value; ev[2] = sdr->lower_noncritical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.lower_non_critical_go_low = 1; } } @@ -579,8 +596,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_LNC_GL)) { if(sensor->asserted_event.lower_non_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_noncritical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNC_GL; + ev[0] = 0x50 | IPMI_THRESHOLD_LNC_GL; + ev[1] = sensor->readout_value; ev[2] = sdr->lower_noncritical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.lower_non_critical_go_low = 0; } } @@ -589,8 +608,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_LC_GL)) { if(!sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, sdr->lower_critical_thr, LOWER_EQ, sensor->signed_flag)){ ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LC_GL; + ev[0] = 0x50 | IPMI_THRESHOLD_LC_GL; + ev[1] = sensor->readout_value; ev[2] = sdr->lower_critical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.lower_critical_go_low = 1; } } @@ -598,8 +619,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_LC_GL)) { if(sensor->asserted_event.lower_critical_go_low && compare_val(sensor->readout_value, (sdr->lower_critical_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LC_GL; + ev[0] = 0x50 | IPMI_THRESHOLD_LC_GL; + ev[1] = sensor->readout_value; ev[2] = sdr->lower_critical_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.lower_critical_go_low = 0; } } @@ -608,8 +631,10 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->assertion_event_mask & (1 << IPMI_THRESHOLD_LNR_GL)) { if(!sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, sdr->lower_nonrecover_thr, LOWER_EQ, sensor->signed_flag)){ ev_type = ASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[0] = 0x50 | IPMI_THRESHOLD_LNR_GL; + ev[1] = sensor->readout_value; ev[2] = sdr->lower_nonrecover_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.lower_non_recoverable_go_high = 1; } } @@ -617,18 +642,13 @@ void check_sensor_event( sensor_t * sensor ) if(sdr->deassertion_event_mask & (1 << IPMI_THRESHOLD_LNR_GL)) { if(sensor->asserted_event.lower_non_recoverable_go_high && compare_val(sensor->readout_value, (sdr->lower_nonrecover_thr + sdr->pos_thr_hysteresis), UPPER_EQ, sensor->signed_flag)){ ev_type = DEASSERTION_EVENT; - ev[0] = IPMI_THRESHOLD_LNR_GL; + ev[0] = 0x50 | IPMI_THRESHOLD_LNR_GL; + ev[1] = sensor->readout_value; ev[2] = sdr->lower_nonrecover_thr; + ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); sensor->asserted_event.lower_non_recoverable_go_high = 0; } } - - if ((ev[0] != 0x0F)) { - /* Indicate that threshold and trigger values are indicated in bytes 2 and 3 */ - ev[0] |= 0x50; - ev[1] = sensor->readout_value; - ipmi_event_send(sensor, ev_type, ev, sizeof(ev)); - } } /* Management Controller Device Locator Record 37.9 SDR Type 12h */