summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-03-09 20:04:05 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-03-16 02:17:02 +0300
commit8280d077f1f57dd044968e3079b1fa60f72cad75 (patch)
tree8c906286aeec832fcc3d5fcb87c6ad6d1387bd58
parent6bc2f026595b69c9594ce4843502a98129351143 (diff)
downloadopenbmc-8280d077f1f57dd044968e3079b1fa60f72cad75.tar.xz
Factor PS derating into power cap limit validation
When the BMC sends a system power cap to the host, the host validates it is in a certain range or it will reject it. So, the BMC also checks the range before sending it at all. This range comes out of the MRW (machine readable workbook) XML, and is stored as output power. The user, however, inputs the power cap value as input power, and so the range the BMC code checks it against must also be in input power. To support this, the script that pulls the power cap min and max values out of the MRW for use in settings validation will now convert those output power values into input power by applying the power supply derating factor. Resolves openbmc/openbmc#2944 Tested: Check that the power cap range that the settings manager uses is now the input power versions. Change-Id: Id5c5851d081ad706fda73054b49e67a93d57f76e Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bbappend1
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native/mrw-override-settings.yaml2
-rw-r--r--meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb3
3 files changed, 5 insertions, 1 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bbappend b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bbappend
index 72d991c7e..aa8149c1b 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bbappend
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bbappend
@@ -1 +1,2 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+MRW_EXPRESSION_VARS = "-v PS_DERATING=${POWER_SUPPLY_DERATING_FACTOR}"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native/mrw-override-settings.yaml b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native/mrw-override-settings.yaml
index 0bfd51543..c823896f1 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native/mrw-override-settings.yaml
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native/mrw-override-settings.yaml
@@ -5,7 +5,7 @@
Default: 0
Validation:
Type: "range"
- Validator: "MRW_OPEN_POWER_SOFT_MIN_PCAP_WATTS..MRW_OPEN_POWER_N_PLUS_ONE_BULK_POWER_LIMIT_WATTS"
+ Validator: "[[MRW_OPEN_POWER_SOFT_MIN_PCAP_WATTS/(PS_DERATING/100)]]..[[MRW_OPEN_POWER_N_PLUS_ONE_BULK_POWER_LIMIT_WATTS/(PS_DERATING/100)]]"
Unit: "Watts"
PowerCapEnable:
Default: 'false'
diff --git a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb
index 2080a3b6e..d5ec1bc53 100644
--- a/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb
+++ b/meta-phosphor/common/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb
@@ -17,6 +17,8 @@ SRC_URI += "file://mrw-override-settings.yaml"
S = "${WORKDIR}"
+MRW_EXPRESSION_VARS ?= ""
+
do_install() {
DEST=${D}${config_datadir}
install -D mrw-override-settings.yaml ${DEST}/mrw-override-settings.yaml
@@ -30,5 +32,6 @@ do_install() {
-i ${mrw_datadir}/${MRW_XML} \
-s ${DEST}/mrw-override-settings.yaml \
-o ${SETTINGS}/mrw-settings.override.yaml \
+ ${MRW_EXPRESSION_VARS} \
-f
}