diff options
author | Douglas Gilbert <dgilbert@us.ibm.com> | 2018-08-20 12:00:00 -0500 |
---|---|---|
committer | William A. Bryan <wilbryan@us.ibm.com> | 2019-05-01 14:06:09 -0500 |
commit | afa37a7e9bc0fa22fb2271fb2e7ea2557376181e (patch) | |
tree | 5b39ee8a394474649721a51c1c0d4968e52cac08 /src/occ_405 | |
parent | a880ffe3a854a8eb219ea92e7fbc4845d8fa2511 (diff) | |
download | talos-occ-afa37a7e9bc0fa22fb2271fb2e7ea2557376181e.tar.gz talos-occ-afa37a7e9bc0fa22fb2271fb2e7ea2557376181e.zip |
Explorer MSBUF monitoring
Change-Id: Ia8e48ba5c3ad7836dbd249f3965768e79083c181
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73263
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src/occ_405')
-rw-r--r-- | src/occ_405/amec/amec_sensors_ocmb.c | 634 | ||||
-rw-r--r-- | src/occ_405/amec/amec_sensors_ocmb.h | 36 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_slave_smh.c | 89 | ||||
-rwxr-xr-x | src/occ_405/cent/centaur_control.c | 36 | ||||
-rwxr-xr-x | src/occ_405/cent/centaur_data.c | 252 | ||||
-rwxr-xr-x | src/occ_405/cent/centaur_data.h | 26 | ||||
-rwxr-xr-x | src/occ_405/cent/centaur_data_service_codes.h | 1 | ||||
-rw-r--r-- | src/occ_405/cent/ocmb_control.c | 191 | ||||
-rw-r--r-- | src/occ_405/cent/ocmb_data.c | 162 | ||||
-rw-r--r-- | src/occ_405/cent/ocmb_membuf.h | 47 | ||||
-rwxr-xr-x | src/occ_405/dimm/dimm.c | 2 | ||||
-rw-r--r-- | src/occ_405/mem/memory.c | 36 | ||||
-rw-r--r-- | src/occ_405/occLinkInputFile | 3 | ||||
-rwxr-xr-x | src/occ_405/occbuildname.c | 2 | ||||
-rw-r--r-- | src/occ_405/topfiles.mk | 3 |
15 files changed, 1345 insertions, 175 deletions
diff --git a/src/occ_405/amec/amec_sensors_ocmb.c b/src/occ_405/amec/amec_sensors_ocmb.c new file mode 100644 index 0000000..3e57266 --- /dev/null +++ b/src/occ_405/amec/amec_sensors_ocmb.c @@ -0,0 +1,634 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_405/amec/amec_sensors_centaur.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/******************************************************************************/ +/* includes */ +/******************************************************************************/ +#include <occ_common.h> +#include <ssx.h> +#include <errl.h> // Error logging +#include "sensor.h" +#include "rtls.h" +#include "occ_sys_config.h" +#include "occ_service_codes.h" // for SSX_GENERIC_FAILURE +#include "dcom.h" +#include "memory.h" +#include "centaur_data.h" +#include "amec_smh.h" +#include "amec_slave_smh.h" +#include <trac.h> +#include "amec_sys.h" +#include "sensor_enum.h" +#include "amec_service_codes.h" +#include "amec_sensors_ocmb.h" +#include "ocmb_mem_data.h" + +/******************************************************************************/ +/* Globals */ +/******************************************************************************/ +extern dimm_sensor_flags_t G_dimm_overtemp_bitmap; +extern dimm_sensor_flags_t G_dimm_temp_updated_bitmap; +extern uint8_t G_cent_overtemp_bitmap; +extern uint8_t G_cent_temp_updated_bitmap; +extern uint8_t G_centaur_needs_recovery; +extern uint64_t G_inject_dimm; +extern uint32_t G_inject_dimm_trace[MAX_NUM_OCMBS][NUM_DIMMS_PER_OCMB]; + +uint32_t amec_diff_adjust_for_overflow(uint32_t i_new_value, uint32_t i_old_value); + +/******************************************************************************/ +/* Forward Declarations */ +/******************************************************************************/ +void amec_update_ocmb_dimm_dts_sensors(OcmbMemData * i_sensor_cache, uint8_t i_membuf); +void amec_update_ocmb_dts_sensors(OcmbMemData * i_sensor_cache, uint8_t i_membuf); +void amec_perfcount_ocmb_getmc( OcmbMemData * i_sensor_cache, uint8_t i_membuf); + +/******************************************************************************/ +/* Code */ +/******************************************************************************/ + +// Function Specification +// +// Name: amec_update_ocmb_dimm_dts_sensors +// +// Description: Updates sensors that have data grabbed by the fast core data +// task. +// +// Thread: RealTime Loop +// +// End Function Specification +void amec_update_ocmb_sensors(uint8_t i_membuf) +{ + if(CENTAUR_PRESENT(i_membuf)) + { + OcmbMemData * l_sensor_cache = + (OcmbMemData *)cent_get_centaur_data_ptr(i_membuf); + if(CENTAUR_UPDATED(i_membuf)) + { + amec_update_ocmb_dimm_dts_sensors(l_sensor_cache, i_membuf); + amec_update_ocmb_dts_sensors(l_sensor_cache, i_membuf); + amec_perfcount_ocmb_getmc(l_sensor_cache, i_membuf); + } + CLEAR_CENTAUR_UPDATED(i_membuf); + } +} + +// Function Specification +// +// Name: amec_update_ocmb_dimm_dts_sensors +// +// Description: Updates sensors that have data from the membuf sensor cache +// +// Thread: RealTime Loop +// +// Note: The ocmb cache data uses the same space as the Centaur +// membuf cache data, so some of the centaur attributes apply to +// Ocmb data as well as Centaur. +// +// End Function Specification +void amec_update_ocmb_dimm_dts_sensors(OcmbMemData * i_sensor_cache, uint8_t i_membuf) +{ +#define MIN_VALID_DIMM_TEMP 1 +#define MAX_VALID_DIMM_TEMP 125 //according to Mike Pardiek 04/23/2019 +#define MAX_MEM_TEMP_CHANGE 2 + + uint32_t k, l_hottest_dimm_temp; + uint16_t l_dts[NUM_DIMMS_PER_OCMB] = {0}; + uint32_t l_hottest_dimm_loc = NUM_DIMMS_PER_OCMB; + int32_t l_dimm_temp, l_prev_temp; + static uint8_t L_ran_once[MAX_NUM_OCMBS] = {FALSE}; + + // Harvest thermal data for all dimms + for(k=0; k < NUM_DIMMS_PER_OCMB; k++) + { + if(!CENTAUR_SENSOR_ENABLED(i_membuf, k)) + { + continue; + } + +#ifdef __INJECT_DIMM__ + if (g_amec->proc[0].memctl[i_membuf].centaur.dimm_temps[k].temp_sid) // DIMM has sensor ID + { + if ((G_inject_dimm & ((uint64_t)1 << ((i_membuf * 8) + k))) == 0) + { + if (G_inject_dimm_trace[i_membuf][k] != 0) + { + TRAC_INFO("amec_update_ocmb_dimm_dts_sensors: stopping injection of errors for DIMM%04X", (i_membuf<<8)|k); + G_inject_dimm_trace[i_membuf][k] = 0; + } + } + else + { + if (G_inject_dimm_trace[i_membuf][k] == 0) + { + TRAC_INFO("amec_update_ocmb_dimm_dts_sensors: injecting errors for DIMM%04X", (i_membuf<<8)|k); + G_inject_dimm_trace[i_membuf][k] = 1; + } + continue; // Skip this DIMM + } + } +#endif + + fru_temp_t* l_fru = &g_amec->proc[0].memctl[i_membuf].centaur.dimm_temps[k]; + + l_dimm_temp = i_sensor_cache->memdts[k]; + l_prev_temp = l_fru->cur_temp; + if(!l_prev_temp) + { + l_prev_temp = l_dimm_temp; + } + + //Check DTS status bits. VALID NEW if valid and !err + if((k == 0 && + i_sensor_cache->status.fields.memdts0_valid && + (!i_sensor_cache->status.fields.memdts0_err)) || + (k == 1 && + i_sensor_cache->status.fields.memdts1_valid && + (!i_sensor_cache->status.fields.memdts1_err))) + { + //make sure temperature is within a 'reasonable' range. + if(l_dimm_temp < MIN_VALID_DIMM_TEMP || + l_dimm_temp > MAX_VALID_DIMM_TEMP) + { + //set a flag so that if we end up logging an error we have something to debug why + l_fru->flags |= FRU_TEMP_OUT_OF_RANGE; + l_dts[k] = l_prev_temp; + } + else + { + //don't allow temp to change more than is reasonable for 2ms + if(l_dimm_temp > (l_prev_temp + MAX_MEM_TEMP_CHANGE)) + { + l_dts[k] = l_prev_temp + MAX_MEM_TEMP_CHANGE; + if(!l_fru->flags) + { + TRAC_INFO("dimm temp rose faster than reasonable: membuf[%d] dimm[%d] prev[%d] cur[%d]", + i_membuf, k, l_prev_temp, l_dimm_temp); + l_fru->flags |= FRU_TEMP_FAST_CHANGE; + } + } + else if (l_dimm_temp < (l_prev_temp - MAX_MEM_TEMP_CHANGE)) + { + l_dts[k] = l_prev_temp - MAX_MEM_TEMP_CHANGE; + if(!l_fru->flags) + { + TRAC_INFO("dimm temp fell faster than reasonable: membuf[%d] dimm[%d] prev[%d] cur[%d]", + i_membuf, k, l_prev_temp, l_dimm_temp); + l_fru->flags |= FRU_TEMP_FAST_CHANGE; + } + } + else //reasonable amount of change occurred + { + l_dts[k] = l_dimm_temp; + l_fru->flags &= ~FRU_TEMP_FAST_CHANGE; + } + + //Notify thermal thread that temperature has been updated + G_dimm_temp_updated_bitmap.bytes[i_membuf] |= DIMM_SENSOR0 >> k; + + //clear error flags + l_fru->flags &= FRU_TEMP_FAST_CHANGE; + } + } + else //status was VALID_OLD or ERROR + { + //convert status number to a flag + uint8_t l_status_flag = 0; + if((k == 0 && i_sensor_cache->status.fields.memdts0_err) || + (k == 1 && i_sensor_cache->status.fields.memdts1_err)) + { + l_status_flag = FRU_SENSOR_STATUS_ERROR; + } + else + { + l_status_flag = FRU_SENSOR_STATUS_VALID_OLD; + } + + if(L_ran_once[i_membuf]) + { + //Trace the error if we haven't traced it already for this sensor + if((l_status_flag != FRU_SENSOR_STATUS_VALID_OLD) && + !(l_status_flag & l_fru->flags)) + { + TRAC_ERR("Membuf %d dimm sensor%d reported an error.", i_membuf, k); + } + + l_fru->flags |= l_status_flag; + } + + //use last temperature + l_dts[k] = l_prev_temp; + + //request recovery (disable and re-enable sensor cache collection) + if(i_sensor_cache->status.fields.memdts0_err || + i_sensor_cache->status.fields.memdts1_err) + { + G_centaur_needs_recovery |= CENTAUR0_PRESENT_MASK >> i_membuf; + } + } + + //Check if at or above the error temperature + if(l_dts[k] >= g_amec->thermaldimm.ot_error) + { + //Set a bit so that this dimm can be called out by the thermal thread + G_dimm_overtemp_bitmap.bytes[i_membuf] |= 1 << k; + } + } + + // Find hottest temperature from all DIMMs for this centaur + for(l_hottest_dimm_temp = 0, k = 0; k < NUM_DIMMS_PER_OCMB; k++) + { + if(l_dts[k] > l_hottest_dimm_temp) + { + l_hottest_dimm_temp = l_dts[k]; + l_hottest_dimm_loc = k; + } + g_amec->proc[0].memctl[i_membuf].centaur.dimm_temps[k].cur_temp = l_dts[k]; + } + + amec_centaur_t* l_centaur_ptr = &g_amec->proc[0].memctl[i_membuf].centaur; + + //only update location if hottest dimm temp is greater than previous maximum + if(l_hottest_dimm_temp > l_centaur_ptr->tempdimmax.sample_max) + { + sensor_update(&l_centaur_ptr->locdimmax, l_hottest_dimm_loc); + } + + //update the max dimm temperature sensor for this centaur + sensor_update(&l_centaur_ptr->tempdimmax, l_hottest_dimm_temp); + + L_ran_once[i_membuf] = TRUE; + AMEC_DBG("Centaur[%d]: HotDimm=%d\n",i_membuf,l_hottest_dimm_temp); +} + +// Function Specification +// +// Name: amec_update_ocmb_dts_sensors +// +// Description: Updates sensors that have data grabbed by the fast core data +// +// Thread: RealTime Loop +// +// End Function Specification +void amec_update_ocmb_dts_sensors(OcmbMemData * i_sensor_cache, uint8_t i_membuf) +{ +#define MIN_VALID_MEMBUF_TEMP 1 +#define MAX_VALID_MEMBUF_TEMP 125 //according to Mike Pardiek + + uint16_t l_dts; + uint16_t l_sens_temp; + int32_t l_prev_temp; + static uint8_t L_ran_once[MAX_NUM_OCMBS] = {FALSE}; + + l_sens_temp = i_sensor_cache->ubdts0; + + fru_temp_t* l_fru = &g_amec->proc[0].memctl[i_membuf].centaur.centaur_hottest; + + l_prev_temp = l_fru->cur_temp; + if(!l_prev_temp) + { + l_prev_temp = l_sens_temp; + } + + //Check DTS status bits + if(i_sensor_cache->status.fields.ubdts0_valid && + (!i_sensor_cache->status.fields.ubdts0_err)) + { + //make sure temperature is within a 'reasonable' range. + if(l_sens_temp < MIN_VALID_MEMBUF_TEMP || + l_sens_temp > MAX_VALID_MEMBUF_TEMP) + { + //set a flag so that if we end up logging an error we have something to debug why + l_fru->flags |= FRU_TEMP_OUT_OF_RANGE; + l_dts = l_prev_temp; + } + else + { + //don't allow temp to change more than is reasonable for 2ms + if(l_sens_temp > (l_prev_temp + MAX_MEM_TEMP_CHANGE)) + { + l_dts = l_prev_temp + MAX_MEM_TEMP_CHANGE; + if(!l_fru->flags) + { + TRAC_INFO("membuf temp rose faster than reasonable: membuf[%d] prev[%d] cur[%d]", + i_membuf, l_prev_temp, l_sens_temp); + l_fru->flags |= FRU_TEMP_FAST_CHANGE; + } + } + else if (l_sens_temp < (l_prev_temp - MAX_MEM_TEMP_CHANGE)) + { + l_dts = l_prev_temp - MAX_MEM_TEMP_CHANGE; + if(!l_fru->flags) + { + TRAC_INFO("membuf temp fell faster than reasonable: cent[%d] prev[%d] cur[%d]", + i_membuf, l_prev_temp, l_sens_temp); + l_fru->flags |= FRU_TEMP_FAST_CHANGE; + } + } + else //reasonable amount of change occurred + { + l_dts = l_sens_temp; + l_fru->flags &= ~FRU_TEMP_FAST_CHANGE; + } + + //Notify thermal thread that temperature has been updated + G_cent_temp_updated_bitmap |= CENTAUR0_PRESENT_MASK >> i_membuf; + + //clear error flags + l_fru->flags &= FRU_TEMP_FAST_CHANGE; + } + } + else //status was INVALID + { + if(L_ran_once[i_membuf]) + { + //Trace the error if we haven't traced it already for this sensor + if(!(l_fru->flags & FRU_SENSOR_STATUS_INVALID) && + i_sensor_cache->status.fields.ubdts0_err) + { + TRAC_ERR("Membuf %d temp sensor error.", i_membuf); + } + + l_fru->flags |= FRU_SENSOR_STATUS_INVALID; + } + + //use last temperature + l_dts = l_prev_temp; + } + + L_ran_once[i_membuf] = TRUE; + + //Check if at or above the error temperature + if(l_dts >= g_amec->thermalcent.ot_error) + { + //Set a bit so that this dimm can be called out by the thermal thread + G_cent_overtemp_bitmap |= (CENTAUR0_PRESENT_MASK >> i_membuf); + } + + // Update Interim Data - later this will get picked up to form centaur sensor + g_amec->proc[0].memctl[i_membuf].centaur.centaur_hottest.cur_temp = l_dts; + + AMEC_DBG("Membuf[%d]: HotMembuf=%d\n",i_membuf,l_dts); +} + +// Function Specification +// +// Name: amec_update_ocmb_temp_sensors +// +// Description: Updates thermal sensors that have data grabbed by the centaur. +// +// Thread: RealTime Loop +// +// End Function Specification +void amec_update_ocmb_temp_sensors(void) +{ + uint32_t k; + uint32_t l_hot_dimm = 0; + uint32_t l_hot_mb = 0; + + // ----------------------------------------------------------- + // Find hottest temperature from all membufs for this Proc chip + // Find hottest temperature from all DIMMs for this Proc chip + // ----------------------------------------------------------- + for(k=0; k < MAX_NUM_OCMBS; k++) + { + if(g_amec->proc[0].memctl[k].centaur.centaur_hottest.cur_temp > l_hot_mb) + { + l_hot_mb = g_amec->proc[0].memctl[k].centaur.centaur_hottest.cur_temp; + } + if(g_amec->proc[0].memctl[k].centaur.tempdimmax.sample > l_hot_dimm) + { + l_hot_dimm = g_amec->proc[0].memctl[k].centaur.tempdimmax.sample; + } + } + sensor_update(&g_amec->proc[0].temp2mscent,l_hot_mb); + AMEC_DBG("HotMembuf=%d\n",l_hot_mb); + + sensor_update(&g_amec->proc[0].tempdimmthrm,l_hot_dimm); + AMEC_DBG("HotDimm=%d\n",l_hot_dimm); + +} + + +// Function Specification +// +// Name: amec_perfcount_ocmb_getmc +// +// Description: Updates performance sensors that have data grabbed by the +// centaur. +// +// Thread: RealTime Loop +// +// End Function Specification + +void amec_perfcount_ocmb_getmc( OcmbMemData * i_sensor_cache, + uint8_t i_membuf) +{ + /*------------------------------------------------------------------------*/ + /* Local Variables */ + /*------------------------------------------------------------------------*/ + uint32_t tempu = 0; + uint32_t templ = 0; + uint32_t temp32new = 0; + uint32_t temp32 = 0; + uint32_t tempreg = 0; + + #define AMECSENSOR_PORTPAIR_PTR(sensor_base,idx,idx2) \ + (&(g_amec->proc[0].memctl[idx].centaur.portpair[idx2].sensor_base)) + + /*------------------------------------------------------------------------*/ + /* Code */ + /*------------------------------------------------------------------------*/ + + OcmbMemData * l_sensor_cache = i_sensor_cache; + + tempu = l_sensor_cache->mba_rd; + templ = l_sensor_cache->mba_wr; + + // --------------------------------------------------------------------------- + // Interim Calculation: MWRMx (0.01 Mrps) Memory write requests per sec + // --------------------------------------------------------------------------- + + // Extract write bandwidth + temp32new = (templ); + + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.wr_cnt_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.wr_cnt_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.memwrite2ms = tempreg; + + // ------------------------------------------------------------------------- + // Interim Calculation: MRDMx (0.01 Mrps) Memory read requests per sec + // ------------------------------------------------------------------------- + + // Extract read bandwidth + temp32new = (tempu); + + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.rd_cnt_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.rd_cnt_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.memread2ms = tempreg; + + // Go after second MC performance counter (power ups and activations) + tempu = l_sensor_cache->mba_act; + templ = l_sensor_cache->mba_powerups; + + // ---------------------------------------------------------------- + // Sensor: MPUMx (0.01 Mrps) Memory power-up requests per sec + // ---------------------------------------------------------------- + // Extract power up count + temp32new = (templ); // left shift into top 20 bits of 32 bits + + // For DD1.0, we only have 1 channel field that we use; DD2.0 we need to add another channel + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.pwrup_cnt_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.pwrup_cnt_accum = temp32new; // Save latest accumulator away for next time + tempreg=(uint16_t)(temp32>>12); // Select upper 20 bits + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.pwrup_cnt=(uint16_t)tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mpu2ms,i_membuf,0), tempreg); + + // ------------------------------------------------------------------- + // Sensor: MACMx (0.01 Mrps) Memory activation requests per sec + // ------------------------------------------------------------------- + // Extract activation count + temp32 = templ; + temp32 += tempu; + + temp32new = (temp32); // left shift into top 20 bits of 32 bits + // For DD1.0, we only have 1 channel field that we use; DD2.0 we need to add another channel + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.act_cnt_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.act_cnt_accum = temp32new; // Save latest accumulator away for next time + tempreg=(uint16_t)(temp32>>12); // Select lower 16 of 20 bits + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.act_cnt=(uint16_t)tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mac2ms,i_membuf,0), tempreg); + + // -------------------------------------------------------------------------- + // Sensor: MTS (count) Last received Timestamp (frame count) from Centaur + // -------------------------------------------------------------------------- + // Extract framecount (clock is 266.6666666MHz * 0.032 / 4096)=2083. + temp32new = l_sensor_cache->frame_count; + + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.fr2_cnt_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.fr2_cnt_accum = temp32new; // Save latest accumulator away for next time + tempreg=(uint16_t)(temp32>>12); // Select upper 20 bits + + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.fr2_cnt=(uint16_t)tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mts2ms,i_membuf,0), tempreg); + + // ------------------------------------------------------------------------------ + // Sensor: MIRB (0.01 Mevents/s) Memory Inter-request arrival idle intervals + // ------------------------------------------------------------------------------ + temp32new = l_sensor_cache->mba_arr_cnt_base; + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_base_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_base_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.mirb2ms = tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mirb2ms,i_membuf,0), tempreg); + + // -------------------------------------------------------------------------------------------------------- + // Sensor: MIRL (0.01 Mevents/s) Memory Inter-request arrival idle intervals longer than low threshold + // -------------------------------------------------------------------------------------------------------- + temp32new = l_sensor_cache->mba_arr_cnt_low; + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_low_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_low_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.mirl2ms = tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mirl2ms,i_membuf,0), tempreg); + + // ----------------------------------------------------------------------------------------------------------- + // Sensor: MIRM (0.01 Mevents/s) Memory Inter-request arrival idle intervals longer than medium threshold + // ----------------------------------------------------------------------------------------------------------- + temp32new = l_sensor_cache->mba_arr_cnt_med; + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_med_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_med_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.mirm2ms = tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mirm2ms,i_membuf,0), tempreg); + + // --------------------------------------------------------------------------------------------------------- + // Sensor: MIRH (0.01 Mevents/s) Memory Inter-request arrival idle intervals longer than high threshold + // --------------------------------------------------------------------------------------------------------- + temp32new = l_sensor_cache->mba_arr_cnt_high; + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_high_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.intreq_high_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.mirh2ms = tempreg; + sensor_update(AMECSENSOR_PORTPAIR_PTR(mirh2ms,i_membuf,0), tempreg); + + // ---------------------------------------------------- + // Sensor: MLP2 (events/s) Number of LP2 exits + // ---------------------------------------------------- + temp32new = l_sensor_cache->self_timed_refresh; + temp32 = g_amec->proc[0].memctl[i_membuf].centaur.perf.lp2exit_accum; + temp32 = amec_diff_adjust_for_overflow(temp32new, temp32); + g_amec->proc[0].memctl[i_membuf].centaur.perf.lp2exit_accum = temp32new; // Save latest accumulator away for next time + + // Read every 8 ms....to convert to 0.01 Mrps = ((8ms read * 125)/10000) + tempreg = ((temp32*125)/10000); + g_amec->proc[0].memctl[i_membuf].centaur.perf.mlp2_2ms = tempreg; + sensor_update((&(g_amec->proc[0].memctl[i_membuf].centaur.mlp2ms)), tempreg); + + // ------------------------------------------------------------ + // Sensor: MRDMx (0.01 Mrps) Memory read requests per sec + // ------------------------------------------------------------ + tempreg = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.memread2ms; + tempreg += g_amec->proc[0].memctl[i_membuf].centaur.portpair[1].perf.memread2ms; + sensor_update( (&(g_amec->proc[0].memctl[i_membuf].mrd)), tempreg); + + // ------------------------------------------------------------- + // Sensor: MWRMx (0.01 Mrps) Memory write requests per sec + // ------------------------------------------------------------- + tempreg = g_amec->proc[0].memctl[i_membuf].centaur.portpair[0].perf.memwrite2ms; + tempreg += g_amec->proc[0].memctl[i_membuf].centaur.portpair[1].perf.memwrite2ms; + sensor_update( (&(g_amec->proc[0].memctl[i_membuf].mwr)), tempreg); + + return; +} + +/*----------------------------------------------------------------------------*/ +/* End */ +/*----------------------------------------------------------------------------*/ diff --git a/src/occ_405/amec/amec_sensors_ocmb.h b/src/occ_405/amec/amec_sensors_ocmb.h new file mode 100644 index 0000000..c290a3d --- /dev/null +++ b/src/occ_405/amec/amec_sensors_ocmb.h @@ -0,0 +1,36 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_405/amec/amec_sensors_ocmb.h $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef _AMEC_SENSORS_OCMB_H +#define _AMEC_SENSORS_OCMB_H + +//************************************************************************* +// Function Prototypes +//************************************************************************* +void amec_update_ocmb_sensors(uint8_t i_membuf); +void amec_update_ocmb_temp_sensors(void); + +#endif + diff --git a/src/occ_405/amec/amec_slave_smh.c b/src/occ_405/amec/amec_slave_smh.c index 8c34a8a..5293f2f 100755 --- a/src/occ_405/amec/amec_slave_smh.c +++ b/src/occ_405/amec/amec_slave_smh.c @@ -46,6 +46,7 @@ #include <amec_sensors_power.h> #include <memory.h> #include <amec_sensors_centaur.h> +#include <amec_sensors_ocmb.h> #include <amec_sensors_fw.h> #include <amec_freq.h> #include <amec_data.h> @@ -502,8 +503,14 @@ void amec_slv_state_0(void) //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_0); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_0); + } //------------------------------------------------------- // Update vector sensors @@ -531,20 +538,24 @@ void amec_slv_state_0(void) // End Function Specification void amec_slv_state_1(void) { - AMEC_DBG("\tAMEC Slave State 1\n"); - - //------------------------------------------------------- - // Update Centaur sensors (for this tick) - //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) - { - amec_update_centaur_sensors(CENTAUR_1); + AMEC_DBG("\tAMEC Slave State 1\n"); + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { + //------------------------------------------------------- + // Update Centaur sensors (for this tick) + //------------------------------------------------------- + amec_update_centaur_sensors(CENTAUR_1); - //------------------------------------------------------- - // Update Proc Level Centaur/DIMM Temperature sensors - //------------------------------------------------------- - amec_update_centaur_temp_sensors(); - } + //------------------------------------------------------- + // Update Proc Level Centaur/DIMM Temperature sensors + //------------------------------------------------------- + amec_update_centaur_temp_sensors(); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_1); + amec_update_ocmb_temp_sensors(); + } } @@ -562,8 +573,14 @@ void amec_slv_state_2(void) //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_2); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_2); + } // Call VRM Vdd thermal controller amec_controller_vrm_vdd_thermal(); @@ -586,8 +603,14 @@ void amec_slv_state_3(void) //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_3); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_3); + } } @@ -602,13 +625,19 @@ void amec_slv_state_3(void) // End Function Specification void amec_slv_state_4(void) { - AMEC_DBG("\tAMEC Slave State 4\n"); + AMEC_DBG("\tAMEC Slave State 4\n"); //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_4); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_4); + } //------------------------------------------------------- // Run WOF Algorithm if we are NOT getting readings from PGPE @@ -638,8 +667,14 @@ void amec_slv_state_5(void) //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_5); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_5); + } //------------------------------------------------------- // Update partition sensors for DPS algorithms (for this tick) @@ -665,8 +700,14 @@ void amec_slv_state_6(void) //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_6); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_6); + } } @@ -684,8 +725,14 @@ void amec_slv_state_7(void) //------------------------------------------------------- // Update Centaur sensors (for this tick) //------------------------------------------------------- - if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { amec_update_centaur_sensors(CENTAUR_7); + } + else if(MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + amec_update_ocmb_sensors(CENTAUR_7); + } } // Function Specification diff --git a/src/occ_405/cent/centaur_control.c b/src/occ_405/cent/centaur_control.c index 407bbdd..dd3fb7f 100755 --- a/src/occ_405/cent/centaur_control.c +++ b/src/occ_405/cent/centaur_control.c @@ -39,7 +39,7 @@ #include "rtls.h" #include "apss.h" #include "state.h" -#include "centaur_structs.h" +#include "membuf_structs.h" #include "centaur_firmware_registers.h" #include "centaur_register_addresses.h" #include "amec_sys.h" @@ -64,7 +64,7 @@ typedef enum NM_THROTTLE_MBA23 = 1, MBS_THROTTLE_SYNC = 2, NUM_CENT_THROTTLE_SCOMS = 3, -} eCentaurThrottleRegs; +} eMemBufThrottleRegs; //*************************************************************************/ @@ -78,9 +78,9 @@ typedef enum //Pore flex request for the GPE job that is used for centaur init. GpeRequest G_centaur_control_request; -// @see CentaurScomParms in centaur_structs.h -GPE_BUFFER(CentaurScomParms_t G_centaur_control_reg_parms); -// scomList_t @see centaur_configuration.h +// @see CentaurScomParms in membuf_structs.h +GPE_BUFFER(MemBufScomParms_t G_membuf_control_reg_parms); +// scomList_t @see membuf_configuration.h GPE_BUFFER(scomList_t G_centaurThrottle[NUM_CENT_THROTTLE_SCOMS]); //bitmap of configured MBA's (2 per centaur, lsb is centaur 0/mba 0) @@ -244,8 +244,8 @@ bool centaur_control( memory_control_task_t * i_memControlTask ) amec_centaur_t *l_cent_ptr = NULL; int l_cent = i_memControlTask->curMemIndex; - CentaurScomParms_t * l_parms = - (CentaurScomParms_t *)(i_memControlTask->gpe_req.cmd_data); + MemBufScomParms_t * l_parms = + (MemBufScomParms_t *)(i_memControlTask->gpe_req.cmd_data); do { @@ -292,7 +292,7 @@ bool centaur_control( memory_control_task_t * i_memControlTask ) if(MBA_CONFIGURED(l_cent, 0)) { /// [0]: Set up N/M throttle MBA01 - G_centaurThrottle[NM_THROTTLE_MBA01].commandType = CENTAUR_SCOM_RMW; + G_centaurThrottle[NM_THROTTLE_MBA01].commandType = MEMBUF_SCOM_RMW; G_centaurThrottle[NM_THROTTLE_MBA01].instanceNumber = l_cent; // Set up value to be written l_mbafarbq.fields.cfg_nm_n_per_mba = l_mba01_n_per_mba; @@ -301,14 +301,14 @@ bool centaur_control( memory_control_task_t * i_memControlTask ) } else { - G_centaurThrottle[NM_THROTTLE_MBA01].commandType = CENTAUR_SCOM_NOP; + G_centaurThrottle[NM_THROTTLE_MBA01].commandType = MEMBUF_SCOM_NOP; } //only write to MBA23 if configured if(MBA_CONFIGURED(l_cent, 1)) { /// [1]: Set up N/M throttle MBA23 - G_centaurThrottle[NM_THROTTLE_MBA23].commandType = CENTAUR_SCOM_RMW; + G_centaurThrottle[NM_THROTTLE_MBA23].commandType = MEMBUF_SCOM_RMW; G_centaurThrottle[NM_THROTTLE_MBA23].instanceNumber = l_cent; // Set up value to be written l_mbafarbq.fields.cfg_nm_n_per_mba = l_mba23_n_per_mba; @@ -317,10 +317,10 @@ bool centaur_control( memory_control_task_t * i_memControlTask ) } else { - G_centaurThrottle[NM_THROTTLE_MBA23].commandType = CENTAUR_SCOM_NOP; + G_centaurThrottle[NM_THROTTLE_MBA23].commandType = MEMBUF_SCOM_NOP; } - G_centaurThrottle[MBS_THROTTLE_SYNC].commandType = CENTAUR_SCOM_CENTAUR_SYNC; + G_centaurThrottle[MBS_THROTTLE_SYNC].commandType = MEMBUF_SCOM_MEMBUF_SYNC; /// Set up GPE parameters l_parms->scomList = G_centaurThrottle; @@ -377,9 +377,9 @@ void centaur_control_init( void ) G_centaurThrottle[NM_THROTTLE_MBA23].mask = l_mbafarbq.value; // Set up GPE parameters - G_centaur_control_reg_parms.error.ffdc = 0; - G_centaur_control_reg_parms.entries = 0; - G_centaur_control_reg_parms.scomList = &G_centaurThrottle[0]; + G_membuf_control_reg_parms.error.ffdc = 0; + G_membuf_control_reg_parms.entries = 0; + G_membuf_control_reg_parms.scomList = &G_centaurThrottle[0]; //-------------------------------------------------- // Initializes GPE Centaur Control Task, but @@ -388,8 +388,8 @@ void centaur_control_init( void ) l_rc_gpe = gpe_request_create( &G_memory_control_task.gpe_req, // gpe_req for the task &G_async_gpe_queue1, // queue - IPC_ST_CENTAUR_SCOM_FUNCID, // Function ID - &G_centaur_control_reg_parms, // parm for the task + IPC_ST_MEMBUF_SCOM_FUNCID, // Function ID + &G_membuf_control_reg_parms, // parm for the task SSX_WAIT_FOREVER, // NULL, // callback NULL, // callback argument @@ -429,7 +429,7 @@ void centaur_control_init( void ) ); addUsrDtlsToErrl(l_err, //io_err - (uint8_t *) &G_centaur_control_request.ffdc, //i_dataPtr, + (uint8_t *) &G_memory_control_task.gpe_req.ffdc, //i_dataPtr, sizeof(GpeFfdc), //i_size ERRL_USR_DTL_STRUCT_VERSION_1, //version ERRL_USR_DTL_BINARY_DATA); //type diff --git a/src/occ_405/cent/centaur_data.c b/src/occ_405/cent/centaur_data.c index ec27b9d..3ccd7bf 100755 --- a/src/occ_405/cent/centaur_data.c +++ b/src/occ_405/cent/centaur_data.c @@ -38,10 +38,11 @@ #include "apss.h" #include "state.h" #include "occhw_scom.h" -#include "centaur_structs.h" +#include "membuf_structs.h" #include "centaur_mem_data.h" #include "centaur_firmware_registers.h" #include "centaur_register_addresses.h" +#include "dimm.h" // MEM_TYPE_ //*************************************************************************/ // Externs @@ -111,19 +112,19 @@ GPE_BUFFER(CentaurMemData G_centaur_data[NUM_CENTAUR_DATA_BUFF + //pore request for scoming centaur registers GpeRequest G_cent_scom_req; // p8/working/procedures/ssx/pgp/pgp_async.h -//input/output parameters for IPC_ST_CENTAUR_SCOM() -GPE_BUFFER(CentaurScomParms_t G_cent_scom_gpe_parms); +//input/output parameters for IPC_ST_MEMBUF_SCOM() +GPE_BUFFER(MemBufScomParms_t G_cent_scom_gpe_parms); //scom command list entry GPE_BUFFER(scomList_t G_cent_scom_list_entry[NUM_CENT_OPS]); -//buffer for storing output from running IPC_ST_CENTAUR_SCOM() +//buffer for storing output from running IPC_ST_MEMBUF_SCOM() GPE_BUFFER(uint64_t G_cent_scom_data[MAX_NUM_CENTAURS]) = {0}; -// parms for call to IPC_ST_CENTAUR_INIT_FUNCID -GPE_BUFFER(CentaurConfigParms_t G_gpe_centaur_config_args); +// parms for call to IPC_ST_MEMBUF_INIT_FUNCID +GPE_BUFFER(MemBufConfigParms_t G_gpe_centaur_config_args); -GPE_BUFFER(CentaurConfiguration_t G_centaurConfiguration); +GPE_BUFFER(MemBufConfiguration_t G_membufConfiguration); //Global array of centaur data pointers CentaurMemData * G_centaur_data_ptrs[MAX_NUM_CENTAURS] = { &G_centaur_data[0], &G_centaur_data[1], &G_centaur_data[2], &G_centaur_data[3], @@ -131,18 +132,18 @@ CentaurMemData * G_centaur_data_ptrs[MAX_NUM_CENTAURS] = { &G_centaur_data[0], &G_centaur_data[7]}; //Global structures for gpe get mem data parms -GPE_BUFFER(CentaurGetMemDataParms_t G_centaur_data_parms); +GPE_BUFFER(MemBufGetMemDataParms_t G_membuf_data_parms); //Pore flex request for the GPE job that is used for centaur init. GpeRequest G_centaur_reg_gpe_req; //Centaur structures used for task data pointers. -centaur_data_task_t G_centaur_data_task = { - .start_centaur = 0, - .current_centaur = 0, - .end_centaur = 7, - .prev_centaur = 7, - .centaur_data_ptr = &G_centaur_data[MAX_NUM_CENTAURS] +membuf_data_task_t G_membuf_data_task = { + .start_membuf = 0, + .current_membuf = 0, + .end_membuf = 7, + .prev_membuf = 7, + .membuf_data_ptr = &G_centaur_data[MAX_NUM_CENTAURS] }; @@ -274,7 +275,7 @@ void cent_recovery(uint32_t i_cent) { // Check if the centaur has a channel checkstop. If it does then remove the centaur // from the enabled sensor bit map and do not log any errors - if(G_cent_scom_gpe_parms.error.rc == CENTAUR_CHANNEL_CHECKSTOP) + if(G_cent_scom_gpe_parms.error.rc == MEMBUF_CHANNEL_CHECKSTOP) { cent_chan_checkstop(l_prev_cent); } @@ -284,7 +285,7 @@ void cent_recovery(uint32_t i_cent) L_cent_callouts |= l_cent_mask; // There was an error doing the recovery scoms - TRAC_ERR("cent_recovery: IPC_ST_CENTAUR_SCOM failed. rc[0x%08x] cent[%d] entries[%d] errorIndex[0x%08X]", + TRAC_ERR("cent_recovery: IPC_ST_MEMBUF_SCOM failed. rc[0x%08x] cent[%d] entries[%d] errorIndex[0x%08X]", G_cent_scom_gpe_parms.error.rc, l_prev_cent, G_cent_scom_gpe_parms.entries, @@ -449,17 +450,17 @@ void cent_recovery(uint32_t i_cent) //check if this centaur requires lfir6 recovery if(G_centaur_nest_lfir6 & l_cent_mask) { - //Set the command type from CENTAUR_SCOM_NOP to CENTAUR_SCOM_RMW + //Set the command type from MEMBUF_SCOM_NOP to MEMBUF_SCOM_RMW //these entries will reset the centaur DTS FSM and clear LFIR 6 //if recovery worked, LFIR 6 should remain cleared. - G_cent_scom_list_entry[RESET_DTS_FSM].commandType = CENTAUR_SCOM_WRITE; - G_cent_scom_list_entry[CLEAR_NEST_LFIR6].commandType = CENTAUR_SCOM_WRITE; + G_cent_scom_list_entry[RESET_DTS_FSM].commandType = MEMBUF_SCOM_WRITE; + G_cent_scom_list_entry[CLEAR_NEST_LFIR6].commandType = MEMBUF_SCOM_WRITE; } else { //these ops aren't needed so disable them - G_cent_scom_list_entry[RESET_DTS_FSM].commandType = CENTAUR_SCOM_NOP; - G_cent_scom_list_entry[CLEAR_NEST_LFIR6].commandType = CENTAUR_SCOM_NOP; + G_cent_scom_list_entry[RESET_DTS_FSM].commandType = MEMBUF_SCOM_NOP; + G_cent_scom_list_entry[CLEAR_NEST_LFIR6].commandType = MEMBUF_SCOM_NOP; } //Decrement the delay counter for centaur i2c recovery @@ -489,13 +490,13 @@ void cent_recovery(uint32_t i_cent) //clear the request for i2c recovery here G_centaur_needs_recovery &= ~l_cent_mask; - //Set the command type from CENTAUR_SCOM_NOP to CENTAUR_SCOM_RMW + //Set the command type from MEMBUF_SCOM_NOP to MEMBUF_SCOM_RMW //this entry will disable the centaur sensor cache and //set a flag to finish the recovery in a later call of this //function (cent_recovery for a given centaur is called every //2 msec) - G_cent_scom_list_entry[DISABLE_SC].commandType = CENTAUR_SCOM_RMW; - G_cent_scom_list_entry[ENABLE_SC].commandType = CENTAUR_SCOM_NOP; + G_cent_scom_list_entry[DISABLE_SC].commandType = MEMBUF_SCOM_RMW; + G_cent_scom_list_entry[ENABLE_SC].commandType = MEMBUF_SCOM_NOP; L_i2c_finish_recovery[i_cent] = TRUE; } } @@ -515,8 +516,8 @@ void cent_recovery(uint32_t i_cent) } //these ops aren't needed so disable them - G_cent_scom_list_entry[DISABLE_SC].commandType = CENTAUR_SCOM_NOP; - G_cent_scom_list_entry[ENABLE_SC].commandType = CENTAUR_SCOM_NOP; + G_cent_scom_list_entry[DISABLE_SC].commandType = MEMBUF_SCOM_NOP; + G_cent_scom_list_entry[ENABLE_SC].commandType = MEMBUF_SCOM_NOP; // Finish the i2c recovery if it was started for this centaur if(L_i2c_finish_recovery[i_cent] == TRUE) @@ -527,11 +528,11 @@ void cent_recovery(uint32_t i_cent) //clear the finish_recovery flag for this centaur L_i2c_finish_recovery[i_cent] = FALSE; - //Set the command type from CENTAUR_SCOM_NOP to CENTAUR_SCOM_RMW + //Set the command type from MEMBUF_SCOM_NOP to MEMBUF_SCOM_RMW //this entry will re-enable the centaur sensor cache //which will also cause the i2c master to be reset - G_cent_scom_list_entry[DISABLE_SC].commandType = CENTAUR_SCOM_NOP; - G_cent_scom_list_entry[ENABLE_SC].commandType = CENTAUR_SCOM_RMW; + G_cent_scom_list_entry[DISABLE_SC].commandType = MEMBUF_SCOM_NOP; + G_cent_scom_list_entry[ENABLE_SC].commandType = MEMBUF_SCOM_RMW; } } @@ -596,9 +597,9 @@ void centaur_data( void ) errlHndl_t l_err = NULL; // Error handler int rc = 0; // Return code CentaurMemData * l_temp = NULL; - centaur_data_task_t * l_centaur_data_ptr = &G_centaur_data_task; - CentaurGetMemDataParms_t * l_parms = - (CentaurGetMemDataParms_t *)(l_centaur_data_ptr->gpe_req.cmd_data); + membuf_data_task_t * l_centaur_data_ptr = &G_membuf_data_task; + MemBufGetMemDataParms_t * l_parms = + (MemBufGetMemDataParms_t *)(l_centaur_data_ptr->gpe_req.cmd_data); static bool L_gpe_scheduled = FALSE; static bool L_gpe_error_logged = FALSE; static bool L_gpe_had_1_tick = FALSE; @@ -608,16 +609,16 @@ void centaur_data( void ) // ------------------------------------------ // Centaur Data Task Variable Initial State // ------------------------------------------ - // ->current_centaur: the one that was just 'written' to last tick to + // ->current_membuf: the one that was just 'written' to last tick to // kick off the sensor cache population in the - // centaur. It will be 'read from' during this tick. + // membuf. It will be 'read from' during this tick. // - // ->prev_centaur: the one that was 'read from' during the last tick + // ->prev_membuf: the one that was 'read from' during the last tick // and will be used to update the // G_updated_centaur_mask during this tick. // - // ->centaur_data_ptr: points to G_centaur_data_ptrs[] for - // the centaur that is referenced by prev_centaur + // ->membuf_data_ptr: points to G_centaur_data_ptrs[] for + // the centaur that is referenced by prev_membuf // (the one that was just 'read') //First, check to see if the previous GPE request still running @@ -648,7 +649,7 @@ void centaur_data( void ) //Need to complete collecting data for all assigned centaurs from //previous interval and tick 0 is the current tick before collect data again. - if( (l_centaur_data_ptr->current_centaur == l_centaur_data_ptr->end_centaur) + if( (l_centaur_data_ptr->current_membuf == l_centaur_data_ptr->end_membuf) && ((CURRENT_TICK & (MAX_NUM_TICKS - 1)) != 0) ) { CENT_DBG("Did not collect centaur data. Need to wait for tick."); @@ -666,11 +667,11 @@ void centaur_data( void ) { // Check if the centaur has a channel checkstop. If it does then do not // log any errors, but remove the centaur from the config - if(l_parms->error.rc == CENTAUR_CHANNEL_CHECKSTOP) + if(l_parms->error.rc == MEMBUF_CHANNEL_CHECKSTOP) { - cent_chan_checkstop(l_centaur_data_ptr->prev_centaur); + cent_chan_checkstop(l_centaur_data_ptr->prev_membuf); } - else // log the error if it was not a CENTAUR_CHANNEL_CHECKSTOP + else // log the error if it was not a MEMBUF_CHANNEL_CHECKSTOP { //log an error the first time this happens but keep on running. //This should be informational (except mfg) since we are going to retry @@ -683,8 +684,8 @@ void centaur_data( void ) // There was an error collecting the centaur sensor cache TRAC_ERR("task_centaur_data: gpe_get_mem_data failed. rc=0x%08x, cur=%d, prev=%d", l_parms->error.rc, - l_centaur_data_ptr->current_centaur, - l_centaur_data_ptr->prev_centaur); + l_centaur_data_ptr->current_membuf, + l_centaur_data_ptr->prev_membuf); /* @ * @errortype * @moduleid CENT_TASK_DATA_MOD @@ -714,8 +715,16 @@ void centaur_data( void ) ERRL_USR_DTL_STRUCT_VERSION_1, //version ERRL_USR_DTL_BINARY_DATA); //type + + // Capture the GPE1 trace buffer + addUsrDtlsToErrl(l_err, + (uint8_t *) G_shared_gpe_data.gpe1_tb_ptr, + G_shared_gpe_data.gpe1_tb_sz, + ERRL_USR_DTL_STRUCT_VERSION_1, + ERRL_USR_DTL_TRACE_DATA); + //Callouts depend on the return code of the gpe_get_mem_data procedure - if(l_parms->error.rc == CENTAUR_GET_MEM_DATA_DIED) + if(l_parms->error.rc == MEMBUF_GET_MEM_DATA_DIED) { //callout the processor addCalloutToErrl(l_err, @@ -723,14 +732,15 @@ void centaur_data( void ) G_sysConfigData.proc_huid, ERRL_CALLOUT_PRIORITY_LOW); } - else if(l_parms->error.rc == CENTAUR_GET_MEM_DATA_SENSOR_CACHE_FAILED) + else if(l_parms->error.rc == CENTAUR_GET_MEM_DATA_SENSOR_CACHE_FAILED || + l_parms->error.rc == MEMBUF_SCACHE_ERROR) { //callout the previous centaur if present - if(CENTAUR_PRESENT(l_centaur_data_ptr->prev_centaur)) + if(CENTAUR_PRESENT(l_centaur_data_ptr->prev_membuf)) { addCalloutToErrl(l_err, ERRL_CALLOUT_TYPE_HUID, - G_sysConfigData.centaur_huids[l_centaur_data_ptr->prev_centaur], + G_sysConfigData.centaur_huids[l_centaur_data_ptr->prev_membuf], ERRL_CALLOUT_PRIORITY_HIGH); } @@ -743,11 +753,11 @@ void centaur_data( void ) else if(l_parms->error.rc == CENTAUR_GET_MEM_DATA_UPDATE_FAILED) { //callout the current centaur if present - if(CENTAUR_PRESENT(l_centaur_data_ptr->current_centaur)) + if(CENTAUR_PRESENT(l_centaur_data_ptr->current_membuf)) { addCalloutToErrl(l_err, ERRL_CALLOUT_TYPE_HUID, - G_sysConfigData.centaur_huids[l_centaur_data_ptr->current_centaur], + G_sysConfigData.centaur_huids[l_centaur_data_ptr->current_membuf], ERRL_CALLOUT_PRIORITY_HIGH); } @@ -775,18 +785,18 @@ void centaur_data( void ) //If the previous GPE request succeeded then swap l_centaur_data_ptr //with the global one. The gpe routine will write new data into //a buffer that is not being accessed by the RTLoop code. - l_temp = l_centaur_data_ptr->centaur_data_ptr; - l_centaur_data_ptr->centaur_data_ptr = - G_centaur_data_ptrs[l_centaur_data_ptr->current_centaur]; - G_centaur_data_ptrs[l_centaur_data_ptr->prev_centaur] = l_temp; + l_temp = l_centaur_data_ptr->membuf_data_ptr; + l_centaur_data_ptr->membuf_data_ptr = + G_centaur_data_ptrs[l_centaur_data_ptr->current_membuf]; + G_centaur_data_ptrs[l_centaur_data_ptr->prev_membuf] = l_temp; //Centaur data has been collected so set the bit in global mask. //AMEC code will know which centaur to update sensors for. AMEC is //responsible for clearing the bit later on. // prev centaur is the one that was just 'read from' in the last tick - if( CENTAUR_PRESENT(l_centaur_data_ptr->prev_centaur) ) + if( CENTAUR_PRESENT(l_centaur_data_ptr->prev_membuf) ) { - G_updated_centaur_mask |= CENTAUR_BY_MASK(l_centaur_data_ptr->prev_centaur); + G_updated_centaur_mask |= CENTAUR_BY_MASK(l_centaur_data_ptr->prev_membuf); } } }//if(L_gpe_scheduled) @@ -794,48 +804,48 @@ void centaur_data( void ) // If the centaur is not present, then we need to point to the empty G_centaur_data // so that we don't use old/stale data from a leftover G_centaur_data // (this is very handy for debug...) - if( !CENTAUR_PRESENT(l_centaur_data_ptr->current_centaur)) + if( !CENTAUR_PRESENT(l_centaur_data_ptr->current_membuf)) { - G_centaur_data_ptrs[l_centaur_data_ptr->current_centaur] = &G_centaur_data[9]; + G_centaur_data_ptrs[l_centaur_data_ptr->current_membuf] = &G_centaur_data[9]; } //Update current centaur - if ( l_centaur_data_ptr->current_centaur >= l_centaur_data_ptr->end_centaur ) + if ( l_centaur_data_ptr->current_membuf >= l_centaur_data_ptr->end_membuf ) { - l_centaur_data_ptr->prev_centaur = l_centaur_data_ptr->current_centaur; - l_centaur_data_ptr->current_centaur = l_centaur_data_ptr->start_centaur; + l_centaur_data_ptr->prev_membuf = l_centaur_data_ptr->current_membuf; + l_centaur_data_ptr->current_membuf = l_centaur_data_ptr->start_membuf; } else { - l_centaur_data_ptr->prev_centaur = l_centaur_data_ptr->current_centaur; - l_centaur_data_ptr->current_centaur++; + l_centaur_data_ptr->prev_membuf = l_centaur_data_ptr->current_membuf; + l_centaur_data_ptr->current_membuf++; } // ------------------------------------------ - // Centaur Data Task Variable State Changed + // Membuf Data Task Variable State Changed // ------------------------------------------ - // ->current_centaur: the one that will be 'written' to in order to + // ->current_membuf: the one that will be 'written' to in order to // kick off the sensor cache population in the - // centaur. + // membuf. // - // ->prev_centaur: the one that will be 'read from', meaning have - // the sensor cache transferred from the Centaur - // to l_centaur_data_ptr->centaur_data_ptr + // ->prev_membuf: the one that will be 'read from', meaning have + // the sensor cache transferred from the membuf + // to l_centaur_data_ptr->membuf_data_ptr // - // ->centaur_data_ptr: points to G_centaur_data_ptrs[] for - // the centaur that is referenced by prev_centaur + // ->membuf_data_ptr: points to G_centaur_data_ptrs[] for + // the centaur that is referenced by prev_membuf // (the one that will be 'read') //If centaur is not present then skip it. This task assigned to this centaur will //be idle during this time it would have collected the data. - if( CENTAUR_PRESENT(l_centaur_data_ptr->current_centaur) - || CENTAUR_PRESENT(l_centaur_data_ptr->prev_centaur) ) + if( CENTAUR_PRESENT(l_centaur_data_ptr->current_membuf) + || CENTAUR_PRESENT(l_centaur_data_ptr->prev_membuf) ) { // Setup the 'get centaur data' parms // ->config controls which Centaur we are reading from - if( CENTAUR_PRESENT(l_centaur_data_ptr->prev_centaur) ){ + if( CENTAUR_PRESENT(l_centaur_data_ptr->prev_membuf) ){ // If prev centaur is present, do the read of the sensor cache - l_parms->collect = l_centaur_data_ptr->prev_centaur; + l_parms->collect = l_centaur_data_ptr->prev_membuf; } else{ // If prev centaur is not present, don't do the read of the sensor cache. @@ -843,16 +853,16 @@ void centaur_data( void ) } // ->config_update controls which Centaur we are writing to - if( CENTAUR_PRESENT(l_centaur_data_ptr->current_centaur) ){ + if( CENTAUR_PRESENT(l_centaur_data_ptr->current_membuf) ){ // If cur centaur is present, do the write to kick off the sensor cache collect - l_parms->update = l_centaur_data_ptr->current_centaur; + l_parms->update = l_centaur_data_ptr->current_membuf; } else{ // If cur centaur is not present, don't do the write to kick off the sensor cache collect l_parms->update = -1; } - l_parms->data = (uint64_t *)(l_centaur_data_ptr->centaur_data_ptr); + l_parms->data = (uint64_t *)(l_centaur_data_ptr->membuf_data_ptr); l_parms->error.ffdc = 0; // Pore flex schedule gpe_get_mem_data @@ -899,9 +909,12 @@ void centaur_data( void ) while(0); //handle centaur i2c recovery requests and centaur workaround. - if(CENTAUR_PRESENT(l_centaur_data_ptr->current_centaur)) + if(CENTAUR_PRESENT(l_centaur_data_ptr->current_membuf)) { - cent_recovery(l_centaur_data_ptr->current_centaur); + if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { + cent_recovery(l_centaur_data_ptr->current_membuf); + } } return; } @@ -923,7 +936,7 @@ int cent_get_enabled_sensors() { // Set up scom list entry (there's only 1) G_cent_scom_list_entry[0].scom = CENTAUR_SENSCACHE_ENABLE; //scom address - G_cent_scom_list_entry[0].commandType = CENTAUR_SCOM_READ_VECTOR; //scom operation to perform + G_cent_scom_list_entry[0].commandType = MEMBUF_SCOM_READ_VECTOR; //scom operation to perform G_cent_scom_list_entry[0].instanceNumber = 0; //Ignored for READ_VECTOR operation G_cent_scom_list_entry[0].pData = (uint64_t *) G_cent_scom_data; //scom data will be stored here @@ -936,7 +949,7 @@ int cent_get_enabled_sensors() l_rc = gpe_request_create( &G_cent_scom_req, // gpe_req for the task &G_async_gpe_queue1, // queue - IPC_ST_CENTAUR_SCOM_FUNCID, // Function ID + IPC_ST_MEMBUF_SCOM_FUNCID, // Function ID &G_cent_scom_gpe_parms, // parm for the task SSX_SECONDS(2), // timeout NULL, // callback @@ -985,7 +998,7 @@ void centaur_init( void ) int rc = 0; // Return code int l_jj = 0; // Indexer static scomList_t L_scomList[2] SECTION_ATTRIBUTE(".noncacheable"); - static CentaurScomParms_t L_centaur_reg_parms SECTION_ATTRIBUTE(".noncacheable"); + static MemBufScomParms_t L_centaur_reg_parms SECTION_ATTRIBUTE(".noncacheable"); do { @@ -998,7 +1011,7 @@ void centaur_init( void ) /// Before anything else, we need to call this procedure to /// determine which Centaurs are out there, their config info. /// and Type/EC Level - rc = centaur_configuration_create(&G_centaurConfiguration); + rc = membuf_configuration_create(); if( rc ) { break; @@ -1015,14 +1028,13 @@ void centaur_init( void ) if( CENTAUR_BY_MASK(l_jj) ) { - if( G_centaurConfiguration.baseAddress[l_jj] ) + if( G_membufConfiguration.baseAddress[l_jj] ) { // G_cent_ba is != 0, so a valid Bar Address was found // This means there is a VALID centaur there. G_present_centaurs |= (CENTAUR0_PRESENT_MASK >> l_jj); - // Trace out the CFAM Chip ID, which includes Type & EC - TRAC_INFO("centaur_init: Centaur[%d] Found, Chip Id= 0x%08x",l_jj); + TRAC_INFO("centaur_init: Centaur[%d] Found",l_jj); } } } @@ -1034,49 +1046,49 @@ void centaur_init( void ) // Set up recovery scom list entries G_cent_scom_list_entry[L4_LINE_DELETE].scom = MBCCFGQ_REG; //scom address - G_cent_scom_list_entry[L4_LINE_DELETE].commandType = CENTAUR_SCOM_RMW; //scom operation to perform + G_cent_scom_list_entry[L4_LINE_DELETE].commandType = MEMBUF_SCOM_RMW; //scom operation to perform G_cent_scom_list_entry[L4_LINE_DELETE].mask = LINE_DELETE_ON_NEXT_CE; //mask of bits to change G_cent_scom_list_entry[L4_LINE_DELETE].data = LINE_DELETE_ON_NEXT_CE; //scom data (always set the bit) //one time init for reading LFIR6 G_cent_scom_list_entry[READ_NEST_LFIR6].scom = CENT_NEST_LFIR_REG; //scom address - G_cent_scom_list_entry[READ_NEST_LFIR6].commandType = CENTAUR_SCOM_READ; //scom operation to perform + G_cent_scom_list_entry[READ_NEST_LFIR6].commandType = MEMBUF_SCOM_READ; //scom operation to perform G_cent_scom_list_entry[READ_NEST_LFIR6].mask = 0; //mask (not used for reads) G_cent_scom_list_entry[READ_NEST_LFIR6].data = 0; //scom data (initialize to 0) //one time init for reading centaur thermal status register G_cent_scom_list_entry[READ_THERM_STATUS].scom = CENT_THRM_STATUS_REG; //scom address - G_cent_scom_list_entry[READ_THERM_STATUS].commandType = CENTAUR_SCOM_READ; //scom operation to perform + G_cent_scom_list_entry[READ_THERM_STATUS].commandType = MEMBUF_SCOM_READ; //scom operation to perform G_cent_scom_list_entry[READ_THERM_STATUS].mask = 0; //mask (not used for reads) G_cent_scom_list_entry[READ_THERM_STATUS].data = 0; //scom data (initialize to 0) //one time init to reset the centaur dts FSM G_cent_scom_list_entry[RESET_DTS_FSM].scom = CENT_THRM_CTRL_REG; //scom address - G_cent_scom_list_entry[RESET_DTS_FSM].commandType = CENTAUR_SCOM_NOP; //init to no-op (only runs if needed) + G_cent_scom_list_entry[RESET_DTS_FSM].commandType = MEMBUF_SCOM_NOP; //init to no-op (only runs if needed) G_cent_scom_list_entry[RESET_DTS_FSM].mask = 0; //mask (not used for writes) G_cent_scom_list_entry[RESET_DTS_FSM].data = CENT_THRM_CTRL4; //scom data (sets bit4) //one time init to clear centaur NEST LFIR 6 G_cent_scom_list_entry[CLEAR_NEST_LFIR6].scom = CENT_NEST_LFIR_AND_REG; //scom address - G_cent_scom_list_entry[CLEAR_NEST_LFIR6].commandType = CENTAUR_SCOM_NOP; //init to no-op (only runs if needed) + G_cent_scom_list_entry[CLEAR_NEST_LFIR6].commandType = MEMBUF_SCOM_NOP; //init to no-op (only runs if needed) G_cent_scom_list_entry[CLEAR_NEST_LFIR6].mask = 0; //mask (not used for writes) G_cent_scom_list_entry[CLEAR_NEST_LFIR6].data = ~CENT_NEST_LFIR6; //scom data //one time init to disable centaur sensor cache G_cent_scom_list_entry[DISABLE_SC].scom = SCAC_CONFIG_REG; //scom address - G_cent_scom_list_entry[DISABLE_SC].commandType = CENTAUR_SCOM_NOP; //init to no-op (only runs if needed) + G_cent_scom_list_entry[DISABLE_SC].commandType = MEMBUF_SCOM_NOP; //init to no-op (only runs if needed) G_cent_scom_list_entry[DISABLE_SC].mask = SCAC_MASTER_ENABLE; //mask of bits to change G_cent_scom_list_entry[DISABLE_SC].data = 0; //scom data (disable sensor cache) //one time init to enable centaur sensor cache G_cent_scom_list_entry[ENABLE_SC].scom = SCAC_CONFIG_REG; //scom address - G_cent_scom_list_entry[ENABLE_SC].commandType = CENTAUR_SCOM_NOP; //init to no-op (only runs if needed) + G_cent_scom_list_entry[ENABLE_SC].commandType = MEMBUF_SCOM_NOP; //init to no-op (only runs if needed) G_cent_scom_list_entry[ENABLE_SC].mask = SCAC_MASTER_ENABLE; //mask of bits to change G_cent_scom_list_entry[ENABLE_SC].data = SCAC_MASTER_ENABLE; //scom data (enable sensor cache) //one time init for reading centaur sensor cache lfir G_cent_scom_list_entry[READ_SCAC_LFIR].scom = SCAC_LFIR_REG; //scom address - G_cent_scom_list_entry[READ_SCAC_LFIR].commandType = CENTAUR_SCOM_READ; //scom operation to perform + G_cent_scom_list_entry[READ_SCAC_LFIR].commandType = MEMBUF_SCOM_READ; //scom operation to perform G_cent_scom_list_entry[READ_SCAC_LFIR].mask = 0; //mask (not used for reads) G_cent_scom_list_entry[READ_SCAC_LFIR].data = 0; //scom data (initialize to 0) @@ -1085,7 +1097,7 @@ void centaur_init( void ) /// NOTE: max timeout is about 2 seconds. L_scomList[0].scom = CENTAUR_MBSCFGQ; - L_scomList[0].commandType = CENTAUR_SCOM_RMW_ALL; + L_scomList[0].commandType = MEMBUF_SCOM_RMW_ALL; centaur_mbscfgq_t l_mbscfg; l_mbscfg.value = 0; @@ -1102,7 +1114,7 @@ void centaur_init( void ) /// [1]: clear the emergency throttle bit L_scomList[1].scom = CENTAUR_MBSEMERTHROQ; - L_scomList[1].commandType = CENTAUR_SCOM_RMW_ALL; + L_scomList[1].commandType = MEMBUF_SCOM_RMW_ALL; centaur_mbsemerthroq_t l_mbs_et; l_mbs_et.value = 0; @@ -1122,7 +1134,7 @@ void centaur_init( void ) rc = gpe_request_create( &G_centaur_reg_gpe_req, //gpe_req for the task &G_async_gpe_queue1, //queue - IPC_ST_CENTAUR_SCOM_FUNCID, // Function ID + IPC_ST_MEMBUF_SCOM_FUNCID, // Function ID &L_centaur_reg_parms, //parm for the task SSX_SECONDS(5), //timeout NULL, //callback @@ -1140,7 +1152,7 @@ void centaur_init( void ) // Check for errors on Scom if(rc || L_centaur_reg_parms.error.rc) { - TRAC_ERR("centaur_init: IPC_ST_CENTAUR_SCOM failure. rc = 0x%08x, gpe_rc = 0x%08x, address = 0x%08x", + TRAC_ERR("centaur_init: IPC_ST_MEMBUF_SCOM failure. rc = 0x%08x, gpe_rc = 0x%08x, address = 0x%08x", rc, L_centaur_reg_parms.error.rc, L_centaur_reg_parms.error.addr); @@ -1156,17 +1168,17 @@ void centaur_init( void ) /// to gather the 'centaur' data, but we will set them to /// invalid (-1) until the task sets them up - G_centaur_data_parms.error.ffdc = 0; - G_centaur_data_parms.collect = -1; - G_centaur_data_parms.update = -1; - G_centaur_data_parms.data = 0; + G_membuf_data_parms.error.ffdc = 0; + G_membuf_data_parms.collect = -1; + G_membuf_data_parms.update = -1; + G_membuf_data_parms.data = 0; //Initializes existing PoreFlex object for centaur data rc = gpe_request_create( - &G_centaur_data_task.gpe_req, //gpe_req for the task + &G_membuf_data_task.gpe_req, //gpe_req for the task &G_async_gpe_queue1, //queue - IPC_ST_CENTAUR_DATA_FUNCID, //Function ID - &G_centaur_data_parms, //parm for the task + IPC_ST_MEMBUF_DATA_FUNCID, //Function ID + &G_membuf_data_parms, //parm for the task SSX_WAIT_FOREVER, // NULL, //callback NULL, //callback argument @@ -1174,7 +1186,7 @@ void centaur_init( void ) if(rc) { - TRAC_ERR("centaur_init: gpe_request_create failed for G_centaur_data_task.gpe_req. rc = 0x%08x", rc); + TRAC_ERR("centaur_init: gpe_request_create failed for G_membuf_data_task.gpe_req. rc = 0x%08x", rc); break; } @@ -1182,7 +1194,7 @@ void centaur_init( void ) rc = gpe_request_create( &G_cent_scom_req, // gpe_req for the task &G_async_gpe_queue1, // queue - IPC_ST_CENTAUR_SCOM_FUNCID, // entry point + IPC_ST_MEMBUF_SCOM_FUNCID, // entry point &G_cent_scom_gpe_parms, // parm for the task SSX_WAIT_FOREVER, // NULL, // callback @@ -1275,19 +1287,27 @@ CentaurMemData * cent_get_centaur_data_ptr( const uint8_t i_occ_centaur_id ) } } -uint32_t centaur_configuration_create( CentaurConfiguration_t * i_centaurConfiguration ) +uint32_t membuf_configuration_create( ) { bool rc = 0; GpeRequest l_request; do { - G_gpe_centaur_config_args.centaurConfiguration = i_centaurConfiguration; + G_gpe_centaur_config_args.membufConfiguration = &G_membufConfiguration; + if(MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) + { + G_gpe_centaur_config_args.mem_type = MEMTYPE_CENTAUR; + } + else + { + G_gpe_centaur_config_args.mem_type = MEMTYPE_OCMB; + } rc = gpe_request_create( &l_request, // request &G_async_gpe_queue1, // gpe queue - IPC_ST_CENTAUR_INIT_FUNCID, // Function Id + IPC_ST_MEMBUF_INIT_FUNCID, // Function Id &G_gpe_centaur_config_args, // GPE arg_ptr SSX_SECONDS(5), // timeout NULL, // callback @@ -1295,22 +1315,22 @@ uint32_t centaur_configuration_create( CentaurConfiguration_t * i_centaurConfigu ASYNC_REQUEST_BLOCKING); if( rc ) { - TRAC_ERR("centaur_configuration_create: gpe_request_create failed for" - " IPC_ST_CENTAUR_INIT_FUNCID. rc = 0x%08x",rc); + TRAC_ERR("membuf_configuration_create: gpe_request_create failed for" + " IPC_ST_MEMBUF_INIT_FUNCID. rc = 0x%08x",rc); break; } - TRAC_INFO("centaur_configuration_create: Scheduling request for IPC_ST_CENTAUR_INIT_FUNCID"); + TRAC_INFO("membuf_configuration_create: Scheduling request for IPC_ST_MEMBUF_INIT_FUNCID"); gpe_request_schedule(&l_request); - TRAC_INFO("centaur_configuration_create: GPE_centaur_configuration_create w/rc=0x%08x", + TRAC_INFO("membuf_configuration_create: GPE_membuf_configuration_create w/rc=0x%08x", l_request.request.completion_state); if(ASYNC_REQUEST_STATE_COMPLETE != l_request.request.completion_state) { rc = l_request.request.completion_state; - TRAC_ERR("centaur_configuration_create: IPC_ST_CENTAUR_INIT_FUNCID" + TRAC_ERR("membuf_configuration_create: IPC_ST_MEMBUF_INIT_FUNCID" " request did not complete."); break; } @@ -1318,7 +1338,7 @@ uint32_t centaur_configuration_create( CentaurConfiguration_t * i_centaurConfigu if (G_gpe_centaur_config_args.error.rc != GPE_RC_SUCCESS) { rc = G_gpe_centaur_config_args.error.rc; - TRAC_ERR("centaur_configuration_create: IPC_ST_CENTAUR_INIT_FUNCID" + TRAC_ERR("membuf_configuration_create: IPC_ST_MEMBUF_INIT_FUNCID" " failed with rc=0x%08x.", rc); break; diff --git a/src/occ_405/cent/centaur_data.h b/src/occ_405/cent/centaur_data.h index 30c0e0d..2c7e259 100755 --- a/src/occ_405/cent/centaur_data.h +++ b/src/occ_405/cent/centaur_data.h @@ -33,7 +33,7 @@ #include <ssx.h> #include "rtls.h" #include "centaur_mem_data.h" -#include "centaur_structs.h" +#include "membuf_structs.h" #include "occ_sys_config.h" #include "memory.h" @@ -109,15 +109,15 @@ enum eOccCentaurs //Centaur data collect structures used for task data pointers -struct centaur_data_task { - uint8_t start_centaur; - uint8_t current_centaur; - uint8_t end_centaur; - uint8_t prev_centaur; - CentaurMemData * centaur_data_ptr; +struct membuf_data_task { + uint8_t start_membuf; + uint8_t current_membuf; + uint8_t end_membuf; + uint8_t prev_membuf; + CentaurMemData * membuf_data_ptr; GpeRequest gpe_req; } __attribute__ ((__packed__)); -typedef struct centaur_data_task centaur_data_task_t; +typedef struct membuf_data_task membuf_data_task_t; //************************************************************************* @@ -125,7 +125,7 @@ typedef struct centaur_data_task centaur_data_task_t; //************************************************************************* //Global centaur structures used for task data pointers -extern centaur_data_task_t G_centaur_data_task; +extern membuf_data_task_t G_membuf_data_task; //Global is bitmask of centaurs extern uint32_t G_present_centaurs; @@ -158,6 +158,9 @@ extern uint8_t G_cent_temp_updated_bitmap; //bitmap of configured MBA's (2 per centaur, lsb is centaur0/mba0) extern uint16_t G_configured_mbas; +//global Message payload for collecting membuf sensor cache data. +extern MemBufGetMemDataParms_t G_membuf_data_parms; + //************************************************************************* // Function Prototypes //************************************************************************* @@ -176,11 +179,12 @@ void cent_recovery(uint32_t i_cent); //associated with the specified OCC centaur id. CentaurMemData * cent_get_centaur_data_ptr( const uint8_t i_centaur_id ); -// Create the centaur configuration object -uint32_t centaur_configuration_create( CentaurConfiguration_t * i_centaurConfiguration ); +// Create the global membuf configuration object +uint32_t membuf_configuration_create( ); // Remove centaur from enabled sensor list due to channel checkstop void cent_chan_checkstop(uint32_t i_cent); +void ocmb_init(void); #endif //_CENTAUR_DATA_H diff --git a/src/occ_405/cent/centaur_data_service_codes.h b/src/occ_405/cent/centaur_data_service_codes.h index 85515ba..426090e 100755 --- a/src/occ_405/cent/centaur_data_service_codes.h +++ b/src/occ_405/cent/centaur_data_service_codes.h @@ -48,6 +48,7 @@ enum centModuleId CENTAUR_INIT_MOD = CENT_COMP_ID | 0x01, CENT_CONTROL_MOD = CENT_COMP_ID | 0x02, CENT_RECOVERY_MOD = CENT_COMP_ID | 0x03, + OCMB_INIT_MOD = CENT_COMP_ID | 0x04, }; //************************************************************************* diff --git a/src/occ_405/cent/ocmb_control.c b/src/occ_405/cent/ocmb_control.c new file mode 100644 index 0000000..02be215 --- /dev/null +++ b/src/occ_405/cent/ocmb_control.c @@ -0,0 +1,191 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_405/cent/ocmb_control.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include <occ_common.h> +#include "gpe_export.h" +#include "centaur_data_service_codes.h" +#include "errl.h" +#include "trac.h" +#include "memory.h" +#include "membuf_structs.h" +#include "ocmb_firmware_registers.h" +#include "ocmb_register_addresses.h" +#include "amec_sys.h" + +// These are found in centaur_control.c. They are valid for Ocmb +extern MemBufScomParms_t G_membuf_control_reg_parms; +GPE_BUFFER(extern scomList_t *G_centaurThrottle); +extern memory_control_task_t G_memory_control_task; +void cent_update_nlimits(uint32_t i_cent); +uint16_t centaurThrottle_convert2Numerator(uint16_t i_throttle, uint8_t i_cent, uint8_t i_mba); + +typedef enum +{ + NM_THROTTLE_MBA = 0, + NM_THROTTLE_SYNC = 1, + NUM_THROTTLE_SCOMS = 2, +} eOcmbThrottleInfo; + + +void ocmb_control_init( void ) +{ + errlHndl_t err = NULL; + int rc_gpe = 0; + ocmb_mba_farb3q_t l_mbafarbq; + + //initialize the active throttle limits + memset(G_memoryThrottleLimits, 0, sizeof(G_memoryThrottleLimits)); + + // set upt the throttle scom regs. //slot 0, slot1 or per-port + G_centaurThrottle[NM_THROTTLE_MBA].scom = OCMB_MBA_FARB3Q; + l_mbafarbq.value = 0; + l_mbafarbq.fields.cfg_nm_n_per_slot = -1; + l_mbafarbq.fields.cfg_nm_n_per_port = -1; + G_centaurThrottle[NM_THROTTLE_MBA].mask = l_mbafarbq.value; + + // Set up GPE parameters + G_membuf_control_reg_parms.error.ffdc = 0; + G_membuf_control_reg_parms.entries = 0; + G_membuf_control_reg_parms.scomList = &G_centaurThrottle[0]; + + //-------------------------------------------------- + // Initializes GPE Centaur Control Task, but + // doesn't actually run anything until RTL + //-------------------------------------------------- + rc_gpe = gpe_request_create( + &G_memory_control_task.gpe_req, // gpe_req for the task + &G_async_gpe_queue1, // queue + IPC_ST_MEMBUF_SCOM_FUNCID, // Function ID + &G_membuf_control_reg_parms, // parm for the task + SSX_WAIT_FOREVER, // + NULL, // callback + NULL, // callback argument + ASYNC_CALLBACK_IMMEDIATE ); // options + + if (rc_gpe) + { + //If fail to create gpe request then there is a problem. + TRAC_ERR("ocmb_control_init: Failed to initialize membuf control task [rc_gpe=0x%x]", rc_gpe); + + /* @ + * @errortype + * @moduleid CENTAUR_INIT_MOD + * @reasoncode SSX_GENERIC_FAILURE + * @userdata1 l_rc_gpe - Return code of failing function + * @userdata2 0 + * @userdata4 ERC_CENTAUR_GPE_REQUEST_CREATE_FAILURE + * @devdesc Failed to initialize GPE routine + */ + err = createErrl( + OCMB_INIT_MOD, //modId + SSX_GENERIC_FAILURE, //reasoncode + ERC_CENTAUR_GPE_REQUEST_CREATE_FAILURE, //Extended reason code + ERRL_SEV_PREDICTIVE, //Severity + NULL, //Trace Buf + DEFAULT_TRACE_SIZE, //Trace Size + rc_gpe, //userdata1 + 0 //userdata2 + ); + + addUsrDtlsToErrl(err, //io_err + (uint8_t *) &G_memory_control_task.gpe_req.ffdc, //i_dataPtr, + sizeof(GpeFfdc), //i_size + ERRL_USR_DTL_STRUCT_VERSION_1, //version + ERRL_USR_DTL_BINARY_DATA); //type + + REQUEST_RESET(err); + } +} + +// Function Specification +// +// Name: ocmb_control +// +// Description: Performs centaur control. +// return TRUE settings changed HW needs to be updated. +// return FALSE settings did not change +// +// End Function Specification +bool ocmb_control( memory_control_task_t * i_memControlTask ) +{ + bool throttle_updated = TRUE; + int l_membuf = i_memControlTask->curMemIndex; + amec_centaur_t * l_cent_ptr = NULL; + + MemBufScomParms_t * l_parms = + (MemBufScomParms_t *)(i_memControlTask->gpe_req.cmd_data); + + l_cent_ptr = &g_amec->proc[0].memctl[l_membuf].centaur; + + // update min/max settings + cent_update_nlimits(l_membuf); + + // calculate new N values + ocmb_mba_farb3q_t l_mbafarbq; + uint16_t l_mba01_n_per_mba = + centaurThrottle_convert2Numerator(g_amec->mem_speed_request, l_membuf, 0); + + uint16_t l_mba01_n_per_chip = G_memoryThrottleLimits[l_membuf][0].max_n_per_chip; + amec_cent_mem_speed_t l_mba01_speed; + + //combine port and slot(mba) settings (16 bit) in to a single 32bit value + l_mba01_speed.mba_n = l_mba01_n_per_mba; + l_mba01_speed.chip_n = l_mba01_n_per_chip; + + + // Check if the throttle value has been updated since the last + // time we sent it. If it has, then send a new value, otherwise + // do nothing. + if ( l_mba01_speed.word32 != l_cent_ptr->portpair[0].last_mem_speed_sent.word32 ) + { + + /// Set up Centuar Scom Registers - array of Scoms + /// [0]: N/M Throttle MBA + + /// [0]: Set up N/M throttle MBA + G_centaurThrottle[NM_THROTTLE_MBA].commandType = MEMBUF_SCOM_RMW; + G_centaurThrottle[NM_THROTTLE_MBA].instanceNumber = l_membuf; + // Set up value to be written + l_mbafarbq.fields.cfg_nm_n_per_slot = l_mba01_n_per_mba; + l_mbafarbq.fields.cfg_nm_n_per_port = l_mba01_n_per_chip; + G_centaurThrottle[NM_THROTTLE_MBA].data = l_mbafarbq.value; + + G_centaurThrottle[NM_THROTTLE_SYNC].commandType = MEMBUF_SCOM_MEMBUF_SYNC; + + /// Set up GPE parameters + l_parms->scomList = G_centaurThrottle; + l_parms->entries = NUM_THROTTLE_SCOMS; + l_parms->error.ffdc = 0; + + // Update the last sent throttle value, this will get + // cleared if the GPE does not complete successfully. + l_cent_ptr->portpair[0].last_mem_speed_sent.word32 = l_mba01_speed.word32; + } + else + { + throttle_updated = FALSE; + } + + return throttle_updated; +} diff --git a/src/occ_405/cent/ocmb_data.c b/src/occ_405/cent/ocmb_data.c new file mode 100644 index 0000000..8599b28 --- /dev/null +++ b/src/occ_405/cent/ocmb_data.c @@ -0,0 +1,162 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_405/cent/ocmb_data.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include "centaur_data.h" +#include "ocmb_membuf.h" +#include "occ_service_codes.h" +#include "centaur_data_service_codes.h" +#include "errl.h" +#include "trac.h" +#include "membuf_structs.h" + +/** + * GPE shared data area for gpe0 tracebuffer and size + */ +extern gpe_shared_data_t G_shared_gpe_data; + +/** + * ocmb_init + * Initialize environment for collection of ocmb DTS and performance + * data. + * @post G_membufConfiguration populated + * @post G_present_centaurs populated + * @post G_dimm_present_sensors + * @post G_membuf_data_task populated + * @post GPE request to call for recover created ? + * @post GPE request to call for throttle conttrol created + * @note HW Deadman timer enabled and set to max value + * @note HW Any emergency throttle cleared +*/ +void ocmb_init(void) +{ + //errlHndl_t err = NULL; + int rc = 0; + int membuf_idx = 0; + do + { + TRAC_INFO("ocmb_init: Initializing Memory Data Controller"); + // Create configuration data use G_membufConfiguration + rc = membuf_configuration_create(&G_membufConfiguration); + if( rc ) + { + break; + } + + // Configure OCC_405 global membuf present and sensor enabled flags + G_present_centaurs = 0; + for(membuf_idx=0; membuf_idx<MAX_NUM_CENTAURS; ++membuf_idx) + { + // Check if this membuf is even possible to be present + if( CENTAUR_BY_MASK(membuf_idx) ) + { + if( G_membufConfiguration.baseAddress[membuf_idx] ) + { + // A valid inband Bar Address was found + G_present_centaurs |= (CENTAUR0_PRESENT_MASK >> membuf_idx); + + if(G_membufConfiguration.dts_config & CONFIG_MEMDTS0(membuf_idx)) + { + G_dimm_enabled_sensors.bytes[membuf_idx] = DIMM_SENSOR0; + } + if(G_membufConfiguration.dts_config & CONFIG_MEMDTS1(membuf_idx)) + { + G_dimm_enabled_sensors.bytes[membuf_idx] = (DIMM_SENSOR0 >> 1); + } + TRAC_INFO("ocmb_init: Membuf[%d] Found.", + membuf_idx); + } + } + } + + TRAC_IMP("ocmb_init: G_present_centaurs = 0x%08x", G_present_centaurs); + + G_dimm_present_sensors = G_dimm_enabled_sensors; + + TRAC_IMP("bitmap of present dimm temperature sensors: 0x%08X%08X", + G_dimm_enabled_sensors.words[0], + G_dimm_enabled_sensors.words[1]); + + // Setup the GPE request to do sensor data collection + G_membuf_data_parms.error.ffdc = 0; + G_membuf_data_parms.collect = -1; + G_membuf_data_parms.update = -1; + G_membuf_data_parms.data = 0; + + rc = gpe_request_create( + &G_membuf_data_task.gpe_req, //gpe_req for the task + &G_async_gpe_queue1, //queue + IPC_ST_MEMBUF_DATA_FUNCID, //Function ID + &G_membuf_data_parms, //parm for the task + SSX_WAIT_FOREVER, // + NULL, //callback + NULL, //callback argument + 0 ); //options + if( rc ) + { + TRAC_ERR("ocmb_init: gpe_request_create failed for " + "G_membuf_data_task.gpe_req. rc = 0x%08x", rc); + break; + } + + } while(0); + + if( rc ) + { + /* @ + * @errortype + * @moduleid OCMB_INIT_MOD + * @reasoncode SSX_GENERIC_FAILURE + * @userdata1 rc - Return code of failing function + * @userdata4 OCC_NO_EXTENDED_RC + * @devdesc Failed to initialize memory buffer sensors + */ + errlHndl_t l_err = + createErrl( + OCMB_INIT_MOD, //modId + SSX_GENERIC_FAILURE, //reasoncode + OCC_NO_EXTENDED_RC, //Extended reasoncode + ERRL_SEV_PREDICTIVE, //Severity + NULL, //Trace Buf + DEFAULT_TRACE_SIZE, //Trace Size + rc, //userdata1 + 0 //userdata2 + ); + + // Capture the GPE1 trace buffer + addUsrDtlsToErrl(l_err, + (uint8_t *) G_shared_gpe_data.gpe1_tb_ptr, + G_shared_gpe_data.gpe1_tb_sz, + ERRL_USR_DTL_STRUCT_VERSION_1, + ERRL_USR_DTL_TRACE_DATA); + + + REQUEST_RESET(l_err); + } + else + { + ocmb_control_init(); + } + + return; +} diff --git a/src/occ_405/cent/ocmb_membuf.h b/src/occ_405/cent/ocmb_membuf.h new file mode 100644 index 0000000..844974d --- /dev/null +++ b/src/occ_405/cent/ocmb_membuf.h @@ -0,0 +1,47 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ/cent/ocmb_membuf.h $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __OCMB_MEMBUF_H__ +#define __OCMB_MEMBUF_H__ + +#include "ssx.h" +#include "memory.h" +#include "membuf_structs.h" + + +extern MemBufConfiguration_t G_membufConfiguration; + +/** + * Control ocmb memory buffer thottling + * @param[in] The memroy control task + * @return TRUE if throttle values changed, otherwise FALSE. + */ +bool ocmb_control( memory_control_task_t * i_memControlTask ); + +/** + * Initialize structures for throttle control on ocmb memory data buffer + */ +void ocmb_control_init( void ); + +#endif diff --git a/src/occ_405/dimm/dimm.c b/src/occ_405/dimm/dimm.c index 56d36dd..fd8e6e3 100755 --- a/src/occ_405/dimm/dimm.c +++ b/src/occ_405/dimm/dimm.c @@ -1031,7 +1031,7 @@ void task_dimm_sm(struct task *i_self) } } } - else // G_sysConfigData.mem_type is Centaur + else // G_sysConfigData.mem_type is Cumulus(Centaur) or Axone(Ocmb) { centaur_data(); } diff --git a/src/occ_405/mem/memory.c b/src/occ_405/mem/memory.c index 111407d..1ab7277 100644 --- a/src/occ_405/mem/memory.c +++ b/src/occ_405/mem/memory.c @@ -30,8 +30,9 @@ #include "memory_power_control.h" #include "dimm_control.h" #include "centaur_control.h" +#include "ocmb_membuf.h" #include "centaur_data.h" -#include "centaur_structs.h" +#include "membuf_structs.h" #include "memory_service_codes.h" #include <occ_service_codes.h> // for SSX_GENERIC_FAILURE #include "amec_sys.h" @@ -41,7 +42,7 @@ extern dimm_control_args_t G_dimm_control_args; extern task_t G_task_table[TASK_END]; -extern CentaurScomParms_t G_centaur_control_reg_parms; +extern MemBufScomParms_t G_membuf_control_reg_parms; // This array identifies dimm throttle limits for both Centaurs (Cumulus) and // rdimms (Nimbus) based systems. @@ -105,7 +106,11 @@ void task_memory_control( task_t * i_task ) } else if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) { - gpe_rc = G_centaur_control_reg_parms.error.rc; + gpe_rc = G_membuf_control_reg_parms.error.rc; + } + else if (MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + gpe_rc = G_membuf_control_reg_parms.error.rc; } do @@ -148,7 +153,7 @@ void task_memory_control( task_t * i_task ) { // ignore error and stop monitoring this centaur if there is a channel checkstop if( (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) && - (gpe_rc == CENTAUR_CHANNEL_CHECKSTOP) ) + (gpe_rc == MEMBUF_CHANNEL_CHECKSTOP) ) { // Remove the centaur sensor and all dimm sensors behind it. cent_chan_checkstop(memControlTask->curMemIndex); @@ -224,6 +229,16 @@ void task_memory_control( task_t * i_task ) } rc = centaur_control(memControlTask); // Control one centaur } + else if (MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + // We use the same macros for Ocmb and Centaur + if(!CENTAUR_PRESENT(memIndex) || + (!MBA_CONFIGURED(memIndex, 0) && !MBA_CONFIGURED(memIndex, 1))) + { + break; + } + rc = ocmb_control(memControlTask); + } if(rc) { @@ -237,7 +252,7 @@ void task_memory_control( task_t * i_task ) } else if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) { - gpe_rc = G_centaur_control_reg_parms.error.rc; + gpe_rc = G_membuf_control_reg_parms.error.rc; } //Error in schedule gpe memory (dimm/centaur) control @@ -361,11 +376,18 @@ void memory_init() // Init DIMM state manager IPC request memory_nimbus_init(); } - else + else if (MEM_TYPE_CUMULUS == G_sysConfigData.mem_type) { - TRAC_INFO("memory_init: calling centaur_init()"); centaur_init(); //no rc, handles errors internally } + else if (MEM_TYPE_OCM == G_sysConfigData.mem_type) + { + ocmb_init(); + } + else + { + TRAC_ERR("memory_init: Uknown memory type"); + } // check if the init resulted in a reset if(isSafeStateRequested()) diff --git a/src/occ_405/occLinkInputFile b/src/occ_405/occLinkInputFile index 97f2f9a..f34fde3 100644 --- a/src/occ_405/occLinkInputFile +++ b/src/occ_405/occLinkInputFile @@ -15,6 +15,7 @@ INPUT ( amec_amester.o amec_sensors_fw.o amec_sensors_power.o amec_sensors_centaur.o + amec_sensors_ocmb.o amec_sensors_core.o amec_slave_smh.o amec_tasks.o @@ -22,6 +23,8 @@ INPUT ( amec_amester.o avsbus.o centaur_control.o centaur_data.o + ocmb_control.o + ocmb_data.o chom.o cmdh_dbug_cmd.o cmdh_fsp_cmds_datacnfg.o diff --git a/src/occ_405/occbuildname.c b/src/occ_405/occbuildname.c index 1f73927..b3e3a04 100755 --- a/src/occ_405/occbuildname.c +++ b/src/occ_405/occbuildname.c @@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = #else -volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190424a\0" /*</BuildName>*/ ; +volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190426a\0" /*</BuildName>*/ ; #endif diff --git a/src/occ_405/topfiles.mk b/src/occ_405/topfiles.mk index 7d98dbc..94dadfd 100644 --- a/src/occ_405/topfiles.mk +++ b/src/occ_405/topfiles.mk @@ -39,12 +39,15 @@ TOP-C-SOURCES = amec/amec_controller.c \ amec/amec_sensors_fw.c \ amec/amec_sensors_power.c \ amec/amec_sensors_centaur.c \ + amec/amec_sensors_ocmb.c \ amec/amec_sensors_core.c \ amec/amec_slave_smh.c \ amec/amec_tasks.c \ amec/sensor_power.c \ cent/centaur_control.c \ cent/centaur_data.c \ + cent/ocmb_control.c \ + cent/ocmb_data.c \ cmdh/cmdh_dbug_cmd.c \ cmdh/cmdh_fsp_cmds_datacnfg.c \ cmdh/cmdh_fsp_cmds.c \ |