summaryrefslogtreecommitdiffstats
path: root/src/occ_405/cmdh
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2016-06-17 13:35:25 -0500
committerChristopher J. Cain <cjcain@us.ibm.com>2016-07-13 08:02:29 -0400
commita545aa59ce8788c4bfe6fd9bb2f64413bff47189 (patch)
tree754c24597eb222ef14d1187fe1852dd434306376 /src/occ_405/cmdh
parentad4295664e98414db0dcbf0d37fa5bde6dae80ca (diff)
downloadtalos-occ-a545aa59ce8788c4bfe6fd9bb2f64413bff47189.tar.gz
talos-occ-a545aa59ce8788c4bfe6fd9bb2f64413bff47189.zip
Command Changes for fan control and capping
Change-Id: Ib8ba444674bbf5b5554f12730aaffa3ce7c087e4 RTC: 155693 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26005 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Wael El-Essawy <welessa@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Diffstat (limited to 'src/occ_405/cmdh')
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds.c20
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds.h3
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c113
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h13
4 files changed, 73 insertions, 76 deletions
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.c b/src/occ_405/cmdh/cmdh_fsp_cmds.c
index 48d1d5d..ded0263 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds.c
@@ -246,7 +246,8 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
if(CORE_PRESENT(k))
{
l_tempSensorList[l_sensorHeader.count].id = G_amec_sensor_list[TEMP4MSP0C0 + k]->ipmi_sid;
- l_tempSensorList[l_sensorHeader.count].value = G_amec_sensor_list[TEMP4MSP0C0 + k]->sample;
+ l_tempSensorList[l_sensorHeader.count].fru_type = DATA_FRU_PROC;
+ l_tempSensorList[l_sensorHeader.count].value = (G_amec_sensor_list[TEMP4MSP0C0 + k]->sample) & 0xFF;
l_sensorHeader.count++;
}
}
@@ -262,15 +263,15 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
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_port].centaur.dimm_temps[l_dimm].temp_sid;
-
+ l_tempSensorList[l_sensorHeader.count].fru_type = DATA_FRU_DIMM;
//If a dimm timed out long enough, we should return 0xFFFF for that sensor.
if (G_dimm_temp_expired_bitmap.bytes[l_port] & (DIMM_SENSOR0 >> l_dimm))
{
- l_tempSensorList[l_sensorHeader.count].value = 0xFFFF;
+ l_tempSensorList[l_sensorHeader.count].value = 0xFF;
}
else
{
- l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_port].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) & 0xFF;
}
l_sensorHeader.count++;
@@ -286,13 +287,14 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
{
//Add entry for centaurs.
l_tempSensorList[l_sensorHeader.count].id = g_amec->proc[0].memctl[l_cent].centaur.temp_sid;
+ l_tempSensorList[l_sensorHeader.count].fru_type = DATA_FRU_CENTAUR;
if (G_cent_timeout_logged_bitmap & (CENTAUR0_PRESENT_MASK >> l_cent))
{
- l_tempSensorList[l_sensorHeader.count].value = 0xFFFF;
+ l_tempSensorList[l_sensorHeader.count].value = 0xFF;
}
else
{
- l_tempSensorList[l_sensorHeader.count].value = g_amec->proc[0].memctl[l_cent].centaur.centaur_hottest.cur_temp;
+ l_tempSensorList[l_sensorHeader.count].value = (g_amec->proc[0].memctl[l_cent].centaur.centaur_hottest.cur_temp) & 0xFF;
}
l_sensorHeader.count++;
@@ -302,19 +304,19 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
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;
+ l_tempSensorList[l_sensorHeader.count].fru_type = DATA_FRU_DIMM;
//If a dimm timed out long enough, we should return 0xFFFF for that sensor.
if (G_dimm_temp_expired_bitmap.bytes[l_cent] & (DIMM_SENSOR0 >> l_dimm))
{
- l_tempSensorList[l_sensorHeader.count].value = 0xFFFF;
+ l_tempSensorList[l_sensorHeader.count].value = 0xFF;
}
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_cent].centaur.dimm_temps[l_dimm].cur_temp & 0xFF);
}
l_sensorHeader.count++;
}
-
}
}
}
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.h b/src/occ_405/cmdh/cmdh_fsp_cmds.h
index e09ecc2..8961238 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds.h
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds.h
@@ -176,7 +176,8 @@ typedef struct __attribute__ ((packed)) cmdh_poll_sensor_datablock
typedef struct __attribute__ ((packed)) cmdh_poll_temp_sensor
{
uint32_t id; // Sensor id.
- uint16_t value; // current temperature sensor reading in degrees C
+ uint8_t fru_type;
+ uint8_t value; // current temperature sensor reading in degrees C
} cmdh_poll_temp_sensor_t;
typedef struct __attribute__ ((packed)) cmdh_poll_freq_sensor
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
index 2474600..40f0d41 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
@@ -43,13 +43,10 @@
#include <centaur_data.h>
#define FREQ_FORMAT_PWR_MODE_NUM 6
-#define FREQ_FORMAT_BYTES_PER_MODE 3
#define FREQ_FORMAT_BASE_DATA_SZ (sizeof(cmdh_store_mode_freqs_t) - sizeof(cmdh_fsp_cmd_header_t))
-#define FREQ_FORMAT_11_NUM_FREQS 4
#define FREQ_FORMAT_20_NUM_FREQS 6
-#define DATA_FREQ_VERSION_11 0x11
#define DATA_FREQ_VERSION_20 0x20
#define DATA_PCAP_VERSION_20 0x20
@@ -238,11 +235,11 @@ uint8_t DATA_request_cnfgdata ()
return(l_req);
}
-// Functior Specification
+// Function Specification
//
// Name: data_store_freq_data
//
-// Description: TODO Add description
+// Description: Write all of the frequency points from TMGT into G_sysConfigData
//
// End Function Specification
errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
@@ -265,12 +262,9 @@ errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
// Sanity Checks
// If the datapacket is bigger than what we can store, OR
// if the version doesn't equal what we expect, OR
- // if the expected data length does not agree with the actual data length, OR
- // the format is 0x10 and we don't have room for the 3 2B frequencies, OR
- // the format is 0x11 and we don;t have room for the 4 2B frequencies.
+ // if the expected data length does not agree with the actual data length
if((l_data_length < FREQ_FORMAT_BASE_DATA_SZ) ||
- ((l_cmdp->version != DATA_FREQ_VERSION_11) && (l_cmdp->version != DATA_FREQ_VERSION_20)) ||
- ((DATA_FREQ_VERSION_11 == l_cmdp->version) && (l_mode_data_sz != (FREQ_FORMAT_11_NUM_FREQS * 2))) ||
+ (l_cmdp->version != DATA_FREQ_VERSION_20) ||
((DATA_FREQ_VERSION_20 == l_cmdp->version) && (l_mode_data_sz != (FREQ_FORMAT_20_NUM_FREQS * 2))))
{
CMDH_TRAC_ERR("Invalid Frequency Data packet: data_length[%u] version[%u] l_count[%u] l_mode_data_sz[%u]",
@@ -286,44 +280,7 @@ errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
break;
}
- if(DATA_FREQ_VERSION_11 == l_cmdp->version) // Version 0x11
- {
- // 1) Nominal, 2) Turbo,
- // 3) Minimum, 4) Ultra Turbo
- // store under the existing enums.
-
- // Bytes 3-4 Nominal Frequency Point
- l_freq = (l_buf[0] << 8 | l_buf[1]);
- l_table[OCC_MODE_NOMINAL] = l_freq;
- CMDH_TRAC_INFO("Nominal frequency = %d", l_freq);
-
- // Bytes 5-6 Turbo Frequency Point
- l_freq = (l_buf[2] << 8 | l_buf[3]);
- l_table[OCC_MODE_TURBO] = l_freq;
- CMDH_TRAC_INFO("Turbo frequency = %d", l_freq);
-
- // Bytes 7-8 Minimum Frequency Point
- l_freq = (l_buf[4] << 8 | l_buf[5]);
- l_table[OCC_MODE_PWRSAVE] = l_freq;
- l_table[OCC_MODE_MIN_FREQUENCY] = l_freq;
- G_proc_fmin = l_freq;
- CMDH_TRAC_INFO("Minimum frequency = %d", l_freq);
-
-
- // Bytes 9-10 Ultr Turbo Frequency Point
- l_freq = (l_buf[6] << 8 | l_buf[7]);
- if(l_freq)
- {
- G_proc_fmax = l_freq;
- }
- else // If Ultra Turbo Frequency Point = 0, Fmax = Turbo Frequency
- {
- G_proc_fmax = l_table[OCC_MODE_TURBO];
- }
- l_table[OCC_MODE_UTURBO] = l_freq;
- CMDH_TRAC_INFO("UT frequency = %d", l_freq);
- }
- else if(DATA_FREQ_VERSION_20 == l_cmdp->version) // Version 0x20
+ if(DATA_FREQ_VERSION_20 == l_cmdp->version) // Version 0x20
{
// 1) Nominal, 2) Turbo, 3) Minimum,
// 4) Ultra Turbo, 5) Static PS, 6) FFO
@@ -365,17 +322,47 @@ errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
// Bytes 13-14 FFO Frequency Point
l_freq = (l_buf[10] << 8 | l_buf[11]);
- l_table[OCC_MODE_FFO] = l_freq;
- CMDH_TRAC_INFO("FFO Frequency = %d", l_freq);
-
- // Check for FFO Frequency point consistency,
- // rest of the frequency points are checked next
- if(l_freq < G_proc_fmin || l_freq > G_proc_fmax)
+ if (l_freq != 0)
{
- CMDH_TRAC_ERR("FFO Freq point is out-of-range - Fmin=0x%x, Fmax=0x%x, FFO=0x%x",
- l_freq, G_proc_fmin, G_proc_fmax);
+ // Check and make sure that FFO freq is within valid range
+ const uint16_t l_req_freq = l_freq;
+ if (l_freq < G_proc_fmin)
+ {
+ l_freq = G_proc_fmin;
+ }
+ else if (l_freq > G_proc_fmax)
+ {
+ l_freq = G_proc_fmax;
+ }
+
+ // Log an error if we could not honor the requested FFO frequency, but keep going.
+ if (l_req_freq != l_freq)
+ {
+ TRAC_ERR("FFO Frequency out of range. requested %d, but using %d",
+ l_req_freq, l_freq);
+ /* @
+ * @errortype
+ * @moduleid DATA_STORE_FREQ_DATA
+ * @reasoncode INVALID_INPUT_DATA
+ * @userdata1 requested frequency
+ * @userdata2 frequency used
+ * @userdata4 OCC_NO_EXTENDED_RC
+ * @devdesc OCC recieved an invalid FFO frequency
+ */
+ l_err = createErrl(DATA_STORE_FREQ_DATA,
+ INVALID_INPUT_DATA,
+ OCC_NO_EXTENDED_RC,
+ ERRL_SEV_INFORMATIONAL,
+ NULL,
+ DEFAULT_TRACE_SIZE,
+ l_req_freq,
+ l_freq);
+ commitErrl(&l_err);
+ }
}
}
+ l_table[OCC_MODE_FFO] = l_freq;
+ CMDH_TRAC_INFO("FFO Frequency = %d", l_freq);
// Calculate minimum Pstate:
G_proc_pmin = G_proc_pmax + ((G_proc_fmax - G_proc_fmin)/G_khz_per_pstate);
@@ -1523,7 +1510,19 @@ errlHndl_t data_store_mem_cfg(const cmdh_fsp_cmd_t * i_cmd_ptr,
// Validate the i2c info for this data set. Any failure will result in error and
// memory monitoring disabled.
- // Engine must be the same
+ // Only support engine C, D, or E
+ if((l_i2c_engine != PIB_I2C_ENGINE_C) &&
+ (l_i2c_engine != PIB_I2C_ENGINE_D) &&
+ (l_i2c_engine != PIB_I2C_ENGINE_E))
+ {
+ CMDH_TRAC_ERR("data_store_mem_cfg: Invalid I2C engine. entry=%d, engine=%d",
+ i,
+ l_i2c_engine);
+ cmdh_build_errl_rsp(i_cmd_ptr, o_rsp_ptr, ERRL_RC_INVALID_DATA, &l_err);
+ break;
+ }
+
+ // Engine must be the same for all DIMMs
if (l_i2c_engine != G_sysConfigData.dimm_i2c_engine)
{
CMDH_TRAC_ERR("data_store_mem_cfg: I2c engine mismatch. entry=%d, engine=%d, expected=%d",
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h
index 0f2c959..4857671 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h
@@ -95,15 +95,6 @@ typedef struct __attribute__ ((packed))
uint8_t version;
}cmdh_store_mode_freqs_t;
-// Old way used by TMGT to send OCC the frequencies for each mode.
-typedef struct __attribute__ ((packed))
-{
- struct cmdh_fsp_cmd_header;
- uint8_t format;
- uint8_t version;
- uint8_t mode_count;
-}cmdh_store_mode_freqs_old_t;
-
// Used by TMGT to tell OCC if it is a master or not
typedef struct __attribute__ ((packed))
{
@@ -303,9 +294,11 @@ typedef struct __attribute__ ((packed))
uint16_t min_mem_power; // Max mem Power @min (x0.1W)
uint16_t pcap1_n_per_port; // Static per port numerator @PCAP1
+ uint16_t pcap1_n_per_chip; // Static per chip numerator @PCAP1
uint16_t pcap1_mem_power; // Max memory power @PCAP1 (x0.1W)
uint16_t pcap2_n_per_port; // Static per port numerator @PCAP2
+ uint16_t pcap2_n_per_chip; // Static per chip numerator @PCAP2
uint16_t pcap2_mem_power; // Max memory power @PCAP2 (x0.1W)
uint16_t nom_n_per_port; // Static per port @Redundant (no ovs)
@@ -327,9 +320,11 @@ typedef struct __attribute__ ((packed))
uint16_t min_mem_power; // Max mem Power @min (x0.1W)
uint16_t pcap1_n_per_mba; // Static per MBA numerator @PCAP1
+ uint16_t pcap1_n_per_chip; // Static per chip numerator @PCAP1
uint16_t pcap1_mem_power; // Max memory power @PCAP1 (x0.1W)
uint16_t pcap2_n_per_mba; // Static per MBA numerator @PCAP2
+ uint16_t pcap2_n_per_chip; // Static per chip numerator @PCAP2
uint16_t pcap2_mem_power; // Max memory power @PCAP2 (x0.1W)
uint16_t nom_n_per_mba; // Static per MBA @Redundant (no ovs)
OpenPOWER on IntegriCloud