summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2021-03-26 01:45:09 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2021-03-27 01:41:36 +0300
commit12bef3e1bf292dec5ac15af9fb41e86f7bcfb0cb (patch)
tree608a905372f3f545d2686e29512ae3f5f5b4a78c /meta-openbmc-mods
parent0a1ece0568a37de9f17fd6e0bcdfd2cad2c6503f (diff)
downloadopenbmc-12bef3e1bf292dec5ac15af9fb41e86f7bcfb0cb.tar.xz
Update to internal 0.43
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods')
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0001-flash-use-readX-writeX-not-udelay.patch52
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch38
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0007-Add-espi-support.patch10
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch12
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch9
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch20
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch16
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch12
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch10
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch6
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch4
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch22
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch4
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch16
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch20
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch16
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch9
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch57
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch6
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch46
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch6
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0032-PFR-FW-update-and-checkpoint-support-in-u-boot.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0033-Reboot-into-UBOOT-on-Watchdog-Failures.patch20
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0034-Disable-uart-debug-interface.patch18
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0035-PFR-platform-EXTRST-reset-mask-selection.patch18
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0036-Re-Enable-KCS.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0037-aspeed-ast-scu.c-fix-MAC1LINK-and-MAC2LINK-pin-pads-.patch10
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0038-Increase-default-fan-speed-for-cooper-city.patch26
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0040-Initialize-the-BMC-host-mailbox-at-reset-time.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0043-PFR-Skip-counting-WDT2-event-when-EXTRST-is-set.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0044-net-phy-realtek-Change-LED-configuration.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0045-Apply-WDT1-2-reset-mask-to-reset-needed-controller.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0046-Enable-FMC-DMA-for-memmove.patch20
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0047-ast2500-parse-reset-reason.patch6
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0048-Add-WDT-to-u-boot-to-cover-booting-failures.patch18
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0049-Fix-issue-on-host-console-is-broken-due-to-BMC-reset.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0001-image-Correct-comment-for-fit_conf_get_node.patch10
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch10
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0008-image-Load-the-correct-configuration-in-fit_check_si.patch8
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0009-fit_check_sign-Allow-selecting-the-configuration-to-.patch12
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0012-image-Use-constants-for-required-and-key-name-hint.patch16
-rw-r--r--meta-openbmc-mods/meta-ast2600/conf/machine/include/intel-ast2600.inc4
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0004-AST2600-Adjust-default-GPIO-settings.patch25
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0008-AST2600-Add-TPM-pulse-trigger.patch10
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0020-Add-BMC-running-indicator-LED-control.patch16
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0025-ast2600-PFR-platform-EXTRST-reset-mask-selection.patch33
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0027-ast2600-Add-Mailbox-init-function.patch87
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch45
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch39
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch97
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend4
-rw-r--r--meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass1
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb1
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/0001-Fix-build-error-in-kernel-v5.10.patch62
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0031-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch151
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0033-Fix-assertion-failure-in-ISO-20220JP-3-module-bug-27256.patch292
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch44
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend5
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/pam/pam-ipmi_%.bbappend3
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch47
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/configure-usb-c.bb25
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.service9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.sh29
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py15
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/pfr-manager_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch116
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch33
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch44
-rw-r--r--meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch24
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch351
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Fix-crash-issue-due-to-throw-undefined-error.patch38
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend3
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch33
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru.bb2
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh56
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch25
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Firmware-update-configuration-changes.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch30
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch40
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-Fix-wrong-check-in-EventService-events.patch35
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Add-state-sensor-messages-to-the-registry.patch98
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Redfish-TelemetryService-schema-implementation.patch717
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch769
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0003-Add-support-for-MetricDefinition-scheme.patch457
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Sync-Telmetry-service-with-EventService.patch159
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/peci/peci-pcie_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch24
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch139
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch58
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch29
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch447
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0006-Use-groupmems-instead-of-getgrnam_r-due-to-overlay.patch18
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend1
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-support/boost/boost/e8b0445e9837e232047173ddf6b4d541b1585915.patch101
-rw-r--r--meta-openbmc-mods/meta-common/recipes-support/boost/boost_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit/0002-Add-support-for-ssl-config.patch66
-rw-r--r--meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit_git.bb1
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru.bbappend3
-rw-r--r--meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru/decodeBoardID.sh35
-rw-r--r--meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru.bbappend3
-rw-r--r--meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru/decodeBoardID.sh14
136 files changed, 3023 insertions, 2859 deletions
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0001-flash-use-readX-writeX-not-udelay.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0001-flash-use-readX-writeX-not-udelay.patch
index 73ab78a65..b24d91a68 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0001-flash-use-readX-writeX-not-udelay.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0001-flash-use-readX-writeX-not-udelay.patch
@@ -1,7 +1,16 @@
-Index: u-boot/arch/arm/mach-aspeed/flash.c
-===================================================================
---- u-boot.orig/arch/arm/mach-aspeed/flash.c
-+++ u-boot/arch/arm/mach-aspeed/flash.c
+From 614d875d383c6567dd282faeb7ced1db1e4d07d9 Mon Sep 17 00:00:00 2001
+From: Vernon Mauery <vernon.mauery@intel.com>
+Date: Thu, 26 Apr 2018 13:29:46 -0700
+Subject: [PATCH] U-Boot aspeed flash driver should not use udelay
+
+---
+ arch/arm/mach-aspeed/flash.c | 229 ++++++++++++++---------------------
+ 1 file changed, 88 insertions(+), 141 deletions(-)
+
+diff --git a/arch/arm/mach-aspeed/flash.c b/arch/arm/mach-aspeed/flash.c
+index b8a438df75..d33fb9e0fe 100644
+--- a/arch/arm/mach-aspeed/flash.c
++++ b/arch/arm/mach-aspeed/flash.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <asm/processor.h>
@@ -10,7 +19,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
#include <environment.h>
#include <asm/arch/ast_scu.h>
-@@ -199,7 +200,7 @@ static void reset_flash (flash_info_t *
+@@ -202,7 +203,7 @@ static void reset_flash (flash_info_t * info)
if (info->dualport)
ulCtrlData |= 0x08;
#endif
@@ -19,7 +28,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
}
-@@ -228,28 +229,22 @@ static void enable_write (flash_info_t *
+@@ -231,28 +232,22 @@ static void enable_write (flash_info_t * info)
ulCtrlData = (info->tCK_Write << 8);
ulCtrlData |= CE_LOW | USERMODE;
@@ -55,7 +64,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
}
-@@ -280,30 +275,23 @@ static void write_status_register (flash
+@@ -283,30 +278,23 @@ static void write_status_register (flash_info_t * info, uchar data)
ulCtrlData = (info->tCK_Write << 8);
ulCtrlData |= CE_LOW | USERMODE;
@@ -94,7 +103,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
}
static void enable4b (flash_info_t * info)
-@@ -330,13 +318,11 @@ static void enable4b (flash_info_t * inf
+@@ -333,13 +321,11 @@ static void enable4b (flash_info_t * info)
ulCtrlData = (info->tCK_Write << 8);
ulCtrlData |= CE_LOW | USERMODE;
@@ -111,7 +120,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
} /* enable4b */
-@@ -366,29 +352,23 @@ static void enable4b_spansion (flash_inf
+@@ -369,29 +355,23 @@ static void enable4b_spansion (flash_info_t * info)
/* Enable 4B: BAR0 D[7] = 1 */
ulCtrlData = (info->tCK_Write << 8);
ulCtrlData |= CE_LOW | USERMODE;
@@ -149,7 +158,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
} /* enable4b_spansion */
-@@ -420,14 +400,11 @@ static void enable4b_numonyx (flash_info
+@@ -423,14 +403,11 @@ static void enable4b_numonyx (flash_info_t * info)
/* Enable 4B: CMD:0xB7 */
ulCtrlData = (info->tCK_Write << 8);
ulCtrlData |= CE_LOW | USERMODE;
@@ -167,7 +176,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
} /* enable4b_numonyx */
-@@ -463,63 +440,49 @@ static void flash_write_buffer (flash_in
+@@ -466,63 +443,49 @@ static void flash_write_buffer (flash_info_t *info, uchar *src, ulong addr, int
ulCtrlData &= CMD_MASK;
ulCtrlData |= CE_LOW | USERMODE;
@@ -247,7 +256,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
}
}
-@@ -603,57 +566,44 @@ int flash_erase (flash_info_t * info, in
+@@ -606,57 +569,44 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
ulCtrlData &= CMD_MASK;
ulCtrlData |= CE_LOW | USERMODE;
@@ -320,7 +329,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
}
putc ('.');
-@@ -764,22 +714,16 @@ static ulong flash_get_size (ulong base,
+@@ -767,22 +717,16 @@ static ulong flash_get_size (ulong base, flash_info_t *info)
}
/* Get Flash ID */
@@ -351,7 +360,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
ulID = ((ulong)ch[0]) | ((ulong)ch[1] << 8) | ((ulong)ch[2] << 16) ;
info->flash_id = ulID;
-@@ -1294,13 +1238,13 @@ static ulong flash_get_size (ulong base,
+@@ -1339,13 +1283,13 @@ static ulong flash_get_size (ulong base, flash_info_t *info)
if (info->address32) {
#ifndef AST_SOC_G5
@@ -369,7 +378,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
/* set flash chips to 32bits addressing mode */
if ((info->flash_id & 0xFF) == 0x01) /* Spansion */
-@@ -1322,7 +1266,7 @@ unsigned long flash_init (void)
+@@ -1367,7 +1311,7 @@ unsigned long flash_init (void)
unsigned long size = 0;
int i;
@@ -378,7 +387,7 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
/* Init: FMC */
/* BANK 0 : FMC CS0 , 1: FMC CS1, */
-@@ -1352,7 +1296,7 @@ unsigned long flash_init (void)
+@@ -1397,7 +1341,7 @@ unsigned long flash_init (void)
#ifdef CONFIG_SPI0_CS
//pin switch by trap[13:12] -- [0:1] Enable SPI Master
ast_scu_spi_master(1); /* enable SPI master */
@@ -387,22 +396,21 @@ Index: u-boot/arch/arm/mach-aspeed/flash.c
flash_info[CONFIG_FMC_CS].sysspi = 1;
flash_info[CONFIG_FMC_CS].reg_base = AST_FMC_SPI0_BASE;
flash_info[CONFIG_FMC_CS].flash_id = FLASH_UNKNOWN;
-@@ -1403,21 +1347,24 @@ void memmove_dma(void * dest,const void
+@@ -1448,21 +1392,24 @@ void memmove_dma(void * dest,const void *src,size_t count)
poll_time = 100; /* set 100 us as default */
/* force end of burst read */
- *(volatile ulong *) (AST_FMC_BASE + CS0_CTRL) |= CE_HIGH;
- *(volatile ulong *) (AST_FMC_BASE + CS0_CTRL) &= ~CE_HIGH;
--
++ data = readl(AST_FMC_BASE + CS0_CTRL);
++ writel(data | CE_HIGH, AST_FMC_BASE + CS0_CTRL);
++ writel(data & ~CE_HIGH, AST_FMC_BASE + CS0_CTRL);
+
- *(ulong *) (AST_FMC_BASE + REG_FLASH_DMA_CONTROL) = (ulong) (~FLASH_DMA_ENABLE);
- *(ulong *) (AST_FMC_BASE + REG_FLASH_DMA_FLASH_BASE) = (ulong) (src);
- *(ulong *) (AST_FMC_BASE + REG_FLASH_DMA_DRAM_BASE) = (ulong) (dest);
- *(ulong *) (AST_FMC_BASE + REG_FLASH_DMA_LENGTH) = (ulong) (count_align);
- *(ulong *) (AST_FMC_BASE + REG_FLASH_DMA_CONTROL) = (ulong) (FLASH_DMA_ENABLE);
-+ data = readl(AST_FMC_BASE + CS0_CTRL);
-+ writel(data | CE_HIGH, AST_FMC_BASE + CS0_CTRL);
-+ writel(data & ~CE_HIGH, AST_FMC_BASE + CS0_CTRL);
-+
+ writel(~FLASH_DMA_ENABLE, AST_FMC_BASE + REG_FLASH_DMA_CONTROL);
+ writel((ulong)src, AST_FMC_BASE + REG_FLASH_DMA_FLASH_BASE);
+ writel((ulong)dest, AST_FMC_BASE + REG_FLASH_DMA_DRAM_BASE);
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch
index e7e6c56d7..c438bdcd4 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch
@@ -1,4 +1,4 @@
-From 954e7dd9ff9c5d1159f0896afa34c673061b82ea Mon Sep 17 00:00:00 2001
+From 9efa565f1bc09b1906328b25a01e041ab5024769 Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@linux.intel.com>
Date: Tue, 11 Sep 2018 16:24:06 +0800
Subject: [PATCH] Make sure debug uart is using 24MHz clock source
@@ -16,7 +16,7 @@ Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
4 files changed, 17 insertions(+)
diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h
-index dcbc673..06825ce 100644
+index dcbc6730d4..06825cebbf 100644
--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
+++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
@@ -46,4 +46,6 @@ extern void ast_scu_init_eth(u8 num);
@@ -27,7 +27,7 @@ index dcbc673..06825ce 100644
+
#endif
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
-index 1c02914..92ea33b 100644
+index 1c02914fcb..92ea33b89a 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -27,6 +27,7 @@
@@ -39,7 +39,7 @@ index 1c02914..92ea33b 100644
#err "No define for platform.h"
#endif
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
-index 12de9b8..fff02dc 100644
+index 12de9b8036..fff02dc000 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -538,3 +538,9 @@ void ast_scu_get_who_init_dram(void)
@@ -53,10 +53,10 @@ index 12de9b8..fff02dc 100644
+ ~(1 << 28), AST_SCU_MISC2_CTRL);
+}
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index e67a4bf..5a1fade 100644
+index 12496cea09..45353b8f78 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
-@@ -16,6 +16,14 @@
+@@ -19,6 +19,14 @@
DECLARE_GLOBAL_DATA_PTR;
@@ -70,4 +70,4 @@ index e67a4bf..5a1fade 100644
+
int board_init(void)
{
- gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+ bool sdmc_unlocked;
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch
index 6bd063e39..46a547282 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch
@@ -1,4 +1,4 @@
-From 7e11461d6b65969005605f13677269eb91d39643 Mon Sep 17 00:00:00 2001
+From 872e3fd3ae8f692ab11c49dbbd1c5b311c2aaad1 Mon Sep 17 00:00:00 2001
From: Kuiying Wang <kuiying.wang@intel.com>
Date: Wed, 7 Nov 2018 13:57:57 +0800
Subject: [PATCH] enable passthrough in uboot
@@ -9,7 +9,7 @@ Subject: [PATCH] enable passthrough in uboot
2 files changed, 24 insertions(+)
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
-index fff02dc..d27f3d3 100644
+index fff02dc000..d27f3d3ede 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -544,3 +544,25 @@ void ast_config_uart5_clk(void)
@@ -39,10 +39,10 @@ index fff02dc..d27f3d3 100644
+ }
+}
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 5a1fade..b492003 100644
+index 45353b8f78..02eb2c3990 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
-@@ -20,6 +20,8 @@ int board_early_init_f(void)
+@@ -23,6 +23,8 @@ int board_early_init_f(void)
{
/* make sure uart5 is using 24MHz clock */
ast_config_uart5_clk();
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch
index 4f90d6dfe..a659a3011 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch
@@ -1,4 +1,4 @@
-From e782f6a90468fee35877b78e248a17f39f67c94c Mon Sep 17 00:00:00 2001
+From ad92c1981f81fe28b901894db537a0c98d5956e5 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Wed, 14 Nov 2018 10:21:40 -0800
Subject: [PATCH] Add Aspeed g5 interrupt support
@@ -11,11 +11,11 @@ Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: Id7072f1408dcf364968b1b74f2192e50a22a82f0
---
- Kconfig | 13 +++
- arch/arm/lib/interrupts.c | 11 +++
+ Kconfig | 13 ++
+ arch/arm/lib/interrupts.c | 11 ++
board/aspeed/ast-g5/Makefile | 3 +-
- board/aspeed/ast-g5/ast-g5-irq.c | 176 ++++++++++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5-irq.h | 39 ++++++++
+ board/aspeed/ast-g5/ast-g5-irq.c | 176 ++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-irq.h | 39 ++++++
board/aspeed/ast-g5/ast-g5.c | 3 +
board/aspeed/ast-g5/ast-g5.h | 7 ++
cmd/Kconfig | 5 +
@@ -28,7 +28,7 @@ Change-Id: Id7072f1408dcf364968b1b74f2192e50a22a82f0
create mode 100644 board/aspeed/ast-g5/ast-g5.h
diff --git a/Kconfig b/Kconfig
-index 3ceff25..d6439d0 100644
+index 3ceff25032..d6439d01ca 100644
--- a/Kconfig
+++ b/Kconfig
@@ -115,6 +115,19 @@ if EXPERT
@@ -52,7 +52,7 @@ index 3ceff25..d6439d0 100644
menu "Boot images"
diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
-index ed83043..a96b3aa 100644
+index ed83043abb..a96b3aa070 100644
--- a/arch/arm/lib/interrupts.c
+++ b/arch/arm/lib/interrupts.c
@@ -94,6 +94,17 @@ int disable_interrupts (void)
@@ -74,7 +74,7 @@ index ed83043..a96b3aa 100644
int interrupt_init (void)
{
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index d1d7f85..df4e639 100644
+index d1d7f8525e..df4e63966e 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -1 +1,2 @@
@@ -83,7 +83,7 @@ index d1d7f85..df4e639 100644
+obj-y += ast-g5-irq.o
diff --git a/board/aspeed/ast-g5/ast-g5-irq.c b/board/aspeed/ast-g5/ast-g5-irq.c
new file mode 100644
-index 0000000..860f16c
+index 0000000000..860f16cf05
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-irq.c
@@ -0,0 +1,176 @@
@@ -265,7 +265,7 @@ index 0000000..860f16c
+#endif
diff --git a/board/aspeed/ast-g5/ast-g5-irq.h b/board/aspeed/ast-g5/ast-g5-irq.h
new file mode 100644
-index 0000000..703eeab
+index 0000000000..703eeabf13
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-irq.h
@@ -0,0 +1,39 @@
@@ -309,11 +309,11 @@ index 0000000..703eeab
+
+#endif /* __AST_G5_IRQ_H__ */
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index b492003..2472aa3 100644
+index 02eb2c3990..ca25348178 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
-@@ -14,6 +14,8 @@
- #include <asm/arch/ast-sdmc.h>
+@@ -17,6 +17,8 @@
+ #include <asm/arch/regs-sdmc.h>
#include <asm/io.h>
+#include "ast-g5.h"
@@ -321,7 +321,7 @@ index b492003..2472aa3 100644
DECLARE_GLOBAL_DATA_PTR;
int board_early_init_f(void)
-@@ -22,6 +24,7 @@ int board_early_init_f(void)
+@@ -25,6 +27,7 @@ int board_early_init_f(void)
ast_config_uart5_clk();
/*enable pass through*/
ast_enable_pass_through();
@@ -331,7 +331,7 @@ index b492003..2472aa3 100644
}
diff --git a/board/aspeed/ast-g5/ast-g5.h b/board/aspeed/ast-g5/ast-g5.h
new file mode 100644
-index 0000000..9fd10ec
+index 0000000000..9fd10eccb3
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5.h
@@ -0,0 +1,7 @@
@@ -343,7 +343,7 @@ index 0000000..9fd10ec
+
+#endif /* _AST_G5_H_ */
diff --git a/cmd/Kconfig b/cmd/Kconfig
-index d69b817..33be240 100644
+index d69b817c82..33be2407d2 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -313,6 +313,11 @@ endmenu
@@ -359,7 +359,7 @@ index d69b817..33be240 100644
bool "dm - Access to driver model information"
depends on DM
diff --git a/configs/ast_g5_ncsi_2boot_defconfig b/configs/ast_g5_ncsi_2boot_defconfig
-index 2d28c86..d5b7894 100644
+index 2d28c86966..d5b7894a9e 100644
--- a/configs/ast_g5_ncsi_2boot_defconfig
+++ b/configs/ast_g5_ncsi_2boot_defconfig
@@ -33,3 +33,4 @@ CONFIG_CMD_CRC32=y
@@ -368,7 +368,7 @@ index 2d28c86..d5b7894 100644
CONFIG_CMD_MX_CYCLIC=y
+CONFIG_USE_IRQ=y
diff --git a/configs/ast_g5_ncsi_defconfig b/configs/ast_g5_ncsi_defconfig
-index 74029ed..9481e5f 100644
+index 74029ed514..9481e5fb6e 100644
--- a/configs/ast_g5_ncsi_defconfig
+++ b/configs/ast_g5_ncsi_defconfig
@@ -11,3 +11,4 @@ CONFIG_HUSH_PARSER=y
@@ -377,7 +377,7 @@ index 74029ed..9481e5f 100644
CONFIG_SYS_NS16550=y
+CONFIG_USE_IRQ=y
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
-index 767f3af..4aefcf4 100644
+index 767f3af605..4aefcf49e8 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
@@ -12,3 +12,4 @@ CONFIG_HUSH_PARSER=y
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0007-Add-espi-support.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0007-Add-espi-support.patch
index 40336d3dd..cbe0df0aa 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0007-Add-espi-support.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0007-Add-espi-support.patch
@@ -1,7 +1,7 @@
-From dff3a123b0318f83ecd753eea8945ebdc15fd2f9 Mon Sep 17 00:00:00 2001
+From 212e72b6df74af242b23443b252deed4d06129f4 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Wed, 14 Nov 2018 10:21:40 -0800
-Subject: [PATCH 1/1] Add espi support
+Subject: [PATCH] Add espi support
This adds basic eSPI support for U-Boot. The eSPI driver works best with
interrupts because the timing of the initialization with the PCH is not
@@ -13,6 +13,7 @@ functions.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
arch/arm/include/asm/arch-aspeed/regs-scu.h | 2 +
board/aspeed/ast-g5/Makefile | 2 +
@@ -47,7 +48,7 @@ index df4e63966e..58e0c648f4 100644
obj-y += ast-g5-irq.o
diff --git a/board/aspeed/ast-g5/ast-g5-espi.c b/board/aspeed/ast-g5/ast-g5-espi.c
new file mode 100644
-index 0000000000..5a3ffe7bef
+index 0000000000..7c82cdfd65
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-espi.c
@@ -0,0 +1,248 @@
@@ -342,6 +343,3 @@ index ca25348178..cab5fabcef 100644
return 0;
}
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch
index 5fa4bffa1..d82acc623 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch
@@ -1,4 +1,4 @@
-From 40e02e4ffa13c0128db555a3a3982a7cdc0ebf60 Mon Sep 17 00:00:00 2001
+From 248f12a6a02819a5318025df0868dfd40efa2207 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Wed, 14 Nov 2018 12:09:52 -0800
Subject: [PATCH] add sgio support for port80 snoop post LEDs
@@ -11,12 +11,12 @@ Change-Id: Iaa1b91cd40f4b6323dba0598da373cb631459e66
---
arch/arm/include/asm/arch-aspeed/ast_scu.h | 1 +
- arch/arm/mach-aspeed/ast-scu.c | 8 +++
- board/aspeed/ast-g5/ast-g5-intel.c | 96 ++++++++++++++++++++++++++++++
+ arch/arm/mach-aspeed/ast-scu.c | 8 ++
+ board/aspeed/ast-g5/ast-g5-intel.c | 96 ++++++++++++++++++++++
3 files changed, 105 insertions(+)
diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h
-index 06825ce..369c4e3 100644
+index 06825cebbf..369c4e3b60 100644
--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
+++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
@@ -45,6 +45,7 @@ extern u32 ast_scu_get_vga_memsize(void);
@@ -28,7 +28,7 @@ index 06825ce..369c4e3 100644
void ast_config_uart5_clk(void);
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
-index d27f3d3..3a9ba05 100644
+index d27f3d3ede..3a9ba05bf2 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -449,6 +449,14 @@ void ast_scu_multi_func_romcs(u8 num)
@@ -47,7 +47,7 @@ index d27f3d3..3a9ba05 100644
{
int i;
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index e79235c..c2a8b33 100644
+index e79235c8d0..c2a8b33aec 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -8,9 +8,105 @@
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch
index e11f15870..ee93e9884 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch
@@ -1,7 +1,7 @@
-From 15d04184a94aca6db889d77c2cc5a800b280da4b Mon Sep 17 00:00:00 2001
+From 34ceaf8ee2c6556045f00b911c001bcc2f91c1f8 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Fri, 16 Nov 2018 09:58:01 -0800
-Subject: [PATCH 01/30] Add basic GPIO support
+Subject: [PATCH] Add basic GPIO support
Add a table of well-known gpios (such as FP LEDs and FF UPD jumper) and
initialize them at boot.
@@ -11,7 +11,7 @@ Add a mechanism to get/set well known gpios from command line.
Change-Id: I4136a5ccb048b3604f13b17ea0c18a4bc596c249
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
-%% original patch: 0009-Add-basic-GPIO-support.patch
+
---
board/aspeed/ast-g5/Makefile | 1 +
board/aspeed/ast-g5/ast-g5-gpio.c | 202 +++++++++++++++++++++++++++++
@@ -422,6 +422,3 @@ index 9fd10eccb3..908db1477b 100644
+#include "ast-g5-gpio.h"
#endif /* _AST_G5_H_ */
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
index c6ee49f57..b22f50650 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
@@ -1,4 +1,4 @@
-From d08d22af794eed7b928ab96030a103cfb7bf6ce1 Mon Sep 17 00:00:00 2001
+From 1ce8ac1579502cc4a0e00a2d997a46a83941361b Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Fri, 16 Nov 2018 14:59:04 -0800
Subject: [PATCH] Update Force Firmware Update Jumper to use new gpio API
@@ -10,16 +10,16 @@ Change-Id: I8ead931e9dd828522095a0ef386875be652ec885
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
---
- arch/arm/include/asm/arch-aspeed/ast-g5-intel.h | 19 +++++++++++++++++++
- arch/arm/include/asm/arch-aspeed/platform.h | 1 +
- board/aspeed/ast-g5/ast-g5-intel.c | 5 +++++
- common/autoboot.c | 6 ++++++
+ .../include/asm/arch-aspeed/ast-g5-intel.h | 19 +++++++++++++++++++
+ arch/arm/include/asm/arch-aspeed/platform.h | 1 +
+ board/aspeed/ast-g5/ast-g5-intel.c | 5 +++++
+ common/autoboot.c | 6 ++++++
4 files changed, 31 insertions(+)
create mode 100644 arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
diff --git a/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
new file mode 100644
-index 0000000..cd9a099
+index 0000000000..cd9a0994fa
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
@@ -0,0 +1,19 @@
@@ -43,7 +43,7 @@ index 0000000..cd9a099
+
+#endif /* __AST_INTEL_G5_H__ */
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
-index 92ea33b..3b06e52 100644
+index 92ea33b89a..3b06e526f5 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -27,6 +27,7 @@
@@ -55,10 +55,10 @@ index 92ea33b..3b06e52 100644
#else
#err "No define for platform.h"
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 069e7a3..144765a 100644
+index 1868c230eb..9779052da4 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -145,6 +145,11 @@ static void sgpio_init(void)
+@@ -148,6 +148,11 @@ static void sgpio_init(void)
writel(value, AST_GPIO_BASE + GPIO254);
}
@@ -71,7 +71,7 @@ index 069e7a3..144765a 100644
void ast_g5_intel(void)
{
diff --git a/common/autoboot.c b/common/autoboot.c
-index c52bad8..d66c0fa 100644
+index c52bad84a4..d66c0fa63a 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -14,6 +14,7 @@
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch
index 26b4c4fc9..3a26416b3 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch
@@ -1,4 +1,4 @@
-From 320cf189fd017e3578b6949ff640213d7bddb20c Mon Sep 17 00:00:00 2001
+From c5098f399d379f79c5532d06f816b05ad4ad6d77 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Fri, 16 Nov 2018 14:44:49 -0800
Subject: [PATCH] Add basic timer support for Aspeed g5 in U-Boot
@@ -12,15 +12,15 @@ Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
---
board/aspeed/ast-g5/Makefile | 1 +
board/aspeed/ast-g5/ast-g5-intel.c | 1 +
- board/aspeed/ast-g5/ast-g5-timer.c | 66 ++++++++++++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5-timer.h | 27 ++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-timer.c | 66 ++++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-timer.h | 27 ++++++++++++
board/aspeed/ast-g5/ast-g5.h | 1 +
5 files changed, 96 insertions(+)
create mode 100644 board/aspeed/ast-g5/ast-g5-timer.c
create mode 100644 board/aspeed/ast-g5/ast-g5-timer.h
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index 2970ae5..9022433 100644
+index 2970ae5741..90224333c4 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -3,3 +3,4 @@ obj-y += ast-g5-intel.o
@@ -29,7 +29,7 @@ index 2970ae5..9022433 100644
obj-y += ast-g5-gpio.o
+obj-y += ast-g5-timer.o
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 144765a..6e45cb4 100644
+index 9779052da4..4ef25ab8f5 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -15,6 +15,7 @@
@@ -42,7 +42,7 @@ index 144765a..6e45cb4 100644
enum gpio_names {
diff --git a/board/aspeed/ast-g5/ast-g5-timer.c b/board/aspeed/ast-g5/ast-g5-timer.c
new file mode 100644
-index 0000000..5615722
+index 0000000000..56157222d9
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-timer.c
@@ -0,0 +1,66 @@
@@ -114,7 +114,7 @@ index 0000000..5615722
+}
diff --git a/board/aspeed/ast-g5/ast-g5-timer.h b/board/aspeed/ast-g5/ast-g5-timer.h
new file mode 100644
-index 0000000..4b1ac28
+index 0000000000..4b1ac28a9f
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-timer.h
@@ -0,0 +1,27 @@
@@ -146,7 +146,7 @@ index 0000000..4b1ac28
+
+#endif /* __AST_G5_TIMER_H__ */
diff --git a/board/aspeed/ast-g5/ast-g5.h b/board/aspeed/ast-g5/ast-g5.h
-index 908db14..28fe5ea 100644
+index 908db1477b..28fe5eafcb 100644
--- a/board/aspeed/ast-g5/ast-g5.h
+++ b/board/aspeed/ast-g5/ast-g5.h
@@ -4,5 +4,6 @@
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch
index e376001b3..e333b6cc0 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch
@@ -1,4 +1,4 @@
-From 2db86017f1cd48da9f6c102665d5ae3d1efe48cc Mon Sep 17 00:00:00 2001
+From e252fcfd1ad66f1af57da1851bb39a398a9545e7 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Wed, 14 Nov 2018 12:16:53 -0800
Subject: [PATCH] Add status and ID LED support
@@ -11,15 +11,16 @@ Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Change-Id: Ic9595621b21000ef465ff57ed2047855296e2714
+
---
- board/aspeed/ast-g5/ast-g5-intel.c | 113 +++++++++++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-intel.c | 113 +++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 6e45cb4..e749992 100644
+index 4ef25ab8f5..e27b538fcc 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -146,6 +146,112 @@ static void sgpio_init(void)
+@@ -149,6 +149,112 @@ static void sgpio_init(void)
writel(value, AST_GPIO_BASE + GPIO254);
}
@@ -132,7 +133,7 @@ index 6e45cb4..e749992 100644
int intel_force_firmware_jumper_enabled(void)
{
return gpio_get_value(GPIO_FF_UPD_JUMPER);
-@@ -157,4 +263,11 @@ void ast_g5_intel(void)
+@@ -160,4 +266,11 @@ void ast_g5_intel(void)
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
espi_init();
sgpio_init();
@@ -144,6 +145,3 @@ index 6e45cb4..e749992 100644
+ id_led_control(GPIO_AMBER_LED, EIDLED_On);
+ }
}
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch
index 4714dd6cc..6a3132adb 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch
@@ -1,19 +1,20 @@
-From 039b9a278a4d075e455a38ec93171dc812aec8b2 Mon Sep 17 00:00:00 2001
+From 118b202b435df8b9a8bdee296289fd42c4a95959 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Fri, 16 Nov 2018 15:57:57 -0800
-Subject: [PATCH 1/1] aspeed: add Pwm Driver
+Subject: [PATCH] aspeed: add Pwm Driver
Change-Id: Ia8b80212f7c70aafcc6a71782936ec95cf9b7f38
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
board/aspeed/ast-g5/ast-g5-intel.c | 113 +++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index e74999223b..74e218dfd0 100644
+index e27b538fcc..a6cad69b1e 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -257,9 +257,122 @@ int intel_force_firmware_jumper_enabled(void)
+@@ -260,9 +260,122 @@ int intel_force_firmware_jumper_enabled(void)
return gpio_get_value(GPIO_FF_UPD_JUMPER);
}
@@ -136,6 +137,3 @@ index e74999223b..74e218dfd0 100644
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
espi_init();
sgpio_init();
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch
index 22191f07a..306728244 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch
@@ -1,4 +1,4 @@
-From 040c9c13778076403198ce93f43c4aa3a1ed3907 Mon Sep 17 00:00:00 2001
+From 473287e31ebd263e7278dd86e2f5e72aba9ba4db Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Sat, 17 Nov 2018 14:17:27 -0800
Subject: [PATCH] Keep interrupts enabled until last second
@@ -18,10 +18,10 @@ Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index c7ae566..01f8a13 100644
+index a6cad69b1e..5796ecf055 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -255,6 +255,14 @@ int intel_force_firmware_jumper_enabled(void)
+@@ -260,6 +260,14 @@ int intel_force_firmware_jumper_enabled(void)
return gpio_get_value(GPIO_FF_UPD_JUMPER);
}
@@ -37,7 +37,7 @@ index c7ae566..01f8a13 100644
#define PWM_BASE_ADDR 0x1E786000
diff --git a/common/bootm.c b/common/bootm.c
-index 2431019..46909ec 100644
+index 2431019b3f..46909ecdbb 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -602,7 +602,6 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
@@ -76,7 +76,7 @@ index 2431019..46909ec 100644
bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL);
else if (ret == BOOTM_ERR_RESET)
diff --git a/common/bootm_os.c b/common/bootm_os.c
-index 9ec84bd..b56eb39 100644
+index 9ec84bd0db..b56eb39780 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -476,6 +476,7 @@ __weak void arch_preboot_os(void)
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch
index d93d9c4a1..f5ff7a2b9 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch
@@ -1,4 +1,4 @@
-From 711c7bc5a07b62e8369bc76a9db265c960bacef8 Mon Sep 17 00:00:00 2001
+From e600623b13e3de73be5cd3b2711d58095efb4573 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Mon, 19 Nov 2018 11:04:02 -0800
Subject: [PATCH] Rewrite memmove to optimize on word transfers
@@ -12,11 +12,11 @@ Change-Id: Ie0a1f3261e507fb34a908571883d9bf04a1059ee
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
---
- lib/string.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
+ lib/string.c | 77 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 64 insertions(+), 13 deletions(-)
diff --git a/lib/string.c b/lib/string.c
-index 67d5f6a..0bf472f 100644
+index 67d5f6a421..0bf472f1f6 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -505,26 +505,77 @@ void * memcpy(void *dest, const void *src, size_t count)
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch
index 8a63edbb7..8798c1f6a 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch
@@ -1,4 +1,4 @@
-From 9b05a276af65dd436f30b1b2680a09821c5a81aa Mon Sep 17 00:00:00 2001
+From ec61ed244f574158315df42c17f4a8d3b3504b97 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@intel.com>
Date: Mon, 17 Dec 2018 20:37:23 -0800
Subject: [PATCH] u-boot: full platform reset + espi oob-ready
@@ -14,7 +14,7 @@ Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-aspeed/platform_g5.S b/arch/arm/mach-aspeed/platform_g5.S
-index 2ac1ca4..66427b6 100644
+index 2ac1ca4721..66427b6f33 100644
--- a/arch/arm/mach-aspeed/platform_g5.S
+++ b/arch/arm/mach-aspeed/platform_g5.S
@@ -139,7 +139,7 @@
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch
index afdd610b3..c5d194d6b 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch
@@ -1,4 +1,4 @@
-From 54616ade08517374200a332e50f68ee9d0fbf5c5 Mon Sep 17 00:00:00 2001
+From 4027a17dcfa5749cf2777a62c695a5b04377756b Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@linux.intel.com>
Date: Tue, 9 Apr 2019 14:42:05 +0800
Subject: [PATCH] Add system reset status support
@@ -14,12 +14,12 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
---
arch/arm/include/asm/arch-aspeed/platform.h | 2 +
arch/arm/mach-aspeed/ast-scu.c | 4 ++
- board/aspeed/ast-g5/ast-g5-intel.c | 73 +++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5.c | 7 +++
+ board/aspeed/ast-g5/ast-g5-intel.c | 73 +++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5.c | 7 ++
4 files changed, 86 insertions(+)
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
-index 3b06e52..4e4140d 100644
+index 3b06e526f5..4e4140d8e4 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -29,6 +29,8 @@
@@ -32,7 +32,7 @@ index 3b06e52..4e4140d 100644
#err "No define for platform.h"
#endif
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
-index 3a9ba05..976c59b 100644
+index 3a9ba05bf2..976c59b82a 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -494,6 +494,9 @@ void ast_scu_sys_rest_info(void)
@@ -54,11 +54,11 @@ index 3a9ba05..976c59b 100644
u32 ast_scu_get_vga_memsize(void)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 01f8a13..e0bf9ee 100644
+index 5796ecf055..a223c798ac 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -303,6 +303,79 @@ static inline void ast_scu_write(uint32_t val, uint32_t reg)
- #endif
+@@ -333,6 +333,79 @@ static void set_pwm_duty_cycle(int duty)
+
}
+
@@ -138,10 +138,10 @@ index 01f8a13..e0bf9ee 100644
{
uint32_t val;
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index d41ef9c..0953677 100644
+index cab5fabcef..d89a2b799a 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
-@@ -19,6 +19,7 @@
+@@ -22,6 +22,7 @@
DECLARE_GLOBAL_DATA_PTR;
extern void ast_g5_intel(void);
@@ -149,7 +149,7 @@ index d41ef9c..0953677 100644
int board_early_init_f(void)
{
-@@ -40,6 +41,12 @@ int board_init(void)
+@@ -90,6 +91,12 @@ int board_init(void)
return 0;
}
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch
index 6949856db..60800a3fd 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch
@@ -1,4 +1,4 @@
-From 647cc2538ed6b64054c742b4668386fda9394221 Mon Sep 17 00:00:00 2001
+From 088d7496885148f6d953a709988ab3ac1c2919a8 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Tue, 8 Jan 2019 13:33:15 -0800
Subject: [PATCH] Enable PCIe L1 support
@@ -12,7 +12,7 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 12 insertions(+)
diff --git a/arch/arm/mach-aspeed/platform_g5.S b/arch/arm/mach-aspeed/platform_g5.S
-index 66427b6..b404353 100644
+index 66427b6f33..b4043534b0 100644
--- a/arch/arm/mach-aspeed/platform_g5.S
+++ b/arch/arm/mach-aspeed/platform_g5.S
@@ -2432,6 +2432,18 @@ spi_cbr_end:
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch
index 32a40261f..7cc0d2d11 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch
@@ -1,4 +1,4 @@
-From 30c634b4969b8a3cd3afc079d60d23d2cb9f5f5c Mon Sep 17 00:00:00 2001
+From 2740b1112737d3acd23d3a0b56ab26b05a5d1a5e Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@linux.intel.com>
Date: Mon, 11 Feb 2019 15:19:56 +0800
Subject: [PATCH] Config host uart clock source using environment variable
@@ -27,15 +27,15 @@ cat /sys/class/tty/ttyS*/uartclk, ttyS0/12/3 should be 192MHz
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
---
- arch/arm/include/asm/arch-aspeed/regs-scu.h | 5 ++++
- board/aspeed/ast-g5/ast-g5-intel.c | 39 +++++++++++++++++++++++++++++
+ arch/arm/include/asm/arch-aspeed/regs-scu.h | 5 +++
+ board/aspeed/ast-g5/ast-g5-intel.c | 39 +++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/arch/arm/include/asm/arch-aspeed/regs-scu.h b/arch/arm/include/asm/arch-aspeed/regs-scu.h
-index 10b983a..8a596ce 100644
+index 019c00036a..a2c9549fc6 100644
--- a/arch/arm/include/asm/arch-aspeed/regs-scu.h
+++ b/arch/arm/include/asm/arch-aspeed/regs-scu.h
-@@ -529,6 +529,11 @@
+@@ -530,6 +530,11 @@
/* AST_SCU_MAC_CLK 0x48 - MAC interface clock delay setting register */
/* AST_SCU_MISC2_CTRL 0x4C - Misc. 2 Control register */
@@ -48,10 +48,10 @@ index 10b983a..8a596ce 100644
#define SCU_PCIE_MAPPING_HIGH (1 << 15)
#define SCU_MALI_DTY_MODE (1 << 8)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index e0bf9ee..e19df03 100644
+index a223c798ac..a16e1330a0 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -103,6 +103,9 @@ static const GPIOValue gpio_table[] = {
+@@ -106,6 +106,9 @@ static const GPIOValue gpio_table[] = {
#define SGPIO_ENABLE 1
#define GPIO254 0x254
@@ -61,7 +61,7 @@ index e0bf9ee..e19df03 100644
static void sgpio_init(void)
{
uint32_t value;
-@@ -368,6 +371,42 @@ void ast_g5_intel_late_init(void)
+@@ -398,6 +401,42 @@ void ast_g5_intel_late_init(void)
char value[32];
u32 reset_reason = 0;
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch
index 2b6382967..9020ff265 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch
@@ -1,7 +1,7 @@
-From 6d8db23becf9665193023e350adcad00b75195b0 Mon Sep 17 00:00:00 2001
+From ecda16cf2eb96fb63aca737513abcf79cc59a44b Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Wed, 13 Mar 2019 14:28:05 +0530
-Subject: [PATCH 1/1] KCS driver support in uBoot
+Subject: [PATCH] KCS driver support in uBoot
Added KCS support in uBoot. This will enable
KCS channels and set the specified registers
@@ -26,6 +26,7 @@ via KCS interfaces using cmdtool.efi.
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
board/aspeed/ast-g5/Makefile | 1 +
board/aspeed/ast-g5/ast-g5-intel.c | 3 +
@@ -45,20 +46,20 @@ index 90224333c4..05972b9d17 100644
obj-y += ast-g5-timer.o
+obj-y += ast-g5-kcs.o
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 032f716722..c149426947 100644
+index a16e1330a0..ac2af9af56 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -256,6 +256,7 @@ int intel_force_firmware_jumper_enabled(void)
+@@ -493,6 +493,7 @@ static void pwm_init(void)
}
extern void espi_init(void);
+extern void kcs_init(void);
void ast_g5_intel(void)
{
- gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
-@@ -264,5 +265,7 @@ void ast_g5_intel(void)
- timer8_init();
- if (intel_force_firmware_jumper_enabled()) {
+ pwm_init();
+@@ -505,5 +506,7 @@ void ast_g5_intel(void)
+ id_led_control(GPIO_ID_LED, EIDLED_On);
+ id_led_control(GPIO_GREEN_LED, EIDLED_Off);
id_led_control(GPIO_AMBER_LED, EIDLED_On);
+ kcs_init();
+ /* TODO: need to stop the booting here. */
@@ -608,6 +609,3 @@ index 0000000000..bb697c455d
+ u16 data_out_idx;
+ u8 data_out[MAX_KCS_PKT_SIZE];
+};
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch
index afba07abf..5a9b3c081 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch
@@ -1,4 +1,4 @@
-From 4cbfb21b7792e6dae74e2db6e2e2d6803bf6cc1d Mon Sep 17 00:00:00 2001
+From d0546e59ff42f964ab09cebb1bab0fc2d8e7e6d8 Mon Sep 17 00:00:00 2001
From: Vikram Bodireddy <vikram.bodireddy@intel.com>
Date: Tue, 26 Mar 2019 20:34:51 +0530
Subject: [PATCH] u-boot env change for PFR image
@@ -6,12 +6,13 @@ Subject: [PATCH] u-boot env change for PFR image
Tested: verified BMC booting from 0x20b00000
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
+
---
include/configs/ast-common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
-index 0bc7f2d..821ea8f 100644
+index 0bc7f2d75f..821ea8f8eb 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -108,7 +108,7 @@
@@ -32,6 +33,3 @@ index 0bc7f2d..821ea8f 100644
#define CONFIG_ENV_OVERWRITE
#define ASPEED_ENV_SETTINGS \
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch
index f3fc0738b..8da4dc22f 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch
@@ -1,4 +1,4 @@
-From 6b0f858e2dda7afce82797835f950e3501b3046d Mon Sep 17 00:00:00 2001
+From ad47771d6210d686082498e4e829b41b8fd8e160 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 29 Mar 2019 12:30:20 -0700
Subject: [PATCH] Add TPM enable pulse triggering
@@ -12,10 +12,10 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index adc6d10..55afa09 100644
+index ac2af9af56..45ecd83fd3 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -53,8 +53,8 @@ static const GPIOValue gpio_table[] = {
+@@ -56,8 +56,8 @@ static const GPIOValue gpio_table[] = {
GPIO_DEBOUNCE_8MS},
/* Enable Pulse -- pin D6 */
@@ -26,7 +26,7 @@ index adc6d10..55afa09 100644
};
#define LPC_SNOOP_ADDR 0x80
-@@ -232,6 +232,13 @@ void id_led_control(int id, int action)
+@@ -237,6 +237,13 @@ void id_led_control(int id, int action)
gpio_set_value(s_led_info[id].gpio, s_led_info[id].state);
}
@@ -40,11 +40,11 @@ index adc6d10..55afa09 100644
static void timer8_irq_handler(void *regs)
{
int i;
-@@ -488,6 +495,7 @@ void ast_g5_intel(void)
+@@ -501,6 +508,7 @@ void ast_g5_intel(void)
espi_init();
sgpio_init();
timer8_init();
+ enable_onboard_tpm();
if (intel_force_firmware_jumper_enabled()) {
- id_led_control(GPIO_AMBER_LED, EIDLED_On);
- kcs_init();
+ /* FFUJ mode:- ChassisID: Solid Blue, StatusLED: Solid Amber */
+ id_led_control(GPIO_ID_LED, EIDLED_On);
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch
index 252a9ea1b..0697c2808 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch
@@ -1,4 +1,4 @@
-From 2314db61ea792a98c35fcc75b0ac09cbc0db005d Mon Sep 17 00:00:00 2001
+From 7bbaf8f4c268f9df195a84486caf3c22e21db59e Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Tue, 21 May 2019 00:19:16 +0530
Subject: [PATCH] IPMI command handler implementation in uboot
@@ -23,15 +23,15 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
---
board/aspeed/ast-g5/Makefile | 1 +
- board/aspeed/ast-g5/ast-g5-kcs.c | 77 +++++++++++++-----------
- board/aspeed/ast-g5/ipmi-handler.c | 118 +++++++++++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ipmi-handler.h | 40 +++++++++++++
+ board/aspeed/ast-g5/ast-g5-kcs.c | 77 ++++++++++---------
+ board/aspeed/ast-g5/ipmi-handler.c | 118 +++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ipmi-handler.h | 40 ++++++++++
4 files changed, 202 insertions(+), 34 deletions(-)
create mode 100644 board/aspeed/ast-g5/ipmi-handler.c
create mode 100644 board/aspeed/ast-g5/ipmi-handler.h
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index 05972b9..f28fcfe 100644
+index 05972b9d17..f28fcfe61c 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -5,3 +5,4 @@ obj-y += ast-g5-irq.o
@@ -40,7 +40,7 @@ index 05972b9..f28fcfe 100644
obj-y += ast-g5-kcs.o
+obj-y += ipmi-handler.o
diff --git a/board/aspeed/ast-g5/ast-g5-kcs.c b/board/aspeed/ast-g5/ast-g5-kcs.c
-index 7bff26f..98bf69b 100644
+index 7bff26f9db..98bf69ba85 100644
--- a/board/aspeed/ast-g5/ast-g5-kcs.c
+++ b/board/aspeed/ast-g5/ast-g5-kcs.c
@@ -1,7 +1,7 @@
@@ -160,7 +160,7 @@ index 7bff26f..98bf69b 100644
kcs_pkt->read_req_done = false;
diff --git a/board/aspeed/ast-g5/ipmi-handler.c b/board/aspeed/ast-g5/ipmi-handler.c
new file mode 100644
-index 0000000..9cccee9
+index 0000000000..9cccee9f2f
--- /dev/null
+++ b/board/aspeed/ast-g5/ipmi-handler.c
@@ -0,0 +1,118 @@
@@ -284,7 +284,7 @@ index 0000000..9cccee9
+}
diff --git a/board/aspeed/ast-g5/ipmi-handler.h b/board/aspeed/ast-g5/ipmi-handler.h
new file mode 100644
-index 0000000..9d46d9b
+index 0000000000..9d46d9bd9a
--- /dev/null
+++ b/board/aspeed/ast-g5/ipmi-handler.h
@@ -0,0 +1,40 @@
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
index 065f890bc..6932aebf0 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
@@ -1,7 +1,7 @@
-From b6f898ef15eede75700e9e13a8e0b69d88b12fd4 Mon Sep 17 00:00:00 2001
+From 008edb2487358bb3f0f0ec1d753cc5bff7b08182 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Thu, 20 Jun 2019 18:11:43 +0530
-Subject: [PATCH 15/30] Manufacturing mode physical presence detection
+Subject: [PATCH] Manufacturing mode physical presence detection
Support for physical presence of manufacturing mode added.
Front panel power button press for 15 seconds will be detected
@@ -23,7 +23,7 @@ Change-Id: Id7e7c7e7860c7ef3ae8e3a7a7cfda7ff506c0f2b
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
-%% original patch: 0025-Manufacturing-mode-physical-presence-detection.patch
+
---
board/aspeed/ast-g5/ast-g5-gpio.h | 2 +-
board/aspeed/ast-g5/ast-g5-intel.c | 35 ++++++++++++++++++++++++++++++
@@ -109,6 +109,3 @@ index 45ecd83fd3..efc3315caf 100644
}
static void pwm_init(void)
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch
index be2c4018d..2002259ee 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch
@@ -1,4 +1,4 @@
-From ea4f14a24b67d5085149d48c7fb38d00f3a7444a Mon Sep 17 00:00:00 2001
+From dd5ead5f8474a9929301745d3cdac23385ff6ded Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Mon, 6 May 2019 03:01:55 +0530
Subject: [PATCH] Aspeed I2C support in U-Boot
@@ -16,24 +16,24 @@ Change-Id: Iad9af4a57a58bc8dc5c470bfadad9dac1371c238
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
---
- arch/arm/include/asm/arch-aspeed/ast_g5_platform.h | 14 +
- arch/arm/include/asm/arch-aspeed/ast_scu.h | 5 +
- arch/arm/include/asm/arch-aspeed/regs-iic.h | 204 +++++
- arch/arm/mach-aspeed/ast-scu.c | 122 +++
- board/aspeed/ast-g5/ast-g5.c | 8 +
- configs/ast_g5_phy_defconfig | 2 +
- drivers/i2c/Kconfig | 5 +
- drivers/i2c/Makefile | 1 +
- drivers/i2c/ast_i2c.c | 852 +++++++++++++++++++++
- drivers/i2c/ast_i2c.h | 131 ++++
- include/configs/ast-common.h | 5 +
+ .../include/asm/arch-aspeed/ast_g5_platform.h | 14 +
+ arch/arm/include/asm/arch-aspeed/ast_scu.h | 5 +
+ arch/arm/include/asm/arch-aspeed/regs-iic.h | 204 +++++
+ arch/arm/mach-aspeed/ast-scu.c | 122 +++
+ board/aspeed/ast-g5/ast-g5.c | 8 +
+ configs/ast_g5_phy_defconfig | 2 +
+ drivers/i2c/Kconfig | 5 +
+ drivers/i2c/Makefile | 1 +
+ drivers/i2c/ast_i2c.c | 852 ++++++++++++++++++
+ drivers/i2c/ast_i2c.h | 131 +++
+ include/configs/ast-common.h | 5 +
11 files changed, 1349 insertions(+)
create mode 100644 arch/arm/include/asm/arch-aspeed/regs-iic.h
create mode 100644 drivers/i2c/ast_i2c.c
create mode 100644 drivers/i2c/ast_i2c.h
diff --git a/arch/arm/include/asm/arch-aspeed/ast_g5_platform.h b/arch/arm/include/asm/arch-aspeed/ast_g5_platform.h
-index 4210873..a84f471 100644
+index 42108733f3..a84f471bf4 100644
--- a/arch/arm/include/asm/arch-aspeed/ast_g5_platform.h
+++ b/arch/arm/include/asm/arch-aspeed/ast_g5_platform.h
@@ -105,6 +105,20 @@
@@ -58,7 +58,7 @@ index 4210873..a84f471 100644
#define AST_PCIARBITER_BASE 0x1E78C000 /* PCI ARBITER */
#define AST_UART2_BASE 0x1E78D000 /* UART2 */
diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h
-index 369c4e3..b94d13e 100644
+index 369c4e3b60..b94d13e97d 100644
--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
+++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
@@ -28,6 +28,8 @@
@@ -89,7 +89,7 @@ index 369c4e3..b94d13e 100644
diff --git a/arch/arm/include/asm/arch-aspeed/regs-iic.h b/arch/arm/include/asm/arch-aspeed/regs-iic.h
new file mode 100644
-index 0000000..5eb3f0a
+index 0000000000..5eb3f0a828
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/regs-iic.h
@@ -0,0 +1,204 @@
@@ -298,7 +298,7 @@ index 0000000..5eb3f0a
+
+#endif /* __ASM_ARCH_REGS_IIC_H */
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
-index 976c59b..537cd4b 100644
+index 976c59b82a..537cd4b3e1 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -112,6 +112,12 @@ static struct soc_id soc_map_table[] = {
@@ -445,18 +445,18 @@ index 976c59b..537cd4b 100644
{
int i;
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 0953677..3c33546 100644
+index d89a2b799a..ead2e1bb63 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
-@@ -13,6 +13,7 @@
- #include <asm/arch/ast_scu.h>
- #include <asm/arch/ast-sdmc.h>
+@@ -16,6 +16,7 @@
+ #include <asm/arch/regs-scu.h>
+ #include <asm/arch/regs-sdmc.h>
#include <asm/io.h>
+#include <i2c.h>
#include "ast-g5.h"
-@@ -37,6 +38,13 @@ int board_init(void)
+@@ -87,6 +88,13 @@ int board_init(void)
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
gd->flags = 0;
@@ -471,7 +471,7 @@ index 0953677..3c33546 100644
return 0;
}
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
-index 4aefcf4..1b96ab7 100644
+index 4aefcf49e8..1b96ab7f3b 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
@@ -13,3 +13,5 @@ CONFIG_OF_LIBFDT=y
@@ -481,7 +481,7 @@ index 4aefcf4..1b96ab7 100644
+CONFIG_CMD_I2C=y
+CONFIG_SYS_I2C_AST=y
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
-index 6e22bba..5368ba2 100644
+index 6e22bbadff..5368ba270a 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -58,6 +58,11 @@ config DM_I2C_GPIO
@@ -497,7 +497,7 @@ index 6e22bba..5368ba2 100644
bool "Freescale I2C bus driver"
depends on DM_I2C
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
-index 167424d..b2a69ea 100644
+index 167424db98..b2a69eafc1 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_$(SPL_)I2C_CROS_EC_TUNNEL) += cros_ec_tunnel.o
@@ -510,7 +510,7 @@ index 167424d..b2a69ea 100644
obj-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c
new file mode 100644
-index 0000000..533419f
+index 0000000000..533419f9dd
--- /dev/null
+++ b/drivers/i2c/ast_i2c.c
@@ -0,0 +1,852 @@
@@ -1368,7 +1368,7 @@ index 0000000..533419f
+#endif
diff --git a/drivers/i2c/ast_i2c.h b/drivers/i2c/ast_i2c.h
new file mode 100644
-index 0000000..7cff0e5
+index 0000000000..7cff0e5a10
--- /dev/null
+++ b/drivers/i2c/ast_i2c.h
@@ -0,0 +1,131 @@
@@ -1504,7 +1504,7 @@ index 0000000..7cff0e5
+
+#endif /* __AST_I2C_H_ */
diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
-index b7d7192..0bc7f2d 100644
+index b7d7192cce..0bc7f2d75f 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -84,6 +84,11 @@
@@ -1519,6 +1519,3 @@ index b7d7192..0bc7f2d 100644
/*
* Optional MTD and UBI support
*/
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch
index ac458dd6c..2729b066d 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch
@@ -1,4 +1,4 @@
-From 0083904a79527cef9ca99e516ed015b56a6b95c7 Mon Sep 17 00:00:00 2001
+From 3d2ea02810c8b6d595536cf2ce0c692f56ebaf0c Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Tue, 7 May 2019 11:26:35 +0530
Subject: [PATCH] CPLD u-boot commands support for PFR
@@ -29,6 +29,7 @@ ast#
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
+
---
cmd/Makefile | 1 +
cmd/cpld.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -297,6 +298,3 @@ index 0000000000..1b225d20dc
+#endif
+
+U_BOOT_CMD(cpld, 4, 1, do_cpld, "PFR CPLD information", cpld_help_text);
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch
index 0113fc3fe..e3864db6e 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch
@@ -1,4 +1,4 @@
-From 41c08f1fcb5fa0b07ea541fc3d8bc322ddf8701d Mon Sep 17 00:00:00 2001
+From f387e9be00ccaa49d77c82d4340dff6f84bb4bb3 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Mon, 13 May 2019 23:49:02 +0530
Subject: [PATCH] Enabling uart1&uart2 in u-boot for BIOS messages
@@ -19,10 +19,10 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
1 file changed, 21 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 812e3ef..e68ab85 100644
+index efc3315caf..a8b65658b3 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -453,6 +453,26 @@ void ast_g5_intel_late_init(void)
+@@ -487,6 +487,26 @@ void ast_g5_intel_late_init(void)
update_bootargs_cmd("special", NULL);
}
@@ -49,7 +49,7 @@ index 812e3ef..e68ab85 100644
static void pwm_init(void)
{
uint32_t val;
-@@ -521,6 +541,7 @@ extern void espi_init(void);
+@@ -538,6 +558,7 @@ extern void espi_init(void);
extern void kcs_init(void);
void ast_g5_intel(void)
{
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch
index 3c21a7c0a..5dbf1304c 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch
@@ -1,4 +1,4 @@
-From 0f64b0e0c0a122ce23b5ccc518f514ec296bc7f5 Mon Sep 17 00:00:00 2001
+From 61587868bf9979dd8308f12157310949f0e5c430 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Tue, 21 May 2019 00:53:04 +0530
Subject: [PATCH] FFUJ: FW IPMI commands and flash support in u-boot
@@ -28,17 +28,18 @@ Tested:
image transfer via KCS and flashing.
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
+
---
- arch/arm/include/asm/arch-aspeed/ast-g5-intel.h | 1 +
- board/aspeed/ast-g5/Makefile | 2 +
- board/aspeed/ast-g5/fw-update.c | 486 ++++++++++++++++++++++++
- board/aspeed/ast-g5/fw-update.h | 50 +++
- board/aspeed/ast-g5/ipmi-fwupd.c | 402 ++++++++++++++++++++
- board/aspeed/ast-g5/ipmi-fwupd.h | 81 ++++
- board/aspeed/ast-g5/ipmi-handler.c | 66 +++-
- board/aspeed/ast-g5/ipmi-handler.h | 3 +-
- common/autoboot.c | 13 +
- configs/ast_g5_phy_defconfig | 1 +
+ .../include/asm/arch-aspeed/ast-g5-intel.h | 1 +
+ board/aspeed/ast-g5/Makefile | 2 +
+ board/aspeed/ast-g5/fw-update.c | 486 ++++++++++++++++++
+ board/aspeed/ast-g5/fw-update.h | 50 ++
+ board/aspeed/ast-g5/ipmi-fwupd.c | 402 +++++++++++++++
+ board/aspeed/ast-g5/ipmi-fwupd.h | 81 +++
+ board/aspeed/ast-g5/ipmi-handler.c | 66 ++-
+ board/aspeed/ast-g5/ipmi-handler.h | 3 +-
+ common/autoboot.c | 13 +
+ configs/ast_g5_phy_defconfig | 1 +
10 files changed, 1093 insertions(+), 12 deletions(-)
create mode 100644 board/aspeed/ast-g5/fw-update.c
create mode 100644 board/aspeed/ast-g5/fw-update.h
@@ -46,7 +47,7 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
create mode 100644 board/aspeed/ast-g5/ipmi-fwupd.h
diff --git a/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
-index cd9a099..a88521a 100644
+index cd9a0994fa..a88521a1b3 100644
--- a/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
+++ b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
@@ -14,6 +14,7 @@
@@ -58,7 +59,7 @@ index cd9a099..a88521a 100644
#endif /* __AST_INTEL_G5_H__ */
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index f28fcfe..0b2d936 100644
+index f28fcfe61c..0b2d936c23 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -6,3 +6,5 @@ obj-y += ast-g5-gpio.o
@@ -69,7 +70,7 @@ index f28fcfe..0b2d936 100644
+obj-y += fw-update.o
diff --git a/board/aspeed/ast-g5/fw-update.c b/board/aspeed/ast-g5/fw-update.c
new file mode 100644
-index 0000000..9923993
+index 0000000000..99239938b5
--- /dev/null
+++ b/board/aspeed/ast-g5/fw-update.c
@@ -0,0 +1,486 @@
@@ -561,7 +562,7 @@ index 0000000..9923993
+#endif
diff --git a/board/aspeed/ast-g5/fw-update.h b/board/aspeed/ast-g5/fw-update.h
new file mode 100644
-index 0000000..ed033ad
+index 0000000000..ed033adfed
--- /dev/null
+++ b/board/aspeed/ast-g5/fw-update.h
@@ -0,0 +1,50 @@
@@ -617,7 +618,7 @@ index 0000000..ed033ad
+int generate_random_number(void);
diff --git a/board/aspeed/ast-g5/ipmi-fwupd.c b/board/aspeed/ast-g5/ipmi-fwupd.c
new file mode 100644
-index 0000000..3eba056
+index 0000000000..3eba056e7f
--- /dev/null
+++ b/board/aspeed/ast-g5/ipmi-fwupd.c
@@ -0,0 +1,402 @@
@@ -1025,7 +1026,7 @@ index 0000000..3eba056
+}
diff --git a/board/aspeed/ast-g5/ipmi-fwupd.h b/board/aspeed/ast-g5/ipmi-fwupd.h
new file mode 100644
-index 0000000..e490f6b
+index 0000000000..e490f6b527
--- /dev/null
+++ b/board/aspeed/ast-g5/ipmi-fwupd.h
@@ -0,0 +1,81 @@
@@ -1111,7 +1112,7 @@ index 0000000..e490f6b
+u16 fwupd_get_update_status(u8 *req, u16 req_len, u8 *res);
+u16 fwupd_image_write(u8 *req, u16 req_len, u8 *res);
diff --git a/board/aspeed/ast-g5/ipmi-handler.c b/board/aspeed/ast-g5/ipmi-handler.c
-index 9cccee9..5e78546 100644
+index 9cccee9f2f..5e78546e70 100644
--- a/board/aspeed/ast-g5/ipmi-handler.c
+++ b/board/aspeed/ast-g5/ipmi-handler.c
@@ -1,18 +1,37 @@
@@ -1212,7 +1213,7 @@ index 9cccee9..5e78546 100644
#define CMD_TABLE_SIZE ARRAY_SIZE(cmd_info)
diff --git a/board/aspeed/ast-g5/ipmi-handler.h b/board/aspeed/ast-g5/ipmi-handler.h
-index 9d46d9b..8eea930 100644
+index 9d46d9bd9a..8eea93063a 100644
--- a/board/aspeed/ast-g5/ipmi-handler.h
+++ b/board/aspeed/ast-g5/ipmi-handler.h
@@ -1,4 +1,3 @@
@@ -1236,7 +1237,7 @@ index 9d46d9b..8eea930 100644
/* BMC IPMB LUNs */
diff --git a/common/autoboot.c b/common/autoboot.c
-index d66c0fa..3647d5f 100644
+index d66c0fa63a..3647d5fb21 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -349,6 +349,19 @@ void autoboot_command(const char *s)
@@ -1260,7 +1261,7 @@ index d66c0fa..3647d5f 100644
#if defined(CONFIG_AUTOBOOT_KEYED) && !defined(CONFIG_AUTOBOOT_KEYED_CTRLC)
int prev = disable_ctrlc(1); /* disable Control C checking */
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
-index 1b96ab7..5965a9b 100644
+index 1b96ab7f3b..5965a9b04f 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
@@ -15,3 +15,4 @@ CONFIG_SYS_NS16550=y
@@ -1268,6 +1269,3 @@ index 1b96ab7..5965a9b 100644
CONFIG_CMD_I2C=y
CONFIG_SYS_I2C_AST=y
+CONFIG_LIB_RAND=y
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch
index 519977e19..ce62c3fb1 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch
@@ -1,4 +1,4 @@
-From 294a5971c94099277ee5b5589c060896cf22c495 Mon Sep 17 00:00:00 2001
+From 60b24cc8e1da556437770e9e49e046b9f41e2979 Mon Sep 17 00:00:00 2001
From: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Date: Thu, 20 Jun 2019 15:26:50 +0530
Subject: [PATCH] Support Get/Set Security mode command
@@ -20,11 +20,11 @@ throws correct errors
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
---
- board/aspeed/ast-g5/ipmi-handler.c | 63 +++++++++++++++++++++++++++++++++++++-
+ board/aspeed/ast-g5/ipmi-handler.c | 63 +++++++++++++++++++++++++++++-
1 file changed, 62 insertions(+), 1 deletion(-)
diff --git a/board/aspeed/ast-g5/ipmi-handler.c b/board/aspeed/ast-g5/ipmi-handler.c
-index 5e78546..4e921bd 100644
+index 5e78546e70..4e921bd575 100644
--- a/board/aspeed/ast-g5/ipmi-handler.c
+++ b/board/aspeed/ast-g5/ipmi-handler.c
@@ -20,10 +20,19 @@
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch
index b70427fe0..9045360fc 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch
@@ -1,13 +1,14 @@
-From 1d680678abb76bdea7cf2128b7ce6db4a5652151 Mon Sep 17 00:00:00 2001
+From 853894273464f068107f8de3a786327871df699f Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Tue, 16 Jul 2019 16:30:02 -0700
-Subject: [PATCH 1/1] Make it so TFTP port can be modified
+Subject: [PATCH] Make it so TFTP port can be modified
This makes it so we can use non-privileged tftp ports.
Tested: Can load fw from non-privileged port.
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
include/configs/ast-g5-ncsi.h | 2 ++
include/configs/ast-g5-phy.h | 2 ++
@@ -35,6 +36,3 @@ index 62ddb841e5..371f50a1db 100644
+#define CONFIG_TFTP_PORT
+
#endif /* __AST_G5_PHY_CONFIG_H */
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0032-PFR-FW-update-and-checkpoint-support-in-u-boot.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0032-PFR-FW-update-and-checkpoint-support-in-u-boot.patch
index 392acb9ad..bd32d55ec 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0032-PFR-FW-update-and-checkpoint-support-in-u-boot.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0032-PFR-FW-update-and-checkpoint-support-in-u-boot.patch
@@ -1,4 +1,4 @@
-From bd0d8af493387ab1602a0a40b4a548981c1e4d00 Mon Sep 17 00:00:00 2001
+From 5d16832eb3a65e2d30c732a06abcec801c1edf38 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Wed, 24 Jul 2019 20:11:30 +0530
Subject: [PATCH] PFR FW update and checkpoint support in u-boot
@@ -22,6 +22,7 @@ cross verified the check-points properly set or not.
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
+
---
board/aspeed/ast-g5/Makefile | 1 +
board/aspeed/ast-g5/ast-g5-intel.c | 10 +++
@@ -45,7 +46,7 @@ index 0b2d936c23..9021d7fc08 100644
obj-y += fw-update.o
+obj-y += pfr-mgr.o
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index dde5adbc70..6ef3ca9f73 100644
+index 6e43b74bc4..6a36cfa2ba 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -16,6 +16,7 @@
@@ -56,7 +57,7 @@ index dde5adbc70..6ef3ca9f73 100644
/* Names to match the GPIOs */
enum gpio_names {
-@@ -634,6 +635,10 @@ void ast_g5_intel(void)
+@@ -664,6 +665,10 @@ void ast_g5_intel(void)
ast_scu_write(ast_scu_read(AST_SCU_MISC1_CTRL) |
SCU_MISC_UART_DEBUG_DIS, AST_SCU_MISC1_CTRL);
@@ -65,9 +66,9 @@ index dde5adbc70..6ef3ca9f73 100644
+ set_cpld_reg(PFR_CPLD_BOOT_CHECKPOINT_REG, PFR_CPLD_CHKPOINT_START);
+
uart_init();
+ mailbox_init();
pwm_init();
- gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
-@@ -649,6 +654,11 @@ void ast_g5_intel(void)
+@@ -683,6 +688,11 @@ void ast_g5_intel(void)
kcs_init();
if (intel_get_platform_id() == COOPER_CITY_BOARD_ID)
set_pwm_duty_cycle(ELEVATED_PWM_DUTY_VALUE);
@@ -525,6 +526,3 @@ index 0000000000..5c5b98bbe0
+ulong get_update_intent(u32 type);
+ulong get_flash_region_offset(u32 type);
+ulong get_image_max_size(u32 type);
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0033-Reboot-into-UBOOT-on-Watchdog-Failures.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0033-Reboot-into-UBOOT-on-Watchdog-Failures.patch
index e673da7ee..8a00ccc3d 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0033-Reboot-into-UBOOT-on-Watchdog-Failures.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0033-Reboot-into-UBOOT-on-Watchdog-Failures.patch
@@ -1,7 +1,7 @@
-From c82bf9de515cbbdb4ea1a350be83fb89f4a83631 Mon Sep 17 00:00:00 2001
+From a4ba855a0dfac7af9720e94d82720d1fd916cb4b Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Wed, 31 Jul 2019 16:01:49 -0700
-Subject: [PATCH 1/1] Reboot into UBOOT on Watchdog Failures
+Subject: [PATCH] Reboot into UBOOT on Watchdog Failures
We use watchdog1 to reboot when there is a watchdog
error. Reboot into u-boot as we are using that as
@@ -11,6 +11,7 @@ Tested: watchdog -T 0 -F /dev/watchdog1 reboots into
uboot after 3 times
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
.../include/asm/arch-aspeed/ast-g5-intel.h | 1 +
board/aspeed/ast-g5/ast-g5-intel.c | 31 +++++++++++++++++++
@@ -30,10 +31,10 @@ index a88521a1b3..64f4ed17bf 100644
#endif
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index e68ab8546a..c003d9a7bc 100644
+index a8b65658b3..12216922ac 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -111,6 +111,24 @@ static const GPIOValue gpio_table[] = {
+@@ -114,6 +114,24 @@ static const GPIOValue gpio_table[] = {
#define HOST_SERIAL_A_HIGH_SPEED (1 << 0)
#define HOST_SERIAL_B_HIGH_SPEED (1 << 1)
@@ -58,7 +59,7 @@ index e68ab8546a..c003d9a7bc 100644
static void sgpio_init(void)
{
uint32_t value;
-@@ -270,6 +288,11 @@ int intel_force_firmware_jumper_enabled(void)
+@@ -275,6 +293,11 @@ int intel_force_firmware_jumper_enabled(void)
return gpio_get_value(GPIO_FF_UPD_JUMPER);
}
@@ -70,7 +71,7 @@ index e68ab8546a..c003d9a7bc 100644
void arch_preboot_os(void)
{
// last second before booting... set the LEDs
-@@ -402,6 +425,7 @@ void ast_g5_intel_late_init(void)
+@@ -436,6 +459,7 @@ void ast_g5_intel_late_init(void)
{
char value[32];
u32 reset_reason = 0;
@@ -78,7 +79,7 @@ index e68ab8546a..c003d9a7bc 100644
/* By default host serail A and B use normal speed */
uint32_t host_serial_cfg = 0;
-@@ -446,6 +470,13 @@ void ast_g5_intel_late_init(void)
+@@ -480,6 +504,13 @@ void ast_g5_intel_late_init(void)
update_bootargs_cmd("resetreason", value);
@@ -93,7 +94,7 @@ index e68ab8546a..c003d9a7bc 100644
if (is_mfg_mode_phy_req())
update_bootargs_cmd("special", "mfg");
diff --git a/common/autoboot.c b/common/autoboot.c
-index 45a600e663..03fd164501 100644
+index 3647d5fb21..0e7f7b0965 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -263,6 +263,8 @@ static int abortboot(int bootdelay)
@@ -105,6 +106,3 @@ index 45a600e663..03fd164501 100644
# endif
if (bootdelay >= 0)
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0034-Disable-uart-debug-interface.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0034-Disable-uart-debug-interface.patch
index 941dc7d0d..e8cd4179f 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0034-Disable-uart-debug-interface.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0034-Disable-uart-debug-interface.patch
@@ -1,7 +1,7 @@
-From 961561c437c8a3f3de1753c502a20c334966354e Mon Sep 17 00:00:00 2001
+From aec56ef4f3cf0417a28ddc0719603d54073eee09 Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@linux.intel.com>
Date: Tue, 20 Aug 2019 16:10:03 +0800
-Subject: [PATCH 1/2] Disable uart debug interface
+Subject: [PATCH] Disable uart debug interface
AST2500 SOC integrates a UART debug interface which can
input commands to AST2500 by using simple terminal
@@ -17,28 +17,29 @@ md 0x1e6e202c
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
+
---
arch/arm/include/asm/arch-aspeed/regs-scu.h | 1 +
board/aspeed/ast-g5/ast-g5-intel.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/arch/arm/include/asm/arch-aspeed/regs-scu.h b/arch/arm/include/asm/arch-aspeed/regs-scu.h
-index 8a596ceafc..8333ba1c59 100644
+index a2c9549fc6..1bdb1d8574 100644
--- a/arch/arm/include/asm/arch-aspeed/regs-scu.h
+++ b/arch/arm/include/asm/arch-aspeed/regs-scu.h
-@@ -467,6 +467,7 @@
- #define SCU_MISC_VUART_TO_CTRL (0x1 << 13)
+@@ -468,6 +468,7 @@
#define SCU_MISC_DIV13_EN (0x1 << 12)
+ #define SCU_MISC_DEBUG_UART (0x1 << 10)
#define SCU_MISC_Y_CLK_INVERT (0x1 << 11)
+#define SCU_MISC_UART_DEBUG_DIS (0x1 << 10)
#define SCU_MISC_OUT_DELAY (0x1 << 9)
#define SCU_MISC_PCI_TO_AHB_DIS (0x1 << 8)
#define SCU_MISC_2D_CRT_EN (0x1 << 7)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 324387a4bc..c58fd3591b 100644
+index 12216922ac..e05a6da468 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -578,6 +578,10 @@ extern void espi_init(void);
+@@ -589,6 +589,10 @@ extern void espi_init(void);
extern void kcs_init(void);
void ast_g5_intel(void)
{
@@ -49,6 +50,3 @@ index 324387a4bc..c58fd3591b 100644
uart_init();
pwm_init();
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0035-PFR-platform-EXTRST-reset-mask-selection.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0035-PFR-platform-EXTRST-reset-mask-selection.patch
index f2d1ebdeb..eb8fac487 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0035-PFR-platform-EXTRST-reset-mask-selection.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0035-PFR-platform-EXTRST-reset-mask-selection.patch
@@ -1,4 +1,4 @@
-From a5dc9fb9b33aa732858dc574f1ada22bc4cbd57c Mon Sep 17 00:00:00 2001
+From 6b62f592434eaadc02057c0d35c3b79982f555bc Mon Sep 17 00:00:00 2001
From: Vikram Bodireddy <vikram.bodireddy@intel.com>
Date: Thu, 5 Sep 2019 15:03:21 +0530
Subject: [PATCH] PFR platform - EXTRST# reset mask selection
@@ -11,14 +11,15 @@ update flow, during which certain modules of BMC should be chosen
to be reset so that Host functionality would be intact.
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
+
---
- arch/arm/include/asm/arch-aspeed/ast-g5-intel.h | 31 +++++++++++++++++++++++++
- arch/arm/include/asm/arch-aspeed/regs-scu.h | 29 +++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5-intel.c | 9 +++++++
+ .../include/asm/arch-aspeed/ast-g5-intel.h | 31 +++++++++++++++++++
+ arch/arm/include/asm/arch-aspeed/regs-scu.h | 29 +++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-intel.c | 9 ++++++
3 files changed, 69 insertions(+)
diff --git a/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
-index 64f4ed1..b9386b2 100644
+index 64f4ed17bf..b9386b2cf6 100644
--- a/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
+++ b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
@@ -12,6 +12,37 @@
@@ -60,7 +61,7 @@ index 64f4ed1..b9386b2 100644
int intel_force_firmware_jumper_enabled(void);
int intel_failed_boot(void);
diff --git a/arch/arm/include/asm/arch-aspeed/regs-scu.h b/arch/arm/include/asm/arch-aspeed/regs-scu.h
-index 1bdb1d8..0a4fb6f 100644
+index 1bdb1d8574..0a4fb6f773 100644
--- a/arch/arm/include/asm/arch-aspeed/regs-scu.h
+++ b/arch/arm/include/asm/arch-aspeed/regs-scu.h
@@ -144,6 +144,35 @@
@@ -100,7 +101,7 @@ index 1bdb1d8..0a4fb6f 100644
#define SCU_RESET_CRT3 (0x1 << 8)
#define SCU_RESET_CRT2 (0x1 << 7)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 06c6708..e6dd2e6 100644
+index 6a36cfa2ba..2d260a7759 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -661,6 +661,15 @@ extern void espi_init(void);
@@ -119,6 +120,3 @@ index 06c6708..e6dd2e6 100644
/* Disable uart port debug function */
ast_scu_write(ast_scu_read(AST_SCU_MISC1_CTRL) |
SCU_MISC_UART_DEBUG_DIS, AST_SCU_MISC1_CTRL);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0036-Re-Enable-KCS.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0036-Re-Enable-KCS.patch
index 976277f9e..08b05e60b 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0036-Re-Enable-KCS.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0036-Re-Enable-KCS.patch
@@ -1,7 +1,7 @@
-From 6bd4135cd2b8e3a95f5c29e7edaa678e0ca6eded Mon Sep 17 00:00:00 2001
+From 6e3928154538f8935d9d6379e3db40daeb1aedcf Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Thu, 19 Sep 2019 10:15:19 -0700
-Subject: [PATCH 1/1] Re-Enable KCS
+Subject: [PATCH] Re-Enable KCS
Phosphor-isolation isolates too much and seems to
make KCS not work. This removes the lines from that
@@ -10,6 +10,7 @@ patch that seem to be of question.
Tested: AC/Cycled, cmdtool.efi 20 18 1 works
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
board/aspeed/ast-g5/ast-g5.c | 5 -----
1 file changed, 5 deletions(-)
@@ -30,6 +31,3 @@ index ead2e1bb63..00bd92ae5f 100644
val = readl(AST_LPC_BASE + AST_LPC_HICRB);
val |= LPC_HICRB_ILPC2AHB;
writel(val, AST_LPC_BASE + AST_LPC_HICRB);
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0037-aspeed-ast-scu.c-fix-MAC1LINK-and-MAC2LINK-pin-pads-.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0037-aspeed-ast-scu.c-fix-MAC1LINK-and-MAC2LINK-pin-pads-.patch
index 9c176e998..eaaa0075b 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0037-aspeed-ast-scu.c-fix-MAC1LINK-and-MAC2LINK-pin-pads-.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0037-aspeed-ast-scu.c-fix-MAC1LINK-and-MAC2LINK-pin-pads-.patch
@@ -1,4 +1,4 @@
-From 4b96a19bdde82d7fed24cb70e0bcaef16d8711c3 Mon Sep 17 00:00:00 2001
+From 07a269d7873c77c372acbd4ccf83612e14f05404 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 4 Oct 2019 15:54:43 -0700
Subject: [PATCH] aspeed/ast-scu.c: fix MAC1LINK and MAC2LINK pin pads setting
@@ -8,12 +8,13 @@ so this commit disables them in SCU pin control register so that
the pins can be used as GPIOs.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+
---
- arch/arm/mach-aspeed/ast-scu.c | 37 +++++++++----------------------------
+ arch/arm/mach-aspeed/ast-scu.c | 37 +++++++++-------------------------
1 file changed, 9 insertions(+), 28 deletions(-)
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
-index 537cd4b3e1c7..28c48c115406 100644
+index 537cd4b3e1..28c48c1154 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -419,49 +419,30 @@ void ast_scu_multi_func_eth(u8 num)
@@ -75,6 +76,3 @@ index 537cd4b3e1c7..28c48c115406 100644
break;
}
}
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0038-Increase-default-fan-speed-for-cooper-city.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0038-Increase-default-fan-speed-for-cooper-city.patch
index 53cdd763e..96172cbac 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0038-Increase-default-fan-speed-for-cooper-city.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0038-Increase-default-fan-speed-for-cooper-city.patch
@@ -1,7 +1,7 @@
-From e465945672408b632d5e3c2cf7f08ade1268419e Mon Sep 17 00:00:00 2001
+From d248ebf5bddd0c0bc6f7e287867b651d0c17aafe Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Thu, 24 Oct 2019 14:39:22 -0700
-Subject: [PATCH 1/1] Increase default fan speed for cooper city
+Subject: [PATCH] Increase default fan speed for cooper city
This increases the uboot fan speed for cooper city
as it has high core count CPUS.
@@ -9,16 +9,17 @@ as it has high core count CPUS.
Tested: In uboot fans appeared to run faster
Signed-off-by: James Feist <james.feist@linux.intel.com>
+
---
board/aspeed/ast-g5/ast-g5-gpio.h | 6 ++++
board/aspeed/ast-g5/ast-g5-intel.c | 46 ++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-gpio.h b/board/aspeed/ast-g5/ast-g5-gpio.h
-index ed2499f5cc..9088cdd3e3 100644
+index 8ccf437346..7f0c06d88f 100644
--- a/board/aspeed/ast-g5/ast-g5-gpio.h
+++ b/board/aspeed/ast-g5/ast-g5-gpio.h
-@@ -70,9 +70,15 @@
+@@ -71,9 +71,15 @@
#define ID_LED_PORT_PIN PORT_PIN(GPIO_PORT_S, GPIO_PIN_6)
#define GRN_LED_PORT_PIN PORT_PIN(GPIO_PORT_S, GPIO_PIN_4)
#define AMB_LED_PORT_PIN PORT_PIN(GPIO_PORT_S, GPIO_PIN_5)
@@ -35,7 +36,7 @@ index ed2499f5cc..9088cdd3e3 100644
// GPIO Configuration Register bits
#define GPCFG_EVENT_TO_SMI (1 << 7) // 1 == enabled
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index c58fd3591b..9d5db68b7e 100644
+index e05a6da468..4b017269f9 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -25,6 +25,12 @@ enum gpio_names {
@@ -51,8 +52,8 @@ index c58fd3591b..9d5db68b7e 100644
};
#define GPIO_CFG_DEFAULT (GPCFG_ACTIVE_HIGH | GPCFG_LEVEL_TRIG)
-@@ -60,6 +66,21 @@ static const GPIOValue gpio_table[] = {
- [GPIO_FP_PWR_BTN] = {FP_PWR_BTN_PORT_PIN, GPIO_CFG_DEFAULT, 0,
+@@ -63,6 +69,21 @@ static const GPIOValue gpio_table[] = {
+ [GPIO_FP_PWR_BTN] = {FP_PWR_BTN_PORT_PIN, GPIO_CFG_LOW_INPUT, 0,
GPIO_DEBOUNCE_8MS},
+ /* Platform ID Pins */
@@ -73,7 +74,7 @@ index c58fd3591b..9d5db68b7e 100644
};
#define LPC_SNOOP_ADDR 0x80
-@@ -114,6 +135,8 @@ static const GPIOValue gpio_table[] = {
+@@ -117,6 +138,8 @@ static const GPIOValue gpio_table[] = {
#define WATCHDOG_RESET_BIT 0x8
#define BOOT_FAILURE_LIMIT 0x3
@@ -82,7 +83,7 @@ index c58fd3591b..9d5db68b7e 100644
static int get_boot_failures(void)
{
return getenv_ulong("bootfailures", 10, 0);
-@@ -295,6 +318,26 @@ int intel_failed_boot(void)
+@@ -298,6 +321,26 @@ int intel_failed_boot(void)
return get_boot_failures() >= BOOT_FAILURE_LIMIT;
}
@@ -109,7 +110,7 @@ index c58fd3591b..9d5db68b7e 100644
void arch_preboot_os(void)
{
// last second before booting... set the LEDs
-@@ -322,6 +365,7 @@ void arch_preboot_os(void)
+@@ -325,6 +368,7 @@ void arch_preboot_os(void)
#define PWM_CLK_ENABLE BIT(0)
#define PWM_DUTY(PCT) (((PCT) * 128) / 100)
#define DEFAULT_PWM_DUTY_VALUE PWM_DUTY(57)
@@ -117,7 +118,7 @@ index c58fd3591b..9d5db68b7e 100644
static inline uint32_t ast_scu_read(uint32_t reg)
-@@ -595,6 +639,8 @@ void ast_g5_intel(void)
+@@ -606,6 +650,8 @@ void ast_g5_intel(void)
id_led_control(GPIO_GREEN_LED, EIDLED_Off);
id_led_control(GPIO_AMBER_LED, EIDLED_On);
kcs_init();
@@ -126,6 +127,3 @@ index c58fd3591b..9d5db68b7e 100644
/* TODO: need to stop the booting here. */
}
}
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0040-Initialize-the-BMC-host-mailbox-at-reset-time.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0040-Initialize-the-BMC-host-mailbox-at-reset-time.patch
index b36627d17..464faa65d 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0040-Initialize-the-BMC-host-mailbox-at-reset-time.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0040-Initialize-the-BMC-host-mailbox-at-reset-time.patch
@@ -1,4 +1,4 @@
-From 933d80ac82dbe1f74c653b0ac505fde406e2553c Mon Sep 17 00:00:00 2001
+From c749a717d02936b49f6213f8861e3c17b35abf67 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@intel.com>
Date: Mon, 27 Jan 2020 15:13:10 -0800
Subject: [PATCH] Initialize the BMC/host mailbox at reset time
@@ -10,15 +10,16 @@ Tested: boot the BMC and take note that the mailbox registers are no
longer random garbage.
Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
+
---
board/aspeed/ast-g5/ast-g5-intel.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index ce87a46cd1..1086742045 100644
+index 4b017269f9..6c193d8afb 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -575,6 +575,33 @@ static void pwm_init(void)
+@@ -629,6 +629,33 @@ static void pwm_init(void)
writel(val, PWM_BASE_ADDR + PWM_CONTROL);
}
@@ -52,14 +53,11 @@ index ce87a46cd1..1086742045 100644
extern void espi_init(void);
extern void kcs_init(void);
void ast_g5_intel(void)
-@@ -597,6 +624,7 @@ void ast_g5_intel(void)
- set_cpld_reg(PFR_CPLD_BOOT_CHECKPOINT_REG, PFR_CPLD_CHKPOINT_START);
+@@ -638,6 +665,7 @@ void ast_g5_intel(void)
+ SCU_MISC_UART_DEBUG_DIS, AST_SCU_MISC1_CTRL);
uart_init();
+ mailbox_init();
pwm_init();
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
espi_init();
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0043-PFR-Skip-counting-WDT2-event-when-EXTRST-is-set.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0043-PFR-Skip-counting-WDT2-event-when-EXTRST-is-set.patch
index 3833d2a31..bbab94421 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0043-PFR-Skip-counting-WDT2-event-when-EXTRST-is-set.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0043-PFR-Skip-counting-WDT2-event-when-EXTRST-is-set.patch
@@ -1,4 +1,4 @@
-From 51ae3c80f20be3b8e010aa57041fa9c38076cc76 Mon Sep 17 00:00:00 2001
+From 0bae11a932e57c968394dd533bbd853ee2e9493f Mon Sep 17 00:00:00 2001
From: Vikram Bodireddy <vikram.bodireddy@intel.com>
Date: Wed, 18 Mar 2020 21:47:11 +0530
Subject: [PATCH] PFR- Skip counting WDT2 event when EXTRST# is set
@@ -14,23 +14,24 @@ Tested: Verified BMC updates 4 times and checked that
the boot is not aborted at u-boot.
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
+
---
board/aspeed/ast-g5/ast-g5-intel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 575061ff88..872c7a843a 100644
+index 2d260a7759..1d426db659 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -145,6 +145,7 @@ static const GPIOValue gpio_table[] = {
+@@ -137,6 +137,7 @@ static const GPIOValue gpio_table[] = {
#define HOST_SERIAL_B_HIGH_SPEED (1 << 1)
#define WATCHDOG_RESET_BIT 0x8
+#define EXTRST_RESET_BIT 0x2
#define BOOT_FAILURE_LIMIT 0x3
- #define BRIGHTON_CITY_BOARD_ID 0
-@@ -572,7 +573,8 @@ void ast_g5_intel_late_init(void)
+ #define COOPER_CITY_BOARD_ID 40
+@@ -551,7 +552,8 @@ void ast_g5_intel_late_init(void)
boot_failures = get_boot_failures();
@@ -40,6 +41,3 @@ index 575061ff88..872c7a843a 100644
set_boot_failures(boot_failures + 1);
else
set_boot_failures(0);
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0044-net-phy-realtek-Change-LED-configuration.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0044-net-phy-realtek-Change-LED-configuration.patch
index b70d3be50..fb823bae8 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0044-net-phy-realtek-Change-LED-configuration.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0044-net-phy-realtek-Change-LED-configuration.patch
@@ -1,4 +1,4 @@
-From 06039a941d59f265385c5b4a19231fbd55a05b26 Mon Sep 17 00:00:00 2001
+From 70589b01e3284867c77e1d1387bce83b898bd54a Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 5 Jun 2020 15:14:50 -0700
Subject: [PATCH] net: phy: realtek: Change LED configuration
@@ -9,12 +9,13 @@ LED1 (Left Orange): Link 10/100 + Blink on Tx/Rx
LED2 (Left Green): Link 1000 + Blink on Tx/Rx
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+
---
drivers/net/phy/realtek.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
-index 7a99cb023401..c15280259c35 100644
+index 7a99cb0234..c15280259c 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -92,10 +92,15 @@ static int rtl8211f_config(struct phy_device *phydev)
@@ -35,6 +36,3 @@ index 7a99cb023401..c15280259c35 100644
phy_write(phydev, MDIO_DEVAD_NONE,
MIIM_RTL8211F_PAGE_SELECT, 0x0);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0045-Apply-WDT1-2-reset-mask-to-reset-needed-controller.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0045-Apply-WDT1-2-reset-mask-to-reset-needed-controller.patch
index 94e93db7f..92d11f634 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0045-Apply-WDT1-2-reset-mask-to-reset-needed-controller.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0045-Apply-WDT1-2-reset-mask-to-reset-needed-controller.patch
@@ -1,4 +1,4 @@
-From 622df2804c7f8540587df26c81653b47809c9984 Mon Sep 17 00:00:00 2001
+From e23fbe6c3867b92b8ba7bfb36e1719348b102399 Mon Sep 17 00:00:00 2001
From: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
Date: Thu, 16 Jul 2020 11:02:53 +0530
Subject: [PATCH] Apply WDT1-2 reset mask to reset needed controller
@@ -57,12 +57,13 @@ Tested:
BMC should not hang and able to complete the "erase all" command
Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
+
---
arch/arm/mach-aspeed/platform_g5.S | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-aspeed/platform_g5.S b/arch/arm/mach-aspeed/platform_g5.S
-index b404353..97253f4 100644
+index b4043534b0..f221c97b19 100644
--- a/arch/arm/mach-aspeed/platform_g5.S
+++ b/arch/arm/mach-aspeed/platform_g5.S
@@ -366,7 +366,10 @@ init_dram:
@@ -77,6 +78,3 @@ index b404353..97253f4 100644
str r1, [r0]
b bypass_first_reset
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0046-Enable-FMC-DMA-for-memmove.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0046-Enable-FMC-DMA-for-memmove.patch
index e75b732b1..547754996 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0046-Enable-FMC-DMA-for-memmove.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0046-Enable-FMC-DMA-for-memmove.patch
@@ -1,4 +1,4 @@
-From 38d3fba3ac2d4240bab1e5427fc6ed71291e1cc8 Mon Sep 17 00:00:00 2001
+From da1a1d60346118e6d05efc39c8899f590b483a25 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 19 Jun 2020 16:30:47 -0700
Subject: [PATCH] Enable FMC DMA for memmove
@@ -8,16 +8,17 @@ completed quickly.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+
---
arch/arm/mach-aspeed/Makefile | 2 +-
- arch/arm/mach-aspeed/utils.S | 53 +++++++++++++++++++++++++++++++++++++++++++
- lib/Kconfig | 6 +++++
- lib/string.c | 12 +++++++++-
+ arch/arm/mach-aspeed/utils.S | 53 +++++++++++++++++++++++++++++++++++
+ lib/Kconfig | 6 ++++
+ lib/string.c | 12 +++++++-
4 files changed, 71 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/mach-aspeed/utils.S
diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile
-index 7d8930beb988..b9fcf41d8c97 100644
+index 7d8930beb9..b9fcf41d8c 100644
--- a/arch/arm/mach-aspeed/Makefile
+++ b/arch/arm/mach-aspeed/Makefile
@@ -11,7 +11,7 @@
@@ -31,7 +32,7 @@ index 7d8930beb988..b9fcf41d8c97 100644
obj-$(CONFIG_ARCH_AST2400) += platform_g4.o
diff --git a/arch/arm/mach-aspeed/utils.S b/arch/arm/mach-aspeed/utils.S
new file mode 100644
-index 000000000000..a06d72552eef
+index 0000000000..a06d72552e
--- /dev/null
+++ b/arch/arm/mach-aspeed/utils.S
@@ -0,0 +1,53 @@
@@ -89,7 +90,7 @@ index 000000000000..a06d72552eef
+ mov pc, lr
+ENDPROC(aspeed_spi_fastcpy)
diff --git a/lib/Kconfig b/lib/Kconfig
-index 02ca4058d37e..8c8fde6b1b28 100644
+index 02ca4058d3..8c8fde6b1b 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -149,6 +149,12 @@ config SPL_OF_LIBFDT
@@ -106,7 +107,7 @@ index 02ca4058d37e..8c8fde6b1b28 100644
source lib/efi_loader/Kconfig
diff --git a/lib/string.c b/lib/string.c
-index 0bf472f1f69e..f95b8e478fa6 100644
+index 0bf472f1f6..f95b8e478f 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -15,11 +15,12 @@
@@ -146,6 +147,3 @@ index 0bf472f1f69e..f95b8e478fa6 100644
if (unaligned_src || unaligned_dst) {
if (unaligned_dst != unaligned_src) {
unaligned_header = count;
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0047-ast2500-parse-reset-reason.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0047-ast2500-parse-reset-reason.patch
index b1b525f99..a21fb00dd 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0047-ast2500-parse-reset-reason.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0047-ast2500-parse-reset-reason.patch
@@ -1,9 +1,10 @@
-From 96eb25949b824af10cabd387cfdc6401d23ac04b Mon Sep 17 00:00:00 2001
+From 079424a954cf0c697b65492a2d6a38f1938fe1bf Mon Sep 17 00:00:00 2001
From: Kuiying Wang <kuiying.wang@intel.com>
Date: Tue, 7 Jul 2020 13:41:48 +0800
Subject: [PATCH] ast2500: parse reset reason.
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
+
---
arch/arm/mach-aspeed/ast-scu.c | 39 +++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
@@ -60,6 +61,3 @@ index 28c48c1154..ff90c0fc7e 100644
#else
if (rest & SCU_SYS_EXT_RESET_FLAG) {
printf("RST : External\n");
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0048-Add-WDT-to-u-boot-to-cover-booting-failures.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0048-Add-WDT-to-u-boot-to-cover-booting-failures.patch
index 2d2b906b5..f6b3fefcf 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0048-Add-WDT-to-u-boot-to-cover-booting-failures.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0048-Add-WDT-to-u-boot-to-cover-booting-failures.patch
@@ -1,4 +1,4 @@
-From 367c6c2734e54ff37eac2ace4691f55b0e3d6096 Mon Sep 17 00:00:00 2001
+From 18e6251fbd3b58069d2b3d7097e5c24b70b42bf9 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Mon, 14 Sep 2020 17:38:28 -0700
Subject: [PATCH] Add WDT to u-boot to cover booting failures
@@ -12,6 +12,7 @@ code. The early u-boot WD timeout is 5 seconds and kernel booting WD
timeout is 100 seconds.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+
---
arch/arm/mach-aspeed/flash.c | 7 +++
arch/arm/mach-aspeed/platform_g5.S | 78 ++++++++++++++++++++++++++++++
@@ -21,7 +22,7 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
5 files changed, 121 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-aspeed/flash.c b/arch/arm/mach-aspeed/flash.c
-index d33fb9e0fe78..31bbf77e9e67 100644
+index d33fb9e0fe..31bbf77e9e 100644
--- a/arch/arm/mach-aspeed/flash.c
+++ b/arch/arm/mach-aspeed/flash.c
@@ -30,6 +30,7 @@
@@ -53,7 +54,7 @@ index d33fb9e0fe78..31bbf77e9e67 100644
reset_flash(info);
diff --git a/arch/arm/mach-aspeed/platform_g5.S b/arch/arm/mach-aspeed/platform_g5.S
-index f221c97b19dc..e468ed68d687 100644
+index f221c97b19..e468ed68d6 100644
--- a/arch/arm/mach-aspeed/platform_g5.S
+++ b/arch/arm/mach-aspeed/platform_g5.S
@@ -582,6 +582,31 @@ espi_early_init_done:
@@ -191,10 +192,10 @@ index f221c97b19dc..e468ed68d687 100644
mov lr, r4
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index c46bd70b71b2..92518a66fa67 100644
+index 6c193d8afb..6e43b74bc4 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -701,6 +701,9 @@ void ast_g5_intel(void)
+@@ -673,6 +673,9 @@ void ast_g5_intel(void)
timer8_init();
enable_onboard_tpm();
if (intel_force_firmware_jumper_enabled()) {
@@ -205,7 +206,7 @@ index c46bd70b71b2..92518a66fa67 100644
id_led_control(GPIO_ID_LED, EIDLED_On);
id_led_control(GPIO_GREEN_LED, EIDLED_Off);
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 00bd92ae5f94..3f27503bce62 100644
+index 00bd92ae5f..3f27503bce 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
@@ -125,9 +125,35 @@ int board_eth_init(bd_t *bd)
@@ -247,7 +248,7 @@ index 00bd92ae5f94..3f27503bce62 100644
}
#endif /* CONFIG_WATCHDOG */
diff --git a/common/bootm_os.c b/common/bootm_os.c
-index b56eb39780e8..ec0e12ac84b9 100644
+index b56eb39780..ec0e12ac84 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -473,11 +473,16 @@ __weak void arch_preboot_os(void)
@@ -267,6 +268,3 @@ index b56eb39780e8..ec0e12ac84b9 100644
boot_fn(state, argc, argv, images);
/* Stand-alone may return when 'autostart' is 'no' */
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0049-Fix-issue-on-host-console-is-broken-due-to-BMC-reset.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0049-Fix-issue-on-host-console-is-broken-due-to-BMC-reset.patch
index 3c1705c05..8dfa55733 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0049-Fix-issue-on-host-console-is-broken-due-to-BMC-reset.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0049-Fix-issue-on-host-console-is-broken-due-to-BMC-reset.patch
@@ -1,4 +1,4 @@
-From b6f1f040f515a43d1903f4c4020032dfe436670d Mon Sep 17 00:00:00 2001
+From a4a0c281865339c68871e4f62dd21f78504ea60e Mon Sep 17 00:00:00 2001
From: Kuiying Wang <kuiying.wang@intel.com>
Date: Sun, 27 Sep 2020 17:45:56 +0800
Subject: [PATCH] Fix issue on host console is broken due to BMC reset by
@@ -88,6 +88,7 @@ ast# md 0x1e78909c
1e78909c: 00000000 ffceff00 19000000 00000000
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
+
---
arch/arm/include/asm/arch-aspeed/regs-lpc.h | 1 +
board/aspeed/ast-g5/ast-g5.c | 3 +++
@@ -106,7 +107,7 @@ index b0162ae4f3..b4d3da2906 100644
/* AST_LPC_HICR5 : 0x80 Host Interface Control Register 5 */
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 00bd92ae5f..4c5997ab8a 100644
+index 3f27503bce..6fdc06ad63 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
@@ -45,6 +45,9 @@ int board_init(void)
@@ -119,6 +120,3 @@ index 00bd92ae5f..4c5997ab8a 100644
/* P2A, PCIe BMC */
val = readl(AST_SCU_BASE + AST_SCU_PCIE_CONFIG_SET);
val &= ~(SCU_PCIE_CONFIG_SET_BMC_DMA
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0001-image-Correct-comment-for-fit_conf_get_node.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0001-image-Correct-comment-for-fit_conf_get_node.patch
index 7e1cd0351..05e9ae9c1 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0001-image-Correct-comment-for-fit_conf_get_node.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0001-image-Correct-comment-for-fit_conf_get_node.patch
@@ -1,4 +1,4 @@
-From 07867a17f8ed7ca621107550e218b1c916b9cc19 Mon Sep 17 00:00:00 2001
+From 6455ab0f57e2a64f4952c6a1cefca1891d582139 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] image: Correct comment for fit_conf_get_node()
@@ -8,13 +8,14 @@ header file. Fix this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
common/image-fit.c | 18 ------------------
include/image.h | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
-index 6f920da22043..f31e93a36441 100644
+index 6f920da220..f31e93a364 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1375,24 +1375,6 @@ int fit_conf_find_compat(const void *fit, const void *fdt)
@@ -43,7 +44,7 @@ index 6f920da22043..f31e93a36441 100644
{
int noffset, confs_noffset;
diff --git a/include/image.h b/include/image.h
-index a16187f874db..b05e8552cc5b 100644
+index a16187f874..b05e8552cc 100644
--- a/include/image.h
+++ b/include/image.h
@@ -908,6 +908,25 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp);
@@ -72,6 +73,3 @@ index a16187f874db..b05e8552cc5b 100644
int fit_conf_get_node(const void *fit, const char *conf_uname);
/**
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch
index 16ac5fb59..62594c6f3 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch
@@ -1,4 +1,4 @@
-From 3d7360b1b32f56e26bbc90bcff42d5f204d0b717 Mon Sep 17 00:00:00 2001
+From 0373da3f0baf0f5d90e978b9f735306d06e19d24 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] image: Be a little more verbose when checking signatures
@@ -8,13 +8,14 @@ Update a few messages to help with this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
common/image-fit.c | 2 +-
tools/image-host.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
-index f31e93a36441..8a7c78f4c144 100644
+index f31e93a364..8a7c78f4c1 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1637,7 +1637,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
@@ -27,7 +28,7 @@ index f31e93a36441..8a7c78f4c144 100644
return -ENOENT;
}
diff --git a/tools/image-host.c b/tools/image-host.c
-index 7effb6cea59e..01fdec276da4 100644
+index 7effb6cea5..01fdec276d 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -717,7 +717,8 @@ int fit_check_sign(const void *fit, const void *key)
@@ -40,6 +41,3 @@ index 7effb6cea59e..01fdec276da4 100644
ret = fit_config_verify(fit, cfg_noffset);
if (ret)
return ret;
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch
index fd8ceecf0..d0501ff82 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch
@@ -1,4 +1,4 @@
-From 647e43f0aee09ef33d2159ad95c7f3499d8fd8a4 Mon Sep 17 00:00:00 2001
+From ffb95288ea143ca9f76890aebe804067bf327b68 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] image: Return an error message from fit_config_verify_sig()
@@ -9,12 +9,13 @@ what went wrong.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
common/image-sig.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/image-sig.c b/common/image-sig.c
-index eda5e1353ab0..a664f4a40945 100644
+index eda5e1353a..a664f4a409 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -415,13 +415,14 @@ static int fit_config_verify_sig(const void *fit, int conf_noffset,
@@ -34,6 +35,3 @@ index eda5e1353ab0..a664f4a40945 100644
}
int fit_config_verify_required_sigs(const void *fit, int conf_noffset,
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch
index 5a4bca485..1a2eba2e1 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch
@@ -1,4 +1,4 @@
-From ece10b3eac018240776bfec8aceb1e8f4947288b Mon Sep 17 00:00:00 2001
+From c77be61073581f8009a9b8bf8960f5c1ad621d63 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] image: Check hash-nodes when checking configurations
@@ -12,12 +12,13 @@ static.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
common/image-sig.c | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/common/image-sig.c b/common/image-sig.c
-index a664f4a40945..057d654c17d4 100644
+index a664f4a409..057d654c17 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -283,20 +283,39 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset,
@@ -92,6 +93,3 @@ index a664f4a40945..057d654c17d4 100644
if (ret) {
puts("- ");
} else {
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0008-image-Load-the-correct-configuration-in-fit_check_si.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0008-image-Load-the-correct-configuration-in-fit_check_si.patch
index 4701086bc..460615410 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0008-image-Load-the-correct-configuration-in-fit_check_si.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0008-image-Load-the-correct-configuration-in-fit_check_si.patch
@@ -1,4 +1,4 @@
-From 738b8ba7ac971c10500d1322fda59ac6aa58e867 Mon Sep 17 00:00:00 2001
+From b8e5bf59f37db05fbb21832117351bd6bdda3afd Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] image: Load the correct configuration in fit_check_sign
@@ -11,12 +11,13 @@ Update this function to use the selected configuration.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
common/bootm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/bootm.c b/common/bootm.c
-index 46909ecdbb1f..b39fd60c8c49 100644
+index 46909ecdbb..b39fd60c8c 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -894,7 +894,8 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
@@ -46,6 +47,3 @@ index 46909ecdbb1f..b39fd60c8c49 100644
if (!err && ret && ret != -ENOENT)
err = ret;
}
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0009-fit_check_sign-Allow-selecting-the-configuration-to-.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0009-fit_check_sign-Allow-selecting-the-configuration-to-.patch
index 687946e4c..4f151f84e 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0009-fit_check_sign-Allow-selecting-the-configuration-to-.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0009-fit_check_sign-Allow-selecting-the-configuration-to-.patch
@@ -1,4 +1,4 @@
-From 86a746eecc231886fbca97db6c6544997b95e49a Mon Sep 17 00:00:00 2001
+From ef74a120215a65d34b4c4658327049c7a7ac5bea Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] fit_check_sign: Allow selecting the configuration to verify
@@ -9,6 +9,7 @@ the logic through.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
tools/fdt_host.h | 3 ++-
tools/fit_check_sign.c | 8 ++++++--
@@ -16,7 +17,7 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/tools/fdt_host.h b/tools/fdt_host.h
-index 134d9657139b..4eceab19dd3a 100644
+index 134d965713..4eceab19dd 100644
--- a/tools/fdt_host.h
+++ b/tools/fdt_host.h
@@ -11,6 +11,7 @@
@@ -29,7 +30,7 @@ index 134d9657139b..4eceab19dd3a 100644
#endif /* __FDT_HOST_H__ */
diff --git a/tools/fit_check_sign.c b/tools/fit_check_sign.c
-index d9361b00950c..e9a489db3920 100644
+index d9361b0095..e9a489db39 100644
--- a/tools/fit_check_sign.c
+++ b/tools/fit_check_sign.c
@@ -42,6 +42,7 @@ int main(int argc, char **argv)
@@ -69,7 +70,7 @@ index d9361b00950c..e9a489db3920 100644
ret = EXIT_SUCCESS;
fprintf(stderr, "Signature check OK\n");
diff --git a/tools/image-host.c b/tools/image-host.c
-index 01fdec276da4..da374eeabf5e 100644
+index 01fdec276d..da374eeabf 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -708,12 +708,13 @@ int fit_add_verification_data(const char *keydir, void *keydest, void *fit,
@@ -96,6 +97,3 @@ index 01fdec276da4..da374eeabf5e 100644
ret = bootm_host_load_images(fit, cfg_noffset);
return ret;
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0012-image-Use-constants-for-required-and-key-name-hint.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0012-image-Use-constants-for-required-and-key-name-hint.patch
index 4f5704e7c..a04f68fb3 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0012-image-Use-constants-for-required-and-key-name-hint.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/CVE-2020-10648/0012-image-Use-constants-for-required-and-key-name-hint.patch
@@ -1,4 +1,4 @@
-From 82d0b38436fd44bc54372ebe3f3d3fef63835b83 Mon Sep 17 00:00:00 2001
+From dfe95ace84f7bb04b6302fd8f51f8a942a288e40 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Tue, 31 Mar 2020 18:43:55 +0200
Subject: [PATCH] image: Use constants for 'required' and 'key-name-hint'
@@ -7,6 +7,7 @@ These are used in multiple places so update them to use a shared #define.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
+
---
common/image-fit.c | 6 +++---
common/image-sig.c | 8 +++++---
@@ -16,7 +17,7 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
5 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
-index 8a7c78f4c144..322fde728b50 100644
+index 8a7c78f4c1..322fde728b 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -264,7 +264,7 @@ static void fit_image_print_data(const void *fit, int noffset, const char *p,
@@ -40,7 +41,7 @@ index 8a7c78f4c144..322fde728b50 100644
printf(":%s", keyname);
if (required)
diff --git a/common/image-sig.c b/common/image-sig.c
-index 057d654c17d4..b49732117927 100644
+index 057d654c17..b497321179 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -156,7 +156,7 @@ static int fit_image_setup_verify(struct image_sign_info *info,
@@ -73,7 +74,7 @@ index 057d654c17d4..b49732117927 100644
continue;
ret = fit_config_verify_sig(fit, conf_noffset, sig_blob,
diff --git a/include/image.h b/include/image.h
-index b05e8552cc5b..2c6ef4de259d 100644
+index b05e8552cc..2c6ef4de25 100644
--- a/include/image.h
+++ b/include/image.h
@@ -782,12 +782,14 @@ int bootz_setup(ulong image, ulong *start, ulong *end);
@@ -93,7 +94,7 @@ index b05e8552cc5b..2c6ef4de259d 100644
/* image node */
#define FIT_DATA_PROP "data"
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
-index 5d9716f01349..972af6b8a7e2 100644
+index 5d9716f013..972af6b8a7 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -486,8 +486,8 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest)
@@ -117,7 +118,7 @@ index 5d9716f01349..972af6b8a7e2 100644
}
done:
diff --git a/tools/image-host.c b/tools/image-host.c
-index da374eeabf5e..afeba22a09be 100644
+index da374eeabf..afeba22a09 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -161,7 +161,7 @@ static int fit_image_setup_sig(struct image_sign_info *info,
@@ -147,6 +148,3 @@ index da374eeabf5e..afeba22a09be 100644
/* Write the public key into the supplied FDT file */
if (keydest) {
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2600/conf/machine/include/intel-ast2600.inc b/meta-openbmc-mods/meta-ast2600/conf/machine/include/intel-ast2600.inc
index 7f323f4e2..ae22138ba 100644
--- a/meta-openbmc-mods/meta-ast2600/conf/machine/include/intel-ast2600.inc
+++ b/meta-openbmc-mods/meta-ast2600/conf/machine/include/intel-ast2600.inc
@@ -1,6 +1,8 @@
COMPATIBLE_MACHINE_intel-ast2600 = "intel-ast2600"
KMACHINE = "aspeed"
-KERNEL_DEVICETREE = "${KMACHINE}-bmc-${COMPATIBLE_MACHINE}.dtb"
+KERNEL_DEVICETREE = " \
+ ${KMACHINE}-bmc-${COMPATIBLE_MACHINE}.dtb \
+ "
#KERNEL_DEVICETREE = "${KMACHINE}-ast2600-evb.dtb"
require conf/machine/include/ast2600.inc
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0004-AST2600-Adjust-default-GPIO-settings.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0004-AST2600-Adjust-default-GPIO-settings.patch
index 4e6ebb5ad..60929ccb0 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0004-AST2600-Adjust-default-GPIO-settings.patch
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0004-AST2600-Adjust-default-GPIO-settings.patch
@@ -1,24 +1,24 @@
-From 122fa6153479d026a06c27512f3c7024a1515c63 Mon Sep 17 00:00:00 2001
+From a7c85034b4a0a7e061930f27a6ec561d23d97cc6 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 3 Jan 2020 15:14:09 -0800
Subject: [PATCH] AST2600: Adjust default GPIO settings
- Disabled GPIOC3 to prevent unexpected host failures.
-- Fixed GPIOC5, GPIOD4, GPIOG6, GPIOI0~7 and GPIOL6~7 directions and
- default values.
+- Fixed GPIOC5, GPIOD4, GPIOG6, GPIOI0~7, GPIOL6~7 and GPIO_S3
+ directions and default values.
- Disabled internal pull-down of GPIOB6.
- Disabled HBLED.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- board/aspeed/ast2600_intel/intel.c | 65 ++++++++++++++++++++++++++++++
- 1 file changed, 65 insertions(+)
+ board/aspeed/ast2600_intel/intel.c | 74 ++++++++++++++++++++++++++++++
+ 1 file changed, 74 insertions(+)
diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
-index d1ac8651ac6c..7c9e78f8c005 100644
+index d1ac8651ac6c..14a20b27e178 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
-@@ -162,6 +162,69 @@ static void sgpio_init(void)
+@@ -162,6 +162,78 @@ static void sgpio_init(void)
SCU_BASE | SCU_414);
}
@@ -31,6 +31,8 @@ index d1ac8651ac6c..7c9e78f8c005 100644
+#define GPIO_024 0x024 /* GPIO E/F/G/H Direction */
+#define GPIO_070 0x070 /* GPIO I/J/K/L Value */
+#define GPIO_074 0x074 /* GPIO I/J/K/L Direction */
++#define GPIO_080 0x080 /* GPIO Q/R/S/T Value */
++#define GPIO_084 0x084 /* GPIO Q/R/S/T Direction */
+
+static void set_gpio_default_state(void)
+{
@@ -83,12 +85,19 @@ index d1ac8651ac6c..7c9e78f8c005 100644
+#define GPIO_G6 BIT(22)
+ writel(readl(AST_GPIO_BASE | GPIO_024) & ~GPIO_G6,
+ AST_GPIO_BASE | GPIO_024);
++
++ /* Set GPIO S3 as push-pull output high */
++#define GPIO_S3 BIT(19)
++ writel(readl(AST_GPIO_BASE + GPIO_084) | GPIO_S3,
++ AST_GPIO_BASE + GPIO_084);
++ writel(readl(AST_GPIO_BASE + GPIO_080) | GPIO_S3,
++ AST_GPIO_BASE + GPIO_080);
+}
+
static void timer_handler(void *regs)
{
printf("+");
-@@ -175,6 +238,8 @@ int board_early_init_f(void)
+@@ -175,6 +247,8 @@ int board_early_init_f(void)
* I am not sure if it actually does anything... */
arch_interrupt_init_early();
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0008-AST2600-Add-TPM-pulse-trigger.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0008-AST2600-Add-TPM-pulse-trigger.patch
index edad150af..6b417fae9 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0008-AST2600-Add-TPM-pulse-trigger.patch
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0008-AST2600-Add-TPM-pulse-trigger.patch
@@ -1,4 +1,4 @@
-From 627e49e75963fb372f1d6cd2297c8f73d6ec91e0 Mon Sep 17 00:00:00 2001
+From ec8377bb77dd560b3f03f02361d268b362e28e7f Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 25 Mar 2020 15:04:26 -0700
Subject: [PATCH] AST2600: Add TPM pulse trigger
@@ -11,11 +11,11 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 17 insertions(+)
diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
-index e1fd06a142b9..63af3d0f9034 100644
+index d03a446846bc..ebf883144418 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
-@@ -215,6 +215,21 @@ static void set_gpio_default_state(void)
- AST_GPIO_BASE | GPIO_024);
+@@ -234,6 +234,21 @@ static void set_gpio_default_state(void)
+ AST_GPIO_BASE + GPIO_080);
}
+void enable_onboard_tpm(void)
@@ -36,7 +36,7 @@ index e1fd06a142b9..63af3d0f9034 100644
static void timer_handler(void *regs)
{
printf("+");
-@@ -245,6 +260,8 @@ int board_early_init_r(void)
+@@ -264,6 +279,8 @@ int board_early_init_r(void)
debug("board_early_init_r\n");
/* timer_enable(0, 1, timer_handler); */
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0020-Add-BMC-running-indicator-LED-control.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0020-Add-BMC-running-indicator-LED-control.patch
index a30f7a7b8..768f3adaa 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0020-Add-BMC-running-indicator-LED-control.patch
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0020-Add-BMC-running-indicator-LED-control.patch
@@ -1,4 +1,4 @@
-From 5029f400e62981278957f62c5f8b4e22c2faecd9 Mon Sep 17 00:00:00 2001
+From a5e31f9ef7622b001c55f96a98dd18b19976c90c Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 26 Jun 2020 14:35:47 -0700
Subject: [PATCH] Add BMC running indicator LED control
@@ -15,19 +15,19 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 18 insertions(+)
diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
-index e93ef57dabed..565893777ffc 100644
+index 1d650ff959f6..95a90474cbd3 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
-@@ -192,6 +192,8 @@ static void sgpio_init(void)
- #define GPIO_024 0x024 /* GPIO E/F/G/H Direction */
- #define GPIO_070 0x070 /* GPIO I/J/K/L Value */
+@@ -194,6 +194,8 @@ static void sgpio_init(void)
#define GPIO_074 0x074 /* GPIO I/J/K/L Direction */
+ #define GPIO_080 0x080 /* GPIO Q/R/S/T Value */
+ #define GPIO_084 0x084 /* GPIO Q/R/S/T Direction */
+#define GPIO_088 0x088 /* GPIO U/V/W/X Value */
+#define GPIO_08C 0x08C /* GPIO U/V/W/X Direction */
static void set_gpio_default_state(void)
{
-@@ -252,6 +254,20 @@ void enable_onboard_tpm(void)
+@@ -270,6 +272,20 @@ void enable_onboard_tpm(void)
AST_GPIO_BASE | GPIO_000);
}
@@ -48,7 +48,7 @@ index e93ef57dabed..565893777ffc 100644
static void timer_callback(void *cookie)
{
uint timer_nr = (uint)cookie;
-@@ -292,6 +308,8 @@ int board_early_init_r(void)
+@@ -310,6 +326,8 @@ int board_early_init_r(void)
enable_onboard_tpm();
@@ -58,5 +58,5 @@ index e93ef57dabed..565893777ffc 100644
}
--
-2.7.4
+2.17.1
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0025-ast2600-PFR-platform-EXTRST-reset-mask-selection.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0025-ast2600-PFR-platform-EXTRST-reset-mask-selection.patch
index 119db1318..23fc22ea7 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0025-ast2600-PFR-platform-EXTRST-reset-mask-selection.patch
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0025-ast2600-PFR-platform-EXTRST-reset-mask-selection.patch
@@ -1,9 +1,8 @@
-From 298f34e528c3e64e5e10403380832df91f986f12 Mon Sep 17 00:00:00 2001
-From: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com>
-Date: Tue, 8 Dec 2020 10:44:53 +0000
-Subject: [PATCH] ast2600:PFR platform - EXTRST# reset mask selection
+From 5ca28a9259d084440879be48ef4b4d6716794281 Mon Sep 17 00:00:00 2001
+From: Vikram Bodireddy <vikram.bodireddy@intel.com>
+Date: Mon, 22 Feb 2021 17:22:16 +0530
+Subject: [PATCH] ast2600-PFR-platform-EXTRST-reset-mask-selection
-This is a fix taken from Purely PFR.
This commit will enable specific reset mask for EXTRST# signal.
On PFR platforms, EXTRST# signal is used by PFR CPLD to put BMC
in reset during firmware authentications, recovery and firmware
@@ -11,29 +10,35 @@ update flow, during which certain modules of BMC should be chosen
to be reset so that Host functionality would be intact.
Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com>
+Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
---
- arch/arm/mach-aspeed/ast2600/platform.S | 6 ++++++
- 1 file changed, 6 insertions(+)
+ arch/arm/mach-aspeed/ast2600/platform.S | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
diff --git a/arch/arm/mach-aspeed/ast2600/platform.S b/arch/arm/mach-aspeed/ast2600/platform.S
-index cd8a57edd7..6756aee804 100644
+index ecc9fd33d1..8c40515b76 100644
--- a/arch/arm/mach-aspeed/ast2600/platform.S
+++ b/arch/arm/mach-aspeed/ast2600/platform.S
-@@ -39,6 +39,7 @@
+@@ -39,6 +39,8 @@
#define AST_SCU_REV_ID (AST_SCU_BASE + 0x014)
#define AST_SCU_SYSRST_CTRL (AST_SCU_BASE + 0x040)
#define AST_SCU_SYSRST_CTRL_CLR (AST_SCU_BASE + 0x044)
-+#define AST_SCU_EXTRST_SEL (AST_SCU_BASE + 0x060)
++#define AST_SCU_EXTRST_SEL1 (AST_SCU_BASE + 0x060)
++#define AST_SCU_EXTRST_SEL2 (AST_SCU_BASE + 0x070)
#define AST_SCU_DEBUG_CTRL (AST_SCU_BASE + 0x0C8)
#define AST_SCU_DEBUG_CTRL2 (AST_SCU_BASE + 0x0D8)
#define AST_SCU_HPLL_PARAM (AST_SCU_BASE + 0x200)
-@@ -285,6 +286,11 @@ wait_lock:
+@@ -285,6 +287,15 @@ wait_lock:
str r1, [r0]
1:
-+ /* SCU060:EXTRST# reset mask selection */
-+ ldr r0, =AST_SCU_EXTRST_SEL
-+ ldr r1, =0x00FF1FF5
++ /* SCU060:EXTRST1# reset mask selection */
++ ldr r0, =AST_SCU_EXTRST_SEL1
++ ldr r1, =0x6FF1FF5
++ str r1, [r0]
++ /* SCU070:EXTRST2# reset mask selection */
++ ldr r0, =AST_SCU_EXTRST_SEL2
++ ldr r1, =0x3FFFFF7
+ str r1, [r0]
+
/* disable eSPI, LPC and PWM resets on WDT1 reset */
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0027-ast2600-Add-Mailbox-init-function.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0027-ast2600-Add-Mailbox-init-function.patch
new file mode 100644
index 000000000..2bcf464cf
--- /dev/null
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0027-ast2600-Add-Mailbox-init-function.patch
@@ -0,0 +1,87 @@
+From 615d57c7c2a86df3ba19e0c1a201aa0d8042e38d Mon Sep 17 00:00:00 2001
+From: Kuiying Wang <kuiying.wang@intel.com>
+Date: Thu, 25 Feb 2021 14:45:12 +0800
+Subject: [PATCH] ast2600: Add Mailbox init function.
+
+Add Mailbox init function to make sure
+mailbox regs are clear when BMC reset.
+AST2600 A0 has 16 mailboxes.
+AST2600 A1 has 32 mailboxes.
+
+Tested:
+BMC could boot correctly and all the mailboxes clear
+ast# md 0x1e789200
+1e789200: 00000000 00000000 00000000 00000000 ................
+1e789210: 00000000 00000000 00000000 00000000 ................
+1e789220: 00000000 00000000 00000000 00000000 ................
+1e789230: 00000000 00000000 00000000 00000000 ................
+1e789240: 00000000 00000000 00000000 00000000 ................
+
+Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
+Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ board/aspeed/ast2600_intel/intel.c | 26 ++++++++++++++++++++++++--
+ 1 file changed, 24 insertions(+), 2 deletions(-)
+
+diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
+index 17a21c746098..17d1b1952d4d 100644
+--- a/board/aspeed/ast2600_intel/intel.c
++++ b/board/aspeed/ast2600_intel/intel.c
+@@ -10,6 +10,9 @@
+ #define WATCHDOG_RESET_BIT BIT(20)
+ #define BOOT_FAILURE_LIMIT 3
+
++#define SCU_014 0x014 /* Silicon Revision ID */
++#define REV_ID_AST2600A0 0x05000303 /* AST2600 A0 */
++
+ static int get_boot_failures(void)
+ {
+ return env_get_ulong("bootfailures", 10, 0);
+@@ -320,6 +323,25 @@ static void timer_callback(void *cookie)
+ }
+ }
+
++#define AST_MBX_BASE 0x1e789200
++#define AST_MBX_COUNT_A0 16
++#define AST_MBX_COUNT 32
++static void mailbox_init(void)
++{
++ /* clear out default mbox values */
++ int i, mbx_count;
++
++ if (readl(SCU_BASE + SCU_014) == REV_ID_AST2600A0)
++ mbx_count = AST_MBX_COUNT_A0;
++ else
++ mbx_count = AST_MBX_COUNT;
++
++ for (i = 0; i < mbx_count; i++)
++ {
++ writel(0, AST_MBX_BASE + 4 * i);
++ }
++}
++
+ int board_early_init_f(void)
+ {
+ /* This is called before relocation; beware! */
+@@ -333,6 +355,8 @@ int board_early_init_f(void)
+
+ sgpio_init();
+
++ mailbox_init();
++
+ /* TODO: is it too late to enforce HW security registers? */
+ return 0;
+ }
+@@ -469,8 +493,6 @@ extern void timer_enable(int n, u32 interval_us, interrupt_handler_t *handler,
+ void *cookie);
+ int board_late_init(void)
+ {
+-#define SCU_014 0x014 /* Silicon Revision ID */
+-#define REV_ID_AST2600A0 0x05000303 /* AST2600 A0 */
+ #define ONE_MSEC_IN_USEC 1000
+ char value[11];
+ u32 boot_failures;
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch
deleted file mode 100644
index 230a7bb0a..000000000
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0002-image-Be-a-little-more-verbose-when-checking-signatu.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 63c22eddb8fba1b6ffb845765e91587e998e470e Mon Sep 17 00:00:00 2001
-From: Simon Glass <sjg@chromium.org>
-Date: Tue, 31 Mar 2020 18:43:55 +0200
-Subject: [PATCH] image: Be a little more verbose when checking signatures
-
-It is useful to be a little more specific about what is being checked.
-Update a few messages to help with this.
-
-Signed-off-by: Simon Glass <sjg@chromium.org>
-Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
----
- common/image-fit.c | 2 +-
- tools/image-host.c | 3 ++-
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/common/image-fit.c b/common/image-fit.c
-index 06f3358c931c..58923cbc9371 100644
---- a/common/image-fit.c
-+++ b/common/image-fit.c
-@@ -1850,7 +1850,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
- fit_uname = fit_get_name(fit, noffset, NULL);
- }
- if (noffset < 0) {
-- puts("Could not find subimage node\n");
-+ printf("Could not find subimage node type '%s'\n", prop_name);
- bootstage_error(bootstage_id + BOOTSTAGE_SUB_SUBNODE);
- return -ENOENT;
- }
-diff --git a/tools/image-host.c b/tools/image-host.c
-index 88b329502ca3..8e94ee8f3e31 100644
---- a/tools/image-host.c
-+++ b/tools/image-host.c
-@@ -743,7 +743,8 @@ int fit_check_sign(const void *fit, const void *key)
- if (!cfg_noffset)
- return -1;
-
-- printf("Verifying Hash Integrity ... ");
-+ printf("Verifying Hash Integrity for node '%s'... ",
-+ fdt_get_name(fit, cfg_noffset, NULL));
- ret = fit_config_verify(fit, cfg_noffset);
- if (ret)
- return ret;
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch
deleted file mode 100644
index 5f82abeda..000000000
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0003-image-Return-an-error-message-from-fit_config_verify.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 2fa27334977ba688f17edb6b66c8eb355d4a53a5 Mon Sep 17 00:00:00 2001
-From: Simon Glass <sjg@chromium.org>
-Date: Tue, 31 Mar 2020 18:43:55 +0200
-Subject: [PATCH] image: Return an error message from fit_config_verify_sig()
-
-This function only returns an error message sometimes. Update it to always
-return an error message if one is available. This makes it easier to see
-what went wrong.
-
-Signed-off-by: Simon Glass <sjg@chromium.org>
-Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
----
- common/image-sig.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/common/image-sig.c b/common/image-sig.c
-index 4f6b4ec412c3..48c89f930276 100644
---- a/common/image-sig.c
-+++ b/common/image-sig.c
-@@ -470,13 +470,14 @@ static int fit_config_verify_sig(const void *fit, int conf_noffset,
- goto error;
- }
-
-- return verified ? 0 : -EPERM;
-+ if (verified)
-+ return 0;
-
- error:
- printf(" error!\n%s for '%s' hash node in '%s' config node\n",
- err_msg, fit_get_name(fit, noffset, NULL),
- fit_get_name(fit, conf_noffset, NULL));
-- return -1;
-+ return -EPERM;
- }
-
- int fit_config_verify_required_sigs(const void *fit, int conf_noffset,
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch
deleted file mode 100644
index 9dd5e6668..000000000
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/CVE-2020-10648/0007-image-Check-hash-nodes-when-checking-configurations.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From c7c1af4f9996986f05ced17694b68a575eda328e Mon Sep 17 00:00:00 2001
-From: Simon Glass <sjg@chromium.org>
-Date: Tue, 31 Mar 2020 18:43:55 +0200
-Subject: [PATCH] image: Check hash-nodes when checking configurations
-
-It is currently possible to use a different configuration's signature and
-thus bypass the configuration check. Make sure that the configuration node
-that was hashed matches the one being checked, to catch this problem.
-
-Also add a proper function comment to fit_config_check_sig() and make it
-static.
-
-Signed-off-by: Simon Glass <sjg@chromium.org>
-Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
----
- common/image-sig.c | 36 +++++++++++++++++++++++++++++++++---
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/common/image-sig.c b/common/image-sig.c
-index 48c89f930276..4526c82acf75 100644
---- a/common/image-sig.c
-+++ b/common/image-sig.c
-@@ -330,20 +330,39 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset,
- return 0;
- }
-
--int fit_config_check_sig(const void *fit, int noffset, int required_keynode,
-- char **err_msgp)
-+/**
-+ * fit_config_check_sig() - Check the signature of a config
-+ *
-+ * @fit: FIT to check
-+ * @noffset: Offset of configuration node (e.g. /configurations/conf-1)
-+ * @required_keynode: Offset in the control FDT of the required key node,
-+ * if any. If this is given, then the configuration wil not
-+ * pass verification unless that key is used. If this is
-+ * -1 then any signature will do.
-+ * @conf_noffset: Offset of the configuration subnode being checked (e.g.
-+ * /configurations/conf-1/kernel)
-+ * @err_msgp: In the event of an error, this will be pointed to a
-+ * help error string to display to the user.
-+ * @return 0 if all verified ok, <0 on error
-+ */
-+static int fit_config_check_sig(const void *fit, int noffset,
-+ int required_keynode, int conf_noffset,
-+ char **err_msgp)
- {
- char * const exc_prop[] = {"data"};
- const char *prop, *end, *name;
- struct image_sign_info info;
- const uint32_t *strings;
-+ const char *config_name;
- uint8_t *fit_value;
- int fit_value_len;
-+ bool found_config;
- int max_regions;
- int i, prop_len;
- char path[200];
- int count;
-
-+ config_name = fit_get_name(fit, conf_noffset, NULL);
- debug("%s: fdt=%p, conf='%s', sig='%s'\n", __func__, gd_fdt_blob(),
- fit_get_name(fit, noffset, NULL),
- fit_get_name(gd_fdt_blob(), required_keynode, NULL));
-@@ -384,9 +403,20 @@ int fit_config_check_sig(const void *fit, int noffset, int required_keynode,
- char *node_inc[count];
-
- debug("Hash nodes (%d):\n", count);
-+ found_config = false;
- for (name = prop, i = 0; name < end; name += strlen(name) + 1, i++) {
- debug(" '%s'\n", name);
- node_inc[i] = (char *)name;
-+ if (!strncmp(FIT_CONFS_PATH, name, strlen(FIT_CONFS_PATH)) &&
-+ name[sizeof(FIT_CONFS_PATH) - 1] == '/' &&
-+ !strcmp(name + sizeof(FIT_CONFS_PATH), config_name)) {
-+ debug(" (found config node %s)", config_name);
-+ found_config = true;
-+ }
-+ }
-+ if (!found_config) {
-+ *err_msgp = "Selected config not in hashed nodes";
-+ return -1;
- }
-
- /*
-@@ -454,7 +484,7 @@ static int fit_config_verify_sig(const void *fit, int conf_noffset,
- if (!strncmp(name, FIT_SIG_NODENAME,
- strlen(FIT_SIG_NODENAME))) {
- ret = fit_config_check_sig(fit, noffset, sig_offset,
-- &err_msg);
-+ conf_noffset, &err_msg);
- if (ret) {
- puts("- ");
- } else {
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend
index 3747fbdfb..e05f9e16f 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/u-boot-aspeed-sdk_%.bbappend
@@ -32,14 +32,12 @@ SRC_URI_append_intel-ast2600 = " \
file://0024-fix-SUS_WARN-handling-logic.patch \
file://0025-ast2600-PFR-platform-EXTRST-reset-mask-selection.patch \
file://0025-Enable-PCIe-L1-support.patch \
+ file://0027-ast2600-Add-Mailbox-init-function.patch \
"
# CVE-2020-10648 vulnerability fix
SRC_URI_append_intel-ast2600 = " \
file://0001-image-Correct-comment-for-fit_conf_get_node.patch \
- file://0002-image-Be-a-little-more-verbose-when-checking-signatu.patch \
- file://0003-image-Return-an-error-message-from-fit_config_verify.patch \
- file://0007-image-Check-hash-nodes-when-checking-configurations.patch \
file://0008-image-Load-the-correct-configuration-in-fit_check_si.patch \
file://0009-fit_check_sign-Allow-selecting-the-configuration-to-.patch \
file://0012-image-Use-constants-for-required-and-key-name-hint.patch \
diff --git a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass
index 32d52e76a..e61eb2dae 100644
--- a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass
+++ b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass
@@ -77,6 +77,7 @@ IMAGE_INSTALL_append = " \
biosconfig-manager \
telemetry \
i3c-tools \
+ configure-usb-c \
"
IMAGE_INSTALL_append = " ${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'pfr-manager', '', d)}"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb
index 77f171095..10df9dd59 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb
@@ -13,6 +13,7 @@ DEPENDS = "sdbusplus openssl libpam libgpiod safec"
do_configure[depends] += "virtual/kernel:do_shared_workdir"
SRC_URI = "git://github.com/Intel-BMC/asd;protocol=git"
+SRC_URI += "file://0001-Fix-build-error-in-kernel-v5.10.patch"
SRCREV = "1.4.4"
inherit useradd
diff --git a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/0001-Fix-build-error-in-kernel-v5.10.patch b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/0001-Fix-build-error-in-kernel-v5.10.patch
new file mode 100644
index 000000000..7ebedeee3
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/0001-Fix-build-error-in-kernel-v5.10.patch
@@ -0,0 +1,62 @@
+From 7ed9ba9738d8f27578ea2d00019f8245ee2a5556 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Mon, 22 Feb 2021 15:32:13 -0800
+Subject: [PATCH] Fix build error in kernel v5.10
+
+Kernel headers should be added as last headers to prevent unexpected
+build breaks.
+
+Change-Id: Ie7d1a054baf2af88b9c46f928d0d84a64d8febd9
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ i2c_handler.c | 5 +++--
+ i2c_msg_builder.c | 5 +++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/i2c_handler.c b/i2c_handler.c
+index 21fb931..05470f4 100644
+--- a/i2c_handler.c
++++ b/i2c_handler.c
+@@ -29,8 +29,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/i2c-dev.h>
+-#include <linux/i2c.h>
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -40,6 +38,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include "logging.h"
+
++#include <linux/i2c-dev.h>
++#include <linux/i2c.h>
++
+ #define FILE_NAME "/dev/i2c"
+ #define MAX_I2C_DEV_FILENAME 256
+
+diff --git a/i2c_msg_builder.c b/i2c_msg_builder.c
+index 6ae06a0..05dc340 100644
+--- a/i2c_msg_builder.c
++++ b/i2c_msg_builder.c
+@@ -27,13 +27,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include "i2c_msg_builder.h"
+
+-#include <linux/i2c-dev.h>
+-#include <linux/i2c.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+
+ #include "logging.h"
+
++#include <linux/i2c-dev.h>
++#include <linux/i2c.h>
++
+ STATUS copy_i2c_to_asd(asd_i2c_msg* asd, struct i2c_msg* i2c);
+ STATUS copy_asd_to_i2c(const asd_i2c_msg* asd, struct i2c_msg* i2c);
+
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0031-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0031-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch
deleted file mode 100644
index bb297d50b..000000000
--- a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0031-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From 228edd356f03bf62dcf2b1335f25d43c602ee68d Mon Sep 17 00:00:00 2001
-From: Michael Colavita <mcolavita@fb.com>
-Date: Thu, 19 Nov 2020 11:44:40 -0500
-Subject: [PATCH] iconv: Fix incorrect UCS4 inner loop bounds (BZ#26923)
-
-Previously, in UCS4 conversion routines we limit the number of
-characters we examine to the minimum of the number of characters in the
-input and the number of characters in the output. This is not the
-correct behavior when __GCONV_IGNORE_ERRORS is set, as we do not consume
-an output character when we skip a code unit. Instead, track the input
-and output pointers and terminate the loop when either reaches its
-limit.
-
-This resolves assertion failures when resetting the input buffer in a step of
-iconv, which assumes that the input will be fully consumed given sufficient
-output space.
----
- iconv/Makefile | 2 +-
- iconv/gconv_simple.c | 16 ++++----------
- iconv/tst-iconv8.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 55 insertions(+), 13 deletions(-)
- create mode 100644 iconv/tst-iconv8.c
-
-diff --git a/iconv/Makefile b/iconv/Makefile
-index 30bf996d3a..f9b51e23ec 100644
---- a/iconv/Makefile
-+++ b/iconv/Makefile
-@@ -44,7 +44,7 @@ CFLAGS-linereader.c += -DNO_TRANSLITERATION
- CFLAGS-simple-hash.c += -I../locale
-
- tests = tst-iconv1 tst-iconv2 tst-iconv3 tst-iconv4 tst-iconv5 tst-iconv6 \
-- tst-iconv7 tst-iconv-mt tst-iconv-opt
-+ tst-iconv7 tst-iconv8 tst-iconv-mt
-
- others = iconv_prog iconvconfig
- install-others-programs = $(inst_bindir)/iconv
-diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
-index d4797fba17..963b29f246 100644
---- a/iconv/gconv_simple.c
-+++ b/iconv/gconv_simple.c
-@@ -239,11 +239,9 @@ ucs4_internal_loop (struct __gconv_step *step,
- int flags = step_data->__flags;
- const unsigned char *inptr = *inptrp;
- unsigned char *outptr = *outptrp;
-- size_t n_convert = MIN (inend - inptr, outend - outptr) / 4;
- int result;
-- size_t cnt;
-
-- for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
-+ for (; inptr + 4 <= inend && outptr + 4 <= outend; inptr += 4)
- {
- uint32_t inval;
-
-@@ -307,11 +305,9 @@ ucs4_internal_loop_unaligned (struct __gconv_step *step,
- int flags = step_data->__flags;
- const unsigned char *inptr = *inptrp;
- unsigned char *outptr = *outptrp;
-- size_t n_convert = MIN (inend - inptr, outend - outptr) / 4;
- int result;
-- size_t cnt;
-
-- for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
-+ for (; inptr + 4 <= inend && outptr + 4 <= outend; inptr += 4)
- {
- if (__glibc_unlikely (inptr[0] > 0x80))
- {
-@@ -613,11 +609,9 @@ ucs4le_internal_loop (struct __gconv_step *step,
- int flags = step_data->__flags;
- const unsigned char *inptr = *inptrp;
- unsigned char *outptr = *outptrp;
-- size_t n_convert = MIN (inend - inptr, outend - outptr) / 4;
- int result;
-- size_t cnt;
-
-- for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
-+ for (; inptr + 4 <= inend && outptr + 4 <= outend; inptr += 4)
- {
- uint32_t inval;
-
-@@ -684,11 +678,9 @@ ucs4le_internal_loop_unaligned (struct __gconv_step *step,
- int flags = step_data->__flags;
- const unsigned char *inptr = *inptrp;
- unsigned char *outptr = *outptrp;
-- size_t n_convert = MIN (inend - inptr, outend - outptr) / 4;
- int result;
-- size_t cnt;
-
-- for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
-+ for (; inptr + 4 <= inend && outptr + 4 <= outend; inptr += 4)
- {
- if (__glibc_unlikely (inptr[3] > 0x80))
- {
-diff --git a/iconv/tst-iconv8.c b/iconv/tst-iconv8.c
-new file mode 100644
-index 0000000000..0b92b19f66
---- /dev/null
-+++ b/iconv/tst-iconv8.c
-@@ -0,0 +1,50 @@
-+/* Test iconv behavior on UCS4 conversions with //IGNORE.
-+ Copyright (C) 2020 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <http://www.gnu.org/licenses/>. */
-+
-+/* Derived from BZ #26923 */
-+#include <errno.h>
-+#include <iconv.h>
-+#include <stdio.h>
-+#include <support/check.h>
-+
-+static int
-+do_test (void)
-+{
-+ iconv_t cd = iconv_open ("UTF-8//IGNORE", "ISO-10646/UCS4/");
-+ TEST_VERIFY_EXIT (cd != (iconv_t) -1);
-+
-+ /*
-+ * Convert sequence beginning with an irreversible character into buffer that
-+ * is too small.
-+ */
-+ char input[12] = "\xe1\x80\xa1" "AAAAAAAAA";
-+ char *inptr = input;
-+ size_t insize = sizeof (input);
-+ char output[6];
-+ char *outptr = output;
-+ size_t outsize = sizeof (output);
-+
-+ TEST_VERIFY (iconv (cd, &inptr, &insize, &outptr, &outsize) == -1);
-+ TEST_VERIFY (errno == E2BIG);
-+
-+ TEST_VERIFY_EXIT (iconv_close (cd) != -1);
-+
-+ return 0;
-+}
-+
-+#include <support/test-driver.c>
---
-2.27.0
-
diff --git a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0033-Fix-assertion-failure-in-ISO-20220JP-3-module-bug-27256.patch b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0033-Fix-assertion-failure-in-ISO-20220JP-3-module-bug-27256.patch
new file mode 100644
index 000000000..68b9fcfdf
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0033-Fix-assertion-failure-in-ISO-20220JP-3-module-bug-27256.patch
@@ -0,0 +1,292 @@
+From 7d88c6142c6efc160c0ee5e4f85cde382c072888 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Wed, 27 Jan 2021 13:36:12 +0100
+Subject: [PATCH] gconv: Fix assertion failure in ISO-2022-JP-3 module (bug
+ 27256)
+
+The conversion loop to the internal encoding does not follow
+the interface contract that __GCONV_FULL_OUTPUT is only returned
+after the internal wchar_t buffer has been filled completely. This
+is enforced by the first of the two asserts in iconv/skeleton.c:
+
+ /* We must run out of output buffer space in this
+ rerun. */
+ assert (outbuf == outerr);
+ assert (nstatus == __GCONV_FULL_OUTPUT);
+
+This commit solves this issue by queuing a second wide character
+which cannot be written immediately in the state variable, like
+other converters already do (e.g., BIG5-HKSCS or TSCII).
+
+Reported-by: Tavis Ormandy <taviso@gmail.com>
+---
+ iconvdata/Makefile | 4 +-
+ iconvdata/bug-iconv14.c | 127 ++++++++++++++++++++++++++++++++++++++
+ iconvdata/iso-2022-jp-3.c | 67 ++++++++++++++------
+ 3 files changed, 178 insertions(+), 20 deletions(-)
+ create mode 100644 iconvdata/bug-iconv14.c
+
+diff --git a/iconvdata/Makefile b/iconvdata/Makefile
+index c8c532a3e4..55c527a5f7 100644
+--- a/iconvdata/Makefile
++++ b/iconvdata/Makefile
+@@ -74,7 +74,7 @@ ifeq (yes,$(build-shared))
+ tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
+ tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
+ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
+- bug-iconv13
++ bug-iconv13 bug-iconv14
+ ifeq ($(have-thread-library),yes)
+ tests += bug-iconv3
+ endif
+@@ -322,6 +322,8 @@ $(objpfx)bug-iconv10.out: $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so))
+ $(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so))
++$(objpfx)bug-iconv14.out: $(objpfx)gconv-modules \
++ $(addprefix $(objpfx),$(modules.so))
+
+ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
+ $(addprefix $(objpfx),$(modules.so)) \
+diff --git a/iconvdata/bug-iconv14.c b/iconvdata/bug-iconv14.c
+new file mode 100644
+index 0000000000..902f140fa9
+--- /dev/null
++++ b/iconvdata/bug-iconv14.c
+@@ -0,0 +1,127 @@
++/* Assertion in ISO-2022-JP-3 due to two-character sequence (bug 27256).
++ Copyright (C) 2021 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#include <iconv.h>
++#include <string.h>
++#include <errno.h>
++#include <support/check.h>
++
++/* Use an escape sequence to return to the initial state. */
++static void
++with_escape_sequence (void)
++{
++ iconv_t c = iconv_open ("UTF-8", "ISO-2022-JP-3");
++ TEST_VERIFY_EXIT (c != (iconv_t) -1);
++
++ char in[] = "\e$(O+D\e(B";
++ char *inbuf = in;
++ size_t inleft = strlen (in);
++ char out[3]; /* Space for one output character. */
++ char *outbuf;
++ size_t outleft;
++
++ outbuf = out;
++ outleft = sizeof (out);
++ TEST_COMPARE (iconv (c, &inbuf, &inleft, &outbuf, &outleft), (size_t) -1);
++ TEST_COMPARE (errno, E2BIG);
++ TEST_COMPARE (inleft, 3);
++ TEST_COMPARE (inbuf - in, strlen (in) - 3);
++ TEST_COMPARE (outleft, sizeof (out) - 2);
++ TEST_COMPARE (outbuf - out, 2);
++ TEST_COMPARE (out[0] & 0xff, 0xc3);
++ TEST_COMPARE (out[1] & 0xff, 0xa6);
++
++ /* Return to the initial shift state, producing the pending
++ character. */
++ outbuf = out;
++ outleft = sizeof (out);
++ TEST_COMPARE (iconv (c, &inbuf, &inleft, &outbuf, &outleft), 0);
++ TEST_COMPARE (inleft, 0);
++ TEST_COMPARE (inbuf - in, strlen (in));
++ TEST_COMPARE (outleft, sizeof (out) - 2);
++ TEST_COMPARE (outbuf - out, 2);
++ TEST_COMPARE (out[0] & 0xff, 0xcc);
++ TEST_COMPARE (out[1] & 0xff, 0x80);
++
++ /* Nothing should be flushed the second time. */
++ outbuf = out;
++ outleft = sizeof (out);
++ TEST_COMPARE (iconv (c, NULL, 0, &outbuf, &outleft), 0);
++ TEST_COMPARE (outleft, sizeof (out));
++ TEST_COMPARE (outbuf - out, 0);
++ TEST_COMPARE (out[0] & 0xff, 0xcc);
++ TEST_COMPARE (out[1] & 0xff, 0x80);
++
++ TEST_COMPARE (iconv_close (c), 0);
++}
++
++/* Use an explicit flush to return to the initial state. */
++static void
++with_flush (void)
++{
++ iconv_t c = iconv_open ("UTF-8", "ISO-2022-JP-3");
++ TEST_VERIFY_EXIT (c != (iconv_t) -1);
++
++ char in[] = "\e$(O+D";
++ char *inbuf = in;
++ size_t inleft = strlen (in);
++ char out[3]; /* Space for one output character. */
++ char *outbuf;
++ size_t outleft;
++
++ outbuf = out;
++ outleft = sizeof (out);
++ TEST_COMPARE (iconv (c, &inbuf, &inleft, &outbuf, &outleft), (size_t) -1);
++ TEST_COMPARE (errno, E2BIG);
++ TEST_COMPARE (inleft, 0);
++ TEST_COMPARE (inbuf - in, strlen (in));
++ TEST_COMPARE (outleft, sizeof (out) - 2);
++ TEST_COMPARE (outbuf - out, 2);
++ TEST_COMPARE (out[0] & 0xff, 0xc3);
++ TEST_COMPARE (out[1] & 0xff, 0xa6);
++
++ /* Flush the pending character. */
++ outbuf = out;
++ outleft = sizeof (out);
++ TEST_COMPARE (iconv (c, NULL, 0, &outbuf, &outleft), 0);
++ TEST_COMPARE (outleft, sizeof (out) - 2);
++ TEST_COMPARE (outbuf - out, 2);
++ TEST_COMPARE (out[0] & 0xff, 0xcc);
++ TEST_COMPARE (out[1] & 0xff, 0x80);
++
++ /* Nothing should be flushed the second time. */
++ outbuf = out;
++ outleft = sizeof (out);
++ TEST_COMPARE (iconv (c, NULL, 0, &outbuf, &outleft), 0);
++ TEST_COMPARE (outleft, sizeof (out));
++ TEST_COMPARE (outbuf - out, 0);
++ TEST_COMPARE (out[0] & 0xff, 0xcc);
++ TEST_COMPARE (out[1] & 0xff, 0x80);
++
++ TEST_COMPARE (iconv_close (c), 0);
++}
++
++static int
++do_test (void)
++{
++ with_escape_sequence ();
++ with_flush ();
++ return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/iconvdata/iso-2022-jp-3.c b/iconvdata/iso-2022-jp-3.c
+index 3eaa847ad9..c8ba88cdc9 100644
+--- a/iconvdata/iso-2022-jp-3.c
++++ b/iconvdata/iso-2022-jp-3.c
+@@ -67,23 +67,34 @@ enum
+ CURRENT_SEL_MASK = 7 << 3
+ };
+
+-/* During UCS-4 to ISO-2022-JP-3 conversion, the COUNT element of the state
+- also contains the last two bytes to be output, shifted by 6 bits, and a
+- one-bit indicator whether they must be preceded by the shift sequence,
+- in bit 22. */
++/* During UCS-4 to ISO-2022-JP-3 conversion, the COUNT element of the
++ state also contains the last two bytes to be output, shifted by 6
++ bits, and a one-bit indicator whether they must be preceded by the
++ shift sequence, in bit 22. During ISO-2022-JP-3 to UCS-4
++ conversion, COUNT may also contain a non-zero pending wide
++ character, shifted by six bits. This happens for certain inputs in
++ JISX0213_1_2004_set and JISX0213_2_set if the second wide character
++ in a combining sequence cannot be written because the buffer is
++ full. */
+
+ /* Since this is a stateful encoding we have to provide code which resets
+ the output state to the initial state. This has to be done during the
+ flushing. */
+ #define EMIT_SHIFT_TO_INIT \
+- if ((data->__statep->__count & ~7) != ASCII_set) \
++ if (data->__statep->__count != ASCII_set) \
+ { \
+ if (FROM_DIRECTION) \
+ { \
+- /* It's easy, we don't have to emit anything, we just reset the \
+- state for the input. */ \
+- data->__statep->__count &= 7; \
+- data->__statep->__count |= ASCII_set; \
++ if (__glibc_likely (outbuf + 4 <= outend)) \
++ { \
++ /* Write out the last character. */ \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 6; \
++ outbuf += sizeof (uint32_t); \
++ data->__statep->__count = ASCII_set; \
++ } \
++ else \
++ /* We don't have enough room in the output buffer. */ \
++ status = __GCONV_FULL_OUTPUT; \
+ } \
+ else \
+ { \
+@@ -151,7 +162,21 @@ enum
+ #define LOOPFCT FROM_LOOP
+ #define BODY \
+ { \
+- uint32_t ch = *inptr; \
++ uint32_t ch; \
++ \
++ /* Output any pending character. */ \
++ ch = set >> 6; \
++ if (__glibc_unlikely (ch != 0)) \
++ { \
++ put32 (outptr, ch); \
++ outptr += 4; \
++ /* Remove the pending character, but preserve state bits. */ \
++ set &= (1 << 6) - 1; \
++ continue; \
++ } \
++ \
++ /* Otherwise read the next input byte. */ \
++ ch = *inptr; \
+ \
+ /* Recognize escape sequences. */ \
+ if (__glibc_unlikely (ch == ESC)) \
+@@ -297,21 +322,25 @@ enum
+ uint32_t u1 = __jisx0213_to_ucs_combining[ch - 1][0]; \
+ uint32_t u2 = __jisx0213_to_ucs_combining[ch - 1][1]; \
+ \
++ inptr += 2; \
++ \
++ put32 (outptr, u1); \
++ outptr += 4; \
++ \
+ /* See whether we have room for two characters. */ \
+- if (outptr + 8 <= outend) \
++ if (outptr + 4 <= outend) \
+ { \
+- inptr += 2; \
+- put32 (outptr, u1); \
+- outptr += 4; \
+ put32 (outptr, u2); \
+ outptr += 4; \
+ continue; \
+ } \
+- else \
+- { \
+- result = __GCONV_FULL_OUTPUT; \
+- break; \
+- } \
++ \
++ /* Otherwise store only the first character now, and \
++ put the second one into the queue. */ \
++ set |= u2 << 6; \
++ /* Tell the caller why we terminate the loop. */ \
++ result = __GCONV_FULL_OUTPUT; \
++ break; \
+ } \
+ \
+ inptr += 2; \
+--
+2.27.0
+
diff --git a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch
new file mode 100644
index 000000000..28580c7e2
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch
@@ -0,0 +1,44 @@
+From dca565886b5e8bd7966e15f0ca42ee5cff686673 Mon Sep 17 00:00:00 2001
+From: DJ Delorie <dj@redhat.com>
+Date: Thu, 25 Feb 2021 16:08:21 -0500
+Subject: [PATCH] nscd: Fix double free in netgroupcache [BZ #27462]
+
+In commit 745664bd798ec8fd50438605948eea594179fba1 a use-after-free
+was fixed, but this led to an occasional double-free. This patch
+tracks the "live" allocation better.
+
+Tested manually by a third party.
+
+Related: RHBZ 1927877
+
+Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
+Reviewed-by: Carlos O'Donell <carlos@redhat.com>
+---
+ nscd/netgroupcache.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
+index dba6ceec1b..ad2daddafd 100644
+--- a/nscd/netgroupcache.c
++++ b/nscd/netgroupcache.c
+@@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+ : NULL);
+ ndomain = (ndomain ? newbuf + ndomaindiff
+ : NULL);
+- buffer = newbuf;
++ *tofreep = buffer = newbuf;
+ }
+
+ nhost = memcpy (buffer + bufused,
+@@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+ else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE)
+ {
+ buflen *= 2;
+- buffer = xrealloc (buffer, buflen);
++ *tofreep = buffer = xrealloc (buffer, buflen);
+ }
+ else if (status == NSS_STATUS_RETURN
+ || status == NSS_STATUS_NOTFOUND
+--
+2.27.0
+
diff --git a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend
index d458a6d94..e0f4c3080 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend
@@ -1,5 +1,6 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += "file://0031-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch \
- file://0032-Fix-buffer-overrun-in-EUC-KR-conversion-module-BZ-24973.patch \
+SRC_URI += "file://0032-Fix-buffer-overrun-in-EUC-KR-conversion-module-BZ-24973.patch \
+ file://0033-Fix-assertion-failure-in-ISO-20220JP-3-module-bug-27256.patch \
+ file://0034-Fix-double-free-in-netgroupcache-BZ-27462.patch \
"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend
index 995146b35..6c25b3e0e 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend
@@ -2,4 +2,4 @@ EXTRA_OECMAKE += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', '-DINTEL_PF
EXTRA_OECMAKE += "${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'validation-unsecure', '-DBMC_VALIDATION_UNSECURE_FEATURE=ON', '', d)}"
EXTRA_OECMAKE += "-DUSING_ENTITY_MANAGER_DECORATORS=OFF"
SRC_URI = "git://github.com/openbmc/intel-ipmi-oem.git"
-SRCREV = "b910987a7d832e38e9342f0946aeb555a48f9cb0"
+SRCREV = "84efff0c639ed24e3b47394e8c38d3aba75b1a41"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend
index 55cfcc00c..b99d3948b 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend
@@ -1,3 +1,3 @@
# Enable downstream autobump
SRC_URI = "git://github.com/openbmc/libpeci"
-SRCREV = "bc641112abc99b4a972665aa984023a6713a21ac"
+SRCREV = "adf056af63af67dff75065be810ba286bcea6e3a"
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/pam/pam-ipmi_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/pam/pam-ipmi_%.bbappend
index 08f8c58b0..55fb00a77 100644
--- a/meta-openbmc-mods/meta-common/recipes-extended/pam/pam-ipmi_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-extended/pam/pam-ipmi_%.bbappend
@@ -2,6 +2,3 @@ do_install_append () {
# Remove ipmi_pass from image, if debug-tweaks is not enabled
${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', '', 'rm ${D}/${sysconfdir}/ipmi_pass', d)}
}
-
-# latest upstream HEAD until meta-phosphor autobumps
-SRCREV = "c2ef3319b42d86862b479e08e652ab36a26a14db"
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch
index 7b483550c..9aaf2f952 100644
--- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch
+++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch
@@ -1,35 +1,34 @@
-From d2a418f554ebe3438181c97f2800d36f17295c1f Mon Sep 17 00:00:00 2001
+From baff58f6e8f7aef4fd56be959fdd2e5e3c429eef Mon Sep 17 00:00:00 2001
From: Johnathan Mantey <johnathanx.mantey@intel.com>
Date: Mon, 13 Jul 2020 11:51:54 -0700
Subject: [PATCH] Revert "server: Check return code for
sd_bus_add_object_vtable()"
This reverts commit 017a19da5f67a74daedf4d63111569902d4764e6.
-
-%% original patch: 0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch
---
- include/sdbusplus/server/interface.hpp | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
+ src/server/interface.cpp | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
-diff --git a/include/sdbusplus/server/interface.hpp b/include/sdbusplus/server/interface.hpp
-index acf4a09..36e89de 100644
---- a/include/sdbusplus/server/interface.hpp
-+++ b/include/sdbusplus/server/interface.hpp
-@@ -64,12 +64,8 @@ struct interface final
- _interface_added(false)
- {
- sd_bus_slot* slot = nullptr;
-- int r = _intf->sd_bus_add_object_vtable(
-- _bus.get(), &slot, _path.c_str(), _interf.c_str(), vtable, context);
-- if (r < 0)
-- {
-- throw exception::SdBusError(-r, "sd_bus_add_object_vtable");
-- }
-+ _intf->sd_bus_add_object_vtable(_bus.get(), &slot, _path.c_str(),
-+ _interf.c_str(), vtable, context);
+diff --git a/src/server/interface.cpp b/src/server/interface.cpp
+index a72c656..0155b6d 100644
+--- a/src/server/interface.cpp
++++ b/src/server/interface.cpp
+@@ -17,13 +17,8 @@ interface::interface(sdbusplus::bus::bus& bus, const char* path,
+ _interface_added(false)
+ {
+ sd_bus_slot* slot = nullptr;
+- int r = _intf->sd_bus_add_object_vtable(_bus.get(), &slot, _path.c_str(),
+- _interf.c_str(), vtable, context);
+- if (r < 0)
+- {
+- throw exception::SdBusError(-r, "sd_bus_add_object_vtable");
+- }
+-
++ _intf->sd_bus_add_object_vtable(_bus.get(), &slot, _path.c_str(),
++ _interf.c_str(), vtable, context);
+ _slot = decltype(_slot){slot};
+ }
- _slot = decltype(_slot){slot};
- }
--
-2.26.2
+2.17.1
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/configure-usb-c.bb b/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/configure-usb-c.bb
new file mode 100644
index 000000000..66481543b
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/configure-usb-c.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Configure USB Type C controller"
+DESCRIPTION = "Configure USB Type C CC controller which requires basic initialization on every G3 to S5 cycle"
+
+S = "${WORKDIR}"
+SRC_URI = " \
+ file://configure-usb-c.sh \
+ file://configure-usb-c.service \
+ "
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+RDEPENDS_${PN} += "bash"
+
+inherit systemd
+
+FILES_${PN} += "${systemd_system_unitdir}/configure-usb-c.service"
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/configure-usb-c.sh ${D}/${bindir}/configure-usb-c.sh
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${S}/configure-usb-c.service ${D}${base_libdir}/systemd/system
+}
+
+SYSTEMD_SERVICE_${PN} = "configure-usb-c.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.service b/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.service
new file mode 100644
index 000000000..465ddd77f
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Configure USB Type C controller
+
+[Service]
+ExecStart=/usr/bin/configure-usb-c.sh
+Type=oneshot
+
+[Install]
+WantedBy=basic.target
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.sh b/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.sh
new file mode 100644
index 000000000..c7cc4a231
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/configure-usb-c/files/configure-usb-c.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+I2C_BUS=7
+CHIP_ADDR=0x47
+
+read_id() {
+ local idx=0
+ local result=0
+ local value=0
+ for ((idx=0; idx<6; idx++))
+ do
+ typeset -i value=$(gpioget $(gpiofind "FM_BMC_BOARD_SKU_ID${idx}_N"))
+ value=$((value << idx))
+ result=$((result | value))
+ done
+ echo $result
+}
+
+BOARD_ID=$(read_id)
+if grep -q 'CPU part\s*: 0xc07' /proc/cpuinfo; then # AST2600
+ if [[ $BOARD_ID == 62 || $BOARD_ID == 61 ]]; then
+ # Write 0x01 data into General Control Register (offset 0x0A)
+ # Write 0x21 data into General Control Register (offset 0x0A)
+ # Write 0x80 data into Connection Status Register (offset 0x08)
+ # Write 0x20 data into General Control Register (offset 0x0A)
+ i2cset -y $I2C_BUS $CHIP_ADDR 0x0a 0x01; i2cset -y $I2C_BUS $CHIP_ADDR 0x0a 0x21; i2cset -y $I2C_BUS $CHIP_ADDR 0x08 0x80; i2cset -y $I2C_BUS $CHIP_ADDR 0x0a 0x20
+ echo "Configured USB Type C controller"
+ fi
+fi
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py
index c077e5318..baa174349 100755
--- a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py
@@ -1,4 +1,19 @@
#!/usr/bin/env python3
+
+# Copyright (c) 2020 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
# coding: utf-8
# our image is contained as parts, including the hash
# then it gets zipped up and signed again
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/pfr-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/pfr-manager_%.bbappend
index 9a8fa44c0..6b769b941 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/pfr-manager_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/pfr-manager_%.bbappend
@@ -1,5 +1,5 @@
# Enable downstream autobump
SRC_URI = "git://github.com/openbmc/pfr-manager"
-SRCREV = "f88197083c3372cfb9167347b3cf9cc26d488a4d"
+SRCREV = "00acaffb3840d019bf0853d1ee93fdde947f47d2"
DEPENDS += " libgpiod \
"
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch
index 0a7d4007f..fbd51df7a 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch
@@ -1,4 +1,4 @@
-From 63d053b12cc7ca63a668872ce70e6592fe1dd7e5 Mon Sep 17 00:00:00 2001
+From 7474fe190f770e064a5ce5e939bd713ce2aa1de5 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 3 Feb 2021 16:18:37 -0800
Subject: [PATCH] peci: Add debug printing to check caller PID
@@ -16,18 +16,18 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 5 insertions(+)
diff --git a/drivers/peci/peci-core.c b/drivers/peci/peci-core.c
-index 0fc2f246ada8..0fdb26a15150 100644
+index 10375e6087a5..02c8502fd846 100644
--- a/drivers/peci/peci-core.c
+++ b/drivers/peci/peci-core.c
-@@ -193,6 +193,7 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
+@@ -194,6 +194,7 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
bool do_retry, bool has_aw_fcs)
{
- uint interval_ms = PECI_DEV_RETRY_INTERVAL_MIN_MSEC;
+ uint interval_us = PECI_DEV_RETRY_INTERVAL_MIN_USEC;
+ char task_name[TASK_COMM_LEN];
ulong timeout = jiffies;
u8 aw_fcs;
int ret;
-@@ -213,6 +214,10 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
+@@ -214,6 +215,10 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
}
}
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch
new file mode 100644
index 000000000..b9a6ca527
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch
@@ -0,0 +1,116 @@
+From af414e45bade3cf7277215d82b59a31c9b459cea Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Mon, 22 Feb 2021 15:27:22 -0800
+Subject: [PATCH] Fix libmctp build error
+
+This is a quick fix for libmctp building which includes staging
+kernel headers. It's a temporary fix until kernel tree fixes the
+rwonce.h including issue.
+
+Note: Do not upstream it.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ include/asm/rwonce.h | 90 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 90 insertions(+)
+ create mode 100644 include/asm/rwonce.h
+
+diff --git a/include/asm/rwonce.h b/include/asm/rwonce.h
+new file mode 100644
+index 000000000000..11619bdbebae
+--- /dev/null
++++ b/include/asm/rwonce.h
+@@ -0,0 +1,90 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * Prevent the compiler from merging or refetching reads or writes. The
++ * compiler is also forbidden from reordering successive instances of
++ * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some
++ * particular ordering. One way to make the compiler aware of ordering is to
++ * put the two invocations of READ_ONCE or WRITE_ONCE in different C
++ * statements.
++ *
++ * These two macros will also work on aggregate data types like structs or
++ * unions.
++ *
++ * Their two major use cases are: (1) Mediating communication between
++ * process-level code and irq/NMI handlers, all running on the same CPU,
++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
++ * mutilate accesses that either do not require ordering or that interact
++ * with an explicit memory barrier or atomic instruction that provides the
++ * required ordering.
++ */
++#ifndef __ASM_GENERIC_RWONCE_H
++#define __ASM_GENERIC_RWONCE_H
++
++#ifndef __ASSEMBLY__
++
++#include <linux/compiler_types.h>
++#include <linux/kasan-checks.h>
++#include <linux/kcsan-checks.h>
++
++/*
++ * Yes, this permits 64-bit accesses on 32-bit architectures. These will
++ * actually be atomic in some cases (namely Armv7 + LPAE), but for others we
++ * rely on the access being split into 2x32-bit accesses for a 32-bit quantity
++ * (e.g. a virtual address) and a strong prevailing wind.
++ */
++#define compiletime_assert_rwonce_type(t) \
++ compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
++ "Unsupported access size for {READ,WRITE}_ONCE().")
++
++/*
++ * Use __READ_ONCE() instead of READ_ONCE() if you do not require any
++ * atomicity. Note that this may result in tears!
++ */
++#ifndef __READ_ONCE
++#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
++#endif
++
++#define READ_ONCE(x) \
++({ \
++ compiletime_assert_rwonce_type(x); \
++ __READ_ONCE(x); \
++})
++
++#define __WRITE_ONCE(x, val) \
++do { \
++ *(volatile typeof(x) *)&(x) = (val); \
++} while (0)
++
++#define WRITE_ONCE(x, val) \
++do { \
++ compiletime_assert_rwonce_type(x); \
++ __WRITE_ONCE(x, val); \
++} while (0)
++
++static __always_inline
++unsigned long __read_once_word_nocheck(const void *addr)
++{
++ return __READ_ONCE(*(unsigned long *)addr);
++}
++
++/*
++ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need to load a
++ * word from memory atomically but without telling KASAN/KCSAN. This is
++ * usually used by unwinding code when walking the stack of a running process.
++ */
++#define READ_ONCE_NOCHECK(x) \
++({ \
++ compiletime_assert(sizeof(x) == sizeof(unsigned long), \
++ "Unsupported access size for READ_ONCE_NOCHECK()."); \
++ (typeof(x))__read_once_word_nocheck(&(x)); \
++})
++
++static __always_inline
++unsigned long read_word_at_a_time(const void *addr)
++{
++ kasan_check_read(addr, 1);
++ return *(unsigned long *)addr;
++}
++
++#endif /* __ASSEMBLY__ */
++#endif /* __ASM_GENERIC_RWONCE_H */
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch
new file mode 100644
index 000000000..2d435c796
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch
@@ -0,0 +1,33 @@
+From cdd7104850d34cfe22902c45d69dac6cb506b087 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Fri, 26 Feb 2021 11:00:54 -0800
+Subject: [PATCH] Add a quick fix to resolve USB gadget DMA issue.
+
+This is a quick fix to resolve USB gadget DMA issue and it should
+be removed when a real fix is added.
+
+Tested: Keyboard and mouse in KVM feature worked.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ kernel/dma/mapping.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
+index 51bb8fa8eb89..7bcfedeb1e30 100644
+--- a/kernel/dma/mapping.c
++++ b/kernel/dma/mapping.c
+@@ -146,8 +146,10 @@ dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page,
+
+ BUG_ON(!valid_dma_direction(dir));
+
++#if 0 /* Quick fix to resolve USB gadget issue */
+ if (WARN_ON_ONCE(!dev->dma_mask))
+ return DMA_MAPPING_ERROR;
++#endif
+
+ if (dma_map_direct(dev, ops))
+ addr = dma_direct_map_page(dev, page, offset, size, dir, attrs);
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend
index b2865e511..5ca73f0d8 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -1,10 +1,10 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-KBRANCH = "dev-5.8-intel"
+KBRANCH = "dev-5.10-intel"
KSRC = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=${KBRANCH}"
# Include this as a comment only for downstream auto-bump
-# SRC_URI = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=dev-5.8-intel"
-SRCREV="0f6cc27c3bed1e633100e9ea8d8e0384ca51e613"
+# SRC_URI = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=dev-5.10-intel"
+SRCREV="c306c95688f3e2d9ee9b5270eff4bfb3e6e34b8a"
do_compile_prepend(){
# device tree compiler flags
@@ -15,6 +15,8 @@ SRC_URI += " \
file://intel.cfg \
file://0001-peci-Add-debug-printing-to-check-caller-PID.patch \
file://0002-soc-aspeed-add-AST2600-A0-specific-fix-into-mbox-dri.patch \
+ file://0003-Fix-libmctp-build-error.patch \
+ file://0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch \
"
SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'file://0005-128MB-flashmap-for-PFR.patch', '', d)}"
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch
index bcdad9c21..a8dd27f8a 100644
--- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch
+++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch
@@ -1,7 +1,7 @@
-From 9b0fcfc02c9ba33c02e210b8d253fa64eeb69060 Mon Sep 17 00:00:00 2001
+From c5c5634ccc31cd494ad5333987fa6076f0f7464a Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Thu, 2 Apr 2020 17:06:07 +0530
-Subject: [PATCH 1/2] Adding channel specific privilege to network
+Subject: [PATCH] Adding channel specific privilege to network
- Adding the channel access information to the network
interface object. This privilege will be used in
@@ -17,17 +17,16 @@ access command
Change-Id: I3b592a19363eef684e31d5f7c34dad8f2f9211df
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
-
-%% original patch: 0003-Adding-channel-specific-privilege-to-network.patch
+Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
---
ethernet_interface.cpp | 123 +++++++++++++++++++++++++++++++++++++++++
- ethernet_interface.hpp | 38 ++++++++++++-
- network_manager.cpp | 104 ++++++++++++++++++++++++++++++++++
+ ethernet_interface.hpp | 37 ++++++++++++-
+ network_manager.cpp | 102 ++++++++++++++++++++++++++++++++++
network_manager.hpp | 9 +++
- 4 files changed, 273 insertions(+), 1 deletion(-)
+ 4 files changed, 270 insertions(+), 1 deletion(-)
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
-index 76d7f92..318b94b 100644
+index 522be57..89adf69 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -44,6 +44,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties";
@@ -49,7 +48,7 @@ index 76d7f92..318b94b 100644
// Emit deferred signal.
if (emitSignal)
-@@ -1076,5 +1081,123 @@ void EthernetInterface::deleteAll()
+@@ -1068,5 +1073,123 @@ void EthernetInterface::deleteAll()
manager.writeToConfigurationFile();
}
@@ -174,7 +173,7 @@ index 76d7f92..318b94b 100644
} // namespace network
} // namespace phosphor
diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp
-index abaf43e..fb538a7 100644
+index abaf43e..f6d6363 100644
--- a/ethernet_interface.hpp
+++ b/ethernet_interface.hpp
@@ -2,11 +2,14 @@
@@ -202,7 +201,7 @@ index abaf43e..fb538a7 100644
using IP = sdbusplus::xyz::openbmc_project::Network::server::IP;
-@@ -31,11 +35,15 @@ using EthernetInterfaceIntf =
+@@ -31,11 +35,14 @@ using EthernetInterfaceIntf =
sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
using MacAddressIntf =
sdbusplus::xyz::openbmc_project::Network::server::MACAddress;
@@ -213,12 +212,11 @@ index abaf43e..fb538a7 100644
using ObjectPath = sdbusplus::message::object_path;
namespace fs = std::filesystem;
-+using DbusVariant =
-+ sdbusplus::message::variant<std::string, std::vector<std::string>>;
++using DbusVariant = std::variant<std::string, std::vector<std::string>>;
class Manager; // forward declaration of network manager.
-@@ -223,6 +231,14 @@ class EthernetInterface : public Ifaces
+@@ -223,6 +230,14 @@ class EthernetInterface : public Ifaces
*/
void deleteAll();
@@ -233,7 +231,7 @@ index abaf43e..fb538a7 100644
using EthernetInterfaceIntf::dHCPEnabled;
using EthernetInterfaceIntf::interfaceName;
using EthernetInterfaceIntf::linkUp;
-@@ -344,6 +360,26 @@ class EthernetInterface : public Ifaces
+@@ -344,6 +359,26 @@ class EthernetInterface : public Ifaces
* @returns true/false value if the address is static
*/
bool originIsManuallyAssigned(IP::AddressOrigin origin);
@@ -261,7 +259,7 @@ index abaf43e..fb538a7 100644
} // namespace network
diff --git a/network_manager.cpp b/network_manager.cpp
-index c55c9bb..b5ff278 100644
+index c55c9bb..50ff908 100644
--- a/network_manager.cpp
+++ b/network_manager.cpp
@@ -36,6 +36,13 @@ extern std::unique_ptr<Timer> restartTimer;
@@ -278,7 +276,7 @@ index c55c9bb..b5ff278 100644
Manager::Manager(sdbusplus::bus::bus& bus, const char* objPath,
const std::string& path) :
details::VLANCreateIface(bus, objPath, true),
-@@ -43,6 +50,103 @@ Manager::Manager(sdbusplus::bus::bus& bus, const char* objPath,
+@@ -43,6 +50,101 @@ Manager::Manager(sdbusplus::bus::bus& bus, const char* objPath,
{
fs::path confDir(path);
setConfDir(confDir);
@@ -347,12 +345,10 @@ index c55c9bb..b5ff278 100644
+ return;
+ }
+
-+ sdbusplus::message::variant<std::vector<std::string>> result;
++ std::variant<std::vector<std::string>> result;
+ reply.read(result);
+
-+ supportedPrivList =
-+ sdbusplus::message::variant_ns::get<std::vector<std::string>>(
-+ result);
++ supportedPrivList = std::get<std::vector<std::string>>(result);
+ }
+
+ // Resgister the signal
@@ -372,8 +368,8 @@ index c55c9bb..b5ff278 100644
+ {
+ if (t.first == propNameAllPrivileges)
+ {
-+ supportedPrivList = sdbusplus::message::variant_ns::get<
-+ std::vector<std::string>>(t.second);
++ supportedPrivList =
++ std::get<std::vector<std::string>>(t.second);
+ }
+ }
+ });
@@ -410,5 +406,5 @@ index 6815d3f..96e20a6 100644
} // namespace network
--
-2.26.2
+2.29.2
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend
index fd2f926c8..973cba09e 100644
--- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend
@@ -2,11 +2,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
DEPENDS += "nlohmann-json boost"
-#todo: Appu, fix nobranch
SRC_URI = "git://github.com/openbmc/phosphor-networkd"
-SRC_URI += " file://0004-Improved-IPv6-netmask-parsing.patch \
- "
-
SRCREV = "1b5ec9c5367947d19bdf6efd08251eeb55dd90f4"
+SRC_URI += "file://0003-Adding-channel-specific-privilege-to-network.patch \
+ file://0004-Improved-IPv6-netmask-parsing.patch \
+ "
+
EXTRA_OECONF_append = " --enable-nic-ethtool=yes"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch
index c518d943f..fdd2ba6e3 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch
@@ -1,4 +1,4 @@
-From 2048226878a80fefcbcbe999fd826cc7c02ed9e4 Mon Sep 17 00:00:00 2001
+From 85e7b2d9ede4bb33e02f48ea1d4691d2154fc4a5 Mon Sep 17 00:00:00 2001
From: Johnathan Mantey <johnathanx.mantey@intel.com>
Date: Tue, 13 Oct 2020 15:00:51 -0700
Subject: [PATCH] Improve initialization of I2C sensors
@@ -32,15 +32,15 @@ missing after AC cycles.
Change-Id: I118df674162677d66e7d211b089430fce384086b
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
---
- include/devices.hpp | 153 +++++++++++++++++++----------------
+ include/devices.hpp | 165 ++++++++++++++++++++-----------------
src/Overlay.cpp | 192 ++++++++++++++++++++++++++++++++++----------
- 2 files changed, 233 insertions(+), 112 deletions(-)
+ 2 files changed, 239 insertions(+), 118 deletions(-)
diff --git a/include/devices.hpp b/include/devices.hpp
-index acbfb95..1f25864 100644
+index c375b1c..b7dc7d0 100644
--- a/include/devices.hpp
+++ b/include/devices.hpp
-@@ -31,99 +31,116 @@ struct CmpStr
+@@ -31,105 +31,122 @@ struct CmpStr
struct ExportTemplate
{
@@ -65,12 +65,18 @@ index acbfb95..1f25864 100644
- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
- {"24C64", ExportTemplate("24c64 $Address",
- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
+- {"ADM1266",
+- ExportTemplate("adm1266 $Address",
+- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
+ {{"24C02",
+ ExportTemplate("24c02 $Address", "/sys/bus/i2c/devices/i2c-$Bus",
+ "new_device", "delete_device", false)},
+ {"24C64",
+ ExportTemplate("24c64 $Address", "/sys/bus/i2c/devices/i2c-$Bus",
+ "new_device", "delete_device", false)},
++ {"ADM1266", ExportTemplate("adm1266 $Address",
++ "/sys/bus/i2c/devices/i2c-$Bus/new_device",
++ "new_device", "delete_device", false)},
{"ADM1272",
- ExportTemplate("adm1272 $Address",
- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
@@ -152,8 +158,14 @@ index acbfb95..1f25864 100644
{"MAX31730",
- ExportTemplate("max31730 $Address",
- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
+- {"MAX34440",
+- ExportTemplate("max34440 $Address",
+- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
+ ExportTemplate("max31730 $Address", "/sys/bus/i2c/devices/i2c-$Bus",
+ "new_device", "delete_device", true)},
++ {"MAX34440", ExportTemplate("max34440 $Address",
++ "/sys/bus/i2c/devices/i2c-$Bus/new_device",
++ "new_device", "delete_device", true)},
{"MAX34451",
- ExportTemplate("max34451 $Address",
- "/sys/bus/i2c/devices/i2c-$Bus/new_device")},
@@ -471,5 +483,5 @@ index cb6ed10..7a3089e 100644
linkMux(name, static_cast<size_t>(*bus), static_cast<size_t>(*address),
*channels);
--
-2.26.2
+2.17.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch
new file mode 100644
index 000000000..88e86f68c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch
@@ -0,0 +1,351 @@
+From 1e8b3e0fe4ce9aa87a35f6c3ba6e506873d5455c Mon Sep 17 00:00:00 2001
+From: mansijos <mansi.joshi@intel.com>
+Date: Fri, 12 Feb 2021 11:26:57 +0530
+Subject: [PATCH] Entity-manager: Add support to update assetTag
+
+Asset tag is an updateable property from User level interface like
+Redfish. User-level interface will update Asset tag in entity-manager,
+which will further update the needed FRU interface property exposed.
+
+Tested:
+Successfully updated in assetTag interface as well as in fru interface
+while using set-property and using redfish as well.
+The new value is preserved after BMC resets.
+
+Change-Id: Iab8b24344d1a27486ceafe21aa2b4496706a2944
+Signed-off-by: mansijos <mansi.joshi@intel.com>
+---
+ include/EntityManager.hpp | 15 ++--
+ src/EntityManager.cpp | 148 ++++++++++++++++++++++++++++++++------
+ 2 files changed, 135 insertions(+), 28 deletions(-)
+
+diff --git a/include/EntityManager.hpp b/include/EntityManager.hpp
+index 5867556..a4e9922 100644
+--- a/include/EntityManager.hpp
++++ b/include/EntityManager.hpp
+@@ -29,13 +29,16 @@
+ #include <list>
+ #include <string>
+
+-using DBusProbeObjectT = boost::container::flat_map<
+- std::string,
+- std::vector<boost::container::flat_map<std::string, BasicVariantType>>>;
+-
+ using FoundDeviceT =
+ std::vector<boost::container::flat_map<std::string, BasicVariantType>>;
+
++using FoundDeviceInfoT = std::vector<
++ std::tuple<boost::container::flat_map<std::string, BasicVariantType>,
++ std::string, std::string, std::string>>;
++
++using DBusProbeObjectT =
++ boost::container::flat_map<std::string, FoundDeviceInfoT>;
++
+ struct PerformScan : std::enable_shared_from_this<PerformScan>
+ {
+
+@@ -62,12 +65,12 @@ struct PerformProbe : std::enable_shared_from_this<PerformProbe>
+ {
+ PerformProbe(const std::vector<std::string>& probeCommand,
+ std::shared_ptr<PerformScan>& scanPtr,
+- std::function<void(FoundDeviceT&)>&& callback);
++ std::function<void(FoundDeviceInfoT&)>&& callback);
+ virtual ~PerformProbe();
+
+ std::vector<std::string> _probeCommand;
+ std::shared_ptr<PerformScan> scan;
+- std::function<void(FoundDeviceT&)> _callback;
++ std::function<void(FoundDeviceInfoT&)> _callback;
+ };
+
+ inline void logDeviceAdded(const nlohmann::json& record)
+diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
+index aa1df20..cd73675 100644
+--- a/src/EntityManager.cpp
++++ b/src/EntityManager.cpp
+@@ -47,9 +47,14 @@ constexpr const char* lastConfiguration = "/tmp/configuration/last.json";
+ constexpr const char* currentConfiguration = "/var/configuration/system.json";
+ constexpr const char* globalSchema = "global.json";
+ constexpr const int32_t MAX_MAPPER_DEPTH = 0;
++constexpr const char* foundObject = "FoundProbe";
+
+ constexpr const bool DEBUG = false;
+
++using foundProbeData = std::map<std::string, std::string>;
++static foundProbeData foundData;
++static std::map<std::string, foundProbeData> mapFoundData;
++
+ struct cmp_str
+ {
+ bool operator()(const char* a, const char* b) const
+@@ -169,7 +174,10 @@ void getInterfaces(
+ return;
+ }
+
+- scan->dbusProbeObjects[std::get<2>(call)].emplace_back(resp);
++ // Save the dbus info along with device info
++ scan->dbusProbeObjects[std::get<2>(call)].emplace_back(
++ std::make_tuple(resp, std::get<0>(call), std::get<1>(call),
++ std::get<2>(call)));
+ },
+ std::get<0>(call), std::get<1>(call), "org.freedesktop.DBus.Properties",
+ "GetAll", std::get<2>(call));
+@@ -274,11 +282,10 @@ void findDbusObjects(std::vector<std::shared_ptr<PerformProbe>>&& probeVector,
+ // probes dbus interface dictionary for a key with a value that matches a regex
+ bool probeDbus(const std::string& interface,
+ const std::map<std::string, nlohmann::json>& matches,
+- FoundDeviceT& devices, std::shared_ptr<PerformScan> scan,
++ FoundDeviceInfoT& devices, std::shared_ptr<PerformScan> scan,
+ bool& foundProbe)
+ {
+- std::vector<boost::container::flat_map<std::string, BasicVariantType>>&
+- dbusObject = scan->dbusProbeObjects[interface];
++ FoundDeviceInfoT& dbusObject = scan->dbusProbeObjects[interface];
+ if (dbusObject.empty())
+ {
+ foundProbe = false;
+@@ -287,8 +294,9 @@ bool probeDbus(const std::string& interface,
+ foundProbe = true;
+
+ bool foundMatch = false;
+- for (auto& device : dbusObject)
++ for (auto& deviceInfo : dbusObject)
+ {
++ auto& device = std::get<0>(deviceInfo);
+ bool deviceMatches = true;
+ for (auto& match : matches)
+ {
+@@ -305,7 +313,7 @@ bool probeDbus(const std::string& interface,
+ }
+ if (deviceMatches)
+ {
+- devices.emplace_back(device);
++ devices.emplace_back(deviceInfo);
+ foundMatch = true;
+ deviceMatches = false; // for next iteration
+ }
+@@ -315,11 +323,8 @@ bool probeDbus(const std::string& interface,
+
+ // default probe entry point, iterates a list looking for specific types to
+ // call specific probe functions
+-bool probe(
+- const std::vector<std::string>& probeCommand,
+- std::shared_ptr<PerformScan> scan,
+- std::vector<boost::container::flat_map<std::string, BasicVariantType>>&
+- foundDevs)
++bool probe(const std::vector<std::string>& probeCommand,
++ std::shared_ptr<PerformScan> scan, FoundDeviceInfoT& foundDevs)
+ {
+ const static std::regex command(R"(\((.*)\))");
+ std::smatch match;
+@@ -449,8 +454,9 @@ bool probe(
+ // probe passed, but empty device
+ if (ret && foundDevs.size() == 0)
+ {
+- foundDevs.emplace_back(
+- boost::container::flat_map<std::string, BasicVariantType>{});
++ foundDevs.emplace_back(std::make_tuple(
++ boost::container::flat_map<std::string, BasicVariantType>{},
++ std::string{}, std::string{}, std::string{}));
+ }
+ if (matchOne && ret)
+ {
+@@ -465,13 +471,13 @@ bool probe(
+
+ PerformProbe::PerformProbe(const std::vector<std::string>& probeCommand,
+ std::shared_ptr<PerformScan>& scanPtr,
+- std::function<void(FoundDeviceT&)>&& callback) :
++ std::function<void(FoundDeviceInfoT&)>&& callback) :
+ _probeCommand(probeCommand),
+ scan(scanPtr), _callback(std::move(callback))
+ {}
+ PerformProbe::~PerformProbe()
+ {
+- FoundDeviceT foundDevs;
++ FoundDeviceInfoT foundDevs;
+ if (probe(_probeCommand, scan, foundDevs))
+ {
+ _callback(foundDevs);
+@@ -556,6 +562,47 @@ void addArrayToDbus(const std::string& name, const nlohmann::json& array,
+ }
+ }
+
++template <typename PropertyType>
++bool persistAssetTag(const PropertyType& newVal,
++ const std::string& jsonPointerString)
++{
++ std::size_t found = jsonPointerString.find_last_of("/\\");
++ std::string jsonPointerPath = jsonPointerString.substr(0, found);
++
++ auto it = mapFoundData.find(jsonPointerPath);
++ if (it == mapFoundData.end())
++ {
++ std::cerr << "Error in finding jsonPointerPath in mapFoundData"
++ << "\n";
++ return false;
++ }
++
++ foundProbeData& tmpMap = it->second;
++ auto foundConn = tmpMap.find("foundConn");
++ auto foundPath = tmpMap.find("foundPath");
++ auto foundIntf = tmpMap.find("foundIntf");
++ if (foundConn == tmpMap.end() || foundPath == tmpMap.end() ||
++ foundIntf == tmpMap.end())
++ {
++ std::cerr << "No prob object data is avaliable in foundProbeData"
++ << "\n";
++ return false;
++ }
++
++ SYSTEM_BUS->async_method_call(
++ [](const boost::system::error_code& ec) {
++ if (ec)
++ {
++ std::cerr << "Error setting AssetTag in FRU interface " << ec
++ << "\n";
++ }
++ },
++ foundConn->second, foundPath->second, "org.freedesktop.DBus.Properties",
++ "Set", foundIntf->second, "PRODUCT_ASSET_TAG",
++ std::variant<PropertyType>(newVal));
++ return true;
++}
++
+ template <typename PropertyType>
+ void addProperty(const std::string& propertyName, const PropertyType& value,
+ sdbusplus::asio::dbus_interface* iface,
+@@ -568,11 +615,21 @@ void addProperty(const std::string& propertyName, const PropertyType& value,
+ iface->register_property(propertyName, value);
+ return;
+ }
++
+ iface->register_property(
+ propertyName, value,
+- [&systemConfiguration,
++ [propertyName, &systemConfiguration,
+ jsonPointerString{std::string(jsonPointerString)}](
+ const PropertyType& newVal, PropertyType& val) {
++ if (propertyName == "AssetTag")
++ {
++ if (!persistAssetTag(newVal, jsonPointerString))
++ {
++ std::cerr << "error setting AssetTag in FRU interface\n";
++ return -1;
++ }
++ }
++
+ val = newVal;
+ if (!setJsonFromPointer(jsonPointerString, val,
+ systemConfiguration))
+@@ -970,6 +1027,11 @@ void postToDbus(const nlohmann::json& newConfiguration,
+ populateInterfaceFromJson(systemConfiguration, jsonPointerPath,
+ boardIface, boardValues, objServer);
+ jsonPointerPath += "/";
++
++ std::string foundConn;
++ std::string foundPath;
++ std::string foundIntf;
++
+ // iterate through board properties
+ for (auto& boardField : boardValues.items())
+ {
+@@ -979,9 +1041,32 @@ void postToDbus(const nlohmann::json& newConfiguration,
+ createInterface(objServer, boardName, boardField.key(),
+ boardKeyOrig);
+
+- populateInterfaceFromJson(systemConfiguration,
+- jsonPointerPath + boardField.key(),
+- iface, boardField.value(), objServer);
++ if (boardField.key() == "FoundProbe")
++ {
++ foundConn = boardField.value()["Connection"];
++ foundPath = boardField.value()["Path"];
++ foundIntf = boardField.value()["Interface"];
++ }
++ if (boardField.key() ==
++ "xyz.openbmc_project.Inventory.Decorator.AssetTag")
++ {
++ foundData["foundConn"] = foundConn;
++ foundData["foundPath"] = foundPath;
++ foundData["foundIntf"] = foundIntf;
++ mapFoundData[jsonPointerPath + boardField.key()] =
++ foundData;
++
++ populateInterfaceFromJson(
++ systemConfiguration, jsonPointerPath + boardField.key(),
++ iface, boardField.value(), objServer,
++ sdbusplus::asio::PropertyPermission::readWrite);
++ }
++ else
++ {
++ populateInterfaceFromJson(
++ systemConfiguration, jsonPointerPath + boardField.key(),
++ iface, boardField.value(), objServer);
++ }
+ }
+ }
+
+@@ -1278,7 +1363,7 @@ void PerformScan::run()
+ auto thisRef = shared_from_this();
+ auto probePointer = std::make_shared<PerformProbe>(
+ probeCommand, thisRef,
+- [&, recordPtr, probeName](FoundDeviceT& foundDevices) {
++ [&, recordPtr, probeName](FoundDeviceInfoT& foundDevices) {
+ _passed = true;
+
+ std::set<nlohmann::json> usedNames;
+@@ -1294,7 +1379,8 @@ void PerformScan::run()
+ for (auto itr = foundDevices.begin();
+ itr != foundDevices.end();)
+ {
+- std::string recordName = getRecordName(*itr, probeName);
++ std::string recordName =
++ getRecordName(std::get<0>(*itr), probeName);
+
+ auto fromLastJson = lastJson.find(recordName);
+ if (fromLastJson != lastJson.end())
+@@ -1328,6 +1414,15 @@ void PerformScan::run()
+ continue;
+ }
+
++ nlohmann::json recordVal = *recordPtr;
++ // Save the dbus connection, path and interface info
++ // of the device
++ recordVal[foundObject]["Connection"] =
++ std::get<1>(*itr);
++ recordVal[foundObject]["Path"] = std::get<2>(*itr);
++ recordVal[foundObject]["Interface"] =
++ std::get<3>(*itr);
++
+ int index = std::stoi(
+ nameIt->get<std::string>().substr(indexIdx),
+ nullptr, 0);
+@@ -1349,8 +1444,9 @@ void PerformScan::run()
+
+ std::optional<std::string> replaceStr;
+
+- for (auto& foundDevice : foundDevices)
++ for (auto& foundDeviceInfo : foundDevices)
+ {
++ auto& foundDevice = std::get<0>(foundDeviceInfo);
+ nlohmann::json record = *recordPtr;
+ std::string recordName =
+ getRecordName(foundDevice, probeName);
+@@ -1382,6 +1478,14 @@ void PerformScan::run()
+ }
+ }
+
++ // Save the dbus connection, path and interface info
++ // of the device
++ record[foundObject]["Connection"] =
++ std::get<1>(foundDeviceInfo);
++ record[foundObject]["Path"] = std::get<2>(foundDeviceInfo);
++ record[foundObject]["Interface"] =
++ std::get<3>(foundDeviceInfo);
++
+ if (replaceStr)
+ {
+ std::cerr << "Duplicates found, replacing "
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend
index 619c2f3d4..94bddf2be 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend
@@ -1,8 +1,10 @@
# this is here just to bump faster than upstream
# SRC_URI = "git://github.com/openbmc/entity-manager.git"
-SRCREV = "2a9670820094a9a1847770597b713bf6fb3c08ba"
+SRCREV = "296667f0076888f3cdf898a3f2cdf66da260853e"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += " file://0001-Improve-initialization-of-I2C-sensors.patch"
+SRC_URI += " file://0001-Improve-initialization-of-I2C-sensors.patch \
+ file://0002-Entity-manager-Add-support-to-update-assetTag.patch \
+ "
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Fix-crash-issue-due-to-throw-undefined-error.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Fix-crash-issue-due-to-throw-undefined-error.patch
deleted file mode 100644
index 98c3873dd..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0034-Fix-crash-issue-due-to-throw-undefined-error.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From df0e7c1414b793a36e34a5875e4196a3a45704a5 Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Mon, 21 Dec 2020 23:09:33 +0800
-Subject: [PATCH] Fix crash issue due to throw undefined error
-
-Below 3 error is used by bios config manager daemon.
-xyz.openbmc_project.Common.Error.InvalidArgument
-xyz.openbmc_project.BIOSConfig.Common.Error.AttributeNotFound
-xyz.openbmc_project.BIOSConfig.Common.Error.AttributeReadOnl
-
-Tested:
-bios config manager daemon could throw these 3 error,
-but not crash any more.
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
----
- xyz/openbmc_project/BIOSConfig/Manager.interface.yaml | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/xyz/openbmc_project/BIOSConfig/Manager.interface.yaml b/xyz/openbmc_project/BIOSConfig/Manager.interface.yaml
-index 225ccaa..98daf3a 100644
---- a/xyz/openbmc_project/BIOSConfig/Manager.interface.yaml
-+++ b/xyz/openbmc_project/BIOSConfig/Manager.interface.yaml
-@@ -109,7 +109,10 @@ properties:
- ex- { {"QuietBoot",Type.Integer, 0x1},
- { "DdrFreqLimit",Type.String,"2933"}
- }
--
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InvalidArgument
-+ - xyz.openbmc_project.BIOSConfig.Common.Error.AttributeNotFound
-+ - xyz.openbmc_project.BIOSConfig.Common.Error.AttributeReadOnly
-
- enumerations:
- - name: AttributeType
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend
index f947b19c0..4cc641eec 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend
@@ -1,7 +1,7 @@
# Keep this as a comment to enable the auto-bump script without
# stomping on SRC_URI from previous .bbappend files
#SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git"
-SRCREV = "6be85da9193d5c529b49fbf9345507e0be2b9477"
+SRCREV = "d01d1f84191894ad605a9ba5b546280bcfc64f7d"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
@@ -18,5 +18,4 @@ SRC_URI += "file://0007-ipmi-set-BIOS-id.patch \
file://0030-Add-PLDM-version-purpose-enumeration.patch \
file://0032-update-meson-build-for-MCTP-interfaces.patch \
file://0033-update-meson-build-for-PLDM-FWU-interfaces.patch \
- file://0034-Fix-crash-issue-due-to-throw-undefined-error.patch \
"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch
index 82ec8431d..cfaa077eb 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch
@@ -1,4 +1,4 @@
-From 05b893222a8586c51e6f66320067f13b2a89dd46 Mon Sep 17 00:00:00 2001
+From df1281792f6886b41c99919e8197c2c2d369d0ca Mon Sep 17 00:00:00 2001
From: Jennifer Lee <jennifer1.lee@intel.com>
Date: Mon, 10 Dec 2018 10:36:44 -0800
Subject: [PATCH] Modified firmware activation to launch fwupd.sh through
@@ -10,7 +10,6 @@ Subject: [PATCH] Modified firmware activation to launch fwupd.sh through
Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
-
---
activation.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++-
meson.build | 1 +
@@ -20,12 +19,12 @@ Signed-off-by: James Feist <james.feist@linux.intel.com>
5 files changed, 91 insertions(+), 9 deletions(-)
diff --git a/activation.cpp b/activation.cpp
-index c82e297..d690a39 100644
+index eb57587..901caf3 100644
--- a/activation.cpp
+++ b/activation.cpp
-@@ -88,7 +88,50 @@ auto Activation::activation(Activations value) -> Activations
-
- if (value == softwareServer::Activation::Activations::Activating)
+@@ -92,7 +92,50 @@ auto Activation::activation(Activations value) -> Activations
+ value ==
+ softwareServer::Activation::Activations::ActivatingAsStandbySpare)
{
+#ifdef FWUPD_SCRIPT
+ if (!activationProgress)
@@ -74,7 +73,7 @@ index c82e297..d690a39 100644
#ifdef HOST_BIOS_UPGRADE
auto purpose = parent.versions.find(versionId)->second->purpose();
if (purpose == VersionPurpose::Host)
-@@ -111,7 +154,6 @@ auto Activation::activation(Activations value) -> Activations
+@@ -115,7 +158,6 @@ auto Activation::activation(Activations value) -> Activations
return softwareServer::Activation::activation(value);
}
#endif
@@ -82,7 +81,7 @@ index c82e297..d690a39 100644
auto versionStr = parent.versions.find(versionId)->second->version();
if (!minimum_ship_level::verify(versionStr))
-@@ -175,6 +217,7 @@ auto Activation::activation(Activations value) -> Activations
+@@ -179,6 +221,7 @@ auto Activation::activation(Activations value) -> Activations
return softwareServer::Activation::activation(
softwareServer::Activation::Activations::Active);
#endif
@@ -91,24 +90,24 @@ index c82e297..d690a39 100644
else
{
diff --git a/meson.build b/meson.build
-index c74a927..0e5f963 100644
+index 0a7a6a6..5990168 100644
--- a/meson.build
+++ b/meson.build
-@@ -54,6 +54,7 @@ conf.set('MMC_LAYOUT', get_option('bmc-layout').contains('mmc'))
- # Configurable features
- conf.set('HOST_BIOS_UPGRADE', get_option('host-bios-upgrade').enabled())
- conf.set('WANT_SIGNATURE_VERIFY', get_option('verify-signature').enabled())
+@@ -57,6 +57,7 @@ conf.set('WANT_SIGNATURE_VERIFY', \
+ get_option('verify-signature').enabled() or \
+ get_option('verify-full-signature').enabled())
+ conf.set('WANT_SIGNATURE_FULL_VERIFY', get_option('verify-full-signature').enabled())
+conf.set('FWUPD_SCRIPT', get_option('fwupd-script').enabled())
# Configurable variables
conf.set('ACTIVE_BMC_MAX_ALLOWED', get_option('active-bmc-max-allowed'))
diff --git a/meson_options.txt b/meson_options.txt
-index d37e681..d86371b 100644
+index 355773c..f0c8730 100644
--- a/meson_options.txt
+++ b/meson_options.txt
-@@ -22,6 +22,9 @@ option('oe-sdk', type: 'feature', description: 'Enable OE SDK')
- option('verify-signature', type: 'feature',
- description: 'Enable image signature validation.')
+@@ -25,6 +25,9 @@ option('verify-signature', type: 'feature',
+ option('verify-full-signature', type: 'feature',
+ description: 'Enable image full signature validation.')
+option('fwupd-script', type: 'feature',
+ description: 'Enable fwupd script support.')
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru.bb
index 53cec437d..da8fc846e 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru.bb
@@ -8,6 +8,7 @@ SYSTEMD_SERVICE_${PN} = "SetBaseboardFru.service"
S = "${WORKDIR}"
SRC_URI = "file://checkFru.sh \
+ file://decodeBoardID.sh \
file://SetBaseboardFru.service \
file://mkfru.cpp \
file://CMakeLists.txt \
@@ -24,6 +25,7 @@ RDEPENDS_${PN} = "bash"
do_install_append() {
install -d ${D}${bindir}
install -m 0755 ${S}/checkFru.sh ${D}/${bindir}/checkFru.sh
+ install -m 0755 ${S}/decodeBoardID.sh ${D}/${bindir}/decodeBoardID.sh
install -d ${D}${base_libdir}/systemd/system
install -m 0644 ${S}/SetBaseboardFru.service ${D}${base_libdir}/systemd/system
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh b/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh
index 9227beb20..18a6c7260 100755
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/checkFru.sh
@@ -5,10 +5,7 @@ FRUPATH="/etc/fru"
PRODIDPATH="/var/cache/private"
fruFile="$FRUPATH/baseboard.fru.bin"
prodIDFile="$PRODIDPATH/prodID"
-
-if [ -f $fruFile -a -f $prodIDFile ]; then
- exit 0
-fi
+source decodeBoardID.sh
read_id() {
local idx=0
@@ -23,48 +20,30 @@ read_id() {
echo $result
}
-BOARD_ID=$(read_id)
-if grep -q 'CPU part\s*: 0xb76' /proc/cpuinfo; then
- # AST2500
- case $BOARD_ID in
- 12) NAME="D50TNP1SB"
- PRODID="0x99";;
- 40) NAME="CooperCity"
- PRODID="0x9d";;
- 42) NAME="WilsonCity"
- PRODID="0x91";;
- 44) NAME="WilsonCityM"
- PRODID="0x91";;
- 45) NAME="WilsonCity"
- PRODID="0x91";;
- 60) NAME="M50CYP2SB2U"
- PRODID="0x98";;
- 62) NAME="WilsonPoint"
- PRODID="0x9a";;
- *) NAME="S2600WFT"
- PRODID="0x7b";;
- esac
-
-elif grep -q 'CPU part\s*: 0xc07' /proc/cpuinfo; then
- # AST2600
- case $BOARD_ID in
- 62) NAME="ArcherCity"
- PRODID="0x9c";;
- *) NAME="AST2600EVB"
- PRODID="0x00";;
- esac
-
+if [ -f $fruFile -a -f $prodIDFile ] &&
+ grep -q 'CPU part\s*: 0xc07' /proc/cpuinfo; then
+ exit 0
fi
-if [ -z "$NAME" ]; then
- NAME="Unknown"
-fi
+NAME="Unknown"
+PRODID="0x00"
+EEPROM_FRU=false
+
+BOARD_ID=$(read_id)
+decode_board_id
if [ ! -e $prodIDFile ]
then
echo $PRODID >$prodIDFile
fi
+if $EEPROM_FRU;
+then
+ # Remove baseboard filesystem FRU(if any), as this platform has EEPROM FRU.
+ rm -f $fruFile
+ exit 0
+fi
+
if [ ! -f $fruFile ]
then
cd /tmp
@@ -73,4 +52,3 @@ then
mv $NAME.fru.bin $fruFile
fi
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh b/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh
new file mode 100644
index 000000000..80710ae26
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fru/default-fru/decodeBoardID.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# this script uses the BOARD_ID set from checkFru.sh and provides the NAME,
+# PRODID, and EEPROM_FRU values for this platform
+decode_board_id() {
+}
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch
new file mode 100644
index 000000000..ec6d70df1
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch
@@ -0,0 +1,25 @@
+From 4af788655c5b5a5fae4d85b365a70dc619810fe0 Mon Sep 17 00:00:00 2001
+From: Karol Wachowski <karol.wachowski@intel.com>
+Date: Thu, 11 Feb 2021 08:35:41 +0000
+Subject: [PATCH] Add ConnectedVia property to virtual media item template
+
+Tested: Verified that ConnectedVia property is returned and set to
+ "NotConnected" for disconnected media.
+
+Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
+---
+ redfish-core/lib/virtual_media.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
+index 188248a..80e7315 100644
+--- a/redfish-core/lib/virtual_media.hpp
++++ b/redfish-core/lib/virtual_media.hpp
+@@ -192,6 +192,7 @@ static nlohmann::json vmItemTemplate(const std::string& name,
+ item["@odata.id"] =
+ "/redfish/v1/Managers/" + name + "/VirtualMedia/" + resName;
+ item["@odata.type"] = "#VirtualMedia.v1_3_0.VirtualMedia";
++ item["ConnectedVia"] = "NotConnected";
+ item["Name"] = "Virtual Removable Media";
+ item["Id"] = resName;
+ item["WriteProtected"] = true;
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Firmware-update-configuration-changes.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Firmware-update-configuration-changes.patch
index a802095d5..193461baf 100755
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Firmware-update-configuration-changes.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0001-Firmware-update-configuration-changes.patch
@@ -1,4 +1,4 @@
-From b831fbaf5c3ca346d2e701b021307ba219ca2ef8 Mon Sep 17 00:00:00 2001
+From 10cb7cb14974725a29b3ead4c543ca5e58234c07 Mon Sep 17 00:00:00 2001
From: Vikram Bodireddy <vikram.bodireddy@intel.com>
Date: Wed, 18 Nov 2020 17:14:41 +0530
Subject: [PATCH] Firmware update configuration changes
@@ -55,7 +55,7 @@ Signed-off-by: Helen Huang <he.huang@intel.com>
create mode 100644 static/redfish/v1/schema/OemUpdateService_v1.xml
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
-index 9e382ce..7dff5c9 100644
+index 6d44171..8eda265 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -32,6 +32,17 @@ static std::unique_ptr<sdbusplus::bus::match::match> fwUpdateErrorMatcher;
@@ -287,7 +287,7 @@ index 9e382ce..7dff5c9 100644
// Setup callback for when new software detected
// Give TFTP 10 minutes to complete
monitorForSoftwareAvailable(
- nullptr, req,
+ asyncResp, req,
"/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate",
- 600);
+ httpUriTargets, 600);
@@ -557,10 +557,10 @@ index 9e382ce..7dff5c9 100644
};
diff --git a/static/redfish/v1/$metadata/index.xml b/static/redfish/v1/$metadata/index.xml
-index e7f9d6d..bedc9e5 100644
+index 514f3dd..c068d4f 100644
--- a/static/redfish/v1/$metadata/index.xml
+++ b/static/redfish/v1/$metadata/index.xml
-@@ -2700,6 +2700,9 @@
+@@ -2142,6 +2142,9 @@
<edmx:Reference Uri="/redfish/v1/schema/OemManager_v1.xml">
<edmx:Include Namespace="OemManager"/>
</edmx:Reference>
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch
new file mode 100644
index 000000000..d04220b89
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch
@@ -0,0 +1,30 @@
+From dcc94627aac5b8e4ad181c8548391c53d27b8896 Mon Sep 17 00:00:00 2001
+From: Karol Wachowski <karol.wachowski@intel.com>
+Date: Tue, 16 Feb 2021 06:47:11 +0000
+Subject: [PATCH] Change InsertMedia action response for POST in proxy mode
+
+Set boost::beast::http::status::method_not_allowed as a response
+for POST request to Virtual Media Insert Media action to keep
+consistency with other non existing requests.
+---
+ redfish-core/lib/virtual_media.hpp | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
+index 80e7315..76e8c4a 100644
+--- a/redfish-core/lib/virtual_media.hpp
++++ b/redfish-core/lib/virtual_media.hpp
+@@ -611,10 +611,9 @@ class VirtualMediaActionInsertMedia : public Node
+ // Not possible in proxy mode
+ BMCWEB_LOG_DEBUG << "InsertMedia not "
+ "allowed in proxy mode";
+- messages::resourceNotFound(
+- aResp->res, "VirtualMedia.InsertMedia",
+- resName);
+-
++ aResp->res.result(
++ boost::beast::http::status::
++ method_not_allowed);
+ return;
+ }
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch
new file mode 100644
index 000000000..eaba041d5
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch
@@ -0,0 +1,40 @@
+From dab4adbf211b6867f86fcf6080b34a0e41f6f4a1 Mon Sep 17 00:00:00 2001
+From: Karol Wachowski <karol.wachowski@intel.com>
+Date: Tue, 23 Feb 2021 15:53:16 +0000
+Subject: [PATCH] Set Inserted redfish property for not inserted resources
+
+Tested: Verified that Inserted property is returned and set to
+ "false" for not inserted media.
+Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
+---
+ redfish-core/lib/virtual_media.hpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
+index 188248a..f477f63 100644
+--- a/redfish-core/lib/virtual_media.hpp
++++ b/redfish-core/lib/virtual_media.hpp
+@@ -95,6 +95,7 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface,
+ BMCWEB_LOG_DEBUG << "Value Active not found";
+ return;
+ }
++ aResp->res.jsonValue["Inserted"] = *activeValue;
+
+ const std::string* endpointIdValue =
+ std::get_if<std::string>(&endpointIdProperty->second);
+@@ -106,7 +107,6 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface,
+ aResp->res.jsonValue["Oem"]["OpenBMC"]["WebSocketEndpoint"] =
+ *endpointIdValue;
+ aResp->res.jsonValue["TransferProtocolType"] = "OEM";
+- aResp->res.jsonValue["Inserted"] = *activeValue;
+ if (*activeValue == true)
+ {
+ aResp->res.jsonValue["ConnectedVia"] = "Applet";
+@@ -137,7 +137,6 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface,
+ }
+
+ aResp->res.jsonValue["Image"] = *imageUrlValue;
+- aResp->res.jsonValue["Inserted"] = *activeValue;
+ aResp->res.jsonValue["TransferProtocolType"] =
+ getTransferProtocolTypeFromUri(*imageUrlValue);
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-Fix-wrong-check-in-EventService-events.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-Fix-wrong-check-in-EventService-events.patch
deleted file mode 100644
index 115a48112..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-Fix-wrong-check-in-EventService-events.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 6a9f85f9050e2c0f38148e295d7e25f56d05c6de Mon Sep 17 00:00:00 2001
-From: AppaRao Puli <apparao.puli@linux.intel.com>
-Date: Mon, 1 Feb 2021 23:45:53 +0000
-Subject: [PATCH] Fix wrong check in EventService events
-
-Sending async event logs to event listener is
-broken due to commit 23a21a1cbed23ace4174664950e595df961e9e69.
-Correct the check to make EventService back to functional
-state.
-
-Tested:
- - Redfish event logs are properly sent to subscribers.
-
-Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
-Change-Id: If232846a2b0ac694205731a801e55dc4bd5e928a
----
- redfish-core/include/event_service_manager.hpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
-index 54dafb4..3db9f0c 100644
---- a/redfish-core/include/event_service_manager.hpp
-+++ b/redfish-core/include/event_service_manager.hpp
-@@ -1208,7 +1208,7 @@ class EventServiceManager
-
- static void watchRedfishEventLogFile()
- {
-- if (inotifyConn)
-+ if (!inotifyConn)
- {
- return;
- }
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Add-state-sensor-messages-to-the-registry.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Add-state-sensor-messages-to-the-registry.patch
new file mode 100644
index 000000000..b171a8b2c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Add-state-sensor-messages-to-the-registry.patch
@@ -0,0 +1,98 @@
+From df571ddf0596f73c0318da3a90b9813e6df19dd9 Mon Sep 17 00:00:00 2001
+From: "Arun P. Mohanan" <arun.p.m@linux.intel.com>
+Date: Wed, 27 Jan 2021 18:22:58 +0530
+Subject: [PATCH] Add state sensor messages to the registry
+
+Add messages to registry to indicate state sensor state change.
+
+Tested:
+Build and redfish validator passes.
+Logged these events and confirmed that they appear as expected on
+Redfish.
+GET: https://<BMC IP>/redfish/v1/Systems/system/LogServices/EventLog/Entries/1612528180
+{
+ "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1612528180",
+ "@odata.type": "#LogEntry.v1_4_0.LogEntry",
+ "Created": "2021-02-05T12:29:40+00:00",
+ "EntryType": "Event",
+ "Id": "1612528180",
+ "Message": "Operational Fault Status of Card_health_1 state sensor changed from Error to Normal.",
+ "MessageArgs": [
+ "Operational Fault Status",
+ "Card_health_1",
+ "Error",
+ "Normal"
+ ],
+ "MessageId": "OpenBMC.0.1.StateSensorNormal",
+ "Name": "System Event Log Entry",
+ "Severity": "OK"
+}
+
+Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
+---
+ .../registries/openbmc_message_registry.hpp | 36 +++++++++++++++++--
+ 1 file changed, 34 insertions(+), 2 deletions(-)
+
+diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp
+index 5eb9380..dbea97c 100644
+--- a/redfish-core/include/registries/openbmc_message_registry.hpp
++++ b/redfish-core/include/registries/openbmc_message_registry.hpp
+@@ -29,7 +29,7 @@ const Header header = {
+ "0.1.0",
+ "OpenBMC",
+ };
+-constexpr std::array<MessageEntry, 187> registry = {
++constexpr std::array<MessageEntry, 190> registry = {
+ MessageEntry{
+ "ADDDCCorrectable",
+ {
+@@ -2318,6 +2318,39 @@ constexpr std::array<MessageEntry, 187> registry = {
+ {},
+ "None.",
+ }},
++ MessageEntry{
++ "StateSensorNormal",
++ {
++ "Indicates that a state sensor has changed state to normal.",
++ "%1 of %2 state sensor changed from %3 to %4.",
++ "OK",
++ "OK",
++ 4,
++ {"string", "string", "string", "string"},
++ "None.",
++ }},
++ MessageEntry{
++ "StateSensorWarning",
++ {
++ "Indicates that a state sensor has changed state to warning.",
++ "%1 of %2 state sensor changed from %3 to %4.",
++ "Warning",
++ "Warning",
++ 4,
++ {"string", "string", "string", "string"},
++ "Check sensor subsystem for errors.",
++ }},
++ MessageEntry{
++ "StateSensorCritical",
++ {
++ "Indicates that a state sensor has changed state to critical.",
++ "%1 of %2 state sensor changed from %3 to %4.",
++ "Critical",
++ "Critical",
++ 4,
++ {"string", "string", "string", "string"},
++ "Check sensor subsystem for errors.",
++ }},
+ MessageEntry{"SystemInterfaceDisabledProvisioned",
+ {
+ "Indicates that the system interface is in the disabled "
+@@ -2410,6 +2443,5 @@ constexpr std::array<MessageEntry, 187> registry = {
+ {"string"},
+ "None.",
+ }},
+-
+ };
+ } // namespace redfish::message_registries::openbmc
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Redfish-TelemetryService-schema-implementation.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Redfish-TelemetryService-schema-implementation.patch
deleted file mode 100644
index 208831338..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Redfish-TelemetryService-schema-implementation.patch
+++ /dev/null
@@ -1,717 +0,0 @@
-From d50e4ce193703c008d3293acd03e1c0542c0c215 Mon Sep 17 00:00:00 2001
-From: "Wludzik, Jozef" <jozef.wludzik@intel.com>
-Date: Mon, 27 Apr 2020 17:24:15 +0200
-Subject: [PATCH] Redfish TelemetryService schema implementation
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Added TelemetryService, MetricReports, MetricReportCollection,
-MetricReportDefinition and MetricReportDefinitionCollection schemas
-with GET method support. Added TelemetryService URI to root service.
-Implemented communication with backend - Telemetry.
-Added schemes attributes that are supported by Telemetry service
-design. User is able to fetch basic information about reports if
-Telemetry service is present in OpenBMC.
-Added util function that converts decimal value into duration format
-that is described by ISO 8601 and Redfish specification.
-
-Tested:
- - Succesfully passed RedfishServiceValidator.py
- - Verified DBus method calls to Telemetry service
- - Verified all possible pages that are displayed to user when:
- - Reports are fully defined in Telemetry
- - Reports are partially available in Telemetry
- - Telemetry is disabled
- - Verified time_utils::toDurationString() output
-
-Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
-Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
-Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
-Change-Id: Ie6b0b49f4ef5eeaef07d1209b6c349270c04d570
----
- redfish-core/include/redfish.hpp | 10 +
- .../include/utils/telemetry_utils.hpp | 71 +++++++
- redfish-core/include/utils/time_utils.hpp | 78 ++++++++
- redfish-core/lib/metric_report.hpp | 162 +++++++++++++++
- redfish-core/lib/metric_report_definition.hpp | 186 ++++++++++++++++++
- redfish-core/lib/service_root.hpp | 2 +
- redfish-core/lib/telemetry_service.hpp | 93 +++++++++
- 7 files changed, 602 insertions(+)
- create mode 100644 redfish-core/include/utils/telemetry_utils.hpp
- create mode 100644 redfish-core/include/utils/time_utils.hpp
- create mode 100644 redfish-core/lib/metric_report.hpp
- create mode 100644 redfish-core/lib/metric_report_definition.hpp
- create mode 100644 redfish-core/lib/telemetry_service.hpp
-
-diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
-index dabf78e..b366e24 100644
---- a/redfish-core/include/redfish.hpp
-+++ b/redfish-core/include/redfish.hpp
-@@ -25,6 +25,8 @@
- #include "../lib/managers.hpp"
- #include "../lib/memory.hpp"
- #include "../lib/message_registries.hpp"
-+#include "../lib/metric_report.hpp"
-+#include "../lib/metric_report_definition.hpp"
- #include "../lib/network_protocol.hpp"
- #include "../lib/pcie.hpp"
- #include "../lib/power.hpp"
-@@ -36,6 +38,7 @@
- #include "../lib/storage.hpp"
- #include "../lib/systems.hpp"
- #include "../lib/task.hpp"
-+#include "../lib/telemetry_service.hpp"
- #include "../lib/thermal.hpp"
- #include "../lib/update_service.hpp"
- #ifdef BMCWEB_ENABLE_VM_NBDPROXY
-@@ -212,6 +215,13 @@ class RedfishService
- nodes.emplace_back(std::make_unique<HypervisorInterface>(app));
- nodes.emplace_back(std::make_unique<HypervisorSystem>(app));
-
-+ nodes.emplace_back(std::make_unique<TelemetryService>(app));
-+ nodes.emplace_back(
-+ std::make_unique<MetricReportDefinitionCollection>(app));
-+ nodes.emplace_back(std::make_unique<MetricReportDefinition>(app));
-+ nodes.emplace_back(std::make_unique<MetricReportCollection>(app));
-+ nodes.emplace_back(std::make_unique<MetricReport>(app));
-+
- for (const auto& node : nodes)
- {
- node->initPrivileges();
-diff --git a/redfish-core/include/utils/telemetry_utils.hpp b/redfish-core/include/utils/telemetry_utils.hpp
-new file mode 100644
-index 0000000..8caee2d
---- /dev/null
-+++ b/redfish-core/include/utils/telemetry_utils.hpp
-@@ -0,0 +1,71 @@
-+#pragma once
-+
-+namespace redfish
-+{
-+
-+namespace telemetry
-+{
-+
-+constexpr const char* service = "xyz.openbmc_project.Telemetry";
-+constexpr const char* reportInterface = "xyz.openbmc_project.Telemetry.Report";
-+constexpr const char* metricReportDefinitionUri =
-+ "/redfish/v1/TelemetryService/MetricReportDefinitions/";
-+constexpr const char* metricReportUri =
-+ "/redfish/v1/TelemetryService/MetricReports/";
-+
-+inline void getReportCollection(const std::shared_ptr<AsyncResp>& asyncResp,
-+ const std::string& uri)
-+{
-+ const std::array<const char*, 1> interfaces = {reportInterface};
-+
-+ crow::connections::systemBus->async_method_call(
-+ [asyncResp, uri](const boost::system::error_code ec,
-+ const std::vector<std::string>& reportPaths) {
-+ if (ec)
-+ {
-+ asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-+ asyncResp->res.jsonValue["Members@odata.count"] = 0;
-+ return;
-+ }
-+
-+ nlohmann::json& members = asyncResp->res.jsonValue["Members"];
-+ members = nlohmann::json::array();
-+
-+ for (const std::string& path : reportPaths)
-+ {
-+ std::size_t pos = path.rfind('/');
-+ if (pos == std::string::npos)
-+ {
-+ BMCWEB_LOG_ERROR << "Failed to find '/' in " << path;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+ if (path.size() <= (pos + 1))
-+ {
-+ BMCWEB_LOG_ERROR << "Failed to parse path " << path;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ members.push_back({{"@odata.id", uri + path.substr(pos + 1)}});
-+ }
-+
-+ asyncResp->res.jsonValue["Members@odata.count"] = members.size();
-+ },
-+ "xyz.openbmc_project.ObjectMapper",
-+ "/xyz/openbmc_project/object_mapper",
-+ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths",
-+ "/xyz/openbmc_project/Telemetry/Reports/TelemetryService", 1,
-+ interfaces);
-+}
-+
-+inline std::string getDbusReportPath(const std::string& id)
-+{
-+ std::string path =
-+ "/xyz/openbmc_project/Telemetry/Reports/TelemetryService/" + id;
-+ dbus::utility::escapePathForDbus(path);
-+ return path;
-+}
-+
-+} // namespace telemetry
-+} // namespace redfish
-diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp
-new file mode 100644
-index 0000000..dd4ea75
---- /dev/null
-+++ b/redfish-core/include/utils/time_utils.hpp
-@@ -0,0 +1,78 @@
-+#pragma once
-+
-+#include <chrono>
-+#include <string>
-+
-+namespace redfish
-+{
-+
-+namespace time_utils
-+{
-+
-+namespace details
-+{
-+
-+inline void leftZeroPadding(std::string& str, const std::size_t padding)
-+{
-+ if (str.size() < padding)
-+ {
-+ str.insert(0, padding - str.size(), '0');
-+ }
-+}
-+} // namespace details
-+
-+/**
-+ * @brief Convert time value into duration format that is based on ISO 8601.
-+ * Example output: "P12DT1M5.5S"
-+ * Ref: Redfish Specification, Section 9.4.4. Duration values
-+ */
-+std::string toDurationString(std::chrono::milliseconds ms)
-+{
-+ if (ms < std::chrono::milliseconds::zero())
-+ {
-+ return "";
-+ }
-+
-+ std::string fmt;
-+ fmt.reserve(sizeof("PxxxxxxxxxxxxDTxxHxxMxx.xxxxxxS"));
-+
-+ using Days = std::chrono::duration<long, std::ratio<24 * 60 * 60>>;
-+ Days days = std::chrono::floor<Days>(ms);
-+ ms -= days;
-+
-+ std::chrono::hours hours = std::chrono::floor<std::chrono::hours>(ms);
-+ ms -= hours;
-+
-+ std::chrono::minutes minutes = std::chrono::floor<std::chrono::minutes>(ms);
-+ ms -= minutes;
-+
-+ std::chrono::seconds seconds = std::chrono::floor<std::chrono::seconds>(ms);
-+ ms -= seconds;
-+
-+ fmt = "P";
-+ if (days.count() > 0)
-+ {
-+ fmt += std::to_string(days.count()) + "D";
-+ }
-+ fmt += "T";
-+ if (hours.count() > 0)
-+ {
-+ fmt += std::to_string(hours.count()) + "H";
-+ }
-+ if (minutes.count() > 0)
-+ {
-+ fmt += std::to_string(minutes.count()) + "M";
-+ }
-+ if (seconds.count() != 0 || ms.count() != 0)
-+ {
-+ fmt += std::to_string(seconds.count()) + ".";
-+ std::string msStr = std::to_string(ms.count());
-+ details::leftZeroPadding(msStr, 3);
-+ fmt += msStr + "S";
-+ }
-+
-+ return fmt;
-+}
-+
-+} // namespace time_utils
-+} // namespace redfish
-diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp
-new file mode 100644
-index 0000000..050304c
---- /dev/null
-+++ b/redfish-core/lib/metric_report.hpp
-@@ -0,0 +1,162 @@
-+#pragma once
-+
-+#include "node.hpp"
-+#include "utils/telemetry_utils.hpp"
-+
-+namespace redfish
-+{
-+
-+class MetricReportCollection : public Node
-+{
-+ public:
-+ MetricReportCollection(App& app) :
-+ Node(app, "/redfish/v1/TelemetryService/MetricReports/")
-+ {
-+ entityPrivileges = {
-+ {boost::beast::http::verb::get, {{"Login"}}},
-+ {boost::beast::http::verb::head, {{"Login"}}},
-+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
-+ }
-+
-+ private:
-+ void doGet(crow::Response& res, const crow::Request&,
-+ const std::vector<std::string>&) override
-+ {
-+ res.jsonValue["@odata.type"] =
-+ "#MetricReportCollection.MetricReportCollection";
-+ res.jsonValue["@odata.id"] =
-+ "/redfish/v1/TelemetryService/MetricReports";
-+ res.jsonValue["Name"] = "Metric Report Collection";
-+
-+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+ telemetry::getReportCollection(asyncResp, telemetry::metricReportUri);
-+ }
-+};
-+
-+class MetricReport : public Node
-+{
-+ public:
-+ MetricReport(App& app) :
-+ Node(app, "/redfish/v1/TelemetryService/MetricReports/<str>/",
-+ std::string())
-+ {
-+ entityPrivileges = {
-+ {boost::beast::http::verb::get, {{"Login"}}},
-+ {boost::beast::http::verb::head, {{"Login"}}},
-+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
-+ }
-+
-+ private:
-+ void doGet(crow::Response& res, const crow::Request&,
-+ const std::vector<std::string>& params) override
-+ {
-+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+
-+ if (params.size() != 1)
-+ {
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ const std::string& id = params[0];
-+ const std::string reportPath = telemetry::getDbusReportPath(id);
-+
-+ crow::connections::systemBus->async_method_call(
-+ [asyncResp, id, reportPath](const boost::system::error_code& ec) {
-+ if (ec.value() == EBADR)
-+ {
-+ messages::resourceNotFound(asyncResp->res, schemaType, id);
-+ return;
-+ }
-+ if (ec)
-+ {
-+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ crow::connections::systemBus->async_method_call(
-+ [asyncResp,
-+ id](const boost::system::error_code ec,
-+ const std::variant<TimestampReadings>& ret) {
-+ if (ec)
-+ {
-+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ fillReport(asyncResp, id, ret);
-+ },
-+ telemetry::service, reportPath,
-+ "org.freedesktop.DBus.Properties", "Get",
-+ telemetry::reportInterface, "Readings");
-+ },
-+ telemetry::service, reportPath, telemetry::reportInterface,
-+ "Update");
-+ }
-+
-+ using Readings =
-+ std::vector<std::tuple<std::string, std::string, double, uint64_t>>;
-+ using TimestampReadings = std::tuple<uint64_t, Readings>;
-+
-+ static nlohmann::json toMetricValues(const Readings& readings)
-+ {
-+ nlohmann::json metricValues = nlohmann::json::array_t();
-+
-+ for (auto& [id, metadata, sensorValue, timestamp] : readings)
-+ {
-+ nlohmann::json metadataJson = nlohmann::json::parse(metadata);
-+ metricValues.push_back({
-+ {"MetricId", id},
-+ {"MetricDefinition", metadataJson.contains("MetricDefinition")
-+ ? metadataJson["MetricDefinition"]
-+ : nlohmann::json()},
-+ {"MetricProperty", metadataJson.contains("MetricProperty")
-+ ? metadataJson["MetricProperty"]
-+ : nlohmann::json()},
-+ {"MetricValue", std::to_string(sensorValue)},
-+ {"Timestamp",
-+ crow::utility::getDateTime(static_cast<time_t>(timestamp))},
-+ });
-+ }
-+
-+ return metricValues;
-+ }
-+
-+ static void fillReport(const std::shared_ptr<AsyncResp>& asyncResp,
-+ const std::string& id,
-+ const std::variant<TimestampReadings>& var)
-+ {
-+ asyncResp->res.jsonValue["@odata.type"] = schemaType;
-+ asyncResp->res.jsonValue["@odata.id"] = telemetry::metricReportUri + id;
-+ asyncResp->res.jsonValue["Id"] = id;
-+ asyncResp->res.jsonValue["Name"] = id;
-+ asyncResp->res.jsonValue["MetricReportDefinition"]["@odata.id"] =
-+ telemetry::metricReportDefinitionUri + id;
-+
-+ const TimestampReadings* timestampReadings =
-+ std::get_if<TimestampReadings>(&var);
-+ if (!timestampReadings)
-+ {
-+ BMCWEB_LOG_ERROR << "Property type mismatch or property is missing";
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ const auto& [timestamp, readings] = *timestampReadings;
-+ asyncResp->res.jsonValue["Timestamp"] =
-+ crow::utility::getDateTime(static_cast<time_t>(timestamp));
-+ asyncResp->res.jsonValue["MetricValues"] = toMetricValues(readings);
-+ }
-+
-+ static constexpr const char* schemaType =
-+ "#MetricReport.v1_3_0.MetricReport";
-+};
-+} // namespace redfish
-diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
-new file mode 100644
-index 0000000..48c56e6
---- /dev/null
-+++ b/redfish-core/lib/metric_report_definition.hpp
-@@ -0,0 +1,186 @@
-+#pragma once
-+
-+#include "node.hpp"
-+#include "utils/telemetry_utils.hpp"
-+#include "utils/time_utils.hpp"
-+
-+#include <tuple>
-+#include <variant>
-+
-+namespace redfish
-+{
-+
-+class MetricReportDefinitionCollection : public Node
-+{
-+ public:
-+ MetricReportDefinitionCollection(App& app) :
-+ Node(app, "/redfish/v1/TelemetryService/MetricReportDefinitions/")
-+ {
-+ entityPrivileges = {
-+ {boost::beast::http::verb::get, {{"Login"}}},
-+ {boost::beast::http::verb::head, {{"Login"}}},
-+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
-+ }
-+
-+ private:
-+ void doGet(crow::Response& res, const crow::Request&,
-+ const std::vector<std::string>&) override
-+ {
-+ res.jsonValue["@odata.type"] = "#MetricReportDefinitionCollection."
-+ "MetricReportDefinitionCollection";
-+ res.jsonValue["@odata.id"] =
-+ "/redfish/v1/TelemetryService/MetricReportDefinitions";
-+ res.jsonValue["Name"] = "Metric Definition Collection";
-+
-+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+ telemetry::getReportCollection(asyncResp,
-+ telemetry::metricReportDefinitionUri);
-+ }
-+};
-+
-+class MetricReportDefinition : public Node
-+{
-+ public:
-+ MetricReportDefinition(App& app) :
-+ Node(app, "/redfish/v1/TelemetryService/MetricReportDefinitions/<str>/",
-+ std::string())
-+ {
-+ entityPrivileges = {
-+ {boost::beast::http::verb::get, {{"Login"}}},
-+ {boost::beast::http::verb::head, {{"Login"}}},
-+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
-+ }
-+
-+ private:
-+ void doGet(crow::Response& res, const crow::Request&,
-+ const std::vector<std::string>& params) override
-+ {
-+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+
-+ if (params.size() != 1)
-+ {
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ const std::string& id = params[0];
-+ crow::connections::systemBus->async_method_call(
-+ [asyncResp,
-+ id](const boost::system::error_code ec,
-+ const std::vector<std::pair<
-+ std::string, std::variant<bool, ReadingParameters,
-+ std::string, uint64_t>>>& ret) {
-+ if (ec.value() == EBADR)
-+ {
-+ messages::resourceNotFound(asyncResp->res, schemaType, id);
-+ return;
-+ }
-+ if (ec)
-+ {
-+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ fillReportDefinition(asyncResp, id, ret);
-+ },
-+ telemetry::service, telemetry::getDbusReportPath(id),
-+ "org.freedesktop.DBus.Properties", "GetAll",
-+ telemetry::reportInterface);
-+ }
-+
-+ using ReadingParameters =
-+ std::vector<std::tuple<std::vector<sdbusplus::message::object_path>,
-+ std::string, std::string, std::string>>;
-+
-+ static void fillReportDefinition(
-+ const std::shared_ptr<AsyncResp>& asyncResp, const std::string& id,
-+ const std::vector<
-+ std::pair<std::string, std::variant<bool, ReadingParameters,
-+ std::string, uint64_t>>>& ret)
-+ {
-+ asyncResp->res.jsonValue["@odata.type"] = schemaType;
-+ asyncResp->res.jsonValue["@odata.id"] =
-+ telemetry::metricReportDefinitionUri + id;
-+ asyncResp->res.jsonValue["Id"] = id;
-+ asyncResp->res.jsonValue["Name"] = id;
-+ asyncResp->res.jsonValue["MetricReport"]["@odata.id"] =
-+ telemetry::metricReportUri + id;
-+ asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
-+ asyncResp->res.jsonValue["ReportUpdates"] = "Overwrite";
-+
-+ const bool* emitsReadingsUpdate = nullptr;
-+ const bool* logToMetricReportsCollection = nullptr;
-+ const ReadingParameters* readingParams = nullptr;
-+ const std::string* reportingType = nullptr;
-+ const uint64_t* interval = nullptr;
-+ for (const auto& [key, var] : ret)
-+ {
-+ if (key == "EmitsReadingsUpdate")
-+ {
-+ emitsReadingsUpdate = std::get_if<bool>(&var);
-+ }
-+ else if (key == "LogToMetricReportsCollection")
-+ {
-+ logToMetricReportsCollection = std::get_if<bool>(&var);
-+ }
-+ else if (key == "ReadingParameters")
-+ {
-+ readingParams = std::get_if<ReadingParameters>(&var);
-+ }
-+ else if (key == "ReportingType")
-+ {
-+ reportingType = std::get_if<std::string>(&var);
-+ }
-+ else if (key == "Interval")
-+ {
-+ interval = std::get_if<uint64_t>(&var);
-+ }
-+ }
-+ if (!emitsReadingsUpdate || !logToMetricReportsCollection ||
-+ !readingParams || !reportingType || !interval)
-+ {
-+ BMCWEB_LOG_ERROR << "Property type mismatch or property is missing";
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ std::vector<std::string> redfishReportActions;
-+ redfishReportActions.reserve(2);
-+ if (*emitsReadingsUpdate)
-+ {
-+ redfishReportActions.emplace_back("RedfishEvent");
-+ }
-+ if (*logToMetricReportsCollection)
-+ {
-+ redfishReportActions.emplace_back("LogToMetricReportsCollection");
-+ }
-+
-+ nlohmann::json metrics = nlohmann::json::array();
-+ for (auto& [sensorPaths, operationType, id, metadata] : *readingParams)
-+ {
-+ nlohmann::json metadataJson = nlohmann::json::parse(metadata);
-+ metrics.push_back({
-+ {"MetricId", id},
-+ {"MetricProperties", metadataJson.contains("MetricProperties")
-+ ? metadataJson["MetricProperties"]
-+ : nlohmann::json()},
-+ });
-+ }
-+ asyncResp->res.jsonValue["Metrics"] = metrics;
-+ asyncResp->res.jsonValue["MetricReportDefinitionType"] = *reportingType;
-+ asyncResp->res.jsonValue["ReportActions"] = redfishReportActions;
-+ asyncResp->res.jsonValue["Schedule"]["RecurrenceInterval"] =
-+ time_utils::toDurationString(std::chrono::milliseconds(*interval));
-+ }
-+
-+ static constexpr const char* schemaType =
-+ "#MetricReportDefinition.v1_3_0.MetricReportDefinition";
-+};
-+} // namespace redfish
-diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
-index 629280c..3df5ec5 100644
---- a/redfish-core/lib/service_root.hpp
-+++ b/redfish-core/lib/service_root.hpp
-@@ -68,6 +68,8 @@ class ServiceRoot : public Node
- res.jsonValue["Tasks"] = {{"@odata.id", "/redfish/v1/TaskService"}};
- res.jsonValue["EventService"] = {
- {"@odata.id", "/redfish/v1/EventService"}};
-+ res.jsonValue["TelemetryService"] = {
-+ {"@odata.id", "/redfish/v1/TelemetryService"}};
- res.end();
- }
-
-diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
-new file mode 100644
-index 0000000..a6acc34
---- /dev/null
-+++ b/redfish-core/lib/telemetry_service.hpp
-@@ -0,0 +1,93 @@
-+#pragma once
-+
-+#include "node.hpp"
-+#include "utils/telemetry_utils.hpp"
-+
-+#include <variant>
-+
-+namespace redfish
-+{
-+
-+class TelemetryService : public Node
-+{
-+ public:
-+ TelemetryService(App& app) : Node(app, "/redfish/v1/TelemetryService/")
-+ {
-+ entityPrivileges = {
-+ {boost::beast::http::verb::get, {{"Login"}}},
-+ {boost::beast::http::verb::head, {{"Login"}}},
-+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
-+ {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
-+ }
-+
-+ private:
-+ void doGet(crow::Response& res, const crow::Request&,
-+ const std::vector<std::string>&) override
-+ {
-+ res.jsonValue["@odata.type"] =
-+ "#TelemetryService.v1_2_1.TelemetryService";
-+ res.jsonValue["@odata.id"] = "/redfish/v1/TelemetryService";
-+ res.jsonValue["Id"] = "TelemetryService";
-+ res.jsonValue["Name"] = "Telemetry Service";
-+
-+ res.jsonValue["LogService"]["@odata.id"] =
-+ "/redfish/v1/Managers/bmc/LogServices/Journal";
-+ res.jsonValue["MetricReportDefinitions"]["@odata.id"] =
-+ "/redfish/v1/TelemetryService/MetricReportDefinitions";
-+ res.jsonValue["MetricReports"]["@odata.id"] =
-+ "/redfish/v1/TelemetryService/MetricReports";
-+
-+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+ crow::connections::systemBus->async_method_call(
-+ [asyncResp](
-+ const boost::system::error_code ec,
-+ const std::vector<std::pair<
-+ std::string, std::variant<uint32_t, uint64_t>>>& ret) {
-+ if (ec == boost::system::errc::host_unreachable)
-+ {
-+ asyncResp->res.jsonValue["Status"]["State"] = "Absent";
-+ return;
-+ }
-+ if (ec)
-+ {
-+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
-+
-+ const size_t* maxReports = nullptr;
-+ const uint64_t* minInterval = nullptr;
-+ for (const auto& [key, var] : ret)
-+ {
-+ if (key == "MaxReports")
-+ {
-+ maxReports = std::get_if<size_t>(&var);
-+ }
-+ else if (key == "MinInterval")
-+ {
-+ minInterval = std::get_if<uint64_t>(&var);
-+ }
-+ }
-+ if (!maxReports || !minInterval)
-+ {
-+ BMCWEB_LOG_ERROR
-+ << "Property type mismatch or property is missing";
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ asyncResp->res.jsonValue["MaxReports"] = *maxReports;
-+ asyncResp->res.jsonValue["MinCollectionInterval"] =
-+ time_utils::toDurationString(std::chrono::milliseconds(
-+ static_cast<time_t>(*minInterval)));
-+ },
-+ telemetry::service, "/xyz/openbmc_project/Telemetry/Reports",
-+ "org.freedesktop.DBus.Properties", "GetAll",
-+ "xyz.openbmc_project.Telemetry.ReportManager");
-+ }
-+};
-+} // namespace redfish
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch
index f40058ad8..fd7e8a445 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch
@@ -1,7 +1,7 @@
-From 433358330c7f7d2fba99f6e488d67b314224317f Mon Sep 17 00:00:00 2001
+From bc1635622e122f307fb3b8eb9bbd66ea576a8f0c Mon Sep 17 00:00:00 2001
From: "Wludzik, Jozef" <jozef.wludzik@intel.com>
Date: Mon, 18 May 2020 11:56:57 +0200
-Subject: [PATCH] Add POST and DELETE in MetricReportDefinitions
+Subject: [PATCH 2/4] Add POST and DELETE in MetricReportDefinitions
Added POST action in MetricReportDefinitions node to allow user
to add new MetricReportDefinition. Using minimal set of
@@ -12,64 +12,62 @@ Added DELETE request in MetricReportDefinitions node to allow user
to remove report from Telemetry.
Added conversion from string that represents duration format into
its numeric equivalent.
+Added unit tests for conversion from and to Duration format.
Tested:
- - Succesfully passed RedfishServiceValidator.py
- - Validated good cases with different parameters for POST action
- - Validated bad cases with different parameters for POST action
- - Verified time_utils::fromDurationString()
+ - Tested using witherspoon image on QEMU
+ - Verified POST action in different cases:
+ - all parameters are provided, new report is added to collection
+ - some parameters are missing or invalid, user gets response with
+ description of the issue
- Verified that reports are removed on DELETE request
+ - Verified that on invalid DELETE request user receives response
+ with error
+ - Verified time_utils::fromDurationString()
+ - Succesfully passed RedfishServiceValidator.py
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I2fed96848594451e22fde686f8c066d7770cc65a
---
- .../include/utils/telemetry_utils.hpp | 5 +-
- redfish-core/include/utils/time_utils.hpp | 145 ++++++-
- redfish-core/lib/metric_report_definition.hpp | 382 +++++++++++++++++-
- 3 files changed, 516 insertions(+), 16 deletions(-)
+ meson.build | 1 +
+ redfish-core/include/utils/time_utils.hpp | 138 ++++++++++-
+ redfish-core/lib/metric_report_definition.hpp | 328 ++++++++++++++++++++++++++
+ redfish-core/ut/time_utils_test.cpp | 63 +++++
+ 4 files changed, 528 insertions(+), 2 deletions(-)
+ create mode 100644 redfish-core/ut/time_utils_test.cpp
-diff --git a/redfish-core/include/utils/telemetry_utils.hpp b/redfish-core/include/utils/telemetry_utils.hpp
-index 8caee2d..acb739d 100644
---- a/redfish-core/include/utils/telemetry_utils.hpp
-+++ b/redfish-core/include/utils/telemetry_utils.hpp
-@@ -12,6 +12,8 @@ constexpr const char* metricReportDefinitionUri =
- "/redfish/v1/TelemetryService/MetricReportDefinitions/";
- constexpr const char* metricReportUri =
- "/redfish/v1/TelemetryService/MetricReports/";
-+constexpr const char* reportDir =
-+ "/xyz/openbmc_project/Telemetry/Reports/TelemetryService/";
+diff --git a/meson.build b/meson.build
+index 7a16e91..3d65b01 100644
+--- a/meson.build
++++ b/meson.build
+@@ -330,6 +330,7 @@ srcfiles_bmcweb = ['src/webserver_main.cpp','redfish-core/src/error_messages.cpp
+ srcfiles_unittest = ['include/ut/dbus_utility_test.cpp',
+ 'redfish-core/ut/privileges_test.cpp',
+ 'redfish-core/ut/lock_test.cpp',
++ 'redfish-core/ut/time_utils_test.cpp',
+ 'http/ut/utility_test.cpp']
- inline void getReportCollection(const std::shared_ptr<AsyncResp>& asyncResp,
- const std::string& uri)
-@@ -61,8 +63,7 @@ inline void getReportCollection(const std::shared_ptr<AsyncResp>& asyncResp,
-
- inline std::string getDbusReportPath(const std::string& id)
- {
-- std::string path =
-- "/xyz/openbmc_project/Telemetry/Reports/TelemetryService/" + id;
-+ std::string path = reportDir + id;
- dbus::utility::escapePathForDbus(path);
- return path;
- }
+ # Gather the Configuration data
diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp
-index dd4ea75..d8985ab 100644
+index dd4ea75..e94801b 100644
--- a/redfish-core/include/utils/time_utils.hpp
+++ b/redfish-core/include/utils/time_utils.hpp
-@@ -1,7 +1,12 @@
+@@ -1,7 +1,13 @@
#pragma once
+#include "logging.hpp"
+
+#include <charconv>
#include <chrono>
++#include <cmath>
+#include <optional>
#include <string>
+#include <system_error>
namespace redfish
{
-@@ -12,6 +17,8 @@ namespace time_utils
+@@ -12,6 +18,8 @@ namespace time_utils
namespace details
{
@@ -78,32 +76,12 @@ index dd4ea75..d8985ab 100644
inline void leftZeroPadding(std::string& str, const std::size_t padding)
{
if (str.size() < padding)
-@@ -19,8 +26,143 @@ inline void leftZeroPadding(std::string& str, const std::size_t padding)
+@@ -19,8 +27,135 @@ inline void leftZeroPadding(std::string& str, const std::size_t padding)
str.insert(0, padding - str.size(), '0');
}
}
+
-+inline bool fromChars(const char* start, const char* end,
-+ std::chrono::milliseconds::rep& val)
-+{
-+ auto [ptr, ec] = std::from_chars(start, end, val);
-+ if (ptr != end)
-+ {
-+ BMCWEB_LOG_ERROR
-+ << "Failed to convert string to decimal because of unexpected sign";
-+ return false;
-+ }
-+ if (ec != std::errc())
-+ {
-+ BMCWEB_LOG_ERROR << "Failed to convert string to decimal with err: "
-+ << static_cast<int>(ec) << "("
-+ << std::make_error_code(ec).message() << ")";
-+ return false;
-+ }
-+ return true;
-+}
-+
-+template <typename T>
++template <typename FromTime>
+bool fromDurationItem(std::string_view& fmt, const char postfix,
+ std::chrono::milliseconds& out)
+{
@@ -117,31 +95,43 @@ index dd4ea75..d8985ab 100644
+ return false;
+ }
+
-+ std::chrono::milliseconds::rep v = 0;
-+ if constexpr (std::is_same_v<T, std::chrono::milliseconds>)
++ const char* end;
++ std::chrono::milliseconds::rep ticks = 0;
++ if constexpr (std::is_same_v<FromTime, std::chrono::milliseconds>)
+ {
-+ std::string str(fmt.data(), std::min<size_t>(pos, 3U));
-+ while (str.size() < 3U)
-+ {
-+ str += '0';
-+ }
-+ if (!fromChars(str.data(), str.data() + str.size(), v))
-+ {
-+ return false;
-+ }
++ end = fmt.data() + std::min<size_t>(pos, 3U);
+ }
+ else
+ {
-+ if (!fromChars(fmt.data(), fmt.data() + pos, v))
-+ {
-+ return false;
-+ }
++ end = fmt.data() + pos;
+ }
+
-+ out += T(v);
-+ if (out < T(v) ||
-+ std::chrono::duration_cast<T>(std::chrono::milliseconds::max())
-+ .count() < v)
++ auto [ptr, ec] = std::from_chars(fmt.data(), end, ticks);
++ if (ptr != end || ec != std::errc())
++ {
++ BMCWEB_LOG_ERROR << "Failed to convert string to decimal with err: "
++ << static_cast<int>(ec) << "("
++ << std::make_error_code(ec).message() << "), ptr{"
++ << static_cast<const void*>(ptr) << "} != end{"
++ << static_cast<const void*>(end) << "})";
++ return false;
++ }
++
++ if constexpr (std::is_same_v<FromTime, std::chrono::milliseconds>)
++ {
++ ticks *= static_cast<std::chrono::milliseconds::rep>(
++ std::pow(10, 3 - std::min<size_t>(pos, 3U)));
++ }
++ if (ticks < 0)
++ {
++ return false;
++ }
++
++ out += FromTime(ticks);
++ const auto maxConversionRange =
++ std::chrono::duration_cast<FromTime>(std::chrono::milliseconds::max())
++ .count();
++ if (out < FromTime(ticks) || maxConversionRange < ticks)
+ {
+ return false;
+ }
@@ -222,7 +212,7 @@ index dd4ea75..d8985ab 100644
/**
* @brief Convert time value into duration format that is based on ISO 8601.
* Example output: "P12DT1M5.5S"
-@@ -36,8 +178,7 @@ std::string toDurationString(std::chrono::milliseconds ms)
+@@ -36,8 +171,7 @@ std::string toDurationString(std::chrono::milliseconds ms)
std::string fmt;
fmt.reserve(sizeof("PxxxxxxxxxxxxDTxxHxxMxx.xxxxxxS"));
@@ -233,10 +223,10 @@ index dd4ea75..d8985ab 100644
std::chrono::hours hours = std::chrono::floor<std::chrono::hours>(ms);
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
-index 48c56e6..d5a540d 100644
+index 59025d9..fcbc99c 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
-@@ -1,15 +1,26 @@
+@@ -1,9 +1,12 @@
#pragma once
#include "node.hpp"
@@ -249,394 +239,311 @@ index 48c56e6..d5a540d 100644
#include <tuple>
#include <variant>
- namespace redfish
- {
-
-+namespace telemetry
-+{
-+
-+using ReadingParameters =
-+ std::vector<std::tuple<std::vector<sdbusplus::message::object_path>,
-+ std::string, std::string, std::string>>;
-+} // namespace telemetry
-+
- class MetricReportDefinitionCollection : public Node
- {
- public:
-@@ -39,6 +50,318 @@ class MetricReportDefinitionCollection : public Node
- telemetry::getReportCollection(asyncResp,
- telemetry::metricReportDefinitionUri);
- }
-+
-+ struct AddReportArgs
-+ {
-+ std::string name;
-+ std::string reportingType;
-+ bool emitsReadingsUpdate = false;
-+ bool logToMetricReportsCollection = false;
-+ uint64_t interval = 0;
-+ std::vector<std::pair<std::string, std::vector<std::string>>> metrics;
-+ };
+@@ -95,6 +98,252 @@ inline void fillReportDefinition(
+ asyncResp->res.jsonValue["Schedule"]["RecurrenceInterval"] =
+ time_utils::toDurationString(std::chrono::milliseconds(*interval));
+ }
+
-+ void doPost(crow::Response& res, const crow::Request& req,
-+ const std::vector<std::string>&) override
++struct AddReportArgs
++{
++ std::string name;
++ std::string reportingType;
++ bool emitsReadingsUpdate = false;
++ bool logToMetricReportsCollection = false;
++ uint64_t interval = 0;
++ std::vector<std::pair<std::string, std::vector<std::string>>> metrics;
++};
++
++inline bool toDbusReportActions(crow::Response& res,
++ std::vector<std::string>& actions,
++ AddReportArgs& args)
++{
++ size_t index = 0;
++ for (auto& action : actions)
+ {
-+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+ AddReportArgs args;
-+ if (!getUserParameters(res, req, args))
++ if (action == "RedfishEvent")
+ {
-+ return;
++ args.emitsReadingsUpdate = true;
+ }
-+
-+ boost::container::flat_set<std::pair<std::string, std::string>>
-+ chassisSensors;
-+ if (!getChassisSensorNode(asyncResp, args.metrics, chassisSensors))
++ else if (action == "LogToMetricReportsCollection")
+ {
-+ return;
++ args.logToMetricReportsCollection = true;
+ }
-+
-+ auto addReportReq =
-+ std::make_shared<AddReport>(std::move(args), asyncResp);
-+ for (const auto& [chassis, sensorType] : chassisSensors)
++ else
+ {
-+ retrieveUriToDbusMap(
-+ chassis, sensorType,
-+ [asyncResp, addReportReq](
-+ const boost::beast::http::status status,
-+ const boost::container::flat_map<std::string, std::string>&
-+ uriToDbus) {
-+ if (status != boost::beast::http::status::ok)
-+ {
-+ BMCWEB_LOG_ERROR << "Failed to retrieve URI to dbus "
-+ "sensors map with err "
-+ << static_cast<unsigned>(status);
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+ addReportReq->insert(uriToDbus);
-+ });
++ messages::propertyValueNotInList(
++ res, action, "ReportActions/" + std::to_string(index));
++ return false;
+ }
++ index++;
+ }
++ return true;
++}
+
-+ static bool toDbusReportActions(crow::Response& res,
-+ std::vector<std::string>& actions,
-+ AddReportArgs& args)
++inline bool getUserParameters(crow::Response& res, const crow::Request& req,
++ AddReportArgs& args)
++{
++ std::vector<nlohmann::json> metrics;
++ std::vector<std::string> reportActions;
++ std::optional<nlohmann::json> schedule;
++ if (!json_util::readJson(req, res, "Id", args.name, "Metrics", metrics,
++ "MetricReportDefinitionType", args.reportingType,
++ "ReportActions", reportActions, "Schedule",
++ schedule))
+ {
-+ size_t index = 0;
-+ for (auto& action : actions)
-+ {
-+ if (action == "RedfishEvent")
-+ {
-+ args.emitsReadingsUpdate = true;
-+ }
-+ else if (action == "LogToMetricReportsCollection")
-+ {
-+ args.logToMetricReportsCollection = true;
-+ }
-+ else
-+ {
-+ messages::propertyValueNotInList(
-+ res, action, "ReportActions/" + std::to_string(index));
-+ return false;
-+ }
-+ index++;
-+ }
-+ return true;
++ return false;
++ }
++
++ constexpr const char* allowedCharactersInName =
++ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
++ if (args.name.empty() || args.name.find_first_not_of(
++ allowedCharactersInName) != std::string::npos)
++ {
++ BMCWEB_LOG_ERROR << "Failed to match " << args.name
++ << " with allowed character "
++ << allowedCharactersInName;
++ messages::propertyValueIncorrect(res, "Id", args.name);
++ return false;
++ }
++
++ if (args.reportingType != "Periodic" && args.reportingType != "OnRequest")
++ {
++ messages::propertyValueNotInList(res, args.reportingType,
++ "MetricReportDefinitionType");
++ return false;
+ }
+
-+ static bool getUserParameters(crow::Response& res, const crow::Request& req,
-+ AddReportArgs& args)
++ if (!toDbusReportActions(res, reportActions, args))
+ {
-+ std::vector<nlohmann::json> metrics;
-+ std::vector<std::string> reportActions;
-+ std::optional<nlohmann::json> schedule;
-+ if (!json_util::readJson(req, res, "Id", args.name, "Metrics", metrics,
-+ "MetricReportDefinitionType",
-+ args.reportingType, "ReportActions",
-+ reportActions, "Schedule", schedule))
++ return false;
++ }
++
++ if (args.reportingType == "Periodic")
++ {
++ if (!schedule)
+ {
++ messages::createFailedMissingReqProperties(res, "Schedule");
+ return false;
+ }
+
-+ constexpr const char* allowedCharactersInName =
-+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
-+ if (args.name.empty() ||
-+ args.name.find_first_not_of(allowedCharactersInName) !=
-+ std::string::npos)
++ std::string durationStr;
++ if (!json_util::readJson(*schedule, res, "RecurrenceInterval",
++ durationStr))
+ {
-+ BMCWEB_LOG_ERROR << "Failed to match " << args.name
-+ << " with allowed character "
-+ << allowedCharactersInName;
-+ messages::propertyValueIncorrect(res, "Id", args.name);
+ return false;
+ }
+
-+ if (args.reportingType != "Periodic" &&
-+ args.reportingType != "OnRequest")
++ std::optional<std::chrono::milliseconds> durationNum =
++ time_utils::fromDurationString(durationStr);
++ if (!durationNum)
+ {
-+ messages::propertyValueNotInList(res, args.reportingType,
-+ "MetricReportDefinitionType");
++ messages::propertyValueIncorrect(res, "RecurrenceInterval",
++ durationStr);
+ return false;
+ }
++ args.interval = static_cast<uint64_t>(durationNum->count());
++ }
+
-+ if (!toDbusReportActions(res, reportActions, args))
++ args.metrics.reserve(metrics.size());
++ for (auto& m : metrics)
++ {
++ std::string id;
++ std::vector<std::string> uris;
++ if (!json_util::readJson(m, res, "MetricId", id, "MetricProperties",
++ uris))
+ {
+ return false;
+ }
+
-+ if (args.reportingType == "Periodic")
++ args.metrics.emplace_back(std::move(id), std::move(uris));
++ }
++
++ return true;
++}
++
++inline bool getChassisSensorNode(
++ const std::shared_ptr<AsyncResp>& asyncResp,
++ const std::vector<std::pair<std::string, std::vector<std::string>>>&
++ metrics,
++ boost::container::flat_set<std::pair<std::string, std::string>>& matched)
++{
++ for (const auto& [id, uris] : metrics)
++ {
++ for (size_t i = 0; i < uris.size(); i++)
+ {
-+ if (!schedule)
-+ {
-+ messages::createFailedMissingReqProperties(res, "Schedule");
-+ return false;
-+ }
++ const std::string& uri = uris[i];
++ std::string chassis;
++ std::string node;
+
-+ std::string durationStr;
-+ if (!json_util::readJson(*schedule, res, "RecurrenceInterval",
-+ durationStr))
++ if (!boost::starts_with(uri, "/redfish/v1/Chassis/") ||
++ !dbus::utility::getNthStringFromPath(uri, 3, chassis) ||
++ !dbus::utility::getNthStringFromPath(uri, 4, node))
+ {
++ BMCWEB_LOG_ERROR << "Failed to get chassis and sensor Node "
++ "from "
++ << uri;
++ messages::propertyValueIncorrect(asyncResp->res, uri,
++ "MetricProperties/" +
++ std::to_string(i));
+ return false;
+ }
+
-+ std::optional<std::chrono::milliseconds> durationNum =
-+ time_utils::fromDurationString(durationStr);
-+ if (!durationNum)
++ if (boost::ends_with(node, "#"))
+ {
-+ messages::propertyValueIncorrect(res, "RecurrenceInterval",
-+ durationStr);
-+ return false;
++ node.pop_back();
+ }
-+ args.interval = static_cast<uint64_t>(durationNum->count());
++
++ matched.emplace(std::move(chassis), std::move(node));
+ }
++ }
++ return true;
++}
+
-+ args.metrics.reserve(metrics.size());
-+ for (auto& m : metrics)
++class AddReport
++{
++ public:
++ AddReport(AddReportArgs argsIn, std::shared_ptr<AsyncResp> asyncResp) :
++ asyncResp{std::move(asyncResp)}, args{std::move(argsIn)}
++ {}
++ ~AddReport()
++ {
++ if (asyncResp->res.result() != boost::beast::http::status::ok)
+ {
-+ std::string id;
-+ std::vector<std::string> uris;
-+ if (!json_util::readJson(m, res, "MetricId", id, "MetricProperties",
-+ uris))
-+ {
-+ return false;
-+ }
-+
-+ args.metrics.emplace_back(std::move(id), std::move(uris));
++ return;
+ }
+
-+ return true;
-+ }
++ telemetry::ReadingParameters readingParams;
++ readingParams.reserve(args.metrics.size());
+
-+ static bool getChassisSensorNode(
-+ const std::shared_ptr<AsyncResp>& asyncResp,
-+ const std::vector<std::pair<std::string, std::vector<std::string>>>&
-+ metrics,
-+ boost::container::flat_set<std::pair<std::string, std::string>>&
-+ matched)
-+ {
-+ for (const auto& [id, uris] : metrics)
++ for (const auto& [id, uris] : args.metrics)
+ {
+ for (size_t i = 0; i < uris.size(); i++)
+ {
+ const std::string& uri = uris[i];
-+ std::string chassis;
-+ std::string node;
-+
-+ if (!boost::starts_with(uri, "/redfish/v1/Chassis/") ||
-+ !dbus::utility::getNthStringFromPath(uri, 3, chassis) ||
-+ !dbus::utility::getNthStringFromPath(uri, 4, node))
++ auto el = uriToDbus.find(uri);
++ if (el == uriToDbus.end())
+ {
-+ BMCWEB_LOG_ERROR << "Failed to get chassis and sensor Node "
-+ "from "
++ BMCWEB_LOG_ERROR << "Failed to find DBus sensor "
++ "corresponding to URI "
+ << uri;
-+ messages::propertyValueIncorrect(asyncResp->res, uri,
++ messages::propertyValueNotInList(asyncResp->res, uri,
+ "MetricProperties/" +
+ std::to_string(i));
-+ return false;
-+ }
-+
-+ if (boost::ends_with(node, "#"))
-+ {
-+ node.pop_back();
++ return;
+ }
+
-+ matched.emplace(std::move(chassis), std::move(node));
++ const std::string& dbusPath = el->second;
++ readingParams.emplace_back(dbusPath, "SINGLE", id, uri);
+ }
+ }
-+ return true;
-+ }
-+
-+ class AddReport
-+ {
-+ public:
-+ AddReport(AddReportArgs argsIn, std::shared_ptr<AsyncResp> asyncResp) :
-+ asyncResp{std::move(asyncResp)}, args{std::move(argsIn)}
-+ {}
-+ ~AddReport()
-+ {
-+ if (asyncResp->res.result() != boost::beast::http::status::ok)
-+ {
-+ return;
-+ }
-+
-+ telemetry::ReadingParameters readingParams;
-+ readingParams.reserve(args.metrics.size());
+
-+ for (const auto& [id, uris] : args.metrics)
-+ {
-+ std::vector<sdbusplus::message::object_path> dbusPaths;
-+ dbusPaths.reserve(uris.size());
-+
-+ for (size_t i = 0; i < uris.size(); i++)
++ crow::connections::systemBus->async_method_call(
++ [asyncResp = std::move(asyncResp), name = args.name,
++ uriToDbus = std::move(uriToDbus)](
++ const boost::system::error_code ec, const std::string&) {
++ if (ec == boost::system::errc::file_exists)
++ {
++ messages::resourceAlreadyExists(
++ asyncResp->res, "MetricReportDefinition", "Id", name);
++ return;
++ }
++ if (ec == boost::system::errc::too_many_files_open)
+ {
-+ const std::string& uri = uris[i];
-+ auto el = uriToDbus.find(uri);
-+ if (el == uriToDbus.end())
++ messages::createLimitReachedForResource(asyncResp->res);
++ return;
++ }
++ if (ec == boost::system::errc::argument_list_too_long)
++ {
++ nlohmann::json metricProperties = nlohmann::json::array();
++ for (const auto& [uri, _] : uriToDbus)
+ {
-+ BMCWEB_LOG_ERROR << "Failed to find DBus sensor "
-+ "corresponding to URI "
-+ << uri;
-+ messages::propertyValueNotInList(asyncResp->res, uri,
-+ "MetricProperties/" +
-+ std::to_string(i));
-+ return;
++ metricProperties.emplace_back(uri);
+ }
-+
-+ dbusPaths.emplace_back(el->second);
++ messages::propertyValueIncorrect(
++ asyncResp->res, metricProperties, "MetricProperties");
++ return;
+ }
-+
-+ nlohmann::json metadata;
-+ metadata["MetricProperties"] = uris;
-+ if (uris.size() == 1)
++ if (ec)
+ {
-+ metadata["MetricProperty"] = uris[0];
++ messages::internalError(asyncResp->res);
++ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec;
++ return;
+ }
-+ readingParams.emplace_back(std::move(dbusPaths), "SINGLE", id,
-+ metadata.dump());
-+ }
+
-+ crow::connections::systemBus->async_method_call(
-+ [asyncResp = asyncResp, name = args.name](
-+ const boost::system::error_code ec, const std::string&) {
-+ if (ec == boost::system::errc::file_exists)
-+ {
-+ messages::resourceAlreadyExists(
-+ asyncResp->res, "MetricReportDefinition", "Id",
-+ name);
-+ return;
-+ }
-+ if (ec == boost::system::errc::too_many_files_open)
-+ {
-+ messages::createLimitReachedForResource(asyncResp->res);
-+ return;
-+ }
-+ if (ec == boost::system::errc::argument_list_too_long)
-+ {
-+ messages::propertyValueNotInList(
-+ asyncResp->res, "/Exceeds supported size/",
-+ "Metrics");
-+ return;
-+ }
-+ if (ec == boost::system::errc::not_supported)
-+ {
-+ messages::propertyValueNotInList(
-+ asyncResp->res,
-+ "/Only single property per metric is supported/",
-+ "MetricProperties");
-+ return;
-+ }
-+ if (ec == boost::system::errc::invalid_argument)
-+ {
-+ messages::propertyValueNotInList(
-+ asyncResp->res, "/Less then MinInterval/",
-+ "RecurrenceInterval");
-+ return;
-+ }
-+ if (ec)
-+ {
-+ messages::internalError(asyncResp->res);
-+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec;
-+ return;
-+ }
++ messages::created(asyncResp->res);
++ },
++ telemetry::service, "/xyz/openbmc_project/Telemetry/Reports",
++ "xyz.openbmc_project.Telemetry.ReportManager", "AddReport",
++ "TelemetryService/" + args.name, args.reportingType,
++ args.emitsReadingsUpdate, args.logToMetricReportsCollection,
++ args.interval, readingParams);
++ }
++
++ void insert(const boost::container::flat_map<std::string, std::string>& el)
++ {
++ uriToDbus.insert(el.begin(), el.end());
++ }
+
-+ messages::created(asyncResp->res);
-+ },
-+ telemetry::service, "/xyz/openbmc_project/Telemetry/Reports",
-+ "xyz.openbmc_project.Telemetry.ReportManager", "AddReport",
-+ "TelemetryService/" + args.name, args.reportingType,
-+ args.emitsReadingsUpdate, args.logToMetricReportsCollection,
-+ args.interval, readingParams);
++ private:
++ std::shared_ptr<AsyncResp> asyncResp;
++ AddReportArgs args;
++ boost::container::flat_map<std::string, std::string> uriToDbus{};
++};
+ } // namespace telemetry
+
+ class MetricReportDefinitionCollection : public Node
+@@ -126,6 +375,46 @@ class MetricReportDefinitionCollection : public Node
+ telemetry::getReportCollection(asyncResp,
+ telemetry::metricReportDefinitionUri);
+ }
++
++ void doPost(crow::Response& res, const crow::Request& req,
++ const std::vector<std::string>&) override
++ {
++ auto asyncResp = std::make_shared<AsyncResp>(res);
++ telemetry::AddReportArgs args;
++ if (!telemetry::getUserParameters(res, req, args))
++ {
++ return;
+ }
+
-+ void insert(
-+ const boost::container::flat_map<std::string, std::string>& el)
++ boost::container::flat_set<std::pair<std::string, std::string>>
++ chassisSensors;
++ if (!telemetry::getChassisSensorNode(asyncResp, args.metrics,
++ chassisSensors))
+ {
-+ uriToDbus.insert(el.begin(), el.end());
++ return;
+ }
+
-+ private:
-+ std::shared_ptr<AsyncResp> asyncResp;
-+ AddReportArgs args;
-+ boost::container::flat_map<std::string, std::string> uriToDbus{};
-+ };
++ auto addReportReq =
++ std::make_shared<telemetry::AddReport>(std::move(args), asyncResp);
++ for (const auto& [chassis, sensorType] : chassisSensors)
++ {
++ retrieveUriToDbusMap(
++ chassis, sensorType,
++ [asyncResp, addReportReq](
++ const boost::beast::http::status status,
++ const boost::container::flat_map<std::string, std::string>&
++ uriToDbus) {
++ if (status != boost::beast::http::status::ok)
++ {
++ BMCWEB_LOG_ERROR << "Failed to retrieve URI to dbus "
++ "sensors map with err "
++ << static_cast<unsigned>(status);
++ return;
++ }
++ addReportReq->insert(uriToDbus);
++ });
++ }
++ }
};
class MetricReportDefinition : public Node
-@@ -73,9 +396,10 @@ class MetricReportDefinition : public Node
- crow::connections::systemBus->async_method_call(
- [asyncResp,
- id](const boost::system::error_code ec,
-- const std::vector<std::pair<
-- std::string, std::variant<bool, ReadingParameters,
-- std::string, uint64_t>>>& ret) {
-+ const std::vector<
-+ std::pair<std::string,
-+ std::variant<bool, telemetry::ReadingParameters,
-+ std::string, uint64_t>>>& ret) {
- if (ec.value() == EBADR)
- {
- messages::resourceNotFound(asyncResp->res, schemaType, id);
-@@ -95,15 +419,11 @@ class MetricReportDefinition : public Node
+@@ -184,5 +473,44 @@ class MetricReportDefinition : public Node
+ "org.freedesktop.DBus.Properties", "GetAll",
telemetry::reportInterface);
}
-
-- using ReadingParameters =
-- std::vector<std::tuple<std::vector<sdbusplus::message::object_path>,
-- std::string, std::string, std::string>>;
--
- static void fillReportDefinition(
- const std::shared_ptr<AsyncResp>& asyncResp, const std::string& id,
-- const std::vector<
-- std::pair<std::string, std::variant<bool, ReadingParameters,
-- std::string, uint64_t>>>& ret)
-+ const std::vector<std::pair<
-+ std::string, std::variant<bool, telemetry::ReadingParameters,
-+ std::string, uint64_t>>>& ret)
- {
- asyncResp->res.jsonValue["@odata.type"] = schemaType;
- asyncResp->res.jsonValue["@odata.id"] =
-@@ -117,7 +437,7 @@ class MetricReportDefinition : public Node
-
- const bool* emitsReadingsUpdate = nullptr;
- const bool* logToMetricReportsCollection = nullptr;
-- const ReadingParameters* readingParams = nullptr;
-+ const telemetry::ReadingParameters* readingParams = nullptr;
- const std::string* reportingType = nullptr;
- const uint64_t* interval = nullptr;
- for (const auto& [key, var] : ret)
-@@ -132,7 +452,7 @@ class MetricReportDefinition : public Node
- }
- else if (key == "ReadingParameters")
- {
-- readingParams = std::get_if<ReadingParameters>(&var);
-+ readingParams = std::get_if<telemetry::ReadingParameters>(&var);
- }
- else if (key == "ReportingType")
- {
-@@ -180,6 +500,44 @@ class MetricReportDefinition : public Node
- time_utils::toDurationString(std::chrono::milliseconds(*interval));
- }
-
++
+ void doDelete(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>& params) override
+ {
@@ -658,7 +565,8 @@ index 48c56e6..d5a540d 100644
+ */
+ if (ec.value() == EBADR)
+ {
-+ messages::resourceNotFound(asyncResp->res, schemaType, id);
++ messages::resourceNotFound(asyncResp->res,
++ "MetricReportDefinition", id);
+ return;
+ }
+
@@ -674,10 +582,77 @@ index 48c56e6..d5a540d 100644
+ telemetry::service, reportPath, "xyz.openbmc_project.Object.Delete",
+ "Delete");
+ }
-+
- static constexpr const char* schemaType =
- "#MetricReportDefinition.v1_3_0.MetricReportDefinition";
};
+ } // namespace redfish
+diff --git a/redfish-core/ut/time_utils_test.cpp b/redfish-core/ut/time_utils_test.cpp
+new file mode 100644
+index 0000000..70999ce
+--- /dev/null
++++ b/redfish-core/ut/time_utils_test.cpp
+@@ -0,0 +1,63 @@
++#include "utils/time_utils.hpp"
++
++#include <gmock/gmock.h>
++
++using namespace testing;
++
++class FromDurationTest :
++ public Test,
++ public WithParamInterface<
++ std::pair<std::string, std::optional<std::chrono::milliseconds>>>
++{};
++
++INSTANTIATE_TEST_SUITE_P(
++ _, FromDurationTest,
++ Values(std::make_pair("PT12S", std::chrono::milliseconds(12000)),
++ std::make_pair("PT0.204S", std::chrono::milliseconds(204)),
++ std::make_pair("PT0.2S", std::chrono::milliseconds(200)),
++ std::make_pair("PT50M", std::chrono::milliseconds(3000000)),
++ std::make_pair("PT23H", std::chrono::milliseconds(82800000)),
++ std::make_pair("P51D", std::chrono::milliseconds(4406400000)),
++ std::make_pair("PT2H40M10.1S", std::chrono::milliseconds(9610100)),
++ std::make_pair("P20DT2H40M10.1S",
++ std::chrono::milliseconds(1737610100)),
++ std::make_pair("", std::chrono::milliseconds(0)),
++ std::make_pair("PTS", std::nullopt),
++ std::make_pair("P1T", std::nullopt),
++ std::make_pair("PT100M1000S100", std::nullopt),
++ std::make_pair("PDTHMS", std::nullopt),
++ std::make_pair("P99999999999999999DT", std::nullopt),
++ std::make_pair("PD222T222H222M222.222S", std::nullopt),
++ std::make_pair("PT99999H9999999999999999999999M99999999999S",
++ std::nullopt),
++ std::make_pair("PT-9H", std::nullopt)));
++
++TEST_P(FromDurationTest, convertToMilliseconds)
++{
++ const auto& [str, expected] = GetParam();
++ EXPECT_THAT(redfish::time_utils::fromDurationString(str), Eq(expected));
++}
++
++class ToDurationTest :
++ public Test,
++ public WithParamInterface<std::pair<std::chrono::milliseconds, std::string>>
++{};
++
++INSTANTIATE_TEST_SUITE_P(
++ _, ToDurationTest,
++ Values(std::make_pair(std::chrono::milliseconds(12000), "PT12.000S"),
++ std::make_pair(std::chrono::milliseconds(204), "PT0.204S"),
++ std::make_pair(std::chrono::milliseconds(200), "PT0.200S"),
++ std::make_pair(std::chrono::milliseconds(3000000), "PT50M"),
++ std::make_pair(std::chrono::milliseconds(82800000), "PT23H"),
++ std::make_pair(std::chrono::milliseconds(4406400000), "P51DT"),
++ std::make_pair(std::chrono::milliseconds(9610100), "PT2H40M10.100S"),
++ std::make_pair(std::chrono::milliseconds(1737610100),
++ "P20DT2H40M10.100S"),
++ std::make_pair(std::chrono::milliseconds(-250), "")));
++
++TEST_P(ToDurationTest, convertToDuration)
++{
++ const auto& [ms, expected] = GetParam();
++ EXPECT_THAT(redfish::time_utils::toDurationString(ms), Eq(expected));
++}
--
-2.17.1
+2.16.6
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0003-Add-support-for-MetricDefinition-scheme.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0003-Add-support-for-MetricDefinition-scheme.patch
index 7c3e4c804..99af0ab86 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0003-Add-support-for-MetricDefinition-scheme.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0003-Add-support-for-MetricDefinition-scheme.patch
@@ -1,35 +1,41 @@
-From d9016c8064f5732fb6d24d07a990ddfa294a8a9d Mon Sep 17 00:00:00 2001
+From 462b2e814698e12a18b4956eb3c6421c34a3a4ba Mon Sep 17 00:00:00 2001
From: "Wludzik, Jozef" <jozef.wludzik@intel.com>
-Date: Mon, 8 Jun 2020 17:15:54 +0200
-Subject: [PATCH] Add support for MetricDefinition scheme
+Date: Tue, 15 Dec 2020 12:28:17 +0100
+Subject: [PATCH 3/4] Add support for MetricDefinition scheme
+
+Added MetricDefinition node to Redfish code. Now user is able
+to list all available metrics in OpenBMC that are supported
+by Telemetry service. Metrics are grouped by following
+categories: temperature, power, voltage, current, fan_tach,
+fan_pwm, utilization.
-Added MetricDefinition node to redfish core. Now user is able to
-get all possible metrics that are present in system and are
-supported by TelemetryService.
Added generic function to fill ReadingUnits and ReadingType
-in Sensor scheme.
+in Sensor node.
Tested:
- - Succesfully passed RedfishServiceValidator.py
- - Validated a presence of MetricDefinition members
+ - MetricDefinitions response is filled with existing sensors,
+ it works with and without Telemetry service
+ - Validated a presence of MetricDefinition members and it
+ attributes
+ - Succesfully passed RedfishServiceValidator.py using
+ witherspoon image on QEMU
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I3086e1302e1ba2e5442d1367939fd5507a0cbc00
---
- redfish-core/include/redfish.hpp | 3 +
- .../include/utils/telemetry_utils.hpp | 56 ++--
- redfish-core/lib/metric_definition.hpp | 269 ++++++++++++++++++
- redfish-core/lib/metric_report_definition.hpp | 22 ++
- redfish-core/lib/power.hpp | 4 +-
- redfish-core/lib/sensors.hpp | 96 +++++--
- redfish-core/lib/telemetry_service.hpp | 2 +
- redfish-core/lib/thermal.hpp | 4 +-
- 8 files changed, 406 insertions(+), 50 deletions(-)
+ redfish-core/include/redfish.hpp | 3 +
+ redfish-core/include/utils/telemetry_utils.hpp | 2 +
+ redfish-core/lib/metric_definition.hpp | 283 +++++++++++++++++++++++++
+ redfish-core/lib/power.hpp | 4 +-
+ redfish-core/lib/sensors.hpp | 85 ++++++--
+ redfish-core/lib/telemetry_service.hpp | 2 +
+ redfish-core/lib/thermal.hpp | 4 +-
+ 7 files changed, 361 insertions(+), 22 deletions(-)
create mode 100644 redfish-core/lib/metric_definition.hpp
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
-index b366e24..a938d43 100644
+index e94c0f3..83f2300 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -25,6 +25,7 @@
@@ -40,7 +46,7 @@ index b366e24..a938d43 100644
#include "../lib/metric_report.hpp"
#include "../lib/metric_report_definition.hpp"
#include "../lib/network_protocol.hpp"
-@@ -216,6 +217,8 @@ class RedfishService
+@@ -213,6 +214,8 @@ class RedfishService
nodes.emplace_back(std::make_unique<HypervisorSystem>(app));
nodes.emplace_back(std::make_unique<TelemetryService>(app));
@@ -50,7 +56,7 @@ index b366e24..a938d43 100644
std::make_unique<MetricReportDefinitionCollection>(app));
nodes.emplace_back(std::make_unique<MetricReportDefinition>(app));
diff --git a/redfish-core/include/utils/telemetry_utils.hpp b/redfish-core/include/utils/telemetry_utils.hpp
-index acb739d..c13a79b 100644
+index a3a8156..c1b7639 100644
--- a/redfish-core/include/utils/telemetry_utils.hpp
+++ b/redfish-core/include/utils/telemetry_utils.hpp
@@ -8,6 +8,8 @@ namespace telemetry
@@ -62,80 +68,12 @@ index acb739d..c13a79b 100644
constexpr const char* metricReportDefinitionUri =
"/redfish/v1/TelemetryService/MetricReportDefinitions/";
constexpr const char* metricReportUri =
-@@ -15,6 +17,36 @@ constexpr const char* metricReportUri =
- constexpr const char* reportDir =
- "/xyz/openbmc_project/Telemetry/Reports/TelemetryService/";
-
-+inline void dbusPathsToMembers(const std::shared_ptr<AsyncResp>& asyncResp,
-+ const std::vector<std::string>& paths,
-+ const std::string& uri)
-+{
-+ nlohmann::json& members = asyncResp->res.jsonValue["Members"];
-+ members = nlohmann::json::array();
-+
-+ for (const std::string& path : paths)
-+ {
-+ std::size_t pos = path.rfind('/');
-+ if (pos == std::string::npos)
-+ {
-+ BMCWEB_LOG_ERROR << "Failed to find '/' in " << path;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ if (path.size() <= (pos + 1))
-+ {
-+ BMCWEB_LOG_ERROR << "Failed to parse path " << path;
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
-+
-+ members.push_back({{"@odata.id", uri + path.substr(pos + 1)}});
-+ }
-+
-+ asyncResp->res.jsonValue["Members@odata.count"] = members.size();
-+}
-+
- inline void getReportCollection(const std::shared_ptr<AsyncResp>& asyncResp,
- const std::string& uri)
- {
-@@ -30,29 +62,7 @@ inline void getReportCollection(const std::shared_ptr<AsyncResp>& asyncResp,
- return;
- }
-
-- nlohmann::json& members = asyncResp->res.jsonValue["Members"];
-- members = nlohmann::json::array();
--
-- for (const std::string& path : reportPaths)
-- {
-- std::size_t pos = path.rfind('/');
-- if (pos == std::string::npos)
-- {
-- BMCWEB_LOG_ERROR << "Failed to find '/' in " << path;
-- messages::internalError(asyncResp->res);
-- return;
-- }
-- if (path.size() <= (pos + 1))
-- {
-- BMCWEB_LOG_ERROR << "Failed to parse path " << path;
-- messages::internalError(asyncResp->res);
-- return;
-- }
--
-- members.push_back({{"@odata.id", uri + path.substr(pos + 1)}});
-- }
--
-- asyncResp->res.jsonValue["Members@odata.count"] = members.size();
-+ dbusPathsToMembers(asyncResp, reportPaths, uri);
- },
- "xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
diff --git a/redfish-core/lib/metric_definition.hpp b/redfish-core/lib/metric_definition.hpp
new file mode 100644
-index 0000000..f037ed2
+index 0000000..4a40af5
--- /dev/null
+++ b/redfish-core/lib/metric_definition.hpp
-@@ -0,0 +1,269 @@
+@@ -0,0 +1,283 @@
+#pragma once
+
+#include "node.hpp"
@@ -149,31 +87,36 @@ index 0000000..f037ed2
+{
+
+template <typename F>
-+inline void getChassisNames(F&& cb)
++inline void getChassisNames(F&& cb, const std::shared_ptr<AsyncResp>& asyncResp)
+{
+ const std::array<const char*, 2> interfaces = {
+ "xyz.openbmc_project.Inventory.Item.Board",
+ "xyz.openbmc_project.Inventory.Item.Chassis"};
+
+ crow::connections::systemBus->async_method_call(
-+ [callback = std::move(cb)](const boost::system::error_code ec,
-+ std::vector<std::string>& chassisList) {
++ [asyncResp,
++ callback = std::move(cb)](const boost::system::error_code ec,
++ std::vector<std::string>& chassises) {
+ if (ec)
+ {
++ messages::internalError(asyncResp->res);
+ BMCWEB_LOG_DEBUG << "DBus call error: " << ec.value();
+ return;
+ }
+
+ std::vector<std::string> chassisNames;
-+ chassisNames.reserve(chassisList.size());
-+ for (const std::string& chassisPath : chassisList)
++ chassisNames.reserve(chassises.size());
++ for (const std::string& chassis : chassises)
+ {
-+ size_t pos = chassisPath.rfind('/');
-+ if (pos == std::string::npos)
++ sdbusplus::message::object_path path(chassis);
++ std::string name = path.filename();
++ if (name.empty())
+ {
-+ continue;
++ messages::internalError(asyncResp->res);
++ BMCWEB_LOG_ERROR << "Invalid chassis: " << chassis;
++ return;
+ }
-+ chassisNames.push_back(chassisPath.substr(pos + 1));
++ chassisNames.push_back(name);
+ }
+
+ callback(chassisNames);
@@ -185,6 +128,109 @@ index 0000000..f037ed2
+}
+} // namespace utils
+
++namespace telemetry
++{
++
++class DefinitionCollectionReduce
++{
++ public:
++ DefinitionCollectionReduce(const std::shared_ptr<AsyncResp>& asyncResp) :
++ asyncResp{asyncResp}
++ {}
++
++ ~DefinitionCollectionReduce()
++ {
++ if (asyncResp->res.result() != boost::beast::http::status::ok)
++ {
++ return;
++ }
++
++ nlohmann::json& members = asyncResp->res.jsonValue["Members"];
++ members = nlohmann::json::array();
++
++ for (const std::string& type : dbusTypes)
++ {
++ members.push_back(
++ {{"@odata.id", telemetry::metricDefinitionUri + type}});
++ }
++ asyncResp->res.jsonValue["Members@odata.count"] = members.size();
++ }
++
++ void insert(const boost::container::flat_map<std::string, std::string>& el)
++ {
++ for (const auto& [_, dbusSensor] : el)
++ {
++ sdbusplus::message::object_path path(dbusSensor);
++ sdbusplus::message::object_path parentPath = path.parent_path();
++ std::string type = parentPath.filename();
++ if (type.empty())
++ {
++ BMCWEB_LOG_ERROR << "Received invalid DBus Sensor Path = "
++ << dbusSensor;
++ continue;
++ }
++
++ dbusTypes.insert(std::move(type));
++ }
++ }
++
++ private:
++ const std::shared_ptr<AsyncResp> asyncResp;
++ boost::container::flat_set<std::string> dbusTypes;
++};
++
++class DefinitionReduce
++{
++ public:
++ DefinitionReduce(const std::shared_ptr<AsyncResp>& asyncResp,
++ const std::string& id) :
++ id(id),
++ pattern{'/' + id + '/'}, asyncResp{asyncResp}
++ {}
++ ~DefinitionReduce()
++ {
++ if (asyncResp->res.result() != boost::beast::http::status::ok)
++ {
++ return;
++ }
++ if (redfishSensors.empty())
++ {
++ messages::resourceNotFound(asyncResp->res, "MetricDefinition", id);
++ return;
++ }
++
++ asyncResp->res.jsonValue["MetricProperties"] = redfishSensors;
++ asyncResp->res.jsonValue["Id"] = id;
++ asyncResp->res.jsonValue["Name"] = id;
++ asyncResp->res.jsonValue["@odata.id"] =
++ telemetry::metricDefinitionUri + id;
++ asyncResp->res.jsonValue["@odata.type"] =
++ "#MetricDefinition.v1_0_3.MetricDefinition";
++ asyncResp->res.jsonValue["MetricDataType"] = "Decimal";
++ asyncResp->res.jsonValue["MetricType"] = "Numeric";
++ asyncResp->res.jsonValue["IsLinear"] = true;
++ asyncResp->res.jsonValue["Units"] = sensors::toReadingUnits(id);
++ }
++
++ void insert(const boost::container::flat_map<std::string, std::string>& el)
++ {
++ for (const auto& [redfishSensor, dbusSensor] : el)
++ {
++ if (dbusSensor.find(pattern) != std::string::npos)
++ {
++ redfishSensors.push_back(redfishSensor);
++ }
++ }
++ }
++
++ private:
++ const std::string id;
++ const std::string pattern;
++ const std::shared_ptr<AsyncResp> asyncResp;
++ std::vector<std::string> redfishSensors;
++};
++} // namespace telemetry
++
+class MetricDefinitionCollection : public Node
+{
+ public:
@@ -213,7 +259,8 @@ index 0000000..f037ed2
+ res.jsonValue["Members@odata.count"] = 0;
+
+ auto asyncResp = std::make_shared<AsyncResp>(res);
-+ auto collectionReduce = std::make_shared<CollectionGather>(asyncResp);
++ auto collectionReduce =
++ std::make_shared<telemetry::DefinitionCollectionReduce>(asyncResp);
+ utils::getChassisNames(
+ [asyncResp,
+ collectionReduce](const std::vector<std::string>& chassisNames) {
@@ -242,50 +289,9 @@ index 0000000..f037ed2
+ });
+ }
+ }
-+ });
++ },
++ asyncResp);
+ }
-+
-+ class CollectionGather
-+ {
-+ public:
-+ CollectionGather(const std::shared_ptr<AsyncResp>& asyncResp) :
-+ asyncResp{asyncResp}
-+ {}
-+
-+ ~CollectionGather()
-+ {
-+ if (asyncResp->res.result() != boost::beast::http::status::ok)
-+ {
-+ return;
-+ }
-+
-+ telemetry::dbusPathsToMembers(
-+ asyncResp,
-+ std::vector<std::string>(dbusTypes.begin(), dbusTypes.end()),
-+ telemetry::metricDefinitionUri);
-+ }
-+
-+ void insert(
-+ const boost::container::flat_map<std::string, std::string>& el)
-+ {
-+ for (const auto& [_, dbusSensor] : el)
-+ {
-+ size_t pos = dbusSensor.rfind('/');
-+ if (pos == std::string::npos)
-+ {
-+ BMCWEB_LOG_ERROR << "Received invalid DBus Sensor Path = "
-+ << dbusSensor;
-+ continue;
-+ }
-+
-+ dbusTypes.insert(dbusSensor.substr(0, pos));
-+ }
-+ }
-+
-+ private:
-+ const std::shared_ptr<AsyncResp> asyncResp;
-+ boost::container::flat_set<std::string> dbusTypes;
-+ };
+};
+
+class MetricDefinition : public Node
@@ -317,7 +323,7 @@ index 0000000..f037ed2
+
+ const std::string& id = params[0];
+ auto definitionGather =
-+ std::make_shared<DefinitionGather>(asyncResp, id);
++ std::make_shared<telemetry::DefinitionReduce>(asyncResp, id);
+ utils::getChassisNames(
+ [asyncResp,
+ definitionGather](const std::vector<std::string>& chassisNames) {
@@ -345,113 +351,12 @@ index 0000000..f037ed2
+ });
+ }
+ }
-+ });
++ },
++ asyncResp);
+ }
-+
-+ class DefinitionGather
-+ {
-+ public:
-+ DefinitionGather(const std::shared_ptr<AsyncResp>& asyncResp,
-+ const std::string& id) :
-+ id(id),
-+ pattern{'/' + id + '/'}, asyncResp{asyncResp}
-+ {}
-+ ~DefinitionGather()
-+ {
-+ if (asyncResp->res.result() != boost::beast::http::status::ok)
-+ {
-+ return;
-+ }
-+ if (redfishSensors.empty())
-+ {
-+ messages::resourceNotFound(asyncResp->res, schemaType, id);
-+ return;
-+ }
-+
-+ asyncResp->res.jsonValue["MetricProperties"] = redfishSensors;
-+ asyncResp->res.jsonValue["Id"] = id;
-+ asyncResp->res.jsonValue["Name"] = id;
-+ asyncResp->res.jsonValue["@odata.id"] =
-+ telemetry::metricDefinitionUri + id;
-+ asyncResp->res.jsonValue["@odata.type"] = schemaType;
-+ asyncResp->res.jsonValue["MetricDataType"] = "Decimal";
-+ asyncResp->res.jsonValue["MetricType"] = "Numeric";
-+ asyncResp->res.jsonValue["IsLinear"] = true;
-+ asyncResp->res.jsonValue["Units"] = sensors::toReadingUnits(id);
-+ }
-+
-+ void insert(
-+ const boost::container::flat_map<std::string, std::string>& el)
-+ {
-+ for (const auto& [redfishSensor, dbusSensor] : el)
-+ {
-+ if (dbusSensor.find(pattern) != std::string::npos)
-+ {
-+ redfishSensors.push_back(redfishSensor);
-+ }
-+ }
-+ }
-+
-+ const std::string id;
-+ const std::string pattern;
-+
-+ private:
-+ const std::shared_ptr<AsyncResp> asyncResp;
-+ std::vector<std::string> redfishSensors;
-+ };
-+
-+ static constexpr const char* schemaType =
-+ "#MetricDefinition.v1_0_3.MetricDefinition";
+};
+
+} // namespace redfish
-diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
-index d5a540d..03f0b82 100644
---- a/redfish-core/lib/metric_report_definition.hpp
-+++ b/redfish-core/lib/metric_report_definition.hpp
-@@ -269,6 +269,8 @@ class MetricReportDefinitionCollection : public Node
- {
- std::vector<sdbusplus::message::object_path> dbusPaths;
- dbusPaths.reserve(uris.size());
-+ std::string sensorType;
-+ bool invalidType = false;
-
- for (size_t i = 0; i < uris.size(); i++)
- {
-@@ -286,6 +288,21 @@ class MetricReportDefinitionCollection : public Node
- }
-
- dbusPaths.emplace_back(el->second);
-+
-+ if (invalidType)
-+ {
-+ continue;
-+ }
-+ std::string tmp;
-+ dbus::utility::getNthStringFromPath(el->second, 3, tmp);
-+ if (sensorType.empty())
-+ {
-+ sensorType = std::move(tmp);
-+ }
-+ else if (sensorType != tmp)
-+ {
-+ invalidType = true;
-+ }
- }
-
- nlohmann::json metadata;
-@@ -294,6 +311,11 @@ class MetricReportDefinitionCollection : public Node
- {
- metadata["MetricProperty"] = uris[0];
- }
-+ if (!sensorType.empty() && !invalidType)
-+ {
-+ metadata["MetricDefinition"]["@odata.id"] =
-+ telemetry::metricDefinitionUri + sensorType;
-+ }
- readingParams.emplace_back(std::move(dbusPaths), "SINGLE", id,
- metadata.dump());
- }
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 1c7a009..99c45ef 100644
--- a/redfish-core/lib/power.hpp
@@ -475,7 +380,7 @@ index 1c7a009..99c45ef 100644
std::optional<std::vector<nlohmann::json>> voltageCollections;
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
-index 14c9593..bf97540 100644
+index 14c9593..5080f77 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -54,9 +54,10 @@ static constexpr std::string_view thermal = "Thermal";
@@ -555,46 +460,12 @@ index 14c9593..bf97540 100644
}
} // namespace sensors
-@@ -90,19 +149,20 @@ class SensorsAsyncResp
- };
-
- SensorsAsyncResp(crow::Response& response, const std::string& chassisIdIn,
-- const std::vector<const char*>& typesIn,
-+ const std::vector<const char*>& matchPathsIn,
- const std::string_view& subNode) :
- res(response),
-- chassisId(chassisIdIn), types(typesIn), chassisSubNode(subNode)
-+ chassisId(chassisIdIn), matchPaths(matchPathsIn),
-+ chassisSubNode(subNode)
- {}
-
- // Store extra data about sensor mapping and return it in callback
- SensorsAsyncResp(crow::Response& response, const std::string& chassisIdIn,
-- const std::vector<const char*>& typesIn,
-+ const std::vector<const char*>& matchPathsIn,
- const std::string_view& subNode,
- DataCompleteCb&& creationComplete) :
- res(response),
-- chassisId(chassisIdIn), types(typesIn),
-+ chassisId(chassisIdIn), matchPaths(matchPathsIn),
- chassisSubNode(subNode), metadata{std::vector<SensorData>()},
- dataComplete{std::move(creationComplete)}
- {}
-@@ -161,7 +221,7 @@ class SensorsAsyncResp
-
- crow::Response& res;
- const std::string chassisId;
-- const std::vector<const char*> types;
-+ const std::vector<const char*> matchPaths;
- const std::string chassisSubNode;
-
- private:
-@@ -345,11 +405,11 @@ inline void reduceSensorList(
+@@ -345,11 +404,11 @@ inline void reduceSensorList(
return;
}
- for (const char* type : sensorsAsyncResp->types)
-+ for (const char* path : sensorsAsyncResp->matchPaths)
++ for (const char* path : sensorsAsyncResp->types)
{
for (const std::string& sensor : *allSensors)
{
@@ -603,7 +474,7 @@ index 14c9593..bf97540 100644
{
activeSensors->emplace(sensor);
}
-@@ -853,18 +913,8 @@ inline void objectInterfacesToJson(
+@@ -853,18 +912,8 @@ inline void objectInterfacesToJson(
if (sensorsAsyncResp->chassisSubNode == sensors::node::sensors)
{
sensorJson["@odata.type"] = "#Sensor.v1_0_0.Sensor";
@@ -624,7 +495,7 @@ index 14c9593..bf97540 100644
}
else if (sensorType == "temperature")
{
-@@ -2976,8 +3026,8 @@ inline void retrieveUriToDbusMap(const std::string& chassis,
+@@ -2976,8 +3025,8 @@ inline void retrieveUriToDbusMap(const std::string& chassis,
const std::string& node,
SensorsAsyncResp::DataCompleteCb&& mapComplete)
{
@@ -635,7 +506,7 @@ index 14c9593..bf97540 100644
{
BMCWEB_LOG_ERROR << "Wrong node provided : " << node;
mapComplete(boost::beast::http::status::bad_request, {});
-@@ -3027,7 +3077,7 @@ class SensorCollection : public Node
+@@ -3027,7 +3076,7 @@ class SensorCollection : public Node
const std::string& chassisId = params[0];
std::shared_ptr<SensorsAsyncResp> asyncResp =
std::make_shared<SensorsAsyncResp>(
@@ -645,13 +516,13 @@ index 14c9593..bf97540 100644
auto getChassisCb =
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
-index a6acc34..8105d86 100644
+index 61ca891..a8c8b03 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
-@@ -34,6 +34,8 @@ class TelemetryService : public Node
+@@ -32,6 +32,8 @@ class TelemetryService : public Node
+ res.jsonValue["Id"] = "TelemetryService";
+ res.jsonValue["Name"] = "Telemetry Service";
- res.jsonValue["LogService"]["@odata.id"] =
- "/redfish/v1/Managers/bmc/LogServices/Journal";
+ res.jsonValue["MetricDefinitions"]["@odata.id"] =
+ "/redfish/v1/TelemetryService/MetricDefinitions";
res.jsonValue["MetricReportDefinitions"]["@odata.id"] =
@@ -680,5 +551,5 @@ index 8e01bee..00acdf9 100644
if (!json_util::readJson(req, asyncResp->res, "Temperatures",
--
-2.17.1
+2.16.6
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Sync-Telmetry-service-with-EventService.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Sync-Telmetry-service-with-EventService.patch
index 06c50b31f..3df9fe5ae 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Sync-Telmetry-service-with-EventService.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Sync-Telmetry-service-with-EventService.patch
@@ -1,27 +1,28 @@
-From b6286fe6800ca402b013e57429025fd9e4d65cab Mon Sep 17 00:00:00 2001
+From 14a429586fd8ccb82c72611fe3310860db2e643b Mon Sep 17 00:00:00 2001
From: "Wludzik, Jozef" <jozef.wludzik@intel.com>
-Date: Fri, 4 Dec 2020 14:48:41 +0100
-Subject: [PATCH] Sync Telmetry service with EventService
+Date: Tue, 15 Dec 2020 12:30:31 +0100
+Subject: [PATCH 4/4] Sync Telmetry service with EventService
-Now assembling MetricReport is done properly and is
-covered in one place - MetricReport node.
-Updated method of fetching Readings from Telemetry by
-EventService. Using ReportUpdate signal is no longer
-supported.
+Synced the latest changes in Telemetry service with Event Service
+code. Now assembling MetricReport is covered in single place in
+code. Updated method of fetching Readings from Telemetry by
+Event Service. Using ReportUpdate signal is no longer
+supported. Now Event Service monitors for PropertiesChanged signal
+from /xyz/openbmc_project/Telemetry/Reports path.
Tested:
- - Received MetricReport in EventListener server after
- adding subscription to EventService.
+ - Verified that EventListener received MetricReport response from
+ Event Service in insecure http push style eventing mode
Change-Id: I2fc1841a6c9259a8bff30b34bddc0d4aabd41912
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
---
- .../include/event_service_manager.hpp | 156 ++++++------------
- redfish-core/lib/metric_report.hpp | 35 ++--
- 2 files changed, 74 insertions(+), 117 deletions(-)
+ redfish-core/include/event_service_manager.hpp | 157 +++++++++----------------
+ redfish-core/lib/metric_report.hpp | 28 +++--
+ 2 files changed, 71 insertions(+), 114 deletions(-)
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
-index f68ae1d..893a813 100644
+index 3db9f0c..5c5a6c1 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -14,6 +14,7 @@
@@ -41,7 +42,7 @@ index f68ae1d..893a813 100644
- const ReadingsObjType& readings)
+ void filterAndSendReports(
+ const std::string& id,
-+ const std::variant<MetricReport::TimestampReadings>& var)
++ const std::variant<telemetry::TimestampReadings>& var)
{
- std::string metricReportDef =
- "/redfish/v1/TelemetryService/MetricReportDefinitions/" + id2;
@@ -62,7 +63,7 @@ index f68ae1d..893a813 100644
- nlohmann::json metricValuesArray = nlohmann::json::array();
- for (const auto& it : readings)
+ nlohmann::json json;
-+ if (!MetricReport::fillReport(json, id, var))
++ if (!telemetry::fillReport(json, id, var))
{
- metricValuesArray.push_back({});
- nlohmann::json& entry = metricValuesArray.back();
@@ -90,7 +91,7 @@ index f68ae1d..893a813 100644
}
void updateRetryConfig(const uint32_t retryAttempts,
-@@ -1342,56 +1324,71 @@ class EventServiceManager
+@@ -1342,56 +1324,72 @@ class EventServiceManager
}
#endif
@@ -152,7 +153,7 @@ index f68ae1d..893a813 100644
- if (!timestampPtr)
+ std::string intf;
+ std::vector<std::pair<
-+ std::string, std::variant<MetricReport::TimestampReadings>>>
++ std::string, std::variant<telemetry::TimestampReadings>>>
+ props;
+ std::vector<std::string> invalidProp;
+
@@ -166,7 +167,7 @@ index f68ae1d..893a813 100644
- ReadingsObjType* readingsPtr =
- std::get_if<ReadingsObjType>(&resp["Readings"]);
- if (!readingsPtr)
-+ const std::variant<MetricReport::TimestampReadings>* varPtr =
++ const std::variant<telemetry::TimestampReadings>* varPtr =
+ nullptr;
+ for (const auto& [key, var] : props)
+ {
@@ -183,15 +184,16 @@ index f68ae1d..893a813 100644
}
- if (!readingsPtr->size())
-+ std::string id;
-+ if (!dbus::utility::getNthStringFromPath(msg.get_path(), 5, id))
++ sdbusplus::message::object_path path(msg.get_path());
++ std::string id = path.filename();
++ if (id.empty())
{
- BMCWEB_LOG_DEBUG << "No metrics report to be transferred";
+ BMCWEB_LOG_ERROR << "Failed to get Id from path";
return;
}
-@@ -1401,52 +1398,9 @@ class EventServiceManager
+@@ -1401,52 +1399,9 @@ class EventServiceManager
std::shared_ptr<Subscription> entry = it.second;
if (entry->eventFormatType == metricReportFormatType)
{
@@ -246,85 +248,64 @@ index f68ae1d..893a813 100644
}
diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp
-index 050304c..c2013cc 100644
+index 9caf4a3..e79a41c 100644
--- a/redfish-core/lib/metric_report.hpp
+++ b/redfish-core/lib/metric_report.hpp
-@@ -52,6 +52,10 @@ class MetricReport : public Node
- {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
+@@ -31,16 +31,14 @@ inline nlohmann::json toMetricValues(const Readings& readings)
+ return metricValues;
+ }
+
+-inline void fillReport(const std::shared_ptr<AsyncResp>& asyncResp,
+- const std::string& id,
++inline bool fillReport(nlohmann::json& json, const std::string& id,
+ const std::variant<TimestampReadings>& var)
+ {
+- asyncResp->res.jsonValue["@odata.type"] =
+- "#MetricReport.v1_3_0.MetricReport";
+- asyncResp->res.jsonValue["@odata.id"] = telemetry::metricReportUri + id;
+- asyncResp->res.jsonValue["Id"] = id;
+- asyncResp->res.jsonValue["Name"] = id;
+- asyncResp->res.jsonValue["MetricReportDefinition"]["@odata.id"] =
++ json["@odata.type"] = "#MetricReport.v1_3_0.MetricReport";
++ json["@odata.id"] = telemetry::metricReportUri + id;
++ json["Id"] = id;
++ json["Name"] = id;
++ json["MetricReportDefinition"]["@odata.id"] =
+ telemetry::metricReportDefinitionUri + id;
+
+ const TimestampReadings* timestampReadings =
+@@ -48,14 +46,14 @@ inline void fillReport(const std::shared_ptr<AsyncResp>& asyncResp,
+ if (!timestampReadings)
+ {
+ BMCWEB_LOG_ERROR << "Property type mismatch or property is missing";
+- messages::internalError(asyncResp->res);
+- return;
++ return false;
}
-+ using Readings =
-+ std::vector<std::tuple<std::string, std::string, double, uint64_t>>;
-+ using TimestampReadings = std::tuple<uint64_t, Readings>;
-+
- private:
- void doGet(crow::Response& res, const crow::Request&,
- const std::vector<std::string>& params) override
-@@ -92,7 +96,10 @@ class MetricReport : public Node
+ const auto& [timestamp, readings] = *timestampReadings;
+- asyncResp->res.jsonValue["Timestamp"] =
++ json["Timestamp"] =
+ crow::utility::getDateTime(static_cast<time_t>(timestamp));
+- asyncResp->res.jsonValue["MetricValues"] = toMetricValues(readings);
++ json["MetricValues"] = toMetricValues(readings);
++ return true;
+ }
+ } // namespace telemetry
+
+@@ -146,7 +144,11 @@ class MetricReport : public Node
return;
}
-- fillReport(asyncResp, id, ret);
-+ if (!fillReport(asyncResp->res.jsonValue, id, ret))
+- telemetry::fillReport(asyncResp, id, ret);
++ if (!telemetry::fillReport(asyncResp->res.jsonValue, id,
++ ret))
+ {
+ messages::internalError(asyncResp->res);
+ }
},
telemetry::service, reportPath,
"org.freedesktop.DBus.Properties", "Get",
-@@ -102,10 +109,6 @@ class MetricReport : public Node
- "Update");
- }
-
-- using Readings =
-- std::vector<std::tuple<std::string, std::string, double, uint64_t>>;
-- using TimestampReadings = std::tuple<uint64_t, Readings>;
--
- static nlohmann::json toMetricValues(const Readings& readings)
- {
- nlohmann::json metricValues = nlohmann::json::array_t();
-@@ -130,15 +133,15 @@ class MetricReport : public Node
- return metricValues;
- }
-
-- static void fillReport(const std::shared_ptr<AsyncResp>& asyncResp,
-- const std::string& id,
-+ public:
-+ static bool fillReport(nlohmann::json& json, const std::string& id,
- const std::variant<TimestampReadings>& var)
- {
-- asyncResp->res.jsonValue["@odata.type"] = schemaType;
-- asyncResp->res.jsonValue["@odata.id"] = telemetry::metricReportUri + id;
-- asyncResp->res.jsonValue["Id"] = id;
-- asyncResp->res.jsonValue["Name"] = id;
-- asyncResp->res.jsonValue["MetricReportDefinition"]["@odata.id"] =
-+ json["@odata.type"] = schemaType;
-+ json["@odata.id"] = telemetry::metricReportUri + id;
-+ json["Id"] = id;
-+ json["Name"] = id;
-+ json["MetricReportDefinition"]["@odata.id"] =
- telemetry::metricReportDefinitionUri + id;
-
- const TimestampReadings* timestampReadings =
-@@ -146,14 +149,14 @@ class MetricReport : public Node
- if (!timestampReadings)
- {
- BMCWEB_LOG_ERROR << "Property type mismatch or property is missing";
-- messages::internalError(asyncResp->res);
-- return;
-+ return false;
- }
-
- const auto& [timestamp, readings] = *timestampReadings;
-- asyncResp->res.jsonValue["Timestamp"] =
-+ json["Timestamp"] =
- crow::utility::getDateTime(static_cast<time_t>(timestamp));
-- asyncResp->res.jsonValue["MetricValues"] = toMetricValues(readings);
-+ json["MetricValues"] = toMetricValues(readings);
-+ return true;
- }
-
- static constexpr const char* schemaType =
--
-2.17.1
+2.16.6
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README
index 833fabfec..35c6e90bc 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README
@@ -2,15 +2,12 @@ These patches are mirror of upstream TelemetryService implementation.
Until change is integrated they will be manually merged here to enable feature in Intel builds.
Current revisions:
-- Redfish TelemetryService schema implementation
- https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/31692/54
-
- Add POST and DELETE in MetricReportDefinitions
- https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/32536/46
+ https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/32536/58
- Add support for MetricDefinition scheme
- https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/33363/42
+ https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/33363/54
- Sync Telmetry service with EventService
- https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38798/9
+ https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38798/21
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
index e5037593f..db8a7a90f 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
@@ -1,5 +1,5 @@
SRC_URI = "git://github.com/openbmc/bmcweb.git"
-SRCREV = "a90daf182891521fcc7c3e99ba266e6a55d4b4dd"
+SRCREV = "2b3da45876aac57a36d3093379a992d699e7e396"
DEPENDS += "boost-url"
RDEPENDS_${PN} += "phosphor-nslcd-authority-cert-config"
@@ -22,17 +22,23 @@ SRC_URI += "file://0001-Firmware-update-configuration-changes.patch \
file://0009-Add-support-to-ChangePassword-action.patch \
file://0010-managers-add-attributes-for-Manager.CommandShell.patch \
file://0034-recommended-fixes-by-crypto-review-team.patch \
- file://0036-Fix-wrong-check-in-EventService-events.patch \
"
+# Temporary downstream mirror of upstream patch to enable feature in Intel builds.
+SRC_URI += "file://0037-Add-state-sensor-messages-to-the-registry.patch \
+"
# Temporary downstream mirror of upstream patches, see telemetry\README for details
-SRC_URI += "file://telemetry/0001-Redfish-TelemetryService-schema-implementation.patch \
- file://telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch \
+SRC_URI += "file://telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch \
file://telemetry/0003-Add-support-for-MetricDefinition-scheme.patch \
file://telemetry/0004-Sync-Telmetry-service-with-EventService.patch \
"
+SRC_URI += "file://0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch \
+ file://0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch \
+ file://0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch \
+"
+
# Temporary fix: Move it to service file
do_install_append() {
install -d ${D}/var/lib/bmcweb
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb
index 30a229022..8a6911345 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "The Node Manager Proxy provides a simple interface for communicat
with Management Engine via IPMB"
SRC_URI = "git://github.com/Intel-BMC/node-manager;protocol=ssh"
-SRCREV = "403434f80e6a6c476516848dde2512b37f7ec5d8"
+SRCREV = "1b243b3bfa5a3523a6ca9805626c8cf045146697"
PV = "0.1+git${SRCPV}"
LICENSE = "Apache-2.0"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/peci/peci-pcie_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/peci/peci-pcie_%.bbappend
index 71a6d58da..6744b172c 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/peci/peci-pcie_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/peci/peci-pcie_%.bbappend
@@ -1,3 +1,3 @@
SRC_URI = "git://github.com/openbmc/peci-pcie"
-SRCREV = "9fa54b52f83c00fd713085e6849d3f261672d008"
+SRCREV = "0b79f3e485554957a4b24d5f0cefc5bc577ad301"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb
index 099de5a47..61d008c46 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb
@@ -2,7 +2,7 @@ SUMMARY = "libmctp_intel"
DESCRIPTION = "Implementation of MCTP(DMTF DSP0236)"
SRC_URI = "git://github.com/Intel-BMC/libmctp.git;protocol=ssh"
-SRCREV = "14bf0b99083dda55b959273d63210407740c8217"
+SRCREV = "f5246c429d728ee1b6558692b72ef1960db68a7c"
S = "${WORKDIR}/git"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb
index d885bf227..d72093b8b 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb
@@ -2,7 +2,7 @@ SUMMARY = "libpldm_intel"
DESCRIPTION = "Provides encode/decode APIs for PLDM specifications"
SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git/libpldm_intel"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb
index 083394a24..291a18375 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab"
SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git/mctp_emulator"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb
index 88939348f..a56db5829 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab"
SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git/mctp_wrapper"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb
index 8612fc78d..226a3a44f 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${PN}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb
index a0c4ac42a..c9a44d1ad 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=615045c30a05cde5c0e924854d43c327"
SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git/mctpwplus"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb
index 3c443aa02..0167014b7 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SRC_URI += "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git/pldmd"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb
index 0997869d5..09a3f9284 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh"
-SRCREV = "7ec1523f3a982678fec20b0ccc94436f3d467126"
+SRCREV = "85f6b517b0c519b88b7533f042159e9a30fd3048"
S = "${WORKDIR}/git/pmci_launcher"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
index 33a19a902..cb4a74a0b 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend
@@ -1,4 +1,4 @@
# Enable downstream autobump
SRC_URI = "git://github.com/openbmc/phosphor-sel-logger.git"
-SRCREV = "7d8a3003fb8038291f5e678cbfd74344ec6e62d2"
+SRCREV = "aaffc124b6f49d9bc267e65565bdd5d4c1db1aaf"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch
index 0b2c19d32..cfdc99d66 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch
@@ -1,4 +1,4 @@
-From 6d553f9fb6829d7dbbe2f625a09f476b0ef91ca0 Mon Sep 17 00:00:00 2001
+From 0a1b2a13f6dbc64b5851ac2b1ca99d57afa78d60 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 27 Jan 2021 15:52:16 -0800
Subject: [PATCH] Fix PECI client creation flow
@@ -12,10 +12,10 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 54 insertions(+), 12 deletions(-)
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
-index dfc942fcf7f3..67be7447e74e 100644
+index f304e3f..92c1716 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
-@@ -84,6 +84,7 @@ struct CPUConfig
+@@ -82,6 +82,7 @@ struct CPUConfig
};
static constexpr const char* peciDev = "/dev/peci-";
@@ -23,16 +23,16 @@ index dfc942fcf7f3..67be7447e74e 100644
static constexpr const unsigned int rankNumMax = 8;
namespace fs = std::filesystem;
-@@ -169,7 +170,7 @@ bool createSensors(boost::asio::io_service& io,
+@@ -167,7 +168,7 @@ bool createSensors(boost::asio::io_service& io,
}
std::vector<fs::path> hwmonNamePaths;
- if (!findFiles(fs::path(R"(/sys/bus/peci/devices)"),
+ if (!findFiles(fs::path(peciDevPath),
R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/name$)",
- hwmonNamePaths, 1))
+ hwmonNamePaths, 6))
{
-@@ -405,7 +406,7 @@ bool createSensors(boost::asio::io_service& io,
+@@ -403,7 +404,7 @@ bool createSensors(boost::asio::io_service& io,
return true;
}
@@ -41,7 +41,7 @@ index dfc942fcf7f3..67be7447e74e 100644
{
std::ostringstream hex;
hex << std::hex << config.addr;
-@@ -413,9 +414,12 @@ void exportDevice(const CPUConfig& config)
+@@ -411,9 +412,12 @@ void exportDevice(const CPUConfig& config)
std::string busStr = std::to_string(config.bus);
std::string parameters = "peci-client 0x" + addrHexStr;
@@ -56,7 +56,7 @@ index dfc942fcf7f3..67be7447e74e 100644
const std::string& dir = devicePath.parent_path().string();
for (const auto& path : std::filesystem::directory_iterator(dir))
{
-@@ -433,20 +437,38 @@ void exportDevice(const CPUConfig& config)
+@@ -431,20 +435,38 @@ void exportDevice(const CPUConfig& config)
std::cout << parameters << " on bus " << busStr
<< " is already exported\n";
}
@@ -99,7 +99,7 @@ index dfc942fcf7f3..67be7447e74e 100644
}
void detectCpu(boost::asio::deadline_timer& pingTimer,
-@@ -462,6 +484,11 @@ void detectCpu(boost::asio::deadline_timer& pingTimer,
+@@ -460,6 +482,11 @@ void detectCpu(boost::asio::deadline_timer& pingTimer,
for (CPUConfig& config : cpuConfigs)
{
@@ -111,7 +111,7 @@ index dfc942fcf7f3..67be7447e74e 100644
std::string peciDevPath = peciDev + std::to_string(config.bus);
auto file = open(peciDevPath.c_str(), O_RDWR | O_CLOEXEC);
if (file < 0)
-@@ -512,16 +539,29 @@ void detectCpu(boost::asio::deadline_timer& pingTimer,
+@@ -510,16 +537,29 @@ void detectCpu(boost::asio::deadline_timer& pingTimer,
newState = State::OFF;
}
@@ -145,13 +145,13 @@ index dfc942fcf7f3..67be7447e74e 100644
}
if (newState == State::ON)
-@@ -544,6 +584,8 @@ void detectCpu(boost::asio::deadline_timer& pingTimer,
+@@ -542,6 +582,8 @@ void detectCpu(boost::asio::deadline_timer& pingTimer,
keepPinging = true;
}
+ close(file);
+
- if (DEBUG)
+ if (debug)
{
std::cout << config.name << ", state: " << config.state << "\n";
--
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch
new file mode 100644
index 000000000..c9175fd64
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch
@@ -0,0 +1,139 @@
+From 17e3ed85f2ff919ff52b4a3fe7a1eb0026f28898 Mon Sep 17 00:00:00 2001
+From: Zhikui Ren <zhikui.ren@intel.com>
+Date: Thu, 24 Sep 2020 14:27:32 -0700
+Subject: [PATCH] Fix missing threshold de-assert event when threshold changes.
+
+Sensor can be re-constructed when sensor configuration changes
+like a new threshold value. Threshold deassert can be missed
+if the new threshold value fixes the alarm because the
+default state for new threshold interface is de-asserted.
+Send threshold de-assert message after interfaces are initialized to
+ensure de-assert event is logged if there is an active assert
+event.
+
+Tested:
+step1:
+busctl set-property xyz.openbmc_project.ADCSensor /xyz/openbmc_project/sensors/voltage/P3VBAT xyz.openbmc_project.Sensor.Threshold.Warning WarningLow d 2.457
+ipmitool sel list
+SEL has no entries
+step2:
+busctl set-property xyz.openbmc_project.ADCSensor /xyz/openbmc_project/sensors/voltage/P3VBAT xyz.openbmc_project.Sensor.Threshold.Warning WarningLow d 3.1
+ipmitool sel list
+ 1 | 09/24/20 | 21:30:15 UTC | Voltage #0x2d | Lower Non-critical going low | Asserted
+step3:
+busctl set-property xyz.openbmc_project.ADCSensor /xyz/openbmc_project/sensors/voltage/P3VBAT xyz.openbmc_project.Sensor.Threshold.Warning WarningLow d 2.457
+ipmitool sel list
+ 1 | 09/24/20 | 21:30:15 UTC | Voltage #0x2d | Lower Non-critical going low | Asserted
+ 2 | 09/24/20 | 21:30:33 UTC | Voltage #0x2d | Lower Non-critical going low | Deasserted
+
+Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
+Change-Id: If28870ac1e0d09be4a631a3145408ec70390dfc5
+---
+ include/Thresholds.hpp | 5 ++++-
+ include/sensor.hpp | 13 +++++++++++++
+ src/ADCSensor.cpp | 1 +
+ src/Thresholds.cpp | 15 +++++++++++++--
+ 4 files changed, 31 insertions(+), 3 deletions(-)
+
+diff --git a/include/Thresholds.hpp b/include/Thresholds.hpp
+index ca2b0a0..c1d0baf 100644
+--- a/include/Thresholds.hpp
++++ b/include/Thresholds.hpp
+@@ -45,7 +45,10 @@ struct Threshold
+
+ void assertThresholds(Sensor* sensor, double assertValue,
+ thresholds::Level level, thresholds::Direction direction,
+- bool assert);
++ bool assert, bool force = false);
++
++void forceDeassertThresholds(Sensor* sensor, thresholds::Level level,
++ thresholds::Direction direction);
+
+ struct TimerUsed
+ {
+diff --git a/include/sensor.hpp b/include/sensor.hpp
+index 0ef87d5..d50b2ff 100644
+--- a/include/sensor.hpp
++++ b/include/sensor.hpp
+@@ -312,6 +312,19 @@ struct Sensor
+ operationalInterface->register_property("Functional", true);
+ operationalInterface->initialize();
+ }
++
++ // Sensor can be reconstructed when sensor configuration changes
++ // like a new threshold value. Threshold deassert can be missed
++ // if the new threshold value fixes the alarm because
++ // default state for new threshold interface is de-asserted.
++ // Send threshold de-assert message during initialization to
++ // ensure de-assert events are logged if there is an active assert
++ // event.
++ for (auto& threshold : thresholds)
++ {
++ thresholds::forceDeassertThresholds(this, threshold.level,
++ threshold.direction);
++ }
+ }
+
+ bool readingStateGood()
+diff --git a/src/ADCSensor.cpp b/src/ADCSensor.cpp
+index fe600d7..632fc8c 100644
+--- a/src/ADCSensor.cpp
++++ b/src/ADCSensor.cpp
+@@ -88,6 +88,7 @@ ADCSensor::~ADCSensor()
+ // close the input dev to cancel async operations
+ inputDev.close();
+ waitTimer.cancel();
++
+ objServer.remove_interface(thresholdInterfaceWarning);
+ objServer.remove_interface(thresholdInterfaceCritical);
+ objServer.remove_interface(sensorInterface);
+diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
+index f4d4ed0..3c791c9 100644
+--- a/src/Thresholds.cpp
++++ b/src/Thresholds.cpp
+@@ -344,6 +344,7 @@ bool checkThresholds(Sensor* sensor)
+ {
+ bool status = true;
+ std::vector<ChangeParam> changes = checkThresholds(sensor, sensor->value);
++
+ for (const auto& change : changes)
+ {
+ assertThresholds(sensor, change.assertValue, change.threshold.level,
+@@ -392,7 +393,7 @@ void checkThresholdsPowerDelay(Sensor* sensor, ThresholdTimer& thresholdTimer)
+
+ void assertThresholds(Sensor* sensor, double assertValue,
+ thresholds::Level level, thresholds::Direction direction,
+- bool assert)
++ bool assert, bool force)
+ {
+ std::string property;
+ std::shared_ptr<sdbusplus::asio::dbus_interface> interface;
+@@ -432,7 +433,9 @@ void assertThresholds(Sensor* sensor, double assertValue,
+ return;
+ }
+
+- if (interface->set_property<bool, true>(property, assert))
++ bool propertyChanged =
++ interface->set_property<bool, true>(property, assert);
++ if (force || propertyChanged)
+ {
+ try
+ {
+@@ -452,6 +455,14 @@ void assertThresholds(Sensor* sensor, double assertValue,
+ }
+ }
+
++// Explicitely de-assert a threshold with existing sensor value
++// Should only be called on sensor desctruction
++void forceDeassertThresholds(Sensor* sensor, thresholds::Level level,
++ thresholds::Direction direction)
++{
++ assertThresholds(sensor, sensor->value, level, direction, false, true);
++}
++
+ bool parseThresholdsFromAttr(
+ std::vector<thresholds::Threshold>& thresholdVector,
+ const std::string& inputPath, const double& scaleFactor,
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch
new file mode 100644
index 000000000..65558aba5
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch
@@ -0,0 +1,58 @@
+From 8f850ea8745aa7aafcb504aa50686ba00fdfcfee Mon Sep 17 00:00:00 2001
+From: Zhikui Ren <zhikui.ren@intel.com>
+Date: Fri, 19 Feb 2021 12:14:05 -0800
+Subject: [PATCH] Fan Tach Sensor Threshold Ignore Zero
+
+Currently there are systems that have system fans plugged
+into different fan connectors. Fan present detection is
+not supported in most of these systems. Critical low
+threshold is asserted for the non-utilized fans
+resulting in FSC boost all fans.
+
+Skip threshold checking for fan tach reading less or equal
+to zero. This is a temporary WA until a more robust solution
+is available.
+
+Note: with this workaround a completely non-working fan
+will not be detected. FSC will still boost fans due to other
+constraints if the system can't be cooled with the working fans.
+
+Tested:
+No cr event for the missing fans.
+
+Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
+---
+ src/TachSensor.cpp | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
+index 1ec979f..b17be98 100644
+--- a/src/TachSensor.cpp
++++ b/src/TachSensor.cpp
+@@ -185,12 +185,18 @@ void TachSensor::handleResponse(const boost::system::error_code& err)
+
+ void TachSensor::checkThresholds(void)
+ {
+- bool status = thresholds::checkThresholds(this);
+-
+- if (redundancy && *redundancy)
++ // WA - treat value <= 0 as not present
++ bool status = false;
++ if (value > 0)
+ {
+- (*redundancy)
+- ->update("/xyz/openbmc_project/sensors/fan_tach/" + name, !status);
++ status = thresholds::checkThresholds(this);
++
++ if (redundancy && *redundancy)
++ {
++ (*redundancy)
++ ->update("/xyz/openbmc_project/sensors/fan_tach/" + name,
++ !status);
++ }
+ }
+
+ bool curLed = !status;
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch
new file mode 100644
index 000000000..8119f7542
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch
@@ -0,0 +1,29 @@
+From f85dd776301371892ff5197c1995bf2224dd87ab Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Mon, 22 Feb 2021 15:57:20 -0800
+Subject: [PATCH] Fix PECI ioctl number
+
+This commit fixes PECI ioctl number to 0xb8 to avoid conflicts in
+kernel v5.10.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ include/linux/peci-ioctl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/linux/peci-ioctl.h b/include/linux/peci-ioctl.h
+index e5b4b8bd3275..1f44edf4fc04 100644
+--- a/include/linux/peci-ioctl.h
++++ b/include/linux/peci-ioctl.h
+@@ -601,7 +601,7 @@ struct peci_crashdump_get_frame_msg {
+ __u8 data[16];
+ } __attribute__((__packed__));
+
+-#define PECI_IOC_BASE 0xb7
++#define PECI_IOC_BASE 0xb8
+
+ #define PECI_IOC_XFER \
+ _IOWR(PECI_IOC_BASE, PECI_CMD_XFER, struct peci_xfer_msg)
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend
index 39a6f1581..bb1268e0a 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend
@@ -1,13 +1,16 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
PROJECT_SRC_DIR := "${THISDIR}/${PN}"
-SRCREV = "a3e8f2a391f389ffb2c379ca0c181e67de43824e"
+SRCREV = "d05867c0d32065d36b13bd452f7aff9dcb20ac2f"
#SRC_URI = "git://github.com/openbmc/dbus-sensors.git"
SRC_URI += "\
file://intrusionsensor-depend-on-networkd.conf \
file://0001-Add-check-for-min-max-received-from-hwmon-files.patch \
file://0002-Fix-PECI-client-creation-flow.patch \
+ file://0003-Fix-missing-threshold-de-assert-event-when-threshold.patch \
+ file://0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch \
+ file://0005-Fix-PECI-ioctl-number.patch \
"
DEPENDS_append = " libgpiod libmctp"
@@ -24,14 +27,12 @@ PACKAGECONFIG += " \
psusensor \
"
-PACKAGECONFIG[nvmesensor] = "-DDISABLE_NVME=OFF, -DDISABLE_NVME=ON"
+PACKAGECONFIG[nvmesensor] = "-Dnvme=enabled, -Dnvme=disabled"
SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'nvmesensor', \
'xyz.openbmc_project.nvmesensor.service', \
'', d)}"
-PACKAGECONFIG_remove = "nvmesensor"
-
do_install_append() {
svc="xyz.openbmc_project.intrusionsensor.service"
srcf="${WORKDIR}/intrusionsensor-depend-on-networkd.conf"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb
index 986d50f2d..6acbfff37 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb
@@ -1,7 +1,7 @@
SUMMARY = "Settings"
SRC_URI = "git://github.com/Intel-BMC/settings.git;protocol=ssh"
-SRCREV = "946ac7669602d5660310e8609f500dadf16bb16d"
+SRCREV = "1bdbb05873b5790bd56b683ce8ddf1a02a6795e7"
PV = "0.1+git${SRCPV}"
LICENSE = "Apache-2.0"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb
index 85e3d6e8b..c77e5ace6 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb
@@ -9,7 +9,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "git://github.com/Intel-BMC/special-mode-manager.git;protocol=ssh"
-SRCREV = "024531a11dbe2bd13f2f6e59bdb41a22fce8b431"
+SRCREV = "32ea1e19df9e5179054d87617468664367dfab80"
EXTRA_OECMAKE += "${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'validation-unsecure', '-DBMC_VALIDATION_UNSECURE_FEATURE=ON', '', d)}"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend
index 1468afe49..cadacc235 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend
@@ -1,5 +1,5 @@
SRC_URI = "git://github.com/openbmc/telemetry.git"
-SRCREV = "405c1e4bf8b993cb3800adead546e91b030ecb9b"
+SRCREV = "92cfff44d5790b7e59930e8a6acf15751a3cd891"
EXTRA_OEMESON += " -Dmax-reports=5"
EXTRA_OEMESON += " -Dmax-reading-parameters=200"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch
index 2182201cf..dfd980a2b 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch
@@ -1,7 +1,7 @@
-From ab2ff3d715b00a13b0a670fb010793dc626352e0 Mon Sep 17 00:00:00 2001
+From 6fd1c797ec7440551052e8fc638d06313c9d6836 Mon Sep 17 00:00:00 2001
From: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
Date: Mon, 2 Jul 2018 19:23:25 -0700
-Subject: [PATCH] Added suport for multiple user manager services
+Subject: [PATCH 1/2] Added suport for multiple user manager services
Support added for SSSD service implementation
@@ -10,12 +10,12 @@ Signed-off-by: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
---
Makefile.am | 5 +-
- mainapp.cpp | 89 ++++++-
- user_mgr.cpp | 297 ++-------------------
+ mainapp.cpp | 90 +++++-
+ user_mgr.cpp | 297 ++----------------
user_mgr.hpp | 9 +-
- user_service.cpp | 786 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- user_service.hpp | 233 +++++++++++++++++
- 6 files changed, 1145 insertions(+), 274 deletions(-)
+ user_service.cpp | 789 +++++++++++++++++++++++++++++++++++++++++++++++
+ user_service.hpp | 233 ++++++++++++++
+ 6 files changed, 1149 insertions(+), 274 deletions(-)
create mode 100644 user_service.cpp
create mode 100644 user_service.hpp
@@ -39,18 +39,19 @@ index 7c7271e..58916b0 100644
phosphor_user_manager_LDFLAGS = $(SDBUSPLUS_LIBS) \
$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
diff --git a/mainapp.cpp b/mainapp.cpp
-index c9da030..03c406a 100644
+index e08da61..f4b7f8c 100644
--- a/mainapp.cpp
+++ b/mainapp.cpp
-@@ -14,18 +14,105 @@
- * limitations under the License.
- */
- #include <string>
-+#include <iostream>
-+#include <getopt.h>
+@@ -16,18 +16,106 @@
+ #include "config.h"
+
#include "user_mgr.hpp"
+#include "user_service.hpp"
- #include "config.h"
+
++#include <getopt.h>
++
++#include <iostream>
+ #include <string>
// D-Bus root for user manager
constexpr auto USER_MANAGER_ROOT = "/xyz/openbmc_project/user";
@@ -150,63 +151,66 @@ index c9da030..03c406a 100644
// Claim the bus now
bus.request_name(USER_MANAGER_BUSNAME);
diff --git a/user_mgr.cpp b/user_mgr.cpp
-index 9694fd1..c48196a 100644
+index c65a822..eed81aa 100644
--- a/user_mgr.cpp
+++ b/user_mgr.cpp
-@@ -14,27 +14,20 @@
- // limitations under the License.
- */
+@@ -18,43 +18,34 @@
+
+ #include "user_mgr.hpp"
+
+-#include "file.hpp"
+ #include "shadowlock.hpp"
+ #include "users.hpp"
+ #include <grp.h>
+ #include <pwd.h>
-#include <shadow.h>
--#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
#include <time.h>
-+#include <cstdio>
- #include <fstream>
- #include <grp.h>
- #include <pwd.h>
- #include <regex>
--#include <algorithm>
--#include <numeric>
+-#include <unistd.h>
+
+ #include <boost/algorithm/string/split.hpp>
-#include <boost/process/child.hpp>
-#include <boost/process/io.hpp>
- #include <boost/algorithm/string/split.hpp>
+ #include <phosphor-logging/elog-errors.hpp>
+ #include <phosphor-logging/elog.hpp>
+ #include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/User/Common/error.hpp>
- #include <phosphor-logging/log.hpp>
- #include <phosphor-logging/elog.hpp>
- #include <phosphor-logging/elog-errors.hpp>
+
+-#include <algorithm>
++#include <cstdio>
+ #include <fstream>
+-#include <numeric>
+ #include <regex>
+#include <stdexcept>
- #include "shadowlock.hpp"
--#include "file.hpp"
- #include "user_mgr.hpp"
- #include "users.hpp"
- #include "config.h"
-@@ -44,12 +37,10 @@ namespace phosphor
+
+ namespace phosphor
+ {
namespace user
{
--static constexpr const char *passwdFileName = "/etc/passwd";
+-static constexpr const char* passwdFileName = "/etc/passwd";
static constexpr size_t ipmiMaxUsers = 15;
static constexpr size_t ipmiMaxUserNameLen = 16;
static constexpr size_t systemMaxUserNameLen = 30;
static constexpr size_t maxSystemUsers = 30;
--static constexpr const char *grpSsh = "ssh";
+-static constexpr const char* grpSsh = "ssh";
static constexpr uint8_t minPasswdLength = 8;
static constexpr int success = 0;
static constexpr int failure = -1;
-@@ -95,79 +86,6 @@ using NoResource =
+@@ -100,79 +91,6 @@ using NoResource =
using Argument = xyz::openbmc_project::Common::InvalidArgument;
-template <typename... ArgTypes>
--static std::vector<std::string> executeCmd(const char *path,
-- ArgTypes &&... tArgs)
+-static std::vector<std::string> executeCmd(const char* path,
+- ArgTypes&&... tArgs)
-{
- std::vector<std::string> stdOutput;
- boost::process::ipstream stdOutStream;
-- boost::process::child execProg(path, const_cast<char *>(tArgs)...,
+- boost::process::child execProg(path, const_cast<char*>(tArgs)...,
- boost::process::std_out > stdOutStream);
- std::string stdOutLine;
-
@@ -254,7 +258,7 @@ index 9694fd1..c48196a 100644
- }
-}
-
--static bool removeStringFromCSV(std::string &csvStr, const std::string &delStr)
+-static bool removeStringFromCSV(std::string& csvStr, const std::string& delStr)
-{
- std::string::size_type delStrPos = csvStr.find(delStr);
- if (delStrPos != std::string::npos)
@@ -273,10 +277,10 @@ index 9694fd1..c48196a 100644
- return false;
-}
-
- bool UserMgr::isUserExist(const std::string &userName)
+ bool UserMgr::isUserExist(const std::string& userName)
{
if (userName.empty())
-@@ -294,39 +212,14 @@ void UserMgr::createUser(std::string userName,
+@@ -299,39 +217,14 @@ void UserMgr::createUser(std::string userName,
{
throwForInvalidPrivilege(priv);
throwForInvalidGroups(groupNames);
@@ -306,7 +310,7 @@ index 9694fd1..c48196a 100644
- (sshRequested ? "/bin/sh" : "/bin/nologin"), "-e",
- (enabled ? "" : "1970-01-02"));
- }
-- catch (const InternalFailure &e)
+- catch (const InternalFailure& e)
- {
- log<level::ERR>("Unable to create new user");
- elog<InternalFailure>();
@@ -319,7 +323,7 @@ index 9694fd1..c48196a 100644
std::string userObj = std::string(usersObjPath) + "/" + userName;
std::sort(groupNames.begin(), groupNames.end());
usersList.emplace(
-@@ -340,19 +233,11 @@ void UserMgr::createUser(std::string userName,
+@@ -345,19 +238,11 @@ void UserMgr::createUser(std::string userName,
void UserMgr::deleteUser(std::string userName)
{
@@ -330,7 +334,7 @@ index 9694fd1..c48196a 100644
- {
- executeCmd("/usr/sbin/userdel", userName.c_str(), "-r");
- }
-- catch (const InternalFailure &e)
+- catch (const InternalFailure& e)
- {
- log<level::ERR>("User delete failed",
- entry("USER_NAME=%s", userName.c_str()));
@@ -343,7 +347,7 @@ index 9694fd1..c48196a 100644
usersList.erase(userName);
-@@ -363,24 +248,13 @@ void UserMgr::deleteUser(std::string userName)
+@@ -368,24 +253,13 @@ void UserMgr::deleteUser(std::string userName)
void UserMgr::renameUser(std::string userName, std::string newUserName)
{
@@ -359,7 +363,7 @@ index 9694fd1..c48196a 100644
- executeCmd("/usr/sbin/usermod", "-l", newUserName.c_str(),
- userName.c_str(), "-d", newHomeDir.c_str(), "-m");
- }
-- catch (const InternalFailure &e)
+- catch (const InternalFailure& e)
- {
- log<level::ERR>("User rename failed",
- entry("USER_NAME=%s", userName.c_str()));
@@ -368,19 +372,19 @@ index 9694fd1..c48196a 100644
+ // Call The User Service to rename user on the system
+ userSrvc->renameUser(userName, newUserName);
+ // Update local list to reflect the name change
- const auto &user = usersList[userName];
+ const auto& user = usersList[userName];
std::string priv = user.get()->userPrivilege();
std::vector<std::string> groupNames = user.get()->userGroups();
-@@ -404,8 +278,6 @@ void UserMgr::updateGroupsAndPriv(const std::string &userName,
+@@ -409,8 +283,6 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
{
throwForInvalidPrivilege(priv);
throwForInvalidGroups(groupNames);
- // All user management lock has to be based on /etc/shadow
- phosphor::user::shadow::Lock lock();
throwForUserDoesNotExist(userName);
- const std::vector<std::string> &oldGroupNames =
+ const std::vector<std::string>& oldGroupNames =
usersList[userName].get()->userGroups();
-@@ -421,29 +293,8 @@ void UserMgr::updateGroupsAndPriv(const std::string &userName,
+@@ -426,29 +298,8 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
throwForMaxGrpUserCount(groupNames);
}
@@ -402,7 +406,7 @@ index 9694fd1..c48196a 100644
- executeCmd("/usr/sbin/usermod", userName.c_str(), "-G", groups.c_str(),
- "-s", (sshRequested ? "/bin/sh" : "/bin/nologin"));
- }
-- catch (const InternalFailure &e)
+- catch (const InternalFailure& e)
- {
- log<level::ERR>("Unable to modify user privilege / groups");
- elog<InternalFailure>();
@@ -412,9 +416,9 @@ index 9694fd1..c48196a 100644
log<level::INFO>("User groups / privilege updated successfully",
entry("USER_NAME=%s", userName.c_str()));
-@@ -639,19 +490,9 @@ int UserMgr::setPamModuleArgValue(const std::string &moduleName,
+@@ -644,19 +495,9 @@ int UserMgr::setPamModuleArgValue(const std::string& moduleName,
- void UserMgr::userEnable(const std::string &userName, bool enabled)
+ void UserMgr::userEnable(const std::string& userName, bool enabled)
{
- // All user management lock has to be based on /etc/shadow
- phosphor::user::shadow::Lock lock();
@@ -424,7 +428,7 @@ index 9694fd1..c48196a 100644
- executeCmd("/usr/sbin/usermod", userName.c_str(), "-e",
- (enabled ? "" : "1970-01-02"));
- }
-- catch (const InternalFailure &e)
+- catch (const InternalFailure& e)
- {
- log<level::ERR>("Unable to modify user enabled state");
- elog<InternalFailure>();
@@ -434,7 +438,7 @@ index 9694fd1..c48196a 100644
log<level::INFO>("User enabled/disabled state updated successfully",
entry("USER_NAME=%s", userName.c_str()),
-@@ -773,54 +614,8 @@ bool UserMgr::userPasswordExpired(const std::string &userName)
+@@ -779,54 +620,8 @@ bool UserMgr::userPasswordExpired(const std::string& userName)
UserSSHLists UserMgr::getUserAndSshGrpList()
{
@@ -491,15 +495,15 @@ index 9694fd1..c48196a 100644
}
size_t UserMgr::getIpmiUsersCount()
-@@ -831,49 +626,14 @@ size_t UserMgr::getIpmiUsersCount()
+@@ -837,49 +632,14 @@ size_t UserMgr::getIpmiUsersCount()
- bool UserMgr::isUserEnabled(const std::string &userName)
+ bool UserMgr::isUserEnabled(const std::string& userName)
{
- // All user management lock has to be based on /etc/shadow
- phosphor::user::shadow::Lock lock();
- std::array<char, 4096> buffer{};
- struct spwd spwd;
-- struct spwd *resultPtr = nullptr;
+- struct spwd* resultPtr = nullptr;
- int status = getspnam_r(userName.c_str(), &spwd, buffer.data(),
- buffer.max_size(), &resultPtr);
- if (!status && (&spwd == resultPtr))
@@ -515,13 +519,13 @@ index 9694fd1..c48196a 100644
+ return userSrvc->isUserEnabled(userName);
}
- std::vector<std::string> UserMgr::getUsersInGroup(const std::string &groupName)
+ std::vector<std::string> UserMgr::getUsersInGroup(const std::string& groupName)
{
- std::vector<std::string> usersInGroup;
- // Should be more than enough to get the pwd structure.
- std::array<char, 4096> buffer{};
- struct group grp;
-- struct group *resultPtr = nullptr;
+- struct group* resultPtr = nullptr;
-
- int status = getgrnam_r(groupName.c_str(), &grp, buffer.data(),
- buffer.max_size(), &resultPtr);
@@ -545,7 +549,7 @@ index 9694fd1..c48196a 100644
}
DbusUserObj UserMgr::getPrivilegeMapperObject(void)
-@@ -1104,11 +864,9 @@ void UserMgr::initUserObjects(void)
+@@ -1106,11 +866,9 @@ void UserMgr::initUserObjects(void)
{
// All user management lock has to be based on /etc/shadow
phosphor::user::shadow::Lock lock();
@@ -559,20 +563,20 @@ index 9694fd1..c48196a 100644
if (!userNameList.empty())
{
-@@ -1163,8 +921,10 @@ void UserMgr::initUserObjects(void)
+@@ -1165,8 +923,10 @@ void UserMgr::initUserObjects(void)
}
}
--UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) :
+-UserMgr::UserMgr(sdbusplus::bus::bus& bus, const char* path) :
- Ifaces(bus, path, true), bus(bus), path(path)
-+UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path,
++UserMgr::UserMgr(sdbusplus::bus::bus& bus, const char* path,
+ UserService::ServiceType srvc) :
+ Ifaces(bus, path, true),
+ bus(bus), path(path)
{
UserMgrIface::allPrivileges(privMgr);
std::sort(groupsMgr.begin(), groupsMgr.end());
-@@ -1272,6 +1032,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) :
+@@ -1274,6 +1034,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus& bus, const char* path) :
}
AccountPolicyIface::accountUnlockTimeout(value32);
}
@@ -581,18 +585,18 @@ index 9694fd1..c48196a 100644
// emit the signal
diff --git a/user_mgr.hpp b/user_mgr.hpp
-index e25ca87..262aaf9 100644
+index f5aac22..5d5ca99 100644
--- a/user_mgr.hpp
+++ b/user_mgr.hpp
-@@ -21,6 +21,7 @@
- #include <unordered_map>
- #include <variant>
- #include "users.hpp"
+@@ -14,6 +14,7 @@
+ // limitations under the License.
+ */
+ #pragma once
+#include "user_service.hpp"
+ #include "users.hpp"
- namespace phosphor
- {
-@@ -28,8 +29,6 @@ namespace user
+ #include <sdbusplus/bus.hpp>
+@@ -30,8 +31,6 @@ namespace user
{
using UserMgrIface = sdbusplus::xyz::openbmc_project::User::server::Manager;
@@ -601,19 +605,19 @@ index e25ca87..262aaf9 100644
using AccountPolicyIface =
sdbusplus::xyz::openbmc_project::User::server::AccountPolicy;
-@@ -76,8 +75,10 @@ class UserMgr : public Ifaces
+@@ -77,8 +76,10 @@ class UserMgr : public Ifaces
*
* @param[in] bus - sdbusplus handler
* @param[in] path - D-Bus path
+ * @param[in] srvc - User service to be used
*/
-- UserMgr(sdbusplus::bus::bus &bus, const char *path);
-+ UserMgr(sdbusplus::bus::bus &bus, const char *path,
+- UserMgr(sdbusplus::bus::bus& bus, const char* path);
++ UserMgr(sdbusplus::bus::bus& bus, const char* path,
+ UserService::ServiceType srvc);
/** @brief create user method.
* This method creates a new user as requested
-@@ -193,6 +194,8 @@ class UserMgr : public Ifaces
+@@ -194,6 +195,8 @@ class UserMgr : public Ifaces
/** @brief object path */
const std::string path;
@@ -624,10 +628,10 @@ index e25ca87..262aaf9 100644
"priv-user", "priv-noaccess"};
diff --git a/user_service.cpp b/user_service.cpp
new file mode 100644
-index 0000000..c3c45bd
+index 0000000..ad4e510
--- /dev/null
+++ b/user_service.cpp
-@@ -0,0 +1,786 @@
+@@ -0,0 +1,789 @@
+/*
+// Copyright (c) 2018 Intel Corporation
+//
@@ -644,15 +648,19 @@ index 0000000..c3c45bd
+// limitations under the License.
+*/
+
++#include "user_service.hpp"
++
++#include "file.hpp"
++#include "shadowlock.hpp"
++
+#include <grp.h>
+#include <pwd.h>
-+#include <numeric>
++
++#include <boost/algorithm/string/split.hpp>
+#include <boost/process/child.hpp>
+#include <boost/process/io.hpp>
-+#include <boost/algorithm/string/split.hpp>
-+#include "shadowlock.hpp"
-+#include "file.hpp"
-+#include "user_service.hpp"
++
++#include <numeric>
+
+/* anonymous namespace for User Service interface implementations.
+// Each class inside this namespace implements a special service
@@ -689,7 +697,7 @@ index 0000000..c3c45bd
+ }
+}
+
-+bool removeStringFromCSV(std::string &csvStr, const std::string &delStr)
++bool removeStringFromCSV(std::string& csvStr, const std::string& delStr)
+{
+ std::string::size_type delStrPos = csvStr.find(delStr);
+ if (delStrPos != std::string::npos)
@@ -770,14 +778,14 @@ index 0000000..c3c45bd
+ }
+
+ std::vector<std::string>
-+ getUsersInGroup(const std::string &groupName) const override
++ getUsersInGroup(const std::string& groupName) const override
+ {
+ std::vector<std::string> usersInGroup;
+ // Should be more than enough to get the pwd structure.
+ std::array<char, 4096> buffer{};
+ struct group grp;
-+ struct group *grpPtr = &grp;
-+ struct group *resultPtr;
++ struct group* grpPtr = &grp;
++ struct group* resultPtr;
+
+ int status = getgrnam_r(groupName.c_str(), grpPtr, buffer.data(),
+ buffer.max_size(), &resultPtr);
@@ -799,9 +807,9 @@ index 0000000..c3c45bd
+ return usersInGroup;
+ }
+
-+ void createUser(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv, const bool &enabled) const override
++ void createUser(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv, const bool& enabled) const override
+ {
+ // All user management lock has to be based on /etc/shadow
+ phosphor::user::shadow::Lock lock();
@@ -827,7 +835,7 @@ index 0000000..c3c45bd
+ "-m", "-N", "-s", (sshRequested ? "/bin/sh" : "/bin/nologin"),
+ "-e", (enabled ? "" : "1970-01-02"));
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to create new user");
@@ -835,8 +843,8 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ void renameUser(const std::string &userName,
-+ const std::string &newUserName) const override
++ void renameUser(const std::string& userName,
++ const std::string& newUserName) const override
+ {
+ // All user management lock has to be based on /etc/shadow
+ phosphor::user::shadow::Lock lock();
@@ -847,7 +855,7 @@ index 0000000..c3c45bd
+ newUserName.c_str(), userName.c_str(),
+ "-d", newHomeDir.c_str(), "-m");
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::INFO>(
+ "User rename failed",
@@ -856,7 +864,7 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ void deleteUser(const std::string &userName) const override
++ void deleteUser(const std::string& userName) const override
+ {
+ // All user management lock has to be based on /etc/shadow
+ phosphor::user::shadow::Lock lock();
@@ -866,7 +874,7 @@ index 0000000..c3c45bd
+ phosphor::user::executeCmd("/usr/sbin/userdel", userName.c_str(),
+ "-r");
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::INFO>(
+ "User delete failed",
@@ -875,9 +883,9 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ void updateGroupsAndPriv(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv) const override
++ void updateGroupsAndPriv(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv) const override
+ {
+ // All user management lock has to be based on /etc/shadow
+ phosphor::user::shadow::Lock lock();
@@ -902,7 +910,7 @@ index 0000000..c3c45bd
+ "/usr/sbin/usermod", userName.c_str(), "-G", groups.c_str(),
+ "-s", (sshRequested ? "/bin/sh" : "/bin/nologin"));
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to modify user privilege / groups");
@@ -910,8 +918,8 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ void updateUserStatus(const std::string &userName,
-+ const bool &enabled) const override
++ void updateUserStatus(const std::string& userName,
++ const bool& enabled) const override
+ {
+ // All user management lock has to be based on /etc/shadow
+ phosphor::user::shadow::Lock lock();
@@ -920,7 +928,7 @@ index 0000000..c3c45bd
+ phosphor::user::executeCmd("/usr/sbin/usermod", userName.c_str(),
+ "-e", (enabled ? "" : "1970-01-02"));
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to modify user enabled state");
@@ -928,13 +936,13 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ bool isUserEnabled(const std::string &userName) const override
++ bool isUserEnabled(const std::string& userName) const override
+ {
+ // All user management lock has to be based on /etc/shadow
+ phosphor::user::shadow::Lock lock();
+ std::array<char, 4096> buffer{};
+ struct spwd spwd;
-+ struct spwd *resultPtr = nullptr;
++ struct spwd* resultPtr = nullptr;
+ int status = getspnam_r(userName.c_str(), &spwd, buffer.data(),
+ buffer.max_size(), &resultPtr);
+ if (!status && (&spwd == resultPtr))
@@ -949,7 +957,7 @@ index 0000000..c3c45bd
+ }
+
+ std::vector<std::string>
-+ getUserGroups(const std::string &userName) const override
++ getUserGroups(const std::string& userName) const override
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "ShadowService::getUserGroups not implemented!");
@@ -957,7 +965,7 @@ index 0000000..c3c45bd
+ return std::vector<std::string>();
+ }
+
-+ void createGroup(const std::string &groupName) const override
++ void createGroup(const std::string& groupName) const override
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "ShadowService::createGroup not implemented!");
@@ -965,22 +973,22 @@ index 0000000..c3c45bd
+ }
+
+ private:
-+ static constexpr const char *passwdFileName = "/etc/passwd";
++ static constexpr const char* passwdFileName = "/etc/passwd";
+};
+
+class SSSDService : public phosphor::user::UserServiceInterface
+{
+ public:
-+ SSSDService(const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs)
++ SSSDService(const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs)
+ {
+
+ createGroup(lockedGrp);
-+ for (const auto &g : groups)
++ for (const auto& g : groups)
+ {
+ createGroup(g);
+ }
-+ for (const auto &p : privs)
++ for (const auto& p : privs)
+ {
+ createGroup(p);
+ }
@@ -999,7 +1007,7 @@ index 0000000..c3c45bd
+ exeOutput = phosphor::user::executeCmd("/usr/bin/getent", "-s",
+ "sss", "passwd");
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to get users information "
@@ -1007,7 +1015,7 @@ index 0000000..c3c45bd
+ phosphor::logging::elog<phosphor::user::InternalFailure>();
+ }
+
-+ for (const auto &userLine : exeOutput)
++ for (const auto& userLine : exeOutput)
+ {
+ std::vector<std::string> userInfo;
+ boost::algorithm::split(userInfo, userLine,
@@ -1035,7 +1043,7 @@ index 0000000..c3c45bd
+ }
+
+ std::vector<std::string>
-+ getUsersInGroup(const std::string &groupName) const override
++ getUsersInGroup(const std::string& groupName) const override
+ {
+ std::vector<std::string> userList;
+ std::vector<std::string> exeOutput;
@@ -1045,7 +1053,7 @@ index 0000000..c3c45bd
+ exeOutput = phosphor::user::executeCmd("/usr/sbin/sss_groupshow",
+ groupName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to get group users from sssd service");
@@ -1067,9 +1075,9 @@ index 0000000..c3c45bd
+ return userList;
+ }
+
-+ void createUser(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv, const bool &enabled) const override
++ void createUser(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv, const bool& enabled) const override
+ {
+ std::string groups = getCSVFromVector(groupNames);
+ bool sshRequested = removeStringFromCSV(groups, phosphor::user::grpSsh);
@@ -1090,7 +1098,7 @@ index 0000000..c3c45bd
+ "/usr/sbin/sss_useradd", "-m", "-G", groups.c_str(), "-s",
+ (sshRequested ? "/bin/sh" : "/bin/nologin"), userName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to create new user in sssd service");
@@ -1105,8 +1113,8 @@ index 0000000..c3c45bd
+ updateUserStatus(userName, enabled);
+ }
+
-+ void renameUser(const std::string &userName,
-+ const std::string &newUserName) const override
++ void renameUser(const std::string& userName,
++ const std::string& newUserName) const override
+ {
+ std::vector<std::string> exeOutput;
+ // Local Domain for sssd doesn't have a rename feature
@@ -1123,7 +1131,7 @@ index 0000000..c3c45bd
+ exeOutput = phosphor::user::executeCmd(
+ "/usr/bin/getent", "-s", "sss", "passwd", userName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to get information for user");
@@ -1141,14 +1149,14 @@ index 0000000..c3c45bd
+ deleteUser(userName);
+ }
+
-+ void deleteUser(const std::string &userName) const override
++ void deleteUser(const std::string& userName) const override
+ {
+ try
+ {
+ phosphor::user::executeCmd("/usr/sbin/sss_userdel", "-r",
+ userName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to delete user from sssd service");
@@ -1156,9 +1164,9 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ void updateGroupsAndPriv(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv) const override
++ void updateGroupsAndPriv(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv) const override
+ {
+ // local domain sssd do not allow to update all list of groups,
+ // so we will remove all groups first (except for the user one)
@@ -1183,7 +1191,7 @@ index 0000000..c3c45bd
+ groups.c_str(), "-s",
+ (sshRequested ? "/bin/sh" : "/bin/nologin"), userName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to update user groups and "
@@ -1192,8 +1200,8 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ void updateUserStatus(const std::string &userName,
-+ const bool &enabled) const override
++ void updateUserStatus(const std::string& userName,
++ const bool& enabled) const override
+ {
+ std::string enabledStr;
+ std::string lockedStr;
@@ -1224,7 +1232,7 @@ index 0000000..c3c45bd
+ enabledStr.c_str(), lockedGrp.c_str(),
+ lockedStr.c_str(), userName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to update user status from sssd service");
@@ -1232,7 +1240,7 @@ index 0000000..c3c45bd
+ }
+ }
+
-+ bool isUserEnabled(const std::string &userName) const override
++ bool isUserEnabled(const std::string& userName) const override
+ {
+ std::vector<std::string> userGrps = getUserGroups(userName);
+ return std::find(userGrps.begin(), userGrps.end(), lockedGrp) ==
@@ -1240,7 +1248,7 @@ index 0000000..c3c45bd
+ }
+
+ std::vector<std::string>
-+ getUserGroups(const std::string &userName) const override
++ getUserGroups(const std::string& userName) const override
+ {
+ std::vector<std::string> exeOutput;
+ try
@@ -1248,7 +1256,7 @@ index 0000000..c3c45bd
+ exeOutput =
+ phosphor::user::executeCmd("/usr/bin/groups", userName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to get groups for user");
@@ -1267,7 +1275,7 @@ index 0000000..c3c45bd
+ return groups;
+ }
+
-+ void createGroup(const std::string &groupName) const override
++ void createGroup(const std::string& groupName) const override
+ {
+ try
+ {
@@ -1277,7 +1285,7 @@ index 0000000..c3c45bd
+ groupName.c_str());
+ }
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Unable to create group");
@@ -1288,14 +1296,14 @@ index 0000000..c3c45bd
+ private:
+ static const std::string lockedGrp;
+
-+ bool groupExists(const std::string &groupName) const
++ bool groupExists(const std::string& groupName) const
+ {
+ try
+ {
+ phosphor::user::executeCmd("/usr/sbin/sss_groupshow",
+ groupName.c_str());
+ }
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
+ {
+ return false;
+ }
@@ -1311,24 +1319,24 @@ index 0000000..c3c45bd
+namespace user
+{
+
-+UserService::UserService(const ServiceType &srvcType,
-+ const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs)
++UserService::UserService(const ServiceType& srvcType,
++ const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs)
+{
+ setServiceImpl(srvcType, groups, privs);
+}
+
-+void UserService::updateServiceType(const ServiceType &srvcType,
-+ const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs)
++void UserService::updateServiceType(const ServiceType& srvcType,
++ const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs)
+{
+ usrSrvcImpl.reset();
+ setServiceImpl(srvcType, groups, privs);
+}
+
-+void UserService::setServiceImpl(const ServiceType &srvcType,
-+ const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs)
++void UserService::setServiceImpl(const ServiceType& srvcType,
++ const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs)
+{
+ switch (srvcType)
+ {
@@ -1356,8 +1364,7 @@ index 0000000..c3c45bd
+}
+
+UserService::~UserService()
-+{
-+}
++{}
+
+phosphor::user::UserSSHLists UserService::getUserAndSshGrpList() const
+{
@@ -1365,49 +1372,49 @@ index 0000000..c3c45bd
+}
+
+std::vector<std::string>
-+ UserService::getUsersInGroup(const std::string &groupName) const
++ UserService::getUsersInGroup(const std::string& groupName) const
+{
+ return usrSrvcImpl->getUsersInGroup(groupName);
+}
+
-+void UserService::createUser(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv, const bool &enabled) const
++void UserService::createUser(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv, const bool& enabled) const
+{
+ usrSrvcImpl->createUser(userName, groupNames, priv, enabled);
+}
+
-+void UserService::renameUser(const std::string &userName,
-+ const std::string &newUserName) const
++void UserService::renameUser(const std::string& userName,
++ const std::string& newUserName) const
+{
+ usrSrvcImpl->renameUser(userName, newUserName);
+}
+
-+void UserService::deleteUser(const std::string &userName) const
++void UserService::deleteUser(const std::string& userName) const
+{
+ usrSrvcImpl->deleteUser(userName);
+}
+
+void UserService::updateGroupsAndPriv(
-+ const std::string &userName, const std::vector<std::string> &groupNames,
-+ const std::string &priv) const
++ const std::string& userName, const std::vector<std::string>& groupNames,
++ const std::string& priv) const
+{
+ usrSrvcImpl->updateGroupsAndPriv(userName, groupNames, priv);
+}
+
-+void UserService::updateUserStatus(const std::string &userName,
-+ const bool &enabled) const
++void UserService::updateUserStatus(const std::string& userName,
++ const bool& enabled) const
+{
+ usrSrvcImpl->updateUserStatus(userName, enabled);
+}
+
-+bool UserService::isUserEnabled(const std::string &userName) const
++bool UserService::isUserEnabled(const std::string& userName) const
+{
+ return usrSrvcImpl->isUserEnabled(userName);
+}
+
+std::vector<std::string>
-+ UserService::getUserGroups(const std::string &userName) const
++ UserService::getUserGroups(const std::string& userName) const
+{
+ return usrSrvcImpl->getUserGroups(userName);
+}
@@ -1416,7 +1423,7 @@ index 0000000..c3c45bd
+} // namespace phosphor
diff --git a/user_service.hpp b/user_service.hpp
new file mode 100644
-index 0000000..97a049b
+index 0000000..50ee4db
--- /dev/null
+++ b/user_service.hpp
@@ -0,0 +1,233 @@
@@ -1437,12 +1444,12 @@ index 0000000..97a049b
+*/
+
+#pragma once
-+#include <xyz/openbmc_project/Common/error.hpp>
-+#include <xyz/openbmc_project/User/Common/error.hpp>
-+#include <phosphor-logging/log.hpp>
-+#include <phosphor-logging/elog.hpp>
+#include <boost/process/child.hpp>
+#include <boost/process/io.hpp>
++#include <phosphor-logging/elog.hpp>
++#include <phosphor-logging/log.hpp>
++#include <xyz/openbmc_project/Common/error.hpp>
++#include <xyz/openbmc_project/User/Common/error.hpp>
+
+namespace phosphor
+{
@@ -1459,11 +1466,11 @@ index 0000000..97a049b
+const std::string grpSsh = "ssh";
+
+template <typename... ArgTypes>
-+std::vector<std::string> executeCmd(const char *path, ArgTypes &&... tArgs)
++std::vector<std::string> executeCmd(const char* path, ArgTypes&&... tArgs)
+{
+ std::vector<std::string> stdOutput;
+ boost::process::ipstream stdOutStream;
-+ boost::process::child execProg(path, const_cast<char *>(tArgs)...,
++ boost::process::child execProg(path, const_cast<char*>(tArgs)...,
+ boost::process::std_out > stdOutStream);
+ std::string stdOutLine;
+
@@ -1500,23 +1507,23 @@ index 0000000..97a049b
+ virtual ~UserServiceInterface() = default;
+ virtual UserSSHLists getUserAndSshGrpList() const = 0;
+ virtual std::vector<std::string>
-+ getUsersInGroup(const std::string &groupName) const = 0;
-+ virtual void createUser(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv,
-+ const bool &enabled) const = 0;
-+ virtual void renameUser(const std::string &userName,
-+ const std::string &newUserName) const = 0;
-+ virtual void deleteUser(const std::string &userName) const = 0;
-+ virtual void updateGroupsAndPriv(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv) const = 0;
-+ virtual void updateUserStatus(const std::string &userName,
-+ const bool &enabled) const = 0;
-+ virtual bool isUserEnabled(const std::string &userName) const = 0;
++ getUsersInGroup(const std::string& groupName) const = 0;
++ virtual void createUser(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv,
++ const bool& enabled) const = 0;
++ virtual void renameUser(const std::string& userName,
++ const std::string& newUserName) const = 0;
++ virtual void deleteUser(const std::string& userName) const = 0;
++ virtual void updateGroupsAndPriv(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv) const = 0;
++ virtual void updateUserStatus(const std::string& userName,
++ const bool& enabled) const = 0;
++ virtual bool isUserEnabled(const std::string& userName) const = 0;
+ virtual std::vector<std::string>
-+ getUserGroups(const std::string &userName) const = 0;
-+ virtual void createGroup(const std::string &groupName) const = 0;
++ getUserGroups(const std::string& userName) const = 0;
++ virtual void createGroup(const std::string& groupName) const = 0;
+};
+
+/** @class UserService
@@ -1532,10 +1539,10 @@ index 0000000..97a049b
+{
+ public:
+ UserService() = delete;
-+ UserService(const UserService &) = delete;
-+ UserService &operator=(const UserService &) = delete;
-+ UserService(UserService &&) = delete;
-+ UserService &operator=(UserService &&) = delete;
++ UserService(const UserService&) = delete;
++ UserService& operator=(const UserService&) = delete;
++ UserService(UserService&&) = delete;
++ UserService& operator=(UserService&&) = delete;
+
+ // Service Types implemented. None is used to validate.
+ enum class ServiceType
@@ -1545,9 +1552,9 @@ index 0000000..97a049b
+ sssd
+ };
+
-+ UserService(const ServiceType &srvcType,
-+ const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs);
++ UserService(const ServiceType& srvcType,
++ const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs);
+ ~UserService();
+
+ /** @brief update the current Service type of the instance.
@@ -1559,9 +1566,9 @@ index 0000000..97a049b
+ * @param[in] groups
+ * @param[in] privs
+ */
-+ void updateServiceType(const ServiceType &srvcType,
-+ const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs);
++ void updateServiceType(const ServiceType& srvcType,
++ const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs);
+
+ /** @brief get user list and SSH group members list
+ * This method gets the list of users from the service.
@@ -1579,7 +1586,7 @@ index 0000000..97a049b
+ * @param[in] groupName - Name of the group which has to be queried
+ */
+ std::vector<std::string>
-+ getUsersInGroup(const std::string &groupName) const;
++ getUsersInGroup(const std::string& groupName) const;
+
+ /** @brief create user method.
+ * This method creates a new user as requested
@@ -1589,9 +1596,9 @@ index 0000000..97a049b
+ * @param[in] priv - Privilege of the user.
+ * @param[in] enabled - State of the user enabled / disabled.
+ */
-+ void createUser(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv, const bool &enabled) const;
++ void createUser(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv, const bool& enabled) const;
+
+ /** @brief rename user method.
+ * This method renames the user as requested
@@ -1599,15 +1606,15 @@ index 0000000..97a049b
+ * @param[in] userName - current name of the user
+ * @param[in] userName - user name to which it has to be renamed.
+ */
-+ void renameUser(const std::string &userName,
-+ const std::string &newUserName) const;
++ void renameUser(const std::string& userName,
++ const std::string& newUserName) const;
+
+ /** @brief delete user method.
+ * This method deletes the user as requested
+ *
+ * @param[in] userName - Name of the user which has to be deleted
+ */
-+ void deleteUser(const std::string &userName) const;
++ void deleteUser(const std::string& userName) const;
+
+ /** @brief Updates user Groups and Privilege.
+ *
@@ -1615,9 +1622,9 @@ index 0000000..97a049b
+ * @param[in] groupNames - Group names list for user.
+ * @param[in] priv - Privilege of the user.
+ */
-+ void updateGroupsAndPriv(const std::string &userName,
-+ const std::vector<std::string> &groupNames,
-+ const std::string &priv) const;
++ void updateGroupsAndPriv(const std::string& userName,
++ const std::vector<std::string>& groupNames,
++ const std::string& priv) const;
+
+ /** @brief Updates user status
+ * If enabled = false: User will be disabled
@@ -1626,8 +1633,8 @@ index 0000000..97a049b
+ * @param[in] userName - Name of the user
+ * @param[in] enabled - Status of the user: enabled / disabled?
+ */
-+ void updateUserStatus(const std::string &userName,
-+ const bool &enabled) const;
++ void updateUserStatus(const std::string& userName,
++ const bool& enabled) const;
+
+ /** @brief Verify if user is enabled or not
+ * If enabled returns true
@@ -1635,24 +1642,24 @@ index 0000000..97a049b
+ *
+ * @param[in] userName - Name of the user
+ */
-+ bool isUserEnabled(const std::string &userName) const;
++ bool isUserEnabled(const std::string& userName) const;
+
+ /** @brief Get the list of groups a user belongs to
+ *
+ * @param[in] userName - Name of the user
+ */
-+ std::vector<std::string> getUserGroups(const std::string &userName) const;
++ std::vector<std::string> getUserGroups(const std::string& userName) const;
+
+ private:
+ // User service implementation.
-+ void setServiceImpl(const ServiceType &srvcType,
-+ const std::vector<std::string> &groups,
-+ const std::vector<std::string> &privs);
++ void setServiceImpl(const ServiceType& srvcType,
++ const std::vector<std::string>& groups,
++ const std::vector<std::string>& privs);
+ std::unique_ptr<UserServiceInterface> usrSrvcImpl;
+};
+
+} // namespace user
+} // namespace phosphor
--
-2.7.4
+2.17.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0006-Use-groupmems-instead-of-getgrnam_r-due-to-overlay.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0006-Use-groupmems-instead-of-getgrnam_r-due-to-overlay.patch
index 2abfeb78c..7a0eff80e 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0006-Use-groupmems-instead-of-getgrnam_r-due-to-overlay.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0006-Use-groupmems-instead-of-getgrnam_r-due-to-overlay.patch
@@ -1,7 +1,7 @@
-From a78bad158bca59dadb93c9c52d6daefa1c52b9cf Mon Sep 17 00:00:00 2001
+From 06064b3d6e56f4e13e6b85552f8525b74d9f1931 Mon Sep 17 00:00:00 2001
From: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Date: Mon, 24 Feb 2020 13:37:12 +0530
-Subject: [PATCH] Use groupmems instead of getgrnam_r due to overlay
+Subject: [PATCH 2/2] Use groupmems instead of getgrnam_r due to overlay
With JFFS2 overlay, getgrnam_r during initial time returns the
old group details as per the lower dir, instead of the overlay one
@@ -26,18 +26,18 @@ Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/user_service.cpp b/user_service.cpp
-index c3c45bd..0a6b171 100644
+index ad4e510..89b27ed 100644
--- a/user_service.cpp
+++ b/user_service.cpp
-@@ -143,28 +143,26 @@ class ShadowService : public phosphor::user::UserServiceInterface
- getUsersInGroup(const std::string &groupName) const override
+@@ -147,28 +147,26 @@ class ShadowService : public phosphor::user::UserServiceInterface
+ getUsersInGroup(const std::string& groupName) const override
{
std::vector<std::string> usersInGroup;
- // Should be more than enough to get the pwd structure.
- std::array<char, 4096> buffer{};
- struct group grp;
-- struct group *grpPtr = &grp;
-- struct group *resultPtr;
+- struct group* grpPtr = &grp;
+- struct group* resultPtr;
-
- int status = getgrnam_r(groupName.c_str(), grpPtr, buffer.data(),
- buffer.max_size(), &resultPtr);
@@ -54,7 +54,7 @@ index c3c45bd..0a6b171 100644
+ "-g", groupName.c_str());
}
- else
-+ catch (const phosphor::user::InternalFailure &e)
++ catch (const phosphor::user::InternalFailure& e)
{
phosphor::logging::log<phosphor::logging::level::ERR>(
"Group not found",
@@ -72,5 +72,5 @@ index c3c45bd..0a6b171 100644
return usersInGroup;
}
--
-2.7.4
+2.17.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend
index 2b90b01e5..0b3d54986 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend
@@ -1,7 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI = "git://github.com/openbmc/phosphor-user-manager"
-SRCREV = "703131fa01422bc28675f5d629edb98d285a1bc4"
+SRCREV = "9638afb9aa848aa0e696c2447e0fbc70a0aa5eed"
EXTRA_OECONF += "${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-root-login' ], '', '--disable-root_user_mgmt', d)}"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
index f0b8e8f23..75f04e2ab 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
@@ -1,6 +1,5 @@
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-SRCREV = "c35135d32f9cb84b62de7b72eee3a2e87b4b3d4d"
SRC_URI += "file://0001-Customize-phosphor-watchdog-for-Intel-platforms.patch \
"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend
index c93a2e96b..7dfdc5525 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend
@@ -1,6 +1,6 @@
# Enable downstream autobump
SRC_URI = "git://github.com/openbmc/webui-vue.git"
-SRCREV = "391f94921bffb243d1eb3d72a49402a930b42160"
+SRCREV = "7006806d21cf8d13666524a8124b8395f2f1e156"
do_compile_prepend() {
cp -vf ${S}/.env.intel ${S}/.env
diff --git a/meta-openbmc-mods/meta-common/recipes-support/boost/boost/e8b0445e9837e232047173ddf6b4d541b1585915.patch b/meta-openbmc-mods/meta-common/recipes-support/boost/boost/e8b0445e9837e232047173ddf6b4d541b1585915.patch
deleted file mode 100644
index 8bdacc5df..000000000
--- a/meta-openbmc-mods/meta-common/recipes-support/boost/boost/e8b0445e9837e232047173ddf6b4d541b1585915.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 5308ba9daf66c50f950834c1469268f9d297f51a Mon Sep 17 00:00:00 2001
-From: Bruno Abinader <brunoabinader@gmail.com>
-Date: Thu, 3 Sep 2020 12:04:08 +0300
-Subject: [PATCH 1/1] Enable ASIO builds without RTTI post 1.17.0
-
-Signed-off-by: James Feist <james.feist@linux.intel.com>
----
- boost/asio/execution/any_executor.hpp | 23 +++++++++++++++++++++++
- boost/asio/io_context.hpp | 12 ++++++++++++
- 2 files changed, 35 insertions(+)
-
-diff --git a/boost/asio/execution/any_executor.hpp b/boost/asio/execution/any_executor.hpp
-index 9c7018c88..c83f837a8 100644
---- a/boost/asio/execution/any_executor.hpp
-+++ b/boost/asio/execution/any_executor.hpp
-@@ -620,7 +620,11 @@ public:
- return static_cast<Executor*>(target_);
- }
-
-+#if !defined(BOOST_ASIO_NO_TYPEID)
- const std::type_info& target_type() const
-+#else // !defined(BOOST_ASIO_NO_TYPEID)
-+ const void* target_type() const
-+#endif // !defined(BOOST_ASIO_NO_TYPEID)
- {
- return target_fns_->target_type();
- }
-@@ -800,16 +804,27 @@ protected:
-
- struct target_fns
- {
-+#if !defined(BOOST_ASIO_NO_TYPEID)
- const std::type_info& (*target_type)();
-+#else
-+ const void* (*target_type)();
-+#endif
- bool (*equal)(const any_executor_base&, const any_executor_base&);
- void (*execute)(const any_executor_base&, BOOST_ASIO_MOVE_ARG(function));
- void (*blocking_execute)(const any_executor_base&, function_view);
- };
-
-+#if !defined(BOOST_ASIO_NO_TYPEID)
- static const std::type_info& target_type_void()
- {
- return typeid(void);
- }
-+#else
-+ static const void* target_type_void()
-+ {
-+ return 0;
-+ }
-+#endif // !defined(BOOST_ASIO_NO_TYPEID)
-
- static bool equal_void(const any_executor_base&, const any_executor_base&)
- {
-@@ -845,11 +860,19 @@ protected:
- return &fns;
- }
-
-+#if !defined(BOOST_ASIO_NO_TYPEID)
- template <typename Ex>
- static const std::type_info& target_type_ex()
- {
- return typeid(Ex);
- }
-+#else // !defined(BOOST_ASIO_NO_TYPEID)
-+ template <typename Ex>
-+ static const void* target_type_ex()
-+ {
-+ return 0;
-+ }
-+#endif // !defined(BOOST_ASIO_NO_TYPEID)
-
- template <typename Ex>
- static bool equal_ex(const any_executor_base& ex1,
-diff --git a/boost/asio/io_context.hpp b/boost/asio/io_context.hpp
-index 6a64ef514..b5672b3d2 100644
---- a/boost/asio/io_context.hpp
-+++ b/boost/asio/io_context.hpp
-@@ -714,6 +714,18 @@ public:
- basic_executor_type&& other) BOOST_ASIO_NOEXCEPT;
- #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
-
-+#if !defined(BOOST_ASIO_NO_TYPEID)
-+ static const std::type_info& type_id()
-+ {
-+ return typeid(basic_executor_type);
-+#else // !defined(BOOST_ASIO_NO_TYPEID)
-+ static const void* type_id()
-+ {
-+ static int unique_id;
-+ return &unique_id;
-+#endif // !defined(BOOST_ASIO_NO_TYPEID)
-+ }
-+
- /// Obtain an executor with the @c blocking.possibly property.
- /**
- * Do not call this function directly. It is intended for use with the
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-support/boost/boost_%.bbappend b/meta-openbmc-mods/meta-common/recipes-support/boost/boost_%.bbappend
index 4cd1bcd51..780a12e24 100644
--- a/meta-openbmc-mods/meta-common/recipes-support/boost/boost_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-support/boost/boost_%.bbappend
@@ -5,5 +5,3 @@ FILES_${PN} += "/usr/lib/libboost_chrono.so* \
BOOST_LIBS_intel += "iostreams coroutine"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-# this patch is for issue https://github.com/chriskohlhoff/asio/issues/533
-SRC_URI += "file://e8b0445e9837e232047173ddf6b4d541b1585915.patch"
diff --git a/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit/0002-Add-support-for-ssl-config.patch b/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit/0002-Add-support-for-ssl-config.patch
new file mode 100644
index 000000000..c597cb3a4
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit/0002-Add-support-for-ssl-config.patch
@@ -0,0 +1,66 @@
+diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c
+index 610511f7..92be4656 100644
+--- a/plugins/curl/curl.c
++++ b/plugins/curl/curl.c
+@@ -69,6 +69,8 @@ static const char *proxy = NULL;
+ static char *proxy_password = NULL;
+ static const char *proxy_user = NULL;
+ static bool sslverify = true;
++static const char *ssl_version = NULL;
++static const char *ssl_cipher_list = NULL;
+ static bool tcp_keepalive = false;
+ static bool tcp_nodelay = true;
+ static uint32_t timeout = 0;
+@@ -232,6 +234,12 @@ curl_config (const char *key, const char *value)
+ sslverify = r;
+ }
+
++ else if (strcmp (key, "ssl-version") == 0)
++ ssl_version = value;
++
++ else if (strcmp (key, "ssl-cipher-list") == 0)
++ ssl_cipher_list = value;
++
+ else if (strcmp (key, "tcp-keepalive") == 0) {
+ r = nbdkit_parse_bool (value);
+ if (r == -1)
+@@ -302,6 +310,8 @@ curl_config_complete (void)
+ "proxy-user=<USER> The proxy user.\n" \
+ "timeout=<TIMEOUT> Set the timeout for requests (seconds).\n" \
+ "sslverify=false Do not verify SSL certificate of remote host.\n" \
++ "ssl-version=<VERSION> Specify preferred TLS/SSL version.\n " \
++ "ssl-cipher-list=C1:C2:.. Specify TLS/SSL cipher suites to be used.\n" \
+ "tcp-keepalive=true Enable TCP keepalives.\n" \
+ "tcp-nodelay=false Disable Nagle’s algorithm.\n" \
+ "unix-socket-path=<PATH> Open Unix domain socket instead of TCP/IP.\n" \
+@@ -418,6 +428,30 @@ curl_open (int readonly)
+ curl_easy_setopt (h->c, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt (h->c, CURLOPT_SSL_VERIFYHOST, 0L);
+ }
++ if (ssl_version) {
++ if (strcmp (ssl_version, "tlsv1") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
++ else if (strcmp (ssl_version, "sslv2") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv2);
++ else if (strcmp (ssl_version, "sslv3") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
++ else if (strcmp (ssl_version, "tlsv1.0") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_0);
++ else if (strcmp (ssl_version, "tlsv1.1") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_1);
++ else if (strcmp (ssl_version, "tlsv1.2") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
++ else if (strcmp (ssl_version, "tlsv1.3") == 0)
++ curl_easy_setopt (h->c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_3);
++ else {
++ display_curl_error (h, r, "curl_easy_setopt: CURLOPT_SSLVERSION [%s]",
++ ssl_version);
++ goto err;
++ }
++
++ }
++ if (ssl_cipher_list)
++ curl_easy_setopt (h->c, CURLOPT_SSL_CIPHER_LIST, ssl_cipher_list);
+ if (tcp_keepalive)
+ curl_easy_setopt (h->c, CURLOPT_TCP_KEEPALIVE, 1L);
+ if (!tcp_nodelay)
diff --git a/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit_git.bb b/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit_git.bb
index b97dea75c..01b3fc27e 100644
--- a/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-utilities/nbdkit/nbdkit_git.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=4332a97808994cf2133a65b6c6f33eaf"
SRC_URI = "git://github.com/libguestfs/nbdkit.git;protocol=https"
SRC_URI += "file://0001-Force-nbdkit-to-send-PATCH-as-upload-method.patch"
+SRC_URI += "file://0002-Add-support-for-ssl-config.patch"
PV = "1.17.5+git${SRCPV}"
SRCREV = "c8406880c6603bb617dae131dd0a8826c05869ca"
diff --git a/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
index 5819f140f..6681e7075 100755
--- a/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend
@@ -1,6 +1,6 @@
# Enable downstream autobump
SRC_URI = "git://github.com/openbmc/x86-power-control.git;protocol=ssh"
-SRCREV = "047bcb569b9c8baaa6184350a1628ec6e4008252"
+SRCREV = "22e0bec01e283819c13310640918c89f4a74fb56"
FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
diff --git a/meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru.bbappend b/meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru.bbappend
new file mode 100644
index 000000000..3251758e9
--- /dev/null
+++ b/meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://decodeBoardID.sh"
diff --git a/meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru/decodeBoardID.sh b/meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru/decodeBoardID.sh
new file mode 100644
index 000000000..ef973548a
--- /dev/null
+++ b/meta-openbmc-mods/meta-wht/recipes-phosphor/fru/default-fru/decodeBoardID.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# this script uses the BOARD_ID set from checkFru.sh and provides the NAME,
+# PRODID, and EEPROM_FRU values for this platform
+decode_board_id() {
+ if grep -q 'CPU part\s*: 0xb76' /proc/cpuinfo; then
+ # AST2500
+ if [ -f $fruFile -a -f $prodIDFile -a $BOARD_ID -ne 0 ]; then
+ exit 0
+ fi
+
+ case $BOARD_ID in
+ 12) NAME="D50TNP1SB"
+ PRODID="0x99";;
+ 40) NAME="CooperCity"
+ PRODID="0x9d";;
+ 42) NAME="WilsonCity"
+ PRODID="0x91";;
+ 44) NAME="WilsonCityM"
+ PRODID="0x91";;
+ 45) NAME="WilsonCity"
+ PRODID="0x91";;
+ 60) NAME="M50CYP2SB2U"
+ PRODID="0x98";;
+ 62) NAME="WilsonPoint"
+ PRODID="0x9a";;
+ 16) EEPROM_FRU=true
+ PRODID="0xA1";;
+ 1) EEPROM_FRU=true
+ PRODID="0xA5";;
+ 0) EEPROM_FRU=true
+ PRODID="0xA0";;
+ esac
+ fi
+}
diff --git a/meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru.bbappend b/meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru.bbappend
new file mode 100644
index 000000000..3251758e9
--- /dev/null
+++ b/meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://decodeBoardID.sh"
diff --git a/meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru/decodeBoardID.sh b/meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru/decodeBoardID.sh
new file mode 100644
index 000000000..bcf2ade3f
--- /dev/null
+++ b/meta-openbmc-mods/meta-wolfpass/recipes-phosphor/fru/default-fru/decodeBoardID.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# this script uses the BOARD_ID set from checkFru.sh and provides the NAME,
+# PRODID, and EEPROM_FRU values for this platform
+decode_board_id() {
+ if grep -q 'CPU part\s*: 0xb76' /proc/cpuinfo; then
+ # AST2500
+ if [ -f $fruFile -a -f $prodIDFile -a $BOARD_ID -ne 0 ]; then
+ exit 0
+ fi
+ NAME="S2600WFT"
+ PRODID="0x7b"
+ fi
+}