diff options
-rwxr-xr-x | src/occ_405/Makefile | 5 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_health.c | 6 | ||||
-rw-r--r-- | src/occ_405/amec/amec_sensors_centaur.c | 19 | ||||
-rwxr-xr-x | src/occ_405/cent/centaur_data.c | 75 | ||||
-rwxr-xr-x | src/occ_405/cmdh/cmdh_fsp_cmds.c | 175 | ||||
-rwxr-xr-x | src/occ_405/cmdh/cmdh_fsp_cmds.h | 114 | ||||
-rw-r--r-- | src/occ_405/occLinkInputFile | 3 | ||||
-rwxr-xr-x | src/occ_405/state.c | 12 | ||||
-rw-r--r-- | src/occ_405/topfiles.mk | 5 |
9 files changed, 176 insertions, 238 deletions
diff --git a/src/occ_405/Makefile b/src/occ_405/Makefile index caae6f7..e6add69 100755 --- a/src/occ_405/Makefile +++ b/src/occ_405/Makefile @@ -5,7 +5,7 @@ # # OpenPOWER OnChipController Project # -# Contributors Listed Below - COPYRIGHT 2015 +# Contributors Listed Below - COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # @@ -65,7 +65,8 @@ LIB_DIRS = -L$(OBJDIR) \ -L$(OBJDIR)/amec \ -L$(OBJDIR)/dcom \ -L$(OBJDIR)/proc \ - -L$(OBJDIR)/firdata + -L$(OBJDIR)/firdata \ + -L$(OBJDIR)/cent #default target is to make a binary application image #This removes all unecessary headers from the ELF executable diff --git a/src/occ_405/amec/amec_health.c b/src/occ_405/amec/amec_health.c index b461583..45986ab 100755 --- a/src/occ_405/amec/amec_health.c +++ b/src/occ_405/amec/amec_health.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -844,7 +844,8 @@ void amec_health_check_proc_temp() // End Function Specification void amec_health_check_proc_timeout() { - +/* TEMP/TODO: Enable when needed */ +#if 0 /*------------------------------------------------------------------------*/ /* Local Variables */ /*------------------------------------------------------------------------*/ @@ -947,6 +948,7 @@ void amec_health_check_proc_timeout() } } }while(0); +#endif } // Function Specification diff --git a/src/occ_405/amec/amec_sensors_centaur.c b/src/occ_405/amec/amec_sensors_centaur.c index 2679bc9..0eb7187 100644 --- a/src/occ_405/amec/amec_sensors_centaur.c +++ b/src/occ_405/amec/amec_sensors_centaur.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -56,9 +56,12 @@ extern uint8_t G_centaur_nest_lfir6; /******************************************************************************/ /* Forward Declarations */ /******************************************************************************/ +/* TEMP/TODO: No MemData anymore */ +#if 0 void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur); void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur); void amec_perfcount_getmc( MemData * i_sensor_cache, uint8_t i_centaur); +#endif /******************************************************************************/ /* Code */ @@ -76,6 +79,8 @@ void amec_perfcount_getmc( MemData * i_sensor_cache, uint8_t i_centaur); // End Function Specification void amec_update_centaur_sensors(uint8_t i_centaur) { +/* TEMP/TODO: No MemData anymore */ +#if 0 if(CENTAUR_PRESENT(i_centaur)) { MemData * l_sensor_cache = cent_get_centaur_data_ptr(i_centaur); @@ -87,6 +92,7 @@ void amec_update_centaur_sensors(uint8_t i_centaur) amec_perfcount_getmc(l_sensor_cache, i_centaur); CLEAR_CENTAUR_UPDATED(i_centaur); } +#endif } // Function Specification @@ -99,6 +105,8 @@ void amec_update_centaur_sensors(uint8_t i_centaur) // Thread: RealTime Loop // // End Function Specification +/* TEMP/TODO: No MemData anymore */ +#if 0 void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur) { #define MIN_VALID_DIMM_TEMP 1 @@ -237,7 +245,7 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur) L_ran_once[i_centaur] = TRUE; AMEC_DBG("Centaur[%d]: HotDimm=%d\n",i_centaur,l_hottest_dimm_temp); } - +#endif // Function Specification // @@ -248,6 +256,8 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur) // Thread: RealTime Loop // // End Function Specification +/* TEMP/TODO: No MemData anymore */ +#if 0 void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur) { #define MIN_VALID_CENT_TEMP 1 @@ -366,7 +376,7 @@ void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur AMEC_DBG("Centaur[%d]: HotCentaur=%d\n",i_centaur,l_dts); } - +#endif // Function Specification // @@ -419,6 +429,8 @@ void amec_update_centaur_temp_sensors(void) // Thread: RealTime Loop // // End Function Specification +/* TEMP/TODO: No MemData anymore */ +#if 0 void amec_perfcount_getmc( MemData * i_sensor_cache, uint8_t i_centaur) { @@ -680,6 +692,7 @@ void amec_perfcount_getmc( MemData * i_sensor_cache, return; } +#endif /*----------------------------------------------------------------------------*/ /* End */ diff --git a/src/occ_405/cent/centaur_data.c b/src/occ_405/cent/centaur_data.c index 9be48e1..ef550b6 100755 --- a/src/occ_405/cent/centaur_data.c +++ b/src/occ_405/cent/centaur_data.c @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ/cent/centaur_data.c $ */ +/* $Source: src/occ_405/cent/centaur_data.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* Contributors Listed Below - COPYRIGHT 2014,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -23,12 +23,12 @@ /* */ /* IBM_PROLOG_END_TAG */ -//************************************************************************* +//*************************************************************************/ // Includes -//************************************************************************* +//*************************************************************************/ #include "centaur_data.h" #include "centaur_control.h" -#include "pgp_async.h" +#include "occhw_async.h" #include "threadSch.h" #include "pmc_register_addresses.h" #include "centaur_data_service_codes.h" @@ -38,21 +38,21 @@ #include "rtls.h" #include "apss.h" #include "state.h" -#include "gpe_scom.h" -#include "centaur_firmware_registers.h" -#include "centaur_register_addresses.h" +#include "occhw_scom.h" +//#include "centaur_firmware_registers.h" +//#include "centaur_register_addresses.h" -//************************************************************************* +//*************************************************************************/ // Externs -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Macros -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Defines/Enums -//************************************************************************* +//*************************************************************************/ // Enumerated list of possible centaur operations typedef enum @@ -83,13 +83,16 @@ typedef enum #define CENT_THRM_PARITY_ERROR26 ((uint64_t)0x0000002000000000ull) #define CENT_MAX_DEADMAN_TIMER 0xf #define CENT_DEADMAN_TIMER_2SEC 0x8 -//************************************************************************* +//*************************************************************************/ // Structures -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Globals -//************************************************************************* +//*************************************************************************/ + +/* TEMP/TODO: PORE/MemData issues */ +#if 0 //Global array of centaur data buffers GPE_BUFFER(MemData G_centaur_data[NUM_CENTAUR_DATA_BUFF + NUM_CENTAUR_DOUBLE_BUF + @@ -107,8 +110,6 @@ GPE_BUFFER(scomList_t G_cent_scom_list_entry[NUM_CENT_OPS]); //buffer for storing output from running gpe_scom_centaur() GPE_BUFFER(uint64_t G_cent_scom_data[MAX_NUM_CENTAURS]) = {0}; -cent_sensor_flags_t G_cent_enabled_sensors = {0}; - //Global array of centaur data pointers MemData * G_centaur_data_ptrs[MAX_NUM_CENTAURS] = { &G_centaur_data[0], &G_centaur_data[1], &G_centaur_data[2], &G_centaur_data[3], @@ -129,6 +130,9 @@ centaur_data_task_t G_centaur_data_task = { .prev_centaur = 7, .centaur_data_ptr = &G_centaur_data[8] }; +#endif + +cent_sensor_flags_t G_cent_enabled_sensors = {0}; //AMEC needs to know when data for a centaur has been collected. uint32_t G_updated_centaur_mask = 0; @@ -147,13 +151,13 @@ uint8_t G_centaur_needs_recovery = 0; // This tells amec code to treat the centaur temperature as invalid uint8_t G_centaur_nest_lfir6 = 0; -//************************************************************************* +//*************************************************************************/ // Function Prototypes -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Functions -//************************************************************************* +//*************************************************************************/ // Function Specification // @@ -173,13 +177,18 @@ uint8_t G_centaur_nest_lfir6 = 0; //number of SC polls to wait between i2c recovery attempts #define CENT_SC_MAX_INTERVAL 256 +/* TEMP/TODO: Reenable when needed */ +#if 0 //determine scom address of MCIFIR register for given Centaur n #define MCS0_MCIFIR_N(n) \ ( (n<4)? (MCS0_MCIFIR + ((MCS1_MCIFIR - MCS0_MCIFIR) * (n))) : (MCS4_MCIFIR + ((MCS5_MCIFIR - MCS4_MCIFIR) * (n-4))) ) +#endif //mask for channel checkstop #define MCIFIR_CHAN_CKSTOP_MASK 0x0000000100000000 +/* TEMP/TODO: Reenable when needed */ +#if 0 bool cent_chan_checkstop(const uint8_t i_cent) { uint32_t l_scom_addr = 0; @@ -226,7 +235,10 @@ bool cent_chan_checkstop(const uint8_t i_cent) } return l_rc; } +#endif // #if 0 +/* TEMP/TODO: Reenable when needed */ +#if 0 void cent_recovery(uint32_t i_cent) { int l_rc = 0; @@ -591,6 +603,7 @@ void cent_recovery(uint32_t i_cent) }while(0); } +#endif // #if 0 // Function Specification // @@ -600,6 +613,8 @@ void cent_recovery(uint32_t i_cent) // collection // // End Function Specification +/* TEMP/TODO: Reenable when needed */ +#if 0 void task_centaur_data( task_t * i_task ) { errlHndl_t l_err = NULL; // Error handler @@ -906,6 +921,7 @@ void task_centaur_data( task_t * i_task ) } return; } +#endif // #if 0 #define CENTAUR_SENSCACHE_ENABLE 0x020115CC // Function Specification @@ -915,6 +931,8 @@ void task_centaur_data( task_t * i_task ) // Description: Reads // // End Function Specification +/* TEMP/TODO: Reenable when needed */ +#if 0 int cent_get_enabled_sensors() { int l_rc = 0; @@ -970,6 +988,7 @@ int cent_get_enabled_sensors() }while(0); return l_rc; } +#endif // #if 0 // Function Specification // @@ -980,6 +999,8 @@ int cent_get_enabled_sensors() // This will also initialize the centaur watchdog. // // End Function Specification +/* TEMP/TODO: Reenable when needed */ +#if 0 void centaur_init( void ) { errlHndl_t l_err = NULL; // Error handler @@ -1241,7 +1262,7 @@ void centaur_init( void ) return; } - +#endif // #if 0 // Function Specification // @@ -1252,6 +1273,8 @@ void centaur_init( void ) // Returns NULL for centaur ID outside the range of 0 to 7. // // End Function Specification +/* TEMP/TODO: Reenable when needed */ +#if 0 MemData * cent_get_centaur_data_ptr( const uint8_t i_occ_centaur_id ) { //The caller needs to send in a valid OCC centaur id. Since type is uchar @@ -1269,4 +1292,4 @@ MemData * cent_get_centaur_data_ptr( const uint8_t i_occ_centaur_id ) return( NULL ); } } - +#endif diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.c b/src/occ_405/cmdh/cmdh_fsp_cmds.c index e153063..c89c230 100755 --- a/src/occ_405/cmdh/cmdh_fsp_cmds.c +++ b/src/occ_405/cmdh/cmdh_fsp_cmds.c @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ/cmdh/cmdh_fsp_cmds.c $ */ +/* $Source: src/occ_405/cmdh/cmdh_fsp_cmds.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -33,10 +33,7 @@ #include "state.h" #include "cmdh_fsp_cmds.h" #include "cmdh_dbug_cmd.h" -//#include "gpsm.h" -//#include "pstates.h" #include "proc_pstate.h" -//#include "gpe_data.h" #include "centaur_data.h" #include <amec_data.h> #include "amec_amester.h" @@ -100,81 +97,12 @@ errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr, errlHndl_t l_errlHndl = NULL; cmdh_poll_query_t * l_poll_cmd = (cmdh_poll_query_t *) i_cmd_ptr; ERRL_RC l_rc = ERRL_RC_INTERNAL_FAIL; - uint8_t k = 0; do { - if(l_poll_cmd->version == CMDH_POLL_BASE_VERSION) + if (l_poll_cmd->version == CMDH_POLL_VERSION20) { - cmdh_poll_resp_v0_t * l_poll_rsp = (cmdh_poll_resp_v0_t *) o_rsp_ptr; - - memset(l_poll_rsp,0,(size_t)sizeof(cmdh_poll_resp_v0_t)); - - l_poll_rsp->status.word = SMGR_validate_get_valid_states(); - l_poll_rsp->ext_status.word = 0; - - l_poll_rsp->occ_pres_mask = G_sysConfigData.is_occ_present; - l_poll_rsp->config_data = DATA_request_cnfgdata(); - l_poll_rsp->state = CURRENT_STATE(); - l_poll_rsp->ips_status.word = 0; - - if( G_sysConfigData.system_type.kvm ) - { - l_poll_rsp->mode = G_occ_external_req_mode_kvm; - } - else - { - l_poll_rsp->mode = CURRENT_MODE(); - } - - l_poll_rsp->ext_status.dvfs_due_to_ot = 0; - l_poll_rsp->ext_status.dvfs_due_to_pwr = 0; - - for ( k = 0; k < MAX_NUM_CORES; k++ ) - { - uint32_t l_freq_reason = g_amec->proc[0].core[k].f_reason; - if ( l_freq_reason & (AMEC_VOTING_REASON_PROC_THRM | AMEC_VOTING_REASON_VRHOT_THRM) ) - { - l_poll_rsp->ext_status.dvfs_due_to_ot = 1; - } - - if ( l_freq_reason & (AMEC_VOTING_REASON_PPB | AMEC_VOTING_REASON_PMAX | AMEC_VOTING_REASON_PWR) ) - { - l_poll_rsp->ext_status.dvfs_due_to_pwr = 1; - } - } - - l_poll_rsp->ips_status.ips_enabled = G_ips_config_data.iv_ipsEnabled; - l_poll_rsp->ips_status.ips_active = AMEC_mst_get_ips_active_status(); - - - l_poll_rsp->errl_id = getOldestErrlID(); - l_poll_rsp->errl_address = getErrlOCIAddrByID(l_poll_rsp->errl_id); - l_poll_rsp->errl_length = getErrlLengthByID(l_poll_rsp->errl_id); - - //If errl_id is not 0, then neither address or length should be zero. - //This should not happen, but if it does tmgt will create an error log that - //includes the data at the errl slot address given. - //NOTE: One cause for a false errlog id is corruption of data in one errl slot - // due to writing data greater than the size of the previous slot. For - // example writing the CallHome errorlog (3kb) into a regular sized (2kb) slot. - if ( (l_poll_rsp->errl_id != 0) && - ((l_poll_rsp->errl_address == 0) || (l_poll_rsp->errl_length == 0))) - { - TRAC_ERR("An error ID has been sent via poll but the address or size is 0. " - "ErrlId:0x%X, sz:0x%X, address:0x%X.", - l_poll_rsp->errl_id, l_poll_rsp->errl_length, l_poll_rsp->errl_address); - } - l_poll_rsp->data_length[0] = CONVERT_UINT16_UINT8_HIGH(CMDH_POLL_RESP_LEN_V0); - l_poll_rsp->data_length[1] = CONVERT_UINT16_UINT8_LOW(CMDH_POLL_RESP_LEN_V0); - l_rc = ERRL_RC_SUCCESS; - l_poll_rsp->rc = ERRL_RC_SUCCESS; - - // TODO: Clear flag indicating we sent a 'poll request' to TMGT - } - else if (l_poll_cmd->version == CMDH_POLL_VERSION10) - { - l_rc = cmdh_poll_v10(o_rsp_ptr); + l_rc = cmdh_poll_v20(o_rsp_ptr); } else { @@ -194,16 +122,14 @@ errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr, // Function Specification // -// Name: cmdh_poll_v10 +// Name: cmdh_poll_v20 // -// Description: Used for version 0x10 poll calls from BMC/HTMGT. +// Description: Used for version 0x20 poll calls from BMC/HTMGT. // // End Function Specification -ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) +ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr) { ERRL_RC l_rc = ERRL_RC_INTERNAL_FAIL; -/* TEMP -- NOT SUPPORTED YET (NEED DCOM/AMEC) */ -#if 0 uint8_t k = 0; cmdh_poll_sensor_db_t l_sensorHeader; @@ -211,7 +137,7 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) memset(o_rsp_ptr, 0, (size_t)sizeof(cmdh_fsp_rsp_t)); // Set pointer to start of o_rsp_ptr - cmdh_poll_resp_v10_fixed_t * l_poll_rsp = (cmdh_poll_resp_v10_fixed_t *) o_rsp_ptr; + cmdh_poll_resp_v20_fixed_t * l_poll_rsp = (cmdh_poll_resp_v20_fixed_t *) o_rsp_ptr; // Byte 1 l_poll_rsp->status.word = SMGR_validate_get_valid_states(); @@ -247,6 +173,8 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) l_poll_rsp->ext_status.n_power = 1; } + // TEMP/TODO: Sync request bit set here + // Byte 3 l_poll_rsp->occ_pres_mask = G_sysConfigData.is_occ_present; // Byte 4 @@ -289,14 +217,16 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) l_poll_rsp->sensor_dblock_version = 0x01; //Currently only 0x01 is supported. //l_rsp_index is used as an index into o_rsp_ptr - uint16_t l_rsp_index = CMDH_POLL_RESP_LEN_V10; + uint16_t l_rsp_index = CMDH_POLL_RESP_LEN_V20; //////////////////// // TEMP sensors: // Generate datablock header for temp sensors and sensor data. + + // Set up the header memset((void*) &l_sensorHeader, 0, (size_t)sizeof(cmdh_poll_sensor_db_t)); memcpy ((void *) &(l_sensorHeader.eyecatcher[0]), SENSOR_TEMP, 4); - l_sensorHeader.format = 0x01; + l_sensorHeader.format = 0x02; l_sensorHeader.length = sizeof(cmdh_poll_temp_sensor_t); l_sensorHeader.count = 0; @@ -304,6 +234,7 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) cmdh_poll_temp_sensor_t l_tempSensorList[MAX_NUM_CORES + MAX_NUM_MEM_CONTROLLERS + (MAX_NUM_MEM_CONTROLLERS * NUM_DIMMS_PER_CENTAUR)]; memset(l_tempSensorList, 0x00, sizeof(l_tempSensorList)); + // Add the core temperatures for (k=0; k<MAX_NUM_CORES; k++) { if(CORE_PRESENT(k)) @@ -314,43 +245,71 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) } } - uint8_t l_cent, l_dimm = 0; - for (l_cent=0; l_cent < MAX_NUM_MEM_CONTROLLERS; l_cent++) + // Add the DIMM and centaur temperatures + uint8_t l_cent, l_port, l_dimm = 0; + if(G_sysConfigData.mem_type == MEM_TYPE_NIMBUS) { - if (CENTAUR_PRESENT(l_cent)) + for (l_port=0; l_port < NUM_DIMM_PORTS; l_port++) { - //Add entry for centaurs. - l_tempSensorList[l_sensorHeader.count].id = g_amec->proc[0].memctl[l_cent].centaur.temp_sid; - if (G_cent_timeout_logged_bitmap & (CENTAUR0_PRESENT_MASK >> l_cent)) - { - l_tempSensorList[l_sensorHeader.count].value = 0xFFFF; - } - else - { - l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_cent].centaur.centaur_hottest.cur_temp; - } - l_sensorHeader.count++; - - //Add entries for present dimms associated with current centaur l_cent. for(l_dimm=0; l_dimm < NUM_DIMMS_PER_CENTAUR; l_dimm++) { - if (g_amec->proc[0].memctl[l_cent].centaur.dimm_temps[l_dimm].temp_sid != 0) + if (g_amec->proc[0].memctl[l_port].centaur.dimm_temps[l_dimm].temp_sid != 0) { - l_tempSensorList[l_sensorHeader.count].id = g_amec->proc[0].memctl[l_cent].centaur.dimm_temps[l_dimm].temp_sid; + l_tempSensorList[l_sensorHeader.count].id = g_amec->proc[0].memctl[l_port].centaur.dimm_temps[l_dimm].temp_sid; + //If a dimm timed out long enough, we should return 0xFFFF for that sensor. - if (G_dimm_timeout_logged_bitmap.bytes[l_cent] & (DIMM_SENSOR0 >> l_dimm)) + if (G_dimm_timeout_logged_bitmap.bytes[l_port] & (DIMM_SENSOR0 >> l_dimm)) { l_tempSensorList[l_sensorHeader.count].value = 0xFFFF; } else { - l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_cent].centaur.dimm_temps[l_dimm].cur_temp; + l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_port].centaur.dimm_temps[l_dimm].cur_temp; } l_sensorHeader.count++; - } + } + } + } + else if (G_sysConfigData.mem_type == MEM_TYPE_CUMULUS) + { + for (l_cent=0; l_cent < MAX_NUM_MEM_CONTROLLERS; l_cent++) + { + if (CENTAUR_PRESENT(l_cent)) + { + //Add entry for centaurs. + l_tempSensorList[l_sensorHeader.count].id = g_amec->proc[0].memctl[l_cent].centaur.temp_sid; + if (G_cent_timeout_logged_bitmap & (CENTAUR0_PRESENT_MASK >> l_cent)) + { + l_tempSensorList[l_sensorHeader.count].value = 0xFFFF; + } + else + { + l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_cent].centaur.centaur_hottest.cur_temp; + } + l_sensorHeader.count++; + //Add entries for present dimms associated with current centaur l_cent. + for(l_dimm=0; l_dimm < NUM_DIMMS_PER_CENTAUR; l_dimm++) + { + if (g_amec->proc[0].memctl[l_cent].centaur.dimm_temps[l_dimm].temp_sid != 0) + { + l_tempSensorList[l_sensorHeader.count].id = g_amec->proc[0].memctl[l_cent].centaur.dimm_temps[l_dimm].temp_sid; + //If a dimm timed out long enough, we should return 0xFFFF for that sensor. + if (G_dimm_timeout_logged_bitmap.bytes[l_cent] & (DIMM_SENSOR0 >> l_dimm)) + { + l_tempSensorList[l_sensorHeader.count].value = 0xFFFF; + } + else + { + l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_cent].centaur.dimm_temps[l_dimm].cur_temp; + } + + l_sensorHeader.count++; + } + + } } } } @@ -376,7 +335,7 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) // Generate datablock header for freq sensors and sensor data. memset((void*) &l_sensorHeader, 0, (size_t)sizeof(cmdh_poll_sensor_db_t)); memcpy ((void *) &(l_sensorHeader.eyecatcher[0]), SENSOR_FREQ, 4); - l_sensorHeader.format = 0x01; + l_sensorHeader.format = 0x02; l_sensorHeader.length = sizeof(cmdh_poll_freq_sensor_t); l_sensorHeader.count = 0; @@ -413,7 +372,7 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) { memset((void*) &l_sensorHeader, 0, (size_t)sizeof(cmdh_poll_sensor_db_t)); memcpy ((void *) &(l_sensorHeader.eyecatcher[0]), SENSOR_POWR, 4); - l_sensorHeader.format = 0x01; + l_sensorHeader.format = 0x02; l_sensorHeader.length = sizeof(cmdh_poll_power_sensor_t); l_sensorHeader.count = 0; @@ -486,7 +445,7 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) l_poll_rsp->data_length[1] = CONVERT_UINT16_UINT8_LOW(l_rsp_index); l_rc = ERRL_RC_SUCCESS; l_poll_rsp->rc = ERRL_RC_SUCCESS; -#endif // #if 0 + return l_rc; } diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.h b/src/occ_405/cmdh/cmdh_fsp_cmds.h index cb3593b..69643e0 100755 --- a/src/occ_405/cmdh/cmdh_fsp_cmds.h +++ b/src/occ_405/cmdh/cmdh_fsp_cmds.h @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ/cmdh/cmdh_fsp_cmds.h $ */ +/* $Source: src/occ_405/cmdh/cmdh_fsp_cmds.h $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -75,11 +75,9 @@ typedef enum //--------------------------------------------------------- // Length of Poll Response -#define CMDH_POLL_RESP_LEN_V0 16 // version 0x00 is 16 bytes. -#define CMDH_POLL_RESP_LEN_V10 40 // version 0x10 has at least 40 bytes. -// Poll Version 0 -#define CMDH_POLL_BASE_VERSION 0x00 -#define CMDH_POLL_VERSION10 0x10 +#define CMDH_POLL_RESP_LEN_V20 40 // version 0x20 has at least 40 bytes. +// Poll Version 0x20 +#define CMDH_POLL_VERSION20 0x20 // Struct used to parse Poll Cmd typedef struct __attribute__ ((packed)) cmdh_poll_query @@ -91,51 +89,51 @@ typedef struct __attribute__ ((packed)) cmdh_poll_query }cmdh_poll_query_t; // Response packet used for Poll Cmd -typedef struct __attribute__ ((packed)) cmdh_poll_resp_v0 +typedef struct __attribute__ ((packed)) cmdh_poll_resp_v20 { - // Standard TMGT + // Standard TMGT/HTMGT struct cmdh_fsp_rsp_header; - // Status + // BYTE 1: Status union { struct { - uint8_t master_occ : 1; - uint8_t _reserved_6 : 1; + uint8_t master_occ : 1; // 1 => master, 0 => slave + uint8_t fir_master : 1; // 1 => fir master. uint8_t _reserved_5 : 1; - uint8_t status_changed : 1; - uint8_t oversubscribed : 1; + uint8_t _reserved_4 : 1; + uint8_t _reserved_3 : 1; uint8_t _reserved_2 : 1; - uint8_t obs_ready : 1; - uint8_t active_ready : 1; + uint8_t obs_ready : 1; // 1 => OCC received all data to support obs state. + uint8_t active_ready : 1; // 1 => OCC received all data to support active state. }; uint8_t word; } status; - // Extended Status + // BYTE 2: Extended Status union { struct { - uint8_t dvfs_due_to_ot : 1; - uint8_t dvfs_due_to_pwr : 1; - uint8_t _reserved_5 : 1; - uint8_t _reserved_4 : 1; + uint8_t dvfs_due_to_ot : 1; // 1 => OCC clipped max Pstate due to an over temp. + uint8_t dvfs_due_to_pwr : 1; // 1 => OCC clipped max Psate due to reaching pcap limit. + uint8_t mthrot_due_to_ot: 1; // 1 => OCC throttled memory due to an over temp. + uint8_t n_power : 1; // 1 => Server running without redundant power. uint8_t _reserved_3 : 1; - uint8_t sync_request : 1; // In TMGT to TPMF interface spec, but not needed yet + uint8_t sync_request : 1; // 1 => OCC needs to restart snapshot buffers uint8_t _reserved_1 : 1; uint8_t _reserved_0 : 1; }; uint8_t word; } ext_status; - // OCCs Present + // BYTE 3: OCCs Present uint8_t occ_pres_mask; - // Config Data Requested + // BYTE 4: Config Data Requested uint8_t config_data; - // Current OCC State + // BYTE 5: Current OCC State uint8_t state; - // Current OCC Mode + // BYTE 6: Current OCC Mode uint8_t mode; - // Current Idle Power Saver Status + // BYTE 7: Current Idle Power Saver Status union { struct @@ -151,64 +149,6 @@ typedef struct __attribute__ ((packed)) cmdh_poll_resp_v0 }; uint8_t word; } ips_status; - // Error Log ID - uint8_t errl_id; - // Error Log Start Address - uint32_t errl_address; - // Error Log Length - uint16_t errl_length; - // Reserved - uint8_t _reserved[2]; - // Checksum - uint8_t checksum[2]; -}cmdh_poll_resp_v0_t; - -// Response packet used for Poll Cmd -typedef struct __attribute__ ((packed)) cmdh_poll_resp_v10 -{ - // Standard TMGT - struct cmdh_fsp_rsp_header; - // BYTE 1: Status - union - { - struct - { - uint8_t master_occ : 1; // 1 => master, 0 => slave - uint8_t fir_master : 1; // 1 => fir master. - uint8_t _reserved_5 : 1; - uint8_t _reserved_4 : 1; - uint8_t attn_enabled : 1; // 1 => Attentions from OCC to Host are enabled. - uint8_t _reserved_2 : 1; - uint8_t obs_ready : 1; // 1 => OCC received all data to support obs state. - uint8_t active_ready : 1; // 1 => OCC received all data to support active state. - }; - uint8_t word; - } status; - // BYTE 2: Extended Status - union - { - struct - { - uint8_t dvfs_due_to_ot : 1; // 1 => OCC clipped max Pstate due to an over temp. - uint8_t dvfs_due_to_pwr : 1; // 1 => OCC clipped max Psate due to reaching pcap limit. - uint8_t mthrot_due_to_ot: 1; // 1 => OCC throttled memory due to an over temp. - uint8_t n_power : 1; // 1 => Server running without redundant power. - uint8_t _reserved_3 : 1; - uint8_t _reserved_2 : 1; - uint8_t _reserved_1 : 1; - uint8_t _reserved_0 : 1; - }; - uint8_t word; - } ext_status; - // BYTE 3: OCCs Present - uint8_t occ_pres_mask; - // BYTE 4: Config Data Requested - uint8_t config_data; - // BYTE 5: Current OCC State - uint8_t state; - // BYTE 6 - 7: Reserved - uint8_t _reserved_6; - uint8_t _reserved_7; // BYTE 8: Error Log ID uint8_t errl_id; // BYTES 9 - 12: Error Log Start Address @@ -228,7 +168,7 @@ typedef struct __attribute__ ((packed)) cmdh_poll_resp_v10 uint8_t sensor_dblock_version; // No need to include the 2 bytes for checksum since they get added prior to sending // data back to tmgt. -}cmdh_poll_resp_v10_fixed_t; +}cmdh_poll_resp_v20_fixed_t; typedef struct __attribute__ ((packed)) cmdh_poll_sensor_datablock { @@ -592,7 +532,7 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * i_rsp_ptr); -ERRL_RC cmdh_poll_v10 (cmdh_fsp_rsp_t * i_rsp_ptr); +ERRL_RC cmdh_poll_v20 (cmdh_fsp_rsp_t * i_rsp_ptr); errlHndl_t cmdh_clear_elog (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * i_rsp_ptr); diff --git a/src/occ_405/occLinkInputFile b/src/occ_405/occLinkInputFile index adc8403..9f6059b 100644 --- a/src/occ_405/occLinkInputFile +++ b/src/occ_405/occLinkInputFile @@ -1,14 +1,17 @@ INPUT ( amec_data.o amec_freq.o + amec_health.o amec_init.o amec_master_smh.o amec_part.o amec_sensors_fw.o amec_sensors_power.o + amec_sensors_centaur.o amec_sensors_core.o amec_slave_smh.o amec_tasks.o apss.o + centaur_data.o cmdh_dbug_cmd.o cmdh_fsp_cmds_datacnfg.o cmdh_fsp_cmds.o diff --git a/src/occ_405/state.c b/src/occ_405/state.c index b784fa4..5cc0b40 100755 --- a/src/occ_405/state.c +++ b/src/occ_405/state.c @@ -1,11 +1,11 @@ -\/* IBM_PROLOG_BEGIN_TAG */ +/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ/state.c $ */ +/* $Source: src/occ_405/state.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -700,12 +700,6 @@ uint8_t SMGR_validate_get_valid_states(void) } } - // If we hit an oversubscription, we need to set that bit - if(FSI2HOST_MBOX_INITIALIZED == G_fsi2host_mbox_ready) - { - l_valid_states |= SMGR_MASK_ATTN_ENABLED; - } - // If we are master OCC, set this bit if(OCC_MASTER == G_occ_role) { diff --git a/src/occ_405/topfiles.mk b/src/occ_405/topfiles.mk index 58aa999..0d2b7b3 100644 --- a/src/occ_405/topfiles.mk +++ b/src/occ_405/topfiles.mk @@ -5,7 +5,7 @@ # # OpenPOWER OnChipController Project # -# Contributors Listed Below - COPYRIGHT 2015 +# Contributors Listed Below - COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # @@ -24,15 +24,18 @@ # IBM_PROLOG_END_TAG TOP-C-SOURCES = amec/amec_data.c \ amec/amec_freq.c \ + amec/amec_health.c \ amec/amec_init.c \ amec/amec_master_smh.c \ amec/amec_part.c \ amec/amec_sensors_fw.c \ amec/amec_sensors_power.c \ + amec/amec_sensors_centaur.c \ amec/amec_sensors_core.c \ amec/amec_slave_smh.c \ amec/amec_tasks.c \ amec/sensor_power.c \ + cent/centaur_data.c \ cmdh/cmdh_dbug_cmd.c \ cmdh/cmdh_fsp_cmds_datacnfg.c \ cmdh/cmdh_fsp_cmds.c \ |