diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-07-30 00:16:52 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-07-30 00:16:52 +0300 |
commit | bb6a14e2f317abf60677c6ad8de9c33d5760bf36 (patch) | |
tree | 00457d3677e86437cec25fd7dab6c4513a53b1a4 /meta-quanta/meta-gbs | |
parent | defdca82c107f46e980c84bffb1b2c1263522fa0 (diff) | |
parent | cf6fd27dbd8e2d1b507f8c3752b85801b2c6ef57 (diff) | |
download | openbmc-bb6a14e2f317abf60677c6ad8de9c33d5760bf36.tar.xz |
Merge tag '0.63' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-quanta/meta-gbs')
40 files changed, 776 insertions, 2255 deletions
diff --git a/meta-quanta/meta-gbs/conf/local.conf.sample b/meta-quanta/meta-gbs/conf/local.conf.sample index 787ab301b..f590e64f8 100644 --- a/meta-quanta/meta-gbs/conf/local.conf.sample +++ b/meta-quanta/meta-gbs/conf/local.conf.sample @@ -3,7 +3,7 @@ DISTRO ?= "gbmc" PACKAGE_CLASSES ?= "package_rpm" SANITY_TESTED_DISTROS_append ?= " *" EXTRA_IMAGE_FEATURES = "debug-tweaks" -USER_CLASSES ?= "buildstats image-mklibs image-prelink" +USER_CLASSES ?= "buildstats image-prelink" PATCHRESOLVE = "noop" BB_DISKMON_DIRS = "\ STOPTASKS,${TMPDIR},1G,100K \ diff --git a/meta-quanta/meta-gbs/conf/machine/gbs.conf b/meta-quanta/meta-gbs/conf/machine/gbs.conf index 6f54e383b..a7a59e9ba 100644 --- a/meta-quanta/meta-gbs/conf/machine/gbs.conf +++ b/meta-quanta/meta-gbs/conf/machine/gbs.conf @@ -15,33 +15,45 @@ GBMC_NCSI_IF_NAME = "eth0" GBMC_KCS_DEV = "ipmi-kcs1" # Overwrite flash offsets -FLASH_ROFS_OFFSET = "7168" -FLASH_RWFS_OFFSET = "62400" +FLASH_KERNEL_OFFSET_flash-65536 = "2048" +FLASH_ROFS_OFFSET_flash-65536 = "7168" +FLASH_RWFS_OFFSET_flash-65536 = "62400" FLASH_SIZE = "65536" -OBMC_MACHINE_FEATURES += "\ - obmc-phosphor-fan-mgmt \ - obmc-phosphor-chassis-mgmt \ - obmc-phosphor-flash-mgmt \ - obmc-host-ipmi \ - obmc-host-state-mgmt \ - obmc-chassis-state-mgmt \ - obmc-bmc-state-mgmt \ - " - -VIRTUAL-RUNTIME_obmc-host-state-manager = "x86-power-control" -VIRTUAL-RUNTIME_obmc-chassis-state-manager = "x86-power-control" -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 = "gbmc-kcs-config" PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "gbs-led-manager-config-native" PREFERRED_PROVIDER_virtual/bios-update = "gbs-bios-update" # Remove unneeded binaries from image +IMAGE_FEATURES_remove = "obmc-bmc-state-mgmt" +IMAGE_FEATURES_remove = "obmc-bmcweb" +IMAGE_FEATURES_remove = "obmc-chassis-mgmt" +IMAGE_FEATURES_remove = "obmc-chassis-state-mgmt" +IMAGE_FEATURES_remove = "obmc-console" +IMAGE_FEATURES_remove = "obmc-dbus-monitor" +IMAGE_FEATURES_remove = "obmc-devtools" IMAGE_FEATURES_remove = "obmc-fan-control" +IMAGE_FEATURES_remove = "obmc-fan-mgmt" +IMAGE_FEATURES_remove = "obmc-flash-mgmt" +IMAGE_FEATURES_remove = "obmc-fru-ipmi" +IMAGE_FEATURES_remove = "obmc-health-monitor" +IMAGE_FEATURES_remove = "obmc-host-ctl" +IMAGE_FEATURES_remove = "obmc-host-ipmi" +IMAGE_FEATURES_remove = "obmc-host-state-mgmt" +IMAGE_FEATURES_remove = "obmc-ikvm" +IMAGE_FEATURES_remove = "obmc-inventory" +IMAGE_FEATURES_remove = "obmc-leds" +IMAGE_FEATURES_remove = "obmc-logging-mgmt" +IMAGE_FEATURES_remove = "obmc-remote-logging-mgmt" +IMAGE_FEATURES_remove = "obmc-rng" +IMAGE_FEATURES_remove = "obmc-net-ipmi" +IMAGE_FEATURES_remove = "obmc-sensors" IMAGE_FEATURES_remove = "obmc-software" +IMAGE_FEATURES_remove = "obmc-system-mgmt" +IMAGE_FEATURES_remove = "obmc-telemetry" IMAGE_FEATURES_remove = "obmc-debug-collector" -IMAGE_FEATURES_remove = "obmc-net-ipmi" +IMAGE_FEATURES_remove = "obmc-settings-mgmt" +IMAGE_FEATURES_remove = "obmc-network-mgmt" +IMAGE_FEATURES_remove = "obmc-user-mgmt" +IMAGE_FEATURES_remove = "obmc-user-mgmt-ldap" +OBMC_IMAGE_BASE_INSTALL_remove = "packagegroup-obmc-apps-extras" diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh index 3a215fa50..36dfa452c 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2020 Google LLC # Copyright 2020 Quanta Computer Inc. # @@ -20,11 +20,23 @@ SPI_SW_SELECT=169 # Kernel control string for bind/unbind -KERNEL_FIU_ID="c0000000.fiu" +KERNEL_FIU_ID="c0000000.spi" # Kernel sysfs path for bind/unbind KERNEL_SYSFS_FIU="/sys/bus/platform/drivers/NPCM-FIU" +# the node of FIU is spi for kernel 5.10, but +# for less than or equal kernel 5.4, the node +# is fiu +for fname in $(find ${KERNEL_SYSFS_FIU} -type l) +do + if [ "${fname##*\.}" == "fiu" ] + then + KERNEL_FIU_ID="c0000000.fiu" + break + fi +done + IMAGE_FILE="/tmp/image-bios" # Taken from /run/initramfs/update diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-nvme-pwr-ctrl/gbs-nvme-pwr-ctrl.bb b/meta-quanta/meta-gbs/recipes-gbs/gbs-nvme-pwr-ctrl/gbs-nvme-pwr-ctrl.bb deleted file mode 100644 index 21ef52c49..000000000 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-nvme-pwr-ctrl/gbs-nvme-pwr-ctrl.bb +++ /dev/null @@ -1,19 +0,0 @@ -SUMMARY = "NVMe Drives Power Control" -DESCRIPTION = "Daemon to monitor and control the power of NVMe drives" -PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -inherit meson pkgconfig -inherit systemd - -DEPENDS += "sdbusplus" -DEPENDS += "boost" -DEPENDS += "libgpiod" - -SRC_URI = "git://github.com/quanta-bmc/nvme-power-control;protocol=git" -SRCREV = "3b39e92a8340d8ba1bd40a03af3f5a9049da3bc7" - -S = "${WORKDIR}/git" - -SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Control.Nvme.Power.service" diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh index d0453ec5e..8c7cbd54a 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh @@ -128,9 +128,21 @@ set_hdd_prsnt() { fi } -KERNEL_FIU_ID="c0000000.fiu" +KERNEL_FIU_ID="c0000000.spi" KERNEL_SYSFS_FIU="/sys/bus/platform/drivers/NPCM-FIU" +# the node of FIU is spi for kernel 5.10, but +# for less than or equal kernel 5.4, the node +# is fiu +for fname in $(find ${KERNEL_SYSFS_FIU} -type l) +do + if [ "${fname##*\.}" == "fiu" ] + then + KERNEL_FIU_ID="c0000000.fiu" + break + fi +done + bind_host_mtd() { set_gpio_direction 'SPI_SW_SELECT' high if [[ -d ${KERNEL_SYSFS_FIU}/${KERNEL_FIU_ID} ]]; then @@ -173,13 +185,6 @@ verify_host_bios() { unbind_host_mtd } -reset_phy() { - ifconfig eth1 down - set_gpio_direction 'RST_BMC_PHY_N' low - set_gpio_direction 'RST_BMC_PHY_N' high - ifconfig eth1 up -} - parse_pe_fru() { pe_fruid=3 for i in {1..2}; @@ -225,6 +230,14 @@ check_power_status() { echo $res0 } +clk_buf_bus_switch="11-0076" +clk_buf_driver="/sys/bus/i2c/drivers/pca954x/" + +bind_clk_buf_switch() { + echo "Re-bind i2c bus 11 clk_buf_switch" + echo "${clk_buf_bus_switch}" > "${clk_buf_driver}"/bind +} + main() { get_board_rev_id get_board_sku_id @@ -238,8 +251,6 @@ main() { check_board_sku - reset_phy - if [[ $(check_power_status) != \ 'xyz.openbmc_project.State.Chassis.PowerState.On' ]]; then verify_host_bios @@ -257,6 +268,9 @@ main() { xyz.openbmc_project.State.Host \ RequestedHostTransition s \ xyz.openbmc_project.State.Host.Transition.On + + sleep 1 + bind_clk_buf_switch else echo "Host is already running, doing nothing!" >&2 fi diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch deleted file mode 100644 index 1cfd330ab..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8e211c8bc64521d772c4389219889a240b40307b Mon Sep 17 00:00:00 2001 -From: Charles <Charles.Hsu@quantatw.com> -Date: Fri, 14 Aug 2020 18:06:22 +0800 -Subject: [PATCH] meta-gis: Enable adm1272 ADM1272_TEMP1_EN - ---- - drivers/hwmon/pmbus/adm1275.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c -index 5caa37fbfc18..550b9a8388f6 100644 ---- a/drivers/hwmon/pmbus/adm1275.c -+++ b/drivers/hwmon/pmbus/adm1275.c -@@ -595,11 +595,13 @@ static int adm1275_probe(struct i2c_client *client, - tindex = 8; - - info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | -- PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT; -+ PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | -+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; - -- /* Enable VOUT if not enabled (it is disabled by default) */ -- if (!(config & ADM1278_VOUT_EN)) { -- config |= ADM1278_VOUT_EN; -+ -+ /* Enable VOUT & TEMP1 if not enabled (it is disabled by default) */ -+ if ((config & (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) != (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) { -+ config |= ADM1278_VOUT_EN | ADM1278_TEMP1_EN; - ret = i2c_smbus_write_byte_data(client, - ADM1275_PMON_CONFIG, - config); -@@ -610,9 +612,7 @@ static int adm1275_probe(struct i2c_client *client, - } - } - -- if (config & ADM1278_TEMP1_EN) -- info->func[0] |= -- PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; -+ - if (config & ADM1278_VIN_EN) - info->func[0] |= PMBUS_HAVE_VIN; - break; --- -2.25.1 - diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-Add-kernel-seven-seg-display-support.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-Add-kernel-seven-seg-display-support.patch deleted file mode 100644 index a21707d8a..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-Add-kernel-seven-seg-display-support.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index b9e6d4c3e906..aa7ce9d72d2c 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -59,3 +59,5 @@ obj-$(CONFIG_HABANA_AI) += habanalabs/ - obj-$(CONFIG_XILINX_SDFEC) += xilinx_sdfec.o - obj-$(CONFIG_NPCM7XX_LPC_BPC) += npcm7xx-lpc-bpc.o - obj-$(CONFIG_NPCM7XX_PCI_MBOX) += npcm7xx-pci-mbox.o -+obj-$(CONFIG_SEVEN_SEGMENT_DISPLAY) += seven_seg_disp.o -+obj-$(CONFIG_SEVEN_SEGMENT_GPIO) += seven_seg_gpio.o diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch deleted file mode 100644 index 8ae624a51..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch +++ /dev/null @@ -1,293 +0,0 @@ -From 2d46e81d9bbb624695bac8400a4ac41b7f116ec4 Mon Sep 17 00:00:00 2001 -From: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Date: Fri, 27 Jul 2018 12:34:54 -0700 -Subject: [PATCH 2/3] drivers: misc: Character device driver for seven segment - display - -Character device driver which implements the user-space -API for letting a user write to two 7-segment displays including -any conversion methods necessary to map the user input -to two 7-segment displays. - -Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Signed-off-by: Kun Yi <kunyi@google.com> -Signed-off-by: Benjamin Fair <benjaminfair@google.com> ---- - drivers/misc/Kconfig | 8 ++ - drivers/misc/Makefile | 1 + - drivers/misc/seven_seg_disp.c | 201 ++++++++++++++++++++++++++++++++++ - drivers/misc/seven_seg_disp.h | 34 ++++++ - 4 files changed, 244 insertions(+) - create mode 100644 drivers/misc/seven_seg_disp.c - create mode 100644 drivers/misc/seven_seg_disp.h - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 9d96469fb41c..d443de886346 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -473,6 +473,14 @@ config VEXPRESS_SYSCFG - bus. System Configuration interface is one of the possible means - of generating transactions on this bus. - -+config SEVEN_SEGMENT_DISPLAY -+ tristate "Character driver for seven segment display support" -+ help -+ Character device driver which implements the user-space -+ API for letting a user write to two 7-segment displays including -+ any conversion methods necessary to map the user input -+ to two 7-segment displays. -+ - config PCI_ENDPOINT_TEST - depends on PCI - select CRC32 - -diff --git a/drivers/misc/seven_seg_disp.c b/drivers/misc/seven_seg_disp.c -new file mode 100644 -index 000000000000..db1c571f68e5 ---- /dev/null -+++ b/drivers/misc/seven_seg_disp.c -@@ -0,0 +1,201 @@ -+/* -+ * Copyright (c) 2016 Google, Inc -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 or later as -+ * published by the Free Software Foundation. -+ */ -+ -+#include <linux/module.h> -+#include <linux/version.h> -+#include <linux/kernel.h> -+#include <linux/types.h> -+#include <linux/kdev_t.h> -+#include <linux/fs.h> -+#include <linux/uaccess.h> -+#include <linux/ctype.h> -+#include <linux/of.h> -+#include <linux/io.h> -+#include <linux/slab.h> -+#include <linux/platform_device.h> -+ -+#include "seven_seg_disp.h" -+ -+#define LED_DOT 0x01 -+ -+/* -+ * 0 1 2 3 4 5 6 7 8 9 A B C D E F -+ * _ _ _ _ _ _ _ _ _ _ _ _ -+ * | | | _| _| |_| |_ |_ | |_| |_| |_| |_ | _| |_ |_ -+ * |_| | |_ _| | _| |_| | |_| | | | |_| |_ |_| |_ | -+ * -+ * data[7:1] = led[a:g] -+ */ -+const u8 seven_seg_bits[] = { -+ 0xFC, 0x60, 0xDA, 0xF2, 0x66, 0xB6, 0xBE, 0xE0, -+ 0xFE, 0xF6, 0xEE, 0x3E, 0x9C, 0x7A, 0x9E, 0x8E -+ }; -+ -+/* -+ * 0 1 2 3 4 5 6 7 8 9 A B C D E F -+ * _ _ _ _ _ -+ * | |_ |_| |_ _ _ _ _ _ _ _ |_ _| _| | | -+ * |_ |_ | | _| |_| |_| | | -+ * -+ * data[7:1] = led[a:g] -+ */ -+const u8 special_seven_seg_bits[] = { -+ 0x00, 0x9C, 0x1E, 0xCE, 0x8E, 0x02, 0x02, 0x02, -+ 0x02, 0x02, 0x02, 0x02, 0xB6, 0x7A, 0x7A, 0xEC -+ }; -+ -+static dev_t seven_seg_devno; -+static struct class *seven_seg_disp_class; -+ -+static int seven_seg_disp_open(struct inode *inode, struct file *filp) -+{ -+ struct seven_seg_disp_dev *disp_dev; -+ -+ disp_dev = container_of(inode->i_cdev, -+ struct seven_seg_disp_dev, cdev); -+ filp->private_data = disp_dev; -+ return 0; -+} -+ -+static int seven_seg_disp_close(struct inode *inode, struct file *filp) -+{ -+ filp->private_data = NULL; -+ return 0; -+} -+ -+static ssize_t seven_seg_disp_read(struct file *filp, char __user *buf, size_t -+ len, loff_t *off) -+{ -+ struct seven_seg_disp_dev *disp_dev = filp->private_data; -+ -+ if (disp_dev->disp_data_valid) -+ return -EINVAL; -+ -+ if (copy_to_user(buf, disp_dev->seven_seg_disp_data_array, -+ MAX_DISP_CHAR_SIZE) != 0) { -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static u16 convert_to_disp_data(char *buf) -+{ -+ u8 low_display; -+ u8 high_display; -+ u16 led_value; -+ -+ low_display = seven_seg_bits[hex_to_bin(buf[2])]; -+ -+ high_display = (buf[0] == '1') ? -+ special_seven_seg_bits[hex_to_bin(buf[1])] : -+ seven_seg_bits[hex_to_bin(buf[1])]; -+ -+ led_value = low_display | (high_display << 8); -+ if (buf[0] == '1') -+ led_value |= LED_DOT | (LED_DOT << 8); -+ -+ return led_value; -+} -+ -+static ssize_t seven_seg_disp_write(struct file *filp, const char __user *buf, -+ size_t len, loff_t *off) -+{ -+ int length = len - 1; -+ int i; -+ -+ struct seven_seg_disp_dev *disp_dev = filp->private_data; -+ -+ if (length != MAX_DISP_CHAR_SIZE) -+ return -EINVAL; -+ -+ if (copy_from_user(disp_dev->seven_seg_disp_data_array, -+ buf, length) != 0) { -+ return -EFAULT; -+ } -+ -+ for (i = 0; i < MAX_DISP_CHAR_SIZE; i++) { -+ if (!isxdigit(disp_dev->seven_seg_disp_data_array[i])) -+ return -EINVAL; -+ } -+ -+ disp_dev->current_seven_seg_disp_data = convert_to_disp_data( -+ disp_dev->seven_seg_disp_data_array); -+ disp_dev->disp_data_valid = true; -+ disp_dev->update_seven_seg_data(&disp_dev->parent, -+ disp_dev->current_seven_seg_disp_data); -+ -+ return len; -+} -+ -+static const struct file_operations seven_seg_disp_fops = { -+ -+ .owner = THIS_MODULE, -+ .open = seven_seg_disp_open, -+ .release = seven_seg_disp_close, -+ .read = seven_seg_disp_read, -+ .write = seven_seg_disp_write -+}; -+ -+void seven_seg_rem_cdev(struct seven_seg_disp_dev *disp_dev) -+{ -+ cdev_del(&disp_dev->cdev); -+ device_destroy(seven_seg_disp_class, seven_seg_devno); -+} -+ -+int seven_seg_setup_cdev(struct seven_seg_disp_dev *disp_dev, -+ void (*update_disp_data)(struct device *, u16 data)) -+{ -+ struct device *dev; -+ int err; -+ -+ dev = device_create(seven_seg_disp_class, NULL, -+ seven_seg_devno, -+ NULL, "seven_seg_disp_val"); -+ if (dev == NULL) -+ return -EIO; -+ disp_dev->dev = dev; -+ disp_dev->update_seven_seg_data = update_disp_data; -+ disp_dev->disp_data_valid = false; -+ -+ cdev_init(&disp_dev->cdev, &seven_seg_disp_fops); -+ err = cdev_add(&disp_dev->cdev, seven_seg_devno, 1); -+ if (err) -+ device_destroy(seven_seg_disp_class, seven_seg_devno); -+ return err; -+} -+ -+static int __init seven_seg_disp_init(void) -+{ -+ int err = alloc_chrdev_region(&seven_seg_devno, 0, 1, "disp_state"); -+ -+ if (err < 0) -+ return err; -+ -+ seven_seg_disp_class = class_create(THIS_MODULE, "disp_state"); -+ if (seven_seg_disp_class == NULL) -+ goto unreg_chrdev; -+ -+ return 0; -+ -+unreg_chrdev: -+ unregister_chrdev_region(seven_seg_devno, 1); -+ return -EIO; -+} -+ -+static void __exit seven_seg_disp_exit(void) -+{ -+ class_destroy(seven_seg_disp_class); -+ unregister_chrdev_region(seven_seg_devno, 1); -+} -+ -+module_init(seven_seg_disp_init); -+module_exit(seven_seg_disp_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>"); -+MODULE_DESCRIPTION("Seven segment display character driver"); -diff --git a/drivers/misc/seven_seg_disp.h b/drivers/misc/seven_seg_disp.h -new file mode 100644 -index 000000000000..0ebed0802747 ---- /dev/null -+++ b/drivers/misc/seven_seg_disp.h -@@ -0,0 +1,34 @@ -+/* -+ * Copyright (c) 2016 Google, Inc -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 or later as -+ * published by the Free Software Foundation. -+ */ -+ -+#ifndef SEVEN_SEG_DISP_H -+#define SEVEN_SEG_DISP_H -+ -+#include <linux/device.h> -+#include <linux/cdev.h> -+ -+#define MAX_DISP_CHAR_SIZE 3 -+ -+#define DEFAULT_REFRESH_INTERVAL_MS 600 -+ -+struct seven_seg_disp_dev { -+ bool disp_data_valid; -+ u16 current_seven_seg_disp_data; -+ char seven_seg_disp_data_array[MAX_DISP_CHAR_SIZE]; -+ struct device parent; -+ struct device *dev; -+ struct cdev cdev; -+ void (*update_seven_seg_data)(struct device *, u16 data); -+}; -+ -+int seven_seg_setup_cdev(struct seven_seg_disp_dev *disp_dev, -+ void (*update_disp_data)(struct device *, u16 data)); -+ -+void seven_seg_rem_cdev(struct seven_seg_disp_dev *disp_dev); -+ -+#endif --- -2.22.0.770.g0f2c4a37fd-goog - diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch deleted file mode 100644 index b166c78b8..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch +++ /dev/null @@ -1,267 +0,0 @@ -From ea3e732d2c4a609e621346a96d37713820640196 Mon Sep 17 00:00:00 2001 -From: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Date: Fri, 27 Jul 2018 12:36:24 -0700 -Subject: [PATCH 3/3] drivers: misc: Platform driver for seven segment display - support - -Platform device driver which provides an API for displaying on two -7-segment displays, and implements the required bit-banging. -The hardware assumed is 74HC164 wired to two 7-segment displays. - -Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Signed-off-by: Kun Yi <kunyi@google.com> -Signed-off-by: Benjamin Fair <benjaminfair@google.com> ---- - drivers/misc/Kconfig | 8 ++ -# drivers/misc/Makefile | 2 ++ - drivers/misc/seven_seg_gpio.c | 205 ++++++++++++++++++++++++++++++++++ - 3 files changed, 215 insertions(+) - create mode 100644 drivers/misc/seven_seg_gpio.c - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index d443de886346..e10984e3288f 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -481,6 +481,14 @@ config SEVEN_SEGMENT_DISPLAY - any conversion methods necessary to map the user input - to two 7-segment displays. - -+config SEVEN_SEGMENT_GPIO -+ tristate "Platform driver to update seven segment display" -+ depends on SEVEN_SEGMENT_DISPLAY -+ help -+ Platform device driver which provides an API for displaying on two -+ 7-segment displays, and implements the required bit-banging. -+ The hardware assumed is 74HC164 wired to two 7-segment displays. -+ - config PCI_ENDPOINT_TEST - depends on PCI - select CRC32 -# diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -# index 402bcc3c9961..f39bec664d92 100644 -# --- a/drivers/misc/Makefile -# +++ b/drivers/misc/Makefile -# @@ -53,6 +53,8 @@ obj-$(CONFIG_GENWQE) += genwqe/ -# obj-$(CONFIG_ECHO) += echo/ -# obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o -# obj-$(CONFIG_CXL_BASE) += cxl/ -# +obj-$(CONFIG_SEVEN_SEGMENT_DISPLAY) += seven_seg_disp.o -# +obj-$(CONFIG_SEVEN_SEGMENT_GPIO) += seven_seg_gpio.o -# obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o -# obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o -# obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o - -diff --git a/drivers/misc/seven_seg_gpio.c b/drivers/misc/seven_seg_gpio.c -new file mode 100644 -index 000000000000..e03ea7f8b848 ---- /dev/null -+++ b/drivers/misc/seven_seg_gpio.c -@@ -0,0 +1,205 @@ -+/* -+ * Copyright (C) 2016 Google, Inc -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 or later as -+ * published by the Free Software Foundation. -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/module.h> -+#include <linux/timer.h> -+#include <linux/jiffies.h> -+#include <linux/sizes.h> -+#include <linux/io.h> -+#include <linux/delay.h> -+#include <linux/uaccess.h> -+#include <linux/mutex.h> -+#include <linux/of_platform.h> -+#include <linux/gpio/consumer.h> -+ -+#include "seven_seg_disp.h" -+ -+#define DELAY_INTVL_US 1 -+ -+#define CLOCK_GPIO_NAME "clock" -+#define DATA_GPIO_NAME "data" -+#define CLEAR_GPIO_NAME "clear" -+ -+struct seven_seg_gpio_info { -+ u16 curr_disp_value; -+ u16 refresh_interval; -+ struct timer_list update_timer; -+ struct gpio_desc *clock_gpio; -+ struct gpio_desc *data_gpio; -+ struct gpio_desc *clear_gpio; -+}; -+ -+static void update_seven_seg_gpio_data(struct device *dev, u16 data) -+{ -+ struct platform_device *pdev; -+ struct seven_seg_gpio_info *gpio_info; -+ -+ pdev = container_of(dev, struct platform_device, dev); -+ if (pdev == NULL) { -+ pr_err("invalid NULL platform_device\n"); -+ return; -+ } -+ -+ gpio_info = platform_get_drvdata(pdev); -+ if (gpio_info == NULL) { -+ pr_err("invalid NULL gpio_info\n"); -+ return; -+ } -+ -+ gpio_info->curr_disp_value = data; -+} -+ -+static void clear_seven_seg_gpio_data(struct device *dev, u16 data) -+{ -+ struct platform_device *pdev; -+ struct seven_seg_gpio_info *gpio_info; -+ -+ pdev = container_of(dev, struct platform_device, dev); -+ if (pdev == NULL) { -+ pr_err("invalid NULL platform_device\n"); -+ return; -+ } -+ -+ gpio_info = platform_get_drvdata(pdev); -+ if (gpio_info == NULL) { -+ pr_err("invalid NULL gpio_info\n"); -+ return; -+ } -+ -+ gpio_info->curr_disp_value = 0; -+} -+ -+static void send_seven_seg_gpio_data(u16 disp_data, -+ struct seven_seg_gpio_info *gpio_info) -+{ -+ int i; -+ -+ gpiod_set_value(gpio_info->clear_gpio, 0); -+ udelay(DELAY_INTVL_US); -+ gpiod_set_value(gpio_info->clear_gpio, 1); -+ udelay(DELAY_INTVL_US); -+ -+ for (i = 0; i < 16; i++) { -+ if (disp_data & 0x01) -+ gpiod_set_value(gpio_info->data_gpio, 1); -+ else -+ gpiod_set_value(gpio_info->data_gpio, 0); -+ -+ udelay(DELAY_INTVL_US); -+ -+ gpiod_set_value(gpio_info->clock_gpio, 0); -+ udelay(DELAY_INTVL_US); -+ gpiod_set_value(gpio_info->clock_gpio, 1); -+ udelay(DELAY_INTVL_US); -+ -+ disp_data >>= 1; -+ } -+} -+ -+static void disp_refresh_timer_handler(struct timer_list *t) -+{ -+ u16 disp_data; -+ struct seven_seg_gpio_info *gpio_info = -+ from_timer(gpio_info, t, update_timer); -+ disp_data = gpio_info->curr_disp_value; -+ -+ send_seven_seg_gpio_data(disp_data, gpio_info); -+ mod_timer(&gpio_info->update_timer, -+ jiffies + msecs_to_jiffies(gpio_info->refresh_interval)); -+} -+ -+static const struct of_device_id of_seven_seg_gpio_match[] = { -+ { .compatible = "seven-seg-gpio-dev" }, -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(of, of_seven_seg_gpio_match); -+ -+static int seven_seg_gpio_probe(struct platform_device *pdev) -+{ -+ u16 interval; -+ int result; -+ struct seven_seg_gpio_info *gpio_info; -+ struct device *dev = &pdev->dev; -+ struct seven_seg_disp_dev *disp_dev; -+ -+ gpio_info = devm_kzalloc(dev, -+ sizeof(struct seven_seg_gpio_info), -+ GFP_KERNEL); -+ if (gpio_info == NULL) -+ return -ENOMEM; -+ -+ /* Requesting the clock gpio */ -+ gpio_info->clock_gpio = devm_gpiod_get(dev, CLOCK_GPIO_NAME, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(gpio_info->clock_gpio)) -+ return PTR_ERR(gpio_info->clock_gpio); -+ -+ /* Requesting the data gpio */ -+ gpio_info->data_gpio = devm_gpiod_get(dev, DATA_GPIO_NAME, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(gpio_info->data_gpio)) -+ return PTR_ERR(gpio_info->data_gpio); -+ -+ /* Requesting the clear gpio */ -+ gpio_info->clear_gpio = devm_gpiod_get(dev, CLEAR_GPIO_NAME, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(gpio_info->clear_gpio)) -+ return PTR_ERR(gpio_info->clear_gpio); -+ -+ result = of_property_read_u16(pdev->dev.of_node, -+ "refresh-interval-ms", &interval); -+ gpio_info->refresh_interval = result ? DEFAULT_REFRESH_INTERVAL_MS : -+ interval; -+ -+ /* Start timer to update seven segment display every second */ -+ timer_setup(&gpio_info->update_timer, disp_refresh_timer_handler, 0); -+ result = mod_timer(&gpio_info->update_timer, -+ jiffies + -+ msecs_to_jiffies(gpio_info->refresh_interval)); -+ if (result) -+ return result; -+ -+ gpio_info->curr_disp_value = 0; -+ -+ platform_set_drvdata(pdev, gpio_info); -+ -+ disp_dev = devm_kzalloc(dev, sizeof(struct seven_seg_disp_dev), -+ GFP_KERNEL); -+ disp_dev->parent = *dev; -+ seven_seg_setup_cdev(disp_dev, &update_seven_seg_gpio_data); -+ return 0; -+} -+ -+static int seven_seg_gpio_remove(struct platform_device *pdev) -+{ -+ struct seven_seg_gpio_info *gpio_info = platform_get_drvdata(pdev); -+ struct seven_seg_disp_dev *disp_dev = -+ container_of(&pdev->dev, -+ struct seven_seg_disp_dev, parent); -+ seven_seg_rem_cdev(disp_dev); -+ del_timer_sync(&gpio_info->update_timer); -+ platform_set_drvdata(pdev, NULL); -+ return 0; -+} -+ -+static struct platform_driver seven_seg_gpio_driver = { -+ .probe = seven_seg_gpio_probe, -+ .remove = seven_seg_gpio_remove, -+ .driver = { -+ .name = "seven-seg-gpio", -+ .of_match_table = of_seven_seg_gpio_match, -+ }, -+}; -+ -+module_platform_driver(seven_seg_gpio_driver); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>"); -+MODULE_DESCRIPTION("Seven segment display driver using GPIO config"); --- -2.22.0.770.g0f2c4a37fd-goog - diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend index e5fadfe05..c2b5da404 100644 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend @@ -1,6 +1,2 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/linux-nuvoton:" SRC_URI_append_gbs = " file://gbs.cfg" -SRC_URI_append_gbs = " file://0004-Add-kernel-seven-seg-display-support.patch" -SRC_URI_append_gbs = " file://0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch" -SRC_URI_append_gbs = " file://0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch" -SRC_URI_append_gbs = " file://0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml index 865e4b3b6..76eaa4e51 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml +++ b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-inventory-sensors.yaml @@ -433,3 +433,9 @@ sensorID: 0xFC sensorType: 0x25 offset: 0x01 +# map non-IPMI-SEL to the system event sensor as "Undetermined system hardware failure." +/xyz/openbmc_project/inventory/system: + eventReadingType: 0x6f + sensorID: 0xFE + sensorType: 0x12 + offset: 0x02 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch deleted file mode 100644 index 050c8b43c..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/0001-Advertise-failSafePercent-on-dbus.patch +++ /dev/null @@ -1,117 +0,0 @@ -From c9b6d4589620275a625121b0ea9f4cc4c93b608a Mon Sep 17 00:00:00 2001 -From: Ian Goegebuer <goegebuer@google.com> -Date: Tue, 10 Nov 2020 14:20:47 -0800 -Subject: [PATCH] pid/zone: Add the ability to dynamically set the failSafe - percent - -This change advertises the failSafe percent as a FanSpeed interface -added to the the FanCtrl object generated by the config.json file. - -The target method added in this case sets the failSafePerecent -out of 255 with 255 being 100% and 0 being 0%. - -Example: -`busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone1 xyz.openbmc_project.Control.FanSpeed Target t 178` -Sets the failSafePercent to 69.8% or ~70% -`busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone1 xyz.openbmc_project.Control.FanSpeed Target t 250` -Sets the failSafePercent to 98% - -Signed-off-by: Ian Goegebuer <goegebuer@google.com> -Change-Id: Ief538d865dc1c654427ed9792496ab368e8803e2 ---- - pid/zone.cpp | 11 +++++++++++ - pid/zone.hpp | 11 +++++++++-- - pid/zone_interface.hpp | 1 + - 3 files changed, 21 insertions(+), 2 deletions(-) - -diff --git a/pid/zone.cpp b/pid/zone.cpp -index 441031a..24f6e84 100644 ---- a/pid/zone.cpp -+++ b/pid/zone.cpp -@@ -120,6 +120,11 @@ double DbusPidZone::getFailSafePercent(void) const - return _failSafePercent; - } - -+void DbusPidZone::setFailSafePercent(double newFailSafe) -+{ -+ _failSafePercent = newFailSafe; -+} -+ - double DbusPidZone::getMinThermalSetpoint(void) const - { - return _minThermalOutputSetPt; -@@ -459,4 +464,10 @@ bool DbusPidZone::failSafe() const - return getFailSafeMode(); - } - -+uint64_t DbusPidZone::target(uint64_t value) -+{ -+ setFailSafePercent(((double)value / 255) * 100.0); -+ return ModeObject::target(value); -+} -+ - } // namespace pid_control -diff --git a/pid/zone.hpp b/pid/zone.hpp -index 3bea9c2..c0d1d22 100644 ---- a/pid/zone.hpp -+++ b/pid/zone.hpp -@@ -10,6 +10,7 @@ - - #include <sdbusplus/bus.hpp> - #include <sdbusplus/server.hpp> -+#include <xyz/openbmc_project/Control/FanSpeed/server.hpp> - #include <xyz/openbmc_project/Control/Mode/server.hpp> - - #include <fstream> -@@ -22,7 +23,9 @@ - template <typename... T> - using ServerObject = typename sdbusplus::server::object::object<T...>; - using ModeInterface = sdbusplus::xyz::openbmc_project::Control::server::Mode; --using ModeObject = ServerObject<ModeInterface>; -+using FanSpeedInterface = -+ sdbusplus::xyz::openbmc_project::Control::server::FanSpeed; -+using ModeObject = ServerObject<ModeInterface, FanSpeedInterface>; - - namespace pid_control - { -@@ -63,6 +66,7 @@ class DbusPidZone : public ZoneInterface, public ModeObject - void clearSetPoints(void) override; - void clearRPMCeilings(void) override; - double getFailSafePercent(void) const override; -+ void setFailSafePercent(double) override; - double getMinThermalSetpoint(void) const; - - Sensor* getSensor(const std::string& name) override; -@@ -88,6 +92,9 @@ class DbusPidZone : public ZoneInterface, public ModeObject - /* Method for reading whether in fail-safe mode over dbus */ - bool failSafe() const override; - -+ /* Method for setting the failSafePercent over dbus */ -+ uint64_t target(uint64_t value) override; -+ - private: - std::ofstream _log; - -@@ -95,7 +102,7 @@ class DbusPidZone : public ZoneInterface, public ModeObject - double _maximumSetPoint = 0; - bool _manualMode = false; - const double _minThermalOutputSetPt; -- const double _failSafePercent; -+ double _failSafePercent; - - std::set<std::string> _failSafeSensors; - -diff --git a/pid/zone_interface.hpp b/pid/zone_interface.hpp -index a024c0e..9ea89c1 100644 ---- a/pid/zone_interface.hpp -+++ b/pid/zone_interface.hpp -@@ -70,6 +70,7 @@ class ZoneInterface - * fail safe. - */ - virtual double getFailSafePercent() const = 0; -+ virtual void setFailSafePercent(double newFailSafe) = 0; - - /** Return if the zone is set to manual mode. false equates to automatic - * mode (the default). --- -2.29.2.222.g5d2a92d10f8-goog diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in index 21ba368df..2c921a7f8 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json.in @@ -73,8 +73,8 @@ }, { "name": "cputemp", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/cputemp", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/cputemp", "writePath": "", "min": 0, "max": 0, @@ -82,9 +82,9 @@ "timeout": 0 }, { - "name": "zone0_vr", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/zone0_vr", + "name": "vddcr_cpu", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddcr_cpu", "writePath": "", "min": 0, "max": 0, @@ -92,9 +92,49 @@ "timeout": 0 }, { - "name": "nvme", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/nvme", + "name": "vddcr_soc", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddcr_soc", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "vddio_abcd", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddio_abcd", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "vddio_efgh", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/vddio_efgh", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "p12v_mobo", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/p12v_mobo", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "powerseq_temp", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/powerseq_temp", "writePath": "", "min": 0, "max": 0, @@ -103,8 +143,168 @@ }, { "name": "p12v_fan", - "type": "margin", - "readPath": "/xyz/openbmc_project/extsensors/margin/p12v_fan", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/p12v_fan", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme0", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme0", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme1", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme1", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme2", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme2", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme3", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme3", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme4", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme4", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme5", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme5", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme6", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme6", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme7", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme7", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme8", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme8", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme9", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme9", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme10", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme10", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme11", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme11", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme12", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme12", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme13", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme13", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme14", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme14", + "writePath": "", + "min": 0, + "max": 0, + "ignoreDbusMinMax": true, + "timeout": 0 + }, + { + "name": "nvme15", + "type": "temp", + "readPath": "/xyz/openbmc_project/sensors/temperature/nvme15", "writePath": "", "min": 0, "max": 0, @@ -162,15 +362,15 @@ }, { "name": "cputemp", - "type": "margin", + "type": "temp", "inputs": [ "cputemp" ], - "setpoint": 10.0, + "setpoint": 80.0, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 714.0, - "integralCoeff": 9.0, + "proportionalCoeff": -714.0, + "integralCoeff": -9.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, @@ -185,15 +385,20 @@ }, { "name": "zone0_vr", - "type": "margin", + "type": "temp", "inputs": [ - "zone0_vr" + "vddcr_cpu", + "vddcr_soc", + "vddio_abcd", + "vddio_efgh", + "p12v_mobo", + "powerseq_temp" ], - "setpoint": 10.0, + "setpoint": 90.0, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 536.0, - "integralCoeff": 9.0, + "proportionalCoeff": -536.0, + "integralCoeff": -9.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, @@ -346,16 +551,16 @@ } }, { - "name": "nvme", - "type": "margin", + "name": "p12v_fan", + "type": "temp", "inputs": [ - "nvme" + "p12v_fan" ], - "setpoint": 10.0, + "setpoint": 90.0, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 1250.0, - "integralCoeff": 12.0, + "proportionalCoeff": -268.0, + "integralCoeff": -4.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, @@ -369,16 +574,361 @@ } }, { - "name": "p12v_fan", - "type": "margin", + "name": "nvme0", + "type": "temp", "inputs": [ - "p12v_fan" + "nvme0" ], - "setpoint": 10.0, + "setpoint": @WCTemp00@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme1", + "type": "temp", + "inputs": [ + "nvme1" + ], + "setpoint": @WCTemp01@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme2", + "type": "temp", + "inputs": [ + "nvme2" + ], + "setpoint": @WCTemp02@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme3", + "type": "temp", + "inputs": [ + "nvme3" + ], + "setpoint": @WCTemp03@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme4", + "type": "temp", + "inputs": [ + "nvme4" + ], + "setpoint": @WCTemp04@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme5", + "type": "temp", + "inputs": [ + "nvme5" + ], + "setpoint": @WCTemp05@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme6", + "type": "temp", + "inputs": [ + "nvme6" + ], + "setpoint": @WCTemp06@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme7", + "type": "temp", + "inputs": [ + "nvme7" + ], + "setpoint": @WCTemp07@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme8", + "type": "temp", + "inputs": [ + "nvme8" + ], + "setpoint": @WCTemp08@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme9", + "type": "temp", + "inputs": [ + "nvme9" + ], + "setpoint": @WCTemp09@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme10", + "type": "temp", + "inputs": [ + "nvme10" + ], + "setpoint": @WCTemp10@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme11", + "type": "temp", + "inputs": [ + "nvme11" + ], + "setpoint": @WCTemp11@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme12", + "type": "temp", + "inputs": [ + "nvme12" + ], + "setpoint": @WCTemp12@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme13", + "type": "temp", + "inputs": [ + "nvme13" + ], + "setpoint": @WCTemp13@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme14", + "type": "temp", + "inputs": [ + "nvme14" + ], + "setpoint": @WCTemp14@, + "pid": { + "samplePeriod": 1.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, + "feedFwdOffsetCoeff": 0.0, + "feedFwdGainCoeff": 0.0, + "integralLimit_min": 2679.0, + "integralLimit_max": 18000.0, + "outLim_min": 2679.0, + "outLim_max": 18000.0, + "slewNeg": 0.0, + "slewPos": 0.0, + "positiveHysteresis": 0.0, + "negativeHysteresis": 0.0 + } + }, + { + "name": "nvme15", + "type": "temp", + "inputs": [ + "nvme15" + ], + "setpoint": @WCTemp15@, "pid": { "samplePeriod": 1.0, - "proportionalCoeff": 268.0, - "integralCoeff": 4.0, + "proportionalCoeff": -1250.0, + "integralCoeff": -12.0, "feedFwdOffsetCoeff": 0.0, "feedFwdGainCoeff": 0.0, "integralLimit_min": 2679.0, diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh index 9617d0da4..5ceac7ea5 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh @@ -15,13 +15,74 @@ mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan2 Fan_0_To_4_Hwmon="$(ls /sys/devices/platform/ahb/ahb\:*/*pwm-fan-controller/hwmon/)" if [[ "$Fan_0_To_4_Hwmon" != "" ]]; then - sed -i "s/@Fan_0_To_4_Hwmon@/$Fan_0_To_4_Hwmon/g" $TEMP_FILE + sed -i "s/@Fan_0_To_4_Hwmon@/$Fan_0_To_4_Hwmon/g" $TEMP_FILE fi +presentGpio=() +presentState=() +gpioPath="/sys/class/gpio/gpio" +if [[ -f "/etc/nvme/nvme_config.json" ]]; then + presentGpio=($(cat /etc/nvme/nvme_config.json | grep NVMeDrivePresentPin \ + | awk '{print $2}' | cut -d "," -f 0)) +fi + +nvmePath="/xyz/openbmc_project/sensors/temperature/nvme" +nvmeInventoryPath="/xyz/openbmc_project/inventory/system/chassis/motherboard/nvme" +# Get and Set WCTEMP +for ((i = 0; i < 16; i++)); do + name="@WCTemp$(printf "%02d" $i)@" + wcTemp=72000 + + if [[ -d "${gpioPath}${presentGpio[i]}" ]] && + [[ "$(cat ${gpioPath}${presentGpio[i]}/value)" == "0" ]]; then + presentState[i]="true" + else + presentState[i]="false" + fi + + if [[ "${presentState[i]}" == "true" ]]; then + actualWCTemp=0 + for ((j = 0; j < 3; j++)); do + actualWCTemp="$( + busctl get-property xyz.openbmc_project.nvme.manager \ + ${nvmePath}${i} \ + xyz.openbmc_project.Sensor.Threshold.Critical \ + CriticalHigh | awk '{print $2}' + )" + if [[ "${actualWCTemp}" -ne 0 ]]; then + break + fi + + echo "${nvmePath}${i} WCTemp was read to be 0, retrying after 1 sec sleep" + sleep 1 + done + + if [[ "${actualWCTemp}" -ne 0 ]]; then + wcTemp="$(echo "${actualWCTemp} -7" | awk '{printf $1 + $2}')" + else + echo "${nvmePath}${i} WCTemp was read to be 0, using default WCTemp: ${wcTemp}" + fi + fi + + sed -i "s/$name/${wcTemp}/g" "$TEMP_FILE" + + if [[ "${presentState[i]}" == "false" ]]; then + sensorPath="${nvmePath}${i}" + pathLine=$(grep -nw "$sensorPath" "$TEMP_FILE" | awk -F ':' '{print $1}') + sed -i "$TEMP_FILE" -re "$((pathLine - 3)),$((pathLine + 6))d" + if [ $i -eq 15 ]; then + sed -i "$((pathLine - 4))s/,//" "$TEMP_FILE" + fi + + listLine=$(grep -n "\"name\": \"nvme${i}\"" "$TEMP_FILE" | awk -F ':' '{print $1}') + sed -i "$TEMP_FILE" -re "$((listLine - 1)),$((listLine + 21))d" + if [ $i -eq 15 ]; then + sed -i "$((listLine - 2))s/,//" "$TEMP_FILE" + fi + fi +done + # Use shell parameter expansion to trim the ".in" suffix mv "$TEMP_FILE" "${FAN_TABLE_FILE_IN%".in"}" -# start read margin temp wait -/usr/bin/read-margin-temp-wait.sh & - exit 0 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend index 7acd44c70..e617f8679 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -2,7 +2,6 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" SRC_URI_append_gbs = " file://config.json.in \ file://fan-table-init.sh \ file://phosphor-pid-control.service \ - file://0001-Advertise-failSafePercent-on-dbus.patch \ " FILES_${PN}_append_gbs = " ${datadir}/swampd/config.json.in" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend index ff9e512c7..9e2666417 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend @@ -14,12 +14,31 @@ OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-ecc" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-sysinit" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-ipmi-entity-association-map" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " usb-network" -OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " mac-address" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-image-signing" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " openssl-bin" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-ipmi-blobs-binarystore" -OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-nvme-pwr-ctrl" -OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " read-margin-temp" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-virtual-sensor" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " acpi-power-state-daemon" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " virtual/obmc-gpio-presence" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ipmitool" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-health-monitor" + +# Add back packages that were part of packagegroup-obmc-apps-extras +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-hwmon" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-inventory-manager" +# Required for obmc-bmcweb +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " bmcweb" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-bmcweb-cert-config" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-nslcd-authority-cert-config" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-user-manager" +# Required for LEDs. Part of obmc-leds +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ${VIRTUAL-RUNTIME_obmc-leds-manager}" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ${VIRTUAL-RUNTIME_obmc-leds-sysfs}" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " ${VIRTUAL-RUNTIME_obmc-led-monitor}" +# Required for the front port. Part of obmc-console +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " obmc-console" +# Required from packagegroup-gbs-apps +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-bmc-update" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " virtual/bios-update" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " x86-power-control" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-pid-control" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json b/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json index b834fa876..01bd7836b 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json @@ -479,7 +479,11 @@ "/xyz/openbmc_project/sensors/fan_tach/fan1", "/xyz/openbmc_project/sensors/fan_tach/fb_fan0", "/xyz/openbmc_project/sensors/fan_tach/fb_fan1", - "/xyz/openbmc_project/sensors/fan_tach/fb_fan2" + "/xyz/openbmc_project/sensors/fan_tach/fb_fan2", + + "/xyz/openbmc_project/sensors/utilization/CPU", + "/xyz/openbmc_project/sensors/utilization/Memory", + "/xyz/openbmc_project/sensors/utilization/Storage_RW" ] } ] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json index 4ad11bc6e..43ee49923 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json @@ -1,5 +1,5 @@ [{ "blobBaseId": "/skm/hss/", - "sysFilePath": "/sys/class/i2c-adapter/i2c-5/5-0050/5-00500/nvmem", + "sysFilePath": "/sys/class/i2c-adapter/i2c-5/5-0050/eeprom", "offsetBytes": 256 }] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-Chassis-State-Transition-interface.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-Chassis-State-Transition-interface.patch deleted file mode 100644 index 74f982b33..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Add-Chassis-State-Transition-interface.patch +++ /dev/null @@ -1,79 +0,0 @@ -From a1f9d797753e32b36e08e7d611ff88b10e9bbad2 Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" <jason.m.bills@linux.intel.com> -Date: Thu, 30 Jan 2020 16:18:33 -0800 -Subject: [PATCH 1/3] Add Chassis State Transition interface - -This adds the Chassis State Transition interface in preparation -to support the mapping defined in the design document below. - -ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/22358 - -Tested: -Ran each IPMI chassis control command to confirm the expected -behavior: -ipmitool power on: system is powered-on -ipmitool power off: system is forced off -ipmitool power cycle: system is forced off then powered-on -ipmitool power reset: system is hard reset -ipmitool power soft: soft power-off requested from system software - -Change-Id: I6acfb795a9a33ff5227a5d6e1830774ab732ac0c -Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> ---- - chassishandler.cpp | 33 +++++++++++++++++++++++++++++++++ - 1 file changed, 33 insertions(+) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 0d318647..fdbb9fa5 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -31,6 +31,7 @@ - #include <xyz/openbmc_project/Control/Boot/Mode/server.hpp> - #include <xyz/openbmc_project/Control/Boot/Source/server.hpp> - #include <xyz/openbmc_project/Control/Power/RestorePolicy/server.hpp> -+#include <xyz/openbmc_project/State/Chassis/server.hpp> - #include <xyz/openbmc_project/State/Host/server.hpp> - #include <xyz/openbmc_project/State/PowerOnHours/server.hpp> - -@@ -865,6 +866,38 @@ int initiate_state_transition(State::Host::Transition transition) - return rc; - } - -+//------------------------------------------ -+// Calls into Chassis State Manager Dbus object -+//------------------------------------------ -+int initiateChassisStateTransition(State::Chassis::Transition transition) -+{ -+ // OpenBMC Chassis State Manager dbus framework -+ constexpr auto chassisStatePath = "/xyz/openbmc_project/state/chassis0"; -+ constexpr auto chassisStateIntf = "xyz.openbmc_project.State.Chassis"; -+ -+ auto service = -+ ipmi::getService(*getSdBus(), chassisStateIntf, chassisStatePath); -+ -+ // Convert to string equivalent of the passed in transition enum. -+ auto request = State::convertForMessage(transition); -+ -+ try -+ { -+ ipmi::setDbusProperty(*getSdBus(), service, chassisStatePath, -+ chassisStateIntf, "RequestedPowerTransition", -+ request); -+ } -+ catch (std::exception& e) -+ { -+ log<level::ERR>( -+ "Failed to initiate transition", -+ entry("EXCEPTION=%s, REQUEST=%s", e.what(), request.c_str())); -+ return -1; -+ } -+ -+ return 0; -+} -+ - //------------------------------------------ - // Set Enabled property to inform NMI source - // handling to trigger a NMI_OUT BSOD. --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Fix-issues-and-support-signed-sensor-values.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Fix-issues-and-support-signed-sensor-values.patch deleted file mode 100644 index 6d13f9297..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0001-Fix-issues-and-support-signed-sensor-values.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 8ce91a760fca8c945540679c92770f841629e179 Mon Sep 17 00:00:00 2001 -From: Tony Lee <tony.lee@quantatw.com> -Date: Thu, 31 Oct 2019 17:24:16 +0800 -Subject: [PATCH] Fix issues and support signed sensor values - -Sensor will get "disable" when the command "ipmitool sdr elist" is -executed that if sensorReadingType is 0x6F. - -sensor_units_1 is always set to 0 currently. To support the display of -signed sensor values, we add the attribute "sensorUnits1" to the sensor -mapping yaml. This attribute can be used to determine whether the -sensor is signed. - -It were making negative values 0 in get::readingData(). Fix the issue -by using a int32_t and add an overflow check. - -Change-Id: I705defcf18805db9ada7d0de0738a59aedab61df -Signed-off-by: Tony Lee <tony.lee@quantatw.com> ---- - include/ipmid/types.hpp | 2 ++ - scripts/sensor-example.yaml | 2 ++ - scripts/writesensor.mako.cpp | 2 ++ - sensordatahandler.cpp | 2 -- - sensordatahandler.hpp | 31 ++++++++++++++++++++++++++++--- - sensorhandler.cpp | 5 ++--- - 6 files changed, 36 insertions(+), 8 deletions(-) - -diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp -index e62c8192..bd1fac2b 100644 ---- a/include/ipmid/types.hpp -+++ b/include/ipmid/types.hpp -@@ -133,6 +133,7 @@ using Unit = std::string; - using EntityType = uint8_t; - using EntityInst = uint8_t; - using SensorName = std::string; -+using SensorUnits1 = uint8_t; - - enum class Mutability - { -@@ -167,6 +168,7 @@ struct Info - Exponent exponentR; - bool hasScale; - Scale scale; -+ SensorUnits1 sensorUnits1; - Unit unit; - std::function<uint8_t(SetSensorReadingReq&, const Info&)> updateFunc; - std::function<GetSensorResponse(const Info&)> getFunc; -diff --git a/scripts/sensor-example.yaml b/scripts/sensor-example.yaml -index 9760cd01..bddd2e6d 100644 ---- a/scripts/sensor-example.yaml -+++ b/scripts/sensor-example.yaml -@@ -112,6 +112,8 @@ - # Applies for analog sensors, the actual reading value for the sensor is - # Value * 10^N - scale: -3 -+ # Indicate Analog Data Format, Rate unit, Modifier unit and Percentage -+ sensorUnits1 : 0x80 - mutability: Mutability::Write|Mutability::Read - serviceInterface: org.freedesktop.DBus.Properties - readingType: readingData -diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp -index 8b268052..813f9404 100644 ---- a/scripts/writesensor.mako.cpp -+++ b/scripts/writesensor.mako.cpp -@@ -49,6 +49,7 @@ extern const IdInfoMap sensors = { - offsetB = sensor.get("offsetB", 0) - bExp = sensor.get("bExp", 0) - rExp = sensor.get("rExp", 0) -+ sensorUnits1 = sensor.get("sensorUnits1", 0) - unit = sensor.get("unit", "") - scale = sensor.get("scale", 0) - hasScale = "true" if "scale" in sensor.keys() else "false" -@@ -91,6 +92,7 @@ extern const IdInfoMap sensors = { - .exponentR = ${rExp}, - .hasScale = ${hasScale}, - .scale = ${scale}, -+ .sensorUnits1 = ${sensorUnits1}, - .unit = "${unit}", - .updateFunc = ${updateFunc}, - .getFunc = ${getFunc}, -diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp -index 06f5f429..fc74b8f8 100644 ---- a/sensordatahandler.cpp -+++ b/sensordatahandler.cpp -@@ -7,8 +7,6 @@ - #include <ipmid/types.hpp> - #include <ipmid/utils.hpp> - #include <optional> --#include <phosphor-logging/elog-errors.hpp> --#include <phosphor-logging/log.hpp> - #include <sdbusplus/message/types.hpp> - #include <xyz/openbmc_project/Common/error.hpp> - -diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp -index 5cad58c5..c48140a3 100644 ---- a/sensordatahandler.hpp -+++ b/sensordatahandler.hpp -@@ -8,6 +8,8 @@ - #include <ipmid/api.hpp> - #include <ipmid/types.hpp> - #include <ipmid/utils.hpp> -+#include <phosphor-logging/elog-errors.hpp> -+#include <phosphor-logging/log.hpp> - #include <sdbusplus/message/types.hpp> - - namespace ipmi -@@ -28,6 +30,7 @@ using ServicePath = std::pair<Path, Service>; - using Interfaces = std::vector<Interface>; - - using MapperResponseType = std::map<Path, std::map<Service, Interfaces>>; -+using namespace phosphor::logging; - - /** @brief get the D-Bus service and service path - * @param[in] bus - The Dbus bus object -@@ -225,10 +228,32 @@ GetSensorResponse readingData(const Info& sensorInfo) - - double value = std::get<T>(propValue) * - std::pow(10, sensorInfo.scale - sensorInfo.exponentR); -+ int32_t rawData = -+ (value - sensorInfo.scaledOffset) / sensorInfo.coefficientM; - -- auto rawData = static_cast<uint8_t>((value - sensorInfo.scaledOffset) / -- sensorInfo.coefficientM); -- setReading(rawData, &response); -+ constexpr uint8_t sensorUnitsSignedBits = 2 << 6; -+ constexpr uint8_t signedDataFormat = 0x80; -+ // if sensorUnits1 [7:6] = 10b, sensor is signed -+ if ((sensorInfo.sensorUnits1 & sensorUnitsSignedBits) == signedDataFormat) -+ { -+ if (rawData > std::numeric_limits<int8_t>::max() || -+ rawData < std::numeric_limits<int8_t>::lowest()) -+ { -+ log<level::ERR>("Value out of range"); -+ throw std::out_of_range("Value out of range"); -+ } -+ setReading(static_cast<int8_t>(rawData), &response); -+ } -+ else -+ { -+ if (rawData > std::numeric_limits<uint8_t>::max() || -+ rawData < std::numeric_limits<uint8_t>::lowest()) -+ { -+ log<level::ERR>("Value out of range"); -+ throw std::out_of_range("Value out of range"); -+ } -+ setReading(static_cast<uint8_t>(rawData), &response); -+ } - - return response; - } -diff --git a/sensorhandler.cpp b/sensorhandler.cpp -index 36998715..260331a0 100644 ---- a/sensorhandler.cpp -+++ b/sensorhandler.cpp -@@ -700,9 +700,8 @@ ipmi_ret_t populate_record_from_dbus(get_sdr::SensorDataFullRecordBody* body, - /* Functional sensor case */ - if (isAnalogSensor(info->propertyInterfaces.begin()->first)) - { -- -- body->sensor_units_1 = 0; // unsigned, no rate, no modifier, not a % -- -+ body->sensor_units_1 = info->sensorUnits1; // default is 0. unsigned, no -+ // rate, no modifier, not a % - /* Unit info */ - setUnitFieldsForObject(info, body); - --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Update-Host-State-Transition-function.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Update-Host-State-Transition-function.patch deleted file mode 100644 index 156327b9c..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Update-Host-State-Transition-function.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 8079e1e39e1953458bd2e59c7f546a3d879558db Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" <jason.m.bills@linux.intel.com> -Date: Thu, 30 Jan 2020 16:02:39 -0800 -Subject: [PATCH 2/3] Update Host State Transition function - -This updates the Host State Transition function to use the new -IPMI DBus APIs for transition requests. - -Tested: -Ran each IPMI chassis control command to confirm the expected -behavior: -ipmitool power on: system is powered-on -ipmitool power off: system is forced off -ipmitool power cycle: system is forced off then powered-on -ipmitool power reset: system is hard reset -ipmitool power soft: soft power-off requested from system software - -Change-Id: Id2253a9c0060e892bc318dd02a6221ac1a2ae2d9 -Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> ---- - chassishandler.cpp | 64 +++++++++++++--------------------------------- - 1 file changed, 18 insertions(+), 46 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index fdbb9fa5..af9cba72 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -811,59 +811,31 @@ ipmi::RspType<> ipmiSetChassisCap(bool intrusion, bool fpLockout, - //------------------------------------------ - // Calls into Host State Manager Dbus object - //------------------------------------------ --int initiate_state_transition(State::Host::Transition transition) -+int initiateHostStateTransition(State::Host::Transition transition) - { - // OpenBMC Host State Manager dbus framework -- constexpr auto HOST_STATE_MANAGER_ROOT = "/xyz/openbmc_project/state/host0"; -- constexpr auto HOST_STATE_MANAGER_IFACE = "xyz.openbmc_project.State.Host"; -- constexpr auto DBUS_PROPERTY_IFACE = "org.freedesktop.DBus.Properties"; -- constexpr auto PROPERTY = "RequestedHostTransition"; -+ constexpr auto hostStatePath = "/xyz/openbmc_project/state/host0"; -+ constexpr auto hostStateIntf = "xyz.openbmc_project.State.Host"; - -- // sd_bus error -- int rc = 0; -- char* busname = NULL; -- -- // SD Bus error report mechanism. -- sd_bus_error bus_error = SD_BUS_ERROR_NULL; -- -- // Gets a hook onto either a SYSTEM or SESSION bus -- sd_bus* bus_type = ipmid_get_sd_bus_connection(); -- rc = mapper_get_service(bus_type, HOST_STATE_MANAGER_ROOT, &busname); -- if (rc < 0) -- { -- log<level::ERR>( -- "Failed to get bus name", -- entry("ERRNO=0x%X, OBJPATH=%s", -rc, HOST_STATE_MANAGER_ROOT)); -- return rc; -- } -+ auto service = ipmi::getService(*getSdBus(), hostStateIntf, hostStatePath); - - // Convert to string equivalent of the passed in transition enum. - auto request = State::convertForMessage(transition); - -- rc = sd_bus_call_method(bus_type, // On the system bus -- busname, // Service to contact -- HOST_STATE_MANAGER_ROOT, // Object path -- DBUS_PROPERTY_IFACE, // Interface name -- "Set", // Method to be called -- &bus_error, // object to return error -- nullptr, // Response buffer if any -- "ssv", // Takes 3 arguments -- HOST_STATE_MANAGER_IFACE, PROPERTY, "s", -- request.c_str()); -- if (rc < 0) -+ try - { -- log<level::ERR>("Failed to initiate transition", -- entry("ERRNO=0x%X, REQUEST=%s", -rc, request.c_str())); -+ ipmi::setDbusProperty(*getSdBus(), service, hostStatePath, -+ hostStateIntf, "RequestedHostTransition", -+ request); - } -- else -+ catch (std::exception& e) - { -- log<level::INFO>("Transition request initiated successfully"); -+ log<level::ERR>( -+ "Failed to initiate transition", -+ entry("EXCEPTION=%s, REQUEST=%s", e.what(), request.c_str())); -+ return -1; - } -- -- sd_bus_error_free(&bus_error); -- free(busname); -- -- return rc; -+ return 0; - } - - //------------------------------------------ -@@ -1411,7 +1383,7 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - switch (chassisControl) - { - case CMD_POWER_ON: -- rc = initiate_state_transition(State::Host::Transition::On); -+ rc = initiateHostStateTransition(State::Host::Transition::On); - break; - case CMD_POWER_OFF: - // This path would be hit in 2 conditions. -@@ -1439,7 +1411,7 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - indicate_no_softoff_needed(); - - // Now request the shutdown -- rc = initiate_state_transition(State::Host::Transition::Off); -+ rc = initiateHostStateTransition(State::Host::Transition::Off); - } - else - { -@@ -1460,12 +1432,12 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - // originating via a soft power off SMS request) - indicate_no_softoff_needed(); - -- rc = initiate_state_transition(State::Host::Transition::Reboot); -+ rc = initiateHostStateTransition(State::Host::Transition::Reboot); - break; - - case CMD_SOFT_OFF_VIA_OVER_TEMP: - // Request Host State Manager to do a soft power off -- rc = initiate_state_transition(State::Host::Transition::Off); -+ rc = initiateHostStateTransition(State::Host::Transition::Off); - break; - - case CMD_PULSE_DIAGNOSTIC_INTR: --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Update-IPMI-Chassis-Control-command-transition-reque.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Update-IPMI-Chassis-Control-command-transition-reque.patch deleted file mode 100644 index 271af3f5b..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Update-IPMI-Chassis-Control-command-transition-reque.patch +++ /dev/null @@ -1,180 +0,0 @@ -From 291629d5c3e5bea31925c9d025688897c90eb783 Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" <jason.m.bills@linux.intel.com> -Date: Thu, 30 Jan 2020 16:22:24 -0800 -Subject: [PATCH 3/3] Update IPMI Chassis Control command transition requests - -This change updates the IPMI Chassis Control command to use the new -host state transitions and chassis off transition based on the -mapping in the design document below. This allows each chassis -control action to more closely follow the behavior defined in the -IPMI spec. - -ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/22358 - -Tested: -Ran each IPMI chassis control command to confirm the expected -behavior: -ipmitool power on: system is powered-on using Host.On -ipmitool power off: system is forced off using Chassis.Off -ipmitool power cycle: system is forced off then powered-on using - Host.Reboot -ipmitool power reset: system is hard reset using Host.ForceWarmReboot -ipmitool power soft: soft power-off requested from system software - using Host.Off - -Change-Id: Ieb42722102fde0e51a49dc4aaa3ff227a3394066 -Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> ---- - chassishandler.cpp | 121 ++------------------------------------------- - 1 file changed, 5 insertions(+), 116 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index af9cba72..663081de 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -1301,76 +1301,6 @@ ipmi::RspType<uint4_t, // Restart Cause - return ipmi::responseSuccess(cause.value(), reserved, channel); - } - --//------------------------------------------------------------- --// Send a command to SoftPowerOff application to stop any timer --//------------------------------------------------------------- --int stop_soft_off_timer() --{ -- constexpr auto iface = "org.freedesktop.DBus.Properties"; -- constexpr auto soft_off_iface = "xyz.openbmc_project.Ipmi.Internal." -- "SoftPowerOff"; -- -- constexpr auto property = "ResponseReceived"; -- constexpr auto value = "xyz.openbmc_project.Ipmi.Internal." -- "SoftPowerOff.HostResponse.HostShutdown"; -- -- // Get the system bus where most system services are provided. -- auto bus = ipmid_get_sd_bus_connection(); -- -- // Get the service name -- // TODO openbmc/openbmc#1661 - Mapper refactor -- // -- // See openbmc/openbmc#1743 for some details but high level summary is that -- // for now the code will directly call the soft off interface due to a -- // race condition with mapper usage -- // -- // char *busname = nullptr; -- // auto r = mapper_get_service(bus, SOFTOFF_OBJPATH, &busname); -- // if (r < 0) -- //{ -- // fprintf(stderr, "Failed to get %s bus name: %s\n", -- // SOFTOFF_OBJPATH, -r); -- // return r; -- //} -- -- // No error object or reply expected. -- int rc = sd_bus_call_method(bus, SOFTOFF_BUSNAME, SOFTOFF_OBJPATH, iface, -- "Set", nullptr, nullptr, "ssv", soft_off_iface, -- property, "s", value); -- if (rc < 0) -- { -- log<level::ERR>("Failed to set property in SoftPowerOff object", -- entry("ERRNO=0x%X", -rc)); -- } -- -- // TODO openbmc/openbmc#1661 - Mapper refactor -- // free(busname); -- return rc; --} -- --//---------------------------------------------------------------------- --// Create file to indicate there is no need for softoff notification to host --//---------------------------------------------------------------------- --void indicate_no_softoff_needed() --{ -- fs::path path{HOST_INBAND_REQUEST_DIR}; -- if (!fs::is_directory(path)) -- { -- fs::create_directory(path); -- } -- -- // Add the host instance (default 0 for now) to the file name -- std::string file{HOST_INBAND_REQUEST_FILE}; -- auto size = std::snprintf(nullptr, 0, file.c_str(), 0); -- size++; // null -- std::unique_ptr<char[]> buf(new char[size]); -- std::snprintf(buf.get(), size, file.c_str(), 0); -- -- // Append file name to directory and create it -- path /= buf.get(); -- std::ofstream(path.c_str()); --} -- - /** @brief Implementation of chassis control command - * - * @param - chassisControl command byte -@@ -1386,60 +1316,19 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) - rc = initiateHostStateTransition(State::Host::Transition::On); - break; - case CMD_POWER_OFF: -- // This path would be hit in 2 conditions. -- // 1: When user asks for power off using ipmi chassis command 0x04 -- // 2: Host asking for power off post shutting down. -- -- // If it's a host requested power off, then need to nudge Softoff -- // application that it needs to stop the watchdog timer if running. -- // If it is a user requested power off, then this is not really -- // needed. But then we need to differentiate between user and host -- // calling this same command -- -- // For now, we are going ahead with trying to nudge the soft off and -- // interpret the failure to do so as a non softoff case -- rc = stop_soft_off_timer(); -- -- // Only request the Off transition if the soft power off -- // application is not running -- if (rc < 0) -- { -- // First create a file to indicate to the soft off application -- // that it should not run. Not doing this will result in State -- // manager doing a default soft power off when asked for power -- // off. -- indicate_no_softoff_needed(); -- -- // Now request the shutdown -- rc = initiateHostStateTransition(State::Host::Transition::Off); -- } -- else -- { -- log<level::INFO>("Soft off is running, so let shutdown target " -- "stop the host"); -- } -+ rc = -+ initiateChassisStateTransition(State::Chassis::Transition::Off); - break; -- - case CMD_HARD_RESET: -+ rc = initiateHostStateTransition( -+ State::Host::Transition::ForceWarmReboot); -+ break; - case CMD_POWER_CYCLE: -- // SPEC has a section that says certain implementations can trigger -- // PowerOn if power is Off when a command to power cycle is -- // requested -- -- // First create a file to indicate to the soft off application -- // that it should not run since this is a direct user initiated -- // power reboot request (i.e. a reboot request that is not -- // originating via a soft power off SMS request) -- indicate_no_softoff_needed(); -- - rc = initiateHostStateTransition(State::Host::Transition::Reboot); - break; -- - case CMD_SOFT_OFF_VIA_OVER_TEMP: -- // Request Host State Manager to do a soft power off - rc = initiateHostStateTransition(State::Host::Transition::Off); - break; -- - case CMD_PULSE_DIAGNOSTIC_INTR: - rc = setNmiProperty(true); - break; --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend index af5fb1356..78fa57039 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -1,12 +1,7 @@ DEPENDS_append_gbs = " gbs-yaml-config" FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://gbs-ipmid-whitelist.conf \ - file://0001-Add-Chassis-State-Transition-interface.patch \ - file://0002-Update-Host-State-Transition-function.patch \ - file://0003-Update-IPMI-Chassis-Control-command-transition-reque.patch \ - file://0001-Fix-issues-and-support-signed-sensor-values.patch \ - " +SRC_URI_append_gbs = " file://gbs-ipmid-whitelist.conf" WHITELIST_CONF_gbs = "${WORKDIR}/gbs-ipmid-whitelist.conf" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf index 0f4083416..70783a8c4 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/leds/phosphor-led-manager/service-override.conf @@ -1,2 +1,7 @@ [Unit] StartLimitBurst=10 + +[Service] +RestartSec=3s +ExecStartPre=mapper get-service /xyz/openbmc_project/led/physical/heartbeat +ExecStartPre=mapper get-service /xyz/openbmc_project/led/physical/sys_boot_status diff --git a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-gbs-apps.bb b/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-gbs-apps.bb deleted file mode 100644 index 20c81ad94..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-gbs-apps.bb +++ /dev/null @@ -1,36 +0,0 @@ -SUMMARY = "OpenBMC for GBS system - Applications" -PR = "r1" - -inherit packagegroup - -PROVIDES = "${PACKAGES}" -PACKAGES = " \ - ${PN}-chassis \ - ${PN}-fans \ - ${PN}-flash \ - " - -PROVIDES += "virtual/obmc-chassis-mgmt" -PROVIDES += "virtual/obmc-fan-mgmt" -PROVIDES += "virtual/obmc-flash-mgmt" - -RPROVIDES_${PN}-chassis += "virtual-obmc-chassis-mgmt" -RPROVIDES_${PN}-fans += "virtual-obmc-fan-mgmt" -RPROVIDES_${PN}-flash += "virtual-obmc-flash-mgmt" - -SUMMARY_${PN}-chassis = "GBS Chassis" -RDEPENDS_${PN}-chassis = " \ - x86-power-control \ - " - -SUMMARY_${PN}-fans = "GBS Fans" -RDEPENDS_${PN}-fans = " \ - phosphor-pid-control \ - " - -SUMMARY_${PN}-flash = "GBS Flash" -RDEPENDS_${PN}-flash = " \ - phosphor-ipmi-flash \ - gbs-bmc-update \ - virtual/bios-update \ - " diff --git a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-obmc-apps%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-obmc-apps%.bbappend deleted file mode 100644 index 73e9b0aa4..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/packagegroups/packagegroup-obmc-apps%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -RDEPENDS_${PN}-fru-ipmi_remove_gbs = "fru-device" -RDEPENDS_${PN}-ikvm_remove_gbs = "obmc-ikvm" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/0002-Add-power-on-monitor-mechanism.patch b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/0002-Add-power-on-monitor-mechanism.patch deleted file mode 100644 index a3718ea2a..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/0002-Add-power-on-monitor-mechanism.patch +++ /dev/null @@ -1,269 +0,0 @@ -From 5cea18ba476c0cb6ea622be50a09ead00cd47b14 Mon Sep 17 00:00:00 2001 -From: Ivan Li <rli11@lenovo.com> -Date: Wed, 25 Dec 2019 17:05:00 +0800 -Subject: [PATCH] Add power on monitor mechanism - -Summary: -1. Add "PWRONMON" attribute in sensor configuration file to determine whether it's power-on monitor sensor or not. (i.e. PWRONMON_temp1 = "ON") -2. Watching "CurrentHostState" property and then use it to turn on/off threshold alert for power-on monitor sensors. - -Test Plan: -Check if there is any abnormal threshold events occurred in power off state or during power transition - -Signed-off-by: Ivan Li <rli11@lenovo.com> -Change-Id: I76d3a664153141d94636e0011f3a48e4f6dee922 ---- - mainloop.cpp | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ - sensor.cpp | 11 +++++- - sensor.hpp | 13 +++++++ - thresholds.hpp | 24 ------------ - 4 files changed, 125 insertions(+), 25 deletions(-) - -diff --git a/mainloop.cpp b/mainloop.cpp -index 29dc26a..5e27a30 100644 ---- a/mainloop.cpp -+++ b/mainloop.cpp -@@ -42,6 +42,13 @@ - #include <string> - #include <unordered_set> - #include <xyz/openbmc_project/Sensor/Device/error.hpp> -+#include <boost/asio/io_service.hpp> -+#include <boost/container/flat_map.hpp> -+#include <boost/algorithm/string/predicate.hpp> -+#include <sdbusplus/asio/connection.hpp> -+#include <sdbusplus/asio/object_server.hpp> -+#include <sdbusplus/message/types.hpp> -+#include <sdbusplus/timer.hpp> - - using namespace phosphor::logging; - -@@ -110,6 +117,12 @@ decltype(Thresholds<CriticalObject>::deassertHighSignal) - Thresholds<CriticalObject>::deassertHighSignal = - &CriticalObject::criticalHighAlarmDeasserted; - -+static std::unique_ptr<phosphor::Timer> cacheTimer = nullptr; -+static std::unique_ptr<sdbusplus::bus::match::match> powerMatch = nullptr; -+static bool powerStatusOn = false; -+static boost::asio::io_service io; -+static auto conn = std::make_shared<sdbusplus::asio::connection>(io); -+ - void updateSensorInterfaces(InterfaceMap& ifaces, SensorValueType value) - { - for (auto& iface : ifaces) -@@ -137,6 +150,83 @@ void updateSensorInterfaces(InterfaceMap& ifaces, SensorValueType value) - } - } - -+void powerStatusSet() -+{ -+ powerStatusOn = true; -+ return; -+} -+ -+void createTimer() -+{ -+ if (cacheTimer == nullptr) -+ { -+ cacheTimer = std::make_unique<phosphor::Timer>(powerStatusSet); -+ } -+} -+ -+bool isPowerOn(void) -+{ -+ if (!powerMatch) -+ { -+ throw std::runtime_error("Power Match Not Created"); -+ } -+ return powerStatusOn; -+} -+ -+void setupPowerMatch(sdbusplus::bus::bus& bus) -+{ -+ if (powerMatch) -+ { -+ return; -+ } -+ -+ powerMatch = std::make_unique<sdbusplus::bus::match::match>( -+ bus, -+ "type='signal',interface='org.freedesktop.DBus.Properties',path='/xyz/" -+ "openbmc_project/state/" -+ "host0',arg0='xyz.openbmc_project.State.Host'", -+ [](sdbusplus::message::message& message) { -+ std::string objectName; -+ boost::container::flat_map<std::string, std::variant<std::string>> -+ values; -+ message.read(objectName, values); -+ auto findState = values.find("CurrentHostState"); -+ if (findState != values.end()) -+ { -+ bool on = boost::ends_with( -+ std::get<std::string>(findState->second), "Running"); -+ if (!on) -+ { -+ cacheTimer->stop(); -+ powerStatusOn = false; -+ return; -+ } -+ cacheTimer->start(std::chrono::duration_cast<std::chrono::microseconds>( -+ std::chrono::seconds(10))); -+ } -+ else { -+ powerStatusOn = false; -+ } -+ }); -+ -+ conn->async_method_call( -+ [](boost::system::error_code ec, -+ const std::variant<std::string>& state) { -+ if (ec) -+ { -+ return; -+ } -+ powerStatusOn = -+ boost::ends_with(std::get<std::string>(state), "Running"); -+ }, -+ "xyz.openbmc_project.State.Host", -+ "/xyz/openbmc_project/state/host0", -+ "org.freedesktop.DBus.Properties", "Get", -+ "xyz.openbmc_project.State.Host", "CurrentHostState"); -+ -+ createTimer(); -+} -+ - std::string MainLoop::getID(SensorSet::container_t::const_reference sensor) - { - std::string id; -@@ -418,6 +508,7 @@ void MainLoop::init() - _interval = std::strtoull(interval.c_str(), NULL, 10); - } - } -+ setupPowerMatch(_bus); - } - - void MainLoop::read() -@@ -462,6 +553,12 @@ void MainLoop::read() - - try - { -+ if(sensor->pwrOnMonitor() && !isPowerOn()) -+ { -+ statusIface->functional(false); -+ continue; -+ } -+ - if (sensor->hasFaultFile()) - { - auto fault = _ioAccess->read(sensorSysfsType, sensorSysfsNum, -@@ -588,6 +685,11 @@ void MainLoop::read() - } - } - -+ if(sensor->pwrOnMonitor() && !isPowerOn()) -+ { -+ statusIface->functional(false); -+ continue; -+ } - updateSensorInterfaces(obj, value); - } - catch (const std::system_error& e) -diff --git a/sensor.cpp b/sensor.cpp -index ac2f896..72b45f8 100644 ---- a/sensor.cpp -+++ b/sensor.cpp -@@ -32,7 +32,7 @@ Sensor::Sensor(const SensorSet::key_type& sensor, - const hwmonio::HwmonIOInterface* ioAccess, - const std::string& devPath) : - _sensor(sensor), -- _ioAccess(ioAccess), _devPath(devPath), _scale(0), _hasFaultFile(false) -+ _ioAccess(ioAccess), _devPath(devPath), _scale(0), _hasFaultFile(false), _pwrOnMonitor(false) - { - auto chip = env::getEnv("GPIOCHIP", sensor); - auto access = env::getEnv("GPIO", sensor); -@@ -61,6 +61,15 @@ Sensor::Sensor(const SensorSet::key_type& sensor, - auto senRmRCs = env::getEnv("REMOVERCS", sensor); - // Add sensor removal return codes defined per sensor - addRemoveRCs(senRmRCs); -+ -+ auto pwrOnMon = env::getEnv("PWRONMON", sensor); -+ if (!pwrOnMon.empty()) -+ { -+ if (pwrOnMon == "ON") -+ { -+ _pwrOnMonitor = true; -+ } -+ } - } - - void Sensor::addRemoveRCs(const std::string& rcList) -diff --git a/sensor.hpp b/sensor.hpp -index 64d6e48..41c0fe7 100644 ---- a/sensor.hpp -+++ b/sensor.hpp -@@ -151,6 +151,16 @@ class Sensor - return _hasFaultFile; - } - -+ /** -+ * @brief Get whether the sensor only need to be monitored in power on state or not. -+ * -+ * @return - Boolean on whether the sensor only need to be monitored in power on state -+ */ -+ inline bool pwrOnMonitor(void) const -+ { -+ return _pwrOnMonitor; -+ } -+ - private: - /** @brief Sensor object's identifiers */ - SensorSet::key_type _sensor; -@@ -172,6 +182,9 @@ class Sensor - - /** @brief Tracks whether the sensor has a fault file or not. */ - bool _hasFaultFile; -+ -+ /** @brief Whether the sensor only need to be monitored in power on state or not. */ -+ bool _pwrOnMonitor; - }; - - /** -diff --git a/thresholds.hpp b/thresholds.hpp -index 8d557fc..0ffe0ce 100644 ---- a/thresholds.hpp -+++ b/thresholds.hpp -@@ -137,32 +137,8 @@ auto addThreshold(const std::string& sensorType, const std::string& sensorID, - auto hi = stod(tHi) * std::pow(10, scale); - (*iface.*Thresholds<T>::setLo)(lo); - (*iface.*Thresholds<T>::setHi)(hi); -- auto alarmLowState = (*iface.*Thresholds<T>::getAlarmLow)(); -- auto alarmHighState = (*iface.*Thresholds<T>::getAlarmHigh)(); - (*iface.*Thresholds<T>::alarmLo)(value <= lo); - (*iface.*Thresholds<T>::alarmHi)(value >= hi); -- if (alarmLowState != (value <= lo)) -- { -- if (value <= lo) -- { -- (*iface.*Thresholds<T>::assertLowSignal)(value); -- } -- else -- { -- (*iface.*Thresholds<T>::deassertLowSignal)(value); -- } -- } -- if (alarmHighState != (value >= hi)) -- { -- if (value >= hi) -- { -- (*iface.*Thresholds<T>::assertHighSignal)(value); -- } -- else -- { -- (*iface.*Thresholds<T>::deassertHighSignal)(value); -- } -- } - auto type = Thresholds<T>::type; - obj[type] = iface; - } --- -2.21.0 - diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf index 427cdabe0..3627aecac 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@8c000/vrm@5d.conf @@ -22,9 +22,9 @@ PWRONMON_in2 = "ON" LABEL_curr1 = "p12v_fan_in" CRITHI_curr1 = "30000" -CRITLO_curr1 = "0" +CRITLO_curr1 = "-1000" WARNHI_curr1 = "30000" -WARNLO_curr1 = "0" +WARNLO_curr1 = "-1000" MINVALUE_curr1 = "0" MAXVALUE_curr1 = "35" # READ_Iin is direct value*0.5 @@ -33,9 +33,9 @@ PWRONMON_curr1 = "ON" LABEL_curr2 = "p12v_fan_out" CRITHI_curr2 = "100000" -CRITLO_curr2 = "0" +CRITLO_curr2 = "-1000" WARNHI_curr2 = "100000" -WARNLO_curr2 = "0" +WARNLO_curr2 = "-1000" MINVALUE_curr2 = "0" MAXVALUE_curr2 = "150" PWRONMON_curr2 = "ON" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend index 22b31cfb9..7307de7fa 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend @@ -1,7 +1,6 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://0002-Add-power-on-monitor-mechanism.patch \ - " +DEPENDS += "boost" GBS_NAMES = " \ i2c@82000/sbtsi@4c \ diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json index 306e74e2a..4c1e3d8d0 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-nvme/nvme_config.json @@ -163,12 +163,12 @@ ], "threshold": [ { - "criticalHigh": 77, + "criticalHigh": 72, "criticalLow": 0, - "warningHigh": 77, + "warningHigh": 72, "warningLow": 0, "maxValue": 127, "minValue": -128 } ] -}
\ No newline at end of file +} diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace index bffb6d154..8e7153fe4 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace @@ -5,8 +5,10 @@ After=obmc-mapper.target After=mapper-wait@-xyz-openbmc_project-sensors-temperature-inlet.service After=mapper-wait@-xyz-openbmc_project-sensors-temperature-outlet_0.service After=mapper-wait@-xyz-openbmc_project-sensors-temperature-outlet_1.service +StartLimitBurst=10 [Service] +Restart=always ExecStart=/usr/bin/virtual-sensor Type=dbus BusName=xyz.openbmc_project.VirtualSensor diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh deleted file mode 100644 index 604eafccc..000000000 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/setMaxMinValue.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -serviceName="xyz.openbmc_project.VirtualSensor" -interfaceName="xyz.openbmc_project.Sensor.Value" -objectPath="/xyz/openbmc_project/sensors/temperature/" - -# set MaxValue, MinValue to sensor dbus property -for i in {0..2}; do - sensorPath="${objectPath}i2cool_${i}" - mapper wait $sensorPath - busctl set-property $serviceName $sensorPath $interfaceName MaxValue d 127 - busctl set-property $serviceName $sensorPath $interfaceName MinValue d -- -128 -done - -exit 0 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 index 27c438d90..c0f04ef03 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 +++ b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 @@ -3,6 +3,3 @@ SERVICE=xyz.openbmc_project.Watchdog UNIT_HARD_RESET=phosphor-host-watchdog-reset.service UNIT_POWER_OFF=phosphor-host-watchdog-poweroff.service UNIT_POWER_CYCLE=phosphor-host-watchdog-powercycle.service -FALLBACK_ACTION=xyz.openbmc_project.State.Watchdog.Action.PowerCycle -FALLBACK_INTERVAL=180000 -MIN_INTERVAL=60000 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service index 4577cd1c1..df11b22e5 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service +++ b/meta-quanta/meta-gbs/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service @@ -4,8 +4,7 @@ Description=Phosphor Watchdog [Service] EnvironmentFile={envfiledir}/obmc/watchdog/%I ExecStart=/usr/bin/env phosphor-watchdog --service=${{SERVICE}} --path=${{DEVPATH}} \ - --continue --fallback_always --min_interval=${{MIN_INTERVAL}} \ - --fallback_action=${{FALLBACK_ACTION}} --fallback_interval=${{FALLBACK_INTERVAL}} \ + --continue \ --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=${{UNIT_HARD_RESET}} \ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=${{UNIT_POWER_OFF}} \ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=${{UNIT_POWER_CYCLE}} diff --git a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json.in b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json.in deleted file mode 100644 index a5ff4979b..000000000 --- a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/config-margin.json.in +++ /dev/null @@ -1,408 +0,0 @@ -{ - "sensors" : [ - { - "name": "cputemp", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/cputemp", - "parameters": { - "type": "", - "maxTemp": 95000, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -15000, - "scalar": 1.0 - } - }, - { - "name": "nvme0", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme0", - "parameters": { - "type": "", - "maxTemp": @WCTemp00@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme1", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme1", - "parameters": { - "type": "", - "maxTemp": @WCTemp01@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme2", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme2", - "parameters": { - "type": "", - "maxTemp": @WCTemp02@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme3", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme3", - "parameters": { - "type": "", - "maxTemp": @WCTemp03@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme4", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme4", - "parameters": { - "type": "", - "maxTemp": @WCTemp04@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme5", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme5", - "parameters": { - "type": "", - "maxTemp": @WCTemp05@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme6", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme6", - "parameters": { - "type": "", - "maxTemp": @WCTemp06@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme7", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme7", - "parameters": { - "type": "", - "maxTemp": @WCTemp07@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme8", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme8", - "parameters": { - "type": "", - "maxTemp": @WCTemp08@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme9", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme9", - "parameters": { - "type": "", - "maxTemp": @WCTemp09@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme10", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme10", - "parameters": { - "type": "", - "maxTemp": @WCTemp10@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme11", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme11", - "parameters": { - "type": "", - "maxTemp": @WCTemp11@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme12", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme12", - "parameters": { - "type": "", - "maxTemp": @WCTemp12@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme13", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme13", - "parameters": { - "type": "", - "maxTemp": @WCTemp13@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme14", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme14", - "parameters": { - "type": "", - "maxTemp": @WCTemp14@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "nvme15", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/nvme15", - "parameters": { - "type": "", - "maxTemp": @WCTemp15@, - "path": "", - "sysLabel": "", - "targetTemp": -1, - "targetTempOffset": -7000, - "scalar": 1.0 - } - }, - { - "name": "vddcr_cpu", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/vddcr_cpu", - "parameters": { - "type": "", - "maxTemp": 100000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - }, - { - "name": "vddcr_soc", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/vddcr_soc", - "parameters": { - "type": "", - "maxTemp": 100000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - }, - { - "name": "vddio_abcd", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/vddio_abcd", - "parameters": { - "type": "", - "maxTemp": 100000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - }, - { - "name": "vddio_efgh", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/vddio_efgh", - "parameters": { - "type": "", - "maxTemp": 100000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - }, - { - "name": "p12v_mobo", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/p12v_mobo", - "parameters": { - "type": "", - "maxTemp": 114000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - }, - { - "name": "powerseq_temp", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/powerseq_temp", - "parameters": { - "type": "", - "maxTemp": 99000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - }, - { - "name": "p12v_fan", - "unit": "degree", - "type": "dbus", - "path": "/xyz/openbmc_project/sensors/temperature/p12v_fan", - "parameters": { - "type": "", - "maxTemp": 114000, - "path": "", - "sysLabel": "", - "targetTemp": 90000, - "targetTempOffset": 0, - "scalar": 1.0 - } - } - ], - "skus" : [ - { - "num": 1, - "zones": [ - { - "id": 0, - "zoneSetpoint": 10000, - "target": "/xyz/openbmc_project/extsensors/margin/cputemp", - "components": [ - "cputemp" - ] - }, - { - "id": 1, - "zoneSetpoint": 10000, - "target": "/xyz/openbmc_project/extsensors/margin/zone0_vr", - "components": [ - "vddcr_cpu", - "vddcr_soc", - "vddio_abcd", - "vddio_efgh", - "p12v_mobo", - "powerseq_temp" - ] - }, - { - "id": 2, - "zoneSetpoint": 10000, - "target": "/xyz/openbmc_project/extsensors/margin/nvme", - "components": [ - @nvmeList@ - ] - }, - { - "id": 3, - "zoneSetpoint": 10000, - "target": "/xyz/openbmc_project/extsensors/margin/p12v_fan", - "components": [ - "p12v_fan" - ] - } - ] - } - ] -} 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 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 deleted file mode 100644 index 981c0d2ca..000000000 --- a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp_%.bbappend +++ /dev/null @@ -1,17 +0,0 @@ -FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" - -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.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.in \ - ${D}${datadir}/${PN}/ -} diff --git a/meta-quanta/meta-gbs/recipes-quanta/network/mac-address/config.txt b/meta-quanta/meta-gbs/recipes-quanta/network/mac-address/config.txt deleted file mode 100644 index 06818fc0b..000000000 --- a/meta-quanta/meta-gbs/recipes-quanta/network/mac-address/config.txt +++ /dev/null @@ -1,8 +0,0 @@ -fruBusNum=5 -fruAddr=0x50 -numberMac=4 -mac1=eth1 -mac2=usb0_dev -mac3=usb0_host -mac4=eth0 -USBLAA=true diff --git a/meta-quanta/meta-gbs/recipes-quanta/network/mac-address_%.bbappend b/meta-quanta/meta-gbs/recipes-quanta/network/mac-address_%.bbappend deleted file mode 100644 index d975fe28b..000000000 --- a/meta-quanta/meta-gbs/recipes-quanta/network/mac-address_%.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://config.txt" - -FILES_${PN}_append_gbs = " ${datadir}/mac-address/config.txt" - -do_install_append_gbs() { - install -d ${D}${datadir}/mac-address - install -m 0644 -D ${WORKDIR}/config.txt \ - ${D}${datadir}/mac-address/config.txt -} 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 index d9d3ed109..5916ccc72 100644 --- 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 @@ -1,8 +1,10 @@ { - "PostComplete": "POST_COMPLETE", - "PwrButton": "POWER_BUTTON", - "PwrOK": "PS_PWROK", - "PwrOut": "POWER_OUT", - "RstButton": "RESET_BUTTON", - "RstOut": "RESET_OUT" + "gpio_configs":{ + "PostComplete": "POST_COMPLETE", + "PwrButton": "POWER_BUTTON", + "PwrOK": "PS_PWROK", + "PwrOut": "POWER_OUT", + "RstButton": "RESET_BUTTON", + "RstOut": "RESET_OUT" + } } |