diff options
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-phosphor')
24 files changed, 697 insertions, 1065 deletions
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml index 865e4b3b6..76eaa4e51 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml +++ b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml @@ -433,3 +433,9 @@ sensorID: 0xFC sensorType: 0x25 offset: 0x01 +# map non-IPMI-SEL to the system event sensor as "Undetermined system hardware failure." +/xyz/openbmc_project/inventory/system: + eventReadingType: 0x6f + sensorID: 0xFE + sensorType: 0x12 + offset: 0x02 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch deleted file mode 100644 index 050c8b43c..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch +++ /dev/null @@ -1,117 +0,0 @@ -From c9b6d4589620275a625121b0ea9f4cc4c93b608a Mon Sep 17 00:00:00 2001 -From: Ian Goegebuer <goegebuer@google.com> -Date: Tue, 10 Nov 2020 14:20:47 -0800 -Subject: [PATCH] pid/zone: Add the ability to dynamically set the failSafe - percent - -This change advertises the failSafe percent as a FanSpeed interface -added to the the FanCtrl object generated by the config.json file. - -The target method added in this case sets the failSafePerecent -out of 255 with 255 being 100% and 0 being 0%. - -Example: -`busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone1 xyz.openbmc_project.Control.FanSpeed Target t 178` -Sets the failSafePercent to 69.8% or ~70% -`busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone1 xyz.openbmc_project.Control.FanSpeed Target t 250` -Sets the failSafePercent to 98% - -Signed-off-by: Ian Goegebuer <goegebuer@google.com> -Change-Id: Ief538d865dc1c654427ed9792496ab368e8803e2 ---- - pid/zone.cpp | 11 +++++++++++ - pid/zone.hpp | 11 +++++++++-- - pid/zone_interface.hpp | 1 + - 3 files changed, 21 insertions(+), 2 deletions(-) - -diff --git a/pid/zone.cpp b/pid/zone.cpp -index 441031a..24f6e84 100644 ---- a/pid/zone.cpp -+++ b/pid/zone.cpp -@@ -120,6 +120,11 @@ double DbusPidZone::getFailSafePercent(void) const - return _failSafePercent; - } - -+void DbusPidZone::setFailSafePercent(double newFailSafe) -+{ -+ _failSafePercent = newFailSafe; -+} -+ - double DbusPidZone::getMinThermalSetpoint(void) const - { - return _minThermalOutputSetPt; -@@ -459,4 +464,10 @@ bool DbusPidZone::failSafe() const - return getFailSafeMode(); - } - -+uint64_t DbusPidZone::target(uint64_t value) -+{ -+ setFailSafePercent(((double)value / 255) * 100.0); -+ return ModeObject::target(value); -+} -+ - } // namespace pid_control -diff --git a/pid/zone.hpp b/pid/zone.hpp -index 3bea9c2..c0d1d22 100644 ---- a/pid/zone.hpp -+++ b/pid/zone.hpp -@@ -10,6 +10,7 @@ - - #include <sdbusplus/bus.hpp> - #include <sdbusplus/server.hpp> -+#include <xyz/openbmc_project/Control/FanSpeed/server.hpp> - #include <xyz/openbmc_project/Control/Mode/server.hpp> - - #include <fstream> -@@ -22,7 +23,9 @@ - template <typename... T> - using ServerObject = typename sdbusplus::server::object::object<T...>; - using ModeInterface = sdbusplus::xyz::openbmc_project::Control::server::Mode; --using ModeObject = ServerObject<ModeInterface>; -+using FanSpeedInterface = -+ sdbusplus::xyz::openbmc_project::Control::server::FanSpeed; -+using ModeObject = ServerObject<ModeInterface, FanSpeedInterface>; - - namespace pid_control - { -@@ -63,6 +66,7 @@ class DbusPidZone : public ZoneInterface, public ModeObject - void clearSetPoints(void) override; - void clearRPMCeilings(void) override; - double getFailSafePercent(void) const override; -+ void setFailSafePercent(double) override; - double getMinThermalSetpoint(void) const; - - Sensor* getSensor(const std::string& name) override; -@@ -88,6 +92,9 @@ class DbusPidZone : public ZoneInterface, public ModeObject - /* Method for reading whether in fail-safe mode over dbus */ - bool failSafe() const override; - -+ /* Method for setting the failSafePercent over dbus */ -+ uint64_t target(uint64_t value) override; -+ - private: - std::ofstream _log; - -@@ -95,7 +102,7 @@ class DbusPidZone : public ZoneInterface, public ModeObject - double _maximumSetPoint = 0; - bool _manualMode = false; - const double _minThermalOutputSetPt; -- const double _failSafePercent; -+ double _failSafePercent; - - std::set<std::string> _failSafeSensors; - -diff --git a/pid/zone_interface.hpp b/pid/zone_interface.hpp -index a024c0e..9ea89c1 100644 ---- a/pid/zone_interface.hpp -+++ b/pid/zone_interface.hpp -@@ -70,6 +70,7 @@ class ZoneInterface - * fail safe. - */ - virtual double getFailSafePercent() const = 0; -+ virtual void setFailSafePercent(double newFailSafe) = 0; - - /** Return if the zone is set to manual mode. false equates to automatic - * mode (the default). --- -2.29.2.222.g5d2a92d10f8-goog diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in index 21ba368df..2c921a7f8 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in @@ -73,8 +73,8 @@ }, { "name": "cputemp", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/cputemp", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/cputemp", "writePath": "", "min": 0, "max": 0, @@ -82,9 +82,9 @@ "timeout": 0 }, { - "name": "zone0_vr", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/zone0_vr", + "name": "vddcr_cpu", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddcr_cpu", "writePath": "", "min": 0, "max": 0, @@ -92,9 +92,49 @@ "timeout": 0 }, { - "name": "nvme", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/nvme", + "name": "vddcr_soc", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddcr_soc", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "vddio_abcd", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddio_abcd", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "vddio_efgh", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddio_efgh", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "p12v_mobo", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/p12v_mobo", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "powerseq_temp", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/powerseq_temp", "writePath": "", "min": 0, "max": 0, @@ -103,8 +143,168 @@ }, { "name": "p12v_fan", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/p12v_fan", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/p12v_fan", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme0", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme1", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme2", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme2", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme3", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme3", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme4", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme4", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme5", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme5", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme6", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme6", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme7", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme7", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme8", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme8", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme9", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme9", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme10", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme10", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme11", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme11", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme12", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme12", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme13", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme13", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme14", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme14", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme15", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme15", "writePath": "", "min": 0, "max": 0, @@ -162,15 +362,15 @@ }, { "name": "cputemp", - "type": "margin", + "type": "temp", "inputs": [ "cputemp" ], - "setpoint": 10.0, + "setpoint": 80.0, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 714.0, - "integralCoeff": 9.0, + "proportionalCoeff": -714.0, + "integralCoeff": -9.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, @@ -185,15 +385,20 @@ }, { "name": "zone0_vr", - "type": "margin", + "type": "temp", "inputs": [ - "zone0_vr" + "vddcr_cpu", + "vddcr_soc", + "vddio_abcd", + "vddio_efgh", + "p12v_mobo", + "powerseq_temp" ], - "setpoint": 10.0, + "setpoint": 90.0, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 536.0, - "integralCoeff": 9.0, + "proportionalCoeff": -536.0, + "integralCoeff": -9.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, @@ -346,16 +551,16 @@ } }, { - "name": "nvme", - "type": "margin", + "name": "p12v_fan", + "type": "temp", "inputs": [ - "nvme" + "p12v_fan" ], - "setpoint": 10.0, + "setpoint": 90.0, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 1250.0, - "integralCoeff": 12.0, + "proportionalCoeff": -268.0, + "integralCoeff": -4.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, @@ -369,16 +574,361 @@ } }, { - "name": "p12v_fan", - "type": "margin", + "name": "nvme0", + "type": "temp", "inputs": [ - "p12v_fan" + "nvme0" ], - "setpoint": 10.0, + "setpoint": @WCTemp00@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme1", + "type": "temp", + "inputs": [ + "nvme1" + ], + "setpoint": @WCTemp01@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme2", + "type": "temp", + "inputs": [ + "nvme2" + ], + "setpoint": @WCTemp02@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme3", + "type": "temp", + "inputs": [ + "nvme3" + ], + "setpoint": @WCTemp03@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme4", + "type": "temp", + "inputs": [ + "nvme4" + ], + "setpoint": @WCTemp04@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme5", + "type": "temp", + "inputs": [ + "nvme5" + ], + "setpoint": @WCTemp05@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme6", + "type": "temp", + "inputs": [ + "nvme6" + ], + "setpoint": @WCTemp06@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme7", + "type": "temp", + "inputs": [ + "nvme7" + ], + "setpoint": @WCTemp07@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme8", + "type": "temp", + "inputs": [ + "nvme8" + ], + "setpoint": @WCTemp08@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme9", + "type": "temp", + "inputs": [ + "nvme9" + ], + "setpoint": @WCTemp09@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme10", + "type": "temp", + "inputs": [ + "nvme10" + ], + "setpoint": @WCTemp10@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme11", + "type": "temp", + "inputs": [ + "nvme11" + ], + "setpoint": @WCTemp11@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme12", + "type": "temp", + "inputs": [ + "nvme12" + ], + "setpoint": @WCTemp12@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme13", + "type": "temp", + "inputs": [ + "nvme13" + ], + "setpoint": @WCTemp13@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme14", + "type": "temp", + "inputs": [ + "nvme14" + ], + "setpoint": @WCTemp14@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme15", + "type": "temp", + "inputs": [ + "nvme15" + ], + "setpoint": @WCTemp15@, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 268.0, - "integralCoeff": 4.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh index 9617d0da4..5ceac7ea5 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh @@ -15,13 +15,74 @@ mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan2 Fan_0_To_4_Hwmon="$(ls /sys/devices/platform/ahb/ahb\:*/*pwm-fan-controller/hwmon/)" if [[ "$Fan_0_To_4_Hwmon" != "" ]]; then - sed -i "s/@Fan_0_To_4_Hwmon@/$Fan_0_To_4_Hwmon/g" $TEMP_FILE + sed -i "s/@Fan_0_To_4_Hwmon@/$Fan_0_To_4_Hwmon/g" $TEMP_FILE fi +presentGpio=() +presentState=() +gpioPath="/sys/class/gpio/gpio" +if [[ -f "/etc/nvme/nvme_config.json" ]]; then + presentGpio=($(cat /etc/nvme/nvme_config.json | grep NVMeDrivePresentPin \ + | awk '{print $2}' | cut -d "," -f 0)) +fi + +nvmePath="/xyz/openbmc_project/sensors/temperature/nvme" +nvmeInventoryPath="/xyz/openbmc_project/inventory/system/chassis/motherboard/nvme" +# Get and Set WCTEMP +for ((i = 0; i < 16; i++)); do + name="@WCTemp$(printf "%02d" $i)@" + wcTemp=72000 + + if [[ -d "${gpioPath}${presentGpio[i]}" ]] && + [[ "$(cat ${gpioPath}${presentGpio[i]}/value)" == "0" ]]; then + presentState[i]="true" + else + presentState[i]="false" + fi + + if [[ "${presentState[i]}" == "true" ]]; then + actualWCTemp=0 + for ((j = 0; j < 3; j++)); do + actualWCTemp="$( + busctl get-property xyz.openbmc_project.nvme.manager \ + ${nvmePath}${i} \ + xyz.openbmc_project.Sensor.Threshold.Critical \ + CriticalHigh | awk '{print $2}' + )" + if [[ "${actualWCTemp}" -ne 0 ]]; then + break + fi + + echo "${nvmePath}${i} WCTemp was read to be 0, retrying after 1 sec sleep" + sleep 1 + done + + if [[ "${actualWCTemp}" -ne 0 ]]; then + wcTemp="$(echo "${actualWCTemp} -7" | awk '{printf $1 + $2}')" + else + echo "${nvmePath}${i} WCTemp was read to be 0, using default WCTemp: ${wcTemp}" + fi + fi + + sed -i "s/$name/${wcTemp}/g" "$TEMP_FILE" + + if [[ "${presentState[i]}" == "false" ]]; then + sensorPath="${nvmePath}${i}" + pathLine=$(grep -nw "$sensorPath" "$TEMP_FILE" | awk -F ':' '{print $1}') + sed -i "$TEMP_FILE" -re "$((pathLine - 3)),$((pathLine + 6))d" + if [ $i -eq 15 ]; then + sed -i "$((pathLine - 4))s/,//" "$TEMP_FILE" + fi + + listLine=$(grep -n "\"name\": \"nvme${i}\"" "$TEMP_FILE" | awk -F ':' '{print $1}') + sed -i "$TEMP_FILE" -re "$((listLine - 1)),$((listLine + 21))d" + if [ $i -eq 15 ]; then + sed -i "$((listLine - 2))s/,//" "$TEMP_FILE" + fi + fi +done + # Use shell parameter expansion to trim the ".in" suffix mv "$TEMP_FILE" "${FAN_TABLE_FILE_IN%".in"}" -# start read margin temp wait -/usr/bin/read-margin-temp-wait.sh & - exit 0 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend index 7acd44c70..e617f8679 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -2,7 +2,6 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" SRC_URI_append_gbs = " file://config.json.in \ file://fan-table-init.sh \ file://phosphor-pid-control.service \ - file://0001-Advertise-failSafePercent-on-dbus.patch \ " FILES_${PN}_append_gbs = " ${datadir}/swampd/config.json.in" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend index ff9e512c7..9e2666417 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend @@ -14,12 +14,31 @@ OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-ecc" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-sysinit" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-ipmi-entity-association-map" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " usb-network" -OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " mac-address" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-image-signing" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " openssl-bin" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-ipmi-blobs-binarystore" -OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-nvme-pwr-ctrl" -OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " read-margin-temp" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-virtual-sensor" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " acpi-power-state-daemon" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " virtual/obmc-gpio-presence" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ipmitool" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-health-monitor" + +# Add back packages that were part of packagegroup-obmc-apps-extras +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-hwmon" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-inventory-manager" +# Required for obmc-bmcweb +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " bmcweb" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-bmcweb-cert-config" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-nslcd-authority-cert-config" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-user-manager" +# Required for LEDs. Part of obmc-leds +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ${VIRTUAL-RUNTIME_obmc-leds-manager}" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ${VIRTUAL-RUNTIME_obmc-leds-sysfs}" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ${VIRTUAL-RUNTIME_obmc-led-monitor}" +# Required for the front port. Part of obmc-console +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " obmc-console" +# Required from packagegroup-gbs-apps +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-bmc-update" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " virtual/bios-update" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " x86-power-control" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-pid-control" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json b/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json index b834fa876..01bd7836b 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json @@ -479,7 +479,11 @@ "/xyz/openbmc_project/sensors/fan_tach/fan1", "/xyz/openbmc_project/sensors/fan_tach/fb_fan0", "/xyz/openbmc_project/sensors/fan_tach/fb_fan1", - "/xyz/openbmc_project/sensors/fan_tach/fb_fan2" + "/xyz/openbmc_project/sensors/fan_tach/fb_fan2", + + "/xyz/openbmc_project/sensors/utilization/CPU", + "/xyz/openbmc_project/sensors/utilization/Memory", + "/xyz/openbmc_project/sensors/utilization/Storage_RW" ] } ] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json index 4ad11bc6e..43ee49923 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json @@ -1,5 +1,5 @@ [{ "blobBaseId": "/skm/hss/", - "sysFilePath": "/sys/class/i2c-adapter/i2c-5/5-0050/5-00500/nvmem", + "sysFilePath": "/sys/class/i2c-adapter/i2c-5/5-0050/eeprom", "offsetBytes": 256 }] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-Chassis-State-Transition-interface.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-Chassis-State-Transition-interface.patch deleted file mode 100644 index 74f982b33..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-Chassis-State-Transition-interface.patch +++ /dev/null @@ -1,79 +0,0 @@ -From a1f9d797753e32b36e08e7d611ff88b10e9bbad2 Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" <jason.m.bills@linux.intel.com> -Date: Thu, 30 Jan 2020 16:18:33 -0800 -Subject: [PATCH 1/3] Add Chassis State Transition interface - -This adds the Chassis State Transition interface in preparation -to support the mapping defined in the design document below. - -ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/22358 - -Tested: -Ran each IPMI chassis control command to confirm the expected -behavior: -ipmitool power on: system is powered-on -ipmitool power off: system is forced off -ipmitool power cycle: system is forced off then powered-on -ipmitool power reset: system is hard reset -ipmitool power soft: soft power-off requested from system software - -Change-Id: I6acfb795a9a33ff5227a5d6e1830774ab732ac0c -Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> ---- - chassishandler.cpp | 33 +++++++++++++++++++++++++++++++++ - 1 file changed, 33 insertions(+) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 0d318647..fdbb9fa5 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -31,6 +31,7 @@ - #include <xyz/openbmc_project/Control/Boot/Mode/server.hpp> - #include <xyz/openbmc_project/Control/Boot/Source/server.hpp> - #include <xyz/openbmc_project/Control/Power/RestorePolicy/server.hpp> -+#include <xyz/openbmc_project/State/Chassis/server.hpp> - #include <xyz/openbmc_project/State/Host/server.hpp> - #include <xyz/openbmc_project/State/PowerOnHours/server.hpp> - -@@ -865,6 +866,38 @@ int initiate_state_transition(State::Host::Transition transition) - return rc; - } - -+//------------------------------------------ -+// Calls into Chassis State Manager Dbus object -+//------------------------------------------ -+int initiateChassisStateTransition(State::Chassis::Transition transition) -+{ -+ // OpenBMC Chassis State Manager dbus framework -+ constexpr auto chassisStatePath = "/xyz/openbmc_project/state/chassis0"; -+ constexpr auto chassisStateIntf = "xyz.openbmc_project.State.Chassis"; -+ -+ auto service = -+ ipmi::getService(*getSdBus(), chassisStateIntf, chassisStatePath); -+ -+ // Convert to string equivalent of the passed in transition enum. -+ auto request = State::convertForMessage(transition); -+ -+ try -+ { -+ ipmi::setDbusProperty(*getSdBus(), service, chassisStatePath, -+ chassisStateIntf, "RequestedPowerTransition", -+ request); -+ } -+ catch (std::exception& e) -+ { -+ log<level::ERR>( -+ "Failed to initiate transition", -+ entry("EXCEPTION=%s, REQUEST=%s", e.what(), request.c_str())); -+ return -1; -+ } -+ -+ return 0; -+} -+ - //------------------------------------------ - // Set Enabled property to inform NMI source - // handling to trigger a NMI_OUT BSOD. --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Fix-issues-and-support-signed-sensor-values.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Fix-issues-and-support-signed-sensor-values.patch deleted file mode 100644 index 6d13f9297..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Fix-issues-and-support-signed-sensor-values.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 8ce91a760fca8c945540679c92770f841629e179 Mon Sep 17 00:00:00 2001 -From: Tony Lee <tony.lee@quantatw.com> -Date: Thu, 31 Oct 2019 17:24:16 +0800 -Subject: [PATCH] Fix issues and support signed sensor values - -Sensor will get "disable" when the command "ipmitool sdr elist" is -executed that if sensorReadingType is 0x6F. - -sensor_units_1 is always set to 0 currently. To support the display of -signed sensor values, we add the attribute "sensorUnits1" to the sensor -mapping yaml. This attribute can be used to determine whether the -sensor is signed. - -It were making negative values 0 in get::readingData(). Fix the issue -by using a int32_t and add an overflow check. - -Change-Id: I705defcf18805db9ada7d0de0738a59aedab61df -Signed-off-by: Tony Lee <tony.lee@quantatw.com> ---- - include/ipmid/types.hpp | 2 ++ - scripts/sensor-example.yaml | 2 ++ - scripts/writesensor.mako.cpp | 2 ++ - sensordatahandler.cpp | 2 -- - sensordatahandler.hpp | 31 ++++++++++++++++++++++++++++--- - sensorhandler.cpp | 5 ++--- - 6 files changed, 36 insertions(+), 8 deletions(-) - -diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp -index e62c8192..bd1fac2b 100644 ---- a/include/ipmid/types.hpp -+++ b/include/ipmid/types.hpp -@@ -133,6 +133,7 @@ using Unit = std::string; - using EntityType = uint8_t; - using EntityInst = uint8_t; - using SensorName = std::string; -+using SensorUnits1 = uint8_t; - - enum class Mutability - { -@@ -167,6 +168,7 @@ struct Info - Exponent exponentR; - bool hasScale; - Scale scale; -+ SensorUnits1 sensorUnits1; - Unit unit; - std::function<uint8_t(SetSensorReadingReq&, const Info&)> updateFunc; - std::function<GetSensorResponse(const Info&)> getFunc; -diff --git a/scripts/sensor-example.yaml b/scripts/sensor-example.yaml -index 9760cd01..bddd2e6d 100644 ---- a/scripts/sensor-example.yaml -+++ b/scripts/sensor-example.yaml -@@ -112,6 +112,8 @@ - # Applies for analog sensors, the actual reading value for the sensor is - # Value * 10^N - scale: -3 -+ # Indicate Analog Data Format, Rate unit, Modifier unit and Percentage -+ sensorUnits1 : 0x80 - mutability: Mutability::Write|Mutability::Read - serviceInterface: org.freedesktop.DBus.Properties - readingType: readingData -diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp -index 8b268052..813f9404 100644 ---- a/scripts/writesensor.mako.cpp -+++ b/scripts/writesensor.mako.cpp -@@ -49,6 +49,7 @@ extern const IdInfoMap sensors = { - offsetB = sensor.get("offsetB", 0) - bExp = sensor.get("bExp", 0) - rExp = sensor.get("rExp", 0) -+ sensorUnits1 = sensor.get("sensorUnits1", 0) - unit = sensor.get("unit", "") - scale = sensor.get("scale", 0) - hasScale = "true" if "scale" in sensor.keys() else "false" -@@ -91,6 +92,7 @@ extern const IdInfoMap sensors = { - .exponentR = ${rExp}, - .hasScale = ${hasScale}, - .scale = ${scale}, -+ .sensorUnits1 = ${sensorUnits1}, - .unit = "${unit}", - .updateFunc = ${updateFunc}, - .getFunc = ${getFunc}, -diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp -index 06f5f429..fc74b8f8 100644 ---- a/sensordatahandler.cpp -+++ b/sensordatahandler.cpp -@@ -7,8 +7,6 @@ - #include <ipmid/types.hpp> - #include <ipmid/utils.hpp> - #include <optional> --#include <phosphor-logging/elog-errors.hpp> --#include <phosphor-logging/log.hpp> - #include <sdbusplus/message/types.hpp> - #include <xyz/openbmc_project/Common/error.hpp> - -diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp -index 5cad58c5..c48140a3 100644 ---- a/sensordatahandler.hpp -+++ b/sensordatahandler.hpp -@@ -8,6 +8,8 @@ - #include <ipmid/api.hpp> - #include <ipmid/types.hpp> - #include <ipmid/utils.hpp> -+#include <phosphor-logging/elog-errors.hpp> -+#include <phosphor-logging/log.hpp> - #include <sdbusplus/message/types.hpp> - - namespace ipmi -@@ -28,6 +30,7 @@ using ServicePath = std::pair<Path, Service>; - using Interfaces = std::vector<Interface>; - - using MapperResponseType = std::map<Path, std::map<Service, Interfaces>>; -+using namespace phosphor::logging; - - /** @brief get the D-Bus service and service path - * @param[in] bus - The Dbus bus object -@@ -225,10 +228,32 @@ GetSensorResponse readingData(const Info& sensorInfo) - - double value = std::get<T>(propValue) * - std::pow(10, sensorInfo.scale - sensorInfo.exponentR); -+ int32_t rawData = -+ (value - sensorInfo.scaledOffset) / sensorInfo.coefficientM; - -- auto rawData = static_cast<uint8_t>((value - sensorInfo.scaledOffset) / -- sensorInfo.coefficientM); -- setReading(rawData, &response); -+ constexpr uint8_t sensorUnitsSignedBits = 2 << 6; -+ constexpr uint8_t signedDataFormat = 0x80; -+ // if sensorUnits1 [7:6] = 10b, sensor is signed -+ if ((sensorInfo.sensorUnits1 & sensorUnitsSignedBits) == signedDataFormat) -+ { -+ if (rawData > std::numeric_limits<int8_t>::max() || -+ rawData < std::numeric_limits<int8_t>::lowest()) -+ { -+ log<level::ERR>("Value out of range"); -+ throw std::out_of_range("Value out of range"); -+ } -+ setReading(static_cast<int8_t>(rawData), &response); -+ } -+ else -+ { -+ if (rawData > std::numeric_limits<uint8_t>::max() || -+ rawData < std::numeric_limits<uint8_t>::lowest()) -+ { -+ log<level::ERR>("Value out of range"); -+ throw std::out_of_range("Value out of range"); -+ } -+ setReading(static_cast<uint8_t>(rawData), &response); -+ } - - return response; - } -diff --git a/sensorhandler.cpp b/sensorhandler.cpp -index 36998715..260331a0 100644 ---- a/sensorhandler.cpp -+++ b/sensorhandler.cpp -@@ -700,9 +700,8 @@ ipmi_ret_t populate_record_from_dbus(get_sdr::SensorDataFullRecordBody* body, - /* Functional sensor case */ - if (isAnalogSensor(info->propertyInterfaces.begin()->first)) - { -- -- body->sensor_units_1 = 0; // unsigned, no rate, no modifier, not a % -- -+ body->sensor_units_1 = info->sensorUnits1; // default is 0. unsigned, no -+ // rate, no modifier, not a % - /* Unit info */ - setUnitFieldsForObject(info, body); - --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Update-Host-State-Transition-function.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Update-Host-State-Transition-function.patch deleted file mode 100644 index 156327b9c..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Update-Host-State-Transition-function.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 8079e1e39e1953458bd2e59c7f546a3d879558db Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" <jason.m.bills@linux.intel.com> -Date: Thu, 30 Jan 2020 16:02:39 -0800 -Subject: [PATCH 2/3] Update Host State Transition function - -This updates the Host State Transition function to use the new -IPMI DBus APIs for transition requests. - -Tested: -Ran each IPMI chassis control command to confirm the expected -behavior: -ipmitool power on: system is powered-on -ipmitool power off: system is forced off -ipmitool power cycle: system is forced off then powered-on -ipmitool power reset: system is hard reset -ipmitool power soft: soft power-off requested from system software - -Change-Id: Id2253a9c0060e892bc318dd02a6221ac1a2ae2d9 -Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> ---- - chassishandler.cpp | 64 +++++++++++++--------------------------------- - 1 file changed, 18 insertions(+), 46 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index fdbb9fa5..af9cba72 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -811,59 +811,31 @@ ipmi::RspType<> ipmiSetChassisCap(bool intrusion, bool fpLockout, - //------------------------------------------ - // Calls into Host State Manager Dbus object - //------------------------------------------ --int initiate_state_transition(State::Host::Transition transition) -+int initiateHostStateTransition(State::Host::Transition transition) - { - // OpenBMC Host State Manager dbus framework -- constexpr auto HOST_STATE_MANAGER_ROOT = "/xyz/openbmc_project/state/host0"; -- constexpr auto HOST_STATE_MANAGER_IFACE = "xyz.openbmc_project.State.Host"; -- constexpr auto DBUS_PROPERTY_IFACE = "org.freedesktop.DBus.Properties"; -- constexpr auto PROPERTY = "RequestedHostTransition"; -+ constexpr auto hostStatePath = "/xyz/openbmc_project/state/host0"; -+ constexpr auto hostStateIntf = "xyz.openbmc_project.State.Host"; - -- // sd_bus error -- int rc = 0; -- char* busname = NULL; -- -- // SD Bus error report mechanism. -- sd_bus_error bus_error = SD_BUS_ERROR_NULL; -- -- // Gets a hook onto either a SYSTEM or SESSION bus -- sd_bus* bus_type = ipmid_get_sd_bus_connection(); -- rc = mapper_get_service(bus_type, HOST_STATE_MANAGER_ROOT, &busname); -- if (rc < 0) -- { -- log<level::ERR>( -- "Failed to get bus name", -- entry("ERRNO=0x%X, OBJPATH=%s", -rc, HOST_STATE_MANAGER_ROOT)); -- return rc; -- } -+ auto service = ipmi::getService(*getSdBus(), hostStateIntf, hostStatePath); - - // Convert to string equivalent of the passed in transition enum. - auto request = State::convertForMessage(transition); - -- rc = sd_bus_call_method(bus_type, // On the system bus -- busname, // Service to contact -- HOST_STATE_MANAGER_ROOT, // Object path -- DBUS_PROPERTY_IFACE, // Interface name -- "Set", // Method to be called -- &bus_error, // object to return error -- nullptr, // Response buffer if any -- "ssv", // Takes 3 arguments -- HOST_STATE_MANAGER_IFACE, PROPERTY, "s", -- request.c_str()); -- if (rc < 0) -+ try - { -- log<level::ERR>("Failed to initiate transition", -- entry("ERRNO=0x%X, REQUEST=%s", -rc, request.c_str())); -+ ipmi::setDbusProperty(*getSdBus(), service, hostStatePath, -+ hostStateIntf, "RequestedHostTransition", -+ request); - } -- else -+ catch (std::exception& e) - { -- log<level::INFO>("Transition request initiated successfully"); -+ log<level::ERR>( -+ "Failed to initiate transition", -+ entry("EXCEPTION=%s, REQUEST=%s", e.what(), request.c_str())); -+ return -1; - } -- -- sd_bus_error_free(&bus_error); -- free(busname); -- -- return rc; -+ return 0; - } - - //------------------------------------------ -@@ -1411,7 +1383,7 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - switch (chassisControl) - { - case CMD_POWER_ON: -- rc = initiate_state_transition(State::Host::Transition::On); -+ rc = initiateHostStateTransition(State::Host::Transition::On); - break; - case CMD_POWER_OFF: - // This path would be hit in 2 conditions. -@@ -1439,7 +1411,7 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - indicate_no_softoff_needed(); - - // Now request the shutdown -- rc = initiate_state_transition(State::Host::Transition::Off); -+ rc = initiateHostStateTransition(State::Host::Transition::Off); - } - else - { -@@ -1460,12 +1432,12 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - // originating via a soft power off SMS request) - indicate_no_softoff_needed(); - -- rc = initiate_state_transition(State::Host::Transition::Reboot); -+ rc = initiateHostStateTransition(State::Host::Transition::Reboot); - break; - - case CMD_SOFT_OFF_VIA_OVER_TEMP: - // Request Host State Manager to do a soft power off -- rc = initiate_state_transition(State::Host::Transition::Off); -+ rc = initiateHostStateTransition(State::Host::Transition::Off); - break; - - case CMD_PULSE_DIAGNOSTIC_INTR: --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Update-IPMI-Chassis-Control-command-transition-reque.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Update-IPMI-Chassis-Control-command-transition-reque.patch deleted file mode 100644 index 271af3f5b..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Update-IPMI-Chassis-Control-command-transition-reque.patch +++ /dev/null @@ -1,180 +0,0 @@ -From 291629d5c3e5bea31925c9d025688897c90eb783 Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" <jason.m.bills@linux.intel.com> -Date: Thu, 30 Jan 2020 16:22:24 -0800 -Subject: [PATCH 3/3] Update IPMI Chassis Control command transition requests - -This change updates the IPMI Chassis Control command to use the new -host state transitions and chassis off transition based on the -mapping in the design document below. This allows each chassis -control action to more closely follow the behavior defined in the -IPMI spec. - -ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/22358 - -Tested: -Ran each IPMI chassis control command to confirm the expected -behavior: -ipmitool power on: system is powered-on using Host.On -ipmitool power off: system is forced off using Chassis.Off -ipmitool power cycle: system is forced off then powered-on using - Host.Reboot -ipmitool power reset: system is hard reset using Host.ForceWarmReboot -ipmitool power soft: soft power-off requested from system software - using Host.Off - -Change-Id: Ieb42722102fde0e51a49dc4aaa3ff227a3394066 -Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> ---- - chassishandler.cpp | 121 ++------------------------------------------- - 1 file changed, 5 insertions(+), 116 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index af9cba72..663081de 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -1301,76 +1301,6 @@ ipmi::RspType<uint4_t, // Restart Cause - return ipmi::responseSuccess(cause.value(), reserved, channel); - } - --//------------------------------------------------------------- --// Send a command to SoftPowerOff application to stop any timer --//------------------------------------------------------------- --int stop_soft_off_timer() --{ -- constexpr auto iface = "org.freedesktop.DBus.Properties"; -- constexpr auto soft_off_iface = "xyz.openbmc_project.Ipmi.Internal." -- "SoftPowerOff"; -- -- constexpr auto property = "ResponseReceived"; -- constexpr auto value = "xyz.openbmc_project.Ipmi.Internal." -- "SoftPowerOff.HostResponse.HostShutdown"; -- -- // Get the system bus where most system services are provided. -- auto bus = ipmid_get_sd_bus_connection(); -- -- // Get the service name -- // TODO openbmc/openbmc#1661 - Mapper refactor -- // -- // See openbmc/openbmc#1743 for some details but high level summary is that -- // for now the code will directly call the soft off interface due to a -- // race condition with mapper usage -- // -- // char *busname = nullptr; -- // auto r = mapper_get_service(bus, SOFTOFF_OBJPATH, &busname); -- // if (r < 0) -- //{ -- // fprintf(stderr, "Failed to get %s bus name: %s\n", -- // SOFTOFF_OBJPATH, -r); -- // return r; -- //} -- -- // No error object or reply expected. -- int rc = sd_bus_call_method(bus, SOFTOFF_BUSNAME, SOFTOFF_OBJPATH, iface, -- "Set", nullptr, nullptr, "ssv", soft_off_iface, -- property, "s", value); -- if (rc < 0) -- { -- log<level::ERR>("Failed to set property in SoftPowerOff object", -- entry("ERRNO=0x%X", -rc)); -- } -- -- // TODO openbmc/openbmc#1661 - Mapper refactor -- // free(busname); -- return rc; --} -- --//---------------------------------------------------------------------- --// Create file to indicate there is no need for softoff notification to host --//---------------------------------------------------------------------- --void indicate_no_softoff_needed() --{ -- fs::path path{HOST_INBAND_REQUEST_DIR}; -- if (!fs::is_directory(path)) -- { -- fs::create_directory(path); -- } -- -- // Add the host instance (default 0 for now) to the file name -- std::string file{HOST_INBAND_REQUEST_FILE}; -- auto size = std::snprintf(nullptr, 0, file.c_str(), 0); -- size++; // null -- std::unique_ptr<char[]> buf(new char[size]); -- std::snprintf(buf.get(), size, file.c_str(), 0); -- -- // Append file name to directory and create it -- path /= buf.get(); -- std::ofstream(path.c_str()); --} -- - /** @brief Implementation of chassis control command - * - * @param - chassisControl command byte -@@ -1386,60 +1316,19 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - rc = initiateHostStateTransition(State::Host::Transition::On); - break; - case CMD_POWER_OFF: -- // This path would be hit in 2 conditions. -- // 1: When user asks for power off using ipmi chassis command 0x04 -- // 2: Host asking for power off post shutting down. -- -- // If it's a host requested power off, then need to nudge Softoff -- // application that it needs to stop the watchdog timer if running. -- // If it is a user requested power off, then this is not really -- // needed. But then we need to differentiate between user and host -- // calling this same command -- -- // For now, we are going ahead with trying to nudge the soft off and -- // interpret the failure to do so as a non softoff case -- rc = stop_soft_off_timer(); -- -- // Only request the Off transition if the soft power off -- // application is not running -- if (rc < 0) -- { -- // First create a file to indicate to the soft off application -- // that it should not run. Not doing this will result in State -- // manager doing a default soft power off when asked for power -- // off. -- indicate_no_softoff_needed(); -- -- // Now request the shutdown -- rc = initiateHostStateTransition(State::Host::Transition::Off); -- } -- else -- { -- log<level::INFO>("Soft off is running, so let shutdown target " -- "stop the host"); -- } -+ rc = -+ initiateChassisStateTransition(State::Chassis::Transition::Off); - break; -- - case CMD_HARD_RESET: -+ rc = initiateHostStateTransition( -+ State::Host::Transition::ForceWarmReboot); -+ break; - case CMD_POWER_CYCLE: -- // SPEC has a section that says certain implementations can trigger -- // PowerOn if power is Off when a command to power cycle is -- // requested -- -- // First create a file to indicate to the soft off application -- // that it should not run since this is a direct user initiated -- // power reboot request (i.e. a reboot request that is not -- // originating via a soft power off SMS request) -- indicate_no_softoff_needed(); -- - rc = initiateHostStateTransition(State::Host::Transition::Reboot); - break; -- - case CMD_SOFT_OFF_VIA_OVER_TEMP: -- // Request Host State Manager to do a soft power off - rc = initiateHostStateTransition(State::Host::Transition::Off); - break; -- - case CMD_PULSE_DIAGNOSTIC_INTR: - rc = setNmiProperty(true); - break; --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend index af5fb1356..78fa57039 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -1,12 +1,7 @@ DEPENDS_append_gbs = " gbs-yaml-config" FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://gbs-ipmid-whitelist.conf \ - file://0001-Add-Chassis-State-Transition-interface.patch \ - file://0002-Update-Host-State-Transition-function.patch \ - file://0003-Update-IPMI-Chassis-Control-command-transition-reque.patch \ - file://0001-Fix-issues-and-support-signed-sensor-values.patch \ - " +SRC_URI_append_gbs = " file://gbs-ipmid-whitelist.conf" WHITELIST_CONF_gbs = "${WORKDIR}/gbs-ipmid-whitelist.conf" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf index 0f4083416..70783a8c4 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf @@ -1,2 +1,7 @@ [Unit] StartLimitBurst=10 + +[Service] +RestartSec=3s +ExecStartPre=mapper get-service /xyz/openbmc_project/led/physical/heartbeat +ExecStartPre=mapper get-service /xyz/openbmc_project/led/physical/sys_boot_status diff --git a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-gbs-apps.bb b/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-gbs-apps.bb deleted file mode 100644 index 20c81ad94..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-gbs-apps.bb +++ /dev/null @@ -1,36 +0,0 @@ -SUMMARY = "OpenBMC for GBS system - Applications" -PR = "r1" - -inherit packagegroup - -PROVIDES = "${PACKAGES}" -PACKAGES = " \ - ${PN}-chassis \ - ${PN}-fans \ - ${PN}-flash \ - " - -PROVIDES += "virtual/obmc-chassis-mgmt" -PROVIDES += "virtual/obmc-fan-mgmt" -PROVIDES += "virtual/obmc-flash-mgmt" - -RPROVIDES_${PN}-chassis += "virtual-obmc-chassis-mgmt" -RPROVIDES_${PN}-fans += "virtual-obmc-fan-mgmt" -RPROVIDES_${PN}-flash += "virtual-obmc-flash-mgmt" - -SUMMARY_${PN}-chassis = "GBS Chassis" -RDEPENDS_${PN}-chassis = " \ - x86-power-control \ - " - -SUMMARY_${PN}-fans = "GBS Fans" -RDEPENDS_${PN}-fans = " \ - phosphor-pid-control \ - " - -SUMMARY_${PN}-flash = "GBS Flash" -RDEPENDS_${PN}-flash = " \ - phosphor-ipmi-flash \ - gbs-bmc-update \ - virtual/bios-update \ - " diff --git a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-obmc-apps%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-obmc-apps%.bbappend deleted file mode 100644 index 73e9b0aa4..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-obmc-apps%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -RDEPENDS_${PN}-fru-ipmi_remove_gbs = "fru-device" -RDEPENDS_${PN}-ikvm_remove_gbs = "obmc-ikvm" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/0002-Add-power-on-monitor-mechanism.patch b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/0002-Add-power-on-monitor-mechanism.patch deleted file mode 100644 index a3718ea2a..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/0002-Add-power-on-monitor-mechanism.patch +++ /dev/null @@ -1,269 +0,0 @@ -From 5cea18ba476c0cb6ea622be50a09ead00cd47b14 Mon Sep 17 00:00:00 2001 -From: Ivan Li <rli11@lenovo.com> -Date: Wed, 25 Dec 2019 17:05:00 +0800 -Subject: [PATCH] Add power on monitor mechanism - -Summary: -1. Add "PWRONMON" attribute in sensor configuration file to determine whether it's power-on monitor sensor or not. (i.e. PWRONMON_temp1 = "ON") -2. Watching "CurrentHostState" property and then use it to turn on/off threshold alert for power-on monitor sensors. - -Test Plan: -Check if there is any abnormal threshold events occurred in power off state or during power transition - -Signed-off-by: Ivan Li <rli11@lenovo.com> -Change-Id: I76d3a664153141d94636e0011f3a48e4f6dee922 ---- - mainloop.cpp | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ - sensor.cpp | 11 +++++- - sensor.hpp | 13 +++++++ - thresholds.hpp | 24 ------------ - 4 files changed, 125 insertions(+), 25 deletions(-) - -diff --git a/mainloop.cpp b/mainloop.cpp -index 29dc26a..5e27a30 100644 ---- a/mainloop.cpp -+++ b/mainloop.cpp -@@ -42,6 +42,13 @@ - #include <string> - #include <unordered_set> - #include <xyz/openbmc_project/Sensor/Device/error.hpp> -+#include <boost/asio/io_service.hpp> -+#include <boost/container/flat_map.hpp> -+#include <boost/algorithm/string/predicate.hpp> -+#include <sdbusplus/asio/connection.hpp> -+#include <sdbusplus/asio/object_server.hpp> -+#include <sdbusplus/message/types.hpp> -+#include <sdbusplus/timer.hpp> - - using namespace phosphor::logging; - -@@ -110,6 +117,12 @@ decltype(Thresholds<CriticalObject>::deassertHighSignal) - Thresholds<CriticalObject>::deassertHighSignal = - &CriticalObject::criticalHighAlarmDeasserted; - -+static std::unique_ptr<phosphor::Timer> cacheTimer = nullptr; -+static std::unique_ptr<sdbusplus::bus::match::match> powerMatch = nullptr; -+static bool powerStatusOn = false; -+static boost::asio::io_service io; -+static auto conn = std::make_shared<sdbusplus::asio::connection>(io); -+ - void updateSensorInterfaces(InterfaceMap& ifaces, SensorValueType value) - { - for (auto& iface : ifaces) -@@ -137,6 +150,83 @@ void updateSensorInterfaces(InterfaceMap& ifaces, SensorValueType value) - } - } - -+void powerStatusSet() -+{ -+ powerStatusOn = true; -+ return; -+} -+ -+void createTimer() -+{ -+ if (cacheTimer == nullptr) -+ { -+ cacheTimer = std::make_unique<phosphor::Timer>(powerStatusSet); -+ } -+} -+ -+bool isPowerOn(void) -+{ -+ if (!powerMatch) -+ { -+ throw std::runtime_error("Power Match Not Created"); -+ } -+ return powerStatusOn; -+} -+ -+void setupPowerMatch(sdbusplus::bus::bus& bus) -+{ -+ if (powerMatch) -+ { -+ return; -+ } -+ -+ powerMatch = std::make_unique<sdbusplus::bus::match::match>( -+ bus, -+ "type='signal',interface='org.freedesktop.DBus.Properties',path='/xyz/" -+ "openbmc_project/state/" -+ "host0',arg0='xyz.openbmc_project.State.Host'", -+ [](sdbusplus::message::message& message) { -+ std::string objectName; -+ boost::container::flat_map<std::string, std::variant<std::string>> -+ values; -+ message.read(objectName, values); -+ auto findState = values.find("CurrentHostState"); -+ if (findState != values.end()) -+ { -+ bool on = boost::ends_with( -+ std::get<std::string>(findState->second), "Running"); -+ if (!on) -+ { -+ cacheTimer->stop(); -+ powerStatusOn = false; -+ return; -+ } -+ cacheTimer->start(std::chrono::duration_cast<std::chrono::microseconds>( -+ std::chrono::seconds(10))); -+ } -+ else { -+ powerStatusOn = false; -+ } -+ }); -+ -+ conn->async_method_call( -+ [](boost::system::error_code ec, -+ const std::variant<std::string>& state) { -+ if (ec) -+ { -+ return; -+ } -+ powerStatusOn = -+ boost::ends_with(std::get<std::string>(state), "Running"); -+ }, -+ "xyz.openbmc_project.State.Host", -+ "/xyz/openbmc_project/state/host0", -+ "org.freedesktop.DBus.Properties", "Get", -+ "xyz.openbmc_project.State.Host", "CurrentHostState"); -+ -+ createTimer(); -+} -+ - std::string MainLoop::getID(SensorSet::container_t::const_reference sensor) - { - std::string id; -@@ -418,6 +508,7 @@ void MainLoop::init() - _interval = std::strtoull(interval.c_str(), NULL, 10); - } - } -+ setupPowerMatch(_bus); - } - - void MainLoop::read() -@@ -462,6 +553,12 @@ void MainLoop::read() - - try - { -+ if(sensor->pwrOnMonitor() && !isPowerOn()) -+ { -+ statusIface->functional(false); -+ continue; -+ } -+ - if (sensor->hasFaultFile()) - { - auto fault = _ioAccess->read(sensorSysfsType, sensorSysfsNum, -@@ -588,6 +685,11 @@ void MainLoop::read() - } - } - -+ if(sensor->pwrOnMonitor() && !isPowerOn()) -+ { -+ statusIface->functional(false); -+ continue; -+ } - updateSensorInterfaces(obj, value); - } - catch (const std::system_error& e) -diff --git a/sensor.cpp b/sensor.cpp -index ac2f896..72b45f8 100644 ---- a/sensor.cpp -+++ b/sensor.cpp -@@ -32,7 +32,7 @@ Sensor::Sensor(const SensorSet::key_type& sensor, - const hwmonio::HwmonIOInterface* ioAccess, - const std::string& devPath) : - _sensor(sensor), -- _ioAccess(ioAccess), _devPath(devPath), _scale(0), _hasFaultFile(false) -+ _ioAccess(ioAccess), _devPath(devPath), _scale(0), _hasFaultFile(false), _pwrOnMonitor(false) - { - auto chip = env::getEnv("GPIOCHIP", sensor); - auto access = env::getEnv("GPIO", sensor); -@@ -61,6 +61,15 @@ Sensor::Sensor(const SensorSet::key_type& sensor, - auto senRmRCs = env::getEnv("REMOVERCS", sensor); - // Add sensor removal return codes defined per sensor - addRemoveRCs(senRmRCs); -+ -+ auto pwrOnMon = env::getEnv("PWRONMON", sensor); -+ if (!pwrOnMon.empty()) -+ { -+ if (pwrOnMon == "ON") -+ { -+ _pwrOnMonitor = true; -+ } -+ } - } - - void Sensor::addRemoveRCs(const std::string& rcList) -diff --git a/sensor.hpp b/sensor.hpp -index 64d6e48..41c0fe7 100644 ---- a/sensor.hpp -+++ b/sensor.hpp -@@ -151,6 +151,16 @@ class Sensor - return _hasFaultFile; - } - -+ /** -+ * @brief Get whether the sensor only need to be monitored in power on state or not. -+ * -+ * @return - Boolean on whether the sensor only need to be monitored in power on state -+ */ -+ inline bool pwrOnMonitor(void) const -+ { -+ return _pwrOnMonitor; -+ } -+ - private: - /** @brief Sensor object's identifiers */ - SensorSet::key_type _sensor; -@@ -172,6 +182,9 @@ class Sensor - - /** @brief Tracks whether the sensor has a fault file or not. */ - bool _hasFaultFile; -+ -+ /** @brief Whether the sensor only need to be monitored in power on state or not. */ -+ bool _pwrOnMonitor; - }; - - /** -diff --git a/thresholds.hpp b/thresholds.hpp -index 8d557fc..0ffe0ce 100644 ---- a/thresholds.hpp -+++ b/thresholds.hpp -@@ -137,32 +137,8 @@ auto addThreshold(const std::string& sensorType, const std::string& sensorID, - auto hi = stod(tHi) * std::pow(10, scale); - (*iface.*Thresholds<T>::setLo)(lo); - (*iface.*Thresholds<T>::setHi)(hi); -- auto alarmLowState = (*iface.*Thresholds<T>::getAlarmLow)(); -- auto alarmHighState = (*iface.*Thresholds<T>::getAlarmHigh)(); - (*iface.*Thresholds<T>::alarmLo)(value <= lo); - (*iface.*Thresholds<T>::alarmHi)(value >= hi); -- if (alarmLowState != (value <= lo)) -- { -- if (value <= lo) -- { -- (*iface.*Thresholds<T>::assertLowSignal)(value); -- } -- else -- { -- (*iface.*Thresholds<T>::deassertLowSignal)(value); -- } -- } -- if (alarmHighState != (value >= hi)) -- { -- if (value >= hi) -- { -- (*iface.*Thresholds<T>::assertHighSignal)(value); -- } -- else -- { -- (*iface.*Thresholds<T>::deassertHighSignal)(value); -- } -- } - auto type = Thresholds<T>::type; - obj[type] = iface; - } --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf index 427cdabe0..3627aecac 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf @@ -22,9 +22,9 @@ PWRONMON_in2 = "ON" LABEL_curr1 = "p12v_fan_in" CRITHI_curr1 = "30000" -CRITLO_curr1 = "0" +CRITLO_curr1 = "-1000" WARNHI_curr1 = "30000" -WARNLO_curr1 = "0" +WARNLO_curr1 = "-1000" MINVALUE_curr1 = "0" MAXVALUE_curr1 = "35" # READ_Iin is direct value*0.5 @@ -33,9 +33,9 @@ PWRONMON_curr1 = "ON" LABEL_curr2 = "p12v_fan_out" CRITHI_curr2 = "100000" -CRITLO_curr2 = "0" +CRITLO_curr2 = "-1000" WARNHI_curr2 = "100000" -WARNLO_curr2 = "0" +WARNLO_curr2 = "-1000" MINVALUE_curr2 = "0" MAXVALUE_curr2 = "150" PWRONMON_curr2 = "ON" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend index 22b31cfb9..7307de7fa 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend @@ -1,7 +1,6 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://0002-Add-power-on-monitor-mechanism.patch \ - " +DEPENDS += "boost" GBS_NAMES = " \ i2c@82000/sbtsi@4c \ diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json index 306e74e2a..4c1e3d8d0 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json @@ -163,12 +163,12 @@ ], "threshold": [ { - "criticalHigh": 77, + "criticalHigh": 72, "criticalLow": 0, - "warningHigh": 77, + "warningHigh": 72, "warningLow": 0, "maxValue": 127, "minValue": -128 } ] -}
\ No newline at end of file +} diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace index bffb6d154..8e7153fe4 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace @@ -5,8 +5,10 @@ After=obmc-mapper.target After=mapper-wait@-xyz-openbmc_project-sensors-temperature-inlet.service After=mapper-wait@-xyz-openbmc_project-sensors-temperature-outlet_0.service After=mapper-wait@-xyz-openbmc_project-sensors-temperature-outlet_1.service +StartLimitBurst=10 [Service] +Restart=always ExecStart=/usr/bin/virtual-sensor Type=dbus BusName=xyz.openbmc_project.VirtualSensor diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh deleted file mode 100644 index 604eafccc..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -serviceName="xyz.openbmc_project.VirtualSensor" -interfaceName="xyz.openbmc_project.Sensor.Value" -objectPath="/xyz/openbmc_project/sensors/temperature/" - -# set MaxValue, MinValue to sensor dbus property -for i in {0..2}; do - sensorPath="${objectPath}i2cool_${i}" - mapper wait $sensorPath - busctl set-property $serviceName $sensorPath $interfaceName MaxValue d 127 - busctl set-property $serviceName $sensorPath $interfaceName MinValue d -- -128 -done - -exit 0 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 index 27c438d90..c0f04ef03 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 +++ b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 @@ -3,6 +3,3 @@ SERVICE=xyz.openbmc_project.Watchdog UNIT_HARD_RESET=phosphor-host-watchdog-reset.service UNIT_POWER_OFF=phosphor-host-watchdog-poweroff.service UNIT_POWER_CYCLE=phosphor-host-watchdog-powercycle.service -FALLBACK_ACTION=xyz.openbmc_project.State.Watchdog.Action.PowerCycle -FALLBACK_INTERVAL=180000 -MIN_INTERVAL=60000 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service index 4577cd1c1..df11b22e5 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service +++ b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service @@ -4,8 +4,7 @@ Description=Phosphor Watchdog [Service] EnvironmentFile={envfiledir}/obmc/watchdog/%I ExecStart=/usr/bin/env phosphor-watchdog --service=${{SERVICE}} --path=${{DEVPATH}} \ - --continue --fallback_always --min_interval=${{MIN_INTERVAL}} \ - --fallback_action=${{FALLBACK_ACTION}} --fallback_interval=${{FALLBACK_INTERVAL}} \ + --continue \ --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=${{UNIT_HARD_RESET}} \ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=${{UNIT_POWER_OFF}} \ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=${{UNIT_POWER_CYCLE}} |