diff options
author | Samuel Jiang <Samuel.Jiang@quantatw.com> | 2019-10-18 03:56:58 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-11-18 22:12:20 +0300 |
commit | aa2b3f294df9126d5b6044e7a6e1b64514974a16 (patch) | |
tree | 317cc3359a34d76e6f0791f66996941f3b31b065 /meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans | |
parent | 782fc3530aa3f0f0efbf2217841956c3f301767d (diff) | |
download | openbmc-aa2b3f294df9126d5b6044e7a6e1b64514974a16.tar.xz |
meta-quanta: meta-runbmc-nuvoton: rename meta-olympus-nuvoton
For avoid confusing this layer only with RUNBMC module
(https://www.opencompute.org/documents/ocp-runbmc-daughterboard-card-
design-specification-v1-4-1-pdf)
The meta-runbmc-nuvoton will rename meta-olympus-nuvoton.
That means the Quanta Olympus product with RUNBMC module which based on
Nuvoton SoC.
The layer configuration will binding Olympus product hardware design.
(From meta-quanta rev: f4a8e7ae48dc788fa7e52f024578c67f164c8620)
Change-Id: I6faa1bfbb3b8f033239fea3c41e8b8ed18fc492d
Signed-off-by: Samuel Jiang <Samuel.Jiang@quantatw.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans')
5 files changed, 457 insertions, 0 deletions
diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/config-olympus-nuvoton.json b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/config-olympus-nuvoton.json new file mode 100644 index 000000000..5a78db6ee --- /dev/null +++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/config-olympus-nuvoton.json @@ -0,0 +1,400 @@ +{ + "sensors" : [ + { + "name": "fan1", + "type": "fan", + "readPath": "/xyz/openbmc_project/sensors/fan_tach/fan1", + "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm1", + "min": 0, + "max": 255 + }, + { + "name": "Core_0_CPU0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_0_CPU0", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_0_CPU1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_0_CPU1", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_1_CPU0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_1_CPU0", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_1_CPU1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_1_CPU1", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_2_CPU0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_2_CPU0", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_2_CPU1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_2_CPU1", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_3_CPU0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_3_CPU0", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_3_CPU1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_3_CPU1", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_4_CPU0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_4_CPU0", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_4_CPU1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_4_CPU1", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_5_CPU0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_5_CPU0", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + }, + { + "name": "Core_5_CPU1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/Core_5_CPU1", + "writePath": "", + "min": 0, + "max": 0, + "timeout": 0 + } + ], + "zones" : [ + { + "id": 0, + "minThermalOutput": 0.0, + "failsafePercent": 100.0, + "pids": [ + { + "name": "fan1", + "type": "fan", + "inputs": ["fan1"], + "setpoint": 40.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": 0.0, + "integralCoeff": 0.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 1.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 3.0, + "outLim_max": 100.0, + "slewNeg": 0.0, + "slewPos": 0.0 + } + }, + { + "name": "Core_0_CPU0", + "type": "temp", + "inputs": ["Core_0_CPU0"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_0_CPU1", + "type": "temp", + "inputs": ["Core_0_CPU1"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_1_CPU0", + "type": "temp", + "inputs": ["Core_1_CPU0"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_1_CPU1", + "type": "temp", + "inputs": ["Core_1_CPU1"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_2_CPU0", + "type": "temp", + "inputs": ["Core_2_CPU0"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_2_CPU1", + "type": "temp", + "inputs": ["Core_2_CPU1"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_3_CPU0", + "type": "temp", + "inputs": ["Core_3_CPU0"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_3_CPU1", + "type": "temp", + "inputs": ["Core_3_CPU1"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_4_CPU0", + "type": "temp", + "inputs": ["Core_4_CPU0"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_4_CPU1", + "type": "temp", + "inputs": ["Core_4_CPU1"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_5_CPU0", + "type": "temp", + "inputs": ["Core_5_CPU0"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + }, + { + "name": "Core_5_CPU1", + "type": "temp", + "inputs": ["Core_5_CPU1"], + "setpoint": 30.0, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -20.0, + "integralCoeff": -0.1, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 0.0, + "integralLimit_max": 0.0, + "outLim_min": 0.0, + "outLim_max": 16000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 1.0, + "negativeHysteresis": 1.0 + } + } + ] + } + ] +} diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh new file mode 100644 index 000000000..9a0d8e2e7 --- /dev/null +++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-full-speed.sh @@ -0,0 +1,3 @@ +#!bin/bash + +echo 255 > /sys/class/hwmon/*/pwm1 diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service new file mode 100644 index 000000000..3ce2e01b0 --- /dev/null +++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service @@ -0,0 +1,12 @@ +[Unit] +Description=Set Fan to Full Speed as Rebooting +DefaultDependencies=no +After=shutdown.target + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=/usr/bin/fan-full-speed.sh + +[Install] +WantedBy=shutdown.target diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service new file mode 100644 index 000000000..57ae69c56 --- /dev/null +++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service @@ -0,0 +1,13 @@ +[Unit] +Description=OpenBMC Fan Control Daemon + +[Service] +Type=simple +ExecStart=/usr/bin/swampd +Restart=always +RestartSec=5 +StartLimitInterval=0 +ExecStopPost=/usr/bin/fan-full-speed.sh + +[Install] +WantedBy=basic.target diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control_%.bbappend new file mode 100644 index 000000000..a61181dcb --- /dev/null +++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -0,0 +1,29 @@ +FILESEXTRAPATHS_prepend_olympus-nuvoton := "${THISDIR}/${PN}:" + +SRC_URI_append_olympus-nuvoton = " file://config-olympus-nuvoton.json" +SRC_URI_append_olympus-nuvoton = " file://fan-full-speed.sh" +SRC_URI_append_olympus-nuvoton = " file://phosphor-pid-control.service" +SRC_URI_append_olympus-nuvoton = " file://fan-reboot-control.service" + +FILES_${PN}_append_olympus-nuvoton = " ${bindir}/fan-full-speed.sh" +FILES_${PN}_append_olympus-nuvoton = " ${datadir}/swampd/config.json" + +RDEPENDS_${PN} += "bash" + +SYSTEMD_SERVICE_${PN}_append_olympus-nuvoton = " phosphor-pid-control.service" +SYSTEMD_SERVICE_${PN}_append_olympus-nuvoton = " fan-reboot-control.service" + +do_install_append_olympus-nuvoton() { + install -d ${D}/${bindir} + install -m 0755 ${WORKDIR}/fan-full-speed.sh ${D}/${bindir} + + install -d ${D}${datadir}/swampd + install -m 0644 -D ${WORKDIR}/config-olympus-nuvoton.json \ + ${D}${datadir}/swampd/config.json + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/phosphor-pid-control.service \ + ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/fan-reboot-control.service \ + ${D}${systemd_unitdir}/system +} |