summaryrefslogtreecommitdiffstats
path: root/src/occ_405
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2017-05-18 18:37:13 -0500
committerChristopher J. Cain <cjcain@us.ibm.com>2017-05-22 12:53:19 -0400
commitbc34ad5806549a7a20079745b2b1f8ef439ade0c (patch)
tree0468ab531f6c922be4d80ec0db3fea3aecdb3211 /src/occ_405
parent74eb0dbfb80468860be178962e5302c301a21580 (diff)
downloadtalos-occ-bc34ad5806549a7a20079745b2b1f8ef439ade0c.tar.gz
talos-occ-bc34ad5806549a7a20079745b2b1f8ef439ade0c.zip
Enable soft power capping and update poll response
- fix bounds checking to allow soft power cap - add soft power cap value to poll response - add EXTN sensor section with frequency points to poll response Change-Id: Ide2a96641194d13c11d22ee2a711090b2a16396a Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40762 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Diffstat (limited to 'src/occ_405')
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds.c67
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds.h16
-rwxr-xr-xsrc/occ_405/occbuildname.c2
3 files changed, 79 insertions, 6 deletions
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.c b/src/occ_405/cmdh/cmdh_fsp_cmds.c
index 3071687..1e1da84 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds.c
@@ -446,7 +446,7 @@ ERRL_RC cmdh_poll_v20(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_CAPS, 4);
- l_sensorHeader.format = 0x02;
+ l_sensorHeader.format = 0x03;
l_sensorHeader.length = sizeof(cmdh_poll_pcaps_sensor_t);
@@ -455,7 +455,8 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
l_pcapData.system = G_amec_sensor_list[PWRSYS]->sample;
l_pcapData.n = G_sysConfigData.pcap.oversub_pcap;
l_pcapData.max = G_sysConfigData.pcap.max_pcap;
- l_pcapData.min = G_sysConfigData.pcap.hard_min_pcap;
+ l_pcapData.hard_min = G_sysConfigData.pcap.hard_min_pcap;
+ l_pcapData.soft_min = G_sysConfigData.pcap.soft_min_pcap;
l_pcapData.user = G_sysConfigData.pcap.current_pcap;
l_pcapData.source = G_sysConfigData.pcap.source;
l_sensorHeader.count = 1;
@@ -477,6 +478,64 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
}
+
+ ///////////////////
+ // EXTN Sensors:
+ // 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_EXTN, 4);
+ l_sensorHeader.format = 0x01;
+ l_sensorHeader.length = sizeof(cmdh_poll_extn_sensor_t);
+ l_sensorHeader.count = 0;
+
+ cmdh_poll_extn_sensor_t l_extnSensorList[4] = {{0}};
+ l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_FMIN;
+ uint16_t freq = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
+ l_extnSensorList[l_sensorHeader.count].data[0] = proc_freq2pstate(freq);
+ l_extnSensorList[l_sensorHeader.count].data[1] = CONVERT_UINT16_UINT8_HIGH(freq);
+ l_extnSensorList[l_sensorHeader.count].data[2] = CONVERT_UINT16_UINT8_LOW(freq);
+ l_sensorHeader.count++;
+ l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_FNOM;
+ freq = G_sysConfigData.sys_mode_freq.table[OCC_MODE_NOMINAL];
+ l_extnSensorList[l_sensorHeader.count].data[0] = proc_freq2pstate(freq);
+ l_extnSensorList[l_sensorHeader.count].data[1] = CONVERT_UINT16_UINT8_HIGH(freq);
+ l_extnSensorList[l_sensorHeader.count].data[2] = CONVERT_UINT16_UINT8_LOW(freq);
+ l_sensorHeader.count++;
+ l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_FTURBO;
+ freq = G_sysConfigData.sys_mode_freq.table[OCC_MODE_TURBO];
+ if (freq > 0)
+ {
+ l_extnSensorList[l_sensorHeader.count].data[0] = proc_freq2pstate(freq);
+ l_extnSensorList[l_sensorHeader.count].data[1] = CONVERT_UINT16_UINT8_HIGH(freq);
+ l_extnSensorList[l_sensorHeader.count].data[2] = CONVERT_UINT16_UINT8_LOW(freq);
+ }
+ l_sensorHeader.count++;
+ l_extnSensorList[l_sensorHeader.count].name = EXTN_NAME_FUTURBO;
+ freq = G_sysConfigData.sys_mode_freq.table[OCC_MODE_UTURBO];
+ if (freq > 0)
+ {
+ l_extnSensorList[l_sensorHeader.count].data[0] = proc_freq2pstate(freq);
+ l_extnSensorList[l_sensorHeader.count].data[1] = CONVERT_UINT16_UINT8_HIGH(freq);
+ l_extnSensorList[l_sensorHeader.count].data[2] = CONVERT_UINT16_UINT8_LOW(freq);
+ }
+ l_sensorHeader.count++;
+
+ // Copy header to response buffer.
+ memcpy ((void *) &(o_rsp_ptr->data[l_rsp_index]), (void *)&l_sensorHeader, sizeof(l_sensorHeader));
+ //Increment index into response buffer.
+ l_rsp_index += sizeof(l_sensorHeader);
+ l_poll_rsp->sensor_dblock_count +=1;
+ // Write data to outbuffer if any.
+ if (l_sensorHeader.count)
+ {
+ uint8_t l_sensordataSz = l_sensorHeader.count * l_sensorHeader.length;
+ // Copy sensor data into response buffer.
+ memcpy ((void *) &(o_rsp_ptr->data[l_rsp_index]), (void *)l_extnSensorList, l_sensordataSz);
+ // Increment index into response buffer.
+ l_rsp_index += l_sensordataSz;
+ }
+
+
l_poll_rsp->data_length[0] = CONVERT_UINT16_UINT8_HIGH(l_rsp_index);
l_poll_rsp->data_length[1] = CONVERT_UINT16_UINT8_LOW(l_rsp_index);
l_rc = ERRL_RC_SUCCESS;
@@ -1647,10 +1706,10 @@ errlHndl_t cmdh_set_user_pcap(const cmdh_fsp_cmd_t * i_cmd_ptr,
//A value of 0 means this pcap has been deactivated, otherwise
//make sure it's within the min & max.
- if ((l_pcap != 0) && (l_pcap < G_master_pcap_data.hard_min_pcap))
+ if ((l_pcap != 0) && (l_pcap < G_master_pcap_data.soft_min_pcap))
{
TRAC_ERR("User PCAP %d is below the minimum allowed (%d)",
- l_pcap, G_master_pcap_data.hard_min_pcap);
+ l_pcap, G_master_pcap_data.soft_min_pcap);
l_rc = ERRL_RC_INVALID_DATA;
break;
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.h b/src/occ_405/cmdh/cmdh_fsp_cmds.h
index b65c8cc..14f364d 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds.h
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds.h
@@ -62,6 +62,11 @@ typedef enum
#define SENSOR_FREQ "FREQ"
#define SENSOR_POWR "POWR"
#define SENSOR_CAPS "CAPS"
+#define SENSOR_EXTN "EXTN"
+#define EXTN_NAME_FMIN 0x464D494E // "FMIN"
+#define EXTN_NAME_FNOM 0x464E4F00 // "FNOM"
+#define EXTN_NAME_FTURBO 0x46540000 // "FT"
+#define EXTN_NAME_FUTURBO 0x46555400 // "FUT"
//---------------------------------------------------------
// Poll Command
@@ -204,11 +209,20 @@ typedef struct __attribute__ ((packed)) cmdh_poll_caps_sensor
uint16_t system; // Current system power in 1W units.
uint16_t n; // Oversubscription; output pcap limit when theres no redundant power.
uint16_t max; // Maximum power cap in 1W units.
- uint16_t min; // Minimum power cap in 1W units.
+ uint16_t hard_min; // Minimum hard power cap in 1W units.
+ uint16_t soft_min; // Minimum soft power cap in 1W units.
uint16_t user; // Power cap set by user in 1W units.
uint8_t source; // User Power Limit Source
} cmdh_poll_pcaps_sensor_t;
+typedef struct __attribute__ ((packed)) cmdh_poll_extn_sensor
+{
+ uint32_t name; // Sensor name or id
+ uint8_t flags; // Flags indicating any special processing
+ uint8_t reserved;
+ uint8_t data[6]; // Data associated with sensor
+} cmdh_poll_extn_sensor_t;
+
//---------------------------------------------------------
// Query FW Level Command
//---------------------------------------------------------
diff --git a/src/occ_405/occbuildname.c b/src/occ_405/occbuildname.c
index 9e8c0d1..761f1a6 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_170515a\0" /*</BuildName>*/ ;
+volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_170519a\0" /*</BuildName>*/ ;
#endif
OpenPOWER on IntegriCloud