diff options
author | William Bryan <wilbryan@us.ibm.com> | 2016-09-23 12:26:05 -0500 |
---|---|---|
committer | William A. Bryan <wilbryan@us.ibm.com> | 2016-10-11 14:45:04 -0400 |
commit | c21550d3951c6b88f12de2b5aa9565a6c23b6bd4 (patch) | |
tree | 6938a483b0d1be783f4ef02d3194fcf4eab015b6 /src | |
parent | 720dfdf376155029a429339f7f862232081ccca0 (diff) | |
download | talos-occ-c21550d3951c6b88f12de2b5aa9565a6c23b6bd4.tar.gz talos-occ-c21550d3951c6b88f12de2b5aa9565a6c23b6bd4.zip |
Save Core & Quad DTS Avgs
Change-Id: I7c57c072f4f84f02ce7bbc5f95c80a4901d6c9a2
RTC:160341
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30180
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/core_data.h | 2 | ||||
-rwxr-xr-x | src/occ_405/Makefile | 1 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_analytics.c | 6 | ||||
-rw-r--r-- | src/occ_405/amec/amec_controller.c | 4 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_health.c | 13 | ||||
-rw-r--r-- | src/occ_405/amec/amec_init.c | 14 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_sensors_core.c | 220 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_slave_smh.c | 4 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_sys.h | 18 | ||||
-rwxr-xr-x | src/occ_405/cmdh/cmdh_fsp_cmds.c | 4 | ||||
-rwxr-xr-x | src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c | 4 | ||||
-rwxr-xr-x | src/occ_405/dcom/dcom.h | 4 | ||||
-rwxr-xr-x | src/occ_405/occ_sys_config.h | 1 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_enum.h | 84 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_info.c | 110 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_table.c | 57 | ||||
-rwxr-xr-x | src/occ_405/thread/chom.c | 4 | ||||
-rw-r--r-- | src/occ_gpe0/core_data.c | 14 |
18 files changed, 342 insertions, 222 deletions
diff --git a/src/include/core_data.h b/src/include/core_data.h index 4787bf6..c3286eb 100644 --- a/src/include/core_data.h +++ b/src/include/core_data.h @@ -103,7 +103,7 @@ typedef struct typedef struct { sensor_result_t core[2]; - sensor_result_t cache; + sensor_result_t cache[2]; sensor_result_t reserved; } CoreDataDts; diff --git a/src/occ_405/Makefile b/src/occ_405/Makefile index 9a67a1f..9c56ad5 100755 --- a/src/occ_405/Makefile +++ b/src/occ_405/Makefile @@ -71,6 +71,7 @@ LIB_DIRS = -L$(OBJDIR) \ -L$(OBJDIR)/mem #default target is to make a binary application image +.PHONY : all all: $(PPETOOLS_OBJDIR)/ppetracepp $(OBJDIR)/$(IMAGE_NAME).bin $(OBJDIR)/$(IMAGE_NAME).dis #This removes all unecessary headers from the ELF executable diff --git a/src/occ_405/amec/amec_analytics.c b/src/occ_405/amec/amec_analytics.c index 9cbb654..fc0ebfe 100755 --- a/src/occ_405/amec/amec_analytics.c +++ b/src/occ_405/amec/amec_analytics.c @@ -304,9 +304,9 @@ void amec_analytics_main(void) tempaccum = tempaccum>>3; g_amec->g44_avg[(i*MSA)+14] = g_amec->g44_avg[(i*MSA)+14] + tempaccum/100; - // hottest processor core temperature (average??) + // hottest processor core temperature (average) g_amec->g44_avg[(i*MSA)+15] = g_amec->g44_avg[(i*MSA)+15] + - (UINT32)g_amec->proc[i].temp4ms.sample; + (UINT32)g_amec->proc[i].tempprocavg.sample; // major changes below to accommodate Group 45 @@ -417,7 +417,7 @@ void amec_analytics_main(void) g_amec->g44_avg[(i * MSA) + 86 + m] = g_amec->g44_avg[(i * MSA) + 86 + m] + (UINT32)(g_amec->proc[i].core[j].ips4ms.sample / 50); // accumulate average MIPS for this core g_amec->g44_avg[(i * MSA) + 98 + m] = g_amec->g44_avg[(i * MSA) + 98 + m] + - (UINT32)g_amec->proc[i].core[j].temp4ms.sample; // accumulate average temperature for this core + (UINT32)g_amec->proc[i].core[j].tempprocthermal.sample; // accumulate average temperature for this core g_amec->g44_avg[(i * MSA) + 110 + m] = 0; // No longer supported (was memory bandwidth) temp16 = ((g_amec->proc[i].core[j].mcpifd4ms.sample) / 100); // accumulate average busy latency counter for this core g_amec->g44_avg[(i * MSA) + 122 + m] = g_amec->g44_avg[(i * MSA) + 122 + m] + (UINT32)temp16; diff --git a/src/occ_405/amec/amec_controller.c b/src/occ_405/amec/amec_controller.c index fee37bb..3f8228a 100644 --- a/src/occ_405/amec/amec_controller.c +++ b/src/occ_405/amec/amec_controller.c @@ -88,9 +88,9 @@ void amec_controller_proc_thermal() /*------------------------------------------------------------------------*/ /* Code */ /*------------------------------------------------------------------------*/ - // Get TEMP4MSP0PEAK sensor, which is hottest core temperature in OCC + // Get TEMPPROCTHRM sensor, which is hottest core temperature in OCC // processor - l_sensor = getSensorByGsid(TEMP4MSP0PEAK); + l_sensor = getSensorByGsid(TEMPPROCTHRM); // Use the highest temperature of all processors in 0.1 degrees C l_thermal_winner = l_sensor->sample * 10; diff --git a/src/occ_405/amec/amec_health.c b/src/occ_405/amec/amec_health.c index 116dd38..81f88fc 100755 --- a/src/occ_405/amec/amec_health.c +++ b/src/occ_405/amec/amec_health.c @@ -818,9 +818,9 @@ void amec_health_check_proc_temp() /*------------------------------------------------------------------------*/ do { - // Get TEMP4MSP0PEAK sensor, which is hottest core temperature + // Get TEMPPROCTHRM sensor, which is hottest core temperature // in OCC processor - l_sensor = getSensorByGsid(TEMP4MSP0PEAK); + l_sensor = getSensorByGsid(TEMPPROCTHRM); l_ot_error = g_amec->thermalproc.ot_error; // Check to see if we exceeded our error temperature @@ -931,7 +931,7 @@ void amec_health_check_proc_timeout() } // Check if this core's temperature sensor has been updated - l_sensor = AMECSENSOR_ARRAY_PTR(TEMP4MSP0C0,i); + l_sensor = AMECSENSOR_ARRAY_PTR(TEMPPROCTHRMC0,i); if (l_sensor->update_tag == G_core_temp_update_tag[i]) { // If the update tag is not changing, then this core's @@ -968,10 +968,11 @@ void amec_health_check_proc_timeout() l_core_data_ptr = proc_get_bulk_core_data_ptr(l_bad_core_index); - TRAC_ERR("Core Sensors[0x%04X%04X] Quad Sensor[0x%04X]", + TRAC_ERR("Core Sensors[0x%04X%04X] Quad Sensor[0x%04X%04X]", (uint16_t)(l_core_data_ptr->dts.core[0].result ), - (uint16_t)(l_core_data_ptr->dts.core[0].result ), - (uint16_t)(l_core_data_ptr->dts.cache.result)); + (uint16_t)(l_core_data_ptr->dts.core[1].result ), + (uint16_t)(l_core_data_ptr->dts.cache[0].result), + (uint16_t)(l_core_data_ptr->dts.cache[1].result)); /* @ * @errortype diff --git a/src/occ_405/amec/amec_init.c b/src/occ_405/amec/amec_init.c index f7b2005..765b005 100644 --- a/src/occ_405/amec/amec_init.c +++ b/src/occ_405/amec/amec_init.c @@ -175,12 +175,12 @@ void amec_init_vector_sensors(void) #define VECTOR_ADD_ELEM_FAILURE 2 //----------------------------------------------------- - // TEMP4MSP0 Vector Sensor + // TEMPPROCAVG Vector Sensor //----------------------------------------------------- - amec_vectorize_core_sensor(AMECSENSOR_PTR(TEMP4MSP0), + amec_vectorize_core_sensor(AMECSENSOR_PTR(TEMPPROCAVG), &g_amec_sys.proc[0].temp4ms_vector, VECTOR_OP_AVG, - TEMP4MSP0C0); + TEMPPROCTHRMC0); //----------------------------------------------------- // FREQA4MSP0 Vector Sensor @@ -199,12 +199,12 @@ void amec_init_vector_sensors(void) IPS4MSP0C0); //----------------------------------------------------- - // TEMP4MSP0PEAK Vector Sensor + // TEMPPROCTHRM Vector Sensor //----------------------------------------------------- - amec_vectorize_core_sensor(AMECSENSOR_PTR(TEMP4MSP0PEAK), - &g_amec_sys.proc[0].temp4mspeak_vector, + amec_vectorize_core_sensor(AMECSENSOR_PTR(TEMPPROCTHRM), + &g_amec_sys.proc[0].tempprocthermal_vector, VECTOR_OP_MAX, - TEMP4MSP0C0); + TEMPPROCTHRMC0); //----------------------------------------------------- // UTIL2MSP0 Vector Sensor diff --git a/src/occ_405/amec/amec_sensors_core.c b/src/occ_405/amec/amec_sensors_core.c index ff4f81e..d29a3ec 100755 --- a/src/occ_405/amec/amec_sensors_core.c +++ b/src/occ_405/amec/amec_sensors_core.c @@ -174,137 +174,137 @@ void amec_update_proc_core_sensors(uint8_t i_core) 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; - uint16_t l_dts[DTS_PER_CORE]; - uint16_t l_quadDts = 0; - BOOLEAN l_update_sensor = FALSE; - uint16_t l_core_hot = 0; - uint8_t l_dtsCnt = 0; //Number of valid Core DTSs + uint32_t l_coreTemp = 0; + uint8_t k = 0; + uint16_t l_coreDts[DTS_PER_CORE] = {0}; + uint16_t l_quadDts[QUAD_DTS_PER_CORE] = {0}; + BOOLEAN l_update_sensor = FALSE; + uint16_t l_core_hot = 0; + uint8_t l_coreDtsCnt = 0; // Number of valid Core DTSs + uint8_t l_quadDtsCnt = 0; // Number of valid Quad DTSs + uint32_t l_dtsAvg = 0; // Average of the two core or quad dts readings - uint8_t cWt = 0; // core weight: zero unless at least one valid core dts reading - uint8_t qWt = 0; // quad weight: zero unless we have a valid quad dts reading + uint8_t cWt = 0; // core weight: zero unless at least one valid core dts reading + uint8_t qWt = 0; // quad weight: zero unless we have a valid quad dts reading - errlHndl_t l_err = NULL; + uint8_t l_quad = 0; // Quad this core resides in - //Clear DTS array. - for (k = 0; k < DTS_PER_CORE; k++) - { - l_dts[k] = 0; - } + static bool L_bad_read_trace = FALSE; - if (i_core_data_ptr != NULL) - { - //the Core DTS temperatures are considered in the calculation only if: - // - They are valid. - // - Non-zero - // - Non-negative - for (k = 0; k < DTS_PER_CORE; k++) + if (i_core_data_ptr != NULL) { - //Check validity - if (i_core_data_ptr->dts.core[k].fields.valid) - { - l_dts[k] = i_core_data_ptr->dts.core[k].fields.reading; - l_dtsCnt++; - - //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. - if(((l_dts[k] & DTS_INVALID_MASK) == DTS_INVALID_MASK) || - (l_dts[k] == 0)) + //the Core DTS temperatures are considered in the calculation only if: + // - They are valid. + // - Non-zero + // - Non-negative + for (k = 0; k < DTS_PER_CORE; k++) { - l_dts[k] = 0; - l_dtsCnt--; - } + //Check validity + if (i_core_data_ptr->dts.core[k].fields.valid) + { + l_coreDts[k] = i_core_data_ptr->dts.core[k].fields.reading; + 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. + if(((l_coreDts[k] & DTS_INVALID_MASK) == DTS_INVALID_MASK) || + (l_coreDts[k] == 0)) + { + l_coreDts[k] = 0; + l_coreDtsCnt--; + } + + if (l_coreDts[k] > l_core_hot) + { + l_core_hot = l_coreDts[k]; + } + } + } //for loop - if (l_dts[k] > l_core_hot) + // The core DTSs are considered only if we have at least 1 valid core DTS and + // a non-zero G_coreWeight. However we want to keep track of the raw core DTS + // values regardless of weight. + if (l_coreDtsCnt) { - l_core_hot = l_dts[k]; - } - } - } //for loop + if (G_data_cnfg->thrm_thresh.proc_core_weight) + { + l_update_sensor = TRUE; + cWt = G_data_cnfg->thrm_thresh.proc_core_weight; + } - //The core DTSs are considered only if we have at least 1 valid core DTS and - //a non-zero G_coreWeight. - if (l_dtsCnt && G_data_cnfg->thrm_thresh.proc_core_weight) - { - l_update_sensor = TRUE; - cWt = G_data_cnfg->thrm_thresh.proc_core_weight; - } + // Update the raw core DTS reading (average of the two) + l_dtsAvg = (l_coreDts[0] + l_coreDts[1]) / l_coreDtsCnt; + sensor_update( AMECSENSOR_ARRAY_PTR(TEMPC0, i_core), l_dtsAvg); + } - //The Quad DTS value is considered only if we have a valid Quad DTS and - //a non-zero quad weight. - if (i_core_data_ptr->dts.cache.fields.valid && - G_data_cnfg->thrm_thresh.proc_quad_weight) - { - l_quadDts = i_core_data_ptr->dts.cache.fields.reading; - l_update_sensor = TRUE; - qWt = G_data_cnfg->thrm_thresh.proc_quad_weight; - } + // The Quad DTS value is considered only if we have a valid Quad DTS and + // a non-zero quad weight. However we want to keep track of the raw Quad + // DTS values regardless of weight. + for (k = 0; k < QUAD_DTS_PER_CORE; k++) + { + if (i_core_data_ptr->dts.cache[k].fields.valid) + { + l_quadDts[k] = i_core_data_ptr->dts.cache[k].fields.reading; + l_quadDtsCnt++; + } + } - // Update the thermal sensor associated with this core - if(l_update_sensor) - { - do + if(l_quadDtsCnt) { - if (!((cWt && l_dtsCnt) || qWt)) + if (G_data_cnfg->thrm_thresh.proc_quad_weight) { - TRAC_ERR("amec_calc_dts_sensors:l_update_sensor Firmware Corrupted! " - "core Weight: %d, valid core DTSs: %d, quad weight: %d", - cWt, l_dtsCnt, qWt); - - /* @ - * @errortype - * @moduleid AMEC_CALC_DTS_SENSORS - * @reasoncode INTERNAL_FW_FAILURE - * @userdata1 core ID for which the assertion failed. - * @userdata2 0 - * @userdata4 OCC_NO_EXTENDED_RC - * @devdesc VRHOT signal has been asserted long enough to - * exceed its error threshold. - * - */ - l_err = createErrl(AMEC_CALC_DTS_SENSORS, - INTERNAL_FW_FAILURE, - OCC_NO_EXTENDED_RC, - ERRL_SEV_PREDICTIVE, - NULL, - DEFAULT_TRACE_SIZE, - i_core, // core ID for which assertion failed. - cWt<<16|l_dtsCnt<<8|qWt); // parameters caused assertion failure. - - // Callout firmware - addCalloutToErrl(l_err, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - - // Commit error log and request reset - REQUEST_RESET(l_err); - - - // Commit Error - commitErrl(&l_err); - break; // avoid potential divide by zero + l_update_sensor = TRUE; + qWt = G_data_cnfg->thrm_thresh.proc_quad_weight; } - //Formula: - // (cWt(CoreDTS1 + CoreDTS2) + (qWt*QuadDTS)) - // ------------------------------------------ - // (2*cWt + qWt) + // Determine the quad this core resides in. + l_quad = i_core / 4; - l_coreTemp = ((cWt * (l_dts[0] + l_dts[1])) + (qWt * l_quadDts)) - / ((l_dtsCnt * cWt) + qWt); + // Update the raw quad DTS reading (average of the two) + l_dtsAvg = (l_quadDts[0] + l_quadDts[1]) / l_quadDtsCnt; + sensor_update( AMECSENSOR_ARRAY_PTR(TEMPQ0, l_quad), l_dtsAvg); + } - // Update sensors & Interim Data - sensor_update( AMECSENSOR_ARRAY_PTR(TEMP4MSP0C0,i_core), l_coreTemp); - g_amec->proc[0].core[i_core].dts_hottest = l_core_hot; - } while(0); + // Update the thermal sensor associated with this core + if(l_update_sensor) + { + do + { + // Make sure data is valid + if (!((cWt && l_coreDtsCnt) || (qWt && l_quadDtsCnt))) + { + if(FALSE == L_bad_read_trace) + { + TRAC_ERR("amec_calc_dts_sensors: updating DTS sensors skipped. " + "core weight: %d, core DTSs: %d, quad weight: %d " + "quad DTSs: %d", cWt, l_coreDtsCnt, qWt, l_quadDtsCnt); + L_bad_read_trace = TRUE; + } + + // Avoid divide by zero + break; + } + + //Formula: + // (cWt(CoreDTS1 + CoreDTS2) + qWt(QuadDTS1 + QuadDTS1)) + // ------------------------------------------ + // (2*cWt + 2*qWt) + + l_coreTemp = ( (cWt * (l_coreDts[0] + l_coreDts[1])) + (qWt * (l_quadDts[0] + l_quadDts[1])) ) / + // --------------------------------------------------------------------------------- + ( (l_coreDtsCnt * cWt) + (l_quadDtsCnt * qWt) ); + + // Update sensors & Interim Data + sensor_update( AMECSENSOR_ARRAY_PTR(TEMPPROCTHRMC0,i_core), l_coreTemp); + g_amec->proc[0].core[i_core].dts_hottest = l_core_hot; + } while(0); + } } - } } // Function Specification diff --git a/src/occ_405/amec/amec_slave_smh.c b/src/occ_405/amec/amec_slave_smh.c index c3f5454..195eb66 100755 --- a/src/occ_405/amec/amec_slave_smh.c +++ b/src/occ_405/amec/amec_slave_smh.c @@ -401,8 +401,8 @@ void amec_slv_state_0(void) //------------------------------------------------------- // Update vector sensors //------------------------------------------------------- - sensor_vector_update(AMECSENSOR_PTR(TEMP4MSP0), 1); - sensor_vector_update(AMECSENSOR_PTR(TEMP4MSP0PEAK),1); + sensor_vector_update(AMECSENSOR_PTR(TEMPPROCAVG), 1); + sensor_vector_update(AMECSENSOR_PTR(TEMPPROCTHRM), 1); sensor_vector_update(AMECSENSOR_PTR(FREQA4MSP0), 1); sensor_vector_update(AMECSENSOR_PTR(IPS4MSP0), 1); sensor_vector_update(AMECSENSOR_PTR(UTIL4MSP0), 1); diff --git a/src/occ_405/amec/amec_sys.h b/src/occ_405/amec/amec_sys.h index 861410a..d7867ac 100755 --- a/src/occ_405/amec/amec_sys.h +++ b/src/occ_405/amec/amec_sys.h @@ -288,13 +288,14 @@ typedef struct sensor_t ips4ms; sensor_t mcpifd4ms; sensor_t mcpifi4ms; - sensor_t temp4ms; + sensor_t tempprocthermal; sensor_t util4ms; sensor_t nutil3s; sensor_t mstl2ms; sensor_t cmt2ms; sensor_t ppic; sensor_t pwrpx250us; + sensor_t tempc; //----------------------------------- // Previous Tick Data @@ -428,6 +429,14 @@ typedef struct } amec_proc_pwr_votes_t; //------------------------------------------------------------- +// Quad Structure +//------------------------------------------------------------- +typedef struct +{ + sensor_t tempq; +} amec_quad_t; + +//------------------------------------------------------------- // Proc Structure //------------------------------------------------------------- typedef struct @@ -437,6 +446,7 @@ typedef struct amec_memctl_t memctl[MAX_NUM_MEM_CONTROLLERS]; amec_vrm_t vrm[NUM_PROC_VRMS]; amec_proc_pwr_votes_t pwr_votes; + amec_quad_t quad[MAX_NUM_QUADS]; // Processor Sensors sensor_t freqa4ms; @@ -453,10 +463,10 @@ typedef struct sensor_t sleepcnt4ms; sensor_t winkcnt4ms; sensor_t sp250us; - sensor_t temp4ms; + sensor_t tempprocavg; vectorSensor_t temp4ms_vector; - sensor_t temp4mspeak; - vectorSensor_t temp4mspeak_vector; + sensor_t tempprocthermal; + vectorSensor_t tempprocthermal_vector; sensor_t util4ms; sensor_t tempnest; vectorSensor_t util4ms_vector; diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.c b/src/occ_405/cmdh/cmdh_fsp_cmds.c index 8a1ad79..93bd66b 100755 --- a/src/occ_405/cmdh/cmdh_fsp_cmds.c +++ b/src/occ_405/cmdh/cmdh_fsp_cmds.c @@ -250,9 +250,9 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr) { if(CORE_PRESENT(k)) { - l_tempSensorList[l_sensorHeader.count].id = G_amec_sensor_list[TEMP4MSP0C0 + k]->ipmi_sid; + l_tempSensorList[l_sensorHeader.count].id = G_amec_sensor_list[TEMPPROCTHRMC0 + k]->ipmi_sid; l_tempSensorList[l_sensorHeader.count].fru_type = DATA_FRU_PROC; - l_tempSensorList[l_sensorHeader.count].value = (G_amec_sensor_list[TEMP4MSP0C0 + k]->sample) & 0xFF; + l_tempSensorList[l_sensorHeader.count].value = (G_amec_sensor_list[TEMPPROCTHRMC0 + k]->sample) & 0xFF; l_sensorHeader.count++; } } diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c index e4e2414..913d45e 100755 --- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c +++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c @@ -1274,10 +1274,10 @@ errlHndl_t data_store_sys_config(const cmdh_fsp_cmd_t * i_cmd_ptr, //Core Temp and Freq sensors are always in sequence in the table for (l_coreIndex = 0; l_coreIndex < MAX_CORES; l_coreIndex++) { - AMECSENSOR_PTR(TEMP4MSP0C0 + l_coreIndex)->ipmi_sid = l_cmd_ptr->sys_config.core_sid[(l_coreIndex * 2)]; + AMECSENSOR_PTR(TEMPPROCTHRMC0 + l_coreIndex)->ipmi_sid = l_cmd_ptr->sys_config.core_sid[(l_coreIndex * 2)]; AMECSENSOR_PTR(FREQA4MSP0C0 + l_coreIndex)->ipmi_sid = l_cmd_ptr->sys_config.core_sid[(l_coreIndex * 2) + 1]; CNFG_DBG("data_store_sys_config: Core[%d] TempSID[0x%08X] FreqSID[0x%08X]", l_coreIndex, - AMECSENSOR_PTR(TEMP4MSP0C0 + l_coreIndex)->ipmi_sid, AMECSENSOR_PTR(FREQA4MSP0C0 + l_coreIndex)->ipmi_sid); + AMECSENSOR_PTR(TEMPPROCTHRMC0 + l_coreIndex)->ipmi_sid, AMECSENSOR_PTR(FREQA4MSP0C0 + l_coreIndex)->ipmi_sid); } } diff --git a/src/occ_405/dcom/dcom.h b/src/occ_405/dcom/dcom.h index c705905..3ce5685 100755 --- a/src/occ_405/dcom/dcom.h +++ b/src/occ_405/dcom/dcom.h @@ -203,8 +203,8 @@ typedef struct __attribute__ ((packed)) uint16_t pwr250usmemp0; // [166] uint16_t sleepcnt4msp0; // [168] uint16_t winkcnt4msp0; // [170] - uint16_t temp4msp0; // [172] - uint16_t temp4msp0peak; // [174] + uint16_t tempprocavg; // [172] + uint16_t tempprocthermal; // [174] uint16_t util4msp0cy[MAX_CORES]; // [176] uint16_t vrfan250usmem; // [224] uint16_t vrfan250usproc; // [226] diff --git a/src/occ_405/occ_sys_config.h b/src/occ_405/occ_sys_config.h index 8df5579..e0799b6 100755 --- a/src/occ_405/occ_sys_config.h +++ b/src/occ_405/occ_sys_config.h @@ -39,6 +39,7 @@ #define MAX_NUM_OCC 4 #define MAX_NUM_NODES 4 #define MAX_NUM_CORES 24 +#define MAX_NUM_QUADS 6 #define MAX_THREADS_PER_CORE 4 #define MAX_NUM_CHIP_MODULES 4 #define MAX_NUM_POWER_SUPPLIES 4 diff --git a/src/occ_405/sensor/sensor_enum.h b/src/occ_405/sensor/sensor_enum.h index 3305cd3..a1dd1c2 100755 --- a/src/occ_405/sensor/sensor_enum.h +++ b/src/occ_405/sensor/sensor_enum.h @@ -122,13 +122,20 @@ enum e_gsid SLEEPCNT4MSP0, WINKCNT4MSP0, SP250USP0, - TEMP4MSP0, - TEMP4MSP0PEAK, + TEMPPROCAVG, + TEMPPROCTHRM, UTIL4MSP0, TEMPNEST, VRFAN250USPROC, VRHOT250USPROC, + TEMPQ0, + TEMPQ1, + TEMPQ2, + TEMPQ3, + TEMPQ4, + TEMPQ5, + FREQ250USP0C0, FREQ250USP0C1, FREQ250USP0C2, @@ -254,30 +261,30 @@ enum e_gsid NOTFIN4MSP0C22, NOTFIN4MSP0C23, - TEMP4MSP0C0, - TEMP4MSP0C1, - TEMP4MSP0C2, - TEMP4MSP0C3, - TEMP4MSP0C4, - TEMP4MSP0C5, - TEMP4MSP0C6, - TEMP4MSP0C7, - TEMP4MSP0C8, - TEMP4MSP0C9, - TEMP4MSP0C10, - TEMP4MSP0C11, - TEMP4MSP0C12, - TEMP4MSP0C13, - TEMP4MSP0C14, - TEMP4MSP0C15, - TEMP4MSP0C16, - TEMP4MSP0C17, - TEMP4MSP0C18, - TEMP4MSP0C19, - TEMP4MSP0C20, - TEMP4MSP0C21, - TEMP4MSP0C22, - TEMP4MSP0C23, + TEMPPROCTHRMC0, + TEMPPROCTHRMC1, + TEMPPROCTHRMC2, + TEMPPROCTHRMC3, + TEMPPROCTHRMC4, + TEMPPROCTHRMC5, + TEMPPROCTHRMC6, + TEMPPROCTHRMC7, + TEMPPROCTHRMC8, + TEMPPROCTHRMC9, + TEMPPROCTHRMC10, + TEMPPROCTHRMC11, + TEMPPROCTHRMC12, + TEMPPROCTHRMC13, + TEMPPROCTHRMC14, + TEMPPROCTHRMC15, + TEMPPROCTHRMC16, + TEMPPROCTHRMC17, + TEMPPROCTHRMC18, + TEMPPROCTHRMC19, + TEMPPROCTHRMC20, + TEMPPROCTHRMC21, + TEMPPROCTHRMC22, + TEMPPROCTHRMC23, UTIL4MSP0C0, UTIL4MSP0C1, @@ -429,6 +436,31 @@ enum e_gsid PWRPX250USP0C22, PWRPX250USP0C23, + TEMPC0, + TEMPC1, + TEMPC2, + TEMPC3, + TEMPC4, + TEMPC5, + TEMPC6, + TEMPC7, + TEMPC8, + TEMPC9, + TEMPC10, + TEMPC11, + TEMPC12, + TEMPC13, + TEMPC14, + TEMPC15, + TEMPC16, + TEMPC17, + TEMPC18, + TEMPC19, + TEMPC20, + TEMPC21, + TEMPC22, + TEMPC23, + // ------------------------------------------------------ // Regulator Sensors // ------------------------------------------------------ diff --git a/src/occ_405/sensor/sensor_info.c b/src/occ_405/sensor/sensor_info.c index 82ab29b..cd29e10 100755 --- a/src/occ_405/sensor/sensor_info.c +++ b/src/occ_405/sensor/sensor_info.c @@ -62,33 +62,75 @@ #define CENTAUR_SENSOR_STRING_HELPER(sensor_name, memc,centL,cent,ppL,pp) SENSOR_STRING(sensor_name##memc##centL##cent##ppL##pp) #define CENTAUR_SENSOR_STRING(sensor_name,memc,cent,pp) CENTAUR_SENSOR_STRING_HELPER(sensor_name, memc,C,cent,P,pp) -// This will create a set of 12 sensor entries into the sensor list table. +// This will create a set of 6 sensor entries into the sensor list table. +// (one for each quad...) The base name of the sensor enum must be passed +// and this macro will take care of the paste & stringify operations. +#define SENS_QUAD_ENTRY_SET(sensor_name, units, type, location, number, frequency, scaleFactor) \ + [SENSOR_W_NUM(sensor_name,0)] = {.name = SENSOR_STRING(sensor_name ## 0), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,1)] = {.name = SENSOR_STRING(sensor_name ## 1), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,2)] = {.name = SENSOR_STRING(sensor_name ## 2), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,3)] = {.name = SENSOR_STRING(sensor_name ## 3), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,4)] = {.name = SENSOR_STRING(sensor_name ## 4), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,5)] = {.name = SENSOR_STRING(sensor_name ## 5), \ + .sensor = { units, type, location, number, frequency, scaleFactor },} + + +// This will create a set of 24 sensor entries into the sensor list table. // (one for each core...) The base name of the sensor enum must be passed // and this macro will take care of the paste & stringify operations. #define SENS_CORE_ENTRY_SET(sensor_name, units, type, location, number, frequency, scaleFactor) \ - [SENSOR_W_NUM(sensor_name,0)] = {.name = SENSOR_STRING(sensor_name ## 1), \ + [SENSOR_W_NUM(sensor_name,0)] = {.name = SENSOR_STRING(sensor_name ## 0), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,1)] = {.name = SENSOR_STRING(sensor_name ## 1), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,2)] = {.name = SENSOR_STRING(sensor_name ## 2), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,3)] = {.name = SENSOR_STRING(sensor_name ## 3), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,4)] = {.name = SENSOR_STRING(sensor_name ## 4), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,5)] = {.name = SENSOR_STRING(sensor_name ## 5), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,6)] = {.name = SENSOR_STRING(sensor_name ## 6), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,7)] = {.name = SENSOR_STRING(sensor_name ## 7), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,8)] = {.name = SENSOR_STRING(sensor_name ## 8), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,9)] = {.name = SENSOR_STRING(sensor_name ## 9), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,10)] = {.name = SENSOR_STRING(sensor_name ## 10), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,11)] = {.name = SENSOR_STRING(sensor_name ## 11), \ + .sensor = { units, type, location, number, frequency, scaleFactor },}, \ + [SENSOR_W_NUM(sensor_name,12)] = {.name = SENSOR_STRING(sensor_name ## 12), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,1)] = {.name = SENSOR_STRING(sensor_name ## 2), \ + [SENSOR_W_NUM(sensor_name,13)] = {.name = SENSOR_STRING(sensor_name ## 13), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,2)] = {.name = SENSOR_STRING(sensor_name ## 3), \ + [SENSOR_W_NUM(sensor_name,14)] = {.name = SENSOR_STRING(sensor_name ## 14), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,3)] = {.name = SENSOR_STRING(sensor_name ## 4), \ + [SENSOR_W_NUM(sensor_name,15)] = {.name = SENSOR_STRING(sensor_name ## 15), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,4)] = {.name = SENSOR_STRING(sensor_name ## 5), \ + [SENSOR_W_NUM(sensor_name,16)] = {.name = SENSOR_STRING(sensor_name ## 16), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,5)] = {.name = SENSOR_STRING(sensor_name ## 6), \ + [SENSOR_W_NUM(sensor_name,17)] = {.name = SENSOR_STRING(sensor_name ## 17), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,6)] = {.name = SENSOR_STRING(sensor_name ## 9), \ + [SENSOR_W_NUM(sensor_name,18)] = {.name = SENSOR_STRING(sensor_name ## 18), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,7)] = {.name = SENSOR_STRING(sensor_name ## 10), \ + [SENSOR_W_NUM(sensor_name,19)] = {.name = SENSOR_STRING(sensor_name ## 19), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,8)] = {.name = SENSOR_STRING(sensor_name ## 11), \ + [SENSOR_W_NUM(sensor_name,20)] = {.name = SENSOR_STRING(sensor_name ## 20), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,9)] = {.name = SENSOR_STRING(sensor_name ## 12), \ + [SENSOR_W_NUM(sensor_name,21)] = {.name = SENSOR_STRING(sensor_name ## 21), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,10)] = {.name = SENSOR_STRING(sensor_name ## 13), \ + [SENSOR_W_NUM(sensor_name,22)] = {.name = SENSOR_STRING(sensor_name ## 22), \ .sensor = { units, type, location, number, frequency, scaleFactor },}, \ - [SENSOR_W_NUM(sensor_name,11)] = {.name = SENSOR_STRING(sensor_name ## 14), \ + [SENSOR_W_NUM(sensor_name,23)] = {.name = SENSOR_STRING(sensor_name ## 23), \ .sensor = { units, type, location, number, frequency, scaleFactor },} // This will create a set of 8 sensor entries into the sensor list table. @@ -217,23 +259,24 @@ const sensor_info_t G_sensor_info[] = SENSOR_INFO_T_ENTRY( TODclock2, "day\0", AMEC_SENSOR_TYPE_TIME, AMEC_SENSOR_LOC_ALL, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 795364,-6) ), /* ==ProcSensors== NameString Units Type Location Number Freq ScaleFactor */ - SENSOR_INFO_T_ENTRY( FREQA4MSP0, "MHz\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( IPS4MSP0, "MIP\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( MEMSP2MSP0, "%\0", AMEC_SENSOR_TYPE_TIME, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( FREQA4MSP0, "MHz\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( IPS4MSP0, "MIP\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( MEMSP2MSP0, "%\0", AMEC_SENSOR_TYPE_TIME, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( PWR250USP0, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( PWR250USVDD0, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( CUR250USVDD0, "A\0", AMEC_SENSOR_TYPE_CURRENT, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1,-2) ), SENSOR_INFO_T_ENTRY( PWR250USVCS0, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( PWR250USMEM0, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( SLEEPCNT4MSP0, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( WINKCNT4MSP0, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( SLEEPCNT4MSP0, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( WINKCNT4MSP0, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( SP250USP0, "%\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( TEMP4MSP0, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( TEMP4MSP0PEAK, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENSOR_INFO_T_ENTRY( UTIL4MSP0, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1,-2) ), + SENSOR_INFO_T_ENTRY( TEMPPROCAVG, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( TEMPPROCTHRM, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( UTIL4MSP0, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1,-2) ), SENSOR_INFO_T_ENTRY( TEMPNEST, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( VRFAN250USPROC, "pin\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_VRM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( VRHOT250USPROC, "pin\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_VRM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), + SENS_QUAD_ENTRY_SET( TEMPQ, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), /* ==ReguSensors== NameString Units Type Location Number Freq ScaleFactor */ SENSOR_INFO_T_ENTRY( UVOLT250USP0V0, "mV\0", AMEC_SENSOR_TYPE_VOLTAGE, AMEC_SENSOR_LOC_VRM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, -1) ), @@ -242,18 +285,19 @@ const sensor_info_t G_sensor_info[] = SENSOR_INFO_T_ENTRY( VOLT250USP0V1, "mV\0", AMEC_SENSOR_TYPE_VOLTAGE, AMEC_SENSOR_LOC_VRM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, -1) ), /* ==CoreSensors== NameString Units Type Location Number Freq ScaleFactor */ - SENS_CORE_ENTRY_SET( FREQ250USP0C , "MHz\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( FREQA4MSP0C , "MHz\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( IPS4MSP0C , "MIP\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( NOTBZE4MSP0C , "cyc\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( NOTFIN4MSP0C , "cyc\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( TEMP4MSP0C , "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( UTIL4MSP0C , "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1,-2) ), - SENS_CORE_ENTRY_SET( NUTIL3SP0C , "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_3S_IN_HZ, AMEFP( 1,-2) ), - SENS_CORE_ENTRY_SET( MSTL2MSP0C , "cpi\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( CMT2MSP0C , "%\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( PPICP0C , "%\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_CORE_ENTRY_SET( PWRPX250USP0C , "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( FREQ250USP0C, "MHz\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( FREQA4MSP0C, "MHz\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( IPS4MSP0C, "MIP\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( NOTBZE4MSP0C, "cyc\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( NOTFIN4MSP0C, "cyc\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( TEMPPROCTHRMC, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( UTIL4MSP0C, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1,-2) ), + SENS_CORE_ENTRY_SET( NUTIL3SP0C, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_3S_IN_HZ, AMEFP( 1,-2) ), + SENS_CORE_ENTRY_SET( MSTL2MSP0C, "cpi\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( CMT2MSP0C, "%\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( PPICP0C, "%\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( PWRPX250USP0C, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), + SENS_CORE_ENTRY_SET( TEMPC, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ), /* ==MemSensors== NameString Units Type Location Number Freq ScaleFactor */ SENSOR_INFO_T_ENTRY( VRFAN250USMEM, "pin\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_VRM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), diff --git a/src/occ_405/sensor/sensor_table.c b/src/occ_405/sensor/sensor_table.c index 6b8ed5a..5ab4f15 100755 --- a/src/occ_405/sensor/sensor_table.c +++ b/src/occ_405/sensor/sensor_table.c @@ -71,6 +71,17 @@ extern amec_sys_t g_amec_sys; [SENSOR_W_NUM(sensor,22)] = ptrbase[22].ptrmember, \ [SENSOR_W_NUM(sensor,23)] = ptrbase[23].ptrmember +// Will define a set of "quad sensor pointers" by passing in base sensor name +// and ptr to [0] entry of array of 6 quad sensors +#define QUAD_SENSOR_PTRS(sensor,ptrbase,ptrmember) \ + [SENSOR_W_NUM(sensor, 0)] = ptrbase[ 0].ptrmember, \ + [SENSOR_W_NUM(sensor, 1)] = ptrbase[ 1].ptrmember, \ + [SENSOR_W_NUM(sensor, 2)] = ptrbase[ 2].ptrmember, \ + [SENSOR_W_NUM(sensor, 3)] = ptrbase[ 3].ptrmember, \ + [SENSOR_W_NUM(sensor, 4)] = ptrbase[ 4].ptrmember, \ + [SENSOR_W_NUM(sensor, 5)] = ptrbase[ 5].ptrmember + + // Will define a set of "memory controller sensor pointers" by passing in // base sensor nameand ptr to [0] entry of array of 8 memcontroller sensors #define MEMCONTROL_SENSOR_PTRS(sensor,ptrbase,ptrmember) \ @@ -136,7 +147,6 @@ extern amec_sys_t g_amec_sys; [SENSOR_W_NUM(sensor,22)] = ptr[22], \ [SENSOR_W_NUM(sensor,23)] = ptr[23] -// Will define a set of "core mini-sensor pointers" as NULL, since not // every sensor must have a mini-sensor. #define CORE_MINI_SENSOR_PTRS_NULL(sensor) \ [SENSOR_W_NUM(sensor, 0)] = NULL, \ @@ -164,6 +174,25 @@ extern amec_sys_t g_amec_sys; [SENSOR_W_NUM(sensor,22)] = NULL, \ [SENSOR_W_NUM(sensor,23)] = NULL +// Will define a set of "quad mini-sensor pointers" by passing in base +// sensor name and ptr to [0] entry of array of quad sensors +#define QUAD_MINI_SENSOR_PTRS(sensor,ptr) \ + [SENSOR_W_NUM(sensor, 0)] = ptr[ 0], \ + [SENSOR_W_NUM(sensor, 1)] = ptr[ 1], \ + [SENSOR_W_NUM(sensor, 2)] = ptr[ 2], \ + [SENSOR_W_NUM(sensor, 3)] = ptr[ 3], \ + [SENSOR_W_NUM(sensor, 4)] = ptr[ 4], \ + [SENSOR_W_NUM(sensor, 5)] = ptr[ 5] + +// every sensor must have a mini-sensor. +#define QUAD_MINI_SENSOR_PTRS_NULL(sensor) \ + [SENSOR_W_NUM(sensor, 0)] = NULL, \ + [SENSOR_W_NUM(sensor, 1)] = NULL, \ + [SENSOR_W_NUM(sensor, 2)] = NULL, \ + [SENSOR_W_NUM(sensor, 3)] = NULL, \ + [SENSOR_W_NUM(sensor, 4)] = NULL, \ + [SENSOR_W_NUM(sensor, 5)] = NULL + // Will define a set of "memory controller mini sensor ptrs" by passing in // base sensor nameand ptr to [0] entry of array of 8 memcontroller sensors #define MEMCONTROL_MINI_SENSOR_PTRS(sensor,ptr) \ @@ -312,14 +341,19 @@ const sensor_ptr_t G_amec_sensor_list[] = SENSOR_PTR( SLEEPCNT4MSP0, &g_amec_sys.proc[0].sleepcnt4ms), SENSOR_PTR( WINKCNT4MSP0, &g_amec_sys.proc[0].winkcnt4ms), SENSOR_PTR( SP250USP0, &g_amec_sys.proc[0].sp250us), - SENSOR_PTR( TEMP4MSP0, &g_amec_sys.proc[0].temp4ms), - SENSOR_PTR( TEMP4MSP0PEAK, &g_amec_sys.proc[0].temp4mspeak), + SENSOR_PTR( TEMPPROCAVG, &g_amec_sys.proc[0].tempprocavg), + SENSOR_PTR( TEMPPROCTHRM, &g_amec_sys.proc[0].tempprocthermal), SENSOR_PTR( UTIL4MSP0, &g_amec_sys.proc[0].util4ms), SENSOR_PTR( TEMPNEST, &g_amec_sys.proc[0].tempnest), SENSOR_PTR( VRFAN250USPROC, &g_amec_sys.sys.vrfan250usproc), SENSOR_PTR( VRHOT250USPROC, &g_amec_sys.sys.vrhot250usproc), // ------------------------------------------------------ + // Quad Sensors (6 each) + // ------------------------------------------------------ + QUAD_SENSOR_PTRS( TEMPQ, &g_amec_sys.proc[0].quad, tempq), + + // ------------------------------------------------------ // Core Sensors (24 of each) // ------------------------------------------------------ CORE_SENSOR_PTRS( FREQ250USP0C , &g_amec_sys.proc[0].core, freq250us), @@ -327,13 +361,14 @@ const sensor_ptr_t G_amec_sensor_list[] = CORE_SENSOR_PTRS( IPS4MSP0C , &g_amec_sys.proc[0].core, ips4ms), CORE_SENSOR_PTRS( NOTBZE4MSP0C , &g_amec_sys.proc[0].core, mcpifd4ms), CORE_SENSOR_PTRS( NOTFIN4MSP0C , &g_amec_sys.proc[0].core, mcpifi4ms), - CORE_SENSOR_PTRS( TEMP4MSP0C , &g_amec_sys.proc[0].core, temp4ms), + CORE_SENSOR_PTRS( TEMPPROCTHRMC , &g_amec_sys.proc[0].core, tempprocthermal), CORE_SENSOR_PTRS( UTIL4MSP0C , &g_amec_sys.proc[0].core, util4ms), CORE_SENSOR_PTRS( NUTIL3SP0C , &g_amec_sys.proc[0].core, nutil3s), CORE_SENSOR_PTRS( MSTL2MSP0C , &g_amec_sys.proc[0].core, mstl2ms), CORE_SENSOR_PTRS( CMT2MSP0C , &g_amec_sys.proc[0].core, cmt2ms), CORE_SENSOR_PTRS( PPICP0C , &g_amec_sys.proc[0].core, ppic), CORE_SENSOR_PTRS( PWRPX250USP0C , &g_amec_sys.proc[0].core, pwrpx250us), + CORE_SENSOR_PTRS( TEMPC, &g_amec_sys.proc[0].core, tempc), // ------------------------------------------------------ // Memory Sensors @@ -464,14 +499,19 @@ const minisensor_ptr_t G_amec_mini_sensor_list[] INIT_SECTION = MINI_SENSOR_PTR( SLEEPCNT4MSP0, &G_dcom_slv_outbox_tx.sleepcnt4msp0), MINI_SENSOR_PTR( WINKCNT4MSP0, &G_dcom_slv_outbox_tx.winkcnt4msp0), MINI_SENSOR_PTR( SP250USP0, NULL), - MINI_SENSOR_PTR( TEMP4MSP0, &G_dcom_slv_outbox_tx.temp4msp0), - MINI_SENSOR_PTR( TEMP4MSP0PEAK, &G_dcom_slv_outbox_tx.temp4msp0peak), + MINI_SENSOR_PTR( TEMPPROCAVG, &G_dcom_slv_outbox_tx.tempprocavg), + MINI_SENSOR_PTR( TEMPPROCTHRM, &G_dcom_slv_outbox_tx.tempprocthermal), MINI_SENSOR_PTR( UTIL4MSP0, &G_dcom_slv_outbox_tx.util4msp0), MINI_SENSOR_PTR( TEMPNEST, NULL), MINI_SENSOR_PTR( VRFAN250USPROC, &G_dcom_slv_outbox_tx.vrfan250usproc), MINI_SENSOR_PTR( VRHOT250USPROC, NULL), // ------------------------------------------------------ + // Quad Sensors (6 each) + // ------------------------------------------------------ + QUAD_MINI_SENSOR_PTRS_NULL( TEMPQ ), + + // ------------------------------------------------------ // Core Sensors (24 of each) // ------------------------------------------------------ CORE_MINI_SENSOR_PTRS_NULL( FREQ250USP0C ), @@ -479,13 +519,14 @@ const minisensor_ptr_t G_amec_mini_sensor_list[] INIT_SECTION = CORE_MINI_SENSOR_PTRS( IPS4MSP0C, &G_dcom_slv_outbox_tx.ips4msp0cy ), CORE_MINI_SENSOR_PTRS( NOTBZE4MSP0C, &G_dcom_slv_outbox_tx.mcpifd4msp0cy ), CORE_MINI_SENSOR_PTRS( NOTFIN4MSP0C, &G_dcom_slv_outbox_tx.mcpifi4msp0cy ), - CORE_MINI_SENSOR_PTRS_NULL( TEMP4MSP0C ), + CORE_MINI_SENSOR_PTRS_NULL( TEMPPROCTHRMC ), CORE_MINI_SENSOR_PTRS( UTIL4MSP0C, &G_dcom_slv_outbox_tx.util4msp0cy ), CORE_MINI_SENSOR_PTRS( NUTIL3SP0C, &G_dcom_slv_outbox_tx.nutil3sp0cy ), CORE_MINI_SENSOR_PTRS_NULL( MSTL2MSP0C ), CORE_MINI_SENSOR_PTRS_NULL( CMT2MSP0C ), CORE_MINI_SENSOR_PTRS_NULL( PPICP0C ), CORE_MINI_SENSOR_PTRS( PWRPX250USP0C, &G_dcom_slv_outbox_tx.pwrpx250usp0cy), // + CORE_MINI_SENSOR_PTRS_NULL( TEMPC ), // ------------------------------------------------------ // Memory Sensors @@ -539,5 +580,3 @@ const minisensor_ptr_t G_amec_mini_sensor_list[] INIT_SECTION = }; STATIC_ASSERT( (NUMBER_OF_SENSORS_IN_LIST != (sizeof(G_amec_mini_sensor_list)/sizeof(uint16_t *))) ); STATIC_ASSERT( (MAX_AMEC_SENSORS < (sizeof(G_amec_mini_sensor_list)/sizeof(uint16_t *))) ); - - diff --git a/src/occ_405/thread/chom.c b/src/occ_405/thread/chom.c index aa0839c..ed04564 100755 --- a/src/occ_405/thread/chom.c +++ b/src/occ_405/thread/chom.c @@ -238,9 +238,9 @@ void chom_update_sensors() // update chom sensors which has multiple mini-sensor source for (i = 0 ; i<MAX_OCCS ; i++) { - if (G_dcom_slv_outbox_rx[i].temp4msp0peak > l_max_core_temp) + if (G_dcom_slv_outbox_rx[i].tempprocthermal > l_max_core_temp) { - l_max_core_temp = G_dcom_slv_outbox_rx[i].temp4msp0peak; + l_max_core_temp = G_dcom_slv_outbox_rx[i].tempprocthermal; } if (G_dcom_slv_outbox_rx[i].temp2mscent > l_max_cent_temp) diff --git a/src/occ_gpe0/core_data.c b/src/occ_gpe0/core_data.c index 2381a98..fe0d085 100644 --- a/src/occ_gpe0/core_data.c +++ b/src/occ_gpe0/core_data.c @@ -76,17 +76,9 @@ uint32_t get_core_data(uint32_t i_core, PPE_LVD(quadSelect + THERM_DTS_RESULT, value64); dts_scom_data.value = value64; - // Pick the sensor reading closest to core - // first two cores - use cache dts0 - // last two cores - use cache dts1 - if(i_core & 0x00000002) - { - o_data->dts.cache.result = dts_scom_data.half_words.reading[1]; - } - else - { - o_data->dts.cache.result = dts_scom_data.half_words.reading[0]; - } + // Store the quad DTS readings + o_data->dts.cache[0].result = dts_scom_data.half_words.reading[0]; + o_data->dts.cache[1].result = dts_scom_data.half_words.reading[1]; //scom_reg = (uint64_t*)(coreSelect + THERM_DTS_RESULT); //dts_scom_data.value = *scom_reg; |