summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2017-12-12 12:51:10 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-12-15 16:15:43 -0500
commit83243d5bbb3db4a79441824d5a4b4a250554f841 (patch)
treeb0dbe40f07358899e71fb98626b1138cd2711540 /src/usr/htmgt
parent02098ca7d9c127a77b88692f1569938679e8c105 (diff)
downloadblackbird-hostboot-83243d5bbb3db4a79441824d5a4b4a250554f841.tar.gz
blackbird-hostboot-83243d5bbb3db4a79441824d5a4b4a250554f841.zip
HTMGT: Send power supply redundancy policy to OCC
Change-Id: If439440e0a4368e51de91818f406f152f5e232b1 CQ: SW408974 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50824 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt')
-rw-r--r--src/usr/htmgt/htmgt_activate.C5
-rw-r--r--src/usr/htmgt/htmgt_cfgdata.C24
-rw-r--r--src/usr/htmgt/htmgt_cfgdata.H6
3 files changed, 25 insertions, 10 deletions
diff --git a/src/usr/htmgt/htmgt_activate.C b/src/usr/htmgt/htmgt_activate.C
index a581596a4..b8dd0e862 100644
--- a/src/usr/htmgt/htmgt_activate.C
+++ b/src/usr/htmgt/htmgt_activate.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -211,8 +211,9 @@ namespace HTMGT
if (active)
{
//Make sure this value is between the min & max allowed
+ bool is_redundant;
min = sys->getAttr<ATTR_OPEN_POWER_MIN_POWER_CAP_WATTS>();
- max = getMaxPowerCap(sys);
+ max = getMaxPowerCap(sys, is_redundant);
if ((limit != 0) && (limit < min))
{
TMGT_INF("sendOccUserPowerCap: User power cap %d is below"
diff --git a/src/usr/htmgt/htmgt_cfgdata.C b/src/usr/htmgt/htmgt_cfgdata.C
index 7ac807e40..98e7a4322 100644
--- a/src/usr/htmgt/htmgt_cfgdata.C
+++ b/src/usr/htmgt/htmgt_cfgdata.C
@@ -636,10 +636,10 @@ void getOCCRoleMessageData(bool i_master, bool i_firMaster,
}
-uint16_t getMaxPowerCap(Target *i_sys)
+uint16_t getMaxPowerCap(Target *i_sys, bool & o_is_redundant)
{
uint16_t o_maxPcap = 0;
- bool useDefaultLimit = true;
+ o_is_redundant = true;
#ifdef CONFIG_BMC_IPMI
// Check if HPC limit was found
@@ -663,7 +663,7 @@ uint16_t getMaxPowerCap(Target *i_sys)
// non-redundant policy allows higher bulk power limit
// with the potential impact of OCC not being able to
// lower power fast enough
- useDefaultLimit = false;
+ o_is_redundant = false;
TMGT_INF("getMaxPowerCap: maximum power cap = %dW"
" (HPC/non-redundant PS bulk power limit)",
hpc_pcap);
@@ -685,7 +685,7 @@ uint16_t getMaxPowerCap(Target *i_sys)
// else HPC limit not found, use default
#endif
- if (useDefaultLimit)
+ if (o_is_redundant)
{
// Read the default N+1 bulk power limit (redundant PS policy)
o_maxPcap = i_sys->
@@ -732,7 +732,8 @@ void getPowerCapMessageData(uint8_t* o_data, uint64_t & o_size)
index += 2;
// System Maximum Power Cap
- const uint16_t max_pcap = getMaxPowerCap(sys);
+ bool is_redundant;
+ const uint16_t max_pcap = getMaxPowerCap(sys, is_redundant);
UINT16_PUT(&o_data[index], max_pcap);
index += 2;
@@ -791,9 +792,20 @@ void getSystemConfigMessageData(const TargetHandle_t i_occ, uint8_t* o_data,
//0=OCC report throttling when max frequency lowered below turbo
G_system_type &= ~OCC_REPORT_THROTTLE_BELOW_NOMINAL;
}
+ bool is_redundant;
+ getMaxPowerCap(sys, is_redundant);
+ if (is_redundant == false)
+ {
+ // Power supply policy is non-redundant
+ G_system_type |= OCC_CFGDATA_NON_REDUNDANT_PS;
+ }
+ else
+ {
+ // Power supply policy is redundant
+ G_system_type &= ~OCC_CFGDATA_NON_REDUNDANT_PS;
+ }
o_data[index++] = G_system_type;
-
//processor Callout Sensor ID
ConstTargetHandle_t proc = getParentChip(i_occ);
SensorID1 = UTIL::getSensorNumber(proc, SENSOR_NAME_PROC_STATE);
diff --git a/src/usr/htmgt/htmgt_cfgdata.H b/src/usr/htmgt/htmgt_cfgdata.H
index 84d936dfa..5349ea600 100644
--- a/src/usr/htmgt/htmgt_cfgdata.H
+++ b/src/usr/htmgt/htmgt_cfgdata.H
@@ -66,6 +66,7 @@ namespace HTMGT
//KVM or OPAL mode + single node
OCC_CFGDATA_OPENPOWER_OPALVM = 0x81,
//PowerVM mode + single node
+ OCC_CFGDATA_NON_REDUNDANT_PS = 0x02,
OCC_CFGDATA_OPENPOWER_POWERVM = 0x01,
//Mask, report throttling only when max frequency lowered below nominal
@@ -193,10 +194,11 @@ namespace HTMGT
* Value is read from the MRW based on the Current Power Supply
* Redundancy Policy sensor in the BMC
*
- * @param[in] i_sys - pointer to system target
+ * @param[in] i_sys - pointer to system target
+ * @param[out] o_is_redundant - true if power supplies should be redundant
* @returns maximum power cap in watts
*/
- uint16_t getMaxPowerCap(TARGETING::Target * i_sys);
+ uint16_t getMaxPowerCap(TARGETING::Target *i_sys, bool & o_is_redundant);
/**
OpenPOWER on IntegriCloud