Skip to content

Commit

Permalink
Delete debug sensors to save SRAM
Browse files Browse the repository at this point in the history
Change-Id: Id1f23066951f09988a7f7dfdd868d7d9a166975e
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/80156
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
  • Loading branch information
marthabroyles committed Jul 10, 2019
1 parent 8a315b7 commit e447be8
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 351 deletions.
59 changes: 2 additions & 57 deletions src/occ_405/amec/amec_amester.c
Expand Up @@ -276,7 +276,7 @@ static uint8_t amester_get_sensor_info( uint8_t* o_resp, uint16_t* io_resp_lengt
break;
}

if( (MEM_TYPE_NIMBUS == G_sysConfigData.mem_type) &&
if( (MEM_TYPE_CUMULUS != G_sysConfigData.mem_type) &&
( ((i_sensor >= MRDM0) &&
(i_sensor <= MRDM7)) ||
((i_sensor >= MWRM0) &&
Expand Down Expand Up @@ -319,7 +319,7 @@ static uint8_t amester_get_sensor_info( uint8_t* o_resp, uint16_t* io_resp_lengt
*((uint32_t *)dest) = l_sensorInfo.sensor.freq;
dest+= 4;

if( (MEM_TYPE_NIMBUS == G_sysConfigData.mem_type) &&
if( (MEM_TYPE_CUMULUS != G_sysConfigData.mem_type) &&
( ((i_sensor >= MRDM0) &&
(i_sensor <= MRDM7)) ||
((i_sensor >= MWRM0) &&
Expand Down Expand Up @@ -708,7 +708,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
uint8_t l_rc,temp1,temp2;
uint16_t i,j,cc,idx,temp16;
uint32_t temp32a;
uint32_t *temp32;
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
Expand All @@ -718,38 +717,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
case 0x07: // Write individual AME parameters
switch (i_msg->au8CmdData_ptr[1])
{

case 20: // parameter 20: Set Probe Parameters
{
if (i_msg->au8CmdData_ptr[2]> (NUM_AMEC_FW_PROBES-1))
{
o_resp[0]=i_msg->au8CmdData_ptr[2];
*io_resp_length=1;
l_rc=COMPCODE_PARAM_OUT_OF_RANGE;
break;
}
if (i_msg->au8CmdData_ptr[3] < 1)
{
o_resp[0]=i_msg->au8CmdData_ptr[2];
*io_resp_length=1;
l_rc=COMPCODE_PARAM_OUT_OF_RANGE;
break;
}

temp32a=((uint32_t)i_msg->au8CmdData_ptr[4]<<24)+((uint32_t)i_msg->au8CmdData_ptr[5]<<16);
temp32a=temp32a+((uint32_t)i_msg->au8CmdData_ptr[6]<<8)+((uint32_t)i_msg->au8CmdData_ptr[7]);
temp32=(uint32_t*)temp32a;

g_amec->ptr_probe250us[i_msg->au8CmdData_ptr[2]]=temp32;
g_amec->size_probe250us[i_msg->au8CmdData_ptr[2]]=i_msg->au8CmdData_ptr[3];
g_amec->index_probe250us[i_msg->au8CmdData_ptr[2]]=0; // Reset index

o_resp[0]=i_msg->au8CmdData_ptr[2]; // Return probe #
*io_resp_length=1;
l_rc = COMPCODE_NORMAL;
break;
};

case 29: // parameter 29: Control vector recording modes and stream rates.
{
g_amec->stream_vector_rate=255; // First step is to set an invalid rate so no recording done at all
Expand Down Expand Up @@ -787,28 +754,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
l_rc = COMPCODE_NORMAL;
break;

case 20: // parameter 20: Read Probe Parameters
{
if (i_msg->au8CmdData_ptr[2]> (NUM_AMEC_FW_PROBES-1))
{
o_resp[0]=i_msg->au8CmdData_ptr[2];
*io_resp_length=1;
l_rc=COMPCODE_PARAM_OUT_OF_RANGE;
break;
}
o_resp[1]=g_amec->size_probe250us[i_msg->au8CmdData_ptr[2]]; // Return size of object read by probe in bytes
temp32=g_amec->ptr_probe250us[i_msg->au8CmdData_ptr[2]]; // Get copy of 32 bit probe ptr
temp32a=(uint32_t)temp32;
o_resp[5]=(uint8_t)temp32a;
o_resp[4]=(uint8_t)((uint32_t)temp32a>>8);
o_resp[3]=(uint8_t)((uint32_t)temp32a>>16);
o_resp[2]=(uint8_t)((uint32_t)temp32a>>24);
o_resp[0]=i_msg->au8CmdData_ptr[2]; // Return probe #
*io_resp_length=6;
l_rc=COMPCODE_NORMAL;
break;
};

case 29: // parameter 29: Stream recording control parameters
o_resp[0]=(uint8_t)(g_amec->stream_vector_mode);
o_resp[1]=(uint8_t)(g_amec->stream_vector_rate);
Expand Down
5 changes: 2 additions & 3 deletions src/occ_405/amec/amec_dps.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -376,8 +376,7 @@ void amec_dps_main(void)
// Find the first valid core and send its frequency
if (CORE_PRESENT(l_idx) && !CORE_OFFLINE(l_idx))
{
G_dcom_slv_outbox_tx.factual =
AMECSENSOR_ARRAY_PTR(FREQREQC0,l_idx)->sample;
G_dcom_slv_outbox_tx.factual = g_amec->proc[0].core[l_idx].f_request;
break;
}
}
Expand Down
11 changes: 2 additions & 9 deletions src/occ_405/amec/amec_freq.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -525,10 +525,6 @@ void amec_slv_proc_voting_box(void)
G_non_dps_power_limited = FALSE;
}

// Update the sensor telling us what the requested frequency is
sensor_update( AMECSENSOR_ARRAY_PTR(FREQREQC0,k),
(uint16_t) g_amec->proc[0].core[k].f_request);

#if DEBUG_PROC_VOTING_BOX
/// This trace that can be used to debug the voting
/// box and control loops. It will trace the reason why a
Expand Down Expand Up @@ -960,10 +956,7 @@ void amec_slv_check_perf(void)
TRAC_ERR("SnrBulkPwr %d > Sys Pcap %d ",l_snrBulkPwr,
G_sysConfigData.pcap.system_pcap );

TRAC_ERR("SnrFanPwr %d, SnrIOPwr %d, SnrStoragePwr %d, SnrGpuPrw %d ",
AMECSENSOR_PTR(PWRFAN)->sample,
AMECSENSOR_PTR(PWRIO)->sample,
AMECSENSOR_PTR(PWRSTORE)->sample,
TRAC_ERR("SnrGpuPrw %d ",
AMECSENSOR_PTR(PWRGPU)->sample );

TRAC_ERR("SnrProcPwr 0 %d, SnrProcPwr 1 %d, SnrProcPwr 2 %d, SnrProcPwr 3 %d",
Expand Down
12 changes: 0 additions & 12 deletions src/occ_405/amec/amec_init.c
Expand Up @@ -299,18 +299,6 @@ void amec_init_gamec_struct(void)
g_amec->stream_vector_delay=0; // Delay in msec before recording can begin
g_amec->stream_vector_rate=0xff; // Invalid setting: requires IPMI command to select initial rate

for(l_idx=0; l_idx<NUM_AMEC_FW_PROBES; l_idx++)
{
g_amec->ptr_probe250us[l_idx] = &g_amec->sys.pwrsys.sample;
g_amec->size_probe250us[l_idx] = 2; // Size of object pointed to by probe is 2 bytes
g_amec->index_probe250us[l_idx] = 0; // Initialize all offsets to 0 (used only if size > 2)
}

g_amec->ptr_probe250us[1] = &g_amec->sys.pwrsys.sample;
g_amec->ptr_probe250us[2] = &g_amec->r_cnt;
g_amec->ptr_probe250us[2] = g_amec->ptr_probe250us[2]+2; // Point to low 16 bits of r_cnt
g_amec->ptr_probe250us[3] = &g_amec->r_cnt;

// Initialize the current_mem_pwr_ctl to indicate that memory power control is not supported
// update memory control registers only if new ips/default memory power control is different
g_amec->sys.current_mem_pwr_ctl = MEM_PWR_CTL_NO_SUPPORT;
Expand Down
4 changes: 1 addition & 3 deletions src/occ_405/amec/amec_pcap.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -540,8 +540,6 @@ void amec_ppb_fmax_calc(void)

//Set the slaves local copy of ppb_fmax to that received from Master OCC.
g_amec->proc[0].pwr_votes.ppb_fmax = G_dcom_slv_inbox_doorbell_rx.ppb_fmax;
// For debug
sensor_update( AMECSENSOR_PTR(PROBE250US0), g_amec->proc[0].pwr_votes.ppb_fmax);

//CALCULATION done by MASTER OCC only.
if(OCC_MASTER == G_occ_role)
Expand Down
19 changes: 0 additions & 19 deletions src/occ_405/amec/amec_sensors_power.c
Expand Up @@ -328,19 +328,6 @@ bool amec_update_apss_sensors(void)
// Convert Other Raw Misc Power from APSS into sensors
// ----------------------------------------------------

// Fans: Add up all Fan channels
temp32 = ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.fans[0]);
temp32 += ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.fans[1]);
temp32 = ROUND_POWER(temp32 * l_bulk_voltage);
sensor_update( AMECSENSOR_PTR(PWRFAN), (uint16_t)temp32);

// I/O: Add up all I/O channels
temp32 = ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.io[0]);
temp32 += ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.io[1]);
temp32 += ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.io[2]);
temp32 = ROUND_POWER(temp32 * l_bulk_voltage);
sensor_update( AMECSENSOR_PTR(PWRIO), (uint16_t)temp32);

// Memory: Add up all channels for the same processor.
temp32 = ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.memory[l_proc][0]);
temp32 += ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.memory[l_proc][1]);
Expand All @@ -364,12 +351,6 @@ bool amec_update_apss_sensors(void)
g_amec->mem_snr_pwr[l_idx] = ROUND_POWER(l_temp * l_bulk_voltage);
}

// Storage/Media
temp32 = ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.storage_media[0]);
temp32 += ADC_CONVERTED_VALUE(G_sysConfigData.apss_adc_map.storage_media[1]);
temp32 = ROUND_POWER(temp32 * l_bulk_voltage);
sensor_update( AMECSENSOR_PTR(PWRSTORE), (uint16_t)temp32);

// Save total GPU adapter for this proc
if (l_proc < MAX_GPU_DOMAINS)
{
Expand Down
49 changes: 0 additions & 49 deletions src/occ_405/amec/amec_sys.h
Expand Up @@ -54,9 +54,6 @@
//*************************************************************************
// Defines/Enums
//*************************************************************************
// This is an arbitrary number of FW probes for use internally.
#define NUM_AMEC_FW_PROBES 8

// Number of States in the AMEC State Machine (= AMEC_SMH_STATES_PER_LVL)
#define NUM_AMEC_SMH_STATES AMEC_SMH_STATES_PER_LVL

Expand All @@ -79,7 +76,6 @@ typedef struct
sensor_t amessdur[NUM_AMEC_SMH_STATES];
sensor_t gpetickdur[NUM_GPE_ENGINES];
sensor_t prcdupdatedur;
sensor_t probe250us[NUM_AMEC_FW_PROBES];
sensor_t voltvddsense;
sensor_t voltvdnsense;

Expand All @@ -89,36 +85,6 @@ typedef struct

} amec_fw_t;

//-------------------------------------------------------------
// Fan Sub-structure
//-------------------------------------------------------------
typedef struct
{
// Sensors
sensor_t pwr250usfan;

} amec_fans_t;

//-------------------------------------------------------------
// IO Sub-structure
//-------------------------------------------------------------
typedef struct
{
// Sensors
sensor_t pwr250usio;

} amec_io_t;

//-------------------------------------------------------------
// Storage Sub-structure
//-------------------------------------------------------------
typedef struct
{
// Sensors
sensor_t pwr250usstore;

} amec_store_t;

//-------------------------------------------------------------
// Proc Sub-structure
//-------------------------------------------------------------
Expand Down Expand Up @@ -264,7 +230,6 @@ typedef struct
//-----------------------------------
// Sensors
//-----------------------------------
sensor_t freq250us;
sensor_t freqa;
sensor_t ips4ms;
sensor_t mcpifd4ms;
Expand Down Expand Up @@ -633,14 +598,6 @@ typedef struct
// Physical Structure
//
//---------------------------------------------------------
// IO Data
amec_io_t io;

// Storage Data
amec_store_t storage;

// Fan Data
amec_fans_t fan;

// Overall System Data
amec_systemwide_t sys;
Expand Down Expand Up @@ -705,7 +662,6 @@ typedef struct

// 32 bit counter of 250usec ticks
uint32_t r_cnt;
void * ptr_probe250us[NUM_AMEC_FW_PROBES]; // array holding ptrs to data that is read by probe250us sensors
// 32-bit ptr to streaming buffer which contains 16 bit elements
uint16_t *ptr_stream_buffer;
// 32-bit index for next write into streaming buffer
Expand Down Expand Up @@ -736,13 +692,8 @@ typedef struct
uint16_t cent_l4_ipl_state[MAX_NUM_CENTAURS];
// input from OCC master to signal a desire to power down the L4s (!=0)
uint8_t l4_powerdown_requestm;
// indicates which of the L4 Centaurs is being monitored by probe.
uint16_t probe_l4_centaur;
// holds the sum of all the memory power sensors (32msec)
uint16_t total_memory_power;
uint16_t probetemp[NUM_AMEC_FW_PROBES]; // array holding temporary probe data
uint8_t size_probe250us[NUM_AMEC_FW_PROBES]; // size of object pointed at by each probe (1 byte, 2 bytes, or 4 bytes)
uint8_t index_probe250us[NUM_AMEC_FW_PROBES]; // index offset to read object pointed to by each probe (only valid for size > 2)

} amec_sys_t;

Expand Down
17 changes: 1 addition & 16 deletions src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
Expand Up @@ -881,26 +881,11 @@ void apss_store_ipmi_sensor_id(const uint16_t i_channel, const apss_cfg_adc_v20_
case ADC_IO_A:
case ADC_IO_B:
case ADC_IO_C:
if (i_adc->ipmisensorId != 0)
{
AMECSENSOR_PTR(PWRIO)->ipmi_sid = i_adc->ipmisensorId;
}
break;

case ADC_FANS_A:
case ADC_FANS_B:
if (i_adc->ipmisensorId != 0)
{
AMECSENSOR_PTR(PWRFAN)->ipmi_sid = i_adc->ipmisensorId;
}
break;

case ADC_STORAGE_A:
case ADC_STORAGE_B:
if (i_adc->ipmisensorId != 0)
{
AMECSENSOR_PTR(PWRSTORE)->ipmi_sid = i_adc->ipmisensorId;
}
//None
break;

case ADC_12V_SENSE:
Expand Down
2 changes: 1 addition & 1 deletion src/occ_405/occbuildname.c
Expand Up @@ -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_190624a\0" /*</BuildName>*/ ;
volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190710a\0" /*</BuildName>*/ ;

#endif

0 comments on commit e447be8

Please sign in to comment.