summaryrefslogtreecommitdiff
path: root/meta-quanta
diff options
context:
space:
mode:
Diffstat (limited to 'meta-quanta')
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/detect-fan-fail.bb26
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.service11
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.sh58
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service11
-rw-r--r--meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb27
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-2ssd.json412
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-8ssd.json928
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-boot-control.service10
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-control.sh39
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh5
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service12
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service14
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control_%.bbappend40
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/images/obmc-phosphor-image.bbappend2
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf38
-rw-r--r--meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend4
16 files changed, 1616 insertions, 21 deletions
diff --git a/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/detect-fan-fail.bb b/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/detect-fan-fail.bb
new file mode 100644
index 000000000..86303c359
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/detect-fan-fail.bb
@@ -0,0 +1,26 @@
+SUMMARY = "OpenBMC Quanta Detect Fan Fail Service"
+DESCRIPTION = "OpenBMC Quanta Detect Fan Fail Daemon."
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit systemd
+
+DEPENDS += "systemd"
+RDEPENDS_${PN} += "bash"
+
+FILESEXTRAPATHS_append_gsj := "${THISDIR}/files:"
+SRC_URI_append_gsj = " file://detect-fan-fail.sh \
+ file://detect-fan-fail.service \
+ "
+
+do_install_append_gsj() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/detect-fan-fail.sh ${D}${bindir}/
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/detect-fan-fail.service ${D}${systemd_unitdir}/system
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "detect-fan-fail.service"
diff --git a/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.service b/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.service
new file mode 100644
index 000000000..0ccafe35d
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Detect Fan Fail Manager
+After=phosphor-pid-control.service
+
+[Service]
+ExecStart=/usr/bin/detect-fan-fail.sh
+Restart=always
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.sh b/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.sh
new file mode 100644
index 000000000..80f1f69c5
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/detect-fan-fail/files/detect-fan-fail.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# get fan state by d-bus command
+function get_fan_state() {
+ get_property_path='xyz.openbmc_project.Sensor.Threshold.Critical CriticalAlarmLow'
+ fan_state="$(busctl get-property $1 $2 $get_property_path | awk '{print $2}')"
+ echo "$fan_state"
+}
+
+# set fan pwm by d-bus command
+function set_fan_value() {
+ set_property_path='xyz.openbmc_project.Control.FanPwm'
+ busctl set-property $1 $2 $set_property_path Target t 255
+}
+
+fan_tach_path=( '/xyz/openbmc_project/sensors/fan_tach/Fan0_0_RPM'
+ '/xyz/openbmc_project/sensors/fan_tach/Fan0_1_RPM'
+ '/xyz/openbmc_project/sensors/fan_tach/Fan1_0_RPM'
+ '/xyz/openbmc_project/sensors/fan_tach/Fan1_1_RPM'
+ '/xyz/openbmc_project/sensors/fan_tach/Fan2_0_RPM'
+ '/xyz/openbmc_project/sensors/fan_tach/Fan2_1_RPM'
+ )
+
+check_fail_flag=0
+current_fan_state=()
+while true; do
+ hwmon_path="$(mapper get-service ${fan_tach_path[0]})"
+ for i in ${!fan_tach_path[@]};
+ do
+ current_fan_state[$i%2]=$(get_fan_state $hwmon_path ${fan_tach_path[$i]})
+
+ #Compare state of dual rotors with CriticalAlarmLow to check if fan fail
+ if [ ${#current_fan_state[@]} -eq 2 ];then
+ if [ "${current_fan_state[0]}" == "true" ] && \
+ [ "${current_fan_state[1]}" == "true" ] ;then
+ if [ $check_fail_flag -eq 0 ];then
+ systemctl stop phosphor-pid-control
+ for j in ${!fan_tach_path[@]};
+ do
+ #If fan fail is detect, set other fan rpm to pwm 255.
+ set_fan_value $hwmon_path ${fan_tach_path[$j]}
+ check_fail_flag=1
+ done
+ fi
+ current_fan_state=()
+ break
+ fi
+ current_fan_state=()
+ fi
+
+ #fans are going to normal.
+ if [ $i -eq $((${#fan_tach_path[@]}-1)) ] && [ $check_fail_flag -eq 1 ]; then
+ check_fail_flag=0
+ systemctl restart phosphor-pid-control
+ fi
+ done
+ sleep 2
+done
diff --git a/meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service b/meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service
new file mode 100644
index 000000000..e18d69493
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/mac-address/files/mac-address.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Initialize MAC Address
+Before=usb_network.service network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/mac-address
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb b/meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb
new file mode 100644
index 000000000..8d3fbf376
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-gsj/mac-address/mac-address.bb
@@ -0,0 +1,27 @@
+SRC_URI = "git://github.com/quanta-bmc/mac-address.git;protocol=git"
+SRCREV = "${AUTOREV}"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${QUANTABASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit autotools pkgconfig
+inherit systemd
+
+DEPENDS += "systemd"
+DEPENDS += "autoconf-archive-native"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append = " file://mac-address.service"
+
+HASHSTYLE = "gnu"
+S = "${WORKDIR}/git"
+CXXFLAGS += "-std=c++17"
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/mac-address.service \
+ ${D}${systemd_unitdir}/system
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} += "mac-address.service" \ No newline at end of file
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-2ssd.json b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-2ssd.json
new file mode 100644
index 000000000..a4552bc5b
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-2ssd.json
@@ -0,0 +1,412 @@
+{
+ "sensors" : [
+ {
+ "name": "Fan0_0_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan0_0_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm1",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan0_1_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan0_1_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm1",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan1_0_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan1_0_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm2",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan1_1_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan1_1_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm2",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan2_0_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan2_0_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm3",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan2_1_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan2_1_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm3",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "KL0",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/KL0",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme0",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme0",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme1",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme1",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ }
+ ],
+ "zones" : [
+ {
+ "id": 0,
+ "minThermalOutput": 0.0,
+ "failsafePercent": 100.0,
+ "pids": [
+ {
+ "name": "Fan0_0_RPM",
+ "type": "fan",
+ "inputs": ["Fan0_0_RPM"],
+ "setpoint": 65.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": "Fan0_1_RPM",
+ "type": "fan",
+ "inputs": ["Fan0_1_RPM"],
+ "setpoint": 65.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": "Fan1_0_RPM",
+ "type": "fan",
+ "inputs": ["Fan1_0_RPM"],
+ "setpoint": 65.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": "Fan1_1_RPM",
+ "type": "fan",
+ "inputs": ["Fan1_1_RPM"],
+ "setpoint": 65.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": "Fan2_0_RPM",
+ "type": "fan",
+ "inputs": ["Fan2_0_RPM"],
+ "setpoint": 65.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": "Fan2_1_RPM",
+ "type": "fan",
+ "inputs": ["Fan2_1_RPM"],
+ "setpoint": 65.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": "nvme0",
+ "type": "temp",
+ "inputs": ["nvme0"],
+ "setpoint": 65.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": "nvme1",
+ "type": "temp",
+ "inputs": ["nvme1"],
+ "setpoint": 65.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": "KL0",
+ "type": "stepwise",
+ "inputs": ["KL0"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 0.0,
+ "negativeHysteresis": 0.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 25,
+ "1": 26,
+ "2": 27,
+ "3": 28,
+ "4": 29,
+ "5": 30,
+ "6": 31,
+ "7": 32,
+ "8": 33,
+ "9": 34,
+ "10": 35,
+ "11": 36,
+ "12": 37,
+ "13": 38,
+ "14": 39,
+ "15": 40,
+ "16": 42,
+ "17": 44,
+ "18": 45,
+ "19": 50
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 10,
+ "3": 10,
+ "4": 10,
+ "5": 10,
+ "6": 20,
+ "7": 30,
+ "8": 40,
+ "9": 50,
+ "10": 60,
+ "11": 73,
+ "12": 76,
+ "13": 79,
+ "14": 82,
+ "15": 86,
+ "16": 90,
+ "17": 90,
+ "18": 100,
+ "19": 100
+ }
+ }
+ },
+ {
+ "name": "nvme00",
+ "type": "stepwise",
+ "inputs": ["nvme0"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 5,
+ "1": 5,
+ "2": 5,
+ "3": 6,
+ "4": 6,
+ "5": 7,
+ "6": 7,
+ "7": 8,
+ "8": 10,
+ "9": 12,
+ "10": 14,
+ "11": 16,
+ "12": 18,
+ "13": 20,
+ "14": 21,
+ "15": 21,
+ "16": 22,
+ "17": 22,
+ "18": 25,
+ "19": 25
+ }
+ }
+ },
+ {
+ "name": "nvme10",
+ "type": "stepwise",
+ "inputs": ["nvme1"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 5,
+ "1": 5,
+ "2": 5,
+ "3": 6,
+ "4": 6,
+ "5": 7,
+ "6": 7,
+ "7": 8,
+ "8": 10,
+ "9": 12,
+ "10": 14,
+ "11": 16,
+ "12": 18,
+ "13": 20,
+ "14": 21,
+ "15": 21,
+ "16": 22,
+ "17": 22,
+ "18": 25,
+ "19": 25
+ }
+ }
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-8ssd.json b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-8ssd.json
new file mode 100644
index 000000000..7cfa861cb
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/config-8ssd.json
@@ -0,0 +1,928 @@
+{
+ "sensors" : [
+ {
+ "name": "Fan0_0_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan0_0_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm1",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan0_1_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan0_1_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm1",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan1_0_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan1_0_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm2",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan1_1_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan1_1_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm2",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan2_0_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan2_0_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm3",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "Fan2_1_RPM",
+ "type": "fan",
+ "readPath": "/xyz/openbmc_project/sensors/fan_tach/Fan2_1_RPM",
+ "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/**/pwm3",
+ "min": 0,
+ "max": 255
+ },
+ {
+ "name": "KL0",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/KL0",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme0",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme0",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme1",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme1",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme2",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme2",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme3",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme3",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme4",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme4",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme5",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme5",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme6",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme6",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ },
+ {
+ "name": "nvme7",
+ "type": "temp",
+ "readPath": "/xyz/openbmc_project/sensors/temperature/nvme7",
+ "writePath": "",
+ "min": 0,
+ "max": 0,
+ "timeout": 0
+ }
+ ],
+ "zones" : [
+ {
+ "id": 0,
+ "minThermalOutput": 0.0,
+ "failsafePercent": 100.0,
+ "pids": [
+ {
+ "name": "Fan0_0_RPM",
+ "type": "fan",
+ "inputs": ["Fan0_0_RPM"],
+ "setpoint": 65.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": "Fan0_1_RPM",
+ "type": "fan",
+ "inputs": ["Fan0_1_RPM"],
+ "setpoint": 65.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": "Fan1_0_RPM",
+ "type": "fan",
+ "inputs": ["Fan1_0_RPM"],
+ "setpoint": 65.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": "Fan1_1_RPM",
+ "type": "fan",
+ "inputs": ["Fan1_1_RPM"],
+ "setpoint": 65.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": "Fan2_0_RPM",
+ "type": "fan",
+ "inputs": ["Fan2_0_RPM"],
+ "setpoint": 65.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": "Fan2_1_RPM",
+ "type": "fan",
+ "inputs": ["Fan2_1_RPM"],
+ "setpoint": 65.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": "nvme0",
+ "type": "temp",
+ "inputs": ["nvme0"],
+ "setpoint": 65.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": "nvme1",
+ "type": "temp",
+ "inputs": ["nvme1"],
+ "setpoint": 65.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": "nvme2",
+ "type": "temp",
+ "inputs": ["nvme2"],
+ "setpoint": 65.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": "nvme3",
+ "type": "temp",
+ "inputs": ["nvme3"],
+ "setpoint": 65.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": "nvme4",
+ "type": "temp",
+ "inputs": ["nvme4"],
+ "setpoint": 65.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": "nvme5",
+ "type": "temp",
+ "inputs": ["nvme5"],
+ "setpoint": 65.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": "nvme6",
+ "type": "temp",
+ "inputs": ["nvme6"],
+ "setpoint": 65.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": "nvme7",
+ "type": "temp",
+ "inputs": ["nvme7"],
+ "setpoint": 65.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": "KL0",
+ "type": "stepwise",
+ "inputs": ["KL0"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 0.0,
+ "negativeHysteresis": 0.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 25,
+ "1": 26,
+ "2": 27,
+ "3": 28,
+ "4": 29,
+ "5": 30,
+ "6": 31,
+ "7": 32,
+ "8": 33,
+ "9": 34,
+ "10": 35,
+ "11": 36,
+ "12": 37,
+ "13": 38,
+ "14": 39,
+ "15": 40,
+ "16": 42,
+ "17": 44,
+ "18": 45,
+ "19": 50
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 10,
+ "3": 10,
+ "4": 10,
+ "5": 10,
+ "6": 20,
+ "7": 30,
+ "8": 40,
+ "9": 50,
+ "10": 60,
+ "11": 73,
+ "12": 76,
+ "13": 79,
+ "14": 82,
+ "15": 86,
+ "16": 90,
+ "17": 90,
+ "18": 100,
+ "19": 100
+ }
+ }
+ },
+ {
+ "name": "nvme00",
+ "type": "stepwise",
+ "inputs": ["nvme0"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme10",
+ "type": "stepwise",
+ "inputs": ["nvme1"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme20",
+ "type": "stepwise",
+ "inputs": ["nvme2"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme30",
+ "type": "stepwise",
+ "inputs": ["nvme3"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme40",
+ "type": "stepwise",
+ "inputs": ["nvme4"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme50",
+ "type": "stepwise",
+ "inputs": ["nvme5"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme60",
+ "type": "stepwise",
+ "inputs": ["nvme6"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ },
+ {
+ "name": "nvme70",
+ "type": "stepwise",
+ "inputs": ["nvme7"],
+ "setpoint": 30.0,
+ "pid": {
+ "samplePeriod": 1.0,
+ "positiveHysteresis": 1.0,
+ "negativeHysteresis": 1.0,
+ "isCeiling": false,
+ "reading": {
+ "0": 45,
+ "1": 46,
+ "2": 47,
+ "3": 48,
+ "4": 49,
+ "5": 50,
+ "6": 51,
+ "7": 52,
+ "8": 53,
+ "9": 54,
+ "10": 55,
+ "11": 56,
+ "12": 57,
+ "13": 58,
+ "14": 59,
+ "15": 60,
+ "16": 61,
+ "17": 62,
+ "18": 63,
+ "19": 64
+ },
+ "output": {
+ "0": 10,
+ "1": 10,
+ "2": 13,
+ "3": 15,
+ "4": 18,
+ "5": 21,
+ "6": 24,
+ "7": 26,
+ "8": 28,
+ "9": 30,
+ "10": 32,
+ "11": 34,
+ "12": 36,
+ "13": 38,
+ "14": 40,
+ "15": 41,
+ "16": 42,
+ "17": 43,
+ "18": 44,
+ "19": 45
+ }
+ }
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-boot-control.service b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-boot-control.service
new file mode 100644
index 000000000..2149c3da5
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-boot-control.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Set Fan to Default Duty as Booting Up
+DefaultDependencies=no
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/fan-default-speed.sh
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-control.sh b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-control.sh
new file mode 100644
index 000000000..3c84ce418
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-control.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+NVME_GPIO_NUM=( 148 149 150 151 152 153 154 155 )
+NVME=( 1 1 1 1 1 1 1 1 )
+FAN_TABLE_PATH="/usr/share/swampd/config.json"
+FAN_TABLE=( "/usr/share/swampd/config-8ssd.json" "/usr/share/swampd/config-2ssd.json" )
+TYPE=-1
+
+# get nvme presence
+for i in {0..7}
+do
+ gpioNum=${NVME_GPIO_NUM[$i]}
+ NVME[$i]=$(cat /sys/class/gpio/gpio$gpioNum/value)
+done
+
+# distinguish between 8-ssd and 2-ssd sku
+for i in {2..7}
+do
+ if [ ${NVME[$i]} -eq 0 ]; then
+ TYPE=0
+ fi
+done
+if [ $TYPE -eq -1 ]; then
+ for i in {0..1}
+ do
+ if [ ${NVME[$i]} -eq 0 ]; then
+ TYPE=1
+ fi
+ done
+fi
+
+if [ $TYPE -eq 1 ]; then
+ cp ${FAN_TABLE[1]} $FAN_TABLE_PATH
+else
+ cp ${FAN_TABLE[0]} $FAN_TABLE_PATH
+fi
+
+# start pid control
+/usr/bin/swampd
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh
new file mode 100644
index 000000000..2cd31066c
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh
@@ -0,0 +1,5 @@
+#!bin/bash
+
+echo 230 > /sys/class/hwmon/*/pwm1
+echo 230 > /sys/class/hwmon/*/pwm2
+echo 230 > /sys/class/hwmon/*/pwm3
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service
new file mode 100644
index 000000000..681bdbe00
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Set Fan to Default Duty as Rebooting
+DefaultDependencies=no
+After=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/usr/bin/fan-default-speed.sh
+
+[Install]
+WantedBy=shutdown.target
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
new file mode 100644
index 000000000..0e18819f8
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=OpenBMC Fan Control Daemon
+After=xyz.openbmc_project.nvme.manager.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/fan-control.sh
+Restart=always
+RestartSec=5
+StartLimitInterval=0
+ExecStopPost=/usr/bin/fan-default-speed.sh
+
+[Install]
+WantedBy=basic.target
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
new file mode 100644
index 000000000..13d037e41
--- /dev/null
+++ b/meta-quanta/meta-gsj/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
@@ -0,0 +1,40 @@
+FILESEXTRAPATHS_prepend_gsj := "${THISDIR}/${PN}:"
+SRC_URI_append_gsj = " file://config-8ssd.json"
+SRC_URI_append_gsj = " file://config-2ssd.json"
+SRC_URI_append_gsj = " file://fan-control.sh"
+SRC_URI_append_gsj = " file://fan-default-speed.sh"
+SRC_URI_append_gsj = " file://phosphor-pid-control.service"
+SRC_URI_append_gsj = " file://fan-reboot-control.service"
+SRC_URI_append_gsj = " file://fan-boot-control.service"
+
+FILES_${PN}_append_gsj = " ${datadir}/swampd/config-8ssd.json"
+FILES_${PN}_append_gsj = " ${datadir}/swampd/config-2ssd.json"
+FILES_${PN}_append_gsj = " ${bindir}/fan-control.sh"
+FILES_${PN}_append_gsj = " ${bindir}/fan-default-speed.sh"
+
+inherit systemd
+RDEPENDS_${PN} += "bash"
+
+SYSTEMD_SERVICE_${PN}_append_gsj = " phosphor-pid-control.service"
+SYSTEMD_SERVICE_${PN}_append_gsj = " fan-reboot-control.service"
+SYSTEMD_SERVICE_${PN}_append_gsj = " fan-boot-control.service"
+
+do_install_append_gsj() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${WORKDIR}/fan-control.sh ${D}/${bindir}
+ install -m 0755 ${WORKDIR}/fan-default-speed.sh ${D}/${bindir}
+
+ install -d ${D}${datadir}/swampd
+ install -m 0644 -D ${WORKDIR}/config-8ssd.json \
+ ${D}${datadir}/swampd/config-8ssd.json
+ install -m 0644 -D ${WORKDIR}/config-2ssd.json \
+ ${D}${datadir}/swampd/config-2ssd.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
+ install -m 0644 ${WORKDIR}/fan-boot-control.service \
+ ${D}${systemd_unitdir}/system
+}
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-quanta/meta-gsj/recipes-phosphor/images/obmc-phosphor-image.bbappend
index b4f8d0665..60de2fcd4 100644
--- a/meta-quanta/meta-gsj/recipes-phosphor/images/obmc-phosphor-image.bbappend
+++ b/meta-quanta/meta-gsj/recipes-phosphor/images/obmc-phosphor-image.bbappend
@@ -1 +1,3 @@
OBMC_IMAGE_EXTRA_INSTALL_append_gsj = " phosphor-ipmi-flash"
+OBMC_IMAGE_EXTRA_INSTALL_append_gsj = " phosphor-pid-control"
+OBMC_IMAGE_EXTRA_INSTALL_append_gsj = " detect-fan-fail"
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf b/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf
index 9eaee659e..8b0e37e99 100644
--- a/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf
+++ b/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf
@@ -1,8 +1,8 @@
LABEL_fan1= "Fan0_0_RPM"
TARGET_fan1= "Fan0_0_RPM"
-WARNHI_fan1= "19000"
-WARNLO_fan1= "230"
-CRITHI_fan1= "20000"
+WARNHI_fan1= "19250"
+WARNLO_fan1= "150"
+CRITHI_fan1= "19250"
CRITLO_fan1= "150"
MINVALUE_fan1 = "0"
MAXVALUE_fan1 = "20145"
@@ -11,9 +11,9 @@ EVENT_fan1= "WARNHI,WARNLO,CRITHI,CRITLO"
LABEL_fan2= "Fan0_1_RPM"
TARGET_fan2= "Fan0_1_RPM"
-WARNHI_fan2= "19000"
-WARNLO_fan2= "230"
-CRITHI_fan2= "20000"
+WARNHI_fan2= "17600"
+WARNLO_fan2= "150"
+CRITHI_fan2= "17600"
CRITLO_fan2= "150"
MINVALUE_fan2 = "0"
MAXVALUE_fan2 = "20145"
@@ -22,9 +22,9 @@ EVENT_fan2= "WARNHI,WARNLO,CRITHI,CRITLO"
LABEL_fan3= "Fan1_0_RPM"
TARGET_fan3= "Fan1_0_RPM"
-WARNHI_fan3= "19000"
-WARNLO_fan3= "230"
-CRITHI_fan3= "20000"
+WARNHI_fan3= "19250"
+WARNLO_fan3= "150"
+CRITHI_fan3= "19250"
CRITLO_fan3= "150"
MINVALUE_fan3 = "0"
MAXVALUE_fan3 = "20145"
@@ -33,9 +33,9 @@ EVENT_fan3= "WARNHI,WARNLO,CRITHI,CRITLO"
LABEL_fan4= "Fan1_1_RPM"
TARGET_fan4= "Fan1_1_RPM"
-WARNHI_fan4= "19000"
-WARNLO_fan4= "230"
-CRITHI_fan4= "20000"
+WARNHI_fan4= "17600"
+WARNLO_fan4= "150"
+CRITHI_fan4= "17600"
CRITLO_fan4= "150"
MINVALUE_fan4 = "0"
MAXVALUE_fan4 = "20145"
@@ -44,9 +44,9 @@ EVENT_fan4= "WARNHI,WARNLO,CRITHI,CRITLO"
LABEL_fan5= "Fan2_0_RPM"
TARGET_fan5= "Fan2_0_RPM"
-WARNHI_fan5= "19000"
-WARNLO_fan5= "230"
-CRITHI_fan5= "20000"
+WARNHI_fan5= "19250"
+WARNLO_fan5= "150"
+CRITHI_fan5= "19250"
CRITLO_fan5= "150"
MINVALUE_fan5 = "0"
MAXVALUE_fan5 = "20145"
@@ -55,11 +55,11 @@ EVENT_fan5= "WARNHI,WARNLO,CRITHI,CRITLO"
LABEL_fan6= "Fan2_1_RPM"
TARGET_fan6= "Fan2_1_RPM"
-WARNHI_fan6= "19000"
-WARNLO_fan6= "230"
-CRITHI_fan6= "20000"
+WARNHI_fan6= "17600"
+WARNLO_fan6= "150"
+CRITHI_fan6= "17600"
CRITLO_fan6= "150"
MINVALUE_fan6 = "0"
MAXVALUE_fan6 = "20145"
PWM_TARGET_fan6 = 3
-EVENT_fan6= "WARNHI,WARNLO,CRITHI,CRITLO" \ No newline at end of file
+EVENT_fan6= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
index 0313b0444..e2d753040 100644
--- a/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
+++ b/meta-quanta/meta-gsj/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
@@ -15,9 +15,9 @@ ITEMSFMT = "ahb/apb/{0}.conf"
ITEMS += "${@compose_list(d, 'ITEMSFMT', 'NAMES')}"
ENVS = "obmc/hwmon/{0}"
-SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'ENVS', 'ITEMS')}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gsj = " ${@compose_list(d, 'ENVS', 'ITEMS')}"
# Fan sensors
FITEMS = "pwm-fan-controller@103000.conf"
FENVS = "obmc/hwmon/ahb/apb/{0}"
-SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'FENVS', 'FITEMS')}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gsj = " ${@compose_list(d, 'FENVS', 'FITEMS')}"