diff options
author | mbroyles <mbroyles@us.ibm.com> | 2017-12-12 09:37:26 -0600 |
---|---|---|
committer | Martha Broyles <mbroyles@us.ibm.com> | 2017-12-13 14:35:46 -0500 |
commit | ee8bac060be43708f0e0fc2a0e47877954cdcf78 (patch) | |
tree | abf8c42848620954a2147d3c096be83575c6df28 /src/occ_405/amec | |
parent | 49ea880a77890b05a7b06cdf083122acb7f15a10 (diff) | |
download | talos-occ-ee8bac060be43708f0e0fc2a0e47877954cdcf78.tar.gz talos-occ-ee8bac060be43708f0e0fc2a0e47877954cdcf78.zip |
Ignore bad quad and nest DTS
Correct DTS readings to be 8 bit with msb signed
Change-Id: Ib5d74535abd17696e9b30d63ccd28273ef4ddc61
CQ: SW410935
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50807
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Diffstat (limited to 'src/occ_405/amec')
-rwxr-xr-x | src/occ_405/amec/amec_sensors_core.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/occ_405/amec/amec_sensors_core.c b/src/occ_405/amec/amec_sensors_core.c index b723366..2dbeb15 100755 --- a/src/occ_405/amec/amec_sensors_core.c +++ b/src/occ_405/amec/amec_sensors_core.c @@ -76,6 +76,7 @@ void amec_update_proc_core_sensors(uint8_t i_core) CoreData *l_core_data_ptr; uint32_t l_temp32 = 0; uint16_t l_core_temp = 0; + uint16_t l_quad_temp = 0; uint16_t l_temp16 = 0; uint16_t l_core_util = 0; uint16_t l_core_freq = 0; @@ -183,9 +184,11 @@ void amec_update_proc_core_sensors(uint8_t i_core) // Determine "core" temperature that will be returned in the poll for fan control // If there is at least 1 core online within the same quad use the quad temp else use the nest - if(QUAD_ONLINE(l_quad)) + // verify quad temp is valid (not zero) this may be 0 if there were no valid quad DTS + l_quad_temp = AMECSENSOR_ARRAY_PTR(TEMPQ0, l_quad)->sample; + if( (QUAD_ONLINE(l_quad)) && l_quad_temp ) { - l_core_temp = AMECSENSOR_ARRAY_PTR(TEMPQ0, l_quad)->sample; + l_core_temp = l_quad_temp; } else { @@ -265,8 +268,6 @@ void amec_calc_dts_sensors(CoreData * i_core_data_ptr, uint8_t i_core) { #define DTS_PER_CORE 2 #define QUAD_DTS_PER_CORE 2 -#define DTS_INVALID_MASK 0x0C00 - uint32_t l_coreTemp = 0; uint8_t k = 0; @@ -297,12 +298,13 @@ void amec_calc_dts_sensors(CoreData * i_core_data_ptr, uint8_t i_core) //Check validity if (i_core_data_ptr->dts.core[k].fields.valid) { - l_coreDts[k] = i_core_data_ptr->dts.core[k].fields.reading; + // temperature is only 8 bits of reading field + l_coreDts[k] = (i_core_data_ptr->dts.core[k].fields.reading & 0xFF); l_coreDtsCnt++; - //Hardware bug workaround: Temperatures reaching 0 degrees C - //can show up as negative numbers. To fix this, we discount - //values that have the 2 MSB's set. + //Hardware bug workaround: Module test will detect bad DTS and write coefficients + //to force a reading of 0 or negative to indicate the DTS is bad. + //Throw out any DTS that is bad if(((l_coreDts[k] & DTS_INVALID_MASK) == DTS_INVALID_MASK) || (l_coreDts[k] == 0)) { @@ -338,13 +340,20 @@ void amec_calc_dts_sensors(CoreData * i_core_data_ptr, uint8_t i_core) // DTS values regardless of weight. for (k = 0; k < QUAD_DTS_PER_CORE; k++) { - if (i_core_data_ptr->dts.cache[k].fields.valid) + // temperature is only 8 bits of reading field + l_quadDtsTemp = (i_core_data_ptr->dts.cache[k].fields.reading & 0xFF); + + if( (i_core_data_ptr->dts.cache[k].fields.valid) && + ((l_quadDtsTemp & DTS_INVALID_MASK) != DTS_INVALID_MASK) && + (l_quadDtsTemp != 0) ) { - l_quadDts[k] = i_core_data_ptr->dts.cache[k].fields.reading; + l_quadDts[k] = l_quadDtsTemp; l_quadDtsCnt++; } } + l_quadDtsTemp = 0; + if(l_quadDtsCnt) { if (G_data_cnfg->thrm_thresh.proc_quad_weight) |