diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-05-24 22:35:24 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-05-24 22:35:24 +0300 |
commit | 0e0df451ae365f09d5c0c766b253f23de26901f2 (patch) | |
tree | db4d7d3ce85e02ee01ad58a86ede02ac876aae77 /meta-quanta | |
parent | e370fd750e2821620ec427f26f8efab0069824ff (diff) | |
parent | 7e10dee74964afa47859704886128dd256acf854 (diff) | |
download | openbmc-0e0df451ae365f09d5c0c766b253f23de26901f2.tar.xz |
Merge tag '0.52' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-quanta')
66 files changed, 604 insertions, 274 deletions
diff --git a/meta-quanta/conf/layer.conf b/meta-quanta/conf/layer.conf index 8db4bd2e8..5ab3e2684 100644 --- a/meta-quanta/conf/layer.conf +++ b/meta-quanta/conf/layer.conf @@ -7,4 +7,4 @@ BBFILES += "${LAYERDIR}/meta-common/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "quanta-layer" BBFILE_PATTERN_quanta-layer := "^${LAYERDIR}/" -LAYERSERIES_COMPAT_quanta-layer = "dunfell gatesgarth" +LAYERSERIES_COMPAT_quanta-layer = "gatesgarth hardknott" diff --git a/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb b/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb index fd5819d42..63551ef99 100644 --- a/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb +++ b/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb @@ -4,7 +4,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" SRC_URI = "git://github.com/quanta-bmc/read-margin-temp.git" -SRCREV = "ca2dc1bf7f34d517f0edc59dd3596c3a76c3d7a1" +SRCREV = "cadbe4801db76799e21b7bc9c405e5df9988dee0" S = "${WORKDIR}/git" inherit autotools pkgconfig diff --git a/meta-quanta/meta-f0b/conf/bblayers.conf.sample b/meta-quanta/meta-f0b/conf/bblayers.conf.sample index 28b258258..db7f86a0d 100644 --- a/meta-quanta/meta-f0b/conf/bblayers.conf.sample +++ b/meta-quanta/meta-f0b/conf/bblayers.conf.sample @@ -9,7 +9,9 @@ BBLAYERS ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-aspeed \ ##OEROOT##/meta-quanta \ @@ -19,7 +21,9 @@ BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-aspeed \ ##OEROOT##/meta-quanta \ diff --git a/meta-quanta/meta-f0b/conf/layer.conf b/meta-quanta/meta-f0b/conf/layer.conf index 05b405f93..fc0a1a720 100644 --- a/meta-quanta/meta-f0b/conf/layer.conf +++ b/meta-quanta/meta-f0b/conf/layer.conf @@ -7,4 +7,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "f0b-layer" BBFILE_PATTERN_f0b-layer = "" -LAYERSERIES_COMPAT_f0b-layer = "dunfell gatesgarth" +LAYERSERIES_COMPAT_f0b-layer = "gatesgarth hardknott" diff --git a/meta-quanta/meta-f0b/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-quanta/meta-f0b/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend index e41607a71..9d0fbe264 100644 --- a/meta-quanta/meta-f0b/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend +++ b/meta-quanta/meta-f0b/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend @@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -EXTRA_OECONF_append_f0b = " --enable-negative-errno-on-fail" +EXTRA_OEMESON_append_f0b = " -Dnegative-errno-on-fail=true" NAME = " \ bus@1e78a000/i2c-bus@80/tmp421@4c \ diff --git a/meta-quanta/meta-gbs/conf/bblayers.conf.sample b/meta-quanta/meta-gbs/conf/bblayers.conf.sample index 541036d81..903833258 100644 --- a/meta-quanta/meta-gbs/conf/bblayers.conf.sample +++ b/meta-quanta/meta-gbs/conf/bblayers.conf.sample @@ -9,7 +9,9 @@ BBLAYERS ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-nuvoton \ ##OEROOT##/meta-google \ @@ -20,7 +22,9 @@ BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-nuvoton \ ##OEROOT##/meta-google \ diff --git a/meta-quanta/meta-gbs/conf/layer.conf b/meta-quanta/meta-gbs/conf/layer.conf index 139259636..ec03a3ad6 100644 --- a/meta-quanta/meta-gbs/conf/layer.conf +++ b/meta-quanta/meta-gbs/conf/layer.conf @@ -7,4 +7,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "gbs-layer" BBFILE_PATTERN_gbs-layer := "^${LAYERDIR}/" -LAYERSERIES_COMPAT_gbs-layer = "dunfell gatesgarth" +LAYERSERIES_COMPAT_gbs-layer = "gatesgarth hardknott" diff --git a/meta-quanta/meta-gbs/conf/machine/gbs.conf b/meta-quanta/meta-gbs/conf/machine/gbs.conf index 241905262..e9456b5ec 100644 --- a/meta-quanta/meta-gbs/conf/machine/gbs.conf +++ b/meta-quanta/meta-gbs/conf/machine/gbs.conf @@ -11,6 +11,7 @@ require conf/machine/include/npcm7xx.inc require conf/machine/include/obmc-bsp-common.inc GBMC_NCSI_IF_NAME = "eth0" +GBMC_KCS_DEV = "ipmi-kcs1" # Overwrite flash offsets FLASH_ROFS_OFFSET = "7296" @@ -34,7 +35,7 @@ VIRTUAL-RUNTIME_obmc-discover-system-state = "x86-power-control" PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-gbs-apps" PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-gbs-apps" PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-gbs-apps" -PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-kcs" +PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "gbmc-kcs-config" PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "gbs-led-manager-config-native" # Remove unneeded binaries from image diff --git a/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service index ea44dda2d..ab4622efa 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service +++ b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service @@ -7,7 +7,7 @@ Wants=xyz.openbmc_project.LED.GroupManager.service ExecStart=/usr/bin/boot-status-led.sh StandardOutput=syslog Type=simple -Restart=yes +Restart=on-failure [Install] WantedBy=multi-user.target diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/files/gbs-detect-fan-fail.service b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/files/gbs-detect-fan-fail.service deleted file mode 100644 index ecdc95399..000000000 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/files/gbs-detect-fan-fail.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Detect Fan Fail Manager -After=phosphor-pid-control.service - -[Service] -ExecStart=/usr/bin/gbs-detect-fan-fail.sh -Restart=always -StandardOutput=syslog - -[Install] -WantedBy=multi-user.target diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/files/gbs-detect-fan-fail.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/files/gbs-detect-fan-fail.sh deleted file mode 100644 index 56ae7bbc5..000000000 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/files/gbs-detect-fan-fail.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -## - # This script is to handle fan fail condition which is described below. - # Fan fail means one fan RPM is under its CriticalLow. If BMC encounters - # such situation, then sets other fans to full speed. - # - -# get fan state -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" -} - -# check fan fail -function is_fan_fail() { - fan_state=("$@") - - for i in "${fan_state[@]}" - do - if [ ! -z "$i" ] - then - if [ $i == "true" ] - then - echo 1 - return - fi - fi - done - echo 0 -} - -fan_tach_path=( '/xyz/openbmc_project/sensors/fan_tach/fan0' - '/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' - ) - -check_fail_flag=0 -is_fan_fail_flag=0 -current_fan_state=() - -while true -do - for i in ${!fan_tach_path[@]} - do - mapper wait ${fan_tach_path[$i]} - hwmon_path="$(mapper get-service ${fan_tach_path[0]})" - current_fan_state[$i]=$(get_fan_state $hwmon_path ${fan_tach_path[$i]}) - done - - is_fan_fail_flag=$(is_fan_fail "${current_fan_state[@]}") - - # if fan fails then set all fans to full speed - if [ $is_fan_fail_flag -eq 1 ] && [ $check_fail_flag -eq 0 ] - then - check_fail_flag=1 - systemctl stop phosphor-pid-control.service - - # fans recover to normal state - elif [ $is_fan_fail_flag -eq 0 ] && [ $check_fail_flag -eq 1 ] - then - check_fail_flag=0 - systemctl restart phosphor-pid-control.service - fi - - sleep 2 -done diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/gbs-detect-fan-fail.bb b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/gbs-detect-fan-fail.bb deleted file mode 100644 index 5befec8d6..000000000 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-fan-fail/gbs-detect-fan-fail.bb +++ /dev/null @@ -1,25 +0,0 @@ -SUMMARY = "OpenBMC Quanta Detect Fan Fail Service" -DESCRIPTION = "OpenBMC Quanta Detect Fan Fail Daemon." -PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -inherit systemd - -DEPENDS += "systemd" -RDEPENDS_${PN} += "bash" - -SRC_URI = " file://gbs-detect-fan-fail.sh \ - file://gbs-detect-fan-fail.service \ - " - -do_install() { - install -d ${D}${bindir} - install -m 0755 ${WORKDIR}/gbs-detect-fan-fail.sh ${D}${bindir}/ - - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/gbs-detect-fan-fail.service ${D}${systemd_system_unitdir} -} - -SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} = "gbs-detect-fan-fail.service" diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh index 2bbe46e84..dd5852a70 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh @@ -10,7 +10,8 @@ PRESENT_OBJPATH=("/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab0_pr "/xyz/openbmc_project/inventory/system/chassis/cable/bp12v_cab_prsnt" "/xyz/openbmc_project/inventory/system/chassis/entity/sata0_prsnt" "/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot0_prsnt" -"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt") +"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt" +"/xyz/openbmc_project/inventory/system/chassis/entity/fans_efuse_pg") INTERFACE_NAME="xyz.openbmc_project.Inventory.Item" IPMI_LOG_SERVICE="xyz.openbmc_project.Logging.IPMI" @@ -23,12 +24,16 @@ LOG_EVENT_DATA="3 0x01 0xff 0xfe" LOG_ASSERT_FLAG="true" LOG_DEASSERT_FLAG="false" LOG_GENID_FLAG="0x0020" -present_state=("true" "true" "true" "true" "true" "true" "true" "true" "true" "true") +present_state=("true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true") + +for i in ${!PRESENT_OBJPATH[@]} +do + mapper wait ${PRESENT_OBJPATH[$i]} +done while true; do for i in ${!PRESENT_OBJPATH[@]} do - mapper wait ${PRESENT_OBJPATH[$i]} boot_status="$(busctl get-property $SERVICE_NAME ${PRESENT_OBJPATH[$i]} $INTERFACE_NAME Present | awk '{print $2}')" if [ $boot_status == "false" ] && [ ${present_state[$i]} == "true" ];then diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-ipmi-entity-association-map/files/entity_association_map.json b/meta-quanta/meta-gbs/recipes-gbs/gbs-ipmi-entity-association-map/files/entity_association_map.json index f4e453a9a..f430dcf00 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-ipmi-entity-association-map/files/entity_association_map.json +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-ipmi-entity-association-map/files/entity_association_map.json @@ -24,6 +24,7 @@ ], "cooling_unit": [ {"instance": 0, "name": "/ZONE0"}, - {"instance": 1, "name": "/ZONE1"} + {"instance": 1, "name": "/ZONE1"}, + {"instance": 2, "name": "/ZONE2"} ] } diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.service b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.service index 645136b85..7fd74377c 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.service +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.service @@ -1,5 +1,7 @@ [Unit] Description = Initialization for GBS boot up +Requires=gbs-host-ready.target +After=gbs-host-ready.target Wants=mapper-wait@-xyz-openbmc_project-inventory.service After=mapper-wait@-xyz-openbmc_project-inventory.service Wants=mapper-wait@-xyz-openbmc_project-control-nvme.service diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.service b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.service new file mode 100644 index 000000000..032fabca5 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.service @@ -0,0 +1,10 @@ +[Unit] +Description = Check Host State to set fan failsafe speed + +[Service] +Type=simple +Restart=on-failure +ExecStart=/usr/bin/gbs-check-host-state.sh + +[Install] +WantedBy=multi-user.target
\ No newline at end of file diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh new file mode 100644 index 000000000..1bff18d08 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +state="xyz.openbmc_project.State.Chassis.PowerState.Off" + +dbus-monitor --system type='signal',interface='org.freedesktop.DBus.Properties',\ +member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Chassis' | \ +while read -r line; do + grep -q member <<< $line && continue + if grep -q $state <<< $line; then + echo "Setting failsafe assuming host is off" >&2 + systemctl start --no-block gbs-host-s5-set-failsafe + fi +done diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-ready.target b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-ready.target new file mode 100644 index 000000000..7f806cdb8 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-ready.target @@ -0,0 +1,8 @@ +[Unit] +Description=Host is ready to be powered on +Wants=phosphor-ipmi-host.service +After=phosphor-ipmi-host.service +Wants=obmc-console@ttyS1.service +After=obmc-console@ttyS1.service +After=postcode-7seg@seven_seg_disp_val.service +RefuseManualStop=yes
\ No newline at end of file diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-s0-set-failsafe.service b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-s0-set-failsafe.service new file mode 100644 index 000000000..263cafaa2 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-s0-set-failsafe.service @@ -0,0 +1,15 @@ +[Unit] +Description=Increase GBS fan failsafe speed on host kernel entrance +PartOf=host-s0-state.target +Requires=phosphor-pid-control.service +After=phosphor-pid-control.service +Wants=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service +After=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service + +[Service] +Type=oneshot +# 230: 90% duty cycle +ExecStart=/usr/bin/gbs-set-failsafe.sh 230 + +[Install] +WantedBy=host-s0-state.target diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-s5-set-failsafe.service b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-s5-set-failsafe.service new file mode 100644 index 000000000..2c0f3bccc --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-s5-set-failsafe.service @@ -0,0 +1,15 @@ +[Unit] +Description=Decrease GBS fan failsafe speed on host shutdown +PartOf=host-s5-state.target +Requires=phosphor-pid-control.service +After=phosphor-pid-control.service +Wants=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service +After=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service + +[Service] +Type=oneshot +# 102: 40% duty cycle +ExecStart=/usr/bin/gbs-set-failsafe.sh 102 + +[Install] +WantedBy=host-s5-state.target diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-set-boot-failsafe@.service b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-set-boot-failsafe@.service new file mode 100644 index 000000000..c1e28383a --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-host-set-boot-failsafe@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Set gBMC boot time failsafe +Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +After=acpi-power-state.service +Before=gbs-sysinit.service + +[Service] +Type=exec +ExecStart=/usr/bin/gbs-set-boot-failsafe.sh +RemainAfterExit=yes + +[Install] +WantedBy=gbs-host-ready.target diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-boot-failsafe.sh b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-boot-failsafe.sh new file mode 100644 index 000000000..6580fbe91 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-boot-failsafe.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright 2021 Google LLC +# Copyright 2021 Quanta Computer Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +main() { + local pgd_val + pgd_val="$(busctl get-property -j xyz.openbmc_project.State.Chassis \ + /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis \ + CurrentPowerState | jq -r '.["data"]')" + + if [[ $pgd_val != 'xyz.openbmc_project.State.Chassis.PowerState.On' ]]; then + echo "Setting failsafe assuming host is off" >&2 + systemctl start --no-block gbs-host-s5-set-failsafe + else + echo "Setting failsafe assuming host is running" >&2 + systemctl start --no-block gbs-host-s0-set-failsafe + fi +} + +# Exit without running main() if sourced +return 0 2>/dev/null + +main "$@" diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh new file mode 100644 index 000000000..bcd1d2cc2 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-set-failsafe.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2021 Google LLC +# Copyright 2021 Quanta Computer Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +target_pwm="$1" + +if [ -z "$target_pwm" ]; then + echo "Target_pwm is not set" >&2 + exit 1 +fi + +zone_num="$(busctl tree xyz.openbmc_project.State.FanCtrl | grep zone | wc -l)" +result=0 + +for (( i = 0; i < ${zone_num}; i++ )); do + retries=4 + busctl_error=-1 + + while (( retries > 0 )) && (( busctl_error != 0 )); do + busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone${i} xyz.openbmc_project.Control.FanSpeed Target t "${target_pwm}" + busctl_error=$? + + if (( busctl_error != 0 )); then + #Retry setting failsafe. Swampd may be running but zone aren't yet built + #so sleep a second to let them be built + sleep 1 + fi + + let retries-=1 + done + + if (( busctl_error != 0 )); then + echo "Failure setting zone${i} fan failsafe to ${target_pwm}" >&2 + result=$busctl_error + else + echo "Setting zone${i} fan failsafe to ${target_pwm}" + fi +done + +exit $result diff --git a/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon_%.bbappend b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon_%.bbappend new file mode 100644 index 000000000..f833b5577 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon_%.bbappend @@ -0,0 +1,43 @@ +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" + +SRC_URI_append_gbs = " \ + file://gbs-host-s0-set-failsafe.service \ + file://gbs-host-s5-set-failsafe.service \ + file://gbs-host-set-boot-failsafe@.service \ + file://gbs-check-host-state.service \ + file://gbs-set-boot-failsafe.sh \ + file://gbs-set-failsafe.sh \ + file://gbs-check-host-state.sh \ + file://gbs-host-ready.target \ + " + +RDEPENDS_${PN}_append_gbs = "bash" + +CHASSIS_INSTANCE="0" + +SYSTEMD_SERVICE_${PN}_append_gbs = " \ + gbs-host-s0-set-failsafe.service \ + gbs-host-s5-set-failsafe.service \ + gbs-host-set-boot-failsafe@${CHASSIS_INSTANCE}.service \ + gbs-check-host-state.service \ + gbs-host-ready.target \ + " + +FILES_${PN}_append_gbs = " \ + ${systemd_system_unitdir}/gbs-host-set-boot-failsafe@.service \ + " + +do_install_append_gbs() { + install -d ${D}${bindir} + + install -m 0755 ${WORKDIR}/gbs-set-failsafe.sh ${D}${bindir}/. + install -m 0755 ${WORKDIR}/gbs-set-boot-failsafe.sh ${D}${bindir}/. + install -m 0755 ${WORKDIR}/gbs-check-host-state.sh ${D}${bindir}/. + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/gbs-host-s0-set-failsafe.service ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/gbs-host-s5-set-failsafe.service ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/gbs-host-set-boot-failsafe@.service ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/gbs-check-host-state.service ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/gbs-host-ready.target ${D}${systemd_system_unitdir} +} diff --git a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml index e0eb0e192..043136b5e 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml +++ b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml @@ -1258,3 +1258,24 @@ sensorReadingType: 0x6F sensorType: 0x23 serviceInterface: org.freedesktop.DBus.Properties + +0xFC: + entityID: 0x1E + entityInstance: 0 + interfaces: + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x00: + assert: true + type: bool + 0x01: + assert: false + type: bool + mutability: Mutability::Write|Mutability::Read + path: /xyz/openbmc_project/inventory/system/chassis/entity/fans_efuse_pg + readingType: assertion + sensorNamePattern: nameLeaf + sensorReadingType: 0x6f + sensorType: 0x25 + serviceInterface: org.freedesktop.DBus.Properties 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 new file mode 100644 index 000000000..050c8b43c --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch @@ -0,0 +1,117 @@ +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-sku.json b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in index e5040ca1c..21ba368df 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config-sku.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in @@ -1,11 +1,11 @@ { - "version": "R04", + "version": "R05", "sensors": [ { "name": "fan0", "type": "fan", "readPath": "/xyz/openbmc_project/sensors/fan_tach/fan0", - "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/Fan_0_To_4_Hwmon/pwm1", + "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm1", "min": 0, "max": 255 }, @@ -13,7 +13,7 @@ "name": "fan1", "type": "fan", "readPath": "/xyz/openbmc_project/sensors/fan_tach/fan1", - "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/Fan_0_To_4_Hwmon/pwm2", + "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm2", "min": 0, "max": 255 }, @@ -21,7 +21,7 @@ "name": "fb_fan0", "type": "fan", "readPath": "/xyz/openbmc_project/sensors/fan_tach/fb_fan0", - "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/Fan_0_To_4_Hwmon/pwm3", + "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm3", "min": 0, "max": 255 }, @@ -29,7 +29,7 @@ "name": "fb_fan1", "type": "fan", "readPath": "/xyz/openbmc_project/sensors/fan_tach/fb_fan1", - "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/Fan_0_To_4_Hwmon/pwm4", + "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm4", "min": 0, "max": 255 }, @@ -37,7 +37,7 @@ "name": "fb_fan2", "type": "fan", "readPath": "/xyz/openbmc_project/sensors/fan_tach/fb_fan2", - "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/Fan_0_To_4_Hwmon/pwm5", + "writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm5", "min": 0, "max": 255 }, diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh deleted file mode 100644 index 22cfab582..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-default-speed.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -for i in {1..5}; -do - echo 255 > /sys/class/hwmon/*/pwm${i} -done diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service deleted file mode 100644 index 681bdbe00..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-reboot-control.service +++ /dev/null @@ -1,12 +0,0 @@ -[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-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 68b699e0f..9617d0da4 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 @@ -1,10 +1,8 @@ #!/bin/bash -FAN_TABLE_SKU_FILE="/usr/share/swampd/config-sku.json" -FAN_TABLE_FILE="/usr/share/swampd/config.json" - -# determine sku -cp $FAN_TABLE_SKU_FILE $FAN_TABLE_FILE +FAN_TABLE_FILE_IN="/usr/share/swampd/config.json.in" +TEMP_FILE="$(mktemp)" +cp "$FAN_TABLE_FILE_IN" "$TEMP_FILE" # wait for fan dbus mapper wait /xyz/openbmc_project/sensors/fan_tach/fan0 @@ -13,15 +11,16 @@ mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan0 mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan1 mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan2 -/usr/bin/fan-default-speed.sh - # generate fan table writePath -Fan_0_To_4_Hwmon="$(ls -la /sys/class/hwmon |grep pwm | head -n 1| tail -n +1|cut -d '/' -f 9)" +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" $FAN_TABLE_FILE + sed -i "s/@Fan_0_To_4_Hwmon@/$Fan_0_To_4_Hwmon/g" $TEMP_FILE fi +# 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 & diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service index 33a441928..1c47761f1 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service @@ -1,6 +1,7 @@ [Unit] Description=Swampd Margin-based Fan Control Daemon After=xyz.openbmc_project.Hwmon@-ahb-apb-pwm\x2dfan\x2dcontroller\x40103000.service +After=xyz.openbmc_project.nvme.manager.service [Service] Type=simple @@ -9,7 +10,6 @@ ExecStart=/usr/bin/swampd Restart=always RestartSec=5 StartLimitInterval=0 -ExecStopPost=/usr/bin/fan-default-speed.sh [Install] WantedBy=basic.target 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 4f21d3bcf..7acd44c70 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 @@ -1,31 +1,26 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://config-sku.json" -SRC_URI_append_gbs = " file://fan-table-init.sh" -SRC_URI_append_gbs = " file://fan-default-speed.sh" -SRC_URI_append_gbs = " file://phosphor-pid-control.service" -SRC_URI_append_gbs = " file://fan-reboot-control.service" +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-sku.json" -FILES_${PN}_append_gbs = " ${bindir}/fan-default-speed.sh" +FILES_${PN}_append_gbs = " ${datadir}/swampd/config.json.in" FILES_${PN}_append_gbs = " ${bindir}/fan-table-init.sh" RDEPENDS_${PN} += "bash" SYSTEMD_SERVICE_${PN}_append_gbs = " phosphor-pid-control.service" -SYSTEMD_SERVICE_${PN}_append_gbs = " fan-reboot-control.service" do_install_append_gbs() { install -d ${D}/${bindir} - install -m 0755 ${WORKDIR}/fan-default-speed.sh ${D}/${bindir} install -m 0755 ${WORKDIR}/fan-table-init.sh ${D}/${bindir} install -d ${D}${datadir}/swampd - install -m 0644 -D ${WORKDIR}/config-sku.json \ - ${D}${datadir}/swampd/config-sku.json + install -m 0644 -D ${WORKDIR}/config.json.in \ + ${D}${datadir}/swampd/ install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/phosphor-pid-control.service \ ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/fan-reboot-control.service \ - ${D}${systemd_system_unitdir} } diff --git a/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/gpios-10.conf b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/gpios-10.conf new file mode 100644 index 000000000..c1c05e369 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/gpios-10.conf @@ -0,0 +1,6 @@ +#The gpio 146 is a real gpio, which is used to +#store the PWRGD_P12V_ALL_FANS signal +INVENTORY=/system/chassis/entity/fans_efuse_pg +DEVPATH=/dev/input/event0 +KEY=146 +NAME=fans_efuse_pg diff --git a/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend index d45636609..4b9a84100 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend @@ -18,7 +18,8 @@ SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-6.conf" SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-7.conf" SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-8.conf" SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-9.conf" -GBS_OBMC_PRESENT_INSTANCES = "0 1 2 3 4 5 6 7 8 9" +SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-10.conf" +GBS_OBMC_PRESENT_INSTANCES = "0 1 2 3 4 5 6 7 8 9 10" SYSTEMD_LINK_${PN}-presence_append_gbs = " ${@compose_list(d, 'FMT_PRESENT', 'GBS_OBMC_PRESENT_INSTANCES')}" 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 27c3c9fdd..9cea5db15 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 @@ -13,7 +13,6 @@ OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-detect-gpio-present" 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 = " gbs-detect-fan-fail" 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" @@ -22,3 +21,4 @@ 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" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/inventory/inventory-cleanup.bb b/meta-quanta/meta-gbs/recipes-phosphor/inventory/gbs-inventory-cleanup.bb index 0c4b56f72..0c4b56f72 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/inventory/inventory-cleanup.bb +++ b/meta-quanta/meta-gbs/recipes-phosphor/inventory/gbs-inventory-cleanup.bb diff --git a/meta-quanta/meta-gbs/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml b/meta-quanta/meta-gbs/recipes-phosphor/inventory/gbs-inventory-cleanup/inventory-cleanup.yaml index 78e03fee0..78e03fee0 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml +++ b/meta-quanta/meta-gbs/recipes-phosphor/inventory/gbs-inventory-cleanup/inventory-cleanup.yaml diff --git a/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend index 205822cb9..38825835d 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" PACKAGECONFIG_append_gbs = " associations" SRC_URI_append_gbs = " file://associations.json" -DEPENDS_append_gbs = " inventory-cleanup" +DEPENDS_append_gbs = " gbs-inventory-cleanup" do_install_append_gbs() { install -d ${D}${base_datadir} diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules deleted file mode 100644 index 1de5562c3..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules +++ /dev/null @@ -1 +0,0 @@ -KERNEL=="ipmi-kcs1", SYMLINK+="ipmi_kcs1" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend deleted file mode 100644 index a7f60d4cc..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -KCS_DEVICE_gbs = "ipmi_kcs1" - -FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://99-ipmi-kcs.rules" - -do_install_append_gbs() { - install -d ${D}/lib/udev/rules.d - install -m 0644 ${WORKDIR}/99-ipmi-kcs.rules ${D}/lib/udev/rules.d -} 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 new file mode 100644 index 000000000..0f4083416 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf @@ -0,0 +1,2 @@ +[Unit] +StartLimitBurst=10 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager_%.bbappend new file mode 100644 index 000000000..a7ec24f41 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" +SRC_URI_append_gbs = " file://service-override.conf" + +SYSTEMD_OVERRIDE_${PN}-ledmanager_append_gbs = " \ + service-override.conf:xyz.openbmc_project.LED.GroupManager.service.d/service-override.conf" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf index bcca9a636..34caf4a43 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-fan-controller@103000.conf @@ -25,7 +25,7 @@ MINVALUE_fan3 = "0" MAXVALUE_fan3 = "20775" PWM_TARGET_fan3 = 3 -LABEL_fan4= "fb_fan2" +LABEL_fan4= "fb_fan1" WARNHI_fan4= "19800" WARNLO_fan4= "3330" CRITHI_fan4= "19800" @@ -34,7 +34,7 @@ MINVALUE_fan4 = "0" MAXVALUE_fan4 = "20775" PWM_TARGET_fan4 = 4 -LABEL_fan5= "fb_fan1" +LABEL_fan5= "fb_fan2" WARNHI_fan5= "19800" WARNLO_fan5= "3330" CRITHI_fan5= "19800" 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 c779b85e0..5f0517a30 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend @@ -32,4 +32,4 @@ FENVS = "obmc/hwmon/ahb/apb/{0}" SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs = " ${@compose_list(d, 'FENVS', 'FITEMS')}" -EXTRA_OECONF_append_gbs = " --enable-update-functional-on-fail" +EXTRA_OEMESON_append_gbs = " -Dupdate-functional-on-fail=true" 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 8068d3bd2..eae38b23d 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 @@ -8,6 +8,7 @@ ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/inlet ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/outlet_0 ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/outlet_1 ExecStart=/usr/bin/virtual-sensor +ExecStartPost=/usr/bin/setMaxMinValue.sh Type=dbus BusName=xyz.openbmc_project.VirtualSensor SyslogIdentifier=phosphor-virtual-sensor 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 new file mode 100644 index 000000000..604eafccc --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh @@ -0,0 +1,15 @@ +#!/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/sensors/phosphor-virtual-sensor_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend index aadafeb2d..77546694e 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend @@ -2,9 +2,15 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" SRC_URI_append_gbs = " file://config-virtual-sensor.json \ file://phosphor-virtual-sensor.service.replace \ + file://setMaxMinValue.sh \ " +RDEPENDS_${PN}_append_gbs = "bash" + do_install_append_gbs() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/setMaxMinValue.sh ${D}${bindir}/ + install -d ${D}${datadir}/${PN} install -m 0644 -D ${WORKDIR}/config-virtual-sensor.json \ ${D}${datadir}/${PN}/virtual_sensor_config.json diff --git a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json.in index e28c0be0f..a5ff4979b 100644 --- a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json +++ b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json.in @@ -2,7 +2,7 @@ "sensors" : [ { "name": "cputemp", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/cputemp", "parameters": { @@ -17,12 +17,12 @@ }, { "name": "nvme0", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme0", "parameters": { "type": "", - "maxTemp": WCTemp00, + "maxTemp": @WCTemp00@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -32,12 +32,12 @@ }, { "name": "nvme1", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme1", "parameters": { "type": "", - "maxTemp": WCTemp01, + "maxTemp": @WCTemp01@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -47,12 +47,12 @@ }, { "name": "nvme2", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme2", "parameters": { "type": "", - "maxTemp": WCTemp02, + "maxTemp": @WCTemp02@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -62,12 +62,12 @@ }, { "name": "nvme3", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme3", "parameters": { "type": "", - "maxTemp": WCTemp03, + "maxTemp": @WCTemp03@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -77,12 +77,12 @@ }, { "name": "nvme4", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme4", "parameters": { "type": "", - "maxTemp": WCTemp04, + "maxTemp": @WCTemp04@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -92,12 +92,12 @@ }, { "name": "nvme5", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme5", "parameters": { "type": "", - "maxTemp": WCTemp05, + "maxTemp": @WCTemp05@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -107,12 +107,12 @@ }, { "name": "nvme6", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme6", "parameters": { "type": "", - "maxTemp": WCTemp06, + "maxTemp": @WCTemp06@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -122,12 +122,12 @@ }, { "name": "nvme7", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme7", "parameters": { "type": "", - "maxTemp": WCTemp07, + "maxTemp": @WCTemp07@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -137,12 +137,12 @@ }, { "name": "nvme8", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme8", "parameters": { "type": "", - "maxTemp": WCTemp08, + "maxTemp": @WCTemp08@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -152,12 +152,12 @@ }, { "name": "nvme9", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme9", "parameters": { "type": "", - "maxTemp": WCTemp09, + "maxTemp": @WCTemp09@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -167,12 +167,12 @@ }, { "name": "nvme10", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme10", "parameters": { "type": "", - "maxTemp": WCTemp10, + "maxTemp": @WCTemp10@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -182,12 +182,12 @@ }, { "name": "nvme11", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme11", "parameters": { "type": "", - "maxTemp": WCTemp11, + "maxTemp": @WCTemp11@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -197,12 +197,12 @@ }, { "name": "nvme12", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme12", "parameters": { "type": "", - "maxTemp": WCTemp12, + "maxTemp": @WCTemp12@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -212,12 +212,12 @@ }, { "name": "nvme13", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme13", "parameters": { "type": "", - "maxTemp": WCTemp13, + "maxTemp": @WCTemp13@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -227,12 +227,12 @@ }, { "name": "nvme14", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme14", "parameters": { "type": "", - "maxTemp": WCTemp14, + "maxTemp": @WCTemp14@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -242,12 +242,12 @@ }, { "name": "nvme15", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/nvme15", "parameters": { "type": "", - "maxTemp": WCTemp15, + "maxTemp": @WCTemp15@, "path": "", "sysLabel": "", "targetTemp": -1, @@ -257,7 +257,7 @@ }, { "name": "vddcr_cpu", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/vddcr_cpu", "parameters": { @@ -272,7 +272,7 @@ }, { "name": "vddcr_soc", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/vddcr_soc", "parameters": { @@ -287,7 +287,7 @@ }, { "name": "vddio_abcd", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/vddio_abcd", "parameters": { @@ -302,7 +302,7 @@ }, { "name": "vddio_efgh", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/vddio_efgh", "parameters": { @@ -317,7 +317,7 @@ }, { "name": "p12v_mobo", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/p12v_mobo", "parameters": { @@ -332,7 +332,7 @@ }, { "name": "powerseq_temp", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/powerseq_temp", "parameters": { @@ -347,7 +347,7 @@ }, { "name": "p12v_fan", - "unit": "millidegree", + "unit": "degree", "type": "dbus", "path": "/xyz/openbmc_project/sensors/temperature/p12v_fan", "parameters": { @@ -391,22 +391,7 @@ "zoneSetpoint": 10000, "target": "/xyz/openbmc_project/extsensors/margin/nvme", "components": [ - "nvme0", - "nvme1", - "nvme2", - "nvme3", - "nvme4", - "nvme5", - "nvme6", - "nvme7", - "nvme8", - "nvme9", - "nvme10", - "nvme11", - "nvme12", - "nvme13", - "nvme14", - "nvme15" + @nvmeList@ ] }, { 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 index d0cb2f632..0937a9fb8 100644 --- 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 @@ -1,50 +1,69 @@ #!/bin/bash -MARGIN_TABLE_FILE="/usr/share/read-margin-temp/config-margin.json" +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 $MARGIN_TABLE_FILE | grep '"target"' | wc -l)" - -cpu_hwmon="$(ls -la /sys/class/hwmon | grep f0082000 | head -n 1 | tail -n +1 | cut -d '/' -f 11)" - -# replace by the real cpu temperature hwmon path in runtime -if [[ "$cpu_hwmon" != "" ]] -then - sed -i "s/cpu_hwmon/$cpu_hwmon/g" $MARGIN_TABLE_FILE -fi +target_num="$(cat $TEMP_FILE | grep '"target"' | wc -l)" # wait target dbus -for ((i=0; i<$target_num; i++)) -do +for ((i = 0; i < ${target_num}; i++)); do line_num=$((i+1)) - path="$(cat $MARGIN_TABLE_FILE | grep '"target"' | head -n ${line_num} | tail -n +${line_num} | cut -d '"' -f 4)" + 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) + name="@WCTemp$(printf "%02d" $i)@" wcTemp=72000 - presentState=$(busctl get-property \ + presentState="$(busctl get-property \ xyz.openbmc_project.Inventory.Manager \ ${nvmeInventoryPath}${i} \ xyz.openbmc_project.Inventory.Item \ - Present | awk '{print $2}') - - if [[ $presentState == "true" ]]; then - wcTemp=$( - busctl get-property xyz.openbmc_project.nvme.manager \ - ${nvmePath}${i} \ - xyz.openbmc_project.Sensor.Threshold.Critical \ - CriticalHigh | awk '{print $2}' - ) - wcTemp=$((wcTemp * 1000)) + 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" $MARGIN_TABLE_FILE + 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 & diff --git a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp_%.bbappend b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp_%.bbappend index b3fc4d221..981c0d2ca 100644 --- a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp_%.bbappend @@ -1,16 +1,17 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://config-margin.json \ + +SRC_URI_append_gbs = " file://config-margin.json.in \ file://read-margin-temp-wait.sh \ " FILES_${PN}_append_gbs = " ${bindir}/read-margin-temp-wait.sh" -FILES_${PN}_append_gbs = " ${datadir}/read-margin-temp/config-margin.json" +FILES_${PN}_append_gbs = " ${datadir}/read-margin-temp/config-margin.json.in" do_install_append_gbs() { install -d ${D}${bindir} install -m 0755 ${WORKDIR}/read-margin-temp-wait.sh ${D}${bindir} install -d ${D}${datadir}/read-margin-temp - install -m 0644 -D ${WORKDIR}/config-margin.json \ - ${D}${datadir}/read-margin-temp/config-margin.json + install -m 0644 -D ${WORKDIR}/config-margin.json.in \ + ${D}${datadir}/${PN}/ } diff --git a/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control/chassis-system-reset.service b/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control/chassis-system-reset.service new file mode 100644 index 000000000..668195482 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control/chassis-system-reset.service @@ -0,0 +1,10 @@ +[Unit] +Description=System unit to hard reset or system reset chassis + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/tray_powercycle.sh + +[Install] +WantedBy=chassis-system-reset.target diff --git a/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control/power-config-host0.json b/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control/power-config-host0.json new file mode 100644 index 000000000..d9d3ed109 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control/power-config-host0.json @@ -0,0 +1,8 @@ +{ + "PostComplete": "POST_COMPLETE", + "PwrButton": "POWER_BUTTON", + "PwrOK": "PS_PWROK", + "PwrOut": "POWER_OUT", + "RstButton": "RESET_BUTTON", + "RstOut": "RESET_OUT" +} diff --git a/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control_%.bbappend index 804fcb022..33cc6d4e0 100644 --- a/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-x86/chassis/x86-power-control_%.bbappend @@ -1,4 +1,14 @@ -SRC_URI_gbs = "git://github.com/quanta-bmc/x86-power-control.git" -SRCREV_gbs = "70389494989e438af6b8b1d3b4db602a68f2f9da" +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" +SRC_URI_append_gbs = " file://power-config-host0.json \ + file://chassis-system-reset.service \ + " -SYSTEMD_SERVICE_${PN}_gbs = "xyz.openbmc_project.Chassis.Control.Power.service" +EXTRA_OECMAKE_append_gbs = " -DCHASSIS_SYSTEM_RESET=ON" + +RDEPENDS_${PN}_append_gbs = " bash" +RDEPENDS_${PN}_append_gbs = " gbs-hotswap-power-cycle" + +do_install_append_gbs() { + install -d ${D}${datadir}/${PN} + install -m 0644 ${WORKDIR}/power-config-host0.json ${D}${datadir}/${PN} +} diff --git a/meta-quanta/meta-gsj/conf/bblayers.conf.sample b/meta-quanta/meta-gsj/conf/bblayers.conf.sample index be7a73873..1c895ea00 100644 --- a/meta-quanta/meta-gsj/conf/bblayers.conf.sample +++ b/meta-quanta/meta-gsj/conf/bblayers.conf.sample @@ -9,7 +9,9 @@ BBLAYERS ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-nuvoton \ ##OEROOT##/meta-google \ @@ -20,7 +22,9 @@ BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-nuvoton \ ##OEROOT##/meta-google \ diff --git a/meta-quanta/meta-gsj/conf/layer.conf b/meta-quanta/meta-gsj/conf/layer.conf index 7935f6b74..9bb671876 100644 --- a/meta-quanta/meta-gsj/conf/layer.conf +++ b/meta-quanta/meta-gsj/conf/layer.conf @@ -7,4 +7,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "gsj-layer" BBFILE_PATTERN_gsj-layer := "^${LAYERDIR}/" -LAYERSERIES_COMPAT_gsj-layer = "dunfell gatesgarth" +LAYERSERIES_COMPAT_gsj-layer = "gatesgarth hardknott" diff --git a/meta-quanta/meta-gsj/conf/machine/gsj.conf b/meta-quanta/meta-gsj/conf/machine/gsj.conf index 4db114585..b0d508e44 100644 --- a/meta-quanta/meta-gsj/conf/machine/gsj.conf +++ b/meta-quanta/meta-gsj/conf/machine/gsj.conf @@ -26,6 +26,7 @@ PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-gsj-apps" PREFERRED_PROVIDER_virtual/obmc-fan-mgmt = "packagegroup-gsj-apps" PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-gsj-apps" PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "gsj-ipmi-inventory-map-native" +PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-properties = "gsj-ipmi-fru-properties-native" PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-read-inventory = "gsj-ipmi-fru-read-inventory-native" PREFERRED_PROVIDER_virtual/phosphor-ipmi-sensor-inventory = "gsj-ipmi-sensor-map-native" PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "gsj-led-manager-config-native" diff --git a/meta-quanta/meta-gsj/recipes-kernel/linux/linux-nuvoton/gsj.cfg b/meta-quanta/meta-gsj/recipes-kernel/linux/linux-nuvoton/gsj.cfg index b95eddfec..5ac68df46 100644 --- a/meta-quanta/meta-gsj/recipes-kernel/linux/linux-nuvoton/gsj.cfg +++ b/meta-quanta/meta-gsj/recipes-kernel/linux/linux-nuvoton/gsj.cfg @@ -46,6 +46,8 @@ CONFIG_USB_CONFIGFS_RNDIS=y CONFIG_USB_CONFIGFS_EEM=y CONFIG_USB_CONFIGFS_MASS_STORAGE=y CONFIG_USB_CONFIGFS_F_HID=y +CONFIG_USB_GADGET_NPCM_USB2=y +CONFIG_USB_NPCM_UDC=y CONFIG_MEDIA_SUPPORT=y CONFIG_FORCE_MAX_ZONEORDER=12 diff --git a/meta-quanta/meta-gsj/recipes-phosphor/ipmi/gsj-ipmi-fru-properties-native.bb b/meta-quanta/meta-gsj/recipes-phosphor/ipmi/gsj-ipmi-fru-properties-native.bb new file mode 100644 index 000000000..656fcb969 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-phosphor/ipmi/gsj-ipmi-fru-properties-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "FRU properties config for ipmi-fru-parser" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit native +inherit phosphor-ipmi-fru + +SRC_URI += "file://extra-properties.yaml" + +PROVIDES += "virtual/phosphor-ipmi-fru-properties" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${properties_datadir} + install -d ${DEST} + install extra-properties.yaml ${DEST} +} diff --git a/meta-quanta/meta-gsj/recipes-phosphor/ipmi/gsj-ipmi-fru-properties/extra-properties.yaml b/meta-quanta/meta-gsj/recipes-phosphor/ipmi/gsj-ipmi-fru-properties/extra-properties.yaml new file mode 100644 index 000000000..8a5668295 --- /dev/null +++ b/meta-quanta/meta-gsj/recipes-phosphor/ipmi/gsj-ipmi-fru-properties/extra-properties.yaml @@ -0,0 +1,7 @@ +/system/chassis/bmc: + xyz.openbmc_project.Inventory.Item: + Present: 'true' + +/system/chassis/hsbp: + xyz.openbmc_project.Inventory.Item: + Present: 'true' diff --git a/meta-quanta/meta-olympus-nuvoton/conf/bblayers.conf.sample b/meta-quanta/meta-olympus-nuvoton/conf/bblayers.conf.sample index c79cda288..f7b4c2210 100644 --- a/meta-quanta/meta-olympus-nuvoton/conf/bblayers.conf.sample +++ b/meta-quanta/meta-olympus-nuvoton/conf/bblayers.conf.sample @@ -9,7 +9,9 @@ BBLAYERS ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-nuvoton \ ##OEROOT##/meta-google \ @@ -20,7 +22,9 @@ BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-openembedded/meta-oe \ ##OEROOT##/meta-openembedded/meta-networking \ + ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-nuvoton \ ##OEROOT##/meta-google \ diff --git a/meta-quanta/meta-olympus-nuvoton/conf/layer.conf b/meta-quanta/meta-olympus-nuvoton/conf/layer.conf index 6d8da09f8..0c2366e53 100644 --- a/meta-quanta/meta-olympus-nuvoton/conf/layer.conf +++ b/meta-quanta/meta-olympus-nuvoton/conf/layer.conf @@ -7,4 +7,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "olympus-nuvoton-layer" BBFILE_PATTERN_olympus-nuvoton-layer := "^${LAYERDIR}/" -LAYERSERIES_COMPAT_olympus-nuvoton-layer = "dunfell gatesgarth" +LAYERSERIES_COMPAT_olympus-nuvoton-layer = "gatesgarth hardknott" diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend index 938bfb60f..9b2fe3aa5 100644 --- a/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend +++ b/meta-quanta/meta-olympus-nuvoton/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend @@ -37,4 +37,4 @@ PECIITEMS = "${@compose_list(d, 'PECIITEMSFMT', 'PECINAMES')}" PECIENVS = "obmc/hwmon/{0}" SYSTEMD_ENVIRONMENT_FILE_${PN}_append_olympus-nuvoton = " ${@compose_list(d, 'PECIENVS', 'PECIITEMS')}" -EXTRA_OECONF_append_olympus-nuvoton = " --enable-update-functional-on-fail" +EXTRA_OEMESON_append_olympus-nuvoton = " -Dupdate-functional-on-fail=true" diff --git a/meta-quanta/meta-q71l/conf/bblayers.conf.sample b/meta-quanta/meta-q71l/conf/bblayers.conf.sample index d59a6c4c6..880ce33b1 100644 --- a/meta-quanta/meta-q71l/conf/bblayers.conf.sample +++ b/meta-quanta/meta-q71l/conf/bblayers.conf.sample @@ -12,6 +12,7 @@ BBLAYERS ?= " \ ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ ##OEROOT##/meta-openembedded/meta-webserver \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-aspeed \ ##OEROOT##/meta-x86 \ @@ -25,6 +26,7 @@ BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta-openembedded/meta-perl \ ##OEROOT##/meta-openembedded/meta-python \ ##OEROOT##/meta-openembedded/meta-webserver \ + ##OEROOT##/meta-security \ ##OEROOT##/meta-phosphor \ ##OEROOT##/meta-aspeed \ ##OEROOT##/meta-x86 \ diff --git a/meta-quanta/meta-q71l/conf/layer.conf b/meta-quanta/meta-q71l/conf/layer.conf index 80bae52e9..9e5616029 100644 --- a/meta-quanta/meta-q71l/conf/layer.conf +++ b/meta-quanta/meta-q71l/conf/layer.conf @@ -7,3 +7,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "q71l" BBFILE_PATTERN_q71l = "" +LAYERSERIES_COMPAT_q71l = "gatesgarth hardknott" diff --git a/meta-quanta/meta-q71l/conf/machine/quanta-q71l.conf b/meta-quanta/meta-q71l/conf/machine/quanta-q71l.conf index 05ebc8262..2bcaeaaa1 100644 --- a/meta-quanta/meta-q71l/conf/machine/quanta-q71l.conf +++ b/meta-quanta/meta-q71l/conf/machine/quanta-q71l.conf @@ -4,7 +4,7 @@ KERNEL_DEVICETREE = "${KMACHINE}-bmc-${MACHINE}.dtb" require conf/machine/include/ast2400.inc require conf/machine/include/obmc-bsp-common.inc -UBOOT_MACHINE_palmetto = "ast_g4_ncsi_config" +UBOOT_MACHINE = "ast_g4_ncsi_config" UBOOT_ENTRYPOINT = "0x40008000" UBOOT_LOADADDRESS = "0x40008000" diff --git a/meta-quanta/meta-q71l/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-quanta/meta-q71l/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend index cc05c010a..89a0b7442 100644 --- a/meta-quanta/meta-q71l/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend +++ b/meta-quanta/meta-q71l/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend @@ -23,4 +23,4 @@ Q71L_ITEMS += "${@compose_list(d, 'Q71L_PSUBASE', 'Q71L_PSUS')}" ENVS = "obmc/hwmon/{0}" SYSTEMD_ENVIRONMENT_FILE_${PN}_append_quanta-q71l := " ${@compose_list(d, 'ENVS', 'Q71L_ITEMS')}" -EXTRA_OECONF_append_quanta-q71l = " --enable-negative-errno-on-fail" +EXTRA_OEMESON_append_quanta-q71l = " -Dnegative-errno-on-fail=true" |