From bf078825d137b0e1a1ec02ddd4e6d08670a6783c Mon Sep 17 00:00:00 2001 From: George Hung Date: Fri, 11 Jun 2021 13:23:25 +0800 Subject: meta-quanta: gbs: Modified pid sensor type from margin to temp - Remove read-margin-temp files and codes - Modified sensor type in pid json to temp setpoint set to target temp Kp set to Kp * scalar Ki set to Ki * scalar - Pre-detect nvme present status in fan-table-init.sh, and delete settings if nvme present is false. Signed-off-by: George Hung Change-Id: Iba4ac164a7a39ca1be109301402911d432294997 --- .../fans/read-margin-temp/read-margin-temp-wait.sh | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh (limited to 'meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh') diff --git a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh deleted file mode 100644 index 0937a9fb8..000000000 --- a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -MARGIN_TABLE_FILE_IN="/usr/share/read-margin-temp/config-margin.json.in" -TEMP_FILE="$(mktemp)" -cp "$MARGIN_TABLE_FILE_IN" "$TEMP_FILE" - -target_num="$(cat $TEMP_FILE | grep '"target"' | wc -l)" - -# wait target dbus -for ((i = 0; i < ${target_num}; i++)); do - line_num=$((i+1)) - path="$(cat $TEMP_FILE | grep '"target"' | head -n ${line_num} | tail -n +${line_num} | cut -d '"' -f 4)" - mapper wait $path -done - -nvmePath="/xyz/openbmc_project/sensors/temperature/nvme" -nvmeInventoryPath="/xyz/openbmc_project/inventory/system/chassis/motherboard/nvme" -nvmeList="" -# Get and Set WCTEMP -for ((i = 0; i < 16; i++)); do - name="@WCTemp$(printf "%02d" $i)@" - wcTemp=72000 - presentState="$(busctl get-property \ - xyz.openbmc_project.Inventory.Manager \ - ${nvmeInventoryPath}${i} \ - xyz.openbmc_project.Inventory.Item \ - Present | awk '{print $2}')" - - if [[ "$presentState" == "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="$((actualWCTemp * 1000))" - else - echo "${nvmePath}${i} WCTemp was read to be 0, using default WCTemp: ${wcTemp}" - fi - - if [[ -z "$nvmeList" ]]; then - nvmeList="\"nvme"${i}"\"" - else - nvmeList="${nvmeList}"", \"nvme"${i}"\"" - fi - fi - - sed -i "s/$name/${wcTemp}/g" "$TEMP_FILE" -done - -sed -i "s/@nvmeList@/${nvmeList}/g" "$TEMP_FILE" - -# Use shell parameter expansion to trim the ".in" suffix -mv "$TEMP_FILE" "${MARGIN_TABLE_FILE_IN%".in"}" - -# start read margin temp -/usr/bin/read-margin-temp & - -exit 0 -- cgit v1.2.3