summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-07-31 20:43:37 +0300
committerEd Tanous <ed.tanous@intel.com>2019-08-01 18:19:38 +0300
commitd0f63ef62c76c932a2003eaa42c0b250065ae06f (patch)
tree4c0e3cb32dc80f80460bdbf82ff6d401d4ff194f /meta-openbmc-mods
parentb4f66bacb1b8e661d794fa7a189e2f66f5092e2e (diff)
downloadopenbmc-d0f63ef62c76c932a2003eaa42c0b250065ae06f.tar.xz
Update to internal 7-31-19
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods')
-rw-r--r--meta-openbmc-mods/conf/machine/include/intel.inc2
-rw-r--r--meta-openbmc-mods/meta-ast2500/conf/machine/include/intel-ast2500.inc10
-rw-r--r--meta-openbmc-mods/meta-ast2500/conf/machine/include/obmc-bsp-si-common.inc11
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-arm-dts-add-DTS-for-Intel-platforms.patch49
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-aspeed-pwm-tacho-change-default-fan-speed.patch28
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch22
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch18
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0004-Test-code-for-LPC-MBOX.patch112
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch6
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0006-Allow-monitoring-of-power-control-input-GPIOs.patch14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/intel-ast2500.cfg5
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend4
-rwxr-xr-x[-rw-r--r--]meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/CYP-baseboard.json114
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/TNP-baseboard.json66
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WC-Baseboard.json74
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WP-Baseboard.json69
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed.bb20
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/fan-default-speed.service10
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/set_fan_speeds.py23
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb14
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.binbin513 -> 0 bytes
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.binbin512 -> 0 bytes
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.binbin511 -> 0 bytes
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.binbin512 -> 0 bytes
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.binbin512 -> 0 bytes
-rwxr-xr-xmeta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh8
-rwxr-xr-xmeta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py154
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-phosphor/workbook/wolfpass-config.bb2
-rw-r--r--meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch83
-rw-r--r--meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-Turn-Off-FFWUPD-Jumper.patch32
-rw-r--r--meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-native_%.bbappend9
-rw-r--r--meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend11
-rw-r--r--meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu_%.bbappend7
-rw-r--r--meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass112
-rw-r--r--meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass8
-rw-r--r--meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass25
-rw-r--r--meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0002-intel-layout-environment-addr.patch59
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch13
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch42
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0007-Add-espi-support.patch24
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch24
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch22
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch22
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch101
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch8
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch18
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch12
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch12
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch61
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch318
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch124
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch40
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0032-Adding-PFR-boot-flow-checkpoint-in-u-boot.patch102
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0033-PFR-firmware-update-support-in-u-boot.patch480
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_%.bbappend9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.service10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.sh8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check_git.bb24
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/com.intel.AtScaleDebug.service2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/.clang-format21
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch36
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.c93
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h18
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c293
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb30
-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/ipmi/ipmi-providers.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/libxcrypt/libxcrypt_%.bbappend5
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/safec/safec_%.bbappend11
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb15
-rw-r--r--meta-openbmc-mods/meta-common/recipes-devtools/python/python_%.bbappend7
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy.bbappend4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog-override.conf (renamed from meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy/rsyslog-override.conf)0
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver/0001-rfbserver-add-a-hooking-function-to-deliver-rfbFrame.patch54
-rw-r--r--meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch30
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control.bb7
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/images/intel-platforms.bb4
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/blocksignbin0 -> 58104 bytes
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/bmc_config.xml47
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_prv.pem8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_pub.pem4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfm_config.xml47
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image-manifest.json63
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py311
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_prv.pem8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_pub.pem4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-pfr-manager_git.bb22
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/obmc-intel-pfr-image-native.bb38
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/ipccli/ipccli_svn.bb14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-intel-apps.bb6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-obmc-apps.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/psu-manager/psu-manager.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv1.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-set-idle-disconnect-to-true-in-all-cases.patch34
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-arm-dts-aspeed-g5-add-espi.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-New-flash-map-for-intel.patch33
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-Add-ASPEED-SGPIO-driver.patch8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-SGPIO-DT-and-pinctrl-fixup.patch32
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0010-Update-PECI-drivers-to-sync-with-linux-upstreaming-v.patch14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0019-Add-I2C-IPMB-support.patch15
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0020-misc-aspeed-add-lpc-mbox-driver.patch475
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0021-Initial-Port-of-Aspeed-LPC-SIO-driver.patch81
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0022-Add-AST2500-eSPI-driver.patch46
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0026-Add-support-for-new-PECI-commands.patch297
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0028-Add-AST2500-JTAG-driver.patch6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch73
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0031-Add-high-speed-baud-rate-support-for-UART.patch16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0032-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch36
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0034-arm-dts-aspeed-Swap-the-mac-nodes-numbering.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0035-Implement-a-memory-driver-share-memory.patch78
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0039-Add-Aspeed-PWM-driver-which-uses-FTTMR010-timer-IP.patch30
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0040-i2c-Add-mux-hold-unhold-msg-types.patch131
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0041-Enable-passthrough-based-gpio-character-device.patch287
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0042-Add-bus-timeout-ms-and-retries-device-tree-propertie.patch12
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0043-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-BT.patch14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0044-misc-Add-clock-control-logic-into-Aspeed-LPC-SNOOP-d.patch32
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0045-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-KC.patch16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0046-misc-Add-clock-control-logic-into-Aspeed-LPC-MBOX-dr.patch166
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0047-misc-Block-error-printing-on-probe-defer-case-in-Asp.patch16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0048-ARM-dts-aspeed-Set-default-status-of-LPC-BT-as-disab.patch40
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0051-Add-AST2500-JTAG-device.patch10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0052-drivers-jtag-Add-JTAG-core-driver.patch30
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0055-Documentation-jtag-Add-ABI-documentation.patch17
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0057-drivers-jtag-Add-JTAG-core-driver-Maintainers.patch8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0058-i2c-aspeed-add-general-call-support.patch42
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0065-i2c-aspeed-fix-master-pending-state-handling.patch8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0066-i2c-aspeed-add-buffer-mode-transfer-support.patch462
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0067-i2c-aspeed-add-DMA-mode-transfer-support.patch442
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0068-i2c-aspeed-add-H-W-timeout-support.patch181
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend7
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers/0001-Enable-passthrough-based-gpio-character-device.patch26
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers_%.bbappend5
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend12
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch38
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch264
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch98
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch63
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch116
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch52
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch80
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch31
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch39
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb18
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch31
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch74
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch15
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch143
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch71
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch176
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch76
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch372
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch270
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch127
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch89
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch29
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch286
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf50
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service6
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend12
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch418
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch282
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch48
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend7
-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/multi-node-manager/multi-node-manager.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb18
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init162
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb18
-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_%.bbappend4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml209
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch37
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend9
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb4
-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/srvcfg-manager/srvcfg-manager_git.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch38
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch338
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch71
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch141
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service18
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service19
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch31
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend4
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb21
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch51
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch198
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch82
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch118
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch48
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service16
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service12
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend7
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod/0001-Add-pass-through-setting-in-gpioset.patch266
-rw-r--r--meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod_%.bbappend7
-rw-r--r--meta-openbmc-mods/meta-wht/conf/conf-notes.txt1
-rw-r--r--meta-openbmc-mods/meta-wht/conf/layer.conf4
-rw-r--r--meta-openbmc-mods/meta-wht/conf/local.conf.sample11
-rw-r--r--meta-openbmc-mods/meta-wolfpass/conf/conf-notes.txt1
-rw-r--r--meta-openbmc-mods/meta-wolfpass/conf/layer.conf2
-rw-r--r--meta-openbmc-mods/meta-wolfpass/conf/local.conf.sample3
239 files changed, 6713 insertions, 6059 deletions
diff --git a/meta-openbmc-mods/conf/machine/include/intel.inc b/meta-openbmc-mods/conf/machine/include/intel.inc
index 588a71bbf..70297bab8 100644
--- a/meta-openbmc-mods/conf/machine/include/intel.inc
+++ b/meta-openbmc-mods/conf/machine/include/intel.inc
@@ -13,6 +13,8 @@ VIRTUAL-RUNTIME_obmc-inventory-manager = "entity-manager"
VIRTUAL-RUNTIME_obmc-led-monitor = ""
VIRTUAL-RUNTIME_obmc-host-state-manager = "intel-chassis-control"
VIRTUAL-RUNTIME_obmc-chassis-state-manager = "intel-chassis-control"
+VIRTUAL-RUNTIME_obmc-discover-system-state = "intel-chassis-control"
+VIRTUAL-RUNTIME_obmc-settings-mgmt = "settings"
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-kcs"
PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-intel-apps"
diff --git a/meta-openbmc-mods/meta-ast2500/conf/machine/include/intel-ast2500.inc b/meta-openbmc-mods/meta-ast2500/conf/machine/include/intel-ast2500.inc
index cc9e30495..1bbd64381 100644
--- a/meta-openbmc-mods/meta-ast2500/conf/machine/include/intel-ast2500.inc
+++ b/meta-openbmc-mods/meta-ast2500/conf/machine/include/intel-ast2500.inc
@@ -8,12 +8,6 @@ require conf/distro/include/phosphor-tiny.inc
UBOOT_MACHINE = "ast_g5_phy_config"
-#Developer to specify the appropriate IMAGE_TYPE and FLASH_SIZE
-#On Intel Whitley platforms PFR feature requires 128MB flash, default is 64MB
-#IMAGE_TYPE = "default" or "pfr" or "non-pfr"
-# "non-pfr" setting for future which is for BMC secure boot
-#for PFR its 128MB in KBs - 128*1024=131072, for non-pfr its 64MB= 64*1024 = 65536
-#pfr IMAGE_TYPE enforces the image signature verification during the image update
-IMAGE_TYPE = "default"
-
VIRTUAL-RUNTIME_skeleton_workbook = "${MACHINE}-config"
+
+IMAGE_CLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'image_types_intel_pfr', '', d)}"
diff --git a/meta-openbmc-mods/meta-ast2500/conf/machine/include/obmc-bsp-si-common.inc b/meta-openbmc-mods/meta-ast2500/conf/machine/include/obmc-bsp-si-common.inc
index 24ec3113b..f4f8a7b9f 100644
--- a/meta-openbmc-mods/meta-ast2500/conf/machine/include/obmc-bsp-si-common.inc
+++ b/meta-openbmc-mods/meta-ast2500/conf/machine/include/obmc-bsp-si-common.inc
@@ -21,7 +21,7 @@ MACHINEOVERRIDES =. "openbmc:"
OBMC_PHOSPHOR_IMAGE_OVERLAY= "1"
OBMC_IMAGE_EXTRA_INSTALL_append = " u-boot-fw-utils-aspeed"
-IMAGE_CLASSES += "image_types image_types_phosphor_auto"
+IMAGE_CLASSES += "image_types image_types_phosphor_auto qemuboot"
INITRAMFS_CTYPE ?= "lzma"
INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
@@ -29,3 +29,12 @@ INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
MACHINE_FEATURES_BACKFILL_CONSIDERED = "qemu-usermode"
KERNEL_IMAGETYPES += "zImage"
+
+# runqemu
+QB_SYSTEM_NAME = "qemu-system-arm"
+QB_DEFAULT_FSTYPE = "mtd"
+QB_ROOTFS_OPT = "-drive file=@ROOTFS@,format=raw,if=mtd"
+QB_MACHINE = "-M intel-ast2500"
+QB_OPT_APPEND += " -nographic"
+QB_NETWORK_DEVICE = "-net nic,macaddr=C0:FF:EE:00:00:02,model=ftgmac100"
+QB_DEFAULT_KERNEL = "none"
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-arm-dts-add-DTS-for-Intel-platforms.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-arm-dts-add-DTS-for-Intel-platforms.patch
index 88a9c5624..613118843 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-arm-dts-add-DTS-for-Intel-platforms.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-arm-dts-add-DTS-for-Intel-platforms.patch
@@ -1,4 +1,4 @@
-From fbbad6c3a18ec7f1e9d95c09e44e765de303329c Mon Sep 17 00:00:00 2001
+From a2505e885fafd674fe0eb3a2e6daa69392e46684 Mon Sep 17 00:00:00 2001
From: Yuan Li <yuan.li@linux.intel.com>
Date: Tue, 19 Sep 2017 15:55:39 +0800
Subject: [PATCH] arm: dts: add DTS for Intel platforms
@@ -10,17 +10,20 @@ Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
+Signed-off-by: Zhu, Yunge <yunge.zhu@linux.intel.com>
+Signed-off-by: Chen Yugang <yugang.chen@linux.intel.com>
+Signed-off-by: Qiang XU <qiang.xu@linux.intel.com>
---
- arch/arm/boot/dts/aspeed-bmc-intel-purley.dts | 388 ++++++++++++++++++++++++++
- 1 file changed, 388 insertions(+)
+ arch/arm/boot/dts/aspeed-bmc-intel-purley.dts | 410 ++++++++++++++++++++++++++
+ 1 file changed, 410 insertions(+)
create mode 100644 arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
new file mode 100644
-index 0000000..421699c
+index 000000000000..e94a1473045f
--- /dev/null
+++ b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-@@ -0,0 +1,388 @@
+@@ -0,0 +1,410 @@
+/dts-v1/;
+
+#include "aspeed-g5.dtsi"
@@ -146,7 +149,7 @@ index 0000000..421699c
+ /*D0-D7*/ "","","","","","","","",
+ /*E0-E7*/ "RESET_BUTTON","RESET_OUT","POWER_BUTTON","POWER_OUT","","","","",
+ /*F0-F7*/ "","","","","CPU_ERR0","CPU_ERR1","","",
-+ /*G0-G7*/ "CPU_ERR2","CPU_CATERR","","","","","","",
++ /*G0-G7*/ "CPU_ERR2","CPU_CATERR","PCH_BMC_THERMTRIP","","","","","",
+ /*H0-H7*/ "","","","","","","","",
+ /*I0-I7*/ "","","","","","","","",
+ /*J0-J7*/ "","","","","","","","",
@@ -166,7 +169,7 @@ index 0000000..421699c
+ /*X0-X7*/ "","","","","","","","",
+ /*Y0-Y7*/ "SIO_S3","SIO_S5","","SIO_ONCONTROL","","","","",
+ /*Z0-Z7*/ "","SIO_POWER_GOOD","","","","","","",
-+ /*AA0-AA7*/ "","","","","","","","POST_COMPLETE",
++ /*AA0-AA7*/ "P3VBAT_BRIDGE_EN","","","","","","SMI","POST_COMPLETE",
+ /*AB0-AB7*/ "","NMI_BUTTON","ID_BUTTON","PS_PWROK","","","","",
+ /*AC0-AC7*/ "","","","","","","","";
+};
@@ -270,31 +273,36 @@ index 0000000..421699c
+&i2c0 {
+ multi-master;
+ general-call;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
-+
-+ ipmb0@10 {
-+ compatible = "slave-mqueue";
-+ reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>;
-+ };
+};
+
+&i2c1 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
+&i2c2 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
+&i2c3 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
+&i2c4 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+
+ hsbp0@10 {
@@ -306,6 +314,8 @@ index 0000000..421699c
+&i2c5 {
+ bus-frequency = <1000000>;
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+
+ smlink0@10 {
@@ -316,22 +326,37 @@ index 0000000..421699c
+
+&i2c6 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
+&i2c7 {
+ multi-master;
+ #retries = <3>;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
+&i2c9 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
++ status = "okay";
++};
++
++&i2c11 {
++ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
+&i2c13 {
+ multi-master;
++ aspeed,dma-buf-size = <4095>;
++ aspeed,hw-timeout-ms = <300>;
+ status = "okay";
+};
+
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-aspeed-pwm-tacho-change-default-fan-speed.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-aspeed-pwm-tacho-change-default-fan-speed.patch
new file mode 100644
index 000000000..40afce9be
--- /dev/null
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0001-aspeed-pwm-tacho-change-default-fan-speed.patch
@@ -0,0 +1,28 @@
+From 80795ca1de706c4111ac7e8874e1490e7ebf8100 Mon Sep 17 00:00:00 2001
+From: James Feist <james.feist@linux.intel.com>
+Date: Tue, 2 Jul 2019 10:14:59 -0700
+Subject: [PATCH] aspeed-pwm-tacho: change default fan speed
+
+Change it from max to 58%
+
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+---
+ drivers/hwmon/aspeed-pwm-tacho.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
+index 40c489be62ea..ae5771f881b5 100644
+--- a/drivers/hwmon/aspeed-pwm-tacho.c
++++ b/drivers/hwmon/aspeed-pwm-tacho.c
+@@ -160,7 +160,7 @@
+ */
+ #define M_TACH_MODE 0x02 /* 10b */
+ #define M_TACH_UNIT 0x0210
+-#define INIT_FAN_CTRL 0xFF
++#define INIT_FAN_CTRL 150 /* 58% */
+
+ /* How long we sleep in us while waiting for an RPM result. */
+ #define ASPEED_RPM_STATUS_SLEEP_USEC 500
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch
index b05ad2502..0ce4163dd 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch
@@ -1,4 +1,4 @@
-From 9537923d6e6a793cb2bf3c1daacd12562263bc0a Mon Sep 17 00:00:00 2001
+From 56faf4c5a3957012f3a3a8467b3dfde760093784 Mon Sep 17 00:00:00 2001
From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
Date: Fri, 3 May 2019 16:12:39 -0700
Subject: [PATCH] Enable pass-through on GPIOE1 and GPIOE3 free
@@ -20,10 +20,10 @@ Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
3 files changed, 64 insertions(+)
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
-index 187abd7..beb0729 100644
+index e20e2a259141..fbc9a68bd88c 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
-@@ -2498,6 +2498,7 @@ static const struct pinmux_ops aspeed_g5_pinmux_ops = {
+@@ -2605,6 +2605,7 @@ static const struct pinmux_ops aspeed_g5_pinmux_ops = {
.get_function_groups = aspeed_pinmux_get_fn_groups,
.set_mux = aspeed_pinmux_set_mux,
.gpio_request_enable = aspeed_gpio_request_enable,
@@ -32,11 +32,11 @@ index 187abd7..beb0729 100644
};
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
-index eb87ab7..f06d752 100644
+index 18f46177b4af..6feea140b438 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
-@@ -538,6 +538,66 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
- return aspeed_sig_expr_enable(expr, pdata->maps);
+@@ -356,6 +356,66 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
+ return aspeed_sig_expr_enable(&pdata->pinmux, expr);
}
+void aspeed_gpio_disable_free(struct pinctrl_dev *pctldev,
@@ -68,11 +68,11 @@ index eb87ab7..f06d752 100644
+ return;
+
+ /* Disable any functions of higher priority than GPIO just in case */
-+ while (funcs = *prios) {
++ while ((funcs = *prios)) {
+ if (aspeed_gpio_in_exprs(funcs))
+ break;
+
-+ ret = aspeed_disable_sig(funcs, pdata->maps);
++ ret = aspeed_disable_sig(&pdata->pinmux, funcs);
+ if (ret)
+ return;
+
@@ -96,17 +96,17 @@ index eb87ab7..f06d752 100644
+ prios--;
+ funcs = *prios;
+ expr = *funcs;
-+ aspeed_sig_expr_enable(expr, pdata->maps);
++ aspeed_sig_expr_enable(&pdata->pinmux, expr);
+}
+
int aspeed_pinctrl_probe(struct platform_device *pdev,
struct pinctrl_desc *pdesc,
struct aspeed_pinctrl_data *pdata)
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.h b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
-index d4d7f03..0037b11 100644
+index 11cc0eb6666b..735162ebb855 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.h
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
-@@ -595,6 +595,9 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
+@@ -64,6 +64,9 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned int offset);
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch
index 1d26b9667..c38134b8c 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch
@@ -1,4 +1,4 @@
-From d26dd7c4ef1a2cb88440420deccc54eb88129c60 Mon Sep 17 00:00:00 2001
+From 7513371d16158cb638dd97e81b402bbef7ed3156 Mon Sep 17 00:00:00 2001
From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
Date: Mon, 6 May 2019 14:18:27 -0700
Subject: [PATCH] Enable GPIOE0 and GPIOE2 pass-through by default
@@ -23,10 +23,10 @@ Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2 files changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-index 45556ac..051e927 100644
+index b049f816bf67..4815104459f1 100644
--- a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-@@ -124,6 +124,10 @@
+@@ -116,6 +116,10 @@
&gpio {
status = "okay";
@@ -35,21 +35,21 @@ index 45556ac..051e927 100644
+ pinctrl-0 = <&pinctrl_gpie0_default
+ &pinctrl_gpie2_default>;
gpio-line-names =
- /*A0-A8*/ "","","","","","","","",
- /*B0-B8*/ "","","","","","","","",
+ /*A0-A7*/ "","","","","","","","",
+ /*B0-B7*/ "","","","","","","","",
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
-index 2175070..f47d139 100644
+index 13d80bfbc3b6..e426452a28f7 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
-@@ -1157,6 +1157,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
+@@ -1152,6 +1152,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
+ {
const struct of_device_id *gpio_id;
struct aspeed_gpio *gpio;
- struct resource *res;
+ struct pinctrl *pinctrl;
int rc, i, banks;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
-@@ -1205,6 +1206,15 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
+@@ -1199,6 +1200,15 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
return -ENOMEM;
/*
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0004-Test-code-for-LPC-MBOX.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0004-Test-code-for-LPC-MBOX.patch
deleted file mode 100644
index dbb163d20..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0004-Test-code-for-LPC-MBOX.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From 2f3587cf9e44f261fe74413ef6a54467686c910b Mon Sep 17 00:00:00 2001
-From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
-Date: Tue, 20 Nov 2018 15:49:15 -0800
-Subject: [PATCH] Test code for LPC MBOX
-
-Blocked interrupt driven code for test.
-
-Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
----
- drivers/misc/aspeed-lpc-mbox.c | 21 ++++++++++++++++++++-
- 1 file changed, 20 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/misc/aspeed-lpc-mbox.c b/drivers/misc/aspeed-lpc-mbox.c
-index 0f0c711bafee..0933e0553953 100644
---- a/drivers/misc/aspeed-lpc-mbox.c
-+++ b/drivers/misc/aspeed-lpc-mbox.c
-@@ -19,6 +19,8 @@
-
- #define DEVICE_NAME "aspeed-mbox"
-
-+#define MBX_USE_INTERRUPT 0
-+
- #define ASPEED_MBOX_NUM_REGS 16
-
- #define ASPEED_MBOX_DATA_0 0x00
-@@ -79,12 +81,14 @@ static int aspeed_mbox_open(struct inode *inode, struct file *file)
- struct aspeed_mbox *mbox = file_mbox(file);
-
- if (atomic_inc_return(&aspeed_mbox_open_count) == 1) {
-+#if MBX_USE_INTERRUPT
- /*
- * Clear the interrupt status bit if it was left on and unmask
- * interrupts.
- * ASPEED_MBOX_CTRL_RECV bit is W1C, this also unmasks in 1 step
- */
- aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
-+#endif
- return 0;
- }
-
-@@ -106,6 +110,7 @@ static ssize_t aspeed_mbox_read(struct file *file, char __user *buf,
- if (count + *ppos > ASPEED_MBOX_NUM_REGS)
- return -EINVAL;
-
-+#if MBX_USE_INTERRUPT
- if (file->f_flags & O_NONBLOCK) {
- if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
- ASPEED_MBOX_CTRL_RECV))
-@@ -115,6 +120,7 @@ static ssize_t aspeed_mbox_read(struct file *file, char __user *buf,
- ASPEED_MBOX_CTRL_RECV)) {
- return -ERESTARTSYS;
- }
-+#endif
-
- mutex_lock(&mbox->mutex);
-
-@@ -129,8 +135,10 @@ static ssize_t aspeed_mbox_read(struct file *file, char __user *buf,
- count--;
- }
-
-+#if MBX_USE_INTERRUPT
- /* ASPEED_MBOX_CTRL_RECV bit is write to clear, this also unmasks in 1 step */
- aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
-+#endif
- ret = p - buf;
-
- out_unlock:
-@@ -180,7 +188,9 @@ static unsigned int aspeed_mbox_poll(struct file *file, poll_table *wait)
-
- poll_wait(file, &mbox->queue, wait);
-
-+#if MBX_USE_INTERRUPT
- if (aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV)
-+#endif
- mask |= POLLIN;
-
- return mask;
-@@ -206,6 +216,7 @@ static irqreturn_t aspeed_mbox_irq(int irq, void *arg)
- {
- struct aspeed_mbox *mbox = arg;
-
-+#if MBX_USE_INTERRUPT
- if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV))
- return IRQ_NONE;
-
-@@ -216,6 +227,7 @@ static irqreturn_t aspeed_mbox_irq(int irq, void *arg)
-
- /* Mask it off, we'll clear it when we the data gets read */
- aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_MASK, ASPEED_MBOX_BMC_CTRL);
-+#endif
-
- wake_up(&mbox->queue);
- return IRQ_HANDLED;
-@@ -248,7 +260,14 @@ static int aspeed_mbox_config_irq(struct aspeed_mbox *mbox,
- aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_0);
- aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_1);
-
-- aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
-+ aspeed_mbox_outb(mbox, aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) | ASPEED_MBOX_CTRL_MASK, ASPEED_MBOX_BMC_CTRL);
-+
-+ /*
-+ * Because mailbox data register init value is random, need to give a
-+ * init value to mailbox data register.
-+ */
-+ aspeed_mbox_outb(mbox, 0x00, ASPEED_MBOX_DATA_0);
-+
- return 0;
- }
-
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch
index 03b4f4da4..14b7154bf 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch
@@ -1,4 +1,4 @@
-From ddfbe1364c6ecf77f06990e6550dfe5a3791e6bf Mon Sep 17 00:00:00 2001
+From 9a71adc7aecbfdf066ba54c763c2ecd8fb09d3cd Mon Sep 17 00:00:00 2001
From: Vikram Bodireddy <vikram.bodireddy@intel.com>
Date: Wed, 6 Feb 2019 15:59:34 +0530
Subject: [PATCH] Selecting 128MB for PFR
@@ -13,10 +13,10 @@ Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-index 8aba46cdce46..6959a06d04e2 100644
+index 4815104459f1..df02bb1aaf36 100644
--- a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-@@ -90,7 +90,7 @@
+@@ -89,7 +89,7 @@
flash@0 {
status = "okay";
m25p,fast-read;
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0006-Allow-monitoring-of-power-control-input-GPIOs.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0006-Allow-monitoring-of-power-control-input-GPIOs.patch
index d3b850efe..c1207055d 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0006-Allow-monitoring-of-power-control-input-GPIOs.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0006-Allow-monitoring-of-power-control-input-GPIOs.patch
@@ -1,4 +1,4 @@
-From 2e834ae04eba975066f80102c6f4656da314ca1e Mon Sep 17 00:00:00 2001
+From 029cf5d5ff436ea14ab2d33da32238910be0a8b2 Mon Sep 17 00:00:00 2001
From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
Date: Fri, 24 May 2019 12:42:59 -0700
Subject: [PATCH] Allow monitoring of power control input GPIOs
@@ -27,10 +27,10 @@ Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
-index beb0729..05d1081 100644
+index fbc9a68bd88c..6f151e7c8d81 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
-@@ -250,7 +250,7 @@ FUNC_GROUP_DECL(SD2, F19, E21, F20, D20, D21, E20, G18, C21);
+@@ -272,7 +272,7 @@ FUNC_GROUP_DECL(SD2, F19, E21, F20, D20, D21, E20, G18, C21);
#define B20 32
SIG_EXPR_LIST_DECL_SINGLE(NCTS3, NCTS3, SIG_DESC_SET(SCU80, 16));
@@ -39,7 +39,7 @@ index beb0729..05d1081 100644
SIG_EXPR_DECL(GPIE0IN, GPIE, GPIE_DESC);
SIG_EXPR_LIST_DECL_DUAL(GPIE0IN, GPIE0, GPIE);
MS_PIN_DECL(B20, GPIOE0, NCTS3, GPIE0IN);
-@@ -270,7 +270,7 @@ FUNC_GROUP_DECL(GPIE0, B20, C20);
+@@ -292,7 +292,7 @@ FUNC_GROUP_DECL(GPIE0, B20, C20);
#define F18 34
SIG_EXPR_LIST_DECL_SINGLE(NDSR3, NDSR3, SIG_DESC_SET(SCU80, 18));
@@ -48,7 +48,7 @@ index beb0729..05d1081 100644
SIG_EXPR_DECL(GPIE2IN, GPIE, GPIE_DESC);
SIG_EXPR_LIST_DECL_DUAL(GPIE2IN, GPIE2, GPIE);
MS_PIN_DECL(F18, GPIOE2, NDSR3, GPIE2IN);
-@@ -1349,7 +1349,7 @@ FUNC_GROUP_DECL(ADC15, H4);
+@@ -1371,7 +1371,7 @@ FUNC_GROUP_DECL(ADC15, H4);
#define R22 192
SIG_EXPR_DECL(SIOS3, SIOS3, SIG_DESC_SET(SCUA4, 8));
@@ -57,7 +57,7 @@ index beb0729..05d1081 100644
SIG_EXPR_LIST_DECL_DUAL(SIOS3, SIOS3, ACPI);
SIG_EXPR_LIST_DECL_SINGLE(DASHR22, DASHR22, SIG_DESC_SET(SCU94, 10));
MS_PIN_DECL(R22, GPIOY0, SIOS3, DASHR22);
-@@ -1357,7 +1357,7 @@ FUNC_GROUP_DECL(SIOS3, R22);
+@@ -1379,7 +1379,7 @@ FUNC_GROUP_DECL(SIOS3, R22);
#define R21 193
SIG_EXPR_DECL(SIOS5, SIOS5, SIG_DESC_SET(SCUA4, 9));
@@ -66,7 +66,7 @@ index beb0729..05d1081 100644
SIG_EXPR_LIST_DECL_DUAL(SIOS5, SIOS5, ACPI);
SIG_EXPR_LIST_DECL_SINGLE(DASHR21, DASHR21, SIG_DESC_SET(SCU94, 10));
MS_PIN_DECL(R21, GPIOY1, SIOS5, DASHR21);
-@@ -1373,7 +1373,7 @@ FUNC_GROUP_DECL(SIOPWREQ, P22);
+@@ -1395,7 +1395,7 @@ FUNC_GROUP_DECL(SIOPWREQ, P22);
#define P21 195
SIG_EXPR_DECL(SIOONCTRL, SIOONCTRL, SIG_DESC_SET(SCUA4, 11));
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/intel-ast2500.cfg b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/intel-ast2500.cfg
index 155ba3ae4..9860a2815 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/intel-ast2500.cfg
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/intel-ast2500.cfg
@@ -12,7 +12,6 @@ CONFIG_PECI_CHARDEV=y
CONFIG_PECI_ASPEED=y
CONFIG_SENSORS_PECI_CPUTEMP=y
CONFIG_SENSORS_PECI_DIMMTEMP=y
-CONFIG_OF_CONFIGFS=y
CONFIG_CONFIGFS_FS=y
CONFIG_BLK_DEV_RAM_SIZE=49152
CONFIG_MAGIC_SYSRQ=y
@@ -21,10 +20,12 @@ CONFIG_MAGIC_SYSRQ_SERIAL=y
CONFIG_ASPEED_ESPI_SLAVE=y
CONFIG_ASPEED_KCS_IPMI_BMC=y
CONFIG_I2C_SLAVE=y
-CONFIG_I2C_SLAVE_EEPROM=n
CONFIG_I2C_SLAVE_MQUEUE=y
CONFIG_I2C_SLAVE_MQUEUE_MESSAGE_SIZE=256
CONFIG_I2C_SLAVE_MQUEUE_QUEUE_SIZE=32
+CONFIG_ASPEED_BT_IPMI_BMC=n
+CONFIG_ASPEED_LPC_CTRL=n
+CONFIG_ASPEED_LPC_MBOX=y
CONFIG_ASPEED_LPC_SIO=y
CONFIG_JTAG=y
CONFIG_JTAG_ASPEED=y
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend
index 0ba716442..1ef28afb5 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend
+++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -3,7 +3,7 @@ SRC_URI += "file://intel-ast2500.cfg \
file://0001-arm-dts-add-DTS-for-Intel-platforms.patch \
file://0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch \
file://0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch \
- file://0004-Test-code-for-LPC-MBOX.patch \
file://0006-Allow-monitoring-of-power-control-input-GPIOs.patch \
+ file://0001-aspeed-pwm-tacho-change-default-fan-speed.patch \
"
-SRC_URI += "${@bb.utils.contains('IMAGE_TYPE', 'pfr', 'file://0005-128MB-flashmap-for-PFR.patch', '', d)}"
+SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'file://0005-128MB-flashmap-for-PFR.patch', '', d)}"
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/CYP-baseboard.json b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/CYP-baseboard.json
index 2bbaa0238..42e313568 100644..100755
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/CYP-baseboard.json
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/CYP-baseboard.json
@@ -224,6 +224,12 @@
"Type": "ADC"
},
{
+ "BridgeGpio": [
+ {
+ "Name": "P3VBAT_BRIDGE_EN",
+ "Polarity": "High"
+ }
+ ],
"Index": 7,
"Name": "P3VBAT",
"ScaleFactor": 0.3333,
@@ -661,20 +667,6 @@
},
{
"Direction": "Input",
- "Index": 48,
- "Name": "Cpu Err2",
- "Polarity": "Low",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
- "Index": 49,
- "Name": "Cpu Caterr",
- "Polarity": "Low",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
"Index": 50,
"Name": "PCH Thermaltrip",
"Polarity": "Low",
@@ -1150,6 +1142,90 @@
"Type": "Gpio"
},
{
+ "Address": "0x71",
+ "Bus": 2,
+ "ChannelNames": [
+ "M2_Slot1",
+ "M2_Slot2",
+ "",
+ ""
+ ],
+ "Name": "M.2 Mux",
+ "Type": "PCA9543Mux"
+ },
+ {
+ "Address": "0x70",
+ "Bus": 4,
+ "ChannelNames": [
+ "U2_Slot1",
+ "U2_Slot2",
+ "U2_Slot3",
+ "U2_Slot4"
+ ],
+ "Name": "HSBP 1 Mux",
+ "Type": "PCA9546Mux"
+ },
+ {
+ "Address": "0x74",
+ "Bus": 4,
+ "ChannelNames": [
+ "U2_Slot5",
+ "U2_Slot6",
+ "U2_Slot7",
+ "U2_Slot8"
+ ],
+ "Name": "HSBP 1 Mux2",
+ "Type": "PCA9546Mux"
+ },
+ {
+ "Address": "0x77",
+ "Bus": 4,
+ "ChannelNames": [
+ "U2_Slot1",
+ "U2_Slot2",
+ "U2_Slot3",
+ "U2_Slot4"
+ ],
+ "Name": "HSBP 2 Mux",
+ "Type": "PCA9546Mux"
+ },
+ {
+ "Address": "0x73",
+ "Bus": 4,
+ "ChannelNames": [
+ "U2_Slot5",
+ "U2_Slot6",
+ "U2_Slot7",
+ "U2_Slot8"
+ ],
+ "Name": "HSBP 2 Mux2",
+ "Type": "PCA9546Mux"
+ },
+ {
+ "Address": "0x76",
+ "Bus": 4,
+ "ChannelNames": [
+ "U2_Slot1",
+ "U2_Slot2",
+ "U2_Slot3",
+ "U2_Slot4"
+ ],
+ "Name": "HSBP 3 Mux",
+ "Type": "PCA9546Mux"
+ },
+ {
+ "Address": "0x72",
+ "Bus": 4,
+ "ChannelNames": [
+ "U2_Slot5",
+ "U2_Slot6",
+ "U2_Slot7",
+ "U2_Slot8"
+ ],
+ "Name": "HSBP 3 Mux2",
+ "Type": "PCA9546Mux"
+ },
+ {
"Address": "0x4D",
"Bus": 6,
"Name": "CPU0 VR Temp",
@@ -1343,13 +1419,17 @@
}
],
"Name": "CYP Baseboard",
- "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*CYP'})",
- "Type": "Board",
+ "Probe": [
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'M50CYP2SB2U'})",
+ "OR",
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*CYP'})"
+ ],
"ProductId": 152,
+ "Type": "Board",
"xyz.openbmc_project.Inventory.Decorator.Asset": {
"Manufacturer": "$PRODUCT_MANUFACTURER",
"Model": "$PRODUCT_PRODUCT_NAME",
"PartNumber": "$PRODUCT_PART_NUMBER",
"SerialNumber": "$PRODUCT_SERIAL_NUMBER"
}
-}
+} \ No newline at end of file
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/TNP-baseboard.json b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/TNP-baseboard.json
index 39e101e77..235e7965a 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/TNP-baseboard.json
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/TNP-baseboard.json
@@ -193,6 +193,12 @@
"Type": "ADC"
},
{
+ "BridgeGpio": [
+ {
+ "Name": "P3VBAT_BRIDGE_EN",
+ "Polarity": "High"
+ }
+ ],
"Index": 7,
"Name": "P3VBAT",
"ScaleFactor": 0.3333,
@@ -558,33 +564,12 @@
},
{
"Direction": "Input",
- "Index": 49,
- "Name": "Cpu Caterr",
- "Polarity": "Low",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
- "Index": 48,
- "Name": "Cpu Err2",
- "Polarity": "Low",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
"Index": 63,
"Name": "PU 240VA Status",
"Polarity": "Low",
"Type": "Gpio"
},
{
- "Direction": "Out",
- "Index": 208,
- "Name": "P3v3bat BridgeEn",
- "Polarity": "High",
- "Type": "Gpio"
- },
- {
"Direction": "Input",
"Index": 214,
"Name": "Nmi Button",
@@ -1687,6 +1672,39 @@
"Type": "IpmbSensor"
},
{
+ "Address": "0x20",
+ "Bus": 10,
+ "Class": "NodePower",
+ "Name": "Node Power",
+ "Thresholds": [
+ {
+ "Direction": "greater than",
+ "Name": "upper critical",
+ "Severity": 1,
+ "Value": 255
+ },
+ {
+ "Direction": "greater than",
+ "Name": "upper non critical",
+ "Severity": 0,
+ "Value": 250
+ },
+ {
+ "Direction": "less than",
+ "Name": "lower non critical",
+ "Severity": 0,
+ "Value": 5
+ },
+ {
+ "Direction": "less than",
+ "Name": "lower critical",
+ "Severity": 1,
+ "Value": 0
+ }
+ ],
+ "Type": "MP5920"
+ },
+ {
"GpioPins": [
27,
26
@@ -1818,7 +1836,11 @@
}
],
"Name": "TNP Baseboard",
- "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*TNP'})",
+ "Probe": [
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'D50TNP1SB'})",
+ "OR",
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*TNP'})"
+ ],
"ProductId": 153,
"Type": "Board",
"xyz.openbmc_project.Inventory.Decorator.Asset": {
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WC-Baseboard.json b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WC-Baseboard.json
index ce98132d6..9431c30a6 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WC-Baseboard.json
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WC-Baseboard.json
@@ -162,7 +162,12 @@
"Type": "ADC"
},
{
- "BridgeGpio": 208,
+ "BridgeGpio": [
+ {
+ "Name": "P3VBAT_BRIDGE_EN",
+ "Polarity": "High"
+ }
+ ],
"Index": 7,
"Name": "P3VBAT",
"ScaleFactor": 0.3333,
@@ -656,13 +661,6 @@
"Type": "FanRedundancy"
},
{
- "Direction": "Out",
- "Index": 208,
- "Name": "Bridge P3VBAT",
- "Polarity": "Low",
- "Type": "Gpio"
- },
- {
"Direction": "Input",
"Index": 40,
"Name": "NMI Input",
@@ -671,20 +669,6 @@
},
{
"Direction": "Input",
- "Index": 48,
- "Name": "CPU ERR2",
- "Polarity": "High",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
- "Index": 49,
- "Name": "CPU CATERR",
- "Polarity": "High",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
"Index": 214,
"Name": "SMI Input",
"Polarity": "High",
@@ -1197,7 +1181,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 65.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1439,7 +1423,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1464,7 +1448,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1490,7 +1474,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1515,7 +1499,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1541,7 +1525,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1567,7 +1551,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1592,7 +1576,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1669,7 +1653,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 75.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1686,16 +1670,18 @@
"ILimitMax": 100,
"ILimitMin": 30,
"Inputs": [
- "VR 1 Temp"
+ "CPU1 VR Mem ABCD Temp",
+ "CPU1 VR Mem ABCD Temp",
+ "CPU1 VR P1V8"
],
- "Name": "VR 1 Temp",
+ "Name": "CPU 1 VR Temp",
"NegativeHysteresis": 5.0,
"OutLimitMax": 100,
"OutLimitMin": 30,
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 85.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1711,16 +1697,18 @@
"ILimitMax": 100,
"ILimitMin": 30,
"Inputs": [
- "VR 2 Temp"
+ "CPU2 VR Mem ABCD Temp",
+ "CPU2 VR Mem ABCD Temp",
+ "CPU2 VR P1V8"
],
- "Name": "VR 2 Temp",
+ "Name": "CPU 2 VR Temp",
"NegativeHysteresis": 5.0,
"OutLimitMax": 100,
"OutLimitMin": 30,
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 85.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -2036,7 +2024,11 @@
}
],
"Name": "WC Baseboard",
- "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*WC'})",
+ "Probe": [
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'WilsonCity'})",
+ "OR",
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*WC'})"
+ ],
"ProductId": 145,
"Type": "Board",
"xyz.openbmc_project.Inventory.Decorator.Asset": {
@@ -2044,5 +2036,9 @@
"Model": "$PRODUCT_PRODUCT_NAME",
"PartNumber": "$PRODUCT_PART_NUMBER",
"SerialNumber": "$PRODUCT_SERIAL_NUMBER"
- }
+ },
+ "xyz.openbmc_project.Inventory.Decorator.AssetTag": {
+ "AssetTag": "$PRODUCT_ASSET_TAG"
+ },
+ "xyz.openbmc_project.Inventory.Item.System": {}
} \ No newline at end of file
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WP-Baseboard.json b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WP-Baseboard.json
index 923924a0b..7da6fe261 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WP-Baseboard.json
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/configuration/entity-manager/WP-Baseboard.json
@@ -162,7 +162,12 @@
"Type": "ADC"
},
{
- "BridgeGpio": 208,
+ "BridgeGpio": [
+ {
+ "Name": "P3VBAT_BRIDGE_EN",
+ "Polarity": "High"
+ }
+ ],
"Index": 7,
"Name": "P3VBAT",
"ScaleFactor": 0.3333,
@@ -656,20 +661,6 @@
"Type": "FanRedundancy"
},
{
- "Direction": "Out",
- "Index": 208,
- "Name": "Bridge P3VBAT",
- "Polarity": "Low",
- "Type": "Gpio"
- },
- {
- "Direction": "Input",
- "Index": 49,
- "Name": "CPU CATERR",
- "Polarity": "High",
- "Type": "Gpio"
- },
- {
"Direction": "Input",
"Index": 214,
"Name": "SMI Input",
@@ -1183,7 +1174,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 65.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1425,7 +1416,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1450,7 +1441,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1476,7 +1467,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1501,7 +1492,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1527,7 +1518,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1553,7 +1544,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1578,7 +1569,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 80.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1655,7 +1646,7 @@
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 75.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1672,16 +1663,18 @@
"ILimitMax": 100,
"ILimitMin": 30,
"Inputs": [
- "VR 1 Temp"
+ "CPU1 VR Mem ABCD Temp",
+ "CPU1 VR Mem ABCD Temp",
+ "CPU1 VR P1V8"
],
- "Name": "VR 1 Temp",
+ "Name": "CPU 1 VR Temp",
"NegativeHysteresis": 5.0,
"OutLimitMax": 100,
"OutLimitMin": 30,
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 85.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -1697,16 +1690,18 @@
"ILimitMax": 100,
"ILimitMin": 30,
"Inputs": [
- "VR 2 Temp"
+ "CPU2 VR Mem ABCD Temp",
+ "CPU2 VR Mem ABCD Temp",
+ "CPU2 VR P1V8"
],
- "Name": "VR 2 Temp",
+ "Name": "CPU 2 VR Temp",
"NegativeHysteresis": 5.0,
"OutLimitMax": 100,
"OutLimitMin": 30,
"Outputs": [],
"PCoefficient": -0.15,
"PositiveHysteresis": 0.0,
- "SetPoint": 60.0,
+ "SetPoint": 85.0,
"SlewNeg": -1,
"SlewPos": 0.0,
"Type": "Pid",
@@ -2022,7 +2017,11 @@
}
],
"Name": "WP Baseboard",
- "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*WP'})",
+ "Probe": [
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'WilsonPoint'})",
+ "OR",
+ "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*WP'})"
+ ],
"ProductId": 154,
"Type": "Board",
"xyz.openbmc_project.Inventory.Decorator.Asset": {
@@ -2030,5 +2029,9 @@
"Model": "$PRODUCT_PRODUCT_NAME",
"PartNumber": "$PRODUCT_PART_NUMBER",
"SerialNumber": "$PRODUCT_SERIAL_NUMBER"
- }
-}
+ },
+ "xyz.openbmc_project.Inventory.Decorator.AssetTag": {
+ "AssetTag": "$PRODUCT_ASSET_TAG"
+ },
+ "xyz.openbmc_project.Inventory.Item.System": {}
+} \ No newline at end of file
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed.bb b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed.bb
deleted file mode 100644
index 9c10c5b3d..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "Set Wolfpass fan default speeds"
-DESCRIPTION = "Sets all fans to a single speed"
-
-inherit allarch
-inherit obmc-phosphor-systemd
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
-
-RDEPENDS_${PN} += "python"
-
-S = "${WORKDIR}"
-SRC_URI += "file://set_fan_speeds.py"
-
-SYSTEMD_SERVICE_${PN} += "fan-default-speed.service"
-
-do_install() {
- install -d ${D}/${bindir}
- install -m 0755 ${WORKDIR}/set_fan_speeds.py ${D}/${bindir}/set_fan_speeds.py
-}
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/fan-default-speed.service b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/fan-default-speed.service
deleted file mode 100644
index 267fdee43..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/fan-default-speed.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Set fans to a default speed
-ConditionFileNotEmpty={bindir}/set_fan_speeds.py
-
-[Service]
-ExecStart={bindir}/set_fan_speeds.py 150
-Type=oneshot
-
-[Install]
-WantedBy=default.target
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/set_fan_speeds.py b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/set_fan_speeds.py
deleted file mode 100644
index 70ba64799..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fans/fan-default-speed/set_fan_speeds.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/python
-import os
-import glob
-import time
-import sys
-
-HWMON_DIR = "/sys/class/hwmon/hwmon0"
-
-count = 0
-inputs = None
-while not inputs:
- count += 1
- if count > 20:
- print("pwm missing!")
- sys.exit(0)
-
- inputs = glob.glob(os.path.join(HWMON_DIR, "pwm*"))
- time.sleep(5)
-
-inputs = glob.glob(os.path.join(HWMON_DIR, "pwm*"))
-for pwm in inputs:
- with open(pwm, 'w') as f:
- f.write(sys.argv[1])
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb
index 1ae1680e0..b8b8f7524 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb
@@ -8,13 +8,25 @@ SYSTEMD_SERVICE_${PN} = "SetBaseboardFru.service"
S = "${WORKDIR}"
SRC_URI = "file://checkFru.sh \
file://SetBaseboardFru.service \
- file://*.fru.bin"
+ file://create_fru.py"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
RDEPENDS_${PN} = "bash"
+python do_compile() {
+ import sys
+ workdir = d.getVar('WORKDIR', True)
+ sys.path.insert(0, workdir)
+ from create_fru import create_fru
+ create_fru('S2600WFT')
+ create_fru('WilsonCity')
+ create_fru('WilsonPoint')
+ create_fru('M50CYP2SB2U')
+ create_fru('D50TNP1SB')
+}
+
do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}/checkFru.sh ${D}/${bindir}/checkFru.sh
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin
deleted file mode 100644
index ba5b96392..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin
+++ /dev/null
Binary files differ
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin
deleted file mode 100644
index afd58e6b9..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin
+++ /dev/null
Binary files differ
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin
deleted file mode 100644
index 76c4b8d4b..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin
+++ /dev/null
Binary files differ
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin
deleted file mode 100644
index 1b9f97ff4..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin
+++ /dev/null
Binary files differ
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin
deleted file mode 100644
index fb219c0ce..000000000
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin
+++ /dev/null
Binary files differ
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh
index 1eb79b299..4b7910198 100755
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh
@@ -22,16 +22,16 @@ done
# wp
if (($result == 62)); then
- cat S2600WP.fru.bin > $fruFile
+ cat WilsonPoint.fru.bin > $fruFile
# wc
elif (($result == 45)); then
- cat S2600WC.fru.bin > $fruFile
+ cat WilsonCity.fru.bin > $fruFile
# cyp
elif (($result == 60)); then
- cat S2600CYP.fru.bin > $fruFile
+ cat M50CYP2SB2U.fru.bin > $fruFile
# tnp
elif (($result == 12)); then
- cat S2600TNP.fru.bin > $fruFile
+ cat D50TNP1SB.fru.bin > $fruFile
# default to wft
else
cat S2600WFT.fru.bin > $fruFile
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py
new file mode 100755
index 000000000..7f11cbf2d
--- /dev/null
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py
@@ -0,0 +1,154 @@
+#!/usr/bin/python3
+
+"""
+This script generates a default baseboard fru file.
+"""
+
+
+def create_fru(name):
+ if len(name) > 16:
+ raise Exception('Product Name Too Large: {}'.format(name))
+
+ fill_char = ord('.')
+ eof = 0xC1
+
+ filename = '{}.fru.bin'.format(name)
+ name = name.encode('ascii')
+
+ name_len = (0x3 << 6) | len(name)
+
+ # internal area
+ internal = [0x01] + ([0] * 6) + [0x01]
+
+ # chassis area
+ chassis = [0x01, # Chassis Info Area Format Version Bit Fields
+ 0xFF, # Chassis Info Area Length (in multiples of 8 bytes)
+ 0x17] # Chassis Type (Main Server Chassis)
+
+ fill_len = 18
+
+ # Chassis Part Number
+ chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len)
+
+ # Chassis Serial Number
+ chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len)
+
+ fill_len = 31
+ chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # Info AM1
+ chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # Info AM2
+
+ chassis.append(eof)
+
+ chassis.append(0) # need room for checksum
+
+ while len(chassis) % 8: # pad
+ chassis.append(0)
+
+ chassis[1] = int(len(chassis) / 8) # populate length
+ chassis[-1] = (256 - sum(chassis)) & 0xFF # populate checksum
+
+ # board area
+ board = [0x1, # Board Info Area Format Version Bit Fields
+ 0xFF, # Board Info Area Length (in multiples of 8 bytes)
+ 0x0, # Language Code
+ 0x0, # Mfg. Date/Time
+ 0x0, # Mfg. Date/Time
+ 0x0, # Mfg. Date/Time
+ 0xD1] # Product Manufacturer Name Len
+
+ corp = b'Intel Corporation'
+ board += bytearray(corp) # Manufacturer Name
+
+ board.append(name_len)
+ board += bytearray(name) # Board Product Name
+
+ fill_len = 12
+ board += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # board SN
+
+ fill_len = 10
+ board += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # board PN
+
+ version = b'FRU Ver 0.01'
+
+ board += [0x3 << 6 | len(version)] # FRU File version ID string
+ board += bytearray(version)
+
+ board.append(eof)
+
+ board.append(0) # need room for checksum
+
+ while len(board) % 8:
+ board.append(0)
+
+ board[1] = int(len(board) / 8) # populate length
+ board[-1] = (256 - sum(board)) & 0xFF # populate checksum
+
+ # product area
+ product = [1, # Product Info Area Format Version Bit Fields
+ 0xFF, # Product Info Area Length (in multiples of 8 bytes)
+ 0x0, # Language Code
+ 0xD1] # Product Manufacturer Name Len
+
+ product += bytearray(corp) # Manufacturer Name
+
+ product.append(name_len) # Product Name Len
+ product += bytearray(name) # Product Name
+
+ fill_len = 10
+
+ # Product Part Number
+ product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len)
+
+ # Product Version
+ fill_len = 20
+ product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len)
+
+ # Product Serial Number
+ fill_len = 12
+ product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len)
+
+ # Asset Tag
+ fill_len = 20
+ product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len)
+
+ product.append(0xC0) # FRU File ID (Not used)
+ product.append(eof)
+
+ product.append(0) # need room for checksum
+
+ while len(product) % 8:
+ product.append(0)
+
+ product[1] = int(len(product) / 8)
+ product[-1] = (256 - sum(product)) & 0xFF
+
+ header = [0x1]
+ length = 1 # internal
+ header.append(length)
+ length += int(len(internal) / 8)
+ header.append(length)
+ length += int(len(chassis) / 8)
+ header.append(length)
+ length += int(len(board) / 8)
+ header.append(length)
+ header.append(0)
+ header.append(0)
+ header.append((256 - sum(header)) & 0xFF)
+
+ result = header + internal + chassis + board + product
+
+ while len(result) < 0x1FF:
+ result.append(0)
+
+ result = bytearray(result)
+
+ # print(result)
+
+ with open(filename, 'wb') as out:
+ out.write(result)
+
+
+if __name__ == '__main__':
+ product_name = input('Enter Product Name: ')
+ create_fru(product_name)
+
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/workbook/wolfpass-config.bb b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/workbook/wolfpass-config.bb
index ead62f47e..c91053536 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/workbook/wolfpass-config.bb
+++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/workbook/wolfpass-config.bb
@@ -7,4 +7,4 @@ inherit config-in-skeleton
LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
SRCREV = "946064239016e38cd1cc346047b1d26960c06cdb"
-SKELETON_URI = "git://git-amr-1.devtools.intel.com:29418/openbmc-skeleton.git;protocol=ssh;branch=intel"
+SKELETON_URI = "git://git@github.com/Intel-BMC/skeleton.git;protocol=ssh;branch=intel"
diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch
new file mode 100644
index 000000000..cca6c838b
--- /dev/null
+++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch
@@ -0,0 +1,83 @@
+From 2ad1d60c39a2a9a08bcd29188362efba4e92e546 Mon Sep 17 00:00:00 2001
+From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
+Date: Tue, 9 Apr 2019 16:18:07 -0700
+Subject: [PATCH] hw/arm/aspeed: Add an intel-ast2500 machine type
+
+Include the HW strap setting and some I2C temperature sensors.
+
+Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+---
+ hw/arm/aspeed.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
+index 465e65f323..80e8466aa9 100644
+--- a/hw/arm/aspeed.c
++++ b/hw/arm/aspeed.c
+@@ -60,6 +60,21 @@ struct AspeedBoardState {
+ SCU_HW_STRAP_MAC0_RGMII) & \
+ ~SCU_HW_STRAP_2ND_BOOT_WDT)
+
++/* intel ast2500 hardware value: 0xF3CCC286 */
++#define INTEL_AST2500_BMC_HW_STRAP1 (( \
++ AST2500_HW_STRAP1_DEFAULTS | \
++ SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE | \
++ SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE | \
++ SCU_AST2500_HW_STRAP_UART_DEBUG | \
++ SCU_AST2500_HW_STRAP_ESPI_ENABLE | \
++ SCU_AST2500_HW_STRAP_DDR4_ENABLE | \
++ SCU_HW_STRAP_GPIOE_PT_EN | \
++ SCU_AST2400_HW_STRAP_ACPI_DIS | \
++ SCU_HW_STRAP_CLK_48M_IN | \
++ SCU_HW_STRAP_VGA_CLASS_CODE | \
++ SCU_HW_STRAP_MAC1_RGMII) & \
++ ~SCU_HW_STRAP_2ND_BOOT_WDT)
++
+ /* Romulus hardware value: 0xF10AD206 */
+ #define ROMULUS_BMC_HW_STRAP1 ( \
+ AST2500_HW_STRAP1_DEFAULTS | \
+@@ -281,6 +296,24 @@ static void ast2500_evb_i2c_init(AspeedBoardState *bmc)
+ i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+ }
+
++static void intel_ast2500_i2c_init(AspeedBoardState *bmc)
++{
++ AspeedSoCState *soc = &bmc->soc;
++ DeviceState *dev;
++
++ dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp421", 0x4d);
++ object_property_set_int(OBJECT(dev), 50000, "temperature0", &error_abort);
++ /* The s2600wf expects a TMP75 but a TMP105 is compatible */
++ dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x48);
++ object_property_set_int(OBJECT(dev), 50000, "temperature", &error_abort);
++ dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x49);
++ object_property_set_int(OBJECT(dev), 50000, "temperature", &error_abort);
++ dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x4a);
++ object_property_set_int(OBJECT(dev), 50000, "temperature", &error_abort);
++ dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x4b);
++ object_property_set_int(OBJECT(dev), 50000, "temperature", &error_abort);
++}
++
+ static void romulus_bmc_i2c_init(AspeedBoardState *bmc)
+ {
+ AspeedSoCState *soc = &bmc->soc;
+@@ -390,6 +423,15 @@ static const AspeedBoardConfig aspeed_boards[] = {
+ .spi_model = "mx25l25635e",
+ .num_cs = 1,
+ .i2c_init = ast2500_evb_i2c_init,
++ }, {
++ .name = MACHINE_TYPE_NAME("intel-ast2500"),
++ .desc = "Intel AST2500 BMC (ARM1176)",
++ .soc_name = "ast2500-a1",
++ .hw_strap1 = INTEL_AST2500_BMC_HW_STRAP1,
++ .fmc_model = "n25q512a",
++ .spi_model = "n25q512a",
++ .num_cs = 1,
++ .i2c_init = intel_ast2500_i2c_init,
+ }, {
+ .name = MACHINE_TYPE_NAME("romulus-bmc"),
+ .desc = "OpenPOWER Romulus BMC (ARM1176)",
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-Turn-Off-FFWUPD-Jumper.patch b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-Turn-Off-FFWUPD-Jumper.patch
new file mode 100644
index 000000000..2f81895d0
--- /dev/null
+++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/files/0002-Turn-Off-FFWUPD-Jumper.patch
@@ -0,0 +1,32 @@
+From db99abbddc9fe958353e47fcd91c741bd7a93066 Mon Sep 17 00:00:00 2001
+From: James Feist <james.feist@linux.intel.com>
+Date: Wed, 19 Jun 2019 14:15:07 -0700
+Subject: [PATCH] Turn Off FFWUPD Jumper
+
+This disabled the jumper so we don't get stuck during
+boot.
+
+TODO: Do this the "right way", if there is one.
+
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+---
+ hw/gpio/aspeed_gpio.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
+index 12d8a49666..ca6f8dd0dd 100644
+--- a/hw/gpio/aspeed_gpio.c
++++ b/hw/gpio/aspeed_gpio.c
+@@ -29,6 +29,9 @@ static uint64_t aspeed_gpio_read(void *opaque, hwaddr addr,
+ val = s->regs[addr];
+ }
+
++ if (addr == 0x0){
++ val |= 1 << 0x18; // ffupd jumper
++ }
+ return val;
+ }
+
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-native_%.bbappend b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-native_%.bbappend
new file mode 100644
index 000000000..4b4630d7c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-native_%.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI = "git://github.com/openbmc/qemu.git \
+ file://0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch \
+ file://0002-Turn-Off-FFWUPD-Jumper.patch"
+
+QEMU_TARGETS = "arm"
+
+S = "${WORKDIR}/git"
+SRCREV = "5dca85cb0b85ac309d131f9db1fb57af282d67cc"
diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend
new file mode 100644
index 000000000..fb0a749bb
--- /dev/null
+++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu-system-native_%.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI = "git://github.com/openbmc/qemu.git \
+ file://powerpc_rom.bin \
+ file://run-ptest \
+ file://0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch \
+ file://0002-Turn-Off-FFWUPD-Jumper.patch"
+
+QEMU_TARGETS = "arm"
+
+S = "${WORKDIR}/git"
+SRCREV = "5dca85cb0b85ac309d131f9db1fb57af282d67cc"
diff --git a/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu_%.bbappend b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu_%.bbappend
new file mode 100644
index 000000000..b25c0f2e8
--- /dev/null
+++ b/meta-openbmc-mods/meta-common-small/recipes-devtools/qemu/qemu_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI = "git://github.com/openbmc/qemu.git \
+ file://0001-hw-arm-aspeed-Add-an-intel-ast2500-machine-type.patch \
+ file://0002-Turn-Off-FFWUPD-Jumper.patch"
+
+S = "${WORKDIR}/git"
+SRCREV = "5dca85cb0b85ac309d131f9db1fb57af282d67cc"
diff --git a/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass b/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass
new file mode 100644
index 000000000..834c09229
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass
@@ -0,0 +1,112 @@
+
+
+inherit obmc-phosphor-full-fitimage
+
+require recipes-core/os-release/version-vars.inc
+
+IMAGE_TYPES += "intel-pfr"
+
+IMAGE_TYPEDEP_intel-pfr = "mtd-auto"
+IMAGE_TYPES_MASKED += "intel-pfr"
+
+# PFR macros
+# directory where PFR scripts and key are copied
+PFR_STAGING_DIR = "${STAGING_DIR}/intel-pfr-files"
+# PFR images directory
+PFR_IMAGES_DIR = "${DEPLOY_DIR_IMAGE}/pfr_images"
+
+# Refer flash map in manifest.json for the addresses offset
+PFM_OFFSET = "0x80000"
+
+# 0x80000/1024 = 0x200 or 512, 1K Page size.
+PFM_OFFSET_PAGE = "512"
+
+# RC_IMAGE
+RC_IMAGE_OFFSET = "0x02a00000"
+
+# RC_IMAGE_PAGE= 0x02a00000/1024 = 0xA800 or 43008
+RC_IMAGE_PAGE = "43008"
+
+do_image_pfr () {
+ bbplain "Generating Intel PFR compliant BMC image"
+
+ bbplain "Build Version = ${build_version}"
+ bbplain "Build Number = ${build_number}"
+ bbplain "Build Hash = ${build_hash}"
+
+ mkdir -p "${PFR_IMAGES_DIR}"
+ cd "${PFR_IMAGES_DIR}"
+
+ # python script that does the creating PFM, BMC compressed and unsigned images from BMC 128MB raw binary file.
+ python ${PFR_STAGING_DIR}/pfr_image.py ${PFR_STAGING_DIR}/pfr_image-manifest.json ${DEPLOY_DIR_IMAGE}/image-mtd ${build_version} ${build_number} ${build_hash}
+
+ # sign the PFM region
+ ${PFR_STAGING_DIR}/blocksign -c ${PFR_STAGING_DIR}/pfm_config.xml -o ${PFR_IMAGES_DIR}/pfm_signed.bin ${PFR_IMAGES_DIR}/pfm.bin
+
+ # Add the signed PFM to rom image
+ dd bs=1k conv=notrunc seek=${PFM_OFFSET_PAGE} if=${PFR_IMAGES_DIR}/pfm_signed.bin of=${PFR_IMAGES_DIR}/image-mtd-pfr
+
+ # Create unsigned BMC update capsule - append with 1. pfm_signed, 2. pbc, 3. bmc compressed
+ dd if=${PFR_IMAGES_DIR}/pfm_signed.bin bs=1k >> ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ dd if=${PFR_IMAGES_DIR}/pbc.bin bs=1k >> ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ dd if=${PFR_IMAGES_DIR}/bmc_compressed.bin bs=1k >> ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ # Sign the BMC update capsule
+ ${PFR_STAGING_DIR}/blocksign -c ${PFR_STAGING_DIR}/bmc_config.xml -o ${PFR_IMAGES_DIR}/bmc_signed_cap.bin ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin
+
+ # Add the signed bmc update capsule to full rom image @ 0x2a00000
+ dd bs=1k conv=notrunc seek=${RC_IMAGE_PAGE} if=${PFR_IMAGES_DIR}/bmc_signed_cap.bin of=${PFR_IMAGES_DIR}/image-mtd-pfr
+
+ # Append date and time to all the PFR images
+ mv ${PFR_IMAGES_DIR}/pfm_signed.bin ${PFR_IMAGES_DIR}/pfm_signed-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/pfm.bin ${PFR_IMAGES_DIR}/pfm-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/pbc.bin ${PFR_IMAGES_DIR}/pbc-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/bmc_compressed.bin ${PFR_IMAGES_DIR}/bmc_compressed-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/bmc_unsigned_cap.bin ${PFR_IMAGES_DIR}/bmc_unsigned-cap_${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/bmc_signed_cap.bin ${PFR_IMAGES_DIR}/bmc_signed_cap-${DATETIME}.bin
+ mv ${PFR_IMAGES_DIR}/image-mtd-pfr ${PFR_IMAGES_DIR}/image-mtd-pfr-${DATETIME}
+}
+
+do_image_pfr[vardepsexclude] += "DATETIME"
+do_image_pfr[vardeps] += "IPMI_MAJOR IPMI_MINOR IPMI_AUX13 IPMI_AUX14 IPMI_AUX15 IPMI_AUX16"
+
+python() {
+ types = d.getVar('IMAGE_FSTYPES', True).split()
+
+ if 'intel-pfr' in types:
+
+ bld_ver1 = d.getVar('IPMI_MAJOR', True)
+ bld_ver1 = int(bld_ver1) << 8
+
+ bld_ver2 = d.getVar('IPMI_MINOR', True)
+ bld_ver2 = int(bld_ver2)
+
+ bld_ver = bld_ver1 | bld_ver2
+ d.setVar('build_version', str(bld_ver))
+
+ bld_num = d.getVar('IPMI_AUX13', True)
+
+ d.setVar('build_number', bld_num)
+
+ bld_hash1 = d.getVar('IPMI_AUX14', True)
+ bld_hash2 = d.getVar('IPMI_AUX15', True)
+ bld_hash3 = d.getVar('IPMI_AUX16', True)
+
+ bld_hash1 = int(bld_hash1, 16)
+ bld_hash2 = int(bld_hash2, 16)
+ bld_hash3 = int(bld_hash3, 16)
+
+ bld_hash = bld_hash3 << 16
+ bld_hash |= bld_hash2 << 8
+ bld_hash |= bld_hash1
+
+ d.setVar('build_hash', str(bld_hash))
+
+ bb.build.addtask(# task, depends_on_task, task_depends_on, d )
+ 'do_image_pfr',
+ 'do_build',
+ 'do_generate_auto', d)
+}
+
diff --git a/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass b/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass
index 24469356f..f90a19c4b 100644
--- a/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass
+++ b/meta-openbmc-mods/meta-common/classes/image_types_phosphor_auto.bbclass
@@ -19,11 +19,13 @@ IMAGE_TYPES_MASKED += "mtd-auto"
# Flash characteristics in KB unless otherwise noted
python() {
+ types = d.getVar('IMAGE_FSTYPES', True).split()
+
# TODO: find partition list in DTS
d.setVar('FLASH_UBOOT_OFFSET', str(0))
- if d.getVar('IMAGE_TYPE', True) == 'pfr':
+ if 'intel-pfr' in types:
d.setVar('FLASH_SIZE', str(128*1024))
- DTB_FULL_FIT_IMAGE_OFFSETS = [0x1100000]
+ DTB_FULL_FIT_IMAGE_OFFSETS = [0xb00000]
else:
d.setVar('FLASH_SIZE', str(64*1024))
DTB_FULL_FIT_IMAGE_OFFSETS = [0x80000, 0x2480000]
@@ -42,7 +44,7 @@ mk_nor_image() {
}
do_generate_auto() {
- bbdebug 1 "do_generate_auto IMAGE_TYPE=${IMAGE_TYPE} size=${FLASH_SIZE}KB (${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.auto.mtd)"
+ bbdebug 1 "do_generate_auto IMAGE_TYPES=${IMAGE_TYPES} size=${FLASH_SIZE}KB (${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.auto.mtd)"
# Assemble the flash image
mk_nor_image ${IMGDEPLOYDIR}/${IMAGE_NAME}.auto.mtd ${FLASH_SIZE}
dd bs=1k conv=notrunc seek=${FLASH_UBOOT_OFFSET} \
diff --git a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass
index fefa65569..26c895951 100644
--- a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass
+++ b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass
@@ -10,14 +10,6 @@ DEPS = " ${PN}:do_image_${@d.getVar('IMAGE_BASETYPE', True).replace('-', '_')} \
virtual/kernel:do_deploy \
u-boot:do_populate_sysroot "
-python() {
- if d.getVar('IMAGE_TYPE', True) == 'pfr':
- d.appendVar('DEPS', ' openssl-native:do_populate_sysroot \
- ${SIGNING_KEY_DEPENDS} \
- ${PN}:do_copy_signing_pubkey')
-}
-
-
# Options for the device tree compiler passed to mkimage '-D' feature:
UBOOT_MKIMAGE_DTCOPTS ??= ""
@@ -478,14 +470,6 @@ python do_generate_phosphor_manifest() {
fd.write('HashType=RSA-SHA256\n')
}
-make_signatures() {
- signature_files=""
- for file in "$@"; do
- openssl dgst -sha256 -sign ${SIGNING_KEY} -out "${file}.sig" $file
- signature_files="${signature_files} ${file}.sig"
- done
-}
-
def get_pubkey_type(d):
return os.listdir(get_pubkey_basedir(d))[0]
@@ -534,14 +518,7 @@ do_image_fitimage_rootfs() {
# touch the required files to minimize change
touch image-kernel image-rofs image-rwfs
- if [ "${IMAGE_TYPE}" = "pfr" ]; then
- ln -sf ${S}/publickey publickey
- make_signatures image-u-boot image-kernel image-rofs image-rwfs image-runtime MANIFEST publickey
- # tar up the update package
- tar -h -cvf "${DEPLOY_DIR_IMAGE}/${PN}-image-update-${MACHINE}-${DATETIME}.tar" image-u-boot image-runtime image-kernel image-rofs image-rwfs MANIFEST publickey ${signature_files}
- else
- tar -h -cvf "${DEPLOY_DIR_IMAGE}/${PN}-image-update-${MACHINE}-${DATETIME}.tar" MANIFEST image-u-boot image-runtime image-kernel image-rofs image-rwfs
- fi
+ tar -h -cvf "${DEPLOY_DIR_IMAGE}/${PN}-image-update-${MACHINE}-${DATETIME}.tar" MANIFEST image-u-boot image-runtime image-kernel image-rofs image-rwfs
# make a symlink
ln -sf "${PN}-image-update-${MACHINE}-${DATETIME}.tar" "${DEPLOY_DIR_IMAGE}/image-update-${MACHINE}"
ln -sf "image-update-${MACHINE}" "${DEPLOY_DIR_IMAGE}/image-update"
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 4ad3b2b92..a495b76fa 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
@@ -1,7 +1,6 @@
inherit obmc-phosphor-image
IMAGE_INSTALL_append = " \
- fan-default-speed \
bmcweb \
dbus-broker \
dtc \
@@ -19,7 +18,6 @@ IMAGE_INSTALL_append = " \
smbios-mdrv1 \
phosphor-certificate-manager \
phosphor-sel-logger \
- gpiodaemon \
smbios-mdrv2 \
obmc-ikvm \
system-watchdog \
@@ -31,8 +29,10 @@ IMAGE_INSTALL_append = " \
mtd-utils-ubifs \
special-mode-mgr \
rsyslog \
- rsyslog-policy \
static-mac-addr \
+ phosphor-u-boot-mgr \
+ prov-mode-mgr \
+ ac-boot-check \
"
# this package was flagged as a security risk
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0002-intel-layout-environment-addr.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0002-intel-layout-environment-addr.patch
index 86fa5b7d5..8937047c5 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0002-intel-layout-environment-addr.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0002-intel-layout-environment-addr.patch
@@ -1,28 +1,16 @@
-Index: u-boot/include/configs/ast-common.h
-===================================================================
---- u-boot.orig/include/configs/ast-common.h
-+++ u-boot/include/configs/ast-common.h
-@@ -103,10 +103,13 @@
- #define CONFIG_SYS_MAX_FLASH_BANKS (CONFIG_FMC_CS)
- #define CONFIG_SYS_MAX_FLASH_SECT (8192) /* max number of sectors on one chip */
- #define CONFIG_ENV_IS_IN_FLASH 1
--#define CONFIG_ENV_ADDR (AST_FMC_CS0_BASE + 0x60000)
-+#define CONFIG_ENV_OFFSET 0x2400000 /* environment starts here */
-+#define CONFIG_ENV_ADDR (AST_FMC_CS0_BASE + CONFIG_ENV_OFFSET)
-+#define CONFIG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
-
--#define CONFIG_ENV_OFFSET 0x60000 /* environment starts here */
--#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */
-+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-+#define CONFIG_ENV_ADDR_REDUND (AST_FMC_CS0_BASE + CONFIG_ENV_OFFSET_REDUND)
-+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
-
- #define CONFIG_BOOTCOMMAND "bootm 20080000"
- #define CONFIG_ENV_OVERWRITE
-Index: u-boot/common/board_r.c
-===================================================================
---- u-boot.orig/common/board_r.c
-+++ u-boot/common/board_r.c
+From 7979a73fba832747ed3c037c0b47c9e67dcf283e Mon Sep 17 00:00:00 2001
+From: Vernon Mauery <vernon.mauery@intel.com>
+Date: Mon, 30 Apr 2018 10:52:37 -0700
+
+---
+ common/board_r.c | 8 ++++++--
+ include/configs/ast-common.h | 9 ++++++---
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/common/board_r.c b/common/board_r.c
+index d959ad3..74797ed 100644
+--- a/common/board_r.c
++++ b/common/board_r.c
@@ -494,10 +494,14 @@ static int should_load_env(void)
static int initr_env(void)
{
@@ -40,3 +28,24 @@ Index: u-boot/common/board_r.c
#ifdef CONFIG_OF_CONTROL
setenv_addr("fdtcontroladdr", gd->fdt_blob);
#endif
+diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
+index eff6d2b..b7d7192 100644
+--- a/include/configs/ast-common.h
++++ b/include/configs/ast-common.h
+@@ -103,10 +103,13 @@
+ #define CONFIG_SYS_MAX_FLASH_BANKS (CONFIG_FMC_CS)
+ #define CONFIG_SYS_MAX_FLASH_SECT (8192) /* max number of sectors on one chip */
+ #define CONFIG_ENV_IS_IN_FLASH 1
+-#define CONFIG_ENV_ADDR (AST_FMC_CS0_BASE + 0x60000)
++#define CONFIG_ENV_OFFSET 0x2400000 /* environment starts here */
++#define CONFIG_ENV_ADDR (AST_FMC_CS0_BASE + CONFIG_ENV_OFFSET)
++#define CONFIG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
+
+-#define CONFIG_ENV_OFFSET 0x60000 /* environment starts here */
+-#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */
++#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
++#define CONFIG_ENV_ADDR_REDUND (AST_FMC_CS0_BASE + CONFIG_ENV_OFFSET_REDUND)
++#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+
+ #define CONFIG_BOOTCOMMAND "bootm 20080000"
+ #define CONFIG_ENV_OVERWRITE
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch
index 8bc0a3ed3..e7e6c56d7 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0004-Make-sure-debug-uart-is-using-24MHz-clock-source.patch
@@ -1,4 +1,4 @@
-From 2f0e14630abec2c9679d21901072648c7802f2c4 Mon Sep 17 00:00:00 2001
+From 954e7dd9ff9c5d1159f0896afa34c673061b82ea 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
@@ -7,6 +7,7 @@ u-boot defines the uart5(debug console) as 24MHz,
set the SCU14[28] to 0, to make sure the clock source is 24M
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
+
---
arch/arm/include/asm/arch-aspeed/ast_scu.h | 2 ++
arch/arm/include/asm/arch-aspeed/platform.h | 1 +
@@ -15,10 +16,10 @@ 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 d248416..98e6335 100644
+index dcbc673..06825ce 100644
--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
+++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
-@@ -45,4 +45,6 @@ extern void ast_scu_init_eth(u8 num);
+@@ -46,4 +46,6 @@ extern void ast_scu_init_eth(u8 num);
extern void ast_scu_multi_func_eth(u8 num);
extern void ast_scu_multi_func_romcs(u8 num);
@@ -26,7 +27,7 @@ index d248416..98e6335 100644
+
#endif
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
-index c9c7a81..a423052 100644
+index 1c02914..92ea33b 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -27,6 +27,7 @@
@@ -38,10 +39,10 @@ index c9c7a81..a423052 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 0cc0d67..902263b 100644
+index 12de9b8..fff02dc 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
-@@ -496,3 +496,9 @@ void ast_scu_get_who_init_dram(void)
+@@ -538,3 +538,9 @@ void ast_scu_get_who_init_dram(void)
break;
}
}
@@ -70,6 +71,3 @@ index e67a4bf..5a1fade 100644
int board_init(void)
{
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch
index 0385a5e31..6bd063e39 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0005-enable-passthrough-in-uboot.patch
@@ -1,7 +1,7 @@
-From b344cf4462acb1f043ed903ccee713e24ce7226d Mon Sep 17 00:00:00 2001
+From 7e11461d6b65969005605f13677269eb91d39643 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 1/1] enable passthrough in uboot
+Subject: [PATCH] enable passthrough in uboot
---
arch/arm/mach-aspeed/ast-scu.c | 22 ++++++++++++++++++++++
@@ -9,10 +9,10 @@ Subject: [PATCH 1/1] 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 902263b28b..c83931ed54 100644
+index fff02dc..d27f3d3 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
-@@ -502,3 +502,25 @@ void ast_config_uart5_clk(void)
+@@ -544,3 +544,25 @@ void ast_config_uart5_clk(void)
ast_scu_write(ast_scu_read(AST_SCU_MISC2_CTRL) &
~(1 << 28), AST_SCU_MISC2_CTRL);
}
@@ -39,7 +39,7 @@ index 902263b28b..c83931ed54 100644
+ }
+}
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 5a1fadeedd..b492003f51 100644
+index 5a1fade..b492003 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)
@@ -51,6 +51,3 @@ index 5a1fadeedd..b492003f51 100644
return 0;
}
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch
index dbaf7b362..4f90d6dfe 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0006-Add-Aspeed-g5-interrupt-support.patch
@@ -1,7 +1,7 @@
-From f33755167ddcdebbf56bc875e4091990273c6997 Mon Sep 17 00:00:00 2001
+From e782f6a90468fee35877b78e248a17f39f67c94c 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/7] Add Aspeed g5 interrupt support
+Subject: [PATCH] Add Aspeed g5 interrupt support
This adds a few new files to the board g5 directory. Several Intel
features require interrupts running in U-Boot, so this adds basic
@@ -9,25 +9,26 @@ interrupt registration and handling support.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: Id7072f1408dcf364968b1b74f2192e50a22a82f0
+
---
- Kconfig | 13 ++
- arch/arm/lib/interrupts.c | 11 ++
- board/aspeed/ast-g5/Makefile | 4 +-
- board/aspeed/ast-g5/ast-g5-irq.c | 176 ++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5-irq.h | 39 ++++++
+ 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.c | 3 +
board/aspeed/ast-g5/ast-g5.h | 7 ++
cmd/Kconfig | 5 +
configs/ast_g5_ncsi_2boot_defconfig | 1 +
configs/ast_g5_ncsi_defconfig | 1 +
configs/ast_g5_phy_defconfig | 1 +
- 11 files changed, 260 insertions(+), 1 deletion(-)
+ 11 files changed, 259 insertions(+), 1 deletion(-)
create mode 100644 board/aspeed/ast-g5/ast-g5-irq.c
create mode 100644 board/aspeed/ast-g5/ast-g5-irq.h
create mode 100644 board/aspeed/ast-g5/ast-g5.h
diff --git a/Kconfig b/Kconfig
-index 3ceff25032..d6439d01ca 100644
+index 3ceff25..d6439d0 100644
--- a/Kconfig
+++ b/Kconfig
@@ -115,6 +115,19 @@ if EXPERT
@@ -51,7 +52,7 @@ index 3ceff25032..d6439d01ca 100644
menu "Boot images"
diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c
-index ed83043abb..a96b3aa070 100644
+index ed83043..a96b3aa 100644
--- a/arch/arm/lib/interrupts.c
+++ b/arch/arm/lib/interrupts.c
@@ -94,6 +94,17 @@ int disable_interrupts (void)
@@ -73,7 +74,7 @@ index ed83043abb..a96b3aa070 100644
int interrupt_init (void)
{
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index d1d7f8525e..d41b11589f 100644
+index d1d7f85..df4e639 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -1 +1,2 @@
@@ -82,7 +83,7 @@ index d1d7f8525e..d41b11589f 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 0000000000..860f16cf05
+index 0000000..860f16c
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-irq.c
@@ -0,0 +1,176 @@
@@ -264,7 +265,7 @@ index 0000000000..860f16cf05
+#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 0000000000..703eeabf13
+index 0000000..703eeab
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-irq.h
@@ -0,0 +1,39 @@
@@ -308,7 +309,7 @@ index 0000000000..703eeabf13
+
+#endif /* __AST_G5_IRQ_H__ */
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index b492003f51..2472aa3603 100644
+index b492003..2472aa3 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
@@ -14,6 +14,8 @@
@@ -330,7 +331,7 @@ index b492003f51..2472aa3603 100644
}
diff --git a/board/aspeed/ast-g5/ast-g5.h b/board/aspeed/ast-g5/ast-g5.h
new file mode 100644
-index 0000000000..9fd10eccb3
+index 0000000..9fd10ec
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5.h
@@ -0,0 +1,7 @@
@@ -342,7 +343,7 @@ index 0000000000..9fd10eccb3
+
+#endif /* _AST_G5_H_ */
diff --git a/cmd/Kconfig b/cmd/Kconfig
-index d69b817c82..33be2407d2 100644
+index d69b817..33be240 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -313,6 +313,11 @@ endmenu
@@ -358,7 +359,7 @@ index d69b817c82..33be2407d2 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 2d28c86966..d5b7894a9e 100644
+index 2d28c86..d5b7894 100644
--- a/configs/ast_g5_ncsi_2boot_defconfig
+++ b/configs/ast_g5_ncsi_2boot_defconfig
@@ -33,3 +33,4 @@ CONFIG_CMD_CRC32=y
@@ -367,7 +368,7 @@ index 2d28c86966..d5b7894a9e 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 74029ed514..9481e5fb6e 100644
+index 74029ed..9481e5f 100644
--- a/configs/ast_g5_ncsi_defconfig
+++ b/configs/ast_g5_ncsi_defconfig
@@ -11,3 +11,4 @@ CONFIG_HUSH_PARSER=y
@@ -376,7 +377,7 @@ index 74029ed514..9481e5fb6e 100644
CONFIG_SYS_NS16550=y
+CONFIG_USE_IRQ=y
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
-index 767f3af605..4aefcf49e8 100644
+index 767f3af..4aefcf4 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
@@ -12,3 +12,4 @@ CONFIG_HUSH_PARSER=y
@@ -384,6 +385,3 @@ index 767f3af605..4aefcf49e8 100644
CONFIG_SPI_FLASH=y
CONFIG_SYS_NS16550=y
+CONFIG_USE_IRQ=y
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0007-Add-espi-support.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0007-Add-espi-support.patch
index 18cc2f9c8..b37aee7e6 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0007-Add-espi-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0007-Add-espi-support.patch
@@ -1,7 +1,7 @@
-From 7ad0ea13337550f35c1e726f21d4751bf74078d6 Mon Sep 17 00:00:00 2001
+From c46cb2dd703f55ca63ed9c5cf2a97868a7e6c209 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 2/7] 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,18 +13,19 @@ functions.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: Id7072f1408dcf364968b1b74f2192e50a22a82f0
+
---
arch/arm/include/asm/arch-aspeed/regs-scu.h | 2 +
- board/aspeed/ast-g5/Makefile | 1 +
- board/aspeed/ast-g5/ast-g5-espi.c | 231 ++++++++++++++++++++
+ board/aspeed/ast-g5/Makefile | 2 +
+ board/aspeed/ast-g5/ast-g5-espi.c | 231 ++++++++++++++++++++++++++++
board/aspeed/ast-g5/ast-g5-intel.c | 16 ++
board/aspeed/ast-g5/ast-g5.c | 3 +
- 5 files changed, 253 insertions(+)
+ 5 files changed, 254 insertions(+)
create mode 100644 board/aspeed/ast-g5/ast-g5-espi.c
create mode 100644 board/aspeed/ast-g5/ast-g5-intel.c
diff --git a/arch/arm/include/asm/arch-aspeed/regs-scu.h b/arch/arm/include/asm/arch-aspeed/regs-scu.h
-index b714fa9234..10b983a966 100644
+index b714fa9..10b983a 100644
--- a/arch/arm/include/asm/arch-aspeed/regs-scu.h
+++ b/arch/arm/include/asm/arch-aspeed/regs-scu.h
@@ -552,6 +552,8 @@
@@ -37,7 +38,7 @@ index b714fa9234..10b983a966 100644
#define SCU_HW_STRAP_SUPER_IO_CONFIG (0x1 << 16)
#define SCU_HW_STRAP_VGA_CLASS_CODE (0x1 << 15)
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index d41b11589f..58e0c648f4 100644
+index df4e639..58e0c64 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -1,2 +1,4 @@
@@ -47,7 +48,7 @@ index d41b11589f..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..79ef253b86
+index 0000000..79ef253
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-espi.c
@@ -0,0 +1,231 @@
@@ -284,7 +285,7 @@ index 0000000000..79ef253b86
+}
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
new file mode 100644
-index 0000000000..e79235c8d0
+index 0000000..e79235c
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -0,0 +1,16 @@
@@ -305,7 +306,7 @@ index 0000000000..e79235c8d0
+ espi_init();
+}
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 2472aa3603..d41ef9cbd3 100644
+index 2472aa3..d41ef9c 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
@@ -18,6 +18,8 @@
@@ -325,6 +326,3 @@ index 2472aa3603..d41ef9cbd3 100644
return 0;
}
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch
index e16b0f158..5fa4bffa1 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0008-add-sgio-support-for-port80-snoop-post-LEDs.patch
@@ -1,4 +1,4 @@
-From c3b44c02392d33cfec85056fd323d93fdc6e523f Mon Sep 17 00:00:00 2001
+From 40e02e4ffa13c0128db555a3a3982a7cdc0ebf60 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
@@ -8,6 +8,7 @@ ultimately drives the POST code LEDs.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: Iaa1b91cd40f4b6323dba0598da373cb631459e66
+
---
arch/arm/include/asm/arch-aspeed/ast_scu.h | 1 +
arch/arm/mach-aspeed/ast-scu.c | 8 +++
@@ -155,6 +156,3 @@ index e79235c..c2a8b33 100644
espi_init();
+ sgpio_init();
}
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch
index a49f196ac..f7dd80504 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0009-Add-basic-GPIO-support.patch
@@ -1,7 +1,7 @@
-From 89728d8c255204c8d9ec46a1dc0d412b04708f22 Mon Sep 17 00:00:00 2001
+From 0fbd5fe6fa08f709b64bdbad6440ea77b422fc4b 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 4/7] 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.
@@ -10,18 +10,19 @@ 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>
+
---
board/aspeed/ast-g5/Makefile | 1 +
- board/aspeed/ast-g5/ast-g5-gpio.c | 195 +++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5-gpio.h | 102 +++++++++++++++
- board/aspeed/ast-g5/ast-g5-intel.c | 42 +++++++
+ board/aspeed/ast-g5/ast-g5-gpio.c | 195 +++++++++++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-gpio.h | 102 +++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-intel.c | 42 ++++++++
board/aspeed/ast-g5/ast-g5.h | 1 +
5 files changed, 341 insertions(+)
create mode 100644 board/aspeed/ast-g5/ast-g5-gpio.c
create mode 100644 board/aspeed/ast-g5/ast-g5-gpio.h
diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
-index 58e0c648f4..2970ae5741 100644
+index 58e0c64..2970ae5 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -2,3 +2,4 @@ obj-y += ast-g5.o
@@ -31,7 +32,7 @@ index 58e0c648f4..2970ae5741 100644
+obj-y += ast-g5-gpio.o
diff --git a/board/aspeed/ast-g5/ast-g5-gpio.c b/board/aspeed/ast-g5/ast-g5-gpio.c
new file mode 100644
-index 0000000000..d596c15914
+index 0000000..d596c15
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-gpio.c
@@ -0,0 +1,195 @@
@@ -232,7 +233,7 @@ index 0000000000..d596c15914
+ "");
diff --git a/board/aspeed/ast-g5/ast-g5-gpio.h b/board/aspeed/ast-g5/ast-g5-gpio.h
new file mode 100644
-index 0000000000..a820c0fcad
+index 0000000..a820c0f
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-gpio.h
@@ -0,0 +1,102 @@
@@ -339,7 +340,7 @@ index 0000000000..a820c0fcad
+
+#endif /* __HW_GPIO_H__ */
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index fca4d91115..252a05dd73 100644
+index c2a8b33..069e7a3 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -14,6 +14,47 @@
@@ -399,7 +400,7 @@ index fca4d91115..252a05dd73 100644
sgpio_init();
}
diff --git a/board/aspeed/ast-g5/ast-g5.h b/board/aspeed/ast-g5/ast-g5.h
-index 9fd10eccb3..908db1477b 100644
+index 9fd10ec..908db14 100644
--- a/board/aspeed/ast-g5/ast-g5.h
+++ b/board/aspeed/ast-g5/ast-g5.h
@@ -3,5 +3,6 @@
@@ -409,6 +410,3 @@ index 9fd10eccb3..908db1477b 100644
+#include "ast-g5-gpio.h"
#endif /* _AST_G5_H_ */
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
index c97e6d74f..c6ee49f57 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
@@ -1,4 +1,4 @@
-From 1f710737f2fe8dea4bc5ebef1e6011de294764b4 Mon Sep 17 00:00:00 2001
+From d08d22af794eed7b928ab96030a103cfb7bf6ce1 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
@@ -8,17 +8,18 @@ functions, such as autoboot.
Change-Id: I8ead931e9dd828522095a0ef386875be652ec885
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
+
---
- .../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 ++++++
+ 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 ++++++
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 0000000000..cd9a0994fa
+index 0000000..cd9a099
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
@@ -0,0 +1,19 @@
@@ -42,7 +43,7 @@ index 0000000000..cd9a0994fa
+
+#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 9f339e913a..3ea1c99089 100644
+index 92ea33b..3b06e52 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -27,6 +27,7 @@
@@ -54,7 +55,7 @@ index 9f339e913a..3ea1c99089 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 252a05dd73..58ad6a55b8 100644
+index 069e7a3..144765a 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)
@@ -70,7 +71,7 @@ index 252a05dd73..58ad6a55b8 100644
void ast_g5_intel(void)
{
diff --git a/common/autoboot.c b/common/autoboot.c
-index c52bad84a4..d66c0fa63a 100644
+index c52bad8..d66c0fa 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -14,6 +14,7 @@
@@ -93,6 +94,3 @@ index c52bad84a4..d66c0fa63a 100644
if (bootdelay >= 0)
abort = __abortboot(bootdelay);
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch
index 11a474b96..26b4c4fc9 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0011-Add-basic-timer-support-for-Aspeed-g5-in-U-Boot.patch
@@ -1,25 +1,26 @@
-From 83d67b5b3cbffcefda5efdc0060b9e30f44c9aca Mon Sep 17 00:00:00 2001
+From 320cf189fd017e3578b6949ff640213d7bddb20c 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 6/7] Add basic timer support for Aspeed g5 in U-Boot
+Subject: [PATCH] Add basic timer support for Aspeed g5 in U-Boot
Timers will be used for timing events and making blinky LEDs. This just
adds the API and infrastructure.
Change-Id: I8ff03b26070b43a47fb970ddf6124d6c3f29b058
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 2970ae5741..90224333c4 100644
+index 2970ae5..9022433 100644
--- a/board/aspeed/ast-g5/Makefile
+++ b/board/aspeed/ast-g5/Makefile
@@ -3,3 +3,4 @@ obj-y += ast-g5-intel.o
@@ -28,7 +29,7 @@ index 2970ae5741..90224333c4 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 58ad6a55b8..23bf4e4352 100644
+index 144765a..6e45cb4 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -15,6 +15,7 @@
@@ -41,7 +42,7 @@ index 58ad6a55b8..23bf4e4352 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 0000000000..56157222d9
+index 0000000..5615722
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-timer.c
@@ -0,0 +1,66 @@
@@ -113,7 +114,7 @@ index 0000000000..56157222d9
+}
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 0000000000..4b1ac28a9f
+index 0000000..4b1ac28
--- /dev/null
+++ b/board/aspeed/ast-g5/ast-g5-timer.h
@@ -0,0 +1,27 @@
@@ -145,7 +146,7 @@ index 0000000000..4b1ac28a9f
+
+#endif /* __AST_G5_TIMER_H__ */
diff --git a/board/aspeed/ast-g5/ast-g5.h b/board/aspeed/ast-g5/ast-g5.h
-index 908db1477b..28fe5eafcb 100644
+index 908db14..28fe5ea 100644
--- a/board/aspeed/ast-g5/ast-g5.h
+++ b/board/aspeed/ast-g5/ast-g5.h
@@ -4,5 +4,6 @@
@@ -155,6 +156,3 @@ index 908db1477b..28fe5eafcb 100644
+#include "ast-g5-timer.h"
#endif /* _AST_G5_H_ */
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch
index 5a2c2206f..16eb31250 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0012-Add-status-and-ID-LED-support.patch
@@ -1,7 +1,7 @@
-From f0e3631ea3005640f988727f051106d83b5dfdaf Mon Sep 17 00:00:00 2001
+From bc6ea87d8213ecdc5ab7cced8b2fc4284fdef019 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 7/7] Add status and ID LED support
+Subject: [PATCH] Add status and ID LED support
Add status (amber and green) and ID (blue) LED support. In the
bootloader phase, the LEDs should be blinking. When booting linux, they
@@ -9,12 +9,13 @@ should turn to a fixed state.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: Ic9595621b21000ef465ff57ed2047855296e2714
+
---
- board/aspeed/ast-g5/ast-g5-intel.c | 118 +++++++++++++++++++++++++++++
- 1 file changed, 118 insertions(+)
+ board/aspeed/ast-g5/ast-g5-intel.c | 110 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 110 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 23bf4e4352..5ff2cbd0e2 100644
+index 6e45cb4..e53f5eb 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -146,6 +146,110 @@ static void sgpio_init(void)
@@ -128,7 +129,7 @@ index 23bf4e4352..5ff2cbd0e2 100644
int intel_force_firmware_jumper_enabled(void)
{
return gpio_get_value(GPIO_FF_UPD_JUMPER);
-@@ -157,4 +269,10 @@ void ast_g5_intel(void)
+@@ -157,4 +261,10 @@ void ast_g5_intel(void)
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
espi_init();
sgpio_init();
@@ -139,6 +140,3 @@ index 23bf4e4352..5ff2cbd0e2 100644
+ id_led_control(GPIO_GREEN_LED, EIDLED_On);
+ }
}
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch
index d235aea62..10a45fa23 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0013-aspeed-Add-Pwm-Driver.patch
@@ -1,18 +1,19 @@
-From 3134584998f624bb6c4ee11102b0bd9b7bb1cbba Mon Sep 17 00:00:00 2001
+From 34ccbd14d8f5caa66523a762e2030b6f105206cb 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
+
---
- board/aspeed/ast-g5/ast-g5-intel.c | 105 +++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-intel.c | 105 +++++++++++++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 5ff2cbd0e2..f810ded4e7 100644
+index e53f5eb..c7ae566 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -263,9 +263,114 @@ int intel_force_firmware_jumper_enabled(void)
+@@ -255,9 +255,114 @@ int intel_force_firmware_jumper_enabled(void)
return gpio_get_value(GPIO_FF_UPD_JUMPER);
}
@@ -127,6 +128,3 @@ index 5ff2cbd0e2..f810ded4e7 100644
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
espi_init();
sgpio_init();
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch
index 91665e064..22191f07a 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0014-Keep-interrupts-enabled-until-last-second.patch
@@ -1,7 +1,7 @@
-From 2078771e0ff84be710250b2e9b2e887f7238f9cc Mon Sep 17 00:00:00 2001
+From 040c9c13778076403198ce93f43c4aa3a1ed3907 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 2/3] Keep interrupts enabled until last second
+Subject: [PATCH] Keep interrupts enabled until last second
The U-Boot bootm command disabled interrupts almost first thing. This
would prevent a person hitting the power button on the host immediatly
@@ -10,6 +10,7 @@ and the host would power off.
Change-Id: I6c0fb5cca1be6c326da4c9a3d3dfbab89dac9928
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
+
---
board/aspeed/ast-g5/ast-g5-intel.c | 8 ++++++++
common/bootm.c | 7 -------
@@ -17,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 f810ded4e7..4d399be392 100644
+index c7ae566..01f8a13 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -263,6 +263,14 @@ int intel_force_firmware_jumper_enabled(void)
+@@ -255,6 +255,14 @@ int intel_force_firmware_jumper_enabled(void)
return gpio_get_value(GPIO_FF_UPD_JUMPER);
}
@@ -36,7 +37,7 @@ index f810ded4e7..4d399be392 100644
#define PWM_BASE_ADDR 0x1E786000
diff --git a/common/bootm.c b/common/bootm.c
-index 2431019b3f..46909ecdbb 100644
+index 2431019..46909ec 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[],
@@ -75,7 +76,7 @@ index 2431019b3f..46909ecdbb 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 9ec84bd0db..b56eb39780 100644
+index 9ec84bd..b56eb39 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -476,6 +476,7 @@ __weak void arch_preboot_os(void)
@@ -86,6 +87,3 @@ index 9ec84bd0db..b56eb39780 100644
arch_preboot_os();
boot_fn(state, argc, argv, images);
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch
index 475b8c3ff..d93d9c4a1 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0015-Rewrite-memmove-to-optimize-on-word-transfers.patch
@@ -1,4 +1,4 @@
-From a71794fc928429e199c5ea48181e5edfbb0c4f39 Mon Sep 17 00:00:00 2001
+From 711c7bc5a07b62e8369bc76a9db265c960bacef8 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
@@ -10,12 +10,13 @@ trailer, where the body is all done with word-sized transfers.
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 67d5f6a421..0bf472f1f6 100644
+index 67d5f6a..0bf472f 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -505,26 +505,77 @@ void * memcpy(void *dest, const void *src, size_t count)
@@ -109,6 +110,3 @@ index 67d5f6a421..0bf472f1f6 100644
return dest;
}
#endif
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch
index 1d2b02954..8a63edbb7 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0019-u-boot-full-platform-reset-espi-oob-ready.patch
@@ -1,4 +1,4 @@
-From bb490aa226dcf261d3d6865be37130765ecbe9f4 Mon Sep 17 00:00:00 2001
+From 9b05a276af65dd436f30b1b2680a09821c5a81aa 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
@@ -8,12 +8,13 @@ reset and then immediately set oob-ready so the espi master controller
can initiate communication.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
+
---
arch/arm/mach-aspeed/platform_g5.S | 13 ++++++++++++-
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 2ac1ca4721..66427b6f33 100644
+index 2ac1ca4..66427b6 100644
--- a/arch/arm/mach-aspeed/platform_g5.S
+++ b/arch/arm/mach-aspeed/platform_g5.S
@@ -139,7 +139,7 @@
@@ -43,6 +44,3 @@ index 2ac1ca4721..66427b6f33 100644
/* Enable Timer separate clear mode */
ldr r0, =0x1e782038
mov r1, #0xAE
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch
index 2e541561a..afdd610b3 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Add-system-reset-status-support.patch
@@ -1,4 +1,4 @@
-From 06445210bfda7f9bbbb36133e6818575bd6a0cc1 Mon Sep 17 00:00:00 2001
+From 54616ade08517374200a332e50f68ee9d0fbf5c5 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
@@ -7,13 +7,16 @@ Will display the reset reasons and other CPU information in u-boot,
and save the reset reasons into kernel command line,
for applications to query.
+Change-Id: I87ada3ecf14368519e4d09035bb1e09fdc05469b
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
+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 | 30 +++++++++++++++++++++++++++++
- board/aspeed/ast-g5/ast-g5.c | 7 +++++++
- 4 files changed, 43 insertions(+)
+ 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 +++
+ 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
@@ -51,41 +54,84 @@ 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 bcaf81e..1e8708a 100644
+index 01f8a13..e0bf9ee 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -303,6 +303,36 @@ static inline void ast_scu_write(uint32_t val, uint32_t reg)
+@@ -303,6 +303,79 @@ static inline void ast_scu_write(uint32_t val, uint32_t reg)
#endif
}
-+void ast_g5_intel_late_init(void)
++
++static void update_bootargs_cmd(const char *key, const char *value)
+{
-+ char *cmdline = NULL;
-+ char *cmdline_new = NULL;
-+ char buf[32];
-+ u32 rest = 0;
++ int buf_len;
++ char *buf;
++ char *cmdline;
++ char comp_key[128];
+
-+ /* save and clear reset status */
-+ rest = ast_scu_read(AST_SCU_SYS_CTRL);
-+ snprintf(buf, sizeof(buf), " resetreason=0x%x", rest);
-+ ast_scu_write(0, AST_SCU_SYS_CTRL);
++ if (!key || (key[0] == '\0')) {
++ printf("%s - Empty key not allowed\n", __func__);
++ return;
++ }
+
+ cmdline = getenv("bootargs");
-+ if (!cmdline) {
-+ printf("Get bootargs fail!\n");
++
++ /* Allocate space for maximum possible new command line */
++ if (value)
++ buf_len = strlen(cmdline) + strlen(key) + 3 + strlen(value);
++ else
++ buf_len = strlen(cmdline) + strlen(key) + 3;
++
++ buf = malloc(buf_len);
++ if (!buf) {
++ printf("%s: out of memory\n", __func__);
+ return;
+ }
++ memset(buf, 0, buf_len);
+
-+ cmdline_new = malloc(strlen(cmdline) + strlen(buf) + 1);
-+ if (!cmdline_new) {
-+ printf("Cannot malloc memory!\n");
++ if (!cmdline) {
++ /* lets add key-value, though bootargs are empty */
++ snprintf(buf, buf_len, "%s=%s", key, (value ? value : ""));
++ setenv("bootargs", buf);
++ free(buf);
+ return;
+ }
+
-+ /* append the reset status into kernel command line */
-+ snprintf(cmdline_new, strlen(cmdline) + strlen(buf) + 1, "%s%s", cmdline, buf);
-+ setenv("bootargs", cmdline_new);
-+ free(cmdline_new);
++ snprintf(comp_key, sizeof(comp_key), "%s=", key);
++ char *start = strstr(cmdline, comp_key);
++
++ /* Check for full word match. Match should be start of cmdline
++ * or there should be space before match */
++ if (start && ((start == cmdline) || (*(start-1) == ' '))) {
++ char *end = strchr(start, ' ');
++ strncpy(buf, cmdline, (start - cmdline));
++
++ if (end)
++ snprintf(buf, buf_len, "%s%s=%s %s", buf, key,
++ (value ? value : ""), end+1);
++ else
++ snprintf(buf, buf_len, "%s%s=%s", buf, key,
++ (value ? value : ""));
++ } else {
++ snprintf(buf, buf_len, "%s %s=%s", cmdline, key,
++ (value ? value : ""));
++ }
++
++ setenv("bootargs", buf);
++ free(buf);
++}
++
++void ast_g5_intel_late_init(void)
++{
++ char value[32];
++ u32 reset_reason = 0;
++
++ /* save and clear reset status */
++ reset_reason = ast_scu_read(AST_SCU_SYS_CTRL);
++ snprintf(value, sizeof(value), "0x%x", reset_reason);
++ ast_scu_write(0, AST_SCU_SYS_CTRL);
++
++ update_bootargs_cmd("resetreason", value);
+}
+
static void pwm_init(void)
@@ -116,6 +162,3 @@ index d41ef9c..0953677 100644
int dram_init(void)
{
u32 vga = ast_scu_get_vga_memsize();
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch
index bdf3d2ddd..6949856db 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0020-Enable-PCIe-L1-support.patch
@@ -1,4 +1,4 @@
-From 22c61ba094d8ebdbdcb44f848eef1f5d87a4be87 Mon Sep 17 00:00:00 2001
+From 647cc2538ed6b64054c742b4668386fda9394221 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
@@ -6,12 +6,13 @@ Subject: [PATCH] Enable PCIe L1 support
This commit enables PCIe L1 support using magic registers.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+
---
arch/arm/mach-aspeed/platform_g5.S | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/mach-aspeed/platform_g5.S b/arch/arm/mach-aspeed/platform_g5.S
-index 66427b6f33e7..b4043534b083 100644
+index 66427b6..b404353 100644
--- a/arch/arm/mach-aspeed/platform_g5.S
+++ b/arch/arm/mach-aspeed/platform_g5.S
@@ -2432,6 +2432,18 @@ spi_cbr_end:
@@ -33,6 +34,3 @@ index 66427b6f33e7..b4043534b083 100644
/******************************************************************************
Configure MAC timing
******************************************************************************/
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch
index 310d9359b..32a40261f 100755
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0021-Config-host-uart-clock-source-using-environment-vari.patch
@@ -1,4 +1,4 @@
-From c82ba33ea40e0007945cbc93da58f296fdeedeaf Mon Sep 17 00:00:00 2001
+From 30c634b4969b8a3cd3afc079d60d23d2cb9f5f5c 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
@@ -25,6 +25,7 @@ ipmitool raw 0x32 0x90 1 3; reboot
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 +++++++++++++++++++++++++++++
@@ -47,7 +48,7 @@ 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 1e8708a..f810a40 100644
+index e0bf9ee..e19df03 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[] = {
@@ -60,9 +61,9 @@ index 1e8708a..f810a40 100644
static void sgpio_init(void)
{
uint32_t value;
-@@ -310,6 +313,42 @@ void ast_g5_intel_late_init(void)
- char buf[32];
- u32 rest = 0;
+@@ -368,6 +371,42 @@ void ast_g5_intel_late_init(void)
+ char value[32];
+ u32 reset_reason = 0;
+ /* By default host serail A and B use normal speed */
+ uint32_t host_serial_cfg = 0;
@@ -101,8 +102,5 @@ index 1e8708a..f810a40 100644
+ }
+
/* save and clear reset status */
- rest = ast_scu_read(AST_SCU_SYS_CTRL);
- snprintf(buf, sizeof(buf), " resetreason=0x%x", rest);
---
-2.7.4
-
+ reset_reason = ast_scu_read(AST_SCU_SYS_CTRL);
+ snprintf(value, sizeof(value), "0x%x", reset_reason);
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch
index c79b2f2dc..63eebe56b 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-KCS-driver-support-in-uBoot.patch
@@ -1,4 +1,4 @@
-From b11377c73c85bdee1975402084c3760b70cc99c4 Mon Sep 17 00:00:00 2001
+From 1264c57a485a238b715c489b7ca14982af396442 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] KCS driver support in uBoot
@@ -25,6 +25,7 @@ via KCS interfaces using cmdtool.efi.
Res: C1 (Invalid).
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
+
---
board/aspeed/ast-g5/Makefile | 1 +
board/aspeed/ast-g5/ast-g5-intel.c | 3 +
@@ -44,10 +45,10 @@ index 9022433..05972b9 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 409b1a7..41d41ea 100644
+index e19df03..adc6d10 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -437,6 +437,7 @@ static void pwm_init(void)
+@@ -480,6 +480,7 @@ static void pwm_init(void)
}
extern void espi_init(void);
@@ -55,7 +56,7 @@ index 409b1a7..41d41ea 100644
void ast_g5_intel(void)
{
pwm_init();
-@@ -446,6 +447,8 @@ void ast_g5_intel(void)
+@@ -489,6 +490,8 @@ void ast_g5_intel(void)
timer8_init();
if (intel_force_firmware_jumper_enabled()) {
id_led_control(GPIO_AMBER_LED, EIDLED_On);
@@ -608,6 +609,3 @@ index 0000000..bb697c4
+ u16 data_out_idx;
+ u8 data_out[MAX_KCS_PKT_SIZE];
+};
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch
index 746063a56..afba07abf 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0022-u-boot-env-change-for-PFR-image.patch
@@ -1,18 +1,20 @@
-From 6651a2663ee3e9f02c6ed8377097456528a2ee1a Mon Sep 17 00:00:00 2001
+From 4cbfb21b7792e6dae74e2db6e2e2d6803bf6cc1d 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
+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 b7d7192..dd89d91 100644
+index 0bc7f2d..821ea8f 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
-@@ -103,7 +103,7 @@
+@@ -108,7 +108,7 @@
#define CONFIG_SYS_MAX_FLASH_BANKS (CONFIG_FMC_CS)
#define CONFIG_SYS_MAX_FLASH_SECT (8192) /* max number of sectors on one chip */
#define CONFIG_ENV_IS_IN_FLASH 1
@@ -21,12 +23,12 @@ index b7d7192..dd89d91 100644
#define CONFIG_ENV_ADDR (AST_FMC_CS0_BASE + CONFIG_ENV_OFFSET)
#define CONFIG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
-@@ -111,7 +111,7 @@
+@@ -116,7 +116,7 @@
#define CONFIG_ENV_ADDR_REDUND (AST_FMC_CS0_BASE + CONFIG_ENV_OFFSET_REDUND)
#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
-#define CONFIG_BOOTCOMMAND "bootm 20080000"
-+#define CONFIG_BOOTCOMMAND "bootm 21100000"
++#define CONFIG_BOOTCOMMAND "bootm 20b00000"
#define CONFIG_ENV_OVERWRITE
#define ASPEED_ENV_SETTINGS \
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch
index 5e8cd103d..f3fc0738b 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0023-Add-TPM-enable-pulse-triggering.patch
@@ -1,4 +1,4 @@
-From f762526077a7af02fc93bacc74fb9d49481d664f Mon Sep 17 00:00:00 2001
+From 6b0f858e2dda7afce82797835f950e3501b3046d 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
@@ -6,12 +6,13 @@ Subject: [PATCH] Add TPM enable pulse triggering
This commit adds onboard TPM enable pulse triggering.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+
---
board/aspeed/ast-g5/ast-g5-intel.c | 12 ++++++++++--
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 f9955c70d2f2..d9ba4a47a413 100644
+index adc6d10..55afa09 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[] = {
@@ -39,7 +40,7 @@ index f9955c70d2f2..d9ba4a47a413 100644
static void timer8_irq_handler(void *regs)
{
int i;
-@@ -445,6 +452,7 @@ void ast_g5_intel(void)
+@@ -488,6 +495,7 @@ void ast_g5_intel(void)
espi_init();
sgpio_init();
timer8_init();
@@ -47,6 +48,3 @@ index f9955c70d2f2..d9ba4a47a413 100644
if (intel_force_firmware_jumper_enabled()) {
id_led_control(GPIO_AMBER_LED, EIDLED_On);
kcs_init();
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch
index 9096b09b2..252a9ea1b 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0024-IPMI-command-handler-implementation-in-uboot.patch
@@ -1,4 +1,4 @@
-From 50d3a7264fc0ecdd61ae1686839b19091b124e8d Mon Sep 17 00:00:00 2001
+From 2314db61ea792a98c35fcc75b0ac09cbc0db005d 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
@@ -20,6 +20,7 @@ and got proper response.
Change-Id: I18b205bc45c34f7c4ef16adc29fa5bd494624ceb
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 +++++++++++++-----------
@@ -327,6 +328,3 @@ index 0000000..9d46d9b
+};
+
+void ipmi_cmd_handler(struct ipmi_cmd_data *ipmi_data);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
index f6f402bc9..7e75acb02 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
@@ -1,6 +1,6 @@
-From 6b4e1b3672433c0d7d392404e19d114ae25e0eb2 Mon Sep 17 00:00:00 2001
-From: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
-Date: Wed, 24 Apr 2019 22:35:43 +0530
+From 0e83d58efe5bd34430c953713285293cd0756b69 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] Manufacturing mode physical presence detection
Support for physical presence of manufacturing mode added.
@@ -15,10 +15,12 @@ special=mfg string
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>
+
---
board/aspeed/ast-g5/ast-g5-gpio.h | 2 +-
- board/aspeed/ast-g5/ast-g5-intel.c | 39 ++++++++++++++++++++++++++++++++++++--
- 2 files changed, 38 insertions(+), 3 deletions(-)
+ board/aspeed/ast-g5/ast-g5-intel.c | 31 +++++++++++++++++++++++++++++++
+ 2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/board/aspeed/ast-g5/ast-g5-gpio.h b/board/aspeed/ast-g5/ast-g5-gpio.h
index a820c0f..ed2499f 100644
@@ -34,7 +36,7 @@ index a820c0f..ed2499f 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 881ab89..86b422f 100644
+index 55afa09..812e3ef 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -24,6 +24,7 @@ enum gpio_names {
@@ -56,8 +58,8 @@ index 881ab89..86b422f 100644
};
#define LPC_SNOOP_ADDR 0x80
-@@ -313,12 +318,35 @@ static inline void ast_scu_write(uint32_t val, uint32_t reg)
- #endif
+@@ -373,6 +378,26 @@ static void update_bootargs_cmd(const char *key, const char *value)
+ free(buf);
}
+static bool is_mfg_mode_phy_req(void)
@@ -82,40 +84,17 @@ index 881ab89..86b422f 100644
+
void ast_g5_intel_late_init(void)
{
- char *cmdline = NULL;
- char *cmdline_new = NULL;
- char buf[32];
- u32 rest = 0;
-+ const char *special_mfg_str = " special=mfg";
-+ const u32 special_str_size = strlen(special_mfg_str);
-+ u32 buf_count = 0;
-
- /* By default host serail A and B use normal speed */
- uint32_t host_serial_cfg = 0;
-@@ -367,14 +395,21 @@ void ast_g5_intel_late_init(void)
- return;
- }
-
-- cmdline_new = malloc(strlen(cmdline) + strlen(buf) + 1);
-+ cmdline_new = malloc(strlen(cmdline) + strlen(buf) +
-+ special_str_size + 1);
- if (!cmdline_new) {
- printf("Cannot malloc memory!\n");
- return;
- }
+ char value[32];
+@@ -420,6 +445,12 @@ void ast_g5_intel_late_init(void)
+ ast_scu_write(0, AST_SCU_SYS_CTRL);
- /* append the reset status into kernel command line */
-- snprintf(cmdline_new, strlen(cmdline) + strlen(buf) + 1, "%s%s", cmdline, buf);
-+ buf_count = snprintf(cmdline_new, strlen(cmdline) + strlen(buf) + 1,
-+ "%s%s", cmdline, buf);
+ update_bootargs_cmd("resetreason", value);
+
++ /* Update the special mode in bootargs */
+ if (is_mfg_mode_phy_req())
-+ snprintf(cmdline_new + buf_count - 1, special_str_size + 1,
-+ "%s", special_mfg_str);
-+
- setenv("bootargs", cmdline_new);
- free(cmdline_new);
++ update_bootargs_cmd("special", "mfg");
++ else
++ update_bootargs_cmd("special", NULL);
}
---
-2.7.4
-
+
+ static void pwm_init(void)
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch
index 950763d8e..be2c4018d 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0026-Aspeed-I2C-support-in-U-Boot.patch
@@ -1,4 +1,4 @@
-From a1626519109c9bda02119114224f3759add21f00 Mon Sep 17 00:00:00 2001
+From ea4f14a24b67d5085149d48c7fb38d00f3a7444a 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
@@ -14,6 +14,7 @@ i2c functionalities like probe, read and write.
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 +
@@ -23,10 +24,10 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
configs/ast_g5_phy_defconfig | 2 +
drivers/i2c/Kconfig | 5 +
drivers/i2c/Makefile | 1 +
- drivers/i2c/ast_i2c.c | 849 +++++++++++++++++++++
+ drivers/i2c/ast_i2c.c | 852 +++++++++++++++++++++
drivers/i2c/ast_i2c.h | 131 ++++
include/configs/ast-common.h | 5 +
- 11 files changed, 1346 insertions(+)
+ 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
@@ -88,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..2847430
+index 0000000..5eb3f0a
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/regs-iic.h
@@ -0,0 +1,204 @@
@@ -129,175 +130,175 @@ index 0000000..2847430
+#endif
+
+/* I2C Register */
-+#define I2C_FUN_CTRL_REG 0x00
-+#define I2C_AC_TIMING_REG1 0x04
-+#define I2C_AC_TIMING_REG2 0x08
-+#define I2C_INTR_CTRL_REG 0x0c
-+#define I2C_INTR_STS_REG 0x10
-+#define I2C_CMD_REG 0x14
-+#define I2C_DEV_ADDR_REG 0x18
-+#define I2C_BUF_CTRL_REG 0x1c
-+#define I2C_BYTE_BUF_REG 0x20
-+#define I2C_DMA_BASE_REG 0x24
-+#define I2C_DMA_LEN_REG 0x28
++#define I2C_FUN_CTRL_REG 0x00
++#define I2C_AC_TIMING_REG1 0x04
++#define I2C_AC_TIMING_REG2 0x08
++#define I2C_INTR_CTRL_REG 0x0c
++#define I2C_INTR_STS_REG 0x10
++#define I2C_CMD_REG 0x14
++#define I2C_DEV_ADDR_REG 0x18
++#define I2C_BUF_CTRL_REG 0x1c
++#define I2C_BYTE_BUF_REG 0x20
++#define I2C_DMA_BASE_REG 0x24
++#define I2C_DMA_LEN_REG 0x28
+
+
+/* Gloable Register Definition */
+/* 0x00 : I2C Interrupt Status Register */
+/* 0x08 : I2C Interrupt Target Assignment */
+#if defined(CONFIG_ARCH_AST2400)
-+#define AST_I2CG_INTR14 (0x1 << 13)
-+#define AST_I2CG_INTR13 (0x1 << 12)
-+#define AST_I2CG_INTR12 (0x1 << 11)
-+#define AST_I2CG_INTR11 (0x1 << 10)
-+#define AST_I2CG_INTR10 (0x1 << 9)
++#define AST_I2CG_INTR14 (0x1 << 13)
++#define AST_I2CG_INTR13 (0x1 << 12)
++#define AST_I2CG_INTR12 (0x1 << 11)
++#define AST_I2CG_INTR11 (0x1 << 10)
++#define AST_I2CG_INTR10 (0x1 << 9)
+#elif defined(CONFIG_ARCH_AST1010)
-+#define AST_I2CG_INTR14 (0x1 << 13)
-+#define AST_I2CG_INTR13 (0x1 << 12)
-+#define AST_I2CG_INTR12 (0x1 << 11)
-+#define AST_I2CG_INTR11 (0x1 << 10)
-+#define AST_I2CG_INTR10 (0x1 << 9)
++#define AST_I2CG_INTR14 (0x1 << 13)
++#define AST_I2CG_INTR13 (0x1 << 12)
++#define AST_I2CG_INTR12 (0x1 << 11)
++#define AST_I2CG_INTR11 (0x1 << 10)
++#define AST_I2CG_INTR10 (0x1 << 9)
+#endif
-+#define AST_I2CG_INTR09 (0x1 << 8)
-+#define AST_I2CG_INTR08 (0x1 << 7)
-+#define AST_I2CG_INTR07 (0x1 << 6)
-+#define AST_I2CG_INTR06 (0x1 << 5)
-+#define AST_I2CG_INTR05 (0x1 << 4)
-+#define AST_I2CG_INTR04 (0x1 << 3)
-+#define AST_I2CG_INTR03 (0x1 << 2)
-+#define AST_I2CG_INTR02 (0x1 << 1)
-+#define AST_I2CG_INTR01 (0x1 )
++#define AST_I2CG_INTR09 (0x1 << 8)
++#define AST_I2CG_INTR08 (0x1 << 7)
++#define AST_I2CG_INTR07 (0x1 << 6)
++#define AST_I2CG_INTR06 (0x1 << 5)
++#define AST_I2CG_INTR05 (0x1 << 4)
++#define AST_I2CG_INTR04 (0x1 << 3)
++#define AST_I2CG_INTR03 (0x1 << 2)
++#define AST_I2CG_INTR02 (0x1 << 1)
++#define AST_I2CG_INTR01 (0x1)
+
+/* Device Register Definition */
+/* 0x00 : I2CD Function Control Register */
-+#define AST_I2CD_BUFF_SEL_MASK (0x7 << 20)
-+#define AST_I2CD_BUFF_SEL(x) (x << 20) // page 0 ~ 7
-+#define AST_I2CD_M_SDA_LOCK_EN (0x1 << 16)
-+#define AST_I2CD_MULTI_MASTER_DIS (0x1 << 15)
-+#define AST_I2CD_M_SCL_DRIVE_EN (0x1 << 14)
-+#define AST_I2CD_MSB_STS (0x1 << 9)
-+#define AST_I2CD_SDA_DRIVE_1T_EN (0x1 << 8)
-+#define AST_I2CD_M_SDA_DRIVE_1T_EN (0x1 << 7)
-+#define AST_I2CD_M_HIGH_SPEED_EN (0x1 << 6)
-+#define AST_I2CD_DEF_ADDR_EN (0x1 << 5)
-+#define AST_I2CD_DEF_ALERT_EN (0x1 << 4)
-+#define AST_I2CD_DEF_ARP_EN (0x1 << 3)
-+#define AST_I2CD_DEF_GCALL_EN (0x1 << 2)
-+#define AST_I2CD_SLAVE_EN (0x1 << 1)
-+#define AST_I2CD_MASTER_EN (0x1 )
++#define AST_I2CD_BUFF_SEL_MASK (0x7 << 20)
++#define AST_I2CD_BUFF_SEL(x) (x << 20) // page 0 ~ 7
++#define AST_I2CD_M_SDA_LOCK_EN (0x1 << 16)
++#define AST_I2CD_MULTI_MASTER_DIS (0x1 << 15)
++#define AST_I2CD_M_SCL_DRIVE_EN (0x1 << 14)
++#define AST_I2CD_MSB_STS (0x1 << 9)
++#define AST_I2CD_SDA_DRIVE_1T_EN (0x1 << 8)
++#define AST_I2CD_M_SDA_DRIVE_1T_EN (0x1 << 7)
++#define AST_I2CD_M_HIGH_SPEED_EN (0x1 << 6)
++#define AST_I2CD_DEF_ADDR_EN (0x1 << 5)
++#define AST_I2CD_DEF_ALERT_EN (0x1 << 4)
++#define AST_I2CD_DEF_ARP_EN (0x1 << 3)
++#define AST_I2CD_DEF_GCALL_EN (0x1 << 2)
++#define AST_I2CD_SLAVE_EN (0x1 << 1)
++#define AST_I2CD_MASTER_EN (0x1)
+
+/* 0x04 : I2CD Clock and AC Timing Control Register #1 */
-+#define AST_I2CD_tBUF (0x1 << 28) // 0~7
-+#define AST_I2CD_tHDSTA (0x1 << 24) // 0~7
-+#define AST_I2CD_tACST (0x1 << 20) // 0~7
-+#define AST_I2CD_tCKHIGH (0x1 << 16) // 0~7
-+#define AST_I2CD_tCKLOW (0x1 << 12) // 0~7
-+#define AST_I2CD_tHDDAT (0x1 << 10) // 0~7
-+#define AST_I2CD_CLK_TO_BASE_DIV (0x1 << 8) // 0~3
-+#define AST_I2CD_CLK_BASE_DIV (0x1 ) // 0~0xf
++#define AST_I2CD_tBUF (0x1 << 28) // 0~7
++#define AST_I2CD_tHDSTA (0x1 << 24) // 0~7
++#define AST_I2CD_tACST (0x1 << 20) // 0~7
++#define AST_I2CD_tCKHIGH (0x1 << 16) // 0~7
++#define AST_I2CD_tCKLOW (0x1 << 12) // 0~7
++#define AST_I2CD_tHDDAT (0x1 << 10) // 0~7
++#define AST_I2CD_CLK_TO_BASE_DIV (0x1 << 8) // 0~3
++#define AST_I2CD_CLK_BASE_DIV (0x1) // 0~0xf
+
+/* 0x08 : I2CD Clock and AC Timing Control Register #2 */
-+#define AST_I2CD_tTIMEOUT (0x1 ) // 0~7
-+#define AST_NO_TIMEOUT_CTRL 0x0
++#define AST_I2CD_tTIMEOUT (0x1) // 0~7
++#define AST_NO_TIMEOUT_CTRL 0x0
+
+
+/* 0x0c : I2CD Interrupt Control Register */
-+#define AST_I2CD_SDA_DL_TO_INTR_EN (0x1 << 14)
-+#define AST_I2CD_BUS_RECOVER_INTR_EN (0x1 << 13)
-+#define AST_I2CD_SMBUS_ALT_INTR_EN (0x1 << 12)
-+#define AST_I2CD_SLAVE_MATCH_INTR_EN (0x1 << 7)
-+#define AST_I2CD_SCL_TO_INTR_EN (0x1 << 6)
-+#define AST_I2CD_ABNORMAL_INTR_EN (0x1 << 5)
-+#define AST_I2CD_NORMAL_STOP_INTR_EN (0x1 << 4)
-+#define AST_I2CD_ARBIT_LOSS_INTR_EN (0x1 << 3)
-+#define AST_I2CD_RX_DOWN_INTR_EN (0x1 << 2)
-+#define AST_I2CD_TX_NAK_INTR_EN (0x1 << 1)
-+#define AST_I2CD_TX_ACK_INTR_EN (0x1 )
++#define AST_I2CD_SDA_DL_TO_INTR_EN (0x1 << 14)
++#define AST_I2CD_BUS_RECOVER_INTR_EN (0x1 << 13)
++#define AST_I2CD_SMBUS_ALT_INTR_EN (0x1 << 12)
++#define AST_I2CD_SLAVE_MATCH_INTR_EN (0x1 << 7)
++#define AST_I2CD_SCL_TO_INTR_EN (0x1 << 6)
++#define AST_I2CD_ABNORMAL_INTR_EN (0x1 << 5)
++#define AST_I2CD_NORMAL_STOP_INTR_EN (0x1 << 4)
++#define AST_I2CD_ARBIT_LOSS_INTR_EN (0x1 << 3)
++#define AST_I2CD_RX_DOWN_INTR_EN (0x1 << 2)
++#define AST_I2CD_TX_NAK_INTR_EN (0x1 << 1)
++#define AST_I2CD_TX_ACK_INTR_EN (0x1)
+
+/* 0x10 : I2CD Interrupt Status Register : WC */
-+#define AST_I2CD_INTR_STS_SDA_DL_TO (0x1 << 14)
-+#define AST_I2CD_INTR_STS_BUS_RECOVER (0x1 << 13)
-+#define AST_I2CD_INTR_STS_SMBUS_ALT (0x1 << 12)
-+#define AST_I2CD_INTR_STS_SMBUS_ARP_ADDR (0x1 << 11)
-+#define AST_I2CD_INTR_STS_SMBUS_DEV_ALT (0x1 << 10)
-+#define AST_I2CD_INTR_STS_SMBUS_DEF_ADDR (0x1 << 9)
-+#define AST_I2CD_INTR_STS_GCALL_ADDR (0x1 << 8)
-+#define AST_I2CD_INTR_STS_SLAVE_MATCH (0x1 << 7)
-+#define AST_I2CD_INTR_STS_SCL_TO (0x1 << 6)
-+#define AST_I2CD_INTR_STS_ABNORMAL (0x1 << 5)
-+#define AST_I2CD_INTR_STS_NORMAL_STOP (0x1 << 4)
-+#define AST_I2CD_INTR_STS_ARBIT_LOSS (0x1 << 3)
-+#define AST_I2CD_INTR_STS_RX_DOWN (0x1 << 2)
-+#define AST_I2CD_INTR_STS_TX_NAK (0x1 << 1)
-+#define AST_I2CD_INTR_STS_TX_ACK (0x1 )
++#define AST_I2CD_INTR_STS_SDA_DL_TO (0x1 << 14)
++#define AST_I2CD_INTR_STS_BUS_RECOVER (0x1 << 13)
++#define AST_I2CD_INTR_STS_SMBUS_ALT (0x1 << 12)
++#define AST_I2CD_INTR_STS_SMBUS_ARP_ADDR (0x1 << 11)
++#define AST_I2CD_INTR_STS_SMBUS_DEV_ALT (0x1 << 10)
++#define AST_I2CD_INTR_STS_SMBUS_DEF_ADDR (0x1 << 9)
++#define AST_I2CD_INTR_STS_GCALL_ADDR (0x1 << 8)
++#define AST_I2CD_INTR_STS_SLAVE_MATCH (0x1 << 7)
++#define AST_I2CD_INTR_STS_SCL_TO (0x1 << 6)
++#define AST_I2CD_INTR_STS_ABNORMAL (0x1 << 5)
++#define AST_I2CD_INTR_STS_NORMAL_STOP (0x1 << 4)
++#define AST_I2CD_INTR_STS_ARBIT_LOSS (0x1 << 3)
++#define AST_I2CD_INTR_STS_RX_DOWN (0x1 << 2)
++#define AST_I2CD_INTR_STS_TX_NAK (0x1 << 1)
++#define AST_I2CD_INTR_STS_TX_ACK (0x1)
+
+/* 0x14 : I2CD Command/Status Register */
-+#define AST_I2CD_SDA_OE (0x1 << 28)
-+#define AST_I2CD_SDA_O (0x1 << 27)
-+#define AST_I2CD_SCL_OE (0x1 << 26)
-+#define AST_I2CD_SCL_O (0x1 << 25)
-+#define AST_I2CD_TX_TIMING (0x1 << 24) // 0 ~3
-+#define AST_I2CD_TX_STATUS (0x1 << 23)
-+// Tx State Machine
-+#define AST_I2CD_IDLE 0x0
++#define AST_I2CD_SDA_OE (0x1 << 28)
++#define AST_I2CD_SDA_O (0x1 << 27)
++#define AST_I2CD_SCL_OE (0x1 << 26)
++#define AST_I2CD_SCL_O (0x1 << 25)
++#define AST_I2CD_TX_TIMING (0x1 << 24) // 0 ~3
++#define AST_I2CD_TX_STATUS (0x1 << 23)
++// Tx State Machine
++#define AST_I2CD_IDLE 0x0
+#define AST_I2CD_MACTIVE 0x8
+#define AST_I2CD_MSTART 0x9
+#define AST_I2CD_MSTARTR 0xa
+#define AST_I2CD_MSTOP 0xb
+#define AST_I2CD_MTXD 0xc
+#define AST_I2CD_MRXACK 0xd
-+#define AST_I2CD_MRXD 0xe
-+#define AST_I2CD_MTXACK 0xf
++#define AST_I2CD_MRXD 0xe
++#define AST_I2CD_MTXACK 0xf
+#define AST_I2CD_SWAIT 0x1
-+#define AST_I2CD_SRXD 0x4
-+#define AST_I2CD_STXACK 0x5
++#define AST_I2CD_SRXD 0x4
++#define AST_I2CD_STXACK 0x5
+#define AST_I2CD_STXD 0x6
-+#define AST_I2CD_SRXACK 0x7
-+#define AST_I2CD_RECOVER 0x3
-+
-+#define AST_I2CD_SCL_LINE_STS (0x1 << 18)
-+#define AST_I2CD_SDA_LINE_STS (0x1 << 17)
-+#define AST_I2CD_BUS_BUSY_STS (0x1 << 16)
-+#define AST_I2CD_SDA_OE_OUT_DIR (0x1 << 15)
-+#define AST_I2CD_SDA_O_OUT_DIR (0x1 << 14)
-+#define AST_I2CD_SCL_OE_OUT_DIR (0x1 << 13)
-+#define AST_I2CD_SCL_O_OUT_DIR (0x1 << 12)
-+#define AST_I2CD_BUS_RECOVER_CMD_EN (0x1 << 11)
-+#define AST_I2CD_S_ALT_EN (0x1 << 10)
++#define AST_I2CD_SRXACK 0x7
++#define AST_I2CD_RECOVER 0x3
++
++#define AST_I2CD_SCL_LINE_STS (0x1 << 18)
++#define AST_I2CD_SDA_LINE_STS (0x1 << 17)
++#define AST_I2CD_BUS_BUSY_STS (0x1 << 16)
++#define AST_I2CD_SDA_OE_OUT_DIR (0x1 << 15)
++#define AST_I2CD_SDA_O_OUT_DIR (0x1 << 14)
++#define AST_I2CD_SCL_OE_OUT_DIR (0x1 << 13)
++#define AST_I2CD_SCL_O_OUT_DIR (0x1 << 12)
++#define AST_I2CD_BUS_RECOVER_CMD_EN (0x1 << 11)
++#define AST_I2CD_S_ALT_EN (0x1 << 10)
+// 0 : DMA Buffer, 1: Pool Buffer
-+//AST1070 DMA register
-+#define AST_I2CD_RX_DMA_ENABLE (0x1 << 9)
-+#define AST_I2CD_TX_DMA_ENABLE (0x1 << 8)
++//AST1070 DMA register
++#define AST_I2CD_RX_DMA_ENABLE (0x1 << 9)
++#define AST_I2CD_TX_DMA_ENABLE (0x1 << 8)
+
+/* Command Bit */
-+#define AST_I2CD_RX_BUFF_ENABLE (0x1 << 7)
-+#define AST_I2CD_TX_BUFF_ENABLE (0x1 << 6)
-+#define AST_I2CD_M_STOP_CMD (0x1 << 5)
-+#define AST_I2CD_M_S_RX_CMD_LAST (0x1 << 4)
-+#define AST_I2CD_M_RX_CMD (0x1 << 3)
-+#define AST_I2CD_S_TX_CMD (0x1 << 2)
-+#define AST_I2CD_M_TX_CMD (0x1 << 1)
-+#define AST_I2CD_M_START_CMD (0x1 )
++#define AST_I2CD_RX_BUFF_ENABLE (0x1 << 7)
++#define AST_I2CD_TX_BUFF_ENABLE (0x1 << 6)
++#define AST_I2CD_M_STOP_CMD (0x1 << 5)
++#define AST_I2CD_M_S_RX_CMD_LAST (0x1 << 4)
++#define AST_I2CD_M_RX_CMD (0x1 << 3)
++#define AST_I2CD_S_TX_CMD (0x1 << 2)
++#define AST_I2CD_M_TX_CMD (0x1 << 1)
++#define AST_I2CD_M_START_CMD (0x1)
+
+/* 0x18 : I2CD Slave Device Address Register */
+
+/* 0x1C : I2CD Pool Buffer Control Register */
-+#define AST_I2CD_RX_BUF_ADDR_GET(x) ((x>> 24)& 0xff)
-+#define AST_I2CD_RX_BUF_END_ADDR_SET(x) (x << 16)
-+#define AST_I2CD_TX_DATA_BUF_END_SET(x) ((x&0xff) << 8)
-+#define AST_I2CD_TX_DATA_BUF_GET(x) ((x >>8) & 0xff)
-+#define AST_I2CD_BUF_BASE_ADDR_SET(x) (x & 0x3f)
++#define AST_I2CD_RX_BUF_ADDR_GET(x) ((x >> 24) & 0xff)
++#define AST_I2CD_RX_BUF_END_ADDR_SET(x) (x << 16)
++#define AST_I2CD_TX_DATA_BUF_END_SET(x) ((x & 0xff) << 8)
++#define AST_I2CD_TX_DATA_BUF_GET(x) ((x >> 8) & 0xff)
++#define AST_I2CD_BUF_BASE_ADDR_SET(x) (x & 0x3f)
+
+/* 0x20 : I2CD Transmit/Receive Byte Buffer Register */
-+#define AST_I2CD_GET_MODE(x) ((x >> 8) & 0x1)
++#define AST_I2CD_GET_MODE(x) ((x >> 8) & 0x1)
+
-+#define AST_I2CD_RX_BYTE_BUFFER (0xff << 8)
-+#define AST_I2CD_TX_BYTE_BUFFER (0xff )
++#define AST_I2CD_RX_BYTE_BUFFER (0xff << 8)
++#define AST_I2CD_TX_BYTE_BUFFER (0xff)
+
+
+#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..7e8d4c8 100644
+index 976c59b..537cd4b 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[] = {
@@ -319,18 +320,18 @@ index 976c59b..7e8d4c8 100644
+u32 ast_get_pclk(void)
+{
-+ unsigned int div, hpll;
++ unsigned int div, hpll;
+
-+ hpll = ast_get_h_pll_clk();
-+ div = SCU_GET_PCLK_DIV(ast_scu_read(AST_SCU_CLK_SEL));
++ hpll = ast_get_h_pll_clk();
++ div = SCU_GET_PCLK_DIV(ast_scu_read(AST_SCU_CLK_SEL));
+#ifdef AST_SOC_G5
-+ div = (div+1) << 2;
++ div = (div+1) << 2;
+#else
-+ div = (div+1) << 1;
++ div = (div+1) << 1;
+#endif
+
-+ debug("HPLL=%d, Div=%d, PCLK=%d\n", hpll, div, hpll/div);
-+ return (hpll/div);
++ debug("HPLL=%d, Div=%d, PCLK=%d\n", hpll, div, hpll/div);
++ return (hpll/div);
+}
+
+
@@ -444,7 +445,7 @@ index 976c59b..7e8d4c8 100644
{
int i;
diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
-index 0953677..7309589 100644
+index 0953677..3c33546 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
@@ -13,6 +13,7 @@
@@ -461,20 +462,20 @@ index 0953677..7309589 100644
+ /* Initialize I2C */
+#if defined(CONFIG_SYS_I2C)
-+ i2c_init(I2C_ADAP->speed, I2C_ADAP->slaveaddr);
++ i2c_init(I2C_ADAP->speed, I2C_ADAP->slaveaddr);
+#else
-+ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
++ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
ast_g5_intel();
return 0;
}
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
-index 8f09190..47d9563 100644
+index 4aefcf4..1b96ab7 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
-@@ -15,3 +15,5 @@ CONFIG_SPI_FLASH_MACRONIX=y
- CONFIG_SPI_FLASH_STMICRO=y
+@@ -13,3 +13,5 @@ CONFIG_OF_LIBFDT=y
+ CONFIG_SPI_FLASH=y
CONFIG_SYS_NS16550=y
CONFIG_USE_IRQ=y
+CONFIG_CMD_I2C=y
@@ -509,10 +510,10 @@ 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..0b12fc2
+index 0000000..533419f
--- /dev/null
+++ b/drivers/i2c/ast_i2c.c
-@@ -0,0 +1,849 @@
+@@ -0,0 +1,852 @@
+/*
+ * i2c_adap_ast.c
+ *
@@ -868,7 +869,7 @@ index 0000000..0b12fc2
+static inline void ast_i2c_write(struct ast_i2c_bus *i2c_bus, u32 val, u32 reg)
+{
+#if 0
-+ printf("%x: W : reg %x , val: %x \n",i2c_bus->reg_base, reg, val);
++ printf("%x: W : reg %x , val: %x\n", i2c_bus->reg_base, reg, val);
+#endif
+ __raw_writel(val, i2c_bus->reg_base + reg);
+}
@@ -877,7 +878,7 @@ index 0000000..0b12fc2
+{
+#if 0
+ u32 val = __raw_readl(i2c_bus->reg_base + reg);
-+ printf("%x: R : reg %x , val: %x \n",i2c_bus->reg_base, reg, val);
++ printf("%x: R : reg %x , val: %x\n", i2c_bus->reg_base, reg, val);
+ return val;
+#else
+ return __raw_readl(i2c_bus->reg_base + reg);
@@ -891,7 +892,7 @@ index 0000000..0b12fc2
+ u32 SCL_Low, SCL_High, data;
+
+ clk = ast_get_pclk();
-+// debug("pclk = %d \n",clk);
++// debug("pclk = %d\n", clk);
+ divider_ratio = clk / bus_clk;
+ for (div = 0; divider_ratio >= 16; div++)
+ {
@@ -910,7 +911,7 @@ index 0000000..0b12fc2
+ u32 data;
+
+ clk = ast_get_pclk();
-+ // debug("pclk = %d \n",clk);
++ // debug("pclk = %d\n", clk);
+
+ for (i = 0;
+ i < sizeof(i2c_timing_table) / sizeof(struct ast_i2c_timing_table);
@@ -920,7 +921,7 @@ index 0000000..0b12fc2
+ }
+ }
+ data = i2c_timing_table[i].timing;
-+ // printk("divisor [%d], timing [%x] \n", i2c_timing_table[i].divisor,
++ // printk("divisor [%d], timing [%x]\n", i2c_timing_table[i].divisor,
+ // i2c_timing_table[i].timing);
+ return data;
+#endif
@@ -1059,7 +1060,7 @@ index 0000000..0b12fc2
+
+ /* Send Offset */
+ for (i = 0; i < i2c_bus->a_len; i++) {
-+ debug("offset [%x] \n", i2c_bus->a_buf[i]);
++ debug("offset [%x]\n", i2c_bus->a_buf[i]);
+ ast_i2c_write(i2c_bus, i2c_bus->a_buf[i],
+ I2C_BYTE_BUF_REG);
+ ast_i2c_write(i2c_bus, AST_I2CD_M_TX_CMD,
@@ -1119,7 +1120,7 @@ index 0000000..0b12fc2
+
+ /* Send Offset */
+ for (i = 0; i < i2c_bus->a_len; i++) {
-+ debug("offset [%x] \n", i2c_bus->a_buf[i]);
++ debug("offset [%x]\n", i2c_bus->a_buf[i]);
+ ast_i2c_write(i2c_bus, i2c_bus->a_buf[i],
+ I2C_BYTE_BUF_REG);
+ ast_i2c_write(i2c_bus, AST_I2CD_M_TX_CMD, I2C_CMD_REG);
@@ -1130,7 +1131,7 @@ index 0000000..0b12fc2
+
+ /* Tx data */
+ for (i = 0; i < i2c_bus->d_len; i++) {
-+ debug("Tx data [%x] \n", i2c_bus->d_buf[i]);
++ debug("Tx data [%x]\n", i2c_bus->d_buf[i]);
+ ast_i2c_write(i2c_bus, i2c_bus->d_buf[i],
+ I2C_BYTE_BUF_REG);
+ ast_i2c_write(i2c_bus, AST_I2CD_M_TX_CMD, I2C_CMD_REG);
@@ -1213,7 +1214,7 @@ index 0000000..0b12fc2
+ return AST_I2C_DEV13_BASE;
+ break;
+ default:
-+ printf("i2c base error \n");
++ printf("i2c base error\n");
+ break;
+ };
+ return 0;
@@ -1247,10 +1248,13 @@ index 0000000..0b12fc2
+ ast_i2c_write(i2c_bus, AST_I2CD_MASTER_EN, I2C_FUN_CTRL_REG);
+
+ // SLAVE mode enable
-+#if 0
-+ if(slaveaddr) {
-+ ast_i2c_write(i2c_bus, slaveaddr, I2C_DEV_ADDR_REG);
-+ ast_i2c_write(i2c_bus, ast_i2c_read(i2c_bus,I2C_FUN_CTRL_REG) | AST_I2CD_SLAVE_EN, I2C_FUN_CTRL_REG);
++#if 0
++ if (slaveaddr) {
++ ast_i2c_write(i2c_bus, slaveaddr, I2C_DEV_ADDR_REG);
++ ast_i2c_write(i2c_bus,
++ ast_i2c_read(i2c_bus, I2C_FUN_CTRL_REG) |
++ AST_I2CD_SLAVE_EN,
++ I2C_FUN_CTRL_REG);
+ }
+#endif
+
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch
index d8e7c4645..b5f7ccf07 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0027-CPLD-u-boot-commands-support-for-PFR.patch
@@ -1,4 +1,4 @@
-From 35a50c959b290ba8a6f0e70a42ae952b65df8a9d Mon Sep 17 00:00:00 2001
+From cdb62eb60de0b99276ff755b896fc51c8ed2606d 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
@@ -27,6 +27,7 @@ CPLD read successful. Reg:0x00 Val:0x04
ast#
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
+
---
cmd/Makefile | 1 +
cmd/cpld.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -47,7 +48,7 @@ index a1731be..c8ac0af 100644
obj-$(CONFIG_CMD_IDE) += ide.o
diff --git a/cmd/cpld.c b/cmd/cpld.c
new file mode 100644
-index 0000000..63220cb
+index 0000000..06b2e98
--- /dev/null
+++ b/cmd/cpld.c
@@ -0,0 +1,244 @@
@@ -65,8 +66,8 @@ index 0000000..63220cb
+#include <errno.h>
+#include <linux/compiler.h>
+
-+#define PFR_CPLD_I2C_BUSNO 5
-+#define PFR_CPLD_SLAVE_ADDR 0x0E
++#define PFR_CPLD_I2C_BUSNO 4
++#define PFR_CPLD_SLAVE_ADDR 0xE0
+
+#define CPLD_READ_TIMEOUT_ATTEMPTS 5
+
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch
index 7601f6dea..0113fc3fe 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch
@@ -1,4 +1,4 @@
-From 56d13790a713659e34eca884ce36dca76b3bdf3d Mon Sep 17 00:00:00 2001
+From 41c08f1fcb5fa0b07ea541fc3d8bc322ddf8701d 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
@@ -13,16 +13,17 @@ to uefi, checked bios serial logs working fine and accessed
keyboard in uefi without any issues.
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
+
---
board/aspeed/ast-g5/ast-g5-intel.c | 21 +++++++++++++++++++++
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 86b422f..fe5128f 100644
+index 812e3ef..e68ab85 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
-@@ -414,6 +414,26 @@ void ast_g5_intel_late_init(void)
- free(cmdline_new);
+@@ -453,6 +453,26 @@ void ast_g5_intel_late_init(void)
+ update_bootargs_cmd("special", NULL);
}
+static void uart_init(void)
@@ -48,7 +49,7 @@ index 86b422f..fe5128f 100644
static void pwm_init(void)
{
uint32_t val;
-@@ -482,6 +502,7 @@ extern void espi_init(void);
+@@ -521,6 +541,7 @@ extern void espi_init(void);
extern void kcs_init(void);
void ast_g5_intel(void)
{
@@ -56,6 +57,3 @@ index 86b422f..fe5128f 100644
pwm_init();
gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
espi_init();
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch
index 00dbd68da..f91ab8fea 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch
@@ -1,4 +1,4 @@
-From bd4a64d7ea394d0b418d491699853112229f098e Mon Sep 17 00:00:00 2001
+From 513ff559cd6fedd29412fb59b6f436f617620511 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,6 +28,7 @@ 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 +
@@ -1258,14 +1259,11 @@ index d66c0fa..45a600e 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 47d9563..f070494 100644
+index 1b96ab7..5965a9b 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
-@@ -17,3 +17,4 @@ CONFIG_SYS_NS16550=y
+@@ -15,3 +15,4 @@ CONFIG_SYS_NS16550=y
CONFIG_USE_IRQ=y
CONFIG_CMD_I2C=y
CONFIG_SYS_I2C_AST=y
+CONFIG_LIB_RAND=y
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch
new file mode 100644
index 000000000..519977e19
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0030-Support-Get-Set-Security-mode-command.patch
@@ -0,0 +1,124 @@
+From 294a5971c94099277ee5b5589c060896cf22c495 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
+
+Support added for get/set security mode oem command. This
+command is used to read / write the RestrictionMode property
+which is saved in U-Boot environment variable. U-Boot
+command provides a way to downgrade RestrictionMode property
+value, which is not allowed in normal mode from Host interface
+
+Tested:
+1. Verified get security mode returns proper value read from
+U-Boot environment variable. cmdtool.efi 20 C0 B3
+2. Verified set security mode updates U-Boot environment variable
+and it is reflected in linux too cmdtool.efi 20 C0 B4 4
+3. Verified negative test cases with improper values and it
+throws correct errors
+
+Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
+
+---
+ 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
+--- a/board/aspeed/ast-g5/ipmi-handler.c
++++ b/board/aspeed/ast-g5/ipmi-handler.c
+@@ -20,10 +20,19 @@
+ #define CMD_FWUPD_SET_OPTIONS 0x2B
+ #define CMD_FWUPD_IMAGE_WRITE 0x2C
+ #define CMD_INTL_OEM_GET_BUFFER_SIZE 0x66
++#define CMD_INTL_OEM_GET_SEC_MODE 0xB3
++#define CMD_INTL_OEM_SET_SEC_MODE 0xB4
+
+ #define MAX_KCS_BUF_SIZE 1020 /* (0xFF * 4) */
+ #define MAX_IPMB_BUF_SIZE 1020 /* (0xFF * 4) */
+
++/* Restriction mode values */
++#define RESTRICTION_MODE_MIN_VALUE 3 /*Provisioning*/
++#define RESTRICION_MODE_MAX_VALUE 5 /*Provisioned host disabled */
++
++#define STR_ENV_PROVISION "provision"
++
++
+ typedef u16 (*fun_handler)(u8 *req, u16 req_len, u8 *res);
+
+ struct ipmi_cmd_table {
+@@ -53,6 +62,11 @@ struct intc_get_buf_size_res {
+ u8 kcs_size;
+ u8 ipmb_size;
+ };
++struct intc_get_secuirty_mode_res {
++ u8 completion_code;
++ u8 restriction_mode;
++ u8 special_mode;
++};
+
+ static u16 get_device_id(u8 *req, u16 req_len, u8 *res)
+ {
+@@ -120,6 +134,51 @@ static u16 intel_get_buffer_size(u8 *req, u16 req_len, u8 *res)
+ return sizeof(struct intc_get_buf_size_res);
+ }
+
++static u16 intel_get_security_mode(u8 *req, u16 req_len, u8 *res)
++{
++ char *cmdline = NULL;
++ struct intc_get_secuirty_mode_res *result =
++ (struct intc_get_secuirty_mode_res *)res;
++
++ if (req_len != 0) {
++ result->completion_code = IPMI_CC_INVALID_DATA_LENGTH;
++ return sizeof(result->completion_code);
++ }
++
++ cmdline = getenv(STR_ENV_PROVISION);
++ if (!cmdline) {
++ /* Default provision must be set only by linux */
++ result->completion_code = IPMI_CC_UNSPECIFIED;
++ return sizeof(result->completion_code);
++ }
++ result->restriction_mode = simple_strtol(cmdline, NULL, 10);
++ /* special mode is non-volatile and not applicable in U-Boot */
++ result->special_mode = 0;
++ result->completion_code = IPMI_CC_OK;
++
++ return sizeof(*result);
++}
++
++static u16 intel_set_security_mode(u8 *req, u16 req_len, u8 *res)
++{
++ if (req_len != sizeof(*req)) {
++ *res = IPMI_CC_INVALID_DATA_LENGTH;
++ return sizeof(*res);
++ }
++
++ if (*req > RESTRICION_MODE_MAX_VALUE ||
++ *req < RESTRICTION_MODE_MIN_VALUE) {
++ *res = IPMI_CC_INVALID_DATA_FIELD;
++ return sizeof(*res);
++ }
++
++ setenv_ulong(STR_ENV_PROVISION, *req);
++ saveenv();
++ *res = IPMI_CC_OK;
++
++ return sizeof(*res);
++}
++
+ const struct ipmi_cmd_table cmd_info[] = {
+ { NETFN_APP, CMD_APP_GET_DEV_ID, get_device_id },
+ { NETFN_APP, CMD_APP_GET_SELF_TEST_RESULTS, get_self_test_result },
+@@ -131,7 +190,9 @@ const struct ipmi_cmd_table cmd_info[] = {
+ { NETFN_FIRMWARE, CMD_FWUPD_GET_UPDATE_STATUS, fwupd_get_update_status },
+ { NETFN_FIRMWARE, CMD_FWUPD_SET_OPTIONS, fwupd_set_options },
+ { NETFN_FIRMWARE, CMD_FWUPD_IMAGE_WRITE, fwupd_image_write },
+- { NETFN_INTEL_OEM, CMD_INTL_OEM_GET_BUFFER_SIZE, intel_get_buffer_size }
++ { NETFN_INTEL_OEM, CMD_INTL_OEM_GET_BUFFER_SIZE, intel_get_buffer_size },
++ { NETFN_INTEL_OEM, CMD_INTL_OEM_GET_SEC_MODE, intel_get_security_mode },
++ { NETFN_INTEL_OEM, CMD_INTL_OEM_SET_SEC_MODE, intel_set_security_mode },
+ };
+
+ #define CMD_TABLE_SIZE ARRAY_SIZE(cmd_info)
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch
new file mode 100644
index 000000000..b70427fe0
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0031-Make-it-so-TFTP-port-can-be-modified.patch
@@ -0,0 +1,40 @@
+From 1d680678abb76bdea7cf2128b7ce6db4a5652151 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
+
+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 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
+index 12d6684551..20864b2798 100644
+--- a/include/configs/ast-g5-ncsi.h
++++ b/include/configs/ast-g5-ncsi.h
+@@ -28,4 +28,6 @@
+
+ #define CONFIG_HW_WATCHDOG
+
++#define CONFIG_TFTP_PORT
++
+ #endif /* __AST_G5_NCSI_CONFIG_H */
+diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
+index 62ddb841e5..371f50a1db 100644
+--- a/include/configs/ast-g5-phy.h
++++ b/include/configs/ast-g5-phy.h
+@@ -30,4 +30,6 @@
+ /* platform.S */
+ #define CONFIG_DRAM_ECC_SIZE 0x10000000
+
++#define CONFIG_TFTP_PORT
++
+ #endif /* __AST_G5_PHY_CONFIG_H */
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0032-Adding-PFR-boot-flow-checkpoint-in-u-boot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0032-Adding-PFR-boot-flow-checkpoint-in-u-boot.patch
new file mode 100644
index 000000000..b76a3dba0
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0032-Adding-PFR-boot-flow-checkpoint-in-u-boot.patch
@@ -0,0 +1,102 @@
+From dda24946edd0a4ec54e3ecaa8bd493cce9bdfa15 Mon Sep 17 00:00:00 2001
+From: AppaRao Puli <apparao.puli@linux.intel.com>
+Date: Mon, 22 Jul 2019 08:26:15 +0530
+Subject: [PATCH] Adding PFR boot flow checkpoint in u-boot
+
+Added two PFR boot flow check points in u-boot
+1) Set the booting starts checkpoint(0x01)
+2) Set FFUJ checkpoint(0x07) when jumper on.
+
+Tested:
+Loaded the image, dumped all cpld registers and
+cross verified the check-points properly set or not.
+
+Change-Id: I3c725b0e15c1fea5bdb7b085826bdabad19bda80
+Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
+---
+ board/aspeed/ast-g5/ast-g5-intel.c | 46 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
+index e68ab85..9f0a64d 100644
+--- a/board/aspeed/ast-g5/ast-g5-intel.c
++++ b/board/aspeed/ast-g5/ast-g5-intel.c
+@@ -12,11 +12,21 @@
+ #include <asm/arch/regs-scu.h>
+ #include <asm/arch/ast_scu.h>
+ #include <asm/arch/aspeed.h>
++#include <i2c.h>
+
+ #include "ast-g5.h"
+ #include "ast-g5-gpio.h"
+ #include "ast-g5-timer.h"
+
++/* PFR Specific defines */
++#define PFR_CPLD_I2C_BUSNO 4
++#define PFR_CPLD_SLAVE_ADDR 0xE0
++#define PFR_CPLD_BOOT_CHECKPOINT_REG 0x13
++
++#define PFR_CPLD_CHKPOINT_START 0x01
++#define PFR_CPLD_CHKPOINT_FFUJ 0x07
++#define PFR_CPLD_CHKPOINT_FINISHED 0x09
++
+ /* Names to match the GPIOs */
+ enum gpio_names {
+ GPIO_ID_LED = 0,
+@@ -537,10 +547,42 @@ static void pwm_init(void)
+ writel(val, PWM_BASE_ADDR + PWM_CONTROL);
+ }
+
++static void set_boot_checkpoint(u8 chk_point)
++{
++ int ret = 0;
++ int chip = (PFR_CPLD_SLAVE_ADDR >> 1);
++ u32 reg_addr = PFR_CPLD_BOOT_CHECKPOINT_REG;
++
++ /* Get current I2C bus number to restore later. */
++ int current_bus_no = i2c_get_bus_num();
++
++ /* Set I2C bus number to PFR CPLD I2C bus. */
++ ret = i2c_set_bus_num(PFR_CPLD_I2C_BUSNO);
++ if (ret) {
++ printf("Failed to change I2C bus number (%d)\n", ret);
++ goto done;
++ }
++
++ ret = i2c_write(chip, reg_addr, 1, &chk_point, 1);
++ if (ret) {
++ printf("Error writing the chip: %d\n", ret);
++ goto done;
++ }
++
++done:
++ /* Restore I2C bus number */
++ if (i2c_set_bus_num(current_bus_no))
++ printf("Failed to restore I2C bus number.\n");
++}
++
+ extern void espi_init(void);
+ extern void kcs_init(void);
+ void ast_g5_intel(void)
+ {
++ /* To notify the CPLD about the start of bootloader
++ * and hardware initialization */
++ set_boot_checkpoint(PFR_CPLD_CHKPOINT_START);
++
+ uart_init();
+ pwm_init();
+ gpio_init(gpio_table, ARRAY_SIZE(gpio_table));
+@@ -551,6 +593,10 @@ void ast_g5_intel(void)
+ if (intel_force_firmware_jumper_enabled()) {
+ id_led_control(GPIO_AMBER_LED, EIDLED_On);
+ kcs_init();
++ /* Notify CPLD about FFUJ jumper set and pause
++ * of booting for indefinitely time. It will be
++ * resumed once reset is done. */
++ set_boot_checkpoint(PFR_CPLD_CHKPOINT_FFUJ);
+ /* TODO: need to stop the booting here. */
+ } else {
+ id_led_control(GPIO_GREEN_LED, EIDLED_On);
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0033-PFR-firmware-update-support-in-u-boot.patch b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0033-PFR-firmware-update-support-in-u-boot.patch
new file mode 100644
index 000000000..80a949a87
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0033-PFR-firmware-update-support-in-u-boot.patch
@@ -0,0 +1,480 @@
+From d9287ee5f3b797fd492ec78617c174ad20e85bc4 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 firmware update support in u-boot
+
+Added firmware update ipmi commands support
+for PFR images. This enables PFR based firmware
+updates for components BMC, BIOS and CPLD during
+FFUJ mode.
+
+Tested:
+Using debug fwpiaupd.efi utility, validated the PFR
+BMC image update.
+
+Change-Id: Ic2b550c42208f52ec865da463e6518bf8c503c15
+Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
+---
+ board/aspeed/ast-g5/Makefile | 1 +
+ board/aspeed/ast-g5/fw-update.c | 112 ++++++++++++++++++++-------------------
+ board/aspeed/ast-g5/fw-update.h | 7 +++
+ board/aspeed/ast-g5/ipmi-fwupd.c | 37 +++++++++++++
+ board/aspeed/ast-g5/ipmi-fwupd.h | 6 ---
+ board/aspeed/ast-g5/pfr-mgr.c | 73 +++++++++++++++++++++++++
+ board/aspeed/ast-g5/pfr-mgr.h | 67 +++++++++++++++++++++++
+ 7 files changed, 242 insertions(+), 61 deletions(-)
+ create mode 100644 board/aspeed/ast-g5/pfr-mgr.c
+ create mode 100644 board/aspeed/ast-g5/pfr-mgr.h
+
+diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile
+index 0b2d936..9021d7f 100644
+--- a/board/aspeed/ast-g5/Makefile
++++ b/board/aspeed/ast-g5/Makefile
+@@ -8,3 +8,4 @@ obj-y += ast-g5-kcs.o
+ obj-y += ipmi-handler.o
+ obj-y += ipmi-fwupd.o
+ obj-y += fw-update.o
++obj-y += pfr-mgr.o
+diff --git a/board/aspeed/ast-g5/fw-update.c b/board/aspeed/ast-g5/fw-update.c
+index 9923993..89fe5fd 100644
+--- a/board/aspeed/ast-g5/fw-update.c
++++ b/board/aspeed/ast-g5/fw-update.c
+@@ -6,6 +6,7 @@
+ #include <flash.h>
+
+ #include "fw-update.h"
++#include "pfr-mgr.h"
+
+ #define BOOTCMD_BOOTM_STR "bootm "
+ #define RANDOM_NUM_TIMEOUT 30 /* in seconds */
+@@ -15,7 +16,7 @@
+ #define PROTECT_ON 1
+
+ extern struct fwupd_global_setting g_fwupd_settings;
+-extern u32 g_write_addr;
++extern struct fwupd_image_info g_img_info;
+
+ bool g_fwupd_settings_lock = false;
+ unsigned long long etime;
+@@ -36,16 +37,8 @@ void fwupd_settings_unlock(void)
+
+ u8 get_active_boot_image(void)
+ {
+- char *bootcmd = getenv("bootcmd");
+- char *start = strstr(bootcmd, BOOTCMD_BOOTM_STR);
++ /* For PFR, its always active region */
+ u8 boot_image = PRIMARY_IMAGE;
+-
+- if (start) {
+- ulong boot_addr = simple_strtoul(
+- (start + strlen(BOOTCMD_BOOTM_STR)), NULL, 16);
+- if (boot_addr == SECONDARY_FITIMAGE_START_ADDR)
+- return SECONDARY_IMAGE;
+- }
+ return boot_image;
+ }
+
+@@ -318,45 +311,22 @@ static int erase_flash_sector(ulong addr_first, ulong addr_last)
+ return rcode;
+ }
+
+-static int verify_image(void)
++static int verify_image(ulong src_addr, ulong img_length)
+ {
+- ulong src_addr = IMAGE_LOAD_RAM_ADDR;
+- void *hdr = (void *)src_addr;
+-
+- printf("\n## Checking Image at 0x%08lx ...\n", src_addr);
+- /* AT the moment, we only support FIT image flash */
+- switch (genimg_get_format(hdr)) {
+- case IMAGE_FORMAT_FIT:
+- printf(" FIT image found\n");
+- if (!fit_check_format(hdr)) {
+- printf("Bad FIT image format!\n");
+- return -1;
+- }
+-
+- if (!fit_all_image_verify(hdr)) {
+- printf("Bad hash in FIT image!\n");
+- return -1;
+- }
+- break;
+- default:
+- printf("Unknown image format!\n");
+- return -1;
+- }
+-
++ /* TODO: Verify the hash alone here.*/
++ /* Full image verification is done in CPLD. */
+ return 0;
+ }
+
+-static int flash_image(void)
++static int flash_image(ulong src_addr, ulong addr_first, ulong max_size,
++ ulong img_length)
+ {
+ int rcode;
+- ulong max_size = MAX_FITIMAGE_SIZE;
+- ulong src_addr = IMAGE_LOAD_RAM_ADDR;
+- ulong addr_first = get_flash_image_address();
+ ulong addr_last = addr_first + max_size - 1;
+
+- if ((g_write_addr > max_size) || (g_write_addr == 0)) {
++ if ((img_length > max_size) || (img_length == 0)) {
+ printf("ERROR: %s(): Invalid file uploaded. filesize(0x%08x)\n",
+- __func__, g_write_addr);
++ __func__, img_length);
+ return -1;
+ }
+
+@@ -398,7 +368,7 @@ static int flash_image(void)
+
+ /* write to flash area */
+ printf("Copy to Flash... ");
+- rcode = flash_write((char *)src_addr, addr_first, g_write_addr * 1);
++ rcode = flash_write((char *)src_addr, addr_first, img_length);
+ if (rcode != 0) {
+ printf("%s(): Flash copy failed(%d).\n", __func__, rcode);
+ flash_perror(rcode);
+@@ -430,10 +400,27 @@ void start_fw_update_loop(void)
+ }
+
+ if (g_fwupd_settings.start_update) {
++ printf("Starting image copy to staging area.....\n");
+ update_processing_status(IMG_VALIDATING, 0);
+-
+- rc = verify_image();
++ u8 update_intent = 0x00;
++ if ((g_fwupd_settings.options_mask &
++ g_fwupd_settings.options_value) & DEFER_BMC_RESET)
++ update_intent |= DEFER_UPDATES_TO_RESET;
++
++ ulong offset =
++ get_flash_region_offset(g_img_info.img_type);
++ ulong max_size =
++ get_image_max_size(g_img_info.img_type);
++ ulong src_addr = IMAGE_LOAD_RAM_ADDR;
++ ulong flash_addr = PFR_IMAGE_STAGING_BASE_ADDR + offset;
++
++ debug("FWUPD: offset:0x%08lx, max_size:0x%08lx, "
++ "src_addr:0x%08lx, flash_addr:0x%08lx\n",
++ offset, max_size, src_addr, flash_addr);
++
++ rc = verify_image(src_addr, g_img_info.img_length);
+ if (rc != 0) {
++ printf("Image verification failed.\n");
+ update_processing_status(UPDATE_ERROR, 100);
+ /* Adding delay to make consumer gets status */
+ mdelay(WAIT_STATE_TIMEOUT);
+@@ -441,31 +428,46 @@ void start_fw_update_loop(void)
+ reset_all_settings();
+ continue;
+ }
++ printf("Image verification success.\n");
+
+ update_processing_status(IMG_PROGRAMMING, 10);
+
+- rc = flash_image();
++ rc = flash_image(src_addr, flash_addr, max_size,
++ g_img_info.img_length);
+ if (rc == 0) {
+- /* Update successful, change the boot command */
+- boot_addr = get_flash_image_address();
+- snprintf(boot_cmd, sizeof(boot_cmd),
+- "bootm %08x", boot_addr);
+- setenv("bootcmd", boot_cmd);
+- saveenv();
++ update_processing_status(IMG_PROGRAMMING, 90);
++ } else {
++ update_processing_status(UPDATE_ERROR, 100);
++ }
+
++ printf("Image copy to staging area %s.\n",
++ ((rc == 0) ? "successful" : "failed"));
++
++ /* Set the BMC update intent BIT to CPLD register */
++ update_intent != get_update_intent(g_img_info.img_type);
++
++ /* TODO: We ned a way to protect the staging area from
++ * next write data. After setting cpld intent bit, CPLD
++ * read the stagging region for associated image types
++ * and update active/recovery area. During this stage,
++ * staging area should be protected from next write.
++ * Working with CPLD team for identifying this state. */
++ if (0 != set_cpld_reg(PFR_CPLD_BMC_UPDATE_INTENT_REG,
++ update_intent)) {
++ update_processing_status(UPDATE_ERROR, 100);
++ } else {
++ printf("CPLD: Update intent set successfully.\n");
+ update_processing_status(UPDATE_SUCCESSFUL,
+ 100);
+- } else {
+- update_processing_status(UPDATE_ERROR, 100);
++
++ if (update_intent & DEFER_UPDATES_TO_RESET)
++ printf("CPLD: Update defered to next reset.\n");
+ }
+
+ /* Adding delay to make sure consumer gets status */
+ mdelay(WAIT_STATE_TIMEOUT);
+-
+ reset_all_settings();
+
+- /* Reset BMC */
+- do_reset(NULL, 0, 0, NULL);
+ }
+ mdelay(WAIT_STATE_TIMEOUT);
+ }
+diff --git a/board/aspeed/ast-g5/fw-update.h b/board/aspeed/ast-g5/fw-update.h
+index ed033ad..45e46ba 100644
+--- a/board/aspeed/ast-g5/fw-update.h
++++ b/board/aspeed/ast-g5/fw-update.h
+@@ -28,6 +28,12 @@ enum update_status {
+ UPDATE_FORBIDDEN = 0x80,
+ AC_CYCLE_REQUIRED = 0x83
+ };
++enum update_options {
++ NO_DOWN_REVISION = BIT(0),
++ DEFER_BMC_RESET = BIT(1),
++ SHA32_INTEGRITY_CHECK = BIT(2),
++ CRC32_INTEGRITY_CHECK = BIT(3)
++};
+
+ struct fwupd_global_setting {
+ bool fwupd_mode_active;
+@@ -48,3 +54,4 @@ bool fwupd_settings_trylock(void);
+ void fwupd_settings_unlock(void);
+ u8 get_active_boot_image(void);
+ int generate_random_number(void);
++
+diff --git a/board/aspeed/ast-g5/ipmi-fwupd.c b/board/aspeed/ast-g5/ipmi-fwupd.c
+index 3eba056..6afc8d6 100644
+--- a/board/aspeed/ast-g5/ipmi-fwupd.c
++++ b/board/aspeed/ast-g5/ipmi-fwupd.c
+@@ -2,10 +2,14 @@
+ // Copyright (c) 2018-2019 Intel Corporation
+
+ #include "ipmi-fwupd.h"
++#include "pfr-mgr.h"
+
+ struct fwupd_global_setting g_fwupd_settings;
+ u32 g_write_addr = 0;
+
++struct fwupd_image_info g_img_info;
++static bool block0_mapped = false;
++
+ u16 fwupd_get_execution_ctx(u8 *req, u16 req_len, u8 *res)
+ {
+ int booting_image = 0x01;
+@@ -395,6 +399,39 @@ u16 fwupd_image_write(u8 *req, u16 req_len, u8 *res)
+ memcpy(mem_addr, req, req_len);
+ g_write_addr += req_len;
+
++ /* Get the PFR block 0 data and read the uploaded image
++ * information( Image type, length, hash etc) */
++ if ((g_write_addr >= sizeof(struct pfr_image_block0)) &&
++ (!block0_mapped)) {
++ struct pfr_image_block0 *block0_data =
++ (struct pfr_image_block0 *)IMAGE_LOAD_RAM_ADDR;
++ u32 magic_num = (u32)((*block0_data->tag) |
++ LSH(*(block0_data->tag + 1), 8) |
++ LSH(*(block0_data->tag + 2), 16) |
++ LSH(*(block0_data->tag + 3), 24));
++ /* Validate the magic number */
++ if (magic_num != PFR_BLOCK0_MAGIC_NUM) {
++ result->completion_code = IPMI_CC_INVALID_DATA_LENGTH;
++ return sizeof(result->completion_code);
++ }
++
++ /* Fill the image info structure for later use */
++ g_img_info.magic_num = magic_num;
++ g_img_info.img_length =
++ (u32)((*block0_data->pc_length) |
++ LSH(*(block0_data->pc_length + 1), 8) |
++ LSH(*(block0_data->pc_length + 2), 16) |
++ LSH(*(block0_data->pc_length + 3), 24));
++ g_img_info.img_type =
++ (u32)((*block0_data->pc_type) |
++ LSH(*(block0_data->pc_type + 1), 8) |
++ LSH(*(block0_data->pc_type + 2), 16) |
++ LSH(*(block0_data->pc_type + 3), 24));
++ /* Add Authentication data struct length for full image */
++ g_img_info.img_length += PFR_AUTH_DATA_STRUCT_LEN;
++ block0_mapped = true;
++ }
++
+ result->completion_code = IPMI_CC_OK;
+ result->no_of_bytes_written = (u8)req_len;
+
+diff --git a/board/aspeed/ast-g5/ipmi-fwupd.h b/board/aspeed/ast-g5/ipmi-fwupd.h
+index e490f6b..7409d2e 100644
+--- a/board/aspeed/ast-g5/ipmi-fwupd.h
++++ b/board/aspeed/ast-g5/ipmi-fwupd.h
+@@ -19,12 +19,6 @@ enum control_state_bit {
+ IMG_TRANSFER_CTRL_BIT_ABORT = (0x01 << 2),
+ USB_CTRL_BIT_ATTACH = (0x01 << 3)
+ };
+-enum update_options_bit {
+- NO_DOWN_REVISION = 0,
+- DEFER_BMC_RESET = 1,
+- SHA32_INTEGRITY_CHECK = 2,
+- CRC32_INTEGRITY_CHECK = 3
+-};
+
+ struct fwupd_get_exe_ctx_res {
+ u8 completion_code;
+diff --git a/board/aspeed/ast-g5/pfr-mgr.c b/board/aspeed/ast-g5/pfr-mgr.c
+new file mode 100644
+index 0000000..7713168
+--- /dev/null
++++ b/board/aspeed/ast-g5/pfr-mgr.c
+@@ -0,0 +1,73 @@
++// SPDX-License-Identifier: GPL-2.0+
++// Copyright (c) 2018-2019 Intel Corporation
++
++#include "pfr-mgr.h"
++
++int set_cpld_reg(u8 reg_addr, u8 value)
++{
++ int ret = 0;
++ int chip = (PFR_CPLD_SLAVE_ADDR >> 1);
++
++ /* Get current I2C bus number to restore later. */
++ int current_bus_no = i2c_get_bus_num();
++
++ /* Set I2C bus number to PFR CPLD I2C bus. */
++ ret = i2c_set_bus_num(PFR_CPLD_I2C_BUSNO);
++ if (ret) {
++ printf("Failed to change I2C bus number (%d)\n", ret);
++ goto done;
++ }
++
++ ret = i2c_write(chip, reg_addr, 1, &value, 1);
++ if (ret) {
++ printf("Error writing the chip: %d\n", ret);
++ goto done;
++ }
++
++done:
++ /* Restore I2C bus number */
++ if (i2c_set_bus_num(current_bus_no))
++ printf("Failed to restore I2C bus number.\n");
++
++ return ret;
++}
++
++ulong get_update_intent(u32 type)
++{
++ ulong intent = 0;
++ if (type == PFR_CPLD_UPDATE_CAPSULE)
++ intent = CPLD_IMAGE_UPDATE;
++ else if (type == PFR_PCH_UPDATE_CAPSULE)
++ intent = PCH_SPI_FLASH_ACTIVE;
++ else if (type == PFR_BMC_UPDATE_CAPSULE)
++ intent = BMC_SPI_FLASH_ACTIVE;
++
++ return intent;
++}
++
++ulong get_image_max_size(u32 type)
++{
++ ulong max_size = MAX_BMC_IMAGE_SIZE;
++ if (type == PFR_CPLD_UPDATE_CAPSULE)
++ max_size = MAX_CPLD_IMAGE_SIZE;
++ else if (type == PFR_PCH_UPDATE_CAPSULE)
++ max_size = MAX_BIOS_IMAGE_SIZE;
++ else if (type == PFR_BMC_UPDATE_CAPSULE)
++ max_size = MAX_BMC_IMAGE_SIZE;
++
++ return max_size;
++}
++
++ulong get_flash_region_offset(u32 type)
++{
++ ulong offset = 0;
++ if (type == PFR_CPLD_UPDATE_CAPSULE)
++ offset = PFR_CPLD_IMAGE_REGION_OFFSET;
++ else if (type == PFR_PCH_UPDATE_CAPSULE)
++ offset = PFR_BIOS_IMAGE_REGION_OFFSET;
++ else if (type == PFR_BMC_UPDATE_CAPSULE)
++ offset = PFR_BMC_IMAGE_REGION_OFFSET;
++
++ return offset;
++}
++
+diff --git a/board/aspeed/ast-g5/pfr-mgr.h b/board/aspeed/ast-g5/pfr-mgr.h
+new file mode 100644
+index 0000000..b2368e1
+--- /dev/null
++++ b/board/aspeed/ast-g5/pfr-mgr.h
+@@ -0,0 +1,67 @@
++// SPDX-License-Identifier: GPL-2.0+
++// Copyright (c) 2018-2019 Intel Corporation
++
++#include <common.h>
++
++/* CPLD I2C device defines */
++#define PFR_CPLD_I2C_BUSNO 4
++#define PFR_CPLD_SLAVE_ADDR 0xE0
++
++/* CPLD registers */
++#define PFR_CPLD_BMC_UPDATE_INTENT_REG 0x13
++
++#define PFR_BLOCK0_MAGIC_NUM 0xB6EAFD19
++#define PFR_AUTH_DATA_STRUCT_LEN 1024 /* Block0 & Block1 */
++
++/* SPI Flash MAP */
++#define PFR_IMAGE_STAGING_BASE_ADDR 0x24A00000 /* 54MB */
++#define MAX_BMC_IMAGE_SIZE 0x2000000 /* 32MB */
++#define MAX_BIOS_IMAGE_SIZE 0x1000000 /* 16MB */
++#define MAX_CPLD_IMAGE_SIZE 0x400000 /* 4MB */
++#define PFR_BMC_IMAGE_REGION_OFFSET 0
++#define PFR_BIOS_IMAGE_REGION_OFFSET \
++ (PFR_BMC_IMAGE_REGION_OFFSET + MAX_BMC_IMAGE_SIZE)
++#define PFR_CPLD_IMAGE_REGION_OFFSET \
++ (PFR_BIOS_IMAGE_REGION_OFFSET + MAX_BIOS_IMAGE_SIZE)
++
++#define LSH(data, num) ((data) << (num))
++
++/* Bit mapping for CPLD 'BMC update intent' */
++enum cpld_update_intent {
++ PCH_SPI_FLASH_ACTIVE = BIT(0),
++ PCH_SPI_FLASH_RECOVERY = BIT(1),
++ CPLD_IMAGE_UPDATE = BIT(2),
++ BMC_SPI_FLASH_ACTIVE = BIT(3),
++ BMC_SPI_FLASH_RECOVERY = BIT(4),
++ DEFER_UPDATES_TO_RESET = BIT(7)
++};
++
++enum pfr_block0_pc_type {
++ PFR_CPLD_UPDATE_CAPSULE = 0x00,
++ PFR_PCH_PFM = 0x01,
++ PFR_PCH_UPDATE_CAPSULE = 0x02,
++ PFR_BMC_PFM = 0x03,
++ PFR_BMC_UPDATE_CAPSULE = 0x04
++};
++
++/* PFR image block 0 - As defined in HAS */
++struct pfr_image_block0 {
++ u8 tag[4];
++ u8 pc_length[4];
++ u8 pc_type[4];
++ u8 reserved_1[4];
++ u8 hash_256[32];
++ u8 hash_384[48];
++ u8 reserved_2[32];
++};
++
++struct fwupd_image_info {
++ u32 magic_num;
++ u32 img_length;
++ u32 img_type;
++};
++
++int set_cpld_reg(u8 reg_addr, u8 value);
++ulong get_update_intent(u32 type);
++ulong get_flash_region_offset(u32 type);
++ulong get_image_max_size(u32 type);
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
index acac46d70..5d8c10a76 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
@@ -31,8 +31,15 @@ SRC_URI_append_intel-ast2500 = " \
file://0027-CPLD-u-boot-commands-support-for-PFR.patch \
file://0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch \
file://0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch \
+ file://0030-Support-Get-Set-Security-mode-command.patch \
+ file://0031-Make-it-so-TFTP-port-can-be-modified.patch \
"
-SRC_URI_append_intel-ast2500 += "${@bb.utils.contains('IMAGE_TYPE', 'pfr', 'file://0022-u-boot-env-change-for-PFR-image.patch', '', d)}"
+PFR_SRC_URI = " \
+ file://0022-u-boot-env-change-for-PFR-image.patch \
+ file://0032-Adding-PFR-boot-flow-checkpoint-in-u-boot.patch \
+ file://0033-PFR-firmware-update-support-in-u-boot.patch \
+ "
+SRC_URI_append_intel-ast2500 += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', PFR_SRC_URI, '', d)}"
require recipes-core/os-release/version-vars.inc
diff --git a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_%.bbappend b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_%.bbappend
index acac46d70..5d8c10a76 100644
--- a/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_%.bbappend
@@ -31,8 +31,15 @@ SRC_URI_append_intel-ast2500 = " \
file://0027-CPLD-u-boot-commands-support-for-PFR.patch \
file://0028-Enabling-uart1-uart2-in-u-boot-for-BIOS-messages.patch \
file://0029-FFUJ-FW-IPMI-commands-and-flash-support-in-u-boot.patch \
+ file://0030-Support-Get-Set-Security-mode-command.patch \
+ file://0031-Make-it-so-TFTP-port-can-be-modified.patch \
"
-SRC_URI_append_intel-ast2500 += "${@bb.utils.contains('IMAGE_TYPE', 'pfr', 'file://0022-u-boot-env-change-for-PFR-image.patch', '', d)}"
+PFR_SRC_URI = " \
+ file://0022-u-boot-env-change-for-PFR-image.patch \
+ file://0032-Adding-PFR-boot-flow-checkpoint-in-u-boot.patch \
+ file://0033-PFR-firmware-update-support-in-u-boot.patch \
+ "
+SRC_URI_append_intel-ast2500 += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', PFR_SRC_URI, '', d)}"
require recipes-core/os-release/version-vars.inc
diff --git a/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.service b/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.service
new file mode 100644
index 000000000..de607f1a7
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Check for AC boot
+After=settings.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/ac-boot-check.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.sh b/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.sh
new file mode 100644
index 000000000..38728b512
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check/ac-boot-check.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [[ `cat /proc/cmdline` =~ "resetreason=0x11" ]]
+then
+ busctl set-property xyz.openbmc_project.Settings /xyz/openbmc_project/control/host0/ac_boot xyz.openbmc_project.Common.ACBoot ACBoot s "True"
+else
+ busctl set-property xyz.openbmc_project.Settings /xyz/openbmc_project/control/host0/ac_boot xyz.openbmc_project.Common.ACBoot ACBoot s "False"
+fi
diff --git a/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check_git.bb b/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check_git.bb
new file mode 100644
index 000000000..2a30696dc
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/ac-boot-check/ac-boot-check_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = "AC Boot Check"
+DESCRIPTION = "Script to check the resetreason for AC boot"
+
+S = "${WORKDIR}"
+SRC_URI = "file://ac-boot-check.sh \
+ file://ac-boot-check.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}/ac-boot-check.service"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/ac-boot-check.service ${D}${systemd_system_unitdir}
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/ac-boot-check.sh ${D}/${bindir}/ac-boot-check.sh
+}
+
+SYSTEMD_SERVICE_${PN} += " ac-boot-check.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug.bb b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug.bb
index 37ad5667f..5576c84c7 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug.bb
+++ b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug.bb
@@ -14,7 +14,7 @@ do_configure[depends] += "virtual/kernel:do_shared_workdir"
SRC_URI = "git://git@github.com/Intel-BMC/at-scale-debug;protocol=ssh"
-SRCREV = "3369d2e81f7e5e4bcb5d9e14bcecea7ae5da07fb"
+SRCREV = "bf2736cb1c8959164f989f59c4337a0ff108b13f"
S = "${WORKDIR}/git"
SYSTEMD_SERVICE_${PN} += "com.intel.AtScaleDebug.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/com.intel.AtScaleDebug.service b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/com.intel.AtScaleDebug.service
index 744982703..a7c238ffe 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/com.intel.AtScaleDebug.service
+++ b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/files/com.intel.AtScaleDebug.service
@@ -5,7 +5,7 @@ Requires=network-online.target
[Service]
Restart=always
RestartSec=30
-ExecStart={bindir}/asd -k /home/root/server.pem
+ExecStart={bindir}/asd
Type=simple
SyslogIdentifier=asd
diff --git a/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb b/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb
index 8f876cc9c..63f65e03d 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb
@@ -4,14 +4,14 @@ inherit obmc-phosphor-systemd
SUMMARY = "CPU Crashdump"
DESCRIPTION = "CPU utilities for dumping CPU Crashdump and registers over PECI"
-DEPENDS = "boost cjson sdbusplus "
+DEPENDS = "boost cjson sdbusplus safec "
inherit cmake
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
SRC_URI = "git://git@github.com/Intel-BMC/at-scale-debug;protocol=ssh"
-SRCREV = "3369d2e81f7e5e4bcb5d9e14bcecea7ae5da07fb"
+SRCREV = "bf2736cb1c8959164f989f59c4337a0ff108b13f"
S = "${WORKDIR}/git/crashdump"
PACKAGES += "libpeci"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb b/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb
index 08d0057ef..d7595696e 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb
+++ b/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb
@@ -11,12 +11,12 @@ RDEPENDS_intel-fw-update += "dosfstools parted"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
-PFR_EN = "${@bb.utils.contains('IMAGE_TYPE', 'pfr', 'pfr', '', d)}"
+PFR_EN = "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'pfr', '', d)}"
SRC_URI += "file://fwupd.sh"
SRC_URI += "file://usb-ctrl"
-FILES_${PN} += "${@bb.utils.contains('IMAGE_TYPE', 'pfr', '${datadir}/pfr', '', d)}"
+FILES_${PN} += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', '${datadir}/pfr', '', d)}"
do_install() {
install -d ${D}${bindir}
diff --git a/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb b/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb
new file mode 100644
index 000000000..1733ac428
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb
@@ -0,0 +1,14 @@
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+inherit cmake systemd
+
+SRC_URI = "git://git@github.com/Intel-BMC/at-scale-debug;protocol=ssh"
+
+DEPENDS = "boost sdbusplus libgpiod"
+
+PV = "0.1+git${SRCPV}"
+SRCREV = "bf2736cb1c8959164f989f59c4337a0ff108b13f"
+
+S = "${WORKDIR}/git/host_error_monitor"
+
+SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.HostErrorMonitor.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/.clang-format b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/.clang-format
new file mode 100644
index 000000000..86a2a9d63
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/.clang-format
@@ -0,0 +1,21 @@
+---
+BasedOnStyle: LLVM
+Language: Cpp
+IndentWidth: 8
+UseTab: Always
+BreakBeforeBraces: Linux
+AlwaysBreakBeforeMultilineStrings: true
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: false
+IndentCaseLabels: false
+AlignEscapedNewlinesLeft: false
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AlignAfterOpenBracket: true
+SpaceAfterCStyleCast: false
+MaxEmptyLinesToKeep: 2
+BreakBeforeBinaryOperators: NonAssignment
+BreakStringLiterals: false
+SortIncludes: true
+ContinuationIndentWidth: 8
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch
new file mode 100644
index 000000000..8bb9ce485
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch
@@ -0,0 +1,36 @@
+From 21f2f29129a7eba8aecdf07875004bafc6a74269 Mon Sep 17 00:00:00 2001
+From: James Feist <james.feist@linux.intel.com>
+Date: Thu, 20 Jun 2019 08:58:44 -0700
+Subject: [PATCH] Add smbus support to Cmake Lists
+
+This adds smbus changes needed for libmctp.
+
+Change-Id: I06fc950337e6f3d5b1cef0fb445be2d448d49e44
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a5b1042..04c4bdf 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
+ add_definitions (-DMCTP_LOG_STDERR)
+ add_definitions (-DMCTP_FILEIO)
+
+-add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
++add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c smbus.c)
+
+ target_include_directories (libmctp PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+@@ -18,5 +18,5 @@ add_executable (test_seq tests/test_seq.c tests/test-utils.c)
+ target_link_libraries (test_seq libmctp)
+
+ install (TARGETS libmctp DESTINATION lib)
+-install (FILES libmctp.h DESTINATION include)
++install (FILES libmctp.h libmctp-smbus.h libmctp-serial.h DESTINATION include)
+
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.c b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.c
new file mode 100644
index 000000000..0d5090e2c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.c
@@ -0,0 +1,93 @@
+#include "crc32c.h"
+/*****************************************************************/
+/* */
+/* CRC LOOKUP TABLE */
+/* ================ */
+/* The following CRC lookup table was generated automagically */
+/* by the Rocksoft^tm Model CRC Algorithm Table Generation */
+/* Program V1.0 using the following model parameters: */
+/* */
+/* Width : 4 bytes. */
+/* Poly : 0x1EDC6F41L */
+/* Reverse : TRUE. */
+/* */
+/* For more information on the Rocksoft^tm Model CRC Algorithm, */
+/* see the document titled "A Painless Guide to CRC Error */
+/* Detection Algorithms" by Ross Williams */
+/* (ross@guest.adelaide.edu.au.). This document is likely to be */
+/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */
+/* */
+/*****************************************************************/
+
+unsigned long crctable[256] = {
+ 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 0xC79A971FL,
+ 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 0x8AD958CFL, 0x78B2DBCCL,
+ 0x6BE22838L, 0x9989AB3BL, 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L,
+ 0x5E133C24L, 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL,
+ 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, 0x9A879FA0L,
+ 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, 0x5D1D08BFL, 0xAF768BBCL,
+ 0xBC267848L, 0x4E4DFB4BL, 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L,
+ 0x33ED7D2AL, 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L,
+ 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, 0x6DFE410EL,
+ 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, 0x30E349B1L, 0xC288CAB2L,
+ 0xD1D83946L, 0x23B3BA45L, 0xF779DEAEL, 0x05125DADL, 0x1642AE59L,
+ 0xE4292D5AL, 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL,
+ 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, 0x417B1DBCL,
+ 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, 0x86E18AA3L, 0x748A09A0L,
+ 0x67DAFA54L, 0x95B17957L, 0xCBA24573L, 0x39C9C670L, 0x2A993584L,
+ 0xD8F2B687L, 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L,
+ 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, 0x96BF4DCCL,
+ 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, 0xDBFC821CL, 0x2997011FL,
+ 0x3AC7F2EBL, 0xC8AC71E8L, 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L,
+ 0x0F36E6F7L, 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L,
+ 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, 0xEB1FCBADL,
+ 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, 0x2C855CB2L, 0xDEEEDFB1L,
+ 0xCDBE2C45L, 0x3FD5AF46L, 0x7198540DL, 0x83F3D70EL, 0x90A324FAL,
+ 0x62C8A7F9L, 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L,
+ 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, 0x3CDB9BDDL,
+ 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, 0x82F63B78L, 0x709DB87BL,
+ 0x63CD4B8FL, 0x91A6C88CL, 0x456CAC67L, 0xB7072F64L, 0xA457DC90L,
+ 0x563C5F93L, 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L,
+ 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, 0x92A8FC17L,
+ 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, 0x55326B08L, 0xA759E80BL,
+ 0xB4091BFFL, 0x466298FCL, 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL,
+ 0x0B21572CL, 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L,
+ 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, 0x65D122B9L,
+ 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, 0x2892ED69L, 0xDAF96E6AL,
+ 0xC9A99D9EL, 0x3BC21E9DL, 0xEF087A76L, 0x1D63F975L, 0x0E330A81L,
+ 0xFC588982L, 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL,
+ 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, 0x38CC2A06L,
+ 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, 0xFF56BD19L, 0x0D3D3E1AL,
+ 0x1E6DCDEEL, 0xEC064EEDL, 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L,
+ 0xD0DDD530L, 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL,
+ 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, 0x8ECEE914L,
+ 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, 0xD3D3E1ABL, 0x21B862A8L,
+ 0x32E8915CL, 0xC083125FL, 0x144976B4L, 0xE622F5B7L, 0xF5720643L,
+ 0x07198540L, 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L,
+ 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, 0xE330A81AL,
+ 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, 0x24AA3F05L, 0xD6C1BC06L,
+ 0xC5914FF2L, 0x37FACCF1L, 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L,
+ 0x7AB90321L, 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL,
+ 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, 0x34F4F86AL,
+ 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, 0x79B737BAL, 0x8BDCB4B9L,
+ 0x988C474DL, 0x6AE7C44EL, 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L,
+ 0xAD7D5351L};
+
+/*****************************************************************/
+/* End of CRC Lookup Table */
+/*****************************************************************/
+
+uint32_t crc32c(uint8_t *data, int length)
+{
+ const uint32_t CRC_INIT = 0xffffffffL;
+ const uint32_t XO_ROT = 0xffffffffL;
+
+ uint32_t crc = CRC_INIT;
+
+ while (length--) {
+ crc = crctable[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
+ }
+ crc = crc ^ XO_ROT;
+
+ return crc;
+}
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h
new file mode 100644
index 000000000..d6b1d11e2
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h
@@ -0,0 +1,9 @@
+#ifndef CRC32C_H
+#define CRC32C_H
+
+#include <stdint.h>
+#include <stdlib.h>
+
+uint32_t crc32c(uint8_t *buf, int len);
+
+#endif /* CRC32C_H */
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h
new file mode 100644
index 000000000..b3beadb0c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: Apache-2.0 */
+
+#ifndef _LIBMCTP_SMBUS_H
+#define _LIBMCTP_SMBUS_H
+
+#include "libmctp.h"
+
+struct mctp_binding_smbus;
+
+struct mctp_binding_smbus *mctp_smbus_init(void);
+int mctp_smbus_get_out_fd(struct mctp_binding_smbus *smbus);
+int mctp_smbus_get_in_fd(struct mctp_binding_smbus *smbus);
+void mctp_smbus_register_bus(struct mctp_binding_smbus *smbus,
+ struct mctp *mctp, mctp_eid_t eid);
+int mctp_smbus_read(struct mctp_binding_smbus *smbus);
+int mctp_smbus_open_bus(struct mctp_binding_smbus *smbus, int out_bus_num,
+ int root_bus_num);
+#endif /* _LIBMCTP_SMBUS_H */
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c
new file mode 100644
index 000000000..8679a5185
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c
@@ -0,0 +1,293 @@
+/* SPDX-License-Identifier: Apache-2.0 */
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef MCTP_FILEIO
+#include <fcntl.h>
+#endif
+
+#define pr_fmt(x) "smbus: " x
+
+#include <i2c/smbus.h>
+#include <linux/i2c-dev.h>
+#include <linux/i2c.h>
+#include <sys/ioctl.h>
+
+#include "libmctp-alloc.h"
+#include "libmctp-log.h"
+#include "libmctp-smbus.h"
+#include "libmctp.h"
+
+struct mctp_binding_smbus {
+ struct mctp_binding binding;
+ struct mctp *mctp;
+ int out_fd;
+ int in_fd;
+
+ unsigned long bus_id;
+
+ /* receive buffer */
+ uint8_t rxbuf[1024];
+ struct mctp_pktbuf *rx_pkt;
+
+ /* temporary transmit buffer */
+ uint8_t txbuf[256];
+};
+
+#ifndef container_of
+#define container_of(ptr, type, member) \
+ (type *)((char *)(ptr) - (char *)&((type *)0)->member)
+#endif
+
+#define binding_to_smbus(b) container_of(b, struct mctp_binding_smbus, binding)
+
+#define MCTP_COMMAND_CODE 0x0F
+#define MCTP_SLAVE_ADDRESS 0x1d
+#define MCTP_SOURCE_SLAVE_ADDRESS 0x21
+
+#define SMBUS_PEC_BYTE_SIZE 1
+
+struct mctp_smbus_header_tx {
+ uint8_t source_slave_address;
+};
+
+struct mctp_smbus_header_rx {
+ uint8_t destination_slave_address;
+ uint8_t command_code;
+ uint8_t byte_count;
+ uint8_t source_slave_address;
+};
+
+static int mctp_binding_smbus_tx(struct mctp_binding *b,
+ struct mctp_pktbuf *pkt)
+{
+ struct mctp_binding_smbus *smbus = binding_to_smbus(b);
+ struct mctp_smbus_header_tx *hdr;
+ uint8_t *buf;
+ size_t len;
+ int r;
+ struct i2c_msg msg;
+ struct i2c_rdwr_ioctl_data data;
+
+ data.msgs = &msg;
+ data.nmsgs = 1;
+
+ uint16_t timeout = 1000;
+ int i;
+
+ /* the length field in the header excludes smbus framing
+ * and escape sequences */
+ len = mctp_pktbuf_size(pkt);
+
+ hdr = (void *)smbus->txbuf;
+
+ // hdr->len = len + 1; // +1 for PET byte
+ hdr->source_slave_address = MCTP_SOURCE_SLAVE_ADDRESS;
+
+ buf = (void *)(hdr + sizeof(*hdr));
+
+ if (len + sizeof(*hdr) > sizeof(smbus->txbuf))
+ return -1;
+
+ memcpy(buf, &pkt->data[pkt->start], len);
+
+ buf += len;
+
+ if (ioctl(smbus->out_fd, I2C_SLAVE, MCTP_SLAVE_ADDRESS) < 0) {
+ mctp_prerr("Can't set slave");
+ return -1;
+ }
+ if (ioctl(smbus->out_fd, I2C_PEC, 1) < 0) {
+ mctp_prerr("Cant set PEC byte");
+ return -1;
+ }
+
+ if (i2c_smbus_write_block_data(smbus->out_fd, MCTP_COMMAND_CODE,
+ sizeof(*hdr) + len, (void *)smbus->txbuf)
+ < 0) {
+ mctp_prerr("Failed to send");
+ return -1;
+ }
+
+ return 0;
+}
+
+#ifdef MCTP_FILEIO
+int mctp_smbus_read(struct mctp_binding_smbus *smbus)
+{
+ ssize_t len;
+ int r;
+ struct mctp_smbus_header_rx *hdr;
+
+ r = lseek(smbus->in_fd, 0, SEEK_SET);
+ if (r < 0) {
+ mctp_prerr("Failed to seek");
+ return -1;
+ }
+ len = read(smbus->in_fd, smbus->rxbuf, sizeof(smbus->rxbuf));
+ if (len < sizeof(*hdr)) {
+ // TODO Don't return an error here, as it seems to happen from
+ // time to time, even with a properly written poll loop,
+ // although it's not clear why.
+ return 0;
+ }
+
+ hdr = (void *)smbus->rxbuf;
+ if (hdr->destination_slave_address
+ != (MCTP_SOURCE_SLAVE_ADDRESS & ~1)) {
+ mctp_prerr("Got bad slave address %d",
+ hdr->destination_slave_address);
+ return 0;
+ }
+ if (hdr->command_code != MCTP_COMMAND_CODE) {
+ mctp_prerr("Got bad command code %d", hdr->command_code);
+ // Not a payload intended for us
+ return 0;
+ }
+
+ if (hdr->byte_count != (len - sizeof(*hdr))) {
+ // Got an incorrectly sized payload
+ mctp_prerr("Got smbus payload sized %d, expecting %d",
+ hdr->byte_count, len - sizeof(*hdr));
+ return 0;
+ }
+
+ if (len < 0) {
+ mctp_prerr("can't read from smbus device: %m");
+ return -1;
+ }
+
+ smbus->rx_pkt = mctp_pktbuf_alloc(0);
+ assert(smbus->rx_pkt);
+
+ if (mctp_pktbuf_push(smbus->rx_pkt, &smbus->rxbuf[sizeof(*hdr)],
+ len - sizeof(*hdr) - SMBUS_PEC_BYTE_SIZE)
+ != 0) {
+ mctp_prerr("Can't push tok pktbuf: %m");
+ return -1;
+ }
+
+ mctp_bus_rx(&(smbus->binding), smbus->rx_pkt);
+
+ mctp_pktbuf_free(smbus->rx_pkt);
+ smbus->rx_pkt = NULL;
+
+ return 0;
+}
+
+int mctp_smbus_get_in_fd(struct mctp_binding_smbus *smbus)
+{
+ return smbus->in_fd;
+}
+
+int mctp_smbus_get_out_fd(struct mctp_binding_smbus *smbus)
+{
+ return smbus->out_fd;
+}
+
+int mctp_smbus_open_bus(struct mctp_binding_smbus *smbus, int out_bus_num,
+ int root_bus_num)
+{
+ char filename[60];
+ size_t filename_size;
+ char slave_mqueue[20];
+ size_t mqueue_size;
+
+ int fd;
+
+ size_t size;
+ int address_7_bit;
+
+ address_7_bit = MCTP_SOURCE_SLAVE_ADDRESS >> 1;
+ size = sizeof(filename);
+ snprintf(filename, size,
+ "/sys/bus/i2c/devices/i2c-%d/%d-%04x/slave-mqueue",
+ root_bus_num, root_bus_num,
+ (address_7_bit << 8) + address_7_bit);
+
+ smbus->in_fd = open(filename, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
+ if (smbus->in_fd < 0) {
+ // Device doesn't exist. Create it.
+ filename_size = sizeof(filename);
+ snprintf(filename, filename_size,
+ "/sys/bus/i2c/devices/i2c-%d/new_device",
+ root_bus_num);
+ filename[filename_size - 1] = '\0';
+
+ fd = open(filename, O_WRONLY);
+ if (fd < 0) {
+ mctp_prerr("can't open root device %s: %m", filename);
+ return -1;
+ }
+
+ mqueue_size = sizeof(slave_mqueue);
+ snprintf(slave_mqueue, mqueue_size, "slave-mqueue %#04x",
+ (address_7_bit << 8) + address_7_bit);
+
+ size = write(fd, slave_mqueue, mqueue_size);
+ close(fd);
+ if (size != mqueue_size) {
+ mctp_prerr("can't create mqueue device on %s: %m",
+ filename);
+ return -1;
+ }
+
+ size = sizeof(filename);
+ snprintf(filename, size,
+ "/sys/bus/i2c/devices/i2c-%d/%d-%04x/slave-mqueue",
+ root_bus_num, root_bus_num,
+ (address_7_bit << 8) + address_7_bit);
+
+ smbus->in_fd =
+ open(filename, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
+ if (smbus->in_fd < 0) {
+ mctp_prerr("can't open mqueue device on %s: %m",
+ filename);
+ return -2;
+ }
+ }
+
+ size = sizeof(filename);
+ snprintf(filename, size, "/dev/i2c-%d", out_bus_num);
+ filename[size - 1] = '\0';
+
+ smbus->out_fd = open(filename, O_RDWR | O_NONBLOCK);
+ if (smbus->out_fd < 0) {
+ close(smbus->in_fd);
+ mctp_prerr("can't open device %s: %m", filename);
+ }
+
+ return 0;
+}
+
+#endif
+
+void mctp_smbus_register_bus(struct mctp_binding_smbus *smbus,
+ struct mctp *mctp, mctp_eid_t eid)
+{
+ assert(smbus->out_fd >= 0);
+ assert(smbus->in_fd >= 0);
+ smbus->mctp = mctp;
+ smbus->bus_id = mctp_register_bus(mctp, &smbus->binding, eid);
+}
+
+struct mctp_binding_smbus *mctp_smbus_init(void)
+{
+ struct mctp_binding_smbus *smbus;
+
+ smbus = __mctp_alloc(sizeof(*smbus));
+ smbus->in_fd = -1;
+ smbus->out_fd = -1;
+
+ smbus->rx_pkt = NULL;
+ smbus->binding.name = "smbus";
+ smbus->binding.version = 1;
+
+ smbus->binding.tx = mctp_binding_smbus_tx;
+
+ return smbus;
+}
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb
new file mode 100644
index 000000000..d9359cfeb
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb
@@ -0,0 +1,30 @@
+SUMMARY = "libmctp"
+DESCRIPTION = "Implementation of MCTP (DTMF DSP0236)"
+
+SRC_URI = "git://github.com/openbmc/libmctp.git"
+SRCREV = "195a7c5e212f7fb50c850880519073ec99133607"
+
+PV = "0.1+git${SRCPV}"
+
+LICENSE = "Apache-2.0 | GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0d30807bb7a4f16d36e96b78f9ed8fae"
+
+inherit cmake
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "i2c-tools"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-Add-smbus-support-to-Cmake-Lists.patch \
+ file://crc32c.c \
+ file://crc32c.h \
+ file://libmctp-smbus.h \
+ file://smbus.c"
+
+do_configure_prepend() {
+ cp -f ${WORKDIR}/*.c ${S}
+ cp -f ${WORKDIR}/*.h ${S}
+}
+
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 70533e540..e79a42fcd 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
@@ -1,2 +1,2 @@
SRC_URI = "git://github.com/openbmc/intel-ipmi-oem.git"
-SRCREV = "ba9c1765f5edc2f0891e012f33b3059a0dbd7ff1"
+SRCREV = "6ae0818f82bcfc6c5568dd2107d0656da5410f61"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/ipmi/ipmi-providers.bb b/meta-openbmc-mods/meta-common/recipes-core/ipmi/ipmi-providers.bb
index b5448060f..7f6d406d4 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/ipmi/ipmi-providers.bb
+++ b/meta-openbmc-mods/meta-common/recipes-core/ipmi/ipmi-providers.bb
@@ -2,7 +2,7 @@ SUMMARY = "Intel IPMI Providers"
DESCRIPTION = "IPMI Provider Libraries"
SRC_URI = "git://git@github.com/Intel-BMC/intel-ipmi-providers;protocol=ssh"
-SRCREV = "3f8aa7959d2e8475e50743d32ff178257aafc1e7"
+SRCREV = "b2c6184269e3bdf601c38f716ac7ee73379af71b"
S = "${WORKDIR}/git"
PV = "0.1+git${SRCPV}"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/libxcrypt/libxcrypt_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/libxcrypt/libxcrypt_%.bbappend
new file mode 100644
index 000000000..ee414efb8
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/libxcrypt/libxcrypt_%.bbappend
@@ -0,0 +1,5 @@
+# libxcrypt fails to compile under gcc with the -Os flag. Because we want to
+# be able to compile the rest of the system with -Os, override the global
+# setting here to fall back to -O3
+CFLAGS_append = "--param max-inline-insns-single=1000"
+FULL_OPTIMIZATION = "-O3 -pipe ${DEBUG_FLAGS}"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb b/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb
index 5061e1e56..01ef73964 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb
@@ -10,7 +10,7 @@ SRC_URI = "git://git@github.com/Intel-BMC/at-scale-debug;protocol=ssh"
DEPENDS = "boost sdbusplus crashdump"
PV = "0.1+git${SRCPV}"
-SRCREV = "3369d2e81f7e5e4bcb5d9e14bcecea7ae5da07fb"
+SRCREV = "bf2736cb1c8959164f989f59c4337a0ff108b13f"
S = "${WORKDIR}/git/peci_pcie"
diff --git a/meta-openbmc-mods/meta-common/recipes-core/safec/safec_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/safec/safec_%.bbappend
new file mode 100644
index 000000000..4ce29534d
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/safec/safec_%.bbappend
@@ -0,0 +1,11 @@
+RDEPENDS_${PN} = ""
+do_install_append() {
+ F=$(find ${D} -name check_for_unsafe_apis)
+ if [ -n "${F}" ]; then
+ # remove the unused perl script
+ rm -f "${F}"
+ # remove the script's destination directory, only if it is empty
+ rmdir "$(dirname ${F})" 2>/dev/null || :
+ fi
+}
+
diff --git a/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb b/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb
new file mode 100644
index 000000000..a6d94fc51
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Safe C Library"
+
+LICENSE = "safec"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6d0eb7dfc57806a006fcbc4e389cf164"
+SECTION = "lib"
+
+inherit autotools pkgconfig
+
+S = "${WORKDIR}/git"
+SRCREV = "f1708afcbba69f75e80920b75aa3d7baee3f611d"
+SRC_URI = "git://github.com/rurban/safeclib.git"
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|powerpc64|arm|aarch64).*-linux'
+
+RDEPENDS_${PN} = "perl"
diff --git a/meta-openbmc-mods/meta-common/recipes-devtools/python/python_%.bbappend b/meta-openbmc-mods/meta-common/recipes-devtools/python/python_%.bbappend
new file mode 100644
index 000000000..00815c173
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-devtools/python/python_%.bbappend
@@ -0,0 +1,7 @@
+# This commit pulls in the python world, and adds a very large chunk to our
+# image size. I suspect we can make most of our things rely on python-core
+# instead of full python, but this is a temporary fix.
+# https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f384e39ad1ca1514fb7b5d7fa0d63e0c863761ca
+
+RPROVIDES_${PN}-core = "${PN}"
+RPROVIDES_${PN}-modules = ""
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy.bbappend
deleted file mode 100644
index 58512234d..000000000
--- a/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://rsyslog-override.conf \
-"
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy/rsyslog-override.conf b/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog-override.conf
index 14bcc0781..14bcc0781 100644
--- a/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog-policy/rsyslog-override.conf
+++ b/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog-override.conf
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
index 03a81e2cb..15e557c79 100644
--- a/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
@@ -12,13 +12,19 @@ SRC_URI += "file://rsyslog.conf \
file://rsyslog.logrotate \
file://rotate-event-logs.service \
file://rotate-event-logs.timer \
+ file://rsyslog-override.conf \
"
+FILES_${PN} += "${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf"
+
PACKAGECONFIG_append = " imjournal"
do_install_append() {
install -m 0644 ${WORKDIR}/rotate-event-logs.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/rotate-event-logs.timer ${D}${systemd_system_unitdir}
+ install -d ${D}${systemd_system_unitdir}/rsyslog.service.d
+ install -m 0644 ${WORKDIR}/rsyslog-override.conf \
+ ${D}${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf
rm ${D}${sysconfdir}/rsyslog.d/imjournal.conf
}
diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend
index af5fa8b05..a7fefea96 100644
--- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend
@@ -1,4 +1,4 @@
#SRC_URI += "git://github.com/openbmc/sdbusplus"
-SRCREV = "f8bbf17c3db879359b0984b40250e4db3d274be1"
+SRCREV = "4212292bcf136d04b38ba5116aa568b0fa312798"
diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver/0001-rfbserver-add-a-hooking-function-to-deliver-rfbFrame.patch b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver/0001-rfbserver-add-a-hooking-function-to-deliver-rfbFrame.patch
deleted file mode 100644
index 6dd1c93f0..000000000
--- a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver/0001-rfbserver-add-a-hooking-function-to-deliver-rfbFrame.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 6d7c437f4d111ed183627c11e9bfc77ad2abc752 Mon Sep 17 00:00:00 2001
-From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
-Date: Thu, 9 May 2019 15:33:55 -0700
-Subject: [PATCH] rfbserver: add a hooking function to deliver
- rfbFramebufferUpdateRequest messages.
-
-This commit adds a hooking function to deliver
-rfbFramebufferUpdateRequest messages from clients to the frame
-producer for a case the producer needs to handle the messages for
-flow control or etc.
----
- libvncserver/rfbserver.c | 2 ++
- rfb/rfb.h | 5 +++++
- 2 files changed, 7 insertions(+)
-
-diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
-index 42209cf29a0d..3a546f2ed330 100644
---- a/libvncserver/rfbserver.c
-+++ b/libvncserver/rfbserver.c
-@@ -2381,6 +2381,8 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
- return;
- }
-
-+ if (cl->clientFURHook)
-+ cl->clientFURHook(cl, &msg.fur);
-
- tmpRegion =
- sraRgnCreateRect(msg.fur.x,
-diff --git a/rfb/rfb.h b/rfb/rfb.h
-index 2a5600e25375..1a2294428288 100644
---- a/rfb/rfb.h
-+++ b/rfb/rfb.h
-@@ -412,6 +412,8 @@ typedef struct sraRegion* sraRegionPtr;
- */
-
- typedef void (*ClientGoneHookPtr)(struct _rfbClientRec* cl);
-+typedef void (*ClientFURHookPtr)(struct _rfbClientRec* cl,
-+ rfbFramebufferUpdateRequestMsg* furMsg);
-
- typedef struct _rfbFileTransferData {
- int fd;
-@@ -457,6 +459,9 @@ typedef struct _rfbClientRec {
- void* clientData;
- ClientGoneHookPtr clientGoneHook;
-
-+ /** clientFURHook is called when a client requests a frame buffer update. */
-+ ClientFURHookPtr clientFURHook;
-+
- SOCKET sock;
- char *host;
-
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend
index e367e97b9..0d9012235 100644
--- a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend
@@ -2,6 +2,4 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
# Use the latest to support obmc-ikvm properly
#SRC_URI = "git://github.com/LibVNC/libvncserver"
-SRCREV = "f12b14f275f019673b3ace8fa4d46c8a79beb388"
-
-SRC_URI += "file://0001-rfbserver-add-a-hooking-function-to-deliver-rfbFrame.patch"
+SRCREV = "091b9eb739a95c8c969e2e6865c255b0d170f95f"
diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch
index 1340e845b..70f2da4a0 100644
--- a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch
+++ b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch
@@ -1,4 +1,4 @@
-From 336d0e9163a027b2b35ed240c2995f06684637b8 Mon Sep 17 00:00:00 2001
+From 88337ce8246a453cd3c6e60e96aead43549a5e1d Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Date: Thu, 9 May 2019 16:26:53 -0700
Subject: [PATCH] Add flow control to prevent buffer over run
@@ -31,12 +31,12 @@ resolves https://github.com/openbmc/bmcweb/issues/80
Change-Id: I6b09a711137d15a38fce59adada9bf3d00afde86
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
- ikvm_server.cpp | 19 +++++++++++++++++++
- ikvm_server.hpp | 10 ++++++++++
- 2 files changed, 29 insertions(+)
+ ikvm_server.cpp | 20 ++++++++++++++++++++
+ ikvm_server.hpp | 11 +++++++++++
+ 2 files changed, 31 insertions(+)
diff --git a/ikvm_server.cpp b/ikvm_server.cpp
-index 35310da292be..363eab7e000d 100644
+index 35310da292be..dfafe3a82e64 100644
--- a/ikvm_server.cpp
+++ b/ikvm_server.cpp
@@ -119,6 +119,12 @@ void Server::sendFrame()
@@ -52,13 +52,14 @@ index 35310da292be..363eab7e000d 100644
if (cl->enableLastRectEncoding)
{
fu->nRects = 0xFFFF;
-@@ -149,6 +155,18 @@ void Server::sendFrame()
+@@ -149,6 +155,19 @@ void Server::sendFrame()
rfbReleaseClientIterator(it);
}
-+void Server::clientFUR(rfbClientPtr cl, rfbFramebufferUpdateRequestMsg* furMsg)
++void Server::clientFramebufferUpdateRequest(
++ rfbClientPtr cl, rfbFramebufferUpdateRequestMsg *furMsg)
+{
-+ ClientData* cd = (ClientData*)cl->clientData;
++ ClientData *cd = (ClientData *)cl->clientData;
+
+ if (!cd)
+ return;
@@ -71,16 +72,16 @@ index 35310da292be..363eab7e000d 100644
void Server::clientGone(rfbClientPtr cl)
{
Server* server = (Server*)cl->screen->screenData;
-@@ -170,6 +188,7 @@ enum rfbNewClientAction Server::newClient(rfbClientPtr cl)
+@@ -170,6 +189,7 @@ enum rfbNewClientAction Server::newClient(rfbClientPtr cl)
cl->clientData =
new ClientData(server->video.getFrameRate(), &server->input);
cl->clientGoneHook = clientGone;
-+ cl->clientFURHook = clientFUR;
++ cl->clientFramebufferUpdateRequestHook = clientFramebufferUpdateRequest;
if (!server->numClients++)
{
server->pendingResize = false;
diff --git a/ikvm_server.hpp b/ikvm_server.hpp
-index b8062017b8ca..e51e57a19722 100644
+index b8062017b8ca..ebe4ad2b287e 100644
--- a/ikvm_server.hpp
+++ b/ikvm_server.hpp
@@ -32,6 +32,7 @@ class Server
@@ -99,7 +100,7 @@ index b8062017b8ca..e51e57a19722 100644
};
/*
-@@ -85,6 +87,14 @@ class Server
+@@ -85,6 +87,15 @@ class Server
private:
/*
@@ -108,8 +109,9 @@ index b8062017b8ca..e51e57a19722 100644
+ * @param[in] cl - Handle to the client object
+ * @param[in] furMsg - Pointer of the FUR message
+ */
-+ static void clientFUR(rfbClientPtr cl,
-+ rfbFramebufferUpdateRequestMsg* furMsg);
++ static void
++ clientFramebufferUpdateRequest(rfbClientPtr cl,
++ rfbFramebufferUpdateRequestMsg *furMsg);
+ /*
* @brief Handler for a client disconnecting
*
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control.bb b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control.bb
index 4b11782e8..ea7579cb3 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control.bb
+++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control.bb
@@ -2,7 +2,7 @@ SUMMARY = "Chassis Power Control service for Intel based platform"
DESCRIPTION = "Chassis Power Control service for Intel based platfrom"
SRC_URI = "git://git@github.com/Intel-BMC/intel-chassis-control.git;protocol=ssh"
-SRCREV = "d98b80a3ce937abe6282b7b9011b47e8b2f162be"
+SRCREV = "8d7026c078d79d5e60e7938e4e5f08bb7966ebbd"
S = "${WORKDIR}/git/services/chassis/"
@@ -22,8 +22,3 @@ DEPENDS += " \
sdbusplus \
phosphor-logging \
"
-
-# linux-libc-headers guides this way to include custom uapi headers
-CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi"
-CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include"
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/images/intel-platforms.bb b/meta-openbmc-mods/meta-common/recipes-intel/images/intel-platforms.bb
index 276e549b9..545ecae7f 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/images/intel-platforms.bb
+++ b/meta-openbmc-mods/meta-common/recipes-intel/images/intel-platforms.bb
@@ -3,6 +3,10 @@ DESCRIPTION = "Image with Intel content based upon Phosphor, an OpenBMC framewor
inherit obmc-phosphor-full-fitimage
inherit obmc-phosphor-image-common
inherit obmc-phosphor-image-dev
+inherit ${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'image_types_intel_pfr', '', d)}
+
+DEPENDS += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'obmc-intel-pfr-image-native', '', d)}"
+DEPENDS += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'intel-pfr-manager', '', d)}"
FEATURE_PACKAGES_obmc-sensors = ""
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/blocksign b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/blocksign
new file mode 100755
index 000000000..69d51d2ba
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/blocksign
Binary files differ
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/bmc_config.xml b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/bmc_config.xml
new file mode 100644
index 000000000..89c3d30ca
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/bmc_config.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- XML file for Block Sign Tool -->
+<blocksign>
+ <!-- Block 0 -->
+ <block0>
+ <magic>0xB6EAFD19</magic>
+ <pctype>4</pctype>
+ </block0>
+ <!-- Block 1 -->
+ <block1>
+ <magic>0xF27F28D7</magic>
+ <!-- Root key -->
+ <rkey>
+ <magic>0xA757A046</magic>
+ <curvemagic>0xC7B88C74</curvemagic>
+ <permissions>-1</permissions>
+ <keyid>-1</keyid>
+ <pubkey>rk_pub.pem</pubkey>
+ </rkey>
+ <!-- Code signing key -->
+ <cskey>
+ <magic>0x14711C2F</magic>
+ <curvemagic>0xC7B88C74</curvemagic>
+ <permissions>8</permissions>
+ <keyid>1</keyid>
+ <pubkey>csk_pub.pem</pubkey>
+ <sigmagic>0xDE64437D</sigmagic>
+ <hashalg>sha256</hashalg>
+ <signkey>rk_prv.pem</signkey>
+ <!--<script>./sign_external.sh</script>-->
+ </cskey>
+ <!-- Signature over Block 0 -->
+ <b0_sig>
+ <magic>0x15364367</magic>
+ <sigmagic>0xDE64437D</sigmagic>
+ <hashalg>sha256</hashalg>
+ <signkey>csk_prv.pem</signkey>
+ </b0_sig>
+ </block1>
+ <!-- CPLD Bitstream Specific -->
+ <padding>
+ <!-- Pad block1 such that combined block length is 1024b -->
+ <blockpad>1024</blockpad>
+ <!-- Align total package to 128 bytes -->
+ <align>128</align>
+ </padding>
+</blocksign>
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_prv.pem b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_prv.pem
new file mode 100644
index 000000000..a46fa2a2b
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_prv.pem
@@ -0,0 +1,8 @@
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIFjPqxcb6tfFWyFVaQCVjeN9MtcISpYIbNlkQoODrHTUoAoGCCqGSM49
+AwEHoUQDQgAERGJveRnhIp7I5cvmjO74MJLbUJjTfvTDKlzK0hJB0WRBEFScpb9d
+xWLrwj9TNcO+EexnNcjEkF1RYNs6lHavRQ==
+-----END EC PRIVATE KEY-----
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_pub.pem b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_pub.pem
new file mode 100644
index 000000000..cc70d6e28
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/csk_pub.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERGJveRnhIp7I5cvmjO74MJLbUJjT
+fvTDKlzK0hJB0WRBEFScpb9dxWLrwj9TNcO+EexnNcjEkF1RYNs6lHavRQ==
+-----END PUBLIC KEY-----
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfm_config.xml b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfm_config.xml
new file mode 100644
index 000000000..215fe8783
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfm_config.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- XML file for Block Sign Tool -->
+<blocksign>
+ <!-- Block 0 -->
+ <block0>
+ <magic>0xB6EAFD19</magic>
+ <pctype>3</pctype>
+ </block0>
+ <!-- Block 1 -->
+ <block1>
+ <magic>0xF27F28D7</magic>
+ <!-- Root key -->
+ <rkey>
+ <magic>0xA757A046</magic>
+ <curvemagic>0xC7B88C74</curvemagic>
+ <permissions>-1</permissions>
+ <keyid>-1</keyid>
+ <pubkey>rk_pub.pem</pubkey>
+ </rkey>
+ <!-- Code signing key -->
+ <cskey>
+ <magic>0x14711C2F</magic>
+ <curvemagic>0xC7B88C74</curvemagic>
+ <permissions>4</permissions>
+ <keyid>1</keyid>
+ <pubkey>csk_pub.pem</pubkey>
+ <sigmagic>0xDE64437D</sigmagic>
+ <hashalg>sha256</hashalg>
+ <signkey>rk_prv.pem</signkey>
+ <!--<script>./sign_external.sh</script>-->
+ </cskey>
+ <!-- Signature over Block 0 -->
+ <b0_sig>
+ <magic>0x15364367</magic>
+ <sigmagic>0xDE64437D</sigmagic>
+ <hashalg>sha256</hashalg>
+ <signkey>csk_prv.pem</signkey>
+ </b0_sig>
+ </block1>
+ <!-- CPLD Bitstream Specific -->
+ <padding>
+ <!-- Pad block1 such that combined block length is 1024b -->
+ <blockpad>1024</blockpad>
+ <!-- Align total package to 128 bytes -->
+ <align>128</align>
+ </padding>
+</blocksign>
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image-manifest.json b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image-manifest.json
new file mode 100644
index 000000000..7890aa700
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image-manifest.json
@@ -0,0 +1,63 @@
+{
+ "image-parts": [{
+ "name": "u-boot",
+ "index": 0,
+ "offset": "0",
+ "size": "0x80000",
+ "prot_mask": 31,
+ "pfm": 1,
+ "hash": 1,
+ "compress": 1
+ },
+ {
+ "name": "pfm",
+ "index": 1,
+ "offset": "0x80000",
+ "size": "0x20000",
+ "prot_mask": 31,
+ "pfm": 1,
+ "hash": 0,
+ "compress": 0
+ },
+ {
+ "name": "u-boot-env",
+ "index": 2,
+ "offset": "0xa0000",
+ "size": "0x20000",
+ "prot_mask": 29,
+ "pfm": 1,
+ "hash": 0,
+ "compress": 0
+ },
+ {
+ "name": "sofs",
+ "index": 3,
+ "offset": "0xc0000",
+ "size": "0x200000",
+ "prot_mask": 29,
+ "pfm": 1,
+ "hash": 0,
+ "compress": 0
+ },
+ {
+ "name": "rwfs",
+ "index": 4,
+ "offset": "0x2c0000",
+ "size": "0x840000",
+ "prot_mask": 29,
+ "pfm": 1,
+ "hash": 0,
+ "compress": 0
+ },
+ {
+ "name": "fit-image-a",
+ "index": 5,
+ "offset": "0xb00000",
+ "size": "0x1f00000",
+ "prot_mask": 31,
+ "pfm": 1,
+ "hash": 1,
+ "compress": 1
+ }
+ ]
+} \ No newline at end of file
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
new file mode 100755
index 000000000..e1a23c172
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/pfr_image.py
@@ -0,0 +1,311 @@
+#/usr/bin/env python3
+# coding: utf-8
+# our image is contained as parts, including the hash
+# then it gets zipped up and signed again
+
+# this internal signature is for boot and recovery, but
+# will be checked prior to writing to flash as well.
+
+# the internal signature format is a PFR-specific block
+# including a hash bitmap, certificates (public keys),
+# and the actual signature data as well, for both active
+# and recovery images
+
+# TODO: figure out if active and recovery actually have different sigs
+# TODO: build hashmap from payload manifest
+# TODO: figure out exact struct layout for PFR metadata
+
+import os, hashlib, struct, json, sys, subprocess, mmap, io, array, binascii, copy, shutil, re
+from array import array
+from binascii import unhexlify
+from six import b, print_, binary_type
+from hashlib import sha1, sha256, sha512
+from shutil import copyfile
+# Flash Map
+# -----------------------------------------------
+# Start addr Contents
+# 0x00000000 S U-Boot
+# 0x00080000 S+ PFM
+# 0x000a0000 U U-boot Env
+# 0x000C0000 U SOFS
+# 0x002c0000 U RWFS
+# 0x00b00000 S fit-image
+# 0x02a00000 S+ rc-image
+# 0x04a00000 U staging-image
+# * partially signed (not full 64k page)
+# + unsigned, owned by pfr
+
+# TODO: The below defines should go to manifest files.
+# Keeping it here hard coded for now.
+# The pages to be skipped for HASH and PBC
+# Pages: 0x80 to 0xaff - starting PFM region until fit-image
+# Pages: 0x2a00 to 0x7FFF - starting RC-image until end of flash
+EXCLUDE_PAGES =[[0x80, 0xaff],[0x2a00,0x7fff]]
+
+# SPI PFM globals
+PFM_OFFSET = 0x80000
+PFM_SPI = 0x1
+SHA256 = 0x1
+SHA256_SIZE = 32
+PFM_DEF_SIZE = 16
+PFM_SPI_SIZE_DEF = 16 # 16 bytes of SPI PFM
+PFM_SPI_SIZE_HASH = 32 # 32 bytes of SPI region HASH
+
+PAGE_SIZE = 0x1000 # 4KB size of page
+
+def load_manifest(fname):
+ manifest = {}
+ with open(fname, 'r') as fd:
+ manifest = json.load(fd)
+ return manifest
+
+class pfm_spi(object):
+
+ def __init__(self, prot_mask, start_addr, end_addr, hash, hash_pres):
+ self.pfm = PFM_SPI
+ self.prot_mask = prot_mask
+ self.hash_pres = hash_pres
+ if hash_pres == 1:
+ self.spi_hash = hash
+ self.pfm_rsvd = 0xffffffff #b'\xff'*4
+ self.start_addr = start_addr
+ self.end_addr = end_addr
+
+
+class pfr_bmc_image(object):
+
+# json_file, update_file
+ def __init__(self, manifest, update_file, build_ver, build_num, build_hash):
+
+ self.manifest = load_manifest(manifest)
+ self.update_file = update_file
+ self.build_version = build_ver
+ self.build_number = build_num
+ self.build_hash = build_hash
+
+ self.pfr_rom_file = 'image-mtd-pfr'
+ open(self.pfr_rom_file, 'a').close()
+
+ self.page_size = PAGE_SIZE
+ self.empty = b'\xff' * self.page_size
+
+ self.image_parts = []
+ for p in self.manifest['image-parts']:
+ # the json should have in the order- filename, index, offset, size and protection byte
+ self.image_parts.append((p['name'], p['index'], p['offset'], p['size'], p['prot_mask'], p['pfm'], p['hash'], p['compress']))
+ print(self.image_parts)
+
+ self.act_dgst = hashlib.sha256()
+
+ # SPI regions PFM array
+ self.pfm_spi_regions = []
+ self.pfm_bytes = PFM_DEF_SIZE # PFM definition bytes (SPI regions + SMBUS)
+
+ # hash, erase and compression bit maps for 128MB
+ self.pbc_erase_bitmap = bytearray(4096)
+ self.pbc_comp_bitmap = bytearray(4096)
+
+ self.pbc_comp_payload = 0
+ self.sec_rev = 1
+
+ # fill in the calculated data
+ self.hash_and_map()
+
+ def hash_compress_regions(self, p, upd):
+
+ # JSON format as below
+ # 0. "name": <image region name>
+ # 1. "index": 1,
+ # 2. "offset": <start addr>,
+ # 3. "size": <size of the region>,
+ # 4. "prot_mask": <PFR protection mask>,
+ # 5. "pfm": <1|0 -add in PFM or not>,
+ # 6. "hash": <hashing of the region needed>,
+ # 7. "compress": <region to be compressed>
+
+ image_name = p[0]
+ start_addr = int(p[2],16) #image part start address
+ size = int(p[3],16) #size of the image part
+ pfm_prot_mask = p[4] # pfm protection mask
+ pfm_flag = p[5] # pfm needed?
+ hash_flag = p[6] #to be hashed?
+ compress = p[7] #compress flag
+ index = p[1] # image part index
+ # 1 page is 4KB
+ page = start_addr >> 12
+
+ if hash_flag == 1:
+ with open(self.update_file, "rb") as f:
+ f.seek(start_addr)
+ skip = False
+ # HASH for the region
+ hash_dgst = hashlib.sha256()
+ for chunk in iter(lambda: f.read(self.page_size), b''):
+ chunk_len = len(chunk)
+ if chunk_len != self.page_size:
+ chunk = b''.join([chunk, b'\xff' * (self.page_size - chunk_len)])
+
+ for p in EXCLUDE_PAGES:
+ if (page >= p[0]) and (page <= p[1]):
+ print("Exclude page={}".format(page))
+ skip = True
+ break
+
+ if not skip:
+ # add to the hash
+ self.act_dgst.update(chunk)
+ hash_dgst.update(chunk)
+ self.pbc_erase_bitmap[page >> 3] |= 1 << (7- (page % 8)) # Big endian bit map
+
+ if compress == 1:
+ # add to the pbc map
+ if chunk != self.empty:
+ print("compressed page ={}".format(page))
+ upd.write(chunk)
+ self.pbc_comp_bitmap[page >> 3] |= 1 << (7- (page % 8)) # Big Endian bit map
+ self.pbc_comp_payload += chunk_len # compressed payload bytes
+
+ page += 1
+
+ if (page * self.page_size) >= (size + start_addr):
+ break
+
+ if pfm_flag == 1:
+ self.pfm_bytes += PFM_SPI_SIZE_DEF
+
+ hash = b'\x00' * 32
+ hash_pres = 0
+
+ if hash_flag == 1:
+ # region's hash
+ hash = hash_dgst.hexdigest()
+ hash_pres = SHA256
+ self.pfm_bytes += PFM_SPI_SIZE_HASH
+
+ # append to SPI regions in PFM
+ self.pfm_spi_regions.append(pfm_spi(pfm_prot_mask, start_addr, (start_addr+size), hash, hash_pres))
+
+ def hash_and_map(self):
+
+ # have copy of the update file for appending with PFR meta and compression
+ copyfile(self.update_file, self.pfr_rom_file)
+ with open("bmc_compressed.bin", "wb+") as upd:
+ for p in self.image_parts:
+ #filename, index, offset, size, protection.
+ print(p[0], p[1], p[2], p[3], p[4])
+ self.hash_compress_regions(p, upd)
+
+ # Generate PFM region binary - pfm.bin
+ self.build_pfm()
+ print("PFM build done")
+
+ # Generate PBC region - pbc.bin
+ self.pbc_hdr()
+ print("PBC build done")
+
+ def pbc_hdr(self):
+ '''
+ typedef struct {
+ uint8_t tag[4]; /* PBC tag */
+ uint32_t version; /* PBC Version- 0x0000_0002 */
+ uint32_t page_size; /* NOR Flash page size = 0x0000_1000 */
+ uint32_t pattern_size; /* 0xFF as pattern 1byte = 0x0000_0001 */
+ uint32_t pattern; /* 0xFF pattern = 0x0000_00FF */
+ uint32_t bitmap_size; /* 32768 pages for 128MB- 0x0000_8000 */
+ uint32_t payload_length /* payload */
+ uint8_t reserved[100]; /* Reserved 100bytes */
+ uint8_t erase_bitmap[4096]; /* erase bit map for 32768 pages */
+ uint8_t comp_bitmap[4096]; /* compression bit map for 32768 pages */
+ uint8_t comp_payload; /* compressed payload */
+ '''
+ names = [
+ 'tag', 'pbc_ver', 'page_sz', 'pattern_sz', 'pattern', 'bitmap_sz',
+ 'payload_size', 'resvd0', 'erase_bitmap', 'comp_bitmap',
+ ]
+ parts = {
+ 'tag': b'CBP_',
+ 'pbc_ver': struct.pack('<i',0x00000002),
+ 'page_sz': struct.pack('<i',0x00001000),
+ 'pattern_sz': struct.pack('<i',0x00000001),
+ 'pattern': struct.pack('<i',0x000000FF),
+ 'bitmap_sz': struct.pack('<i',0x00008000),
+ 'payload_size': struct.pack('<i',self.pbc_comp_payload),
+ 'resvd0' : b'\x00'*100,
+ 'erase_bitmap': bytes(self.pbc_erase_bitmap),
+ 'comp_bitmap': bytes(self.pbc_comp_bitmap),
+ }
+
+ with open("pbc.bin", "wb+") as pbf:
+ pbf.write(b''.join([parts[n] for n in names]))
+ pbf.seek(0) # rewind to beginning of PBC file
+ self.act_dgst.update(pbf.read()) # add up PBC data for hashing
+
+ def build_pfm(self):
+ '''
+ typedef struct {
+ uint32_t tag; /* PFM_HDR_TAG above, no terminating null */
+ uint8_t sec_revision; /* SVN- security revision of associated image data */
+ uint8_t pfm_ver_major; /* PFM revision */
+ uint8_t pfm_ver_minor;
+ uint8_t build_num;
+ uint8_t build_hash[3];
+ uint8_t reserved0; /* reserved */
+ uint32_t pfm_length; /* PFM size in bytes */
+ pfm_spi pfm_spi[2]; /* PFM SPI regions - u-boot & fit-image */
+ pfm_smbus pfm_smbus[4]; /* defined smbus rules for PSUs and HSBP */
+ } __attribute__((packed)) pfm_hdr;
+ '''
+ names = [
+ 'tag', 'sec_rev', 'pfm_ver_major', 'pfm_ver_minor', 'build_num', 'build_hash1', 'build_hash2', 'build_hash3', 'resvd0', 'pfm_len',
+ ]
+ parts = {
+ 'tag': struct.pack("<I", 0x02b3ce1d),
+ 'sec_rev': struct.pack('<B', self.sec_rev),
+ 'pfm_ver_major': struct.pack('<B', ((int(self.build_version) >> 8) & 0xff)),
+ 'pfm_ver_minor': struct.pack('<B', (int(self.build_version) & 0x00ff)),
+ 'build_num': struct.pack('<B', int(self.build_number,16)),
+ 'build_hash1': struct.pack('<B', int(self.build_hash) & 0xff),
+ 'build_hash2': struct.pack('<B', (int(self.build_hash) >> 8) & 0xff),
+ 'build_hash3': struct.pack('<B', (int(self.build_hash) >> 16) & 0xff),
+ 'resvd0': b'\xff'* 1,
+ 'pfm_len': ''
+ }
+
+ # PFM should be 128bytes aligned, find the padding bytes
+ padding_bytes = 128 - (self.pfm_bytes % 128)
+ self.pfm_bytes += padding_bytes
+ parts['pfm_len'] = struct.pack('<I', self.pfm_bytes)
+ print("PFM size={}".format(self.pfm_bytes))
+
+ with open("pfm.bin", "wb+") as f:
+ f.write(b''.join([parts[n] for n in names]))
+ for i in self.pfm_spi_regions:
+ f.write(struct.pack('b', int(i.pfm)))
+ f.write(struct.pack('b', int(i.prot_mask)))
+ f.write(struct.pack('h', int(i.hash_pres)))
+ f.write(struct.pack('<I', int(i.pfm_rsvd)))
+ f.write(struct.pack('<I', int(i.start_addr)))
+ f.write(struct.pack('<I', int(i.end_addr)))
+
+ if i.hash_pres == 1:
+ f.write(i.spi_hash.decode('hex'))
+
+ # write the padding bytes at the end
+ f.write(b'\xff' * padding_bytes)
+
+def main():
+ if len(sys.argv) != 6: #< pfr_image.py manifest.json> <update.bin> <build_version> <build_number> <build_hash>
+ print('usage: {} <manifest.json> <update.bin> <build_version> <build_number> <build_hash>'.format(sys.argv[0]))
+ return
+
+ json_file = sys.argv[1]
+ update_file = sys.argv[2]
+ build_ver = sys.argv[3]
+ build_num = sys.argv[4]
+ build_hash = sys.argv[5]
+
+ # function to generate BMC PFM, PBC header and BMC compressed image
+ pfr_bmc_image(json_file, update_file, build_ver, build_num, build_hash)
+
+if __name__ == '__main__':
+ main()
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_prv.pem b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_prv.pem
new file mode 100644
index 000000000..9e8616795
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_prv.pem
@@ -0,0 +1,8 @@
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIHVbq5CmT4Vr4Jb0eJK0+KhUxDOWy1kh9QYAClV5MH1GoAoGCCqGSM49
+AwEHoUQDQgAEZUL6ZcF0YN590Pq/bKPYjfa3F4E44XiKcqvS6+l2GfSdCLRhXWHw
+iV803vFkTsZ1CfpzFdZGwfbwg7nvG5UpSQ==
+-----END EC PRIVATE KEY-----
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_pub.pem b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_pub.pem
new file mode 100644
index 000000000..117e08bae
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/files/rk_pub.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZUL6ZcF0YN590Pq/bKPYjfa3F4E4
+4XiKcqvS6+l2GfSdCLRhXWHwiV803vFkTsZ1CfpzFdZGwfbwg7nvG5UpSQ==
+-----END PUBLIC KEY-----
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-pfr-manager_git.bb b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-pfr-manager_git.bb
new file mode 100644
index 000000000..ebebe43bb
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-pfr-manager_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Intel PFR Manager Service"
+DESCRIPTION = "Daemon to handle all PFR functionalities"
+
+PV = "1.0+git${SRCPV}"
+
+S = "${WORKDIR}/git/intel-pfr-manager"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
+
+inherit cmake systemd
+SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Intel.PFR.Manager.service"
+
+DEPENDS += " \
+ sdbusplus \
+ phosphor-logging \
+ boost \
+ i2c-tools \
+ "
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/obmc-intel-pfr-image-native.bb b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/obmc-intel-pfr-image-native.bb
new file mode 100644
index 000000000..ee2cc3934
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/obmc-intel-pfr-image-native.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Intel PFR manifest and signing key for development and testing"
+DESCRIPTION = "Do not use this signing keys to sign CI and release images."
+
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit native
+
+PFR_KEY_NAME ?= "pfr-dev-key"
+PFR_SIGN_UTIL ?= "blocksign"
+
+SRC_URI = " \
+ file://pfr_image-manifest.json \
+ file://pfr_image.py \
+ file://blocksign \
+ file://pfm_config.xml \
+ file://bmc_config.xml \
+ file://csk_prv.pem \
+ file://csk_pub.pem \
+ file://rk_pub.pem \
+ file://rk_prv.pem \
+ "
+
+do_install() {
+ bbplain "Copying the intel pfr image generation scripts and image signing keys"
+
+ install -d ${STAGING_DIR}/intel-pfr-files
+ install -m 400 ${WORKDIR}/pfr_image-manifest.json ${STAGING_DIR}/intel-pfr-files
+ install -m 775 ${WORKDIR}/blocksign ${STAGING_DIR}/intel-pfr-files
+ install -m 400 ${WORKDIR}/pfm_config.xml ${STAGING_DIR}/intel-pfr-files
+ install -m 400 ${WORKDIR}/bmc_config.xml ${STAGING_DIR}/intel-pfr-files
+ install -m 775 ${WORKDIR}/pfr_image.py ${STAGING_DIR}/intel-pfr-files
+ install -m 400 ${WORKDIR}/csk_prv.pem ${STAGING_DIR}/intel-pfr-files/
+ install -m 400 ${WORKDIR}/csk_pub.pem ${STAGING_DIR}/intel-pfr-files/
+ install -m 400 ${WORKDIR}/rk_pub.pem ${STAGING_DIR}/intel-pfr-files/
+ install -m 400 ${WORKDIR}/rk_prv.pem ${STAGING_DIR}/intel-pfr-files/
+}
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/ipccli/ipccli_svn.bb b/meta-openbmc-mods/meta-common/recipes-intel/ipccli/ipccli_svn.bb
new file mode 100644
index 000000000..ce7d79975
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-intel/ipccli/ipccli_svn.bb
@@ -0,0 +1,14 @@
+SUMMARY = "ipccli"
+HOMEPAGE = "https://www.intel.com"
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = ""
+
+SRC_URI[md5sum] = "917092bfe4244aa4312b572c2c9c303f"
+SRC_URI = "svn://ssvn.pdx.intel.com/deg/pve/csv/pythonsv/subprojects/;module=ipccli;rev=804701;protocol=https;user=etanous;pswd=Cardinal2bali!"
+
+DEPENDS_${PN} += "python-setuptools-native"
+
+S = "${WORKDIR}/ipccli/trunk"
+inherit setuptools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-intel-apps.bb b/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-intel-apps.bb
index 923133be7..06cc3b972 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-intel-apps.bb
+++ b/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-intel-apps.bb
@@ -36,8 +36,4 @@ RDEPENDS_${PN}-fans = " \
"
SUMMARY_${PN}-flash = "Intel Flash"
-RDEPENDS_${PN}-flash = " \
- obmc-flash-bmc \
- obmc-mgr-download \
- obmc-control-bmc \
- "
+RDEPENDS_${PN}-flash = ""
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-obmc-apps.bbappend b/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-obmc-apps.bbappend
index c71e84bdc..d3b283202 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-intel/packagegroups/packagegroup-obmc-apps.bbappend
@@ -1,3 +1 @@
-# this is for image signing and signature verification
-RDEPENDS_${PN}-extras += "${@bb.utils.contains('IMAGE_TYPE', 'pfr', ' phosphor-image-signing', '', d)}"
RDEPENDS_${PN}-extrasdevtools = "libgpiod-tools"
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/psu-manager/psu-manager.bb b/meta-openbmc-mods/meta-common/recipes-intel/psu-manager/psu-manager.bb
index 24a8c668b..63576a3de 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/psu-manager/psu-manager.bb
+++ b/meta-openbmc-mods/meta-common/recipes-intel/psu-manager/psu-manager.bb
@@ -1,7 +1,7 @@
SUMMARY = "Power supply manager for Intel based platform"
DESCRIPTION = "Power supply manager which include PSU Cold Redundancy service"
-SRC_URI = "git://git-amr-2.devtools.intel.com:29418/openbmc-provingground.git;protocol=ssh;nobranch=1"
+SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh;nobranch=1"
SRCREV = "fe33964c744f871f3e024dd8d0b6ffba67394c30"
S = "${WORKDIR}/git/psu-manager/"
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv1.bb b/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv1.bb
index c37ea66e1..84d5a9831 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv1.bb
+++ b/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv1.bb
@@ -2,7 +2,7 @@ SUMMARY = "SMBIOS MDR version 1 service for Intel based platform"
DESCRIPTION = "SMBIOS MDR version 1 service for Intel based platfrom"
SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
S = "${WORKDIR}/git/services/smbios/"
diff --git a/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb b/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb
index a41cdb50b..bc0538b04 100644
--- a/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb
+++ b/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb
@@ -2,7 +2,7 @@ SUMMARY = "SMBIOS MDR version 2 service for Intel based platform"
DESCRIPTION = "SMBIOS MDR version 2 service for Intel based platfrom"
SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
S = "${WORKDIR}/git/services/smbios-mdrv2/"
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-set-idle-disconnect-to-true-in-all-cases.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-set-idle-disconnect-to-true-in-all-cases.patch
new file mode 100644
index 000000000..925880eff
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-set-idle-disconnect-to-true-in-all-cases.patch
@@ -0,0 +1,34 @@
+From 7854a5e094ac49bebf9b2bfdd44db2f8cdd37543 Mon Sep 17 00:00:00 2001
+From: James Feist <james.feist@linux.intel.com>
+Date: Fri, 31 May 2019 15:05:13 -0700
+Subject: [PATCH] set idle-disconnect to true in all cases
+
+From sysfs this parameter can't be set. We want the
+muxes to clean themselves up if possible. Set this to
+true.
+
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+---
+ drivers/i2c/muxes/i2c-mux-pca954x.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
+index 923aa3a5a3dc..084c10951890 100644
+--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
++++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
+@@ -474,8 +474,12 @@ static int pca954x_probe(struct i2c_client *client,
+ data->last_chan = 0; /* force the first selection */
+ data->idle_state = MUX_IDLE_AS_IS;
+
++#if 1 /* Forcibly set the self-disconnect flag */
++ idle_disconnect_dt = true;
++#else
+ idle_disconnect_dt = np &&
+ of_property_read_bool(np, "i2c-mux-idle-disconnect");
++#endif
+ if (idle_disconnect_dt)
+ data->idle_state = MUX_IDLE_DISCONNECT;
+
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-arm-dts-aspeed-g5-add-espi.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-arm-dts-aspeed-g5-add-espi.patch
index 08498cd01..165596f25 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-arm-dts-aspeed-g5-add-espi.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-arm-dts-aspeed-g5-add-espi.patch
@@ -1,4 +1,4 @@
-From 536b09695117440ed428ff27023cd9167fcf4dfe Mon Sep 17 00:00:00 2001
+From f72d4767835e530ce6bc4673ff30cc1099c88af5 Mon Sep 17 00:00:00 2001
From: Juston Li <juston.li@intel.com>
Date: Mon, 27 Mar 2017 11:16:00 -0700
Subject: [PATCH] arm: dts: aspeed-g5: add espi
@@ -9,10 +9,10 @@ Signed-off-by: Juston Li <juston.li@intel.com>
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index a79e01ffe9d4..0c74adf739d2 100644
+index dc58eb8c6969..db82f47339aa 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -261,7 +261,7 @@
+@@ -283,7 +283,7 @@
#gpio-cells = <2>;
gpio-controller;
compatible = "aspeed,ast2500-gpio";
@@ -21,7 +21,7 @@ index a79e01ffe9d4..0c74adf739d2 100644
interrupts = <20>;
gpio-ranges = <&pinctrl 0 0 220>;
clocks = <&syscon ASPEED_CLK_APB>;
-@@ -269,6 +269,15 @@
+@@ -291,6 +291,15 @@
#interrupt-cells = <2>;
};
@@ -37,7 +37,7 @@ index a79e01ffe9d4..0c74adf739d2 100644
rtc: rtc@1e781000 {
compatible = "aspeed,ast2500-rtc";
reg = <0x1e781000 0x18>;
-@@ -344,6 +353,13 @@
+@@ -366,6 +375,13 @@
status = "disabled";
};
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-New-flash-map-for-intel.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-New-flash-map-for-intel.patch
index 11663c503..695491d28 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-New-flash-map-for-intel.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-New-flash-map-for-intel.patch
@@ -1,4 +1,4 @@
-From 3eabb52efdecfc0da896476ac5567060a6b3788a Mon Sep 17 00:00:00 2001
+From f57d473a30f208754457bdb63512c307f7499ac8 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@intel.com>
Date: Mon, 4 Jun 2018 13:45:42 -0700
Subject: [PATCH] New flash map for Intel
@@ -6,18 +6,18 @@ Subject: [PATCH] New flash map for Intel
Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>
---
- .../boot/dts/openbmc-flash-layout-intel-128MB.dtsi | 52 ++++++++++++++++++++++
- .../boot/dts/openbmc-flash-layout-intel-64MB.dtsi | 39 ++++++++++++++++
- 2 files changed, 91 insertions(+)
+ .../boot/dts/openbmc-flash-layout-intel-128MB.dtsi | 50 ++++++++++++++++++++++
+ .../boot/dts/openbmc-flash-layout-intel-64MB.dtsi | 38 ++++++++++++++++
+ 2 files changed, 88 insertions(+)
create mode 100644 arch/arm/boot/dts/openbmc-flash-layout-intel-128MB.dtsi
create mode 100644 arch/arm/boot/dts/openbmc-flash-layout-intel-64MB.dtsi
diff --git a/arch/arm/boot/dts/openbmc-flash-layout-intel-128MB.dtsi b/arch/arm/boot/dts/openbmc-flash-layout-intel-128MB.dtsi
new file mode 100644
-index 000000000000..23426acc30c7
+index 000000000000..0d3794423aed
--- /dev/null
+++ b/arch/arm/boot/dts/openbmc-flash-layout-intel-128MB.dtsi
-@@ -0,0 +1,52 @@
+@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: GPL-2.0+
+// 128MB flash layout: PFR (active + tmp1/tmp2 + extra)
+// image with common RW partition
@@ -48,34 +48,32 @@ index 000000000000..23426acc30c7
+ };
+
+ rwfs@2c0000 {
-+ reg = <0x2c0000 0xe40000>;
++ reg = <0x2c0000 0x840000>;
+ label = "rwfs";
+ };
+
-+ fit-image-a@1100000 {
-+ reg = <0x1100000 0x2500000>;
++ fit-image-a@b00000 {
++ reg = <0xb00000 0x1f00000>;
+ label = "image-a";
+ };
+
-+ rc-image@3600000 {
-+ reg = <0x3600000 0x2500000>;
++ rc-image@2a00000 {
++ reg = <0x2a00000 0x2000000>;
+ label = "rc-image";
+ };
+
-+ image-staging@5b00000 {
-+ reg = <0x5b00000 0x2500000>;
++ image-staging@4a00000 {
++ reg = <0x4a00000 0x3600000>;
+ label = "image-stg";
+ };
+
+};
-+
-+
diff --git a/arch/arm/boot/dts/openbmc-flash-layout-intel-64MB.dtsi b/arch/arm/boot/dts/openbmc-flash-layout-intel-64MB.dtsi
new file mode 100644
-index 000000000000..6ae8e57087e2
+index 000000000000..092708f5021f
--- /dev/null
+++ b/arch/arm/boot/dts/openbmc-flash-layout-intel-64MB.dtsi
-@@ -0,0 +1,39 @@
+@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0+
+// 64MB flash layout: redundant image with common RW partition
+
@@ -114,7 +112,6 @@ index 000000000000..6ae8e57087e2
+ label = "image-b";
+ };
+};
-+
--
2.7.4
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-Add-ASPEED-SGPIO-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-Add-ASPEED-SGPIO-driver.patch
index beb5087f5..08be45ff7 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-Add-ASPEED-SGPIO-driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-Add-ASPEED-SGPIO-driver.patch
@@ -1,4 +1,4 @@
-From 58adbd18074fbf8005d5d7a5ec116c326252f606 Mon Sep 17 00:00:00 2001
+From 323066b26f02f043e694463a8e0cd4ada465984b Mon Sep 17 00:00:00 2001
From: "Feist, James" <james.feist@intel.com>
Date: Mon, 5 Jun 2017 11:13:52 -0700
Subject: [PATCH] Add ASPEED SGPIO driver.
@@ -16,7 +16,7 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
create mode 100644 drivers/gpio/sgpio-aspeed.c
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
-index b5a2845347ec..e3ce2b68a1fc 100644
+index acd40eb51c46..20808e48229a 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -124,6 +124,14 @@ config GPIO_ASPEED
@@ -35,10 +35,10 @@ index b5a2845347ec..e3ce2b68a1fc 100644
tristate "Atheros AR71XX/AR724X/AR913X GPIO support"
default y if ATH79
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
-index 37628f8dbf70..069155f1db9e 100644
+index 6700eee860b7..77c6ec0ee98f 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
-@@ -32,6 +32,7 @@ obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o
+@@ -33,6 +33,7 @@ obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o
obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o
obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o
obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-SGPIO-DT-and-pinctrl-fixup.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-SGPIO-DT-and-pinctrl-fixup.patch
index 1c5d9ab53..8083ead0b 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-SGPIO-DT-and-pinctrl-fixup.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-SGPIO-DT-and-pinctrl-fixup.patch
@@ -1,4 +1,4 @@
-From 2f895fe17cd72124b2a04af306f9349e5da90a6c Mon Sep 17 00:00:00 2001
+From 1059e64f4fc5af65f2afdc209761342fe44e3498 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@intel.com>
Date: Wed, 16 May 2018 10:03:14 -0700
Subject: [PATCH] SGPIO DT and pinctrl fixup
@@ -15,10 +15,10 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
4 files changed, 54 insertions(+), 60 deletions(-)
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index 3990aed25ee6..19f721118b52 100644
+index fd857be397bf..00848693f455 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -203,6 +203,18 @@
+@@ -207,6 +207,18 @@
#interrupt-cells = <2>;
};
@@ -37,7 +37,7 @@ index 3990aed25ee6..19f721118b52 100644
timer: timer@1e782000 {
/* This timer is a Faraday FTTMR010 derivative */
compatible = "aspeed,ast2400-timer";
-@@ -1183,44 +1195,14 @@
+@@ -1180,44 +1192,14 @@
groups = "SD2";
};
@@ -89,10 +89,10 @@ index 3990aed25ee6..19f721118b52 100644
pinctrl_sioonctrl_default: sioonctrl_default {
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index 0c74adf739d2..d4c99b82f7bd 100644
+index db82f47339aa..8406da6f62a5 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -276,6 +276,9 @@
+@@ -298,6 +298,9 @@
reg = <0x1e780200 0x0100>;
interrupts = <40>;
interrupt-controller;
@@ -102,7 +102,7 @@ index 0c74adf739d2..d4c99b82f7bd 100644
};
rtc: rtc@1e781000 {
-@@ -1388,6 +1391,11 @@
+@@ -1403,6 +1406,11 @@
groups = "SDA2";
};
@@ -115,10 +115,10 @@ index 0c74adf739d2..d4c99b82f7bd 100644
function = "SGPS1";
groups = "SGPS1";
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
-index 05b153034517..353af05b8602 100644
+index 384396cbb22d..a78ed8c33e96 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
-@@ -401,16 +401,22 @@ SSSF_PIN_DECL(E16, GPIOF6, TXD4, SIG_DESC_SET(SCU80, 30));
+@@ -423,16 +423,22 @@ SSSF_PIN_DECL(E16, GPIOF6, TXD4, SIG_DESC_SET(SCU80, 30));
SSSF_PIN_DECL(C17, GPIOF7, RXD4, SIG_DESC_SET(SCU80, 31));
#define A14 48
@@ -145,7 +145,7 @@ index 05b153034517..353af05b8602 100644
#define B13 52
SIG_EXPR_LIST_DECL_SINGLE(OSCCLK, OSCCLK, SIG_DESC_SET(SCU2C, 1));
-@@ -576,16 +582,22 @@ FUNC_GROUP_DECL(SPI1PASSTHRU, C22, G18, D19, C20, B22, G19, C18, E20);
+@@ -598,16 +604,22 @@ FUNC_GROUP_DECL(SPI1PASSTHRU, C22, G18, D19, C20, B22, G19, C18, E20);
FUNC_GROUP_DECL(VGABIOS_ROM, B22, G19, C18, E20);
#define J5 72
@@ -172,7 +172,7 @@ index 05b153034517..353af05b8602 100644
#define T4 76
SSSF_PIN_DECL(T4, GPIOJ4, VGAHS, SIG_DESC_SET(SCU84, 12));
-@@ -2083,14 +2095,8 @@ static const struct aspeed_pin_group aspeed_g4_groups[] = {
+@@ -2105,14 +2117,8 @@ static const struct aspeed_pin_group aspeed_g4_groups[] = {
ASPEED_PINCTRL_GROUP(SALT4),
ASPEED_PINCTRL_GROUP(SD1),
ASPEED_PINCTRL_GROUP(SD2),
@@ -189,7 +189,7 @@ index 05b153034517..353af05b8602 100644
ASPEED_PINCTRL_GROUP(SIOONCTRL),
ASPEED_PINCTRL_GROUP(SIOPBI),
ASPEED_PINCTRL_GROUP(SIOPBO),
-@@ -2238,14 +2244,8 @@ static const struct aspeed_pin_function aspeed_g4_functions[] = {
+@@ -2260,14 +2266,8 @@ static const struct aspeed_pin_function aspeed_g4_functions[] = {
ASPEED_PINCTRL_FUNC(SALT4),
ASPEED_PINCTRL_FUNC(SD1),
ASPEED_PINCTRL_FUNC(SD2),
@@ -207,10 +207,10 @@ index 05b153034517..353af05b8602 100644
ASPEED_PINCTRL_FUNC(SIOPBI),
ASPEED_PINCTRL_FUNC(SIOPBO),
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
-index 4230e1038a88..13f749e35001 100644
+index 6f151e7c8d81..c088f010c554 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
-@@ -577,6 +577,8 @@ SS_PIN_DECL(N3, GPIOJ2, SGPMO);
+@@ -599,6 +599,8 @@ SS_PIN_DECL(N3, GPIOJ2, SGPMO);
SIG_EXPR_LIST_DECL_SINGLE(SGPMI, SGPM, SIG_DESC_SET(SCU84, 11));
SS_PIN_DECL(N4, GPIOJ3, SGPMI);
@@ -219,7 +219,7 @@ index 4230e1038a88..13f749e35001 100644
#define N5 76
SIG_EXPR_LIST_DECL_SINGLE(VGAHS, VGAHS, SIG_DESC_SET(SCU84, 12));
SIG_EXPR_LIST_DECL_SINGLE(DASHN5, DASHN5, SIG_DESC_SET(SCU94, 8));
-@@ -2127,6 +2129,7 @@ static const struct aspeed_pin_group aspeed_g5_groups[] = {
+@@ -2149,6 +2151,7 @@ static const struct aspeed_pin_group aspeed_g5_groups[] = {
ASPEED_PINCTRL_GROUP(SD2),
ASPEED_PINCTRL_GROUP(SDA1),
ASPEED_PINCTRL_GROUP(SDA2),
@@ -227,7 +227,7 @@ index 4230e1038a88..13f749e35001 100644
ASPEED_PINCTRL_GROUP(SGPS1),
ASPEED_PINCTRL_GROUP(SGPS2),
ASPEED_PINCTRL_GROUP(SIOONCTRL),
-@@ -2296,6 +2299,7 @@ static const struct aspeed_pin_function aspeed_g5_functions[] = {
+@@ -2318,6 +2321,7 @@ static const struct aspeed_pin_function aspeed_g5_functions[] = {
ASPEED_PINCTRL_FUNC(SD2),
ASPEED_PINCTRL_FUNC(SDA1),
ASPEED_PINCTRL_FUNC(SDA2),
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0010-Update-PECI-drivers-to-sync-with-linux-upstreaming-v.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0010-Update-PECI-drivers-to-sync-with-linux-upstreaming-v.patch
index d2ecdfd72..86dd2e68c 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0010-Update-PECI-drivers-to-sync-with-linux-upstreaming-v.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0010-Update-PECI-drivers-to-sync-with-linux-upstreaming-v.patch
@@ -1,4 +1,4 @@
-From 9c27803dd432c7a9fc57dd3e16f0fd724919575e Mon Sep 17 00:00:00 2001
+From 2dec2c142e48a35e6c7de00c6a35e963de7447e0 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Mon, 7 Jan 2019 09:56:10 -0800
Subject: [PATCH] Update PECI drivers to sync with linux upstreaming version
@@ -93,10 +93,10 @@ index 821a9258f2e6..a3a3e465c888 100644
+temp[6-*]_crit_hyst Provides the hysteresis value from Tcontrol to Tjmax of
the core.
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
-index 18cd3b17f660..0bd06a938526 100644
+index c0623fa5ba41..7399c3cef30c 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
-@@ -1321,7 +1321,7 @@ config SENSORS_PECI_CPUTEMP
+@@ -1333,7 +1333,7 @@ config SENSORS_PECI_CPUTEMP
the PECI Client Command Suite via the processor PECI client.
Check Documentation/hwmon/peci-cputemp for details.
@@ -105,7 +105,7 @@ index 18cd3b17f660..0bd06a938526 100644
will be called peci-cputemp.
config SENSORS_PECI_DIMMTEMP
-@@ -1335,7 +1335,7 @@ config SENSORS_PECI_DIMMTEMP
+@@ -1347,7 +1347,7 @@ config SENSORS_PECI_DIMMTEMP
Suite via the processor PECI client.
Check Documentation/hwmon/peci-dimmtemp for details.
@@ -673,10 +673,10 @@ index 6ca1855a86bb..ce6b470eae63 100644
/**
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
-index 9af5730ad7ba..28087e9cd4da 100644
+index 75dbcc7da87c..6f7ee4dd08f6 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
-@@ -606,7 +606,7 @@ config MFD_INTEL_MSIC
+@@ -616,7 +616,7 @@ config MFD_INTEL_MSIC
devices used in Intel Medfield platforms.
config MFD_INTEL_PECI_CLIENT
@@ -685,7 +685,7 @@ index 9af5730ad7ba..28087e9cd4da 100644
depends on (PECI || COMPILE_TEST)
select MFD_CORE
help
-@@ -619,6 +619,9 @@ config MFD_INTEL_PECI_CLIENT
+@@ -629,6 +629,9 @@ config MFD_INTEL_PECI_CLIENT
Additional drivers must be enabled in order to use the functionality
of the device.
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0019-Add-I2C-IPMB-support.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0019-Add-I2C-IPMB-support.patch
index 391d6f816..675125322 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0019-Add-I2C-IPMB-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0019-Add-I2C-IPMB-support.patch
@@ -1,4 +1,4 @@
-From 59e2471d9bf64fa7d539520ef66cf5f33c0b0e55 Mon Sep 17 00:00:00 2001
+From f588865f8180a6370ac639bdfc186ffc5b926246 Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@linux.intel.com>
Date: Tue, 13 Feb 2018 14:28:12 +0800
Subject: [PATCH] i2c: slave-mqueue: add mqueue driver to receive ipmi message
@@ -14,20 +14,20 @@ will exposes these messages to userspace by sysfs bin file.
Signed-off-by: Haiyue Wang <haiyue.wang@linux.intel.com>
---
- Documentation/i2c/slave-mqueue-backend.rst | 125 +++++++++++++++++
+ Documentation/i2c/slave-mqueue-backend.rst | 124 +++++++++++++++++
drivers/i2c/Kconfig | 23 +++
drivers/i2c/Makefile | 1 +
drivers/i2c/i2c-slave-mqueue.c | 217 +++++++++++++++++++++++++++++
- 4 files changed, 366 insertions(+)
+ 4 files changed, 365 insertions(+)
create mode 100644 Documentation/i2c/slave-mqueue-backend.rst
create mode 100644 drivers/i2c/i2c-slave-mqueue.c
diff --git a/Documentation/i2c/slave-mqueue-backend.rst b/Documentation/i2c/slave-mqueue-backend.rst
new file mode 100644
-index 000000000000..3966cf0ab8da
+index 000000000000..2d0d06d8df9d
--- /dev/null
+++ b/Documentation/i2c/slave-mqueue-backend.rst
-@@ -0,0 +1,125 @@
+@@ -0,0 +1,124 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=====================================
@@ -152,12 +152,11 @@ index 000000000000..3966cf0ab8da
+ [10203.974044856] : 20 18 c8 2c 80 01 53
+ [10204.220734634] : 20 18 c8 2c 80 01 53
+ [10204.468461664] : 20 18 c8 2c 80 01 53
-+
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
-index efc3354d60ae..04fb851f2c82 100644
+index abedd55a1264..49a2379876c6 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
-@@ -118,6 +118,29 @@ if I2C_SLAVE
+@@ -119,6 +119,29 @@ if I2C_SLAVE
config I2C_SLAVE_EEPROM
tristate "I2C eeprom slave driver"
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0020-misc-aspeed-add-lpc-mbox-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0020-misc-aspeed-add-lpc-mbox-driver.patch
new file mode 100644
index 000000000..884a7018c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0020-misc-aspeed-add-lpc-mbox-driver.patch
@@ -0,0 +1,475 @@
+From efa7ad95db45494b2c3685c0688f00174e517e34 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Wed, 10 Jul 2019 16:19:33 -0700
+Subject: [PATCH] misc: aspeed: add lpc mbox driver
+
+This commit adds back the lpc mbox driver which was removed from
+the openbmc linux dev-5.2 tree.
+
+This driver should be rewritten later.
+
+Signed-off-by: Cyril Bur <cyrilbur@gmail.com>"
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ arch/arm/boot/dts/aspeed-g4.dtsi | 9 +
+ arch/arm/boot/dts/aspeed-g5.dtsi | 9 +
+ drivers/soc/aspeed/Kconfig | 7 +
+ drivers/soc/aspeed/Makefile | 1 +
+ drivers/soc/aspeed/aspeed-lpc-mbox.c | 376 +++++++++++++++++++++++++++++++++++
+ 5 files changed, 402 insertions(+)
+ create mode 100644 drivers/soc/aspeed/aspeed-lpc-mbox.c
+
+diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
+index 00848693f455..4b8b0be22cd4 100644
+--- a/arch/arm/boot/dts/aspeed-g4.dtsi
++++ b/arch/arm/boot/dts/aspeed-g4.dtsi
+@@ -344,6 +344,15 @@
+ sio_regs: regs {
+ compatible = "aspeed,bmc-misc";
+ };
++
++ mbox: mbox@180 {
++ compatible = "aspeed,ast2400-mbox";
++ reg = <0x180 0x5c>;
++ interrupts = <46>;
++ #mbox-cells = <1>;
++ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
++ status = "disabled";
++ };
+ };
+ };
+
+diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
+index 8406da6f62a5..9f3bd5bafab5 100644
+--- a/arch/arm/boot/dts/aspeed-g5.dtsi
++++ b/arch/arm/boot/dts/aspeed-g5.dtsi
+@@ -473,6 +473,15 @@
+ sio_regs: regs {
+ compatible = "aspeed,bmc-misc";
+ };
++
++ mbox: mbox@180 {
++ compatible = "aspeed,ast2500-mbox";
++ reg = <0x180 0x5c>;
++ interrupts = <46>;
++ #mbox-cells = <1>;
++ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
++ status = "disabled";
++ };
+ };
+ };
+
+diff --git a/drivers/soc/aspeed/Kconfig b/drivers/soc/aspeed/Kconfig
+index 78dd74c49ddb..a4be8e566bc7 100644
+--- a/drivers/soc/aspeed/Kconfig
++++ b/drivers/soc/aspeed/Kconfig
+@@ -21,6 +21,13 @@ config ASPEED_LPC_CTRL
+ ioctl()s, the driver also provides a read/write interface to a BMC ram
+ region where the host LPC read/write region can be buffered.
+
++config ASPEED_LPC_MBOX
++ tristate "Aspeed LPC Mailbox Controller"
++ depends on SOC_ASPEED && REGMAP && MFD_SYSCON
++ ---help---
++ Expose the ASPEED LPC MBOX registers found on Aspeed SOCs (AST2400
++ and AST2500) to userspace.
++
+ config ASPEED_LPC_SNOOP
+ tristate "Aspeed ast2500 HOST LPC snoop support"
+ depends on SOC_ASPEED && REGMAP && MFD_SYSCON
+diff --git a/drivers/soc/aspeed/Makefile b/drivers/soc/aspeed/Makefile
+index e631b23d519b..f3ff29b874ed 100644
+--- a/drivers/soc/aspeed/Makefile
++++ b/drivers/soc/aspeed/Makefile
+@@ -1,5 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0-only
+ obj-$(CONFIG_ASPEED_BMC_MISC) += aspeed-bmc-misc.o
+ obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o
++obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o
+ obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
+ obj-$(CONFIG_ASPEED_P2A_CTRL) += aspeed-p2a-ctrl.o
+diff --git a/drivers/soc/aspeed/aspeed-lpc-mbox.c b/drivers/soc/aspeed/aspeed-lpc-mbox.c
+new file mode 100644
+index 000000000000..795107206022
+--- /dev/null
++++ b/drivers/soc/aspeed/aspeed-lpc-mbox.c
+@@ -0,0 +1,376 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++// Copyright 2017 IBM Corporation
++// TODO: Rewrite this driver
++
++#include <linux/clk.h>
++#include <linux/interrupt.h>
++#include <linux/mfd/syscon.h>
++#include <linux/miscdevice.h>
++#include <linux/module.h>
++#include <linux/of_irq.h>
++#include <linux/platform_device.h>
++#include <linux/poll.h>
++#include <linux/regmap.h>
++#include <linux/slab.h>
++
++#define DEVICE_NAME "aspeed-mbox"
++
++#define MBX_USE_INTERRUPT 0
++
++#define ASPEED_MBOX_NUM_REGS 16
++
++#define ASPEED_MBOX_DATA_0 0x00
++#define ASPEED_MBOX_STATUS_0 0x40
++#define ASPEED_MBOX_STATUS_1 0x44
++#define ASPEED_MBOX_BMC_CTRL 0x48
++#define ASPEED_MBOX_CTRL_RECV BIT(7)
++#define ASPEED_MBOX_CTRL_MASK BIT(1)
++#define ASPEED_MBOX_CTRL_SEND BIT(0)
++#define ASPEED_MBOX_HOST_CTRL 0x4c
++#define ASPEED_MBOX_INTERRUPT_0 0x50
++#define ASPEED_MBOX_INTERRUPT_1 0x54
++
++struct aspeed_mbox {
++ struct miscdevice miscdev;
++ struct regmap *regmap;
++ struct clk *clk;
++ unsigned int base;
++ int irq;
++ wait_queue_head_t queue;
++ struct mutex mutex;
++};
++
++static atomic_t aspeed_mbox_open_count = ATOMIC_INIT(0);
++
++static u8 aspeed_mbox_inb(struct aspeed_mbox *mbox, int reg)
++{
++ /*
++ * The mbox registers are actually only one byte but are addressed
++ * four bytes apart. The other three bytes are marked 'reserved',
++ * they *should* be zero but lets not rely on it.
++ * I am going to rely on the fact we can casually read/write to them...
++ */
++ unsigned int val = 0xff; /* If regmap throws an error return 0xff */
++ int rc = regmap_read(mbox->regmap, mbox->base + reg, &val);
++
++ if (rc)
++ dev_err(mbox->miscdev.parent, "regmap_read() failed with "
++ "%d (reg: 0x%08x)\n", rc, reg);
++
++ return val & 0xff;
++}
++
++static void aspeed_mbox_outb(struct aspeed_mbox *mbox, u8 data, int reg)
++{
++ int rc = regmap_write(mbox->regmap, mbox->base + reg, data);
++
++ if (rc)
++ dev_err(mbox->miscdev.parent, "regmap_write() failed with "
++ "%d (data: %u reg: 0x%08x)\n", rc, data, reg);
++}
++
++static struct aspeed_mbox *file_mbox(struct file *file)
++{
++ return container_of(file->private_data, struct aspeed_mbox, miscdev);
++}
++
++static int aspeed_mbox_open(struct inode *inode, struct file *file)
++{
++#if MBX_USE_INTERRUPT
++ struct aspeed_mbox *mbox = file_mbox(file);
++#endif
++
++ if (atomic_inc_return(&aspeed_mbox_open_count) == 1) {
++#if MBX_USE_INTERRUPT
++ /*
++ * Clear the interrupt status bit if it was left on and unmask
++ * interrupts.
++ * ASPEED_MBOX_CTRL_RECV bit is W1C, this also unmasks in 1 step
++ */
++ aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
++#endif
++ return 0;
++ }
++
++ atomic_dec(&aspeed_mbox_open_count);
++ return -EBUSY;
++}
++
++static ssize_t aspeed_mbox_read(struct file *file, char __user *buf,
++ size_t count, loff_t *ppos)
++{
++ struct aspeed_mbox *mbox = file_mbox(file);
++ char __user *p = buf;
++ ssize_t ret;
++ int i;
++
++ if (!access_ok(buf, count))
++ return -EFAULT;
++
++ if (count + *ppos > ASPEED_MBOX_NUM_REGS)
++ return -EINVAL;
++
++#if MBX_USE_INTERRUPT
++ if (file->f_flags & O_NONBLOCK) {
++ if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
++ ASPEED_MBOX_CTRL_RECV))
++ return -EAGAIN;
++ } else if (wait_event_interruptible(mbox->queue,
++ aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
++ ASPEED_MBOX_CTRL_RECV)) {
++ return -ERESTARTSYS;
++ }
++#endif
++
++ mutex_lock(&mbox->mutex);
++
++ for (i = *ppos; count > 0 && i < ASPEED_MBOX_NUM_REGS; i++) {
++ uint8_t reg = aspeed_mbox_inb(mbox, ASPEED_MBOX_DATA_0 + (i * 4));
++
++ ret = __put_user(reg, p);
++ if (ret)
++ goto out_unlock;
++
++ p++;
++ count--;
++ }
++
++#if MBX_USE_INTERRUPT
++ /* ASPEED_MBOX_CTRL_RECV bit is write to clear, this also unmasks in 1 step */
++ aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
++#endif
++ ret = p - buf;
++
++out_unlock:
++ mutex_unlock(&mbox->mutex);
++ return ret;
++}
++
++static ssize_t aspeed_mbox_write(struct file *file, const char __user *buf,
++ size_t count, loff_t *ppos)
++{
++ struct aspeed_mbox *mbox = file_mbox(file);
++ const char __user *p = buf;
++ ssize_t ret;
++ char c;
++ int i;
++
++ if (!access_ok(buf, count))
++ return -EFAULT;
++
++ if (count + *ppos > ASPEED_MBOX_NUM_REGS)
++ return -EINVAL;
++
++ mutex_lock(&mbox->mutex);
++
++ for (i = *ppos; count > 0 && i < ASPEED_MBOX_NUM_REGS; i++) {
++ ret = __get_user(c, p);
++ if (ret)
++ goto out_unlock;
++
++ aspeed_mbox_outb(mbox, c, ASPEED_MBOX_DATA_0 + (i * 4));
++ p++;
++ count--;
++ }
++
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_0);
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_1);
++ aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV | ASPEED_MBOX_CTRL_MASK | ASPEED_MBOX_CTRL_SEND, ASPEED_MBOX_BMC_CTRL);
++ ret = p - buf;
++
++out_unlock:
++ mutex_unlock(&mbox->mutex);
++ return ret;
++}
++
++static unsigned int aspeed_mbox_poll(struct file *file, poll_table *wait)
++{
++ struct aspeed_mbox *mbox = file_mbox(file);
++ unsigned int mask = 0;
++
++ poll_wait(file, &mbox->queue, wait);
++
++#if MBX_USE_INTERRUPT
++ if (aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV)
++#endif
++ mask |= POLLIN;
++
++ return mask;
++}
++
++static int aspeed_mbox_release(struct inode *inode, struct file *file)
++{
++ atomic_dec(&aspeed_mbox_open_count);
++ return 0;
++}
++
++static const struct file_operations aspeed_mbox_fops = {
++ .owner = THIS_MODULE,
++ .llseek = no_seek_end_llseek,
++ .read = aspeed_mbox_read,
++ .write = aspeed_mbox_write,
++ .open = aspeed_mbox_open,
++ .release = aspeed_mbox_release,
++ .poll = aspeed_mbox_poll,
++};
++
++static irqreturn_t aspeed_mbox_irq(int irq, void *arg)
++{
++ struct aspeed_mbox *mbox = arg;
++#if MBX_USE_INTERRUPT
++ int i;
++
++// if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV))
++// return IRQ_NONE;
++
++ printk(KERN_ERR "BMC_CTRL: 0x%02x\n",
++ aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL));
++ printk(KERN_ERR "STATUS_0: 0x%02x\n",
++ aspeed_mbox_inb(mbox, ASPEED_MBOX_STATUS_0));
++ printk(KERN_ERR "STATUS_1: 0x%02x\n",
++ aspeed_mbox_inb(mbox, ASPEED_MBOX_STATUS_1));
++ for (i = 0; i < ASPEED_MBOX_NUM_REGS; i++) {
++ printk(KERN_ERR "DATA_%d: 0x%02x\n", i,
++ aspeed_mbox_inb(mbox, ASPEED_MBOX_DATA_0 + (i * 4)));
++ }
++#endif
++
++ /* Clear interrupt status */
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_0);
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_1);
++ aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
++
++ wake_up(&mbox->queue);
++ return IRQ_HANDLED;
++}
++
++static int aspeed_mbox_config_irq(struct aspeed_mbox *mbox,
++ struct platform_device *pdev)
++{
++ struct device *dev = &pdev->dev;
++ int rc;
++
++ mbox->irq = platform_get_irq(pdev, 0);
++ if (!mbox->irq)
++ return -ENODEV;
++
++ rc = devm_request_irq(dev, mbox->irq, aspeed_mbox_irq,
++ IRQF_SHARED, DEVICE_NAME, mbox);
++ if (rc < 0) {
++ dev_err(dev, "Unable to request IRQ %d\n", mbox->irq);
++ return rc;
++ }
++
++ /* Disable all register based interrupts. */
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_INTERRUPT_0); /* regs 0 - 7 */
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_INTERRUPT_1); /* regs 8 - 15 */
++
++ /* These registers are write one to clear. Clear them. */
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_0);
++ aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_1);
++
++ aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
++ return 0;
++}
++
++static int aspeed_mbox_probe(struct platform_device *pdev)
++{
++ struct aspeed_mbox *mbox;
++ struct device *dev;
++ int rc;
++
++ dev = &pdev->dev;
++
++ mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
++ if (!mbox)
++ return -ENOMEM;
++
++ dev_set_drvdata(&pdev->dev, mbox);
++
++ rc = of_property_read_u32(dev->of_node, "reg", &mbox->base);
++ if (rc) {
++ dev_err(dev, "Couldn't read reg device-tree property\n");
++ return rc;
++ }
++
++ mbox->regmap = syscon_node_to_regmap(
++ pdev->dev.parent->of_node);
++ if (IS_ERR(mbox->regmap)) {
++ dev_err(dev, "Couldn't get regmap\n");
++ return -ENODEV;
++ }
++
++ mutex_init(&mbox->mutex);
++ init_waitqueue_head(&mbox->queue);
++
++ mbox->clk = devm_clk_get(dev, NULL);
++ if (IS_ERR(mbox->clk)) {
++ rc = PTR_ERR(mbox->clk);
++ if (rc != -EPROBE_DEFER)
++ dev_err(dev, "couldn't get clock\n");
++ return rc;
++ }
++ rc = clk_prepare_enable(mbox->clk);
++ if (rc) {
++ dev_err(dev, "couldn't enable clock\n");
++ return rc;
++ }
++
++ mbox->miscdev.minor = MISC_DYNAMIC_MINOR;
++ mbox->miscdev.name = DEVICE_NAME;
++ mbox->miscdev.fops = &aspeed_mbox_fops;
++ mbox->miscdev.parent = dev;
++ rc = misc_register(&mbox->miscdev);
++ if (rc) {
++ dev_err(dev, "Unable to register device\n");
++ goto err;
++ }
++
++ rc = aspeed_mbox_config_irq(mbox, pdev);
++ if (rc) {
++ dev_err(dev, "Failed to configure IRQ\n");
++ misc_deregister(&mbox->miscdev);
++ goto err;
++ }
++
++ dev_info(&pdev->dev, "LPC mbox registered, irq %d\n", mbox->irq);
++
++ return 0;
++
++err:
++ clk_disable_unprepare(mbox->clk);
++
++ return rc;
++}
++
++static int aspeed_mbox_remove(struct platform_device *pdev)
++{
++ struct aspeed_mbox *mbox = dev_get_drvdata(&pdev->dev);
++
++ misc_deregister(&mbox->miscdev);
++ clk_disable_unprepare(mbox->clk);
++
++ return 0;
++}
++
++static const struct of_device_id aspeed_mbox_match[] = {
++ { .compatible = "aspeed,ast2400-mbox" },
++ { .compatible = "aspeed,ast2500-mbox" },
++ { },
++};
++MODULE_DEVICE_TABLE(of, aspeed_mbox_match);
++
++static struct platform_driver aspeed_mbox_driver = {
++ .driver = {
++ .name = DEVICE_NAME,
++ .of_match_table = aspeed_mbox_match,
++ },
++ .probe = aspeed_mbox_probe,
++ .remove = aspeed_mbox_remove,
++};
++
++module_platform_driver(aspeed_mbox_driver);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Cyril Bur <cyrilbur@gmail.com>");
++MODULE_DESCRIPTION("Aspeed mailbox device driver");
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0021-Initial-Port-of-Aspeed-LPC-SIO-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0021-Initial-Port-of-Aspeed-LPC-SIO-driver.patch
index d1745ce5f..b347894be 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0021-Initial-Port-of-Aspeed-LPC-SIO-driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0021-Initial-Port-of-Aspeed-LPC-SIO-driver.patch
@@ -1,4 +1,4 @@
-From 7d5cd323d3b05a00f8b8a6eb38a5a1ec7925660a Mon Sep 17 00:00:00 2001
+From 3d1ddeb903f6eaeb06ddc1d6cfbed6374ef31f36 Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@intel.com>
Date: Mon, 13 Nov 2017 16:29:44 +0800
Subject: [PATCH] Aspeed LPC SIO driver
@@ -8,24 +8,24 @@ Add lpc sio device driver for AST2500/2400
Signed-off-by: Yong Li <yong.b.li@intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- .../devicetree/bindings/misc/aspeed-sio.txt | 18 +
+ .../bindings/soc/aspeed/aspeed-lpc-sio.txt | 17 +
arch/arm/boot/dts/aspeed-g4.dtsi | 7 +
arch/arm/boot/dts/aspeed-g5.dtsi | 7 +
- drivers/misc/Kconfig | 9 +
- drivers/misc/Makefile | 1 +
- drivers/misc/aspeed-lpc-sio.c | 450 +++++++++++++++++++++
+ drivers/soc/aspeed/Kconfig | 7 +
+ drivers/soc/aspeed/Makefile | 1 +
+ drivers/soc/aspeed/aspeed-lpc-sio.c | 450 +++++++++++++++++++++
include/uapi/linux/aspeed-lpc-sio.h | 44 ++
- 7 files changed, 536 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/misc/aspeed-sio.txt
- create mode 100644 drivers/misc/aspeed-lpc-sio.c
+ 7 files changed, 533 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed-lpc-sio.txt
+ create mode 100644 drivers/soc/aspeed/aspeed-lpc-sio.c
create mode 100644 include/uapi/linux/aspeed-lpc-sio.h
-diff --git a/Documentation/devicetree/bindings/misc/aspeed-sio.txt b/Documentation/devicetree/bindings/misc/aspeed-sio.txt
+diff --git a/Documentation/devicetree/bindings/soc/aspeed/aspeed-lpc-sio.txt b/Documentation/devicetree/bindings/soc/aspeed/aspeed-lpc-sio.txt
new file mode 100644
-index 000000000000..3530c2b02f5c
+index 000000000000..c74ea3a4e5ac
--- /dev/null
-+++ b/Documentation/devicetree/bindings/misc/aspeed-sio.txt
-@@ -0,0 +1,18 @@
++++ b/Documentation/devicetree/bindings/soc/aspeed/aspeed-lpc-sio.txt
+@@ -0,0 +1,17 @@
+* Aspeed LPC SIO driver.
+
+Required properties:
@@ -43,12 +43,11 @@ index 000000000000..3530c2b02f5c
+ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
+ status = "disabled";
+};
-+
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index e8bcfc90bf7c..a87fd5ee1c84 100644
+index 07758c9b900b..3df43f925848 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -340,6 +340,13 @@
+@@ -345,6 +345,13 @@
compatible = "aspeed,bmc-misc";
};
@@ -63,10 +62,10 @@ index e8bcfc90bf7c..a87fd5ee1c84 100644
compatible = "aspeed,ast2400-mbox";
reg = <0x180 0x5c>;
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index e5c0ba0f87c8..a568699c28f4 100644
+index 2387e2d1ff9e..2d6f730a7101 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -451,6 +451,13 @@
+@@ -474,6 +474,13 @@
compatible = "aspeed,bmc-misc";
};
@@ -80,40 +79,40 @@ index e5c0ba0f87c8..a568699c28f4 100644
mbox: mbox@180 {
compatible = "aspeed,ast2500-mbox";
reg = <0x180 0x5c>;
-diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
-index 00d1c547ece7..3ffb18f915e8 100644
---- a/drivers/misc/Kconfig
-+++ b/drivers/misc/Kconfig
-@@ -493,6 +493,15 @@ config ASPEED_LPC_CTRL
- ioctl()s, the driver also provides a read/write interface to a BMC ram
- region where the host LPC read/write region can be buffered.
+diff --git a/drivers/soc/aspeed/Kconfig b/drivers/soc/aspeed/Kconfig
+index a4be8e566bc7..285c19042c65 100644
+--- a/drivers/soc/aspeed/Kconfig
++++ b/drivers/soc/aspeed/Kconfig
+@@ -28,6 +28,13 @@ config ASPEED_LPC_MBOX
+ Expose the ASPEED LPC MBOX registers found on Aspeed SOCs (AST2400
+ and AST2500) to userspace.
+config ASPEED_LPC_SIO
-+ depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
+ tristate "Aspeed ast2400/2500 HOST LPC SIO support"
++ depends on SOC_ASPEED && REGMAP && MFD_SYSCON
+ help
-+ Provides a driver to control the LPC SIO interface
-+ on ASPEED platform
-+ through
-+ ioctl()s.
++ Provides a driver to control the LPC SIO interface on ASPEED platform
++ through ioctl()s.
+
config ASPEED_LPC_SNOOP
tristate "Aspeed ast2500 HOST LPC snoop support"
- depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
-diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
-index 768278b059c3..de2d5c6d186c 100644
---- a/drivers/misc/Makefile
-+++ b/drivers/misc/Makefile
-@@ -53,6 +53,7 @@ obj-$(CONFIG_GENWQE) += genwqe/
- obj-$(CONFIG_ECHO) += echo/
- obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
- obj-$(CONFIG_CXL_BASE) += cxl/
-+obj-$(CONFIG_ASPEED_LPC_SIO) += aspeed-lpc-sio.o
+ depends on SOC_ASPEED && REGMAP && MFD_SYSCON
+diff --git a/drivers/soc/aspeed/Makefile b/drivers/soc/aspeed/Makefile
+index f3ff29b874ed..2e547cc47e62 100644
+--- a/drivers/soc/aspeed/Makefile
++++ b/drivers/soc/aspeed/Makefile
+@@ -2,5 +2,6 @@
+ obj-$(CONFIG_ASPEED_BMC_MISC) += aspeed-bmc-misc.o
obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o
- obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o
++obj-$(CONFIG_ASPEED_LPC_SIO) += aspeed-lpc-sio.o
+ obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
+ obj-$(CONFIG_ASPEED_P2A_CTRL) += aspeed-p2a-ctrl.o
+diff --git a/drivers/soc/aspeed/aspeed-lpc-sio.c b/drivers/soc/aspeed/aspeed-lpc-sio.c
+new file mode 100644
+index 000000000000..c717a3182320
--- /dev/null
-+++ b/drivers/misc/aspeed-lpc-sio.c
++++ b/drivers/soc/aspeed/aspeed-lpc-sio.c
@@ -0,0 +1,450 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (C) 2012-2017 ASPEED Technology Inc.
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0022-Add-AST2500-eSPI-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0022-Add-AST2500-eSPI-driver.patch
index 303bff0b1..a44667436 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0022-Add-AST2500-eSPI-driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0022-Add-AST2500-eSPI-driver.patch
@@ -1,4 +1,4 @@
-From 3437db37b2f39a69505338546d9f846338de6c88 Mon Sep 17 00:00:00 2001
+From 0f0e0a03218f6a7bdcdd78d319959e6bb974502c Mon Sep 17 00:00:00 2001
From: Haiyue Wang <haiyue.wang@linux.intel.com>
Date: Sat, 24 Feb 2018 11:12:32 +0800
Subject: [PATCH] eSPI: add ASPEED AST2500 eSPI driver to boot a host with PCH
@@ -18,23 +18,23 @@ Also for the host power on / off actions, from BMC side, the following VW
Signed-off-by: Haiyue Wang <haiyue.wang@linux.intel.com>
---
- .../devicetree/bindings/misc/aspeed,espi-slave.txt | 20 ++
- Documentation/misc-devices/espi-slave.rst | 119 +++++++
+ .../devicetree/bindings/misc/aspeed,espi-slave.txt | 19 ++
+ Documentation/misc-devices/espi-slave.rst | 118 +++++++
arch/arm/boot/dts/aspeed-g5.dtsi | 4 +
drivers/misc/Kconfig | 8 +
drivers/misc/Makefile | 1 +
drivers/misc/aspeed-espi-slave.c | 353 +++++++++++++++++++++
- 6 files changed, 505 insertions(+)
+ 6 files changed, 503 insertions(+)
create mode 100644 Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt
create mode 100644 Documentation/misc-devices/espi-slave.rst
create mode 100644 drivers/misc/aspeed-espi-slave.c
diff --git a/Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt b/Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt
new file mode 100644
-index 000000000000..4f5d47ecc882
+index 000000000000..8660e2ffbb89
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/aspeed,espi-slave.txt
-@@ -0,0 +1,20 @@
+@@ -0,0 +1,19 @@
+ASPEED eSPI Slave Controller
+
+Required properties:
@@ -54,13 +54,12 @@ index 000000000000..4f5d47ecc882
+ interrupts = <23>;
+ status = "disabled";
+};
-+
diff --git a/Documentation/misc-devices/espi-slave.rst b/Documentation/misc-devices/espi-slave.rst
new file mode 100644
-index 000000000000..185acd71bd26
+index 000000000000..887a69a7130a
--- /dev/null
+++ b/Documentation/misc-devices/espi-slave.rst
-@@ -0,0 +1,119 @@
+@@ -0,0 +1,118 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+==========
@@ -179,12 +178,11 @@ index 000000000000..185acd71bd26
+`Enhanced Serial Peripheral Interface (eSPI)
+- Interface Base Specification (for Client and Server Platforms)
+<https://www.intel.com/content/dam/support/us/en/documents/software/chipset-software/327432-004_espi_base_specification_rev1.0.pdf>`_
-+
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index da9e903808bc..01d27e845982 100644
+index 2d6f730a7101..0e7f1d2fa08e 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -267,6 +267,7 @@
+@@ -289,6 +289,7 @@
clocks = <&syscon ASPEED_CLK_APB>;
interrupt-controller;
#interrupt-cells = <2>;
@@ -192,7 +190,7 @@ index da9e903808bc..01d27e845982 100644
};
sgpio: sgpio@1e780200 {
-@@ -361,6 +362,9 @@
+@@ -383,6 +384,9 @@
reg = <0x1e6ee000 0x100>;
interrupts = <23>;
status = "disabled";
@@ -203,10 +201,10 @@ index da9e903808bc..01d27e845982 100644
lpc: lpc@1e789000 {
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
-index d4ed3777462a..8b1fcf741411 100644
+index 9d96469fb41c..b6acddaa9421 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
-@@ -485,6 +485,14 @@ config VEXPRESS_SYSCFG
+@@ -473,6 +473,14 @@ config VEXPRESS_SYSCFG
bus. System Configuration interface is one of the possible means
of generating transactions on this bus.
@@ -218,21 +216,21 @@ index d4ed3777462a..8b1fcf741411 100644
+ Control Aspeed ast2500 eSPI slave controller to handle event
+ which needs the firmware's processing.
+
- config ASPEED_LPC_CTRL
- depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
- tristate "Aspeed ast2400/2500 HOST LPC to BMC bridge control"
+ config PCI_ENDPOINT_TEST
+ depends on PCI
+ select CRC32
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
-index 7b018962cad3..89b051f82391 100644
+index e13de4f0798f..f91f66a15484 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
-@@ -54,6 +54,7 @@ obj-$(CONFIG_ECHO) += echo/
+@@ -54,6 +54,7 @@ obj-$(CONFIG_GENWQE) += genwqe/
+ obj-$(CONFIG_ECHO) += echo/
obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
obj-$(CONFIG_CXL_BASE) += cxl/
- obj-$(CONFIG_ASPEED_LPC_SIO) += aspeed-lpc-sio.o
+obj-$(CONFIG_ASPEED_ESPI_SLAVE) += aspeed-espi-slave.o
- obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o
- obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
- obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o
+ obj-$(CONFIG_PCI_ENDPOINT_TEST) += pci_endpoint_test.o
+ obj-$(CONFIG_OCXL) += ocxl/
+ obj-y += cardreader/
diff --git a/drivers/misc/aspeed-espi-slave.c b/drivers/misc/aspeed-espi-slave.c
new file mode 100644
index 000000000000..36ae867ca6f9
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0026-Add-support-for-new-PECI-commands.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0026-Add-support-for-new-PECI-commands.patch
index 1532a5642..0e11e1c3e 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0026-Add-support-for-new-PECI-commands.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0026-Add-support-for-new-PECI-commands.patch
@@ -1,29 +1,33 @@
-From d1d221aedb9b366e3477f253386b1cf829c56193 Mon Sep 17 00:00:00 2001
+From 8d5f080b38d1b652eb5fdd3a7b74164906680ab7 Mon Sep 17 00:00:00 2001
From: "Jason M. Bills" <jason.m.bills@intel.com>
Date: Wed, 4 Apr 2018 13:52:39 -0700
Subject: [PATCH] Add support for new PECI commands
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- drivers/peci/peci-core.c | 226 ++++++++++++++++++++++++++++++++++++++++
- include/uapi/linux/peci-ioctl.h | 104 ++++++++++++++++++
- 2 files changed, 330 insertions(+)
+ drivers/peci/peci-core.c | 396 ++++++++++++++++++++++++++++++++++++++++
+ include/uapi/linux/peci-ioctl.h | 146 +++++++++++++++
+ 2 files changed, 542 insertions(+)
diff --git a/drivers/peci/peci-core.c b/drivers/peci/peci-core.c
-index e282f9ef383b..9af11accc1d4 100644
+index d1f0df8b139a..b99ba788a032 100644
--- a/drivers/peci/peci-core.c
+++ b/drivers/peci/peci-core.c
-@@ -345,6 +345,9 @@ static int peci_scan_cmd_mask(struct peci_adapter *adapter)
- adapter->cmd_mask |= BIT(PECI_CMD_GET_TEMP);
- adapter->cmd_mask |= BIT(PECI_CMD_GET_DIB);
- adapter->cmd_mask |= BIT(PECI_CMD_PING);
-+ adapter->cmd_mask |= BIT(PECI_CMD_RD_END_PT_CFG);
-+ adapter->cmd_mask |= BIT(PECI_CMD_CRASHDUMP_DISC);
-+ adapter->cmd_mask |= BIT(PECI_CMD_CRASHDUMP_GET_FRAME);
-
- out:
- peci_put_xfer_msg(msg);
-@@ -693,6 +696,226 @@ static int peci_cmd_wr_pci_cfg_local(struct peci_adapter *adapter, void *vmsg)
+@@ -318,6 +318,12 @@ static int peci_scan_cmd_mask(struct peci_adapter *adapter)
+ * See PECI Spec Table 3-1.
+ */
+ revision = FIELD_GET(REVISION_NUM_MASK, dib);
++ if (revision >= 0x40) { /* Rev. 4.0 */
++ adapter->cmd_mask |= BIT(PECI_CMD_RD_END_PT_CFG);
++ adapter->cmd_mask |= BIT(PECI_CMD_WR_END_PT_CFG);
++ adapter->cmd_mask |= BIT(PECI_CMD_CRASHDUMP_DISC);
++ adapter->cmd_mask |= BIT(PECI_CMD_CRASHDUMP_GET_FRAME);
++ }
+ if (revision >= 0x36) /* Rev. 3.6 */
+ adapter->cmd_mask |= BIT(PECI_CMD_WR_IA_MSR);
+ if (revision >= 0x35) /* Rev. 3.5 */
+@@ -687,6 +693,392 @@ static int peci_cmd_wr_pci_cfg_local(struct peci_adapter *adapter, void *vmsg)
return ret;
}
@@ -32,11 +36,12 @@ index e282f9ef383b..9af11accc1d4 100644
+ struct peci_rd_end_pt_cfg_msg *umsg = vmsg;
+ struct peci_xfer_msg *msg = NULL;
+ u32 address;
++ u8 tx_size;
+ int ret;
+
+ switch (umsg->msg_type) {
-+ case PECI_RDENDPTCFG_TYPE_LOCAL_PCI:
-+ case PECI_RDENDPTCFG_TYPE_PCI:
++ case PECI_ENDPTCFG_TYPE_LOCAL_PCI:
++ case PECI_ENDPTCFG_TYPE_PCI:
+ /*
+ * Per the PECI spec, the read length must be a byte, word,
+ * or dword
@@ -55,7 +60,7 @@ index e282f9ef383b..9af11accc1d4 100644
+ if (!msg)
+ return -ENOMEM;
+
-+ address = umsg->params.pci_cfg.reg; /* [11:0] - Register */
++ address = umsg->params.pci_cfg.reg; /* [11:0] - Register */
+ address |= (u32)umsg->params.pci_cfg.function
+ << 12; /* [14:12] - Function */
+ address |= (u32)umsg->params.pci_cfg.device
@@ -70,7 +75,7 @@ index e282f9ef383b..9af11accc1d4 100644
+ msg->tx_buf[3] = 0x00; /* Endpoint ID */
+ msg->tx_buf[4] = 0x00; /* Reserved */
+ msg->tx_buf[5] = 0x00; /* Reserved */
-+ msg->tx_buf[6] = PECI_RDENDPTCFG_ADDR_TYPE_PCI; /* Addr Type */
++ msg->tx_buf[6] = PECI_ENDPTCFG_ADDR_TYPE_PCI; /* Addr Type */
+ msg->tx_buf[7] = umsg->params.pci_cfg.seg; /* PCI Segment */
+ msg->tx_buf[8] = (u8)address; /* LSB - PCI Config Address */
+ msg->tx_buf[9] = (u8)(address >> 8); /* PCI Config Address */
@@ -79,7 +84,7 @@ index e282f9ef383b..9af11accc1d4 100644
+ (u8)(address >> 24); /* MSB - PCI Config Address */
+ break;
+
-+ case PECI_RDENDPTCFG_TYPE_MMIO:
++ case PECI_ENDPTCFG_TYPE_MMIO:
+ /*
+ * Per the PECI spec, the read length must be a byte, word,
+ * dword, or qword
@@ -96,22 +101,27 @@ index e282f9ef383b..9af11accc1d4 100644
+ * or QWORD
+ */
+ if (umsg->params.mmio.addr_type !=
-+ PECI_RDENDPTCFG_ADDR_TYPE_MMIO_D &&
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_D &&
+ umsg->params.mmio.addr_type !=
-+ PECI_RDENDPTCFG_ADDR_TYPE_MMIO_Q) {
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_Q) {
+ dev_dbg(&adapter->dev,
+ "Invalid address type, addr_type: %d\n",
+ umsg->params.mmio.addr_type);
+ return -EINVAL;
+ }
+
-+ msg = peci_get_xfer_msg(PECI_RDENDPTCFG_MMIO_D_WRITE_LEN,
++ if (umsg->params.mmio.addr_type ==
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_D)
++ tx_size = PECI_RDENDPTCFG_MMIO_D_WRITE_LEN;
++ else
++ tx_size = PECI_RDENDPTCFG_MMIO_Q_WRITE_LEN;
++ msg = peci_get_xfer_msg(tx_size,
+ PECI_RDENDPTCFG_READ_LEN_BASE +
+ umsg->rx_len);
+ if (!msg)
+ return -ENOMEM;
+
-+ address = umsg->params.mmio.function; /* [2:0] - Function */
++ address = umsg->params.mmio.function; /* [2:0] - Function */
+ address |= (u32)umsg->params.mmio.device
+ << 3; /* [7:3] - Device */
+
@@ -135,8 +145,7 @@ index e282f9ef383b..9af11accc1d4 100644
+ msg->tx_buf[13] = (u8)(umsg->params.mmio.offset
+ >> 24); /* MSB - DWORD Register Offset */
+ if (umsg->params.mmio.addr_type ==
-+ PECI_RDENDPTCFG_ADDR_TYPE_MMIO_Q) {
-+ msg->tx_len = PECI_RDENDPTCFG_MMIO_Q_WRITE_LEN;
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_Q) {
+ msg->tx_buf[14] = (u8)(umsg->params.mmio.offset
+ >> 32); /* Register Offset */
+ msg->tx_buf[15] = (u8)(umsg->params.mmio.offset
@@ -163,6 +172,167 @@ index e282f9ef383b..9af11accc1d4 100644
+ return ret;
+}
+
++static int peci_cmd_wr_end_pt_cfg(struct peci_adapter *adapter, void *vmsg)
++{
++ struct peci_wr_end_pt_cfg_msg *umsg = vmsg;
++ struct peci_xfer_msg *msg = NULL;
++ u8 tx_size, aw_fcs;
++ int ret, i, idx;
++ u32 address;
++
++ switch (umsg->msg_type) {
++ case PECI_ENDPTCFG_TYPE_LOCAL_PCI:
++ case PECI_ENDPTCFG_TYPE_PCI:
++ /*
++ * Per the PECI spec, the write length must be a byte, word,
++ * or dword
++ */
++ if (umsg->tx_len != 1 && umsg->tx_len != 2 &&
++ umsg->tx_len != 4) {
++ dev_dbg(&adapter->dev,
++ "Invalid write length, tx_len: %d\n",
++ umsg->tx_len);
++ return -EINVAL;
++ }
++
++ msg = peci_get_xfer_msg(PECI_WRENDPTCFG_PCI_WRITE_LEN_BASE +
++ umsg->tx_len, PECI_WRENDPTCFG_READ_LEN);
++ if (!msg)
++ return -ENOMEM;
++
++ address = umsg->params.pci_cfg.reg; /* [11:0] - Register */
++ address |= (u32)umsg->params.pci_cfg.function
++ << 12; /* [14:12] - Function */
++ address |= (u32)umsg->params.pci_cfg.device
++ << 15; /* [19:15] - Device */
++ address |= (u32)umsg->params.pci_cfg.bus
++ << 20; /* [27:20] - Bus */
++ /* [31:28] - Reserved */
++ msg->addr = umsg->addr;
++ msg->tx_buf[0] = PECI_WRENDPTCFG_CMD;
++ msg->tx_buf[1] = 0x00; /* request byte for Host ID|Retry bit */
++ msg->tx_buf[2] = umsg->msg_type; /* Message Type */
++ msg->tx_buf[3] = 0x00; /* Endpoint ID */
++ msg->tx_buf[4] = 0x00; /* Reserved */
++ msg->tx_buf[5] = 0x00; /* Reserved */
++ msg->tx_buf[6] = PECI_ENDPTCFG_ADDR_TYPE_PCI; /* Addr Type */
++ msg->tx_buf[7] = umsg->params.pci_cfg.seg; /* PCI Segment */
++ msg->tx_buf[8] = (u8)address; /* LSB - PCI Config Address */
++ msg->tx_buf[9] = (u8)(address >> 8); /* PCI Config Address */
++ msg->tx_buf[10] = (u8)(address >> 16); /* PCI Config Address */
++ msg->tx_buf[11] =
++ (u8)(address >> 24); /* MSB - PCI Config Address */
++ for (i = 0; i < umsg->tx_len; i++)
++ msg->tx_buf[12 + i] = (u8)(umsg->value >> (i << 3));
++
++ /* Add an Assured Write Frame Check Sequence byte */
++ ret = peci_aw_fcs(msg, 15 + umsg->tx_len, &aw_fcs);
++ if (ret)
++ goto out;
++
++ msg->tx_buf[12 + i] = 0x80 ^ aw_fcs;
++ break;
++
++ case PECI_ENDPTCFG_TYPE_MMIO:
++ /*
++ * Per the PECI spec, the write length must be a byte, word,
++ * dword, or qword
++ */
++ if (umsg->tx_len != 1 && umsg->tx_len != 2 &&
++ umsg->tx_len != 4 && umsg->tx_len != 8) {
++ dev_dbg(&adapter->dev,
++ "Invalid write length, tx_len: %d\n",
++ umsg->tx_len);
++ return -EINVAL;
++ }
++ /*
++ * Per the PECI spec, the address type must specify either DWORD
++ * or QWORD
++ */
++ if (umsg->params.mmio.addr_type !=
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_D &&
++ umsg->params.mmio.addr_type !=
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_Q) {
++ dev_dbg(&adapter->dev,
++ "Invalid address type, addr_type: %d\n",
++ umsg->params.mmio.addr_type);
++ return -EINVAL;
++ }
++
++ if (umsg->params.mmio.addr_type ==
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_D)
++ tx_size = PECI_WRENDPTCFG_MMIO_D_WRITE_LEN_BASE +
++ umsg->tx_len;
++ else
++ tx_size = PECI_WRENDPTCFG_MMIO_Q_WRITE_LEN_BASE +
++ umsg->tx_len;
++ msg = peci_get_xfer_msg(tx_size, PECI_WRENDPTCFG_READ_LEN);
++ if (!msg)
++ return -ENOMEM;
++
++ address = umsg->params.mmio.function; /* [2:0] - Function */
++ address |= (u32)umsg->params.mmio.device
++ << 3; /* [7:3] - Device */
++
++ msg->addr = umsg->addr;
++ msg->tx_buf[0] = PECI_WRENDPTCFG_CMD;
++ msg->tx_buf[1] = 0x00; /* request byte for Host ID|Retry bit */
++ msg->tx_buf[2] = umsg->msg_type; /* Message Type */
++ msg->tx_buf[3] = 0x00; /* Endpoint ID */
++ msg->tx_buf[4] = 0x00; /* Reserved */
++ msg->tx_buf[5] = umsg->params.mmio.bar; /* BAR # */
++ msg->tx_buf[6] = umsg->params.mmio.addr_type; /* Address Type */
++ msg->tx_buf[7] = umsg->params.mmio.seg; /* PCI Segment */
++ msg->tx_buf[8] = (u8)address; /* Function/Device */
++ msg->tx_buf[9] = umsg->params.mmio.bus; /* PCI Bus */
++ msg->tx_buf[10] = (u8)umsg->params.mmio
++ .offset; /* LSB - Register Offset */
++ msg->tx_buf[11] = (u8)(umsg->params.mmio.offset
++ >> 8); /* Register Offset */
++ msg->tx_buf[12] = (u8)(umsg->params.mmio.offset
++ >> 16); /* Register Offset */
++ msg->tx_buf[13] = (u8)(umsg->params.mmio.offset
++ >> 24); /* MSB - DWORD Register Offset */
++ if (umsg->params.mmio.addr_type ==
++ PECI_ENDPTCFG_ADDR_TYPE_MMIO_Q) {
++ msg->tx_len = PECI_WRENDPTCFG_MMIO_Q_WRITE_LEN_BASE;
++ msg->tx_buf[14] = (u8)(umsg->params.mmio.offset
++ >> 32); /* Register Offset */
++ msg->tx_buf[15] = (u8)(umsg->params.mmio.offset
++ >> 40); /* Register Offset */
++ msg->tx_buf[16] = (u8)(umsg->params.mmio.offset
++ >> 48); /* Register Offset */
++ msg->tx_buf[17] =
++ (u8)(umsg->params.mmio.offset
++ >> 56); /* MSB - QWORD Register Offset */
++ idx = 18;
++ } else {
++ idx = 14;
++ }
++ for (i = 0; i < umsg->tx_len; i++)
++ msg->tx_buf[idx + i] = (u8)(umsg->value >> (i << 3));
++
++ /* Add an Assured Write Frame Check Sequence byte */
++ ret = peci_aw_fcs(msg, idx + 3 + umsg->tx_len, &aw_fcs);
++ if (ret)
++ goto out;
++
++ msg->tx_buf[idx + i] = 0x80 ^ aw_fcs;
++ break;
++
++ default:
++ return -EINVAL;
++ }
++
++ ret = peci_xfer_with_retries(adapter, msg, false);
++
++out:
++ umsg->cc = msg->rx_buf[0];
++ peci_put_xfer_msg(msg);
++
++ return ret;
++}
++
+static int peci_cmd_crashdump_disc(struct peci_adapter *adapter, void *vmsg)
+{
+ struct peci_crashdump_disc_msg *umsg = vmsg;
@@ -250,46 +420,48 @@ index e282f9ef383b..9af11accc1d4 100644
typedef int (*peci_cmd_fn_type)(struct peci_adapter *, void *);
static const peci_cmd_fn_type peci_cmd_fn[PECI_CMD_MAX] = {
-@@ -708,6 +931,9 @@ static const peci_cmd_fn_type peci_cmd_fn[PECI_CMD_MAX] = {
+@@ -702,6 +1094,10 @@ static const peci_cmd_fn_type peci_cmd_fn[PECI_CMD_MAX] = {
peci_cmd_wr_pci_cfg,
peci_cmd_rd_pci_cfg_local,
peci_cmd_wr_pci_cfg_local,
+ peci_cmd_rd_end_pt_cfg,
++ peci_cmd_wr_end_pt_cfg,
+ peci_cmd_crashdump_disc,
+ peci_cmd_crashdump_get_frame,
};
/**
diff --git a/include/uapi/linux/peci-ioctl.h b/include/uapi/linux/peci-ioctl.h
-index 4c28abe2c17a..e67b0735f606 100644
+index 253fb42e38b7..405cd8edbcbf 100644
--- a/include/uapi/linux/peci-ioctl.h
+++ b/include/uapi/linux/peci-ioctl.h
-@@ -72,6 +72,9 @@ enum peci_cmd {
+@@ -71,6 +71,10 @@ enum peci_cmd {
PECI_CMD_WR_PCI_CFG,
PECI_CMD_RD_PCI_CFG_LOCAL,
PECI_CMD_WR_PCI_CFG_LOCAL,
+ PECI_CMD_RD_END_PT_CFG,
++ PECI_CMD_WR_END_PT_CFG,
+ PECI_CMD_CRASHDUMP_DISC,
+ PECI_CMD_CRASHDUMP_GET_FRAME,
PECI_CMD_MAX
};
-@@ -439,6 +442,95 @@ struct peci_wr_pci_cfg_local_msg {
+@@ -438,6 +442,132 @@ struct peci_wr_pci_cfg_local_msg {
__u32 value;
} __attribute__((__packed__));
+struct peci_rd_end_pt_cfg_msg {
-+#define PECI_RDENDPTCFG_PCI_WRITE_LEN 0x0C
-+#define PECI_RDENDPTCFG_MMIO_D_WRITE_LEN 0x0E
-+#define PECI_RDENDPTCFG_MMIO_Q_WRITE_LEN 0x12
++#define PECI_RDENDPTCFG_PCI_WRITE_LEN 12
++#define PECI_RDENDPTCFG_MMIO_D_WRITE_LEN 14
++#define PECI_RDENDPTCFG_MMIO_Q_WRITE_LEN 18
+#define PECI_RDENDPTCFG_READ_LEN_BASE 1
-+#define PECI_RDENDPTCFG_CMD 0xC1
++#define PECI_RDENDPTCFG_CMD 0xc1
+
+ __u8 addr;
+ __u8 msg_type;
-+#define PECI_RDENDPTCFG_TYPE_LOCAL_PCI 0x03
-+#define PECI_RDENDPTCFG_TYPE_PCI 0x04
-+#define PECI_RDENDPTCFG_TYPE_MMIO 0x05
++#define PECI_ENDPTCFG_TYPE_LOCAL_PCI 0x03
++#define PECI_ENDPTCFG_TYPE_PCI 0x04
++#define PECI_ENDPTCFG_TYPE_MMIO 0x05
+
+ union {
+ struct {
@@ -306,9 +478,9 @@ index 4c28abe2c17a..e67b0735f606 100644
+ __u8 function;
+ __u8 bar;
+ __u8 addr_type;
-+#define PECI_RDENDPTCFG_ADDR_TYPE_PCI 0x04
-+#define PECI_RDENDPTCFG_ADDR_TYPE_MMIO_D 0x05
-+#define PECI_RDENDPTCFG_ADDR_TYPE_MMIO_Q 0x06
++#define PECI_ENDPTCFG_ADDR_TYPE_PCI 0x04
++#define PECI_ENDPTCFG_ADDR_TYPE_MMIO_D 0x05
++#define PECI_ENDPTCFG_ADDR_TYPE_MMIO_Q 0x06
+
+ __u64 offset;
+ } mmio;
@@ -319,6 +491,43 @@ index 4c28abe2c17a..e67b0735f606 100644
+ __u8 data[8];
+} __attribute__((__packed__));
+
++struct peci_wr_end_pt_cfg_msg {
++#define PECI_WRENDPTCFG_PCI_WRITE_LEN_BASE 13
++#define PECI_WRENDPTCFG_MMIO_D_WRITE_LEN_BASE 15
++#define PECI_WRENDPTCFG_MMIO_Q_WRITE_LEN_BASE 19
++#define PECI_WRENDPTCFG_READ_LEN 1
++#define PECI_WRENDPTCFG_CMD 0xc5
++
++ __u8 addr;
++ __u8 msg_type;
++ /* See msg_type in struct peci_rd_end_pt_cfg_msg */
++
++ union {
++ struct {
++ __u8 seg;
++ __u8 bus;
++ __u8 device;
++ __u8 function;
++ __u16 reg;
++ } pci_cfg;
++ struct {
++ __u8 seg;
++ __u8 bus;
++ __u8 device;
++ __u8 function;
++ __u8 bar;
++ __u8 addr_type;
++ /* See addr_type in struct peci_rd_end_pt_cfg_msg */
++
++ __u64 offset;
++ } mmio;
++ } params;
++ __u8 tx_len;
++ __u8 cc;
++ __u8 padding[2];
++ __u64 value;
++} __attribute__((__packed__));
++
+/* Crashdump Agent */
+#define PECI_CRASHDUMP_CORE 0x00
+#define PECI_CRASHDUMP_TOR 0x01
@@ -370,7 +579,7 @@ index 4c28abe2c17a..e67b0735f606 100644
#define PECI_IOC_BASE 0xb7
#define PECI_IOC_XFER \
-@@ -479,4 +571,16 @@ struct peci_wr_pci_cfg_local_msg {
+@@ -478,4 +608,20 @@ struct peci_wr_pci_cfg_local_msg {
_IOWR(PECI_IOC_BASE, PECI_CMD_WR_PCI_CFG_LOCAL, \
struct peci_wr_pci_cfg_local_msg)
@@ -378,6 +587,10 @@ index 4c28abe2c17a..e67b0735f606 100644
+ _IOWR(PECI_IOC_BASE, PECI_CMD_RD_END_PT_CFG, \
+ struct peci_rd_end_pt_cfg_msg)
+
++#define PECI_IOC_WR_END_PT_CFG \
++ _IOWR(PECI_IOC_BASE, PECI_IOC_WR_END_PT_CFG, \
++ struct peci_wr_end_pt_cfg_msg)
++
+#define PECI_IOC_CRASHDUMP_DISC \
+ _IOWR(PECI_IOC_BASE, PECI_CMD_CRASHDUMP_DISC, \
+ struct peci_crashdump_disc_msg)
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0028-Add-AST2500-JTAG-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0028-Add-AST2500-JTAG-driver.patch
index 56dca7345..28bc8d36c 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0028-Add-AST2500-JTAG-driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0028-Add-AST2500-JTAG-driver.patch
@@ -1,12 +1,14 @@
-From 43470f186979483ba6c1e6374c7ea3a129622862 Mon Sep 17 00:00:00 2001
+From a4413fe3ba94906243b632e0b9e0e9a91620dd22 Mon Sep 17 00:00:00 2001
From: "Corona, Ernesto" <ernesto.corona@intel.com>
-Date: Mon, 1 Mar 2019 11:46:09 -0700
+Date: Fri, 1 Mar 2019 11:46:09 -0700
Subject: [PATCH] Update AST2500d JTAG driver. Step 1
Update AST2500d JTAG driver. Remove Legacy driver but keep headers.
Signed-off-by: Corona, Ernesto <ernesto.corona@intel.com>
---
+ include/uapi/linux/jtag_drv.h | 73 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 73 insertions(+)
create mode 100644 include/uapi/linux/jtag_drv.h
diff --git a/include/uapi/linux/jtag_drv.h b/include/uapi/linux/jtag_drv.h
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch
index e984623ba..d828233fe 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch
@@ -1,4 +1,4 @@
-From f4c13be7b95899d6eca3fa7ae38224bc9c7d7902 Mon Sep 17 00:00:00 2001
+From 38c04788647a95e3951674eb802f1f99ecdde164 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 29 Jun 2018 11:00:02 -0700
Subject: [PATCH] Add dump debug code into I2C drivers
@@ -15,15 +15,15 @@ echo 1 > /sys/module/i2c_slave_mqueue/parameters/dump_debug
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- drivers/i2c/busses/i2c-aspeed.c | 25 +++++++++++++++++++++++++
- drivers/i2c/i2c-slave-mqueue.c | 22 ++++++++++++++++++++++
- 2 files changed, 47 insertions(+)
+ drivers/i2c/busses/i2c-aspeed.c | 26 ++++++++++++++++++++++++++
+ drivers/i2c/i2c-slave-mqueue.c | 24 ++++++++++++++++++++++++
+ 2 files changed, 50 insertions(+)
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
-index 6c8b38fd6e64..77dbd37b7b51 100644
+index fa66951b05d0..434b753def3b 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
-@@ -166,6 +166,19 @@ struct aspeed_i2c_bus {
+@@ -163,6 +163,21 @@ struct aspeed_i2c_bus {
#endif /* CONFIG_I2C_SLAVE */
};
@@ -31,19 +31,21 @@ index 6c8b38fd6e64..77dbd37b7b51 100644
+static int dump_debug_bus_id __read_mostly;
+
+#define I2C_HEX_DUMP(bus, addr, flags, buf, len) \
-+ if (dump_debug && bus->adap.nr == dump_debug_bus_id) { \
-+ char dump_info[100] = {0,}; \
-+ snprintf(dump_info, sizeof(dump_info), \
-+ "%s (bus_id:%d, addr:0x%02x, flags:0x%02x): ", \
-+ __func__, bus->adap.nr, addr, flags); \
-+ print_hex_dump(KERN_ERR, dump_info, DUMP_PREFIX_NONE, 16, 1, \
-+ buf, len, true); \
-+ }
++ do { \
++ if (dump_debug && (bus)->adap.nr == dump_debug_bus_id) { \
++ char dump_info[100] = {0,}; \
++ snprintf(dump_info, sizeof(dump_info), \
++ "bus_id:%d, addr:0x%02x, flags:0x%02x: ", \
++ (bus)->adap.nr, addr, flags); \
++ print_hex_dump(KERN_ERR, dump_info, DUMP_PREFIX_NONE, \
++ 16, 1, buf, len, true); \
++ } \
++ } while (0)
+
static int aspeed_i2c_reset(struct aspeed_i2c_bus *bus);
static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus)
-@@ -655,6 +668,7 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
+@@ -652,6 +667,7 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
{
struct aspeed_i2c_bus *bus = i2c_get_adapdata(adap);
unsigned long time_left, flags;
@@ -51,7 +53,7 @@ index 6c8b38fd6e64..77dbd37b7b51 100644
spin_lock_irqsave(&bus->lock, flags);
bus->cmd_err = 0;
-@@ -697,6 +711,11 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
+@@ -694,6 +710,11 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
return -ETIMEDOUT;
}
@@ -63,21 +65,20 @@ index 6c8b38fd6e64..77dbd37b7b51 100644
return bus->master_xfer_result;
}
-@@ -1064,6 +1083,12 @@ static struct platform_driver aspeed_i2c_bus_driver = {
+@@ -1061,6 +1082,11 @@ static struct platform_driver aspeed_i2c_bus_driver = {
};
module_platform_driver(aspeed_i2c_bus_driver);
-+module_param_named(dump_debug, dump_debug, bool, S_IRUGO | S_IWUSR);
++module_param_named(dump_debug, dump_debug, bool, 0644);
+MODULE_PARM_DESC(dump_debug, "debug flag for dump printing");
-+module_param_named(dump_debug_bus_id, dump_debug_bus_id, int,
-+ S_IRUGO | S_IWUSR);
++module_param_named(dump_debug_bus_id, dump_debug_bus_id, int, 0644);
+MODULE_PARM_DESC(dump_debug_bus_id, "bus id for dump debug printing");
+
MODULE_AUTHOR("Brendan Higgins <brendanhiggins@google.com>");
MODULE_DESCRIPTION("Aspeed I2C Bus Driver");
MODULE_LICENSE("GPL v2");
diff --git a/drivers/i2c/i2c-slave-mqueue.c b/drivers/i2c/i2c-slave-mqueue.c
-index 6014bca0ff2a..4548088e1922 100644
+index 6014bca0ff2a..2c7a6038409c 100644
--- a/drivers/i2c/i2c-slave-mqueue.c
+++ b/drivers/i2c/i2c-slave-mqueue.c
@@ -21,6 +21,7 @@ struct mq_msg {
@@ -88,7 +89,7 @@ index 6014bca0ff2a..4548088e1922 100644
spinlock_t lock; /* spinlock for queue index handling */
int in;
-@@ -31,6 +32,18 @@ struct mq_queue {
+@@ -31,6 +32,21 @@ struct mq_queue {
struct mq_msg *queue;
};
@@ -96,18 +97,21 @@ index 6014bca0ff2a..4548088e1922 100644
+static int dump_debug_bus_id __read_mostly;
+
+#define I2C_HEX_DUMP(client, buf, len) \
-+ if (dump_debug && client->adapter->nr == dump_debug_bus_id) { \
-+ char dump_info[100] = {0,}; \
-+ snprintf(dump_info, sizeof(dump_info), \
-+ "%s (bus_id:%d): ", __func__, client->adapter->nr); \
-+ print_hex_dump(KERN_ERR, dump_info, DUMP_PREFIX_NONE, 16, 1, \
-+ buf, len, true); \
-+ }
++ do { \
++ if (dump_debug && \
++ (client)->adapter->nr == dump_debug_bus_id) { \
++ char dump_info[100] = {0,}; \
++ snprintf(dump_info, sizeof(dump_info), \
++ "bus_id:%d: ", (client)->adapter->nr); \
++ print_hex_dump(KERN_ERR, dump_info, DUMP_PREFIX_NONE, \
++ 16, 1, buf, len, true); \
++ } \
++ } while (0)
+
static int i2c_slave_mqueue_callback(struct i2c_client *client,
enum i2c_slave_event event, u8 *val)
{
-@@ -101,6 +114,7 @@ static ssize_t i2c_slave_mqueue_bin_read(struct file *filp,
+@@ -101,6 +117,7 @@ static ssize_t i2c_slave_mqueue_bin_read(struct file *filp,
if (msg->len <= count) {
ret = msg->len;
memcpy(buf, msg->buf, ret);
@@ -115,7 +119,7 @@ index 6014bca0ff2a..4548088e1922 100644
} else {
ret = -EOVERFLOW; /* Drop this HUGE one. */
}
-@@ -131,6 +145,8 @@ static int i2c_slave_mqueue_probe(struct i2c_client *client,
+@@ -131,6 +148,8 @@ static int i2c_slave_mqueue_probe(struct i2c_client *client,
BUILD_BUG_ON(!is_power_of_2(MQ_QUEUE_SIZE));
@@ -124,14 +128,13 @@ index 6014bca0ff2a..4548088e1922 100644
buf = devm_kmalloc_array(dev, MQ_QUEUE_SIZE, MQ_MSGBUF_SIZE,
GFP_KERNEL);
if (!buf)
-@@ -212,6 +228,12 @@ static struct i2c_driver i2c_slave_mqueue_driver = {
+@@ -212,6 +231,11 @@ static struct i2c_driver i2c_slave_mqueue_driver = {
};
module_i2c_driver(i2c_slave_mqueue_driver);
-+module_param_named(dump_debug, dump_debug, bool, S_IRUGO | S_IWUSR);
++module_param_named(dump_debug, dump_debug, bool, 0644);
+MODULE_PARM_DESC(dump_debug, "debug flag for dump printing");
-+module_param_named(dump_debug_bus_id, dump_debug_bus_id, int,
-+ S_IRUGO | S_IWUSR);
++module_param_named(dump_debug_bus_id, dump_debug_bus_id, int, 0644);
+MODULE_PARM_DESC(dump_debug_bus_id, "bus id for dump debug printing");
+
MODULE_LICENSE("GPL v2");
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0031-Add-high-speed-baud-rate-support-for-UART.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0031-Add-high-speed-baud-rate-support-for-UART.patch
index 8c9d2dce0..803701286 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0031-Add-high-speed-baud-rate-support-for-UART.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0031-Add-high-speed-baud-rate-support-for-UART.patch
@@ -1,4 +1,4 @@
-From 7baa65c9bf638265874838401e27a7b6179559ff Mon Sep 17 00:00:00 2001
+From 01c8d6a5146cd39c2286f659e21f1a1042aa741a Mon Sep 17 00:00:00 2001
From: Yong Li <yong.b.li@linux.intel.com>
Date: Wed, 2 Jan 2019 15:06:43 +0800
Subject: [PATCH] Add high speed baud rate support for UART
@@ -19,7 +19,7 @@ Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
2 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
-index 5961367..3bbb4fb 100644
+index 42b4df6ba249..97c27820db3e 100644
--- a/drivers/clk/clk-aspeed.c
+++ b/drivers/clk/clk-aspeed.c
@@ -14,7 +14,9 @@
@@ -46,7 +46,7 @@ index 5961367..3bbb4fb 100644
#define ASPEED_STRAP 0x70
#define CLKIN_25MHZ_EN BIT(23)
#define AST2400_CLK_SOURCE_SEL BIT(18)
-@@ -425,7 +433,7 @@ static int aspeed_clk_probe(struct platform_device *pdev)
+@@ -446,7 +454,7 @@ static int aspeed_clk_probe(struct platform_device *pdev)
struct aspeed_reset *ar;
struct regmap *map;
struct clk_hw *hw;
@@ -55,7 +55,7 @@ index 5961367..3bbb4fb 100644
int i, ret;
map = syscon_node_to_regmap(dev->of_node);
-@@ -460,15 +468,23 @@ static int aspeed_clk_probe(struct platform_device *pdev)
+@@ -481,15 +489,23 @@ static int aspeed_clk_probe(struct platform_device *pdev)
/* UART clock div13 setting */
regmap_read(map, ASPEED_MISC_CTRL, &val);
if (val & UART_DIV13_EN)
@@ -82,8 +82,8 @@ index 5961367..3bbb4fb 100644
/*
* Memory controller (M-PLL) PLL. This clock is configured by the
* bootloader, and is exposed to Linux as a read-only clock rate.
-@@ -534,9 +550,22 @@ static int aspeed_clk_probe(struct platform_device *pdev)
- * Video Engine (ECLK) mux and clock divider
+@@ -570,9 +586,22 @@ static int aspeed_clk_probe(struct platform_device *pdev)
+ * UART[1..5] clock source mux
*/
+ /* Get the uart clock source configuration from SCU4C*/
@@ -105,7 +105,7 @@ index 5961367..3bbb4fb 100644
/* Special case: the USB port 1 clock (bit 14) is always
* working the opposite way from the other ones.
-@@ -544,7 +573,7 @@ static int aspeed_clk_probe(struct platform_device *pdev)
+@@ -580,7 +609,7 @@ static int aspeed_clk_probe(struct platform_device *pdev)
gate_flags = (gd->clock_idx == 14) ? 0 : CLK_GATE_SET_TO_DISABLE;
hw = aspeed_clk_hw_register_gate(dev,
gd->name,
@@ -115,7 +115,7 @@ index 5961367..3bbb4fb 100644
map,
gd->clock_idx,
diff --git a/include/dt-bindings/clock/aspeed-clock.h b/include/dt-bindings/clock/aspeed-clock.h
-index f437386..3358795 100644
+index f43738607d77..335879505a72 100644
--- a/include/dt-bindings/clock/aspeed-clock.h
+++ b/include/dt-bindings/clock/aspeed-clock.h
@@ -39,6 +39,8 @@
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0032-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0032-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
index e015f2fd9..8c18e87ef 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0032-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0032-misc-aspeed-Add-Aspeed-UART-routing-control-driver.patch
@@ -1,4 +1,4 @@
-From 37b192b278d5ea5da62b2fcff4fce7cf372e4fe6 Mon Sep 17 00:00:00 2001
+From 0928704f3b593217662f980221406fcf6db39377 Mon Sep 17 00:00:00 2001
From: Oskar Senft <osk@google.com>
Date: Wed, 8 Aug 2018 10:15:05 -0400
Subject: [PATCH] misc: aspeed: Add Aspeed UART routing control driver.
@@ -102,10 +102,10 @@ index 000000000000..afaf17cb7eda
+$ cat /sys/bus/platform/drivers/aspeed-uart-routing/*.uart_routing/uart1
+io1 io2 io3 io4 uart2 [uart3] uart4 io6
diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-index 8aba46cdce46..d184fdf6dda6 100644
+index 4815104459f1..3094e90c9def 100644
--- a/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-intel-purley.dts
-@@ -227,6 +227,10 @@
+@@ -233,6 +233,10 @@
status = "okay";
};
@@ -117,10 +117,10 @@ index 8aba46cdce46..d184fdf6dda6 100644
status = "okay";
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index adde826ac1d9..5606ac1d96d5 100644
+index 0e7f1d2fa08e..6e0b40eb939f 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -479,6 +479,12 @@
+@@ -493,6 +493,12 @@
status = "disabled";
};
};
@@ -134,12 +134,12 @@ index adde826ac1d9..5606ac1d96d5 100644
peci: bus@1e78b000 {
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
-index 8b1fcf741411..60f203c04b9b 100644
+index b6acddaa9421..78e8fc892209 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
-@@ -560,6 +560,12 @@ config NPCM7XX_PCI_MBOX
- Expose the NPCM750/730/715/705 PCI MBOX registers found on
- Nuvoton SOCs to userspace.
+@@ -481,6 +481,12 @@ config ASPEED_ESPI_SLAVE
+ Control Aspeed ast2500 eSPI slave controller to handle event
+ which needs the firmware's processing.
+config ASPEED_UART_ROUTING
+ tristate "Aspeed ast2500 UART routing control"
@@ -147,21 +147,21 @@ index 8b1fcf741411..60f203c04b9b 100644
+ If you want to configure UART routing on Aspeed BMC platforms, enable
+ this option.
+
- source "drivers/misc/c2port/Kconfig"
- source "drivers/misc/eeprom/Kconfig"
- source "drivers/misc/cb710/Kconfig"
+ config PCI_ENDPOINT_TEST
+ depends on PCI
+ select CRC32
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
-index 89b051f82391..8f70b888a9ca 100644
+index f91f66a15484..7337b8bcd0a3 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
-@@ -56,6 +56,7 @@ obj-$(CONFIG_CXL_BASE) += cxl/
+@@ -55,6 +55,7 @@ obj-$(CONFIG_ECHO) += echo/
+ obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
+ obj-$(CONFIG_CXL_BASE) += cxl/
obj-$(CONFIG_ASPEED_ESPI_SLAVE) += aspeed-espi-slave.o
- obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o
- obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
+obj-$(CONFIG_ASPEED_UART_ROUTING) += aspeed-uart-routing.o
- obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o
- obj-$(CONFIG_ASPEED_LPC_SIO) += aspeed-lpc-sio.o
obj-$(CONFIG_PCI_ENDPOINT_TEST) += pci_endpoint_test.o
+ obj-$(CONFIG_OCXL) += ocxl/
+ obj-y += cardreader/
diff --git a/drivers/misc/aspeed-uart-routing.c b/drivers/misc/aspeed-uart-routing.c
new file mode 100644
index 000000000000..21ef5d98c317
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0034-arm-dts-aspeed-Swap-the-mac-nodes-numbering.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0034-arm-dts-aspeed-Swap-the-mac-nodes-numbering.patch
index b819be69b..7f556de64 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0034-arm-dts-aspeed-Swap-the-mac-nodes-numbering.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0034-arm-dts-aspeed-Swap-the-mac-nodes-numbering.patch
@@ -1,4 +1,4 @@
-From 9c509b9450f641c169ee3aeb60e398c43810dcb2 Mon Sep 17 00:00:00 2001
+From fcea191a6e0eb869c62b5d1ea8a6e914a540fcfb Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 3 Oct 2018 10:17:58 -0700
Subject: [PATCH] arm: dts: aspeed: Swap the mac nodes numbering
@@ -13,7 +13,7 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index 22eab8a952ed..004bbb08dd4a 100644
+index 3df43f925848..618abeab539b 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
@@ -101,14 +101,6 @@
@@ -47,10 +47,10 @@ index 22eab8a952ed..004bbb08dd4a 100644
compatible = "aspeed,ast2400-ehci", "generic-ehci";
reg = <0x1e6a1000 0x100>;
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index 92843cc1a8f4..30a7f349feeb 100644
+index 6e0b40eb939f..b8c85fad2a39 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -142,14 +142,6 @@
+@@ -149,14 +149,6 @@
reg = <0x1e6c2000 0x80>;
};
@@ -65,7 +65,7 @@ index 92843cc1a8f4..30a7f349feeb 100644
mac1: ethernet@1e680000 {
compatible = "aspeed,ast2500-mac", "faraday,ftgmac100";
reg = <0x1e680000 0x180>;
-@@ -158,6 +150,14 @@
+@@ -165,6 +157,14 @@
status = "disabled";
};
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0035-Implement-a-memory-driver-share-memory.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0035-Implement-a-memory-driver-share-memory.patch
index bb6465023..798038a8e 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0035-Implement-a-memory-driver-share-memory.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0035-Implement-a-memory-driver-share-memory.patch
@@ -1,4 +1,4 @@
-From dae410353f8681b58907c61eb2eb056513d86f6d Mon Sep 17 00:00:00 2001
+From 5ccf8e3e397edf195aa65e91af6e9ea16ed88882 Mon Sep 17 00:00:00 2001
From: Cheng C Yang <cheng.c.yang@intel.com>
Date: Fri, 9 Nov 2018 10:24:37 +0800
Subject: [PATCH] Implement a memory driver share memory
@@ -10,19 +10,19 @@ memory through this driver.
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
---
- .../devicetree/bindings/misc/vga-shared-memory.txt | 20 +++
- drivers/misc/Kconfig | 10 ++
- drivers/misc/Makefile | 1 +
- drivers/misc/aspeed-vga-sharedmem.c | 164 +++++++++++++++++++++
- 4 files changed, 195 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/misc/vga-shared-memory.txt
- create mode 100644 drivers/misc/aspeed-vga-sharedmem.c
+ .../bindings/soc/aspeed/aspeed-vga-sharedmem.txt | 20 +++
+ drivers/soc/aspeed/Kconfig | 9 ++
+ drivers/soc/aspeed/Makefile | 1 +
+ drivers/soc/aspeed/aspeed-vga-sharedmem.c | 163 +++++++++++++++++++++
+ 4 files changed, 193 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed-vga-sharedmem.txt
+ create mode 100644 drivers/soc/aspeed/aspeed-vga-sharedmem.c
-diff --git a/Documentation/devicetree/bindings/misc/vga-shared-memory.txt b/Documentation/devicetree/bindings/misc/vga-shared-memory.txt
+diff --git a/Documentation/devicetree/bindings/soc/aspeed/aspeed-vga-sharedmem.txt b/Documentation/devicetree/bindings/soc/aspeed/aspeed-vga-sharedmem.txt
new file mode 100644
index 000000000000..03f57c53e844
--- /dev/null
-+++ b/Documentation/devicetree/bindings/misc/vga-shared-memory.txt
++++ b/Documentation/devicetree/bindings/soc/aspeed/aspeed-vga-sharedmem.txt
@@ -0,0 +1,20 @@
+* Aspeed VGA shared memory driver
+
@@ -44,45 +44,40 @@ index 000000000000..03f57c53e844
+ compatible = "aspeed,ast2500-vga-sharedmem";
+ reg = <0x9ff00000 0x100000>;
+};
-diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
-index 60f203c04b9b..2d4c6ba87e70 100644
---- a/drivers/misc/Kconfig
-+++ b/drivers/misc/Kconfig
-@@ -566,6 +566,16 @@ config ASPEED_UART_ROUTING
- If you want to configure UART routing on Aspeed BMC platforms, enable
- this option.
+diff --git a/drivers/soc/aspeed/Kconfig b/drivers/soc/aspeed/Kconfig
+index 285c19042c65..59f25d16d6e7 100644
+--- a/drivers/soc/aspeed/Kconfig
++++ b/drivers/soc/aspeed/Kconfig
+@@ -51,4 +51,13 @@ config ASPEED_P2A_CTRL
+ ioctl()s, the driver also provides an interface for userspace mappings to
+ a pre-defined region.
+config ASPEED_VGA_SHAREDMEM
+ tristate "Aspeed VGA Shared memory"
-+ depends on (ARCH_ASPEED || COMPILE_TEST)
++ depends on SOC_ASPEED
+ help
+ To access VGA shared memory on Aspeed BMC, enable this option.
+ This driver used by ManagedDataRegionlV2 specification. In the
-+ specification, BIOS will transfer whole SMBIOS table to VGA
-+ memory, and BMC can get the table from VGA memory through this
-+ driver.
-+
- source "drivers/misc/c2port/Kconfig"
- source "drivers/misc/eeprom/Kconfig"
- source "drivers/misc/cb710/Kconfig"
-diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
-index 8f70b888a9ca..30ee065491ef 100644
---- a/drivers/misc/Makefile
-+++ b/drivers/misc/Makefile
-@@ -55,6 +55,7 @@ obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpres
- obj-$(CONFIG_CXL_BASE) += cxl/
++ specification, BIOS will transfer whole SMBIOS table to VGA memory,
++ and BMC can get the table from VGA memory through this driver.
++
+ endmenu
+diff --git a/drivers/soc/aspeed/Makefile b/drivers/soc/aspeed/Makefile
+index 2e547cc47e62..ae4ef10914be 100644
+--- a/drivers/soc/aspeed/Makefile
++++ b/drivers/soc/aspeed/Makefile
+@@ -5,3 +5,4 @@ obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o
obj-$(CONFIG_ASPEED_LPC_SIO) += aspeed-lpc-sio.o
- obj-$(CONFIG_ASPEED_ESPI_SLAVE) += aspeed-espi-slave.o
-+obj-$(CONFIG_ASPEED_VGA_SHAREDMEM) += aspeed-vga-sharedmem.o
- obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o
obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
- obj-$(CONFIG_ASPEED_UART_ROUTING) += aspeed-uart-routing.o
-diff --git a/drivers/misc/aspeed-vga-sharedmem.c b/drivers/misc/aspeed-vga-sharedmem.c
+ obj-$(CONFIG_ASPEED_P2A_CTRL) += aspeed-p2a-ctrl.o
++obj-$(CONFIG_ASPEED_VGA_SHAREDMEM) += aspeed-vga-sharedmem.o
+\ No newline at end of file
+diff --git a/drivers/soc/aspeed/aspeed-vga-sharedmem.c b/drivers/soc/aspeed/aspeed-vga-sharedmem.c
new file mode 100644
-index 000000000000..76f60cd67d3a
+index 000000000000..cd1f5431378c
--- /dev/null
-+++ b/drivers/misc/aspeed-vga-sharedmem.c
-@@ -0,0 +1,164 @@
++++ b/drivers/soc/aspeed/aspeed-vga-sharedmem.c
+@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2018 Intel Corporation
@@ -112,11 +107,11 @@ index 000000000000..76f60cd67d3a
+
+static int vga_open(struct inode *inode, struct file *file)
+{
++ struct aspeed_vga_sharedmem *vga_sharedmem = file_sharemem(file);
++
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
-+ struct aspeed_vga_sharedmem *vga_sharedmem = file_sharemem(file);
-+
+ if (!vga_sharedmem->mmap_enable)
+ return -EPERM;
+
@@ -193,7 +188,6 @@ index 000000000000..76f60cd67d3a
+{
+ struct aspeed_vga_sharedmem *vga_sharedmem;
+ struct device *dev = &pdev->dev;
-+ u32 reg[2];
+ struct resource *rc;
+
+ vga_sharedmem = devm_kzalloc(dev, sizeof(*vga_sharedmem), GFP_KERNEL);
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0039-Add-Aspeed-PWM-driver-which-uses-FTTMR010-timer-IP.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0039-Add-Aspeed-PWM-driver-which-uses-FTTMR010-timer-IP.patch
index 3e8f86666..c115d23d0 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0039-Add-Aspeed-PWM-driver-which-uses-FTTMR010-timer-IP.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0039-Add-Aspeed-PWM-driver-which-uses-FTTMR010-timer-IP.patch
@@ -1,4 +1,4 @@
-From ef2e1d9d2e8c97daf806f4da74738a84de054116 Mon Sep 17 00:00:00 2001
+From 7ac4709dd92c608ca4c8ff0046a434c8f465a80c Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Mon, 11 Feb 2019 17:02:35 -0800
Subject: [PATCH] Add Aspeed PWM driver which uses FTTMR010 timer IP
@@ -13,15 +13,15 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
arch/arm/boot/dts/aspeed-g5.dtsi | 2 +-
drivers/pwm/Kconfig | 9 +
drivers/pwm/Makefile | 1 +
- drivers/pwm/pwm-fttmr010.c | 437 +++++++++++++++++++++++++++++++++++++++
- 4 files changed, 448 insertions(+), 1 deletion(-)
+ drivers/pwm/pwm-fttmr010.c | 441 +++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 452 insertions(+), 1 deletion(-)
create mode 100644 drivers/pwm/pwm-fttmr010.c
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index 8a7c4257b917..c24197232385 100644
+index b8c85fad2a39..88ac8e08b6ae 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -300,7 +300,7 @@
+@@ -312,7 +312,7 @@
timer: timer@1e782000 {
/* This timer is a Faraday FTTMR010 derivative */
@@ -31,10 +31,10 @@ index 8a7c4257b917..c24197232385 100644
interrupts = <16 17 18 35 36 37 38 39>;
clocks = <&syscon ASPEED_CLK_APB>;
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
-index a8f47df0655a..92a8fbebe2d9 100644
+index dff5a93f7daa..5759439a3947 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
-@@ -170,6 +170,15 @@ config PWM_FSL_FTM
+@@ -171,6 +171,15 @@ config PWM_FSL_FTM
To compile this driver as a module, choose M here: the module
will be called pwm-fsl-ftm.
@@ -51,7 +51,7 @@ index a8f47df0655a..92a8fbebe2d9 100644
tristate "HiSilicon BVT PWM support"
depends on ARCH_HISI || COMPILE_TEST
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
-index 9c676a0dadf5..13b7b20ad5ab 100644
+index c368599d36c0..937d212bb02a 100644
--- a/drivers/pwm/Makefile
+++ b/drivers/pwm/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_PWM_CRC) += pwm-crc.o
@@ -61,13 +61,13 @@ index 9c676a0dadf5..13b7b20ad5ab 100644
+obj-$(CONFIG_PWM_FTTMR010) += pwm-fttmr010.o
obj-$(CONFIG_PWM_HIBVT) += pwm-hibvt.o
obj-$(CONFIG_PWM_IMG) += pwm-img.o
- obj-$(CONFIG_PWM_IMX) += pwm-imx.o
+ obj-$(CONFIG_PWM_IMX1) += pwm-imx1.o
diff --git a/drivers/pwm/pwm-fttmr010.c b/drivers/pwm/pwm-fttmr010.c
new file mode 100644
-index 000000000000..32e508c962dc
+index 000000000000..4c929a25e27c
--- /dev/null
+++ b/drivers/pwm/pwm-fttmr010.c
-@@ -0,0 +1,437 @@
+@@ -0,0 +1,441 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2019 Intel Corporation
+
@@ -192,7 +192,6 @@ index 000000000000..32e508c962dc
+static int pwm_fttmr010_enable(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+ struct pwm_fttmr010 *priv = to_pwm_fttmr010(chip);
-+ ulong flags;
+ u32 cr;
+
+ cr = readl(priv->base + TIMER_CR);
@@ -210,6 +209,8 @@ index 000000000000..32e508c962dc
+ case 8:
+ cr |= (TIMER_8_CR_ASPEED_ENABLE | TIMER_8_CR_ASPEED_PULSE_OUT);
+ break;
++ default:
++ return -ERANGE;
+ }
+
+ writel(cr, priv->base + TIMER_CR);
@@ -221,7 +222,6 @@ index 000000000000..32e508c962dc
+static void pwm_fttmr010_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+ struct pwm_fttmr010 *priv = to_pwm_fttmr010(chip);
-+ ulong flags;
+ u32 cr;
+
+ cr = readl(priv->base + TIMER_CR);
@@ -239,6 +239,8 @@ index 000000000000..32e508c962dc
+ case 8:
+ cr &= ~(TIMER_8_CR_ASPEED_ENABLE | TIMER_8_CR_ASPEED_PULSE_OUT);
+ break;
++ default:
++ return;
+ }
+
+ writel(cr, priv->base + TIMER_CR);
@@ -309,6 +311,8 @@ index 000000000000..32e508c962dc
+ lreg_offset = TIMER8_ASPEED_LOAD;
+ mreg_offset = TIMER8_ASPEED_MATCH1;
+ break;
++ default:
++ return -ERANGE;
+ }
+
+ writel(tload, priv->base + creg_offset);
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0040-i2c-Add-mux-hold-unhold-msg-types.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0040-i2c-Add-mux-hold-unhold-msg-types.patch
index 1b86e9c04..b2057d247 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0040-i2c-Add-mux-hold-unhold-msg-types.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0040-i2c-Add-mux-hold-unhold-msg-types.patch
@@ -1,4 +1,4 @@
-From 80ea6461d77e5b415d9f83fa2f4708fc21eab09b Mon Sep 17 00:00:00 2001
+From ed13e7eb07e6cb8bdc1eb4563de30b469a9beb26 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Fri, 15 Feb 2019 16:05:09 -0800
Subject: [PATCH] i2c: Add mux hold/unhold msg types
@@ -39,19 +39,19 @@ in downstream only.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- drivers/i2c/i2c-core-base.c | 99 ++++++++++++++++++++++++++++++++++-----
- drivers/i2c/i2c-core-smbus.c | 17 ++++++-
+ drivers/i2c/i2c-core-base.c | 70 +++++++++++++++++++++++++--
+ drivers/i2c/i2c-core-smbus.c | 22 +++++++--
drivers/i2c/i2c-mux.c | 109 +++++++++++++++++++++++++++++++++++++++----
include/linux/i2c-mux.h | 3 ++
include/linux/i2c.h | 25 ++++++++++
include/uapi/linux/i2c.h | 1 +
- 6 files changed, 233 insertions(+), 21 deletions(-)
+ 6 files changed, 214 insertions(+), 16 deletions(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
-index 28460f6a60cc..009b0507768e 100644
+index 9e43508d4567..8a480d269542 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
-@@ -1210,6 +1210,25 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr)
+@@ -1299,6 +1299,25 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr)
}
EXPORT_SYMBOL_GPL(i2c_handle_smbus_host_notify);
@@ -77,7 +77,7 @@ index 28460f6a60cc..009b0507768e 100644
static int i2c_register_adapter(struct i2c_adapter *adap)
{
int res = -EINVAL;
-@@ -1291,6 +1310,9 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
+@@ -1381,6 +1400,9 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
bus_for_each_drv(&i2c_bus_type, NULL, adap, __process_new_adapter);
mutex_unlock(&core_lock);
@@ -87,7 +87,7 @@ index 28460f6a60cc..009b0507768e 100644
return 0;
out_reg:
-@@ -1511,6 +1533,8 @@ void i2c_del_adapter(struct i2c_adapter *adap)
+@@ -1601,6 +1623,8 @@ void i2c_del_adapter(struct i2c_adapter *adap)
idr_remove(&i2c_adapter_idr, adap->nr);
mutex_unlock(&core_lock);
@@ -96,7 +96,7 @@ index 28460f6a60cc..009b0507768e 100644
/* Clear the device structure in case this adapter is ever going to be
added again */
memset(&adap->dev, 0, sizeof(adap->dev));
-@@ -1860,7 +1884,9 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs,
+@@ -1950,7 +1974,9 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs,
*/
int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
@@ -106,7 +106,7 @@ index 28460f6a60cc..009b0507768e 100644
int ret, try;
if (WARN_ON(!msgs || num < 1))
-@@ -1869,6 +1895,25 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+@@ -1963,6 +1989,25 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
if (adap->quirks && i2c_check_for_quirks(adap, msgs, num))
return -EOPNOTSUPP;
@@ -132,7 +132,7 @@ index 28460f6a60cc..009b0507768e 100644
/*
* i2c_trace_msg_key gets enabled when tracepoint i2c_transfer gets
* enabled. This is an efficient way of keeping the for-loop from
-@@ -1901,6 +1946,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+@@ -1999,6 +2044,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
trace_i2c_result(adap, num, ret);
}
@@ -142,7 +142,7 @@ index 28460f6a60cc..009b0507768e 100644
return ret;
}
EXPORT_SYMBOL(__i2c_transfer);
-@@ -1919,6 +1967,7 @@ EXPORT_SYMBOL(__i2c_transfer);
+@@ -2017,6 +2065,7 @@ EXPORT_SYMBOL(__i2c_transfer);
*/
int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
@@ -150,77 +150,50 @@ index 28460f6a60cc..009b0507768e 100644
int ret;
if (!adap->algo->master_xfer) {
-@@ -1942,19 +1991,47 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+@@ -2040,12 +2089,25 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
* one (discarding status on the second message) or errno
* (discarding status on the first one).
*/
-- if (in_atomic() || irqs_disabled()) {
-- ret = i2c_trylock_bus(adap, I2C_LOCK_SEGMENT);
-- if (!ret)
-- /* I2C activity is ongoing. */
-- return -EAGAIN;
-- } else {
-- i2c_lock_bus(adap, I2C_LOCK_SEGMENT);
-- }
-
-- ret = __i2c_transfer(adap, msgs, num);
-- i2c_unlock_bus(adap, I2C_LOCK_SEGMENT);
-+ if (adap->algo->master_xfer) {
-+#ifdef DEBUG
-+ for (ret = 0; ret < num; ret++) {
-+ dev_dbg(&adap->dev,
-+ "master_xfer[%d] %c, addr=0x%02x, len=%d%s\n",
-+ ret, (msgs[ret].flags & I2C_M_RD) ? 'R' : 'W',
-+ msgs[ret].addr, msgs[ret].len,
-+ (msgs[ret].flags & I2C_M_RECV_LEN) ? "+" : "");
-+ }
-+#endif
-+ /*
-+ * Do not lock a bus for delivering an unhold msg to a mux
-+ * adpater. This is just for a single length unhold msg case.
-+ */
-+ if (num == 1 && i2c_parent_is_i2c_adapter(adap) &&
-+ i2c_check_hold_msg(msgs[0].flags, msgs[0].len,
-+ (u16 *)msgs[0].buf) ==
-+ I2C_HOLD_MSG_RESET)
-+ do_bus_lock = false;
-+
-+ if (do_bus_lock) {
-+ if (in_atomic() || irqs_disabled()) {
-+ ret = i2c_trylock_bus(adap, I2C_LOCK_SEGMENT);
-+ if (!ret)
-+ /* I2C activity is ongoing. */
-+ return -EAGAIN;
-+ } else {
-+ i2c_lock_bus(adap, I2C_LOCK_SEGMENT);
-+ }
-+ }
-
-- return ret;
-+ ret = __i2c_transfer(adap, msgs, num);
-+ if (do_bus_lock)
-+ i2c_unlock_bus(adap, I2C_LOCK_SEGMENT);
+- ret = __i2c_lock_bus_helper(adap);
+- if (ret)
+- return ret;
++ /*
++ * Do not lock a bus for delivering an unhold msg to a mux
++ * adpater. This is just for a single length unhold msg case.
++ */
++ if (num == 1 && i2c_parent_is_i2c_adapter(adap) &&
++ i2c_check_hold_msg(msgs[0].flags, msgs[0].len,
++ (u16 *)msgs[0].buf) ==
++ I2C_HOLD_MSG_RESET)
++ do_bus_lock = false;
+
-+ return ret;
-+ } else {
-+ dev_dbg(&adap->dev, "I2C level transfers not supported\n");
-+ return -EOPNOTSUPP;
++ if (do_bus_lock) {
++ ret = __i2c_lock_bus_helper(adap);
++ if (ret)
++ return ret;
+ }
- }
- EXPORT_SYMBOL(i2c_transfer);
+ ret = __i2c_transfer(adap, msgs, num);
+- i2c_unlock_bus(adap, I2C_LOCK_SEGMENT);
++ if (do_bus_lock)
++ i2c_unlock_bus(adap, I2C_LOCK_SEGMENT);
+
+ return ret;
+ }
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c
-index 9cd66cabb84f..64c58911bf21 100644
+index 3ac426a8ab5a..f7bf95101e34 100644
--- a/drivers/i2c/i2c-core-smbus.c
+++ b/drivers/i2c/i2c-core-smbus.c
-@@ -528,12 +528,25 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
+@@ -526,15 +526,29 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
unsigned short flags, char read_write,
u8 command, int protocol, union i2c_smbus_data *data)
{
+ bool do_bus_lock = true;
s32 res;
-- i2c_lock_bus(adapter, I2C_LOCK_SEGMENT);
+- res = __i2c_lock_bus_helper(adapter);
+- if (res)
+- return res;
+ /*
+ * Do not lock a bus for delivering an unhold msg to a mux adpater.
+ * This is just for a single length unhold msg case.
@@ -231,8 +204,12 @@ index 9cd66cabb84f..64c58911bf21 100644
+ &data->word) == I2C_HOLD_MSG_RESET)
+ do_bus_lock = false;
+
-+ if (do_bus_lock)
-+ i2c_lock_bus(adapter, I2C_LOCK_SEGMENT);
++ if (do_bus_lock) {
++ res = __i2c_lock_bus_helper(adapter);
++ if (res)
++ return res;
++ }
+
res = __i2c_smbus_xfer(adapter, addr, flags, read_write,
command, protocol, data);
- i2c_unlock_bus(adapter, I2C_LOCK_SEGMENT);
@@ -242,7 +219,7 @@ index 9cd66cabb84f..64c58911bf21 100644
return res;
}
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
-index f330690b4125..4d8909a0f90a 100644
+index 603252fa1284..d3f55243e701 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -26,6 +26,7 @@
@@ -430,7 +407,7 @@ index f330690b4125..4d8909a0f90a 100644
return muxc;
}
EXPORT_SYMBOL_GPL(i2c_mux_alloc);
-@@ -435,6 +526,8 @@ void i2c_mux_del_adapters(struct i2c_mux_core *muxc)
+@@ -441,6 +532,8 @@ void i2c_mux_del_adapters(struct i2c_mux_core *muxc)
{
char symlink_name[20];
@@ -440,10 +417,10 @@ index f330690b4125..4d8909a0f90a 100644
struct i2c_adapter *adap = muxc->adapter[--muxc->num_adapters];
struct i2c_mux_priv *priv = adap->algo_data;
diff --git a/include/linux/i2c-mux.h b/include/linux/i2c-mux.h
-index bd74d5706f3b..bc6f778eaf9d 100644
+index c5a977320f82..47f8763d6ed2 100644
--- a/include/linux/i2c-mux.h
+++ b/include/linux/i2c-mux.h
-@@ -41,6 +41,9 @@ struct i2c_mux_core {
+@@ -27,6 +27,9 @@ struct i2c_mux_core {
int (*select)(struct i2c_mux_core *, u32 chan_id);
int (*deselect)(struct i2c_mux_core *, u32 chan_id);
@@ -454,10 +431,10 @@ index bd74d5706f3b..bc6f778eaf9d 100644
int max_adapters;
struct i2c_adapter *adapter[0];
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
-index 65b4eaed1d96..eadde70c0d4a 100644
+index 1308126fc384..3ee92c6a442d 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
-@@ -692,6 +692,13 @@ struct i2c_adapter {
+@@ -699,6 +699,13 @@ struct i2c_adapter {
const struct i2c_adapter_quirks *quirks;
struct irq_domain *host_notify_domain;
@@ -471,7 +448,7 @@ index 65b4eaed1d96..eadde70c0d4a 100644
};
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
-@@ -949,4 +956,22 @@ static inline struct i2c_client *i2c_acpi_new_device(struct device *dev,
+@@ -998,4 +1005,22 @@ static inline struct i2c_client *i2c_acpi_new_device(struct device *dev,
}
#endif /* CONFIG_ACPI */
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0041-Enable-passthrough-based-gpio-character-device.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0041-Enable-passthrough-based-gpio-character-device.patch
deleted file mode 100644
index 7a4b090ec..000000000
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0041-Enable-passthrough-based-gpio-character-device.patch
+++ /dev/null
@@ -1,287 +0,0 @@
-From 554bc7a7c7aa6e0c0ec49a24063102e17954d06c Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Thu, 31 Jan 2019 17:47:39 +0800
-Subject: [PATCH] Enable passthrough based gpio character device.
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
----
- drivers/gpio/gpio-aspeed.c | 47 ++++++++++++++++++++++++++++--
- drivers/gpio/gpiolib.c | 51 +++++++++++++++++++++++++++++++--
- drivers/gpio/gpiolib.h | 1 +
- include/linux/gpio/consumer.h | 9 ++++++
- include/linux/pinctrl/pinconf-generic.h | 2 ++
- include/uapi/linux/gpio.h | 1 +
- 6 files changed, 106 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
-index 854bce4fb9e7..5f1bce3a9274 100644
---- a/drivers/gpio/gpio-aspeed.c
-+++ b/drivers/gpio/gpio-aspeed.c
-@@ -17,9 +17,11 @@
- #include <linux/init.h>
- #include <linux/io.h>
- #include <linux/kernel.h>
-+#include <linux/mfd/syscon.h>
- #include <linux/module.h>
- #include <linux/pinctrl/consumer.h>
- #include <linux/platform_device.h>
-+#include <linux/regmap.h>
- #include <linux/spinlock.h>
- #include <linux/string.h>
-
-@@ -58,6 +60,7 @@ struct aspeed_gpio {
- struct gpio_chip chip;
- spinlock_t lock;
- void __iomem *base;
-+ struct regmap *scu;
- int irq;
- const struct aspeed_gpio_config *config;
-
-@@ -91,6 +94,13 @@ struct aspeed_gpio_bank {
- * and thus can be used to read back what was last written
- * reliably.
- */
-+#define SCU8C 0x8C /* Multi-function Pin Control #4 */
-+#define PASS_THROUGH1 32
-+#define PASS_THROUGH2 34
-+#define PASS_THROUGH2_MASK 0x2000
-+#define PASS_THROUGH1_MASK 0x1000
-+#define PASS_THROUGH2_ON 0x2000
-+#define PASS_THROUGH1_ON 0x1000
-
- static const int debounce_timers[4] = { 0x00, 0x50, 0x54, 0x58 };
-
-@@ -988,12 +998,38 @@ static int set_debounce(struct gpio_chip *chip, unsigned int offset,
- return disable_debounce(chip, offset);
- }
-
-+static int aspeed_gpio_pass_through(struct gpio_chip *chip, unsigned int offset,
-+ unsigned long param)
-+{
-+ struct aspeed_gpio *gpio = gpiochip_get_data(chip);
-+ u32 value;
-+
-+ if (!gpio->scu)
-+ return -ENOTSUPP;
-+ if (param == PIN_CONFIG_PASS_THROUGH_ENABLE){
-+ if (offset == PASS_THROUGH2){
-+ regmap_update_bits(gpio->scu, SCU8C, PASS_THROUGH2_MASK, PASS_THROUGH2_ON);
-+ } else if (offset == PASS_THROUGH1){
-+ regmap_update_bits(gpio->scu, SCU8C, PASS_THROUGH1_MASK, PASS_THROUGH1_ON);
-+ }
-+ } else if (param == PIN_CONFIG_PASS_THROUGH_DISABLE){
-+ if (offset == PASS_THROUGH2){
-+ regmap_update_bits(gpio->scu, SCU8C, PASS_THROUGH2_MASK, ~(PASS_THROUGH2_ON));
-+ } else if (offset == PASS_THROUGH1){
-+ regmap_update_bits(gpio->scu, SCU8C, PASS_THROUGH1_MASK, ~(PASS_THROUGH1_ON));
-+ }
-+ } else {
-+ return -ENOTSUPP;
-+ }
-+
-+ return 0;
-+}
-+
- static int aspeed_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
- unsigned long config)
- {
- unsigned long param = pinconf_to_config_param(config);
- u32 arg = pinconf_to_config_argument(config);
--
- if (param == PIN_CONFIG_INPUT_DEBOUNCE)
- return set_debounce(chip, offset, arg);
- else if (param == PIN_CONFIG_BIAS_DISABLE ||
-@@ -1006,6 +1042,9 @@ static int aspeed_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
- return -ENOTSUPP;
- else if (param == PIN_CONFIG_PERSIST_STATE)
- return aspeed_gpio_reset_tolerance(chip, offset, arg);
-+ else if (param == PIN_CONFIG_PASS_THROUGH_ENABLE ||
-+ param == PIN_CONFIG_PASS_THROUGH_DISABLE)
-+ return aspeed_gpio_pass_through(chip, offset, param);
-
- return -ENOTSUPP;
- }
-@@ -1167,7 +1206,11 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
- gpio->base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(gpio->base))
- return PTR_ERR(gpio->base);
--
-+ gpio->scu = syscon_regmap_lookup_by_compatible("aspeed,ast2500-scu");
-+ if (IS_ERR(gpio->scu)) {
-+ dev_err(&pdev->dev, "Failed to find SCU regmap\n");
-+ gpio->scu = NULL;
-+ }
- spin_lock_init(&gpio->lock);
-
- gpio_id = of_match_node(aspeed_gpio_of_table, pdev->dev.of_node);
-diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index d1adfdf50fb3..4f9fdd25c6d7 100644
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -428,6 +428,7 @@ struct linehandle_state {
- GPIOHANDLE_REQUEST_OUTPUT | \
- GPIOHANDLE_REQUEST_ACTIVE_LOW | \
- GPIOHANDLE_REQUEST_OPEN_DRAIN | \
-+ GPIOHANDLE_REQUEST_PASS_THROUGH | \
- GPIOHANDLE_REQUEST_OPEN_SOURCE)
-
- static long linehandle_ioctl(struct file *filep, unsigned int cmd,
-@@ -530,7 +531,6 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
- return -EINVAL;
-
- lflags = handlereq.flags;
--
- /* Return an error if an unknown flag is set */
- if (lflags & ~GPIOHANDLE_REQUEST_VALID_FLAGS)
- return -EINVAL;
-@@ -590,6 +590,8 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
- set_bit(FLAG_OPEN_DRAIN, &desc->flags);
- if (lflags & GPIOHANDLE_REQUEST_OPEN_SOURCE)
- set_bit(FLAG_OPEN_SOURCE, &desc->flags);
-+ if (lflags & GPIOHANDLE_REQUEST_PASS_THROUGH)
-+ set_bit(FLAG_PASS_THROUGH, &desc->flags);
-
- ret = gpiod_set_transitory(desc, false);
- if (ret < 0)
-@@ -609,6 +611,11 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
- ret = gpiod_direction_input(desc);
- if (ret)
- goto out_free_descs;
-+ } else if (lflags & GPIOHANDLE_REQUEST_PASS_THROUGH) {
-+ int val = !!handlereq.default_values[i];
-+ ret = gpiod_direction_pass_through(desc, val);
-+ if (ret)
-+ goto out_free_descs;
- }
- dev_dbg(&gdev->dev, "registered chardev handle for line %d\n",
- offset);
-@@ -1027,7 +1034,6 @@ static long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
- struct gpio_device *gdev = filp->private_data;
- struct gpio_chip *chip = gdev->chip;
- void __user *ip = (void __user *)arg;
--
- /* We fail any subsequent ioctl():s when the chip is gone */
- if (!chip)
- return -ENODEV;
-@@ -1035,7 +1041,6 @@ static long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
- /* Fill in the struct and pass to userspace */
- if (cmd == GPIO_GET_CHIPINFO_IOCTL) {
- struct gpiochip_info chipinfo;
--
- memset(&chipinfo, 0, sizeof(chipinfo));
-
- strncpy(chipinfo.name, dev_name(&gdev->dev),
-@@ -2709,6 +2714,46 @@ int gpiod_direction_output(struct gpio_desc *desc, int value)
- EXPORT_SYMBOL_GPL(gpiod_direction_output);
-
- /**
-+ * gpiod_direction_pass_through - set the GPIO direction to pass-through
-+ * @desc: GPIO to set to pass-through
-+ *
-+ * Set the direction of the passed GPIO to passthrough.
-+ *
-+ * Return 0 in case of success, else an error code.
-+ */
-+int gpiod_direction_pass_through(struct gpio_desc *desc, int val)
-+{
-+ struct gpio_chip *gc;
-+
-+ VALIDATE_DESC(desc);
-+ /* GPIOs used for IRQs shall not be set as pass-through */
-+ if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) {
-+ gpiod_err(desc,
-+ "%s: tried to set a GPIO tied to an IRQ as pass-through\n",
-+ __func__);
-+ return -EIO;
-+ }
-+ gc = desc->gdev->chip;
-+ val = !!val;
-+ if (test_bit(FLAG_PASS_THROUGH, &desc->flags)) {
-+ if (val)
-+ gpio_set_config(gc, gpio_chip_hwgpio(desc),
-+ PIN_CONFIG_PASS_THROUGH_ENABLE);
-+ else
-+ gpio_set_config(gc, gpio_chip_hwgpio(desc),
-+ PIN_CONFIG_PASS_THROUGH_DISABLE);
-+ } else {
-+ gpiod_err(desc,
-+ "%s: desc->flags is not set to FLAG_PASS_THROUGH\n",
-+ __func__);
-+ return -EIO;
-+ }
-+
-+ return 0;
-+}
-+EXPORT_SYMBOL_GPL(gpiod_direction_pass_through);
-+
-+/**
- * gpiod_set_debounce - sets @debounce time for a GPIO
- * @desc: descriptor of the GPIO for which to set debounce time
- * @debounce: debounce time in microseconds
-diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
-index bc57f0dc5953..a821a04fc04b 100644
---- a/drivers/gpio/gpiolib.h
-+++ b/drivers/gpio/gpiolib.h
-@@ -212,6 +212,7 @@ struct gpio_desc {
- #define FLAG_IS_OUT 1
- #define FLAG_EXPORT 2 /* protected by sysfs_lock */
- #define FLAG_SYSFS 3 /* exported via /sys/class/gpio/control */
-+#define FLAG_PASS_THROUGH 4 /*Gpio is passthrough type*/
- #define FLAG_ACTIVE_LOW 6 /* value has active low */
- #define FLAG_OPEN_DRAIN 7 /* Gpio is open drain type */
- #define FLAG_OPEN_SOURCE 8 /* Gpio is open source type */
-diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
-index 9ddcf50a3c59..f9775be5a46a 100644
---- a/include/linux/gpio/consumer.h
-+++ b/include/linux/gpio/consumer.h
-@@ -110,6 +110,7 @@ void devm_gpiod_put_array(struct device *dev, struct gpio_descs *descs);
- int gpiod_get_direction(struct gpio_desc *desc);
- int gpiod_direction_input(struct gpio_desc *desc);
- int gpiod_direction_output(struct gpio_desc *desc, int value);
-+int gpiod_direction_pass_through(struct gpio_desc *desc, int val);
- int gpiod_direction_output_raw(struct gpio_desc *desc, int value);
-
- /* Value get/set from non-sleeping context */
-@@ -348,6 +349,14 @@ static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
- WARN_ON(1);
- return -ENOSYS;
- }
-+
-+static inline int gpiod_direction_pass_through(struct gpio_desc *desc, int val)
-+{
-+ /* GPIO can never have been requested */
-+ WARN_ON(1);
-+ return -ENOSYS;
-+}
-+
- static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
- {
- /* GPIO can never have been requested */
-diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
-index 6c0680641108..59f0cbabb685 100644
---- a/include/linux/pinctrl/pinconf-generic.h
-+++ b/include/linux/pinctrl/pinconf-generic.h
-@@ -124,6 +124,8 @@ enum pin_config_param {
- PIN_CONFIG_SLEW_RATE,
- PIN_CONFIG_SKEW_DELAY,
- PIN_CONFIG_PERSIST_STATE,
-+ PIN_CONFIG_PASS_THROUGH_ENABLE,
-+ PIN_CONFIG_PASS_THROUGH_DISABLE,
- PIN_CONFIG_END = 0x7F,
- PIN_CONFIG_MAX = 0xFF,
- };
-diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h
-index 4ebfe0ac6c5b..99864572b7d9 100644
---- a/include/uapi/linux/gpio.h
-+++ b/include/uapi/linux/gpio.h
-@@ -62,6 +62,7 @@ struct gpioline_info {
- #define GPIOHANDLE_REQUEST_ACTIVE_LOW (1UL << 2)
- #define GPIOHANDLE_REQUEST_OPEN_DRAIN (1UL << 3)
- #define GPIOHANDLE_REQUEST_OPEN_SOURCE (1UL << 4)
-+#define GPIOHANDLE_REQUEST_PASS_THROUGH (1UL << 5)
-
- /**
- * struct gpiohandle_request - Information about a GPIO handle request
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0042-Add-bus-timeout-ms-and-retries-device-tree-propertie.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0042-Add-bus-timeout-ms-and-retries-device-tree-propertie.patch
index 3588d62d9..25f494652 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0042-Add-bus-timeout-ms-and-retries-device-tree-propertie.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0042-Add-bus-timeout-ms-and-retries-device-tree-propertie.patch
@@ -1,4 +1,4 @@
-From 6515a2134f90f33dbbea8ede5de598d17bb00c12 Mon Sep 17 00:00:00 2001
+From c55d6bb49cfbd39a7c0848076c84166def65936e Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Thu, 7 Mar 2019 15:17:40 -0800
Subject: [PATCH] Add bus-timeout-ms and #retries device tree properties
@@ -59,10 +59,10 @@ index 44efafdfd7f5..e382931cf3d6 100644
used by the device. I2C core will assign "irq" interrupt (or the very first
interrupt if not using interrupt names) as primary interrupt for the slave.
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
-index 506d867b43d9..84237c5d0aca 100644
+index 434b753def3b..99bd30953531 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
-@@ -1012,7 +1012,6 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+@@ -1014,7 +1014,6 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
spin_lock_init(&bus->lock);
init_completion(&bus->cmd_complete);
bus->adap.owner = THIS_MODULE;
@@ -71,10 +71,10 @@ index 506d867b43d9..84237c5d0aca 100644
bus->adap.dev.parent = &pdev->dev;
bus->adap.dev.of_node = pdev->dev.of_node;
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
-index 009b0507768e..386aa2dad908 100644
+index 8a480d269542..69b798a2d31e 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
-@@ -1231,6 +1231,7 @@ static void i2c_adapter_hold_timer_callback(struct timer_list *t)
+@@ -1320,6 +1320,7 @@ static void i2c_adapter_hold_timer_callback(struct timer_list *t)
static int i2c_register_adapter(struct i2c_adapter *adap)
{
@@ -82,7 +82,7 @@ index 009b0507768e..386aa2dad908 100644
int res = -EINVAL;
/* Can't register until after driver model init */
-@@ -1257,8 +1258,15 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
+@@ -1347,8 +1348,15 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
INIT_LIST_HEAD(&adap->userspace_clients);
/* Set default timeout to 1 second if not already set */
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0043-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-BT.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0043-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-BT.patch
index f04824c0e..035945cf3 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0043-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-BT.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0043-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-BT.patch
@@ -1,4 +1,4 @@
-From d82aacea62f2cc3f5c4f6654bd8920255edf24fd Mon Sep 17 00:00:00 2001
+From c4e7b89ee20dc28e10fae7eb0859e4fa9d3e8643 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 13 Mar 2019 15:04:16 -0700
Subject: [PATCH] char: ipmi: Add clock control logic into Aspeed LPC BT driver
@@ -42,29 +42,29 @@ index 028268fd99ee..d13887d60f19 100644
+ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
};
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index 6e6f50a0fbab..3a7e31f3de07 100644
+index 618abeab539b..c2388bb7c678 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -333,6 +333,7 @@
+@@ -337,6 +337,7 @@
ibt: ibt@c0 {
compatible = "aspeed,ast2400-ibt-bmc";
reg = <0xc0 0x18>;
+ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
interrupts = <8>;
+ status = "disabled";
};
-
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index 4cd4a8258e42..a6720bc952b0 100644
+index 88ac8e08b6ae..88b318fd287b 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -468,6 +468,7 @@
+@@ -470,6 +470,7 @@
ibt: ibt@c0 {
compatible = "aspeed,ast2500-ibt-bmc";
reg = <0xc0 0x18>;
+ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
interrupts = <8>;
+ status = "disabled";
};
-
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 40b9927c072c..a4ec9d1743d7 100644
--- a/drivers/char/ipmi/bt-bmc.c
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0044-misc-Add-clock-control-logic-into-Aspeed-LPC-SNOOP-d.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0044-misc-Add-clock-control-logic-into-Aspeed-LPC-SNOOP-d.patch
index 0559ef5be..c335fb3ec 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0044-misc-Add-clock-control-logic-into-Aspeed-LPC-SNOOP-d.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0044-misc-Add-clock-control-logic-into-Aspeed-LPC-SNOOP-d.patch
@@ -1,4 +1,4 @@
-From 1ebca05f5cb04162e124e59cac701291f23d9091 Mon Sep 17 00:00:00 2001
+From a5bbf0f5943d3a6be6e58a4b78d6d18694ceb859 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 13 Mar 2019 15:27:48 -0700
Subject: [PATCH] misc: Add clock control logic into Aspeed LPC SNOOP driver
@@ -16,16 +16,16 @@ SNOOP driver.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- arch/arm/boot/dts/aspeed-g4.dtsi | 1 +
- arch/arm/boot/dts/aspeed-g5.dtsi | 1 +
- drivers/misc/aspeed-lpc-snoop.c | 30 +++++++++++++++++++++++++++---
+ arch/arm/boot/dts/aspeed-g4.dtsi | 1 +
+ arch/arm/boot/dts/aspeed-g5.dtsi | 1 +
+ drivers/soc/aspeed/aspeed-lpc-snoop.c | 30 +++++++++++++++++++++++++++---
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index 3a7e31f3de07..bedfb77c0158 100644
+index c2388bb7c678..70aca75d65e0 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -316,6 +316,7 @@
+@@ -320,6 +320,7 @@
compatible = "aspeed,ast2400-lpc-snoop";
reg = <0x0 0x80>;
interrupts = <8>;
@@ -34,10 +34,10 @@ index 3a7e31f3de07..bedfb77c0158 100644
};
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index a6720bc952b0..a26e8b3c09bf 100644
+index 88b318fd287b..f4a5d06f1000 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -451,6 +451,7 @@
+@@ -453,6 +453,7 @@
compatible = "aspeed,ast2500-lpc-snoop";
reg = <0x0 0x80>;
interrupts = <8>;
@@ -45,11 +45,11 @@ index a6720bc952b0..a26e8b3c09bf 100644
status = "disabled";
};
-diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
-index 2feb4347d67f..39a0471f0b8f 100644
---- a/drivers/misc/aspeed-lpc-snoop.c
-+++ b/drivers/misc/aspeed-lpc-snoop.c
-@@ -15,6 +15,7 @@
+diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c
+index 48f7ac238861..96ea52db25be 100644
+--- a/drivers/soc/aspeed/aspeed-lpc-snoop.c
++++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c
+@@ -11,6 +11,7 @@
*/
#include <linux/bitops.h>
@@ -57,7 +57,7 @@ index 2feb4347d67f..39a0471f0b8f 100644
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/kfifo.h>
-@@ -71,6 +72,7 @@ struct aspeed_lpc_snoop_channel {
+@@ -67,6 +68,7 @@ struct aspeed_lpc_snoop_channel {
struct aspeed_lpc_snoop {
struct regmap *regmap;
int irq;
@@ -65,7 +65,7 @@ index 2feb4347d67f..39a0471f0b8f 100644
struct aspeed_lpc_snoop_channel chan[NUM_SNOOP_CHANNELS];
};
-@@ -286,22 +288,42 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev)
+@@ -282,22 +284,42 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev)
return -ENODEV;
}
@@ -111,7 +111,7 @@ index 2feb4347d67f..39a0471f0b8f 100644
return rc;
}
-@@ -313,6 +335,8 @@ static int aspeed_lpc_snoop_remove(struct platform_device *pdev)
+@@ -309,6 +331,8 @@ static int aspeed_lpc_snoop_remove(struct platform_device *pdev)
aspeed_lpc_disable_snoop(lpc_snoop, 0);
aspeed_lpc_disable_snoop(lpc_snoop, 1);
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0045-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-KC.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0045-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-KC.patch
index d9b6d05f9..499662ac3 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0045-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-KC.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0045-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-KC.patch
@@ -1,4 +1,4 @@
-From 1326920183042bb91583eb56dabd29ec921f8f65 Mon Sep 17 00:00:00 2001
+From 27675470115548612cee9153903aaffffb68177b Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 13 Mar 2019 15:36:34 -0700
Subject: [PATCH] char: ipmi: Add clock control logic into Aspeed LPC KCS
@@ -45,10 +45,10 @@ index d98a9bf45d6c..3453eb0bf8f2 100644
kcs_addr = <0xCA2>;
status = "okay";
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index bedfb77c0158..a5072ed1f823 100644
+index 1c00828da913..f04006f4cd27 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -294,6 +294,33 @@
+@@ -298,6 +298,33 @@
lpc_bmc: lpc-bmc@0 {
compatible = "aspeed,ast2400-lpc-bmc";
reg = <0x0 0x80>;
@@ -82,7 +82,7 @@ index bedfb77c0158..a5072ed1f823 100644
};
lpc_host: lpc-host@80 {
-@@ -305,6 +332,14 @@
+@@ -309,6 +336,14 @@
#size-cells = <1>;
ranges = <0x0 0x80 0x1e0>;
@@ -98,10 +98,10 @@ index bedfb77c0158..a5072ed1f823 100644
compatible = "aspeed,ast2400-lpc-ctrl";
reg = <0x0 0x80>;
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index a26e8b3c09bf..6a2f161e7548 100644
+index f2292bdfef91..d46b9ffc79de 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -128,7 +128,7 @@
+@@ -135,7 +135,7 @@
};
vic: interrupt-controller@1e6c0080 {
@@ -110,7 +110,7 @@ index a26e8b3c09bf..6a2f161e7548 100644
interrupt-controller;
#interrupt-cells = <1>;
valid-sources = <0xfefff7ff 0x0807ffff>;
-@@ -408,18 +408,21 @@
+@@ -410,18 +410,21 @@
compatible = "aspeed,ast2500-kcs-bmc";
interrupts = <8>;
kcs_chan = <1>;
@@ -132,7 +132,7 @@ index a26e8b3c09bf..6a2f161e7548 100644
status = "disabled";
};
};
-@@ -437,6 +440,7 @@
+@@ -439,6 +442,7 @@
compatible = "aspeed,ast2500-kcs-bmc";
interrupts = <8>;
kcs_chan = <4>;
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0046-misc-Add-clock-control-logic-into-Aspeed-LPC-MBOX-dr.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0046-misc-Add-clock-control-logic-into-Aspeed-LPC-MBOX-dr.patch
deleted file mode 100644
index 220283e24..000000000
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0046-misc-Add-clock-control-logic-into-Aspeed-LPC-MBOX-dr.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-From db310b43e5b444a4e2854f3d69d002c2f0d0605c Mon Sep 17 00:00:00 2001
-From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
-Date: Wed, 13 Mar 2019 15:53:24 -0700
-Subject: [PATCH] misc: Add clock control logic into Aspeed LPC MBOX driver
-
-If LPC MBOX driver is registered ahead of lpc-ctrl module, LPC
-MBOX block will be enabled without heart beating of LCLK until
-lpc-ctrl enables the LCLK. This issue causes improper handling on
-host interrupts when the host sends interrupt in that time frame.
-Then kernel eventually forcibly disables the interrupt with dumping
-stack and printing a 'nobody cared this irq' message out.
-
-To prevent this issue, all LPC sub-nodes should enable LCLK
-individually so this patch adds clock control logic into the LPC
-MBOX driver.
-
-Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
----
- arch/arm/boot/dts/aspeed-g4.dtsi | 1 +
- arch/arm/boot/dts/aspeed-g5.dtsi | 1 +
- drivers/misc/aspeed-lpc-mbox.c | 42 +++++++++++++++++++++++++++++++---------
- 3 files changed, 35 insertions(+), 9 deletions(-)
-
-diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index a5072ed1f823..729245b74c13 100644
---- a/arch/arm/boot/dts/aspeed-g4.dtsi
-+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -389,6 +389,7 @@
- reg = <0x180 0x5c>;
- interrupts = <46>;
- #mbox-cells = <1>;
-+ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
- status = "disabled";
- };
- };
-diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index 6a2f161e7548..df9d63a94264 100644
---- a/arch/arm/boot/dts/aspeed-g5.dtsi
-+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -493,6 +493,7 @@
- reg = <0x180 0x5c>;
- interrupts = <46>;
- #mbox-cells = <1>;
-+ clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
- status = "disabled";
- };
- };
-diff --git a/drivers/misc/aspeed-lpc-mbox.c b/drivers/misc/aspeed-lpc-mbox.c
-index 0933e0553953..f105d27786ac 100644
---- a/drivers/misc/aspeed-lpc-mbox.c
-+++ b/drivers/misc/aspeed-lpc-mbox.c
-@@ -7,6 +7,7 @@
- * 2 of the License, or (at your option) any later version.
- */
-
-+#include <linux/clk.h>
- #include <linux/interrupt.h>
- #include <linux/mfd/syscon.h>
- #include <linux/miscdevice.h>
-@@ -37,7 +38,9 @@
- struct aspeed_mbox {
- struct miscdevice miscdev;
- struct regmap *regmap;
-+ struct clk *clk;
- unsigned int base;
-+ int irq;
- wait_queue_head_t queue;
- struct mutex mutex;
- };
-@@ -237,16 +240,16 @@ static int aspeed_mbox_config_irq(struct aspeed_mbox *mbox,
- struct platform_device *pdev)
- {
- struct device *dev = &pdev->dev;
-- int rc, irq;
-+ int rc;
-
-- irq = irq_of_parse_and_map(dev->of_node, 0);
-- if (!irq)
-+ mbox->irq = platform_get_irq(pdev, 0);
-+ if (!mbox->irq)
- return -ENODEV;
-
-- rc = devm_request_irq(dev, irq, aspeed_mbox_irq,
-- IRQF_SHARED, DEVICE_NAME, mbox);
-+ rc = devm_request_irq(dev, mbox->irq, aspeed_mbox_irq,
-+ IRQF_SHARED, DEVICE_NAME, mbox);
- if (rc < 0) {
-- dev_err(dev, "Unable to request IRQ %d\n", irq);
-+ dev_err(dev, "Unable to request IRQ %d\n", mbox->irq);
- return rc;
- }
-
-@@ -301,6 +304,19 @@ static int aspeed_mbox_probe(struct platform_device *pdev)
- mutex_init(&mbox->mutex);
- init_waitqueue_head(&mbox->queue);
-
-+ mbox->clk = devm_clk_get(dev, NULL);
-+ if (IS_ERR(mbox->clk)) {
-+ rc = PTR_ERR(mbox->clk);
-+ if (rc != -EPROBE_DEFER)
-+ dev_err(dev, "couldn't get clock\n");
-+ return rc;
-+ }
-+ rc = clk_prepare_enable(mbox->clk);
-+ if (rc) {
-+ dev_err(dev, "couldn't enable clock\n");
-+ return rc;
-+ }
-+
- mbox->miscdev.minor = MISC_DYNAMIC_MINOR;
- mbox->miscdev.name = DEVICE_NAME;
- mbox->miscdev.fops = &aspeed_mbox_fops;
-@@ -308,17 +324,24 @@ static int aspeed_mbox_probe(struct platform_device *pdev)
- rc = misc_register(&mbox->miscdev);
- if (rc) {
- dev_err(dev, "Unable to register device\n");
-- return rc;
-+ goto err;
- }
-
- rc = aspeed_mbox_config_irq(mbox, pdev);
- if (rc) {
- dev_err(dev, "Failed to configure IRQ\n");
- misc_deregister(&mbox->miscdev);
-- return rc;
-+ goto err;
- }
-
-+ dev_info(&pdev->dev, "LPC mbox registered, irq %d\n", mbox->irq);
-+
- return 0;
-+
-+err:
-+ clk_disable_unprepare(mbox->clk);
-+
-+ return rc;
- }
-
- static int aspeed_mbox_remove(struct platform_device *pdev)
-@@ -326,6 +349,7 @@ static int aspeed_mbox_remove(struct platform_device *pdev)
- struct aspeed_mbox *mbox = dev_get_drvdata(&pdev->dev);
-
- misc_deregister(&mbox->miscdev);
-+ clk_disable_unprepare(mbox->clk);
-
- return 0;
- }
-@@ -335,6 +359,7 @@ static const struct of_device_id aspeed_mbox_match[] = {
- { .compatible = "aspeed,ast2500-mbox" },
- { },
- };
-+MODULE_DEVICE_TABLE(of, aspeed_mbox_match);
-
- static struct platform_driver aspeed_mbox_driver = {
- .driver = {
-@@ -347,7 +372,6 @@ static struct platform_driver aspeed_mbox_driver = {
-
- module_platform_driver(aspeed_mbox_driver);
-
--MODULE_DEVICE_TABLE(of, aspeed_mbox_match);
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("Cyril Bur <cyrilbur@gmail.com>");
- MODULE_DESCRIPTION("Aspeed mailbox device driver");
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0047-misc-Block-error-printing-on-probe-defer-case-in-Asp.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0047-misc-Block-error-printing-on-probe-defer-case-in-Asp.patch
index 40c26e31b..c3d1f4e8d 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0047-misc-Block-error-printing-on-probe-defer-case-in-Asp.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0047-misc-Block-error-printing-on-probe-defer-case-in-Asp.patch
@@ -1,4 +1,4 @@
-From 4762687044ec864719ca14d8efa3dccdc3807e70 Mon Sep 17 00:00:00 2001
+From 108b39883e73f822b8f03e0d3fe3818b85b29b41 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 13 Mar 2019 15:57:08 -0700
Subject: [PATCH] misc: Block error printing on probe defer case in Aspeed LPC
@@ -10,14 +10,14 @@ out an error message because the probing will be re-visited.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- drivers/misc/aspeed-lpc-ctrl.c | 7 +++++--
+ drivers/soc/aspeed/aspeed-lpc-ctrl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
-diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c
-index a024f8042259..c0818c7b0ffb 100644
---- a/drivers/misc/aspeed-lpc-ctrl.c
-+++ b/drivers/misc/aspeed-lpc-ctrl.c
-@@ -239,8 +239,10 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
+diff --git a/drivers/soc/aspeed/aspeed-lpc-ctrl.c b/drivers/soc/aspeed/aspeed-lpc-ctrl.c
+index 01ed21e8bfee..ae08419834a3 100644
+--- a/drivers/soc/aspeed/aspeed-lpc-ctrl.c
++++ b/drivers/soc/aspeed/aspeed-lpc-ctrl.c
+@@ -252,8 +252,10 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
lpc_ctrl->clk = devm_clk_get(dev, NULL);
if (IS_ERR(lpc_ctrl->clk)) {
@@ -30,7 +30,7 @@ index a024f8042259..c0818c7b0ffb 100644
}
rc = clk_prepare_enable(lpc_ctrl->clk);
if (rc) {
-@@ -264,6 +266,7 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
+@@ -275,6 +277,7 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
err:
clk_disable_unprepare(lpc_ctrl->clk);
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0048-ARM-dts-aspeed-Set-default-status-of-LPC-BT-as-disab.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0048-ARM-dts-aspeed-Set-default-status-of-LPC-BT-as-disab.patch
deleted file mode 100644
index efbea1be8..000000000
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0048-ARM-dts-aspeed-Set-default-status-of-LPC-BT-as-disab.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From abf63c03805bf7df31133b720e165eab759ea702 Mon Sep 17 00:00:00 2001
-From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
-Date: Thu, 14 Mar 2019 13:11:49 -0700
-Subject: [PATCH] ARM: dts: aspeed: Set default status of LPC BT as 'disabled'
-
-LPC BT is not widely used so set its default status as 'disabled'.
-
-Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
----
- arch/arm/boot/dts/aspeed-g4.dtsi | 1 +
- arch/arm/boot/dts/aspeed-g5.dtsi | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index 729245b74c13..d4e1e29c6ed2 100644
---- a/arch/arm/boot/dts/aspeed-g4.dtsi
-+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -371,6 +371,7 @@
- reg = <0xc0 0x18>;
- clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
- interrupts = <8>;
-+ status = "disabled";
- };
-
- sio_regs: regs {
-diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index df9d63a94264..a3850644b10e 100644
---- a/arch/arm/boot/dts/aspeed-g5.dtsi
-+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -475,6 +475,7 @@
- reg = <0xc0 0x18>;
- clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
- interrupts = <8>;
-+ status = "disabled";
- };
-
- sio_regs: regs {
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0051-Add-AST2500-JTAG-device.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0051-Add-AST2500-JTAG-device.patch
index d66facdfa..d9379f565 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0051-Add-AST2500-JTAG-device.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0051-Add-AST2500-JTAG-device.patch
@@ -1,4 +1,4 @@
-From a2e0020ef6e03abde6819fb7fc328dcf23d0bd71 Mon Sep 17 00:00:00 2001
+From 278740d23c1eac792c64608af4bfa3fae640965f Mon Sep 17 00:00:00 2001
From: "Hunt, Bryan" <bryan.hunt@intel.com>
Date: Mon, 6 May 2019 10:02:14 -0700
Subject: [PATCH] Add AST2500d JTAG driver
@@ -7,14 +7,14 @@ Adding aspeed jtag device
Signed-off-by: Hunt, Bryan <bryan.hunt@intel.com>
---
- arch/arm/boot/dts/aspeed-g5.dtsi | 9 +
- 1 files changed, 15 insertions(+)
+ arch/arm/boot/dts/aspeed-g5.dtsi | 9 +++++++++
+ 1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index bf7ae631a458..2c9f287759ce 100644
+index ed0b7217f55f..89a9febf6f14 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -366,6 +366,15 @@
+@@ -389,6 +389,15 @@
pinctrl-0 = <&pinctrl_espi_default>;
};
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0052-drivers-jtag-Add-JTAG-core-driver.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0052-drivers-jtag-Add-JTAG-core-driver.patch
index 6c9d46d9d..3047746ca 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0052-drivers-jtag-Add-JTAG-core-driver.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0052-drivers-jtag-Add-JTAG-core-driver.patch
@@ -1,4 +1,4 @@
-From 0b8b93851bb79e70e91159f310afd4b56084977f Mon Sep 17 00:00:00 2001
+From 520416545a47cffe66815f31bc1465eab8864554 Mon Sep 17 00:00:00 2001
From: "Corona, Ernesto" <ernesto.corona@intel.com>
Date: Fri, 7 Jun 2019 07:37:39 -0800
Subject: [PATCH v29 1/6] drivers: jtag: Add JTAG core driver
@@ -258,7 +258,7 @@ Comments pointed by Tobias Klauser <tklauser@distanz.ch>
drivers/jtag/Makefile | 1 +
drivers/jtag/jtag.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++
include/linux/jtag.h | 47 +++++++
- include/uapi/linux/jtag.h | 214 ++++++++++++++++++++++++++++++
+ include/uapi/linux/jtag.h | 214 +++++++++++++++++++++++++++++++
7 files changed, 602 insertions(+)
create mode 100644 drivers/jtag/Kconfig
create mode 100644 drivers/jtag/Makefile
@@ -267,27 +267,27 @@ Comments pointed by Tobias Klauser <tklauser@distanz.ch>
create mode 100644 include/uapi/linux/jtag.h
diff --git a/drivers/Kconfig b/drivers/Kconfig
-index 4f9f990..0102bae 100644
+index 339ac306ded6..fb970bbe6b03 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
-@@ -228,4 +228,5 @@ source "drivers/siox/Kconfig"
+@@ -234,4 +234,5 @@ source "drivers/counter/Kconfig"
- source "drivers/slimbus/Kconfig"
+ source "drivers/peci/Kconfig"
+source "drivers/jtag/Kconfig"
endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
-index e1ce029..6d756c2 100644
+index 18d91cd5ac0f..b4d21c963923 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
-@@ -186,3 +186,4 @@ obj-$(CONFIG_MULTIPLEXER) += mux/
- obj-$(CONFIG_SIOX) += siox/
- obj-$(CONFIG_GNSS) += gnss/
+@@ -189,3 +189,4 @@ obj-$(CONFIG_GNSS) += gnss/
+ obj-$(CONFIG_INTERCONNECT) += interconnect/
+ obj-$(CONFIG_COUNTER) += counter/
obj-$(CONFIG_PECI) += peci/
-+obj-$(CONFIG_JTAG) += jtag/
++obj-$(CONFIG_JTAG_ASPEED) += jtag/
diff --git a/drivers/jtag/Kconfig b/drivers/jtag/Kconfig
new file mode 100644
-index 0000000..47771fc
+index 000000000000..47771fcd3c5b
--- /dev/null
+++ b/drivers/jtag/Kconfig
@@ -0,0 +1,17 @@
@@ -310,14 +310,14 @@ index 0000000..47771fc
+ be called jtag.
diff --git a/drivers/jtag/Makefile b/drivers/jtag/Makefile
new file mode 100644
-index 0000000..af37493
+index 000000000000..af374939a9e6
--- /dev/null
+++ b/drivers/jtag/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_JTAG) += jtag.o
diff --git a/drivers/jtag/jtag.c b/drivers/jtag/jtag.c
new file mode 100644
-index 0000000..47503a1
+index 000000000000..39a4d88a9c21
--- /dev/null
+++ b/drivers/jtag/jtag.c
@@ -0,0 +1,321 @@
@@ -644,7 +644,7 @@ index 0000000..47503a1
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/jtag.h b/include/linux/jtag.h
new file mode 100644
-index 0000000..4153c90
+index 000000000000..fab12dc4fc5e
--- /dev/null
+++ b/include/linux/jtag.h
@@ -0,0 +1,47 @@
@@ -697,7 +697,7 @@ index 0000000..4153c90
+#endif /* __LINUX_JTAG_H */
diff --git a/include/uapi/linux/jtag.h b/include/uapi/linux/jtag.h
new file mode 100644
-index 0000000..3f9e195
+index 000000000000..315e59577a17
--- /dev/null
+++ b/include/uapi/linux/jtag.h
@@ -0,0 +1,214 @@
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0055-Documentation-jtag-Add-ABI-documentation.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0055-Documentation-jtag-Add-ABI-documentation.patch
index b91311d94..1e4142035 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0055-Documentation-jtag-Add-ABI-documentation.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0055-Documentation-jtag-Add-ABI-documentation.patch
@@ -1,6 +1,6 @@
-From c2d57900820475b50affd171f4dc423a278887ae Mon Sep 17 00:00:00 2001
+From d4c55bd4eeb6d9290025fa353d1787f18bca6ade Mon Sep 17 00:00:00 2001
From: "Corona, Ernesto" <ernesto.corona@intel.com>
-Date: Wed, 10 Mar 2019 11:47:40 -0800
+Date: Sun, 10 Mar 2019 11:47:40 -0800
Subject: [PATCH v29 4/6] Documentation: jtag: Add ABI documentation
Added document that describe the ABI for JTAG class driver
@@ -84,8 +84,8 @@ v6->v7
Comments pointed by Pavel Machek <pavel@ucw.cz>
- Added jtag-cdev documentation to Documentation/ABI/testing folder
---
- Documentation/ABI/testing/jtag-dev | 23 +++++++
- Documentation/jtag/overview | 27 ++++++++
+ Documentation/ABI/testing/jtag-dev | 23 ++++++
+ Documentation/jtag/overview | 27 +++++++
Documentation/jtag/transactions | 145 +++++++++++++++++++++++++++++++++++++
3 files changed, 195 insertions(+)
create mode 100644 Documentation/ABI/testing/jtag-dev
@@ -94,7 +94,7 @@ Comments pointed by Pavel Machek <pavel@ucw.cz>
diff --git a/Documentation/ABI/testing/jtag-dev b/Documentation/ABI/testing/jtag-dev
new file mode 100644
-index 0000000..423baab
+index 000000000000..423baab18761
--- /dev/null
+++ b/Documentation/ABI/testing/jtag-dev
@@ -0,0 +1,23 @@
@@ -123,7 +123,7 @@ index 0000000..423baab
+ userspace tools which wants to access to JTAG bus
diff --git a/Documentation/jtag/overview b/Documentation/jtag/overview
new file mode 100644
-index 0000000..6a5ec33
+index 000000000000..6a5ec335e313
--- /dev/null
+++ b/Documentation/jtag/overview
@@ -0,0 +1,27 @@
@@ -156,7 +156,7 @@ index 0000000..6a5ec33
+User: close -> /dev/jatgX -> JTAG core driver -> JTAG hardware specific driver
diff --git a/Documentation/jtag/transactions b/Documentation/jtag/transactions
new file mode 100644
-index 0000000..76fd0b1
+index 000000000000..f5d4a1ded6cf
--- /dev/null
+++ b/Documentation/jtag/transactions
@@ -0,0 +1,145 @@
@@ -254,7 +254,7 @@ index 0000000..76fd0b1
+length: xfer data length in bits
+tdio : xfer data array
+from: xfer from state can be current JTAG tap state saved by the driver
-+ JTAG_STATE_CURRENT or in a multichain environment any state listed in
++ JTAG_STATE_CURRENT or in a multichain environment any state listed in
+ jtag_tapstate struct saved by your multichain controller software.
+endstate: xfer end state after transaction finish
+ can be: any state listed in jtag_tapstate struct
@@ -307,3 +307,4 @@ index 0000000..76fd0b1
+ tdo1 = bitbang_data[1].tdo;
--
2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0057-drivers-jtag-Add-JTAG-core-driver-Maintainers.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0057-drivers-jtag-Add-JTAG-core-driver-Maintainers.patch
index 8ab4615f0..47a532590 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0057-drivers-jtag-Add-JTAG-core-driver-Maintainers.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0057-drivers-jtag-Add-JTAG-core-driver-Maintainers.patch
@@ -1,6 +1,6 @@
-From 0a563429bc3c34a951db92600681e799b606a01f Mon Sep 17 00:00:00 2001
+From 8598b57423967f5851484533a1b09a04bafa235b Mon Sep 17 00:00:00 2001
From: "Corona, Ernesto" <ernesto.corona@intel.com>
-Date: Wed, 10 Mar 2019 11:49:37 -0800
+Date: Sun, 10 Mar 2019 11:49:37 -0800
Subject: [PATCH v29 6/6] drivers: jtag: Add JTAG core driver Maintainers
JTAG class driver provide infrastructure to support hardware/software
@@ -24,10 +24,10 @@ Cc: Bryan Hunt <bryan.hunt@intel.com>
1 file changed, 11 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
-index dce5c09..eb710a6 100644
+index e0925f221e25..2cd0a46f9a1a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -8173,6 +8173,17 @@ L: linux-serial@vger.kernel.org
+@@ -8521,6 +8521,17 @@ L: linux-serial@vger.kernel.org
S: Orphan
F: drivers/tty/serial/jsm/
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0058-i2c-aspeed-add-general-call-support.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0058-i2c-aspeed-add-general-call-support.patch
index de8bf2355..7d5e006d1 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0058-i2c-aspeed-add-general-call-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0058-i2c-aspeed-add-general-call-support.patch
@@ -1,4 +1,4 @@
-From 551b5192b1074679ca9411cdedb9137d38f7de3d Mon Sep 17 00:00:00 2001
+From f5b6d42c1710a4c1314bc0160f904aa01f501e96 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 1 May 2019 13:27:34 -0700
Subject: [PATCH] i2c: aspeed: add general call support
@@ -28,10 +28,10 @@ index 7da7e813b2b0..724ee9f35c10 100644
specified.
- #retries : Number of retries for master transfer.
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
-index 0060193e1aa4..f96160e01a69 100644
+index 99bd30953531..8f26060bd685 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
-@@ -50,6 +50,7 @@
+@@ -47,6 +47,7 @@
#define ASPEED_I2CD_SDA_DRIVE_1T_EN BIT(8)
#define ASPEED_I2CD_M_SDA_DRIVE_1T_EN BIT(7)
#define ASPEED_I2CD_M_HIGH_SPEED_EN BIT(6)
@@ -39,7 +39,7 @@ index 0060193e1aa4..f96160e01a69 100644
#define ASPEED_I2CD_SLAVE_EN BIT(1)
#define ASPEED_I2CD_MASTER_EN BIT(0)
-@@ -74,6 +75,7 @@
+@@ -71,6 +72,7 @@
*/
#define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14)
#define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13)
@@ -47,7 +47,7 @@ index 0060193e1aa4..f96160e01a69 100644
#define ASPEED_I2CD_INTR_SLAVE_MATCH BIT(7)
#define ASPEED_I2CD_INTR_SCL_TIMEOUT BIT(6)
#define ASPEED_I2CD_INTR_ABNORMAL BIT(5)
-@@ -133,6 +135,8 @@ enum aspeed_i2c_slave_state {
+@@ -130,6 +132,8 @@ enum aspeed_i2c_slave_state {
ASPEED_I2C_SLAVE_READ_PROCESSED,
ASPEED_I2C_SLAVE_WRITE_REQUESTED,
ASPEED_I2C_SLAVE_WRITE_RECEIVED,
@@ -56,7 +56,7 @@ index 0060193e1aa4..f96160e01a69 100644
ASPEED_I2C_SLAVE_STOP,
};
-@@ -163,6 +167,8 @@ struct aspeed_i2c_bus {
+@@ -160,6 +164,8 @@ struct aspeed_i2c_bus {
#if IS_ENABLED(CONFIG_I2C_SLAVE)
struct i2c_client *slave;
enum aspeed_i2c_slave_state slave_state;
@@ -65,7 +65,7 @@ index 0060193e1aa4..f96160e01a69 100644
#endif /* CONFIG_I2C_SLAVE */
};
-@@ -267,6 +273,12 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -266,6 +272,12 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
bus->slave_state = ASPEED_I2C_SLAVE_START;
}
@@ -78,7 +78,7 @@ index 0060193e1aa4..f96160e01a69 100644
/* Slave is not currently active, irq was for someone else. */
if (bus->slave_state == ASPEED_I2C_SLAVE_INACTIVE)
return irq_handled;
-@@ -285,6 +297,21 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -284,6 +296,21 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
else
bus->slave_state =
ASPEED_I2C_SLAVE_WRITE_REQUESTED;
@@ -100,18 +100,16 @@ index 0060193e1aa4..f96160e01a69 100644
}
irq_handled |= ASPEED_I2CD_INTR_RX_DONE;
}
-@@ -324,6 +351,10 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
- bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED;
- i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
+@@ -326,11 +353,16 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ case ASPEED_I2C_SLAVE_WRITE_RECEIVED:
+ i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value);
break;
+ case ASPEED_I2C_SLAVE_GCALL_REQUESTED:
+ bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED;
+ i2c_slave_event(slave, I2C_SLAVE_GCALL_REQUESTED, &value);
+ break;
- case ASPEED_I2C_SLAVE_WRITE_RECEIVED:
- i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value);
- break;
-@@ -332,6 +363,7 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ case ASPEED_I2C_SLAVE_STOP:
+ i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE;
break;
case ASPEED_I2C_SLAVE_START:
@@ -119,7 +117,7 @@ index 0060193e1aa4..f96160e01a69 100644
/* Slave was just started. Waiting for the next event. */;
break;
default:
-@@ -739,6 +771,8 @@ static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
+@@ -738,6 +770,8 @@ static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
/* Turn on slave mode. */
func_ctrl_reg_val = readl(bus->base + ASPEED_I2C_FUN_CTRL_REG);
func_ctrl_reg_val |= ASPEED_I2CD_SLAVE_EN;
@@ -128,7 +126,7 @@ index 0060193e1aa4..f96160e01a69 100644
writel(func_ctrl_reg_val, bus->base + ASPEED_I2C_FUN_CTRL_REG);
}
-@@ -777,6 +811,8 @@ static int aspeed_i2c_unreg_slave(struct i2c_client *client)
+@@ -776,6 +810,8 @@ static int aspeed_i2c_unreg_slave(struct i2c_client *client)
/* Turn off slave mode. */
func_ctrl_reg_val = readl(bus->base + ASPEED_I2C_FUN_CTRL_REG);
func_ctrl_reg_val &= ~ASPEED_I2CD_SLAVE_EN;
@@ -137,7 +135,7 @@ index 0060193e1aa4..f96160e01a69 100644
writel(func_ctrl_reg_val, bus->base + ASPEED_I2C_FUN_CTRL_REG);
bus->slave = NULL;
-@@ -921,6 +957,9 @@ static int aspeed_i2c_init(struct aspeed_i2c_bus *bus,
+@@ -920,6 +956,9 @@ static int aspeed_i2c_init(struct aspeed_i2c_bus *bus,
bus->base + ASPEED_I2C_FUN_CTRL_REG);
#if IS_ENABLED(CONFIG_I2C_SLAVE)
@@ -148,10 +146,10 @@ index 0060193e1aa4..f96160e01a69 100644
if (bus->slave)
__aspeed_i2c_reg_slave(bus, bus->slave->addr);
diff --git a/drivers/i2c/i2c-slave-mqueue.c b/drivers/i2c/i2c-slave-mqueue.c
-index 4548088e1922..a608846cb1db 100644
+index 2c7a6038409c..1d4db584b393 100644
--- a/drivers/i2c/i2c-slave-mqueue.c
+++ b/drivers/i2c/i2c-slave-mqueue.c
-@@ -53,10 +53,12 @@ static int i2c_slave_mqueue_callback(struct i2c_client *client,
+@@ -56,10 +56,12 @@ static int i2c_slave_mqueue_callback(struct i2c_client *client,
switch (event) {
case I2C_SLAVE_WRITE_REQUESTED:
@@ -166,10 +164,10 @@ index 4548088e1922..a608846cb1db 100644
case I2C_SLAVE_WRITE_RECEIVED:
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
-index e1c6b78bdaf1..03ffb70d75f2 100644
+index 3ee92c6a442d..dfdccb2acb24 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
-@@ -371,6 +371,7 @@ enum i2c_slave_event {
+@@ -359,6 +359,7 @@ enum i2c_slave_event {
I2C_SLAVE_WRITE_REQUESTED,
I2C_SLAVE_READ_PROCESSED,
I2C_SLAVE_WRITE_RECEIVED,
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0065-i2c-aspeed-fix-master-pending-state-handling.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0065-i2c-aspeed-fix-master-pending-state-handling.patch
index 3a86d5b25..003a96c8d 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0065-i2c-aspeed-fix-master-pending-state-handling.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0065-i2c-aspeed-fix-master-pending-state-handling.patch
@@ -1,4 +1,4 @@
-From 50221ac92816333efcf961c5f22f8b9ffdccb31b Mon Sep 17 00:00:00 2001
+From 4a05d2506e7cb7fb3ad323a16861f09279b4da39 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Tue, 11 Jun 2019 14:59:53 -0700
Subject: [PATCH] i2c: aspeed: fix master pending state handling
@@ -15,10 +15,10 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
-index f96160e01a69..64bc68eaa88f 100644
+index 8f26060bd685..d8143c24d3a7 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
-@@ -384,18 +384,19 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
+@@ -383,18 +383,19 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
struct i2c_msg *msg = &bus->msgs[bus->msgs_index];
u8 slave_addr = i2c_8bit_addr_from_msg(msg);
@@ -41,7 +41,7 @@ index f96160e01a69..64bc68eaa88f 100644
bus->buf_index = 0;
if (msg->flags & I2C_M_RD) {
-@@ -480,7 +481,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -479,7 +480,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
if (bus->slave_state != ASPEED_I2C_SLAVE_INACTIVE)
goto out_no_complete;
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0066-i2c-aspeed-add-buffer-mode-transfer-support.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0066-i2c-aspeed-add-buffer-mode-transfer-support.patch
index 9480daeff..9b96b400b 100644
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0066-i2c-aspeed-add-buffer-mode-transfer-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0066-i2c-aspeed-add-buffer-mode-transfer-support.patch
@@ -1,4 +1,4 @@
-From efb710a6b3a39f28b988af717eefc1b72c4c43bd Mon Sep 17 00:00:00 2001
+From 36128aacdc8b642b9ee080e493abbc00de345f1d Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Tue, 11 Jun 2019 15:07:08 -0700
Subject: [PATCH] i2c: aspeed: add buffer mode transfer support
@@ -15,7 +15,7 @@ It has 2 KBytes (256 Bytes x 8 pages) of I2C SRAM buffer pool from
buffer pool manipulation. To simplify implementation for supporting
both AST2400 and AST2500, it assigns each 128 Bytes per bus without
using buffer pool manipulation so total 1792 Bytes of I2C SRAM
-buffer will used.
+buffer will be used.
AST2500:
It has 16 Bytes of individual I2C SRAM buffer per each bus and its
@@ -30,329 +30,452 @@ It provides buffer based master and slave data transfer.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- arch/arm/boot/dts/aspeed-g4.dtsi | 42 ++++--
- arch/arm/boot/dts/aspeed-g5.dtsi | 42 ++++--
- drivers/i2c/busses/i2c-aspeed.c | 262 ++++++++++++++++++++++++++++++++----
- drivers/irqchip/irq-aspeed-i2c-ic.c | 8 ++
- 4 files changed, 301 insertions(+), 53 deletions(-)
+ .../devicetree/bindings/i2c/i2c-aspeed.txt | 40 ++-
+ arch/arm/boot/dts/aspeed-g4.dtsi | 47 ++--
+ arch/arm/boot/dts/aspeed-g5.dtsi | 47 ++--
+ drivers/i2c/busses/i2c-aspeed.c | 294 ++++++++++++++++++---
+ 4 files changed, 349 insertions(+), 79 deletions(-)
+diff --git a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
+index 724ee9f35c10..e1a0ae7a8c08 100644
+--- a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
++++ b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
+@@ -3,7 +3,10 @@ Device tree configuration for the I2C busses on the AST24XX and AST25XX SoCs.
+ Required Properties:
+ - #address-cells : should be 1
+ - #size-cells : should be 0
+-- reg : address offset and range of bus
++- reg : Address offset and range of bus registers.
++ An additional SRAM buffer address offset and range is
++ optional in case of enabling I2C dedicated SRAM for
++ buffer mode transfer support.
+ - compatible : should be "aspeed,ast2400-i2c-bus"
+ or "aspeed,ast2500-i2c-bus"
+ - clocks : root clock of bus, should reference the APB
+@@ -29,12 +32,21 @@ i2c {
+ #size-cells = <1>;
+ ranges = <0 0x1e78a000 0x1000>;
+
+- i2c_ic: interrupt-controller@0 {
+- #interrupt-cells = <1>;
+- compatible = "aspeed,ast2400-i2c-ic";
++ i2c_gr: i2c-global-regs@0 {
++ compatible = "aspeed,ast2500-i2c-gr", "syscon";
+ reg = <0x0 0x40>;
+- interrupts = <12>;
+- interrupt-controller;
++
++ #address-cells = <1>;
++ #size-cells = <1>;
++ ranges = <0x0 0x0 0x40>;
++
++ i2c_ic: interrupt-controller@0 {
++ #interrupt-cells = <1>;
++ compatible = "aspeed,ast2500-i2c-ic";
++ reg = <0x0 0x4>;
++ interrupts = <12>;
++ interrupt-controller;
++ };
+ };
+
+ i2c0: i2c-bus@40 {
+@@ -42,11 +54,25 @@ i2c {
+ #size-cells = <0>;
+ #interrupt-cells = <1>;
+ reg = <0x40 0x40>;
+- compatible = "aspeed,ast2400-i2c-bus";
++ compatible = "aspeed,ast2500-i2c-bus";
+ clocks = <&syscon ASPEED_CLK_APB>;
+ resets = <&syscon ASPEED_RESET_I2C>;
+ bus-frequency = <100000>;
+ interrupts = <0>;
+ interrupt-parent = <&i2c_ic>;
+ };
++
++ /* buffer mode transfer enabled */
++ i2c1: i2c-bus@80 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ #interrupt-cells = <1>;
++ reg = <0x80 0x40>, <0x210 0x10>;
++ compatible = "aspeed,ast2500-i2c-bus";
++ clocks = <&syscon ASPEED_CLK_APB>;
++ resets = <&syscon ASPEED_RESET_I2C>;
++ bus-frequency = <100000>;
++ interrupts = <1>;
++ interrupt-parent = <&i2c_ic>;
++ };
+ };
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
-index 47a5029f5bdb..c1c125add9fa 100644
+index 47a5029f5bdb..052b1b6b4dc7 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
-@@ -482,7 +482,8 @@
+@@ -469,12 +469,21 @@
+ };
+
+ &i2c {
+- i2c_ic: interrupt-controller@0 {
+- #interrupt-cells = <1>;
+- compatible = "aspeed,ast2400-i2c-ic";
++ i2c_gr: i2c-global-regs@0 {
++ compatible = "aspeed,ast2400-i2c-gr", "syscon";
+ reg = <0x0 0x40>;
+- interrupts = <12>;
+- interrupt-controller;
++
++ #address-cells = <1>;
++ #size-cells = <1>;
++ ranges = <0x0 0x0 0x40>;
++
++ i2c_ic: interrupt-controller@0 {
++ #interrupt-cells = <1>;
++ compatible = "aspeed,ast2400-i2c-ic";
++ reg = <0x0 0x4>;
++ interrupts = <12>;
++ interrupt-controller;
++ };
+ };
+
+ i2c0: i2c-bus@40 {
+@@ -482,7 +491,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x40 0x40>;
+ reg = <0x40 0x40>, <0x800 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -498,7 +499,8 @@
+@@ -498,7 +507,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x80 0x40>;
+ reg = <0x80 0x40>, <0x880 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -514,7 +516,8 @@
+@@ -514,7 +523,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0xc0 0x40>;
+ reg = <0xc0 0x40>, <0x900 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -531,7 +534,8 @@
+@@ -531,7 +540,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x100 0x40>;
+ reg = <0x100 0x40>, <0x980 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -548,7 +552,8 @@
+@@ -548,7 +557,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x140 0x40>;
+ reg = <0x140 0x40>, <0xa00 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -565,7 +570,8 @@
+@@ -565,7 +574,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x180 0x40>;
+ reg = <0x180 0x40>, <0xa80 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -582,7 +588,8 @@
+@@ -582,7 +591,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x1c0 0x40>;
+ reg = <0x1c0 0x40>, <0xb00 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -599,7 +606,8 @@
+@@ -599,7 +608,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x300 0x40>;
+ reg = <0x300 0x40>, <0xb80 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -616,7 +624,8 @@
+@@ -616,7 +625,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x340 0x40>;
+ reg = <0x340 0x40>, <0xc00 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -633,7 +642,8 @@
+@@ -633,7 +642,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x380 0x40>;
+ reg = <0x380 0x40>, <0xc80 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -650,7 +660,8 @@
+@@ -650,7 +659,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x3c0 0x40>;
+ reg = <0x3c0 0x40>, <0xd00 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -667,7 +678,8 @@
+@@ -667,7 +676,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x400 0x40>;
+ reg = <0x400 0x40>, <0xd80 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -684,7 +696,8 @@
+@@ -684,7 +693,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x440 0x40>;
+ reg = <0x440 0x40>, <0xe00 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -701,7 +714,8 @@
+@@ -701,7 +710,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x480 0x40>;
+ reg = <0x480 0x40>, <0xe80 0x80>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2400-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
-index 9d5ed9499b1f..662249bc15f9 100644
+index 89a9febf6f14..2d2173d598e4 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
-@@ -599,7 +599,8 @@
+@@ -586,12 +586,21 @@
+ };
+
+ &i2c {
+- i2c_ic: interrupt-controller@0 {
+- #interrupt-cells = <1>;
+- compatible = "aspeed,ast2500-i2c-ic";
++ i2c_gr: i2c-global-regs@0 {
++ compatible = "aspeed,ast2500-i2c-gr", "syscon";
+ reg = <0x0 0x40>;
+- interrupts = <12>;
+- interrupt-controller;
++
++ #address-cells = <1>;
++ #size-cells = <1>;
++ ranges = <0x0 0x0 0x40>;
++
++ i2c_ic: interrupt-controller@0 {
++ #interrupt-cells = <1>;
++ compatible = "aspeed,ast2500-i2c-ic";
++ reg = <0x0 0x4>;
++ interrupts = <12>;
++ interrupt-controller;
++ };
+ };
+
+ i2c0: i2c-bus@40 {
+@@ -599,7 +608,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x40 0x40>;
+ reg = <0x40 0x40>, <0x200 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -615,7 +616,8 @@
+@@ -615,7 +624,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x80 0x40>;
+ reg = <0x80 0x40>, <0x210 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -631,7 +633,8 @@
+@@ -631,7 +640,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0xc0 0x40>;
+ reg = <0xc0 0x40>, <0x220 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -648,7 +651,8 @@
+@@ -648,7 +657,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x100 0x40>;
+ reg = <0x100 0x40>, <0x230 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -665,7 +669,8 @@
+@@ -665,7 +674,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x140 0x40>;
+ reg = <0x140 0x40>, <0x240 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -682,7 +687,8 @@
+@@ -682,7 +691,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x180 0x40>;
+ reg = <0x180 0x40>, <0x250 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -699,7 +705,8 @@
+@@ -699,7 +708,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x1c0 0x40>;
+ reg = <0x1c0 0x40>, <0x260 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -716,7 +723,8 @@
+@@ -716,7 +725,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x300 0x40>;
+ reg = <0x300 0x40>, <0x270 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -733,7 +741,8 @@
+@@ -733,7 +742,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x340 0x40>;
+ reg = <0x340 0x40>, <0x280 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -750,7 +759,8 @@
+@@ -750,7 +759,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x380 0x40>;
+ reg = <0x380 0x40>, <0x290 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -767,7 +777,8 @@
+@@ -767,7 +776,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x3c0 0x40>;
+ reg = <0x3c0 0x40>, <0x2a0 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -784,7 +795,8 @@
+@@ -784,7 +793,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x400 0x40>;
+ reg = <0x400 0x40>, <0x2b0 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -801,7 +813,8 @@
+@@ -801,7 +810,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x440 0x40>;
+ reg = <0x440 0x40>, <0x2c0 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
-@@ -818,7 +831,8 @@
+@@ -818,7 +827,7 @@
#size-cells = <0>;
#interrupt-cells = <1>;
- reg = <0x480 0x40>;
+ reg = <0x480 0x40>, <0x2d0 0x10>;
-+ reg-names = "bus-regs", "buf";
compatible = "aspeed,ast2500-i2c-bus";
clocks = <&syscon ASPEED_CLK_APB>;
resets = <&syscon ASPEED_RESET_I2C>;
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
-index 64bc68eaa88f..b21a4c87853e 100644
+index d8143c24d3a7..b721fb1d6d4c 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
-@@ -10,6 +10,7 @@
- * published by the Free Software Foundation.
+@@ -7,6 +7,7 @@
+ * Copyright 2017 Google, Inc.
*/
+#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/err.h>
-@@ -38,6 +39,7 @@
+@@ -19,15 +20,24 @@
+ #include <linux/irqchip/chained_irq.h>
+ #include <linux/irqdomain.h>
+ #include <linux/kernel.h>
++#include <linux/mfd/syscon.h>
+ #include <linux/module.h>
+ #include <linux/of_address.h>
+ #include <linux/of_irq.h>
+ #include <linux/of_platform.h>
+ #include <linux/platform_device.h>
++#include <linux/regmap.h>
+ #include <linux/reset.h>
+ #include <linux/slab.h>
+
+-/* I2C Register */
++/* I2C Global Registers */
++/* 0x00 : I2CG Interrupt Status Register */
++/* 0x08 : I2CG Interrupt Target Assignment */
++/* 0x0c : I2CG Global Control Register (AST2500) */
++#define ASPEED_I2CG_GLOBAL_CTRL_REG 0x0c
++#define ASPEED_I2CG_SRAM_BUFFER_EN BIT(0)
++
++/* I2C Bus Registers */
+ #define ASPEED_I2C_FUN_CTRL_REG 0x00
+ #define ASPEED_I2C_AC_TIMING_REG1 0x04
+ #define ASPEED_I2C_AC_TIMING_REG2 0x08
+@@ -35,14 +45,12 @@
#define ASPEED_I2C_INTR_STS_REG 0x10
#define ASPEED_I2C_CMD_REG 0x14
#define ASPEED_I2C_DEV_ADDR_REG 0x18
+#define ASPEED_I2C_BUF_CTRL_REG 0x1c
#define ASPEED_I2C_BYTE_BUF_REG 0x20
- /* Global Register Definition */
-@@ -46,6 +48,7 @@
-
+-/* Global Register Definition */
+-/* 0x00 : I2C Interrupt Status Register */
+-/* 0x08 : I2C Interrupt Target Assignment */
+-
/* Device Register Definition */
/* 0x00 : I2CD Function Control Register */
+#define ASPEED_I2CD_BUFFER_PAGE_SEL_MASK GENMASK(22, 20)
#define ASPEED_I2CD_MULTI_MASTER_DIS BIT(15)
#define ASPEED_I2CD_SDA_DRIVE_1T_EN BIT(8)
#define ASPEED_I2CD_M_SDA_DRIVE_1T_EN BIT(7)
-@@ -107,6 +110,8 @@
+@@ -104,6 +112,8 @@
#define ASPEED_I2CD_BUS_RECOVER_CMD BIT(11)
/* Command Bit */
@@ -361,7 +484,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
#define ASPEED_I2CD_M_STOP_CMD BIT(5)
#define ASPEED_I2CD_M_S_RX_CMD_LAST BIT(4)
#define ASPEED_I2CD_M_RX_CMD BIT(3)
-@@ -117,6 +122,13 @@
+@@ -114,6 +124,13 @@
/* 0x18 : I2CD Slave Device Address Register */
#define ASPEED_I2CD_DEV_ADDR_MASK GENMASK(6, 0)
@@ -375,11 +498,11 @@ index 64bc68eaa88f..b21a4c87853e 100644
enum aspeed_i2c_master_state {
ASPEED_I2C_MASTER_INACTIVE,
ASPEED_I2C_MASTER_PENDING,
-@@ -164,6 +176,11 @@ struct aspeed_i2c_bus {
+@@ -161,6 +178,11 @@ struct aspeed_i2c_bus {
int master_xfer_result;
/* Multi-master */
bool multi_master;
-+ /* Buffer/DMA mode */
++ /* Buffer mode */
+ void __iomem *buf_base;
+ size_t buf_size;
+ u8 buf_offset;
@@ -387,7 +510,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
#if IS_ENABLED(CONFIG_I2C_SLAVE)
struct i2c_client *slave;
enum aspeed_i2c_slave_state slave_state;
-@@ -260,6 +277,7 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -259,6 +281,7 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
{
u32 command, irq_handled = 0;
struct i2c_client *slave = bus->slave;
@@ -395,39 +518,42 @@ index 64bc68eaa88f..b21a4c87853e 100644
u8 value;
if (!slave)
-@@ -288,7 +306,11 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -287,7 +310,12 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
/* Slave was sent something. */
if (irq_status & ASPEED_I2CD_INTR_RX_DONE) {
- value = readl(bus->base + ASPEED_I2C_BYTE_BUF_REG) >> 8;
+ if (bus->buf_base &&
-+ bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED)
++ bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED &&
++ !(irq_status & ASPEED_I2CD_INTR_NORMAL_STOP))
+ value = readb(bus->buf_base);
+ else
+ value = readl(bus->base + ASPEED_I2C_BYTE_BUF_REG) >> 8;
/* Handle address frame. */
if (bus->slave_state == ASPEED_I2C_SLAVE_START) {
if (value & 0x1)
-@@ -318,6 +340,18 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -317,6 +345,20 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
/* Slave was asked to stop. */
if (irq_status & ASPEED_I2CD_INTR_NORMAL_STOP) {
-+ if (bus->buf_base &&
-+ bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED) {
-+ len = FIELD_GET(ASPEED_I2CD_BUF_RX_COUNT_MASK,
-+ readl(bus->base +
-+ ASPEED_I2C_BUF_CTRL_REG));
-+ for (i = 0; i < len; i++) {
-+ value = readb(bus->buf_base + i);
-+ i2c_slave_event(slave,
-+ I2C_SLAVE_WRITE_RECEIVED,
-+ &value);
++ if (bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED &&
++ irq_status & ASPEED_I2CD_INTR_RX_DONE) {
++ if (bus->buf_base) {
++ len = FIELD_GET(ASPEED_I2CD_BUF_RX_COUNT_MASK,
++ readl(bus->base +
++ ASPEED_I2C_BUF_CTRL_REG));
++ for (i = 0; i < len; i++) {
++ value = readb(bus->buf_base + i);
++ i2c_slave_event(slave,
++ I2C_SLAVE_WRITE_RECEIVED,
++ &value);
++ }
+ }
+ }
irq_handled |= ASPEED_I2CD_INTR_NORMAL_STOP;
bus->slave_state = ASPEED_I2C_SLAVE_STOP;
}
-@@ -350,6 +384,15 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -349,9 +391,36 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
case ASPEED_I2C_SLAVE_WRITE_REQUESTED:
bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED;
i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
@@ -441,10 +567,6 @@ index 64bc68eaa88f..b21a4c87853e 100644
+ bus->base + ASPEED_I2C_CMD_REG);
+ }
break;
- case ASPEED_I2C_SLAVE_GCALL_REQUESTED:
- bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED;
-@@ -357,6 +400,24 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
- break;
case ASPEED_I2C_SLAVE_WRITE_RECEIVED:
i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value);
+ if (bus->buf_base) {
@@ -466,9 +588,9 @@ index 64bc68eaa88f..b21a4c87853e 100644
+ bus->base + ASPEED_I2C_CMD_REG);
+ }
break;
- case ASPEED_I2C_SLAVE_STOP:
- i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
-@@ -383,6 +444,8 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
+ case ASPEED_I2C_SLAVE_GCALL_REQUESTED:
+ bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED;
+@@ -382,6 +451,8 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
u32 command = ASPEED_I2CD_M_START_CMD | ASPEED_I2CD_M_TX_CMD;
struct i2c_msg *msg = &bus->msgs[bus->msgs_index];
u8 slave_addr = i2c_8bit_addr_from_msg(msg);
@@ -477,7 +599,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
#if IS_ENABLED(CONFIG_I2C_SLAVE)
/*
-@@ -401,12 +464,66 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
+@@ -400,12 +471,66 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
if (msg->flags & I2C_M_RD) {
command |= ASPEED_I2CD_M_RX_CMD;
@@ -486,11 +608,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
- command |= ASPEED_I2CD_M_S_RX_CMD_LAST;
+
+ if (bus->buf_base && !(msg->flags & I2C_M_RECV_LEN)) {
-+ command |= ASPEED_I2CD_TX_BUFF_ENABLE |
-+ ASPEED_I2CD_RX_BUFF_ENABLE;
-+
-+ wbuf[0] = slave_addr;
-+ writel(*(u32 *)wbuf, bus->buf_base);
++ command |= ASPEED_I2CD_RX_BUFF_ENABLE;
+
+ if (msg->len > bus->buf_size) {
+ len = bus->buf_size;
@@ -501,7 +619,6 @@ index 64bc68eaa88f..b21a4c87853e 100644
+
+ writel(FIELD_PREP(ASPEED_I2CD_BUF_RX_SIZE_MASK,
+ len - 1) |
-+ FIELD_PREP(ASPEED_I2CD_BUF_TX_COUNT_MASK, 0) |
+ FIELD_PREP(ASPEED_I2CD_BUF_OFFSET_MASK,
+ bus->buf_offset),
+ bus->base + ASPEED_I2C_BUF_CTRL_REG);
@@ -521,6 +638,11 @@ index 64bc68eaa88f..b21a4c87853e 100644
+ else
+ len = msg->len + 1;
+
++ /*
++ * Yeah, it looks clumsy but byte writings on a remapped
++ * I2C SRAM cause corruptions so use this way to make
++ * dword writings.
++ */
+ wbuf[0] = slave_addr;
+ for (i = 1; i < len; i++) {
+ wbuf[i % 4] = msg->buf[i - 1];
@@ -548,22 +670,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
writel(command, bus->base + ASPEED_I2C_CMD_REG);
}
-@@ -441,12 +558,22 @@ static int aspeed_i2c_is_irq_error(u32 irq_status)
- return 0;
- }
-
-+static inline int aspeed_i2c_is_tx_error(struct aspeed_i2c_bus *bus)
-+{
-+ if (FIELD_GET(ASPEED_I2CD_BUF_TX_COUNT_MASK,
-+ readl(bus->base + ASPEED_I2C_BUF_CTRL_REG)) !=
-+ bus->buf_size - 1)
-+ return -EIO;
-+
-+ return 0;
-+}
-+
- static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
- {
+@@ -445,7 +570,7 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
u32 irq_handled = 0, command = 0;
struct i2c_msg *msg;
u8 recv_byte;
@@ -572,16 +679,17 @@ index 64bc68eaa88f..b21a4c87853e 100644
if (irq_status & ASPEED_I2CD_INTR_BUS_RECOVER_DONE) {
bus->master_state = ASPEED_I2C_MASTER_INACTIVE;
-@@ -559,11 +686,46 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -558,11 +683,43 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
/* fall through */
case ASPEED_I2C_MASTER_TX_FIRST:
if (bus->buf_index < msg->len) {
++ command = ASPEED_I2CD_M_TX_CMD;
++
+ if (bus->buf_base) {
+ u8 wbuf[4];
+ int i;
+
-+ if (unlikely(aspeed_i2c_is_tx_error(bus)))
-+ goto error_and_stop;
++ command |= ASPEED_I2CD_TX_BUFF_ENABLE;
+
+ if (msg->len - bus->buf_index > bus->buf_size)
+ len = bus->buf_size;
@@ -606,15 +714,11 @@ index 64bc68eaa88f..b21a4c87853e 100644
+ FIELD_PREP(ASPEED_I2CD_BUF_OFFSET_MASK,
+ bus->buf_offset),
+ bus->base + ASPEED_I2C_BUF_CTRL_REG);
-+ writel(ASPEED_I2CD_TX_BUFF_ENABLE |
-+ ASPEED_I2CD_M_TX_CMD,
-+ bus->base + ASPEED_I2C_CMD_REG);
+ } else {
+ writel(msg->buf[bus->buf_index++],
+ bus->base + ASPEED_I2C_BYTE_BUF_REG);
-+ writel(ASPEED_I2CD_M_TX_CMD,
-+ bus->base + ASPEED_I2C_CMD_REG);
+ }
++ writel(command, bus->base + ASPEED_I2C_CMD_REG);
bus->master_state = ASPEED_I2C_MASTER_TX;
- writel(msg->buf[bus->buf_index++],
- bus->base + ASPEED_I2C_BYTE_BUF_REG);
@@ -623,7 +727,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
} else {
aspeed_i2c_next_msg_or_stop(bus);
}
-@@ -580,25 +742,57 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+@@ -579,25 +736,56 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
}
irq_handled |= ASPEED_I2CD_INTR_RX_DONE;
@@ -687,7 +791,6 @@ index 64bc68eaa88f..b21a4c87853e 100644
+ FIELD_PREP(ASPEED_I2CD_BUF_OFFSET_MASK,
+ bus->buf_offset),
+ bus->base + ASPEED_I2C_BUF_CTRL_REG);
-+
+ } else {
+ if (bus->buf_index + 1 == msg->len)
+ command |= ASPEED_I2CD_M_S_RX_CMD_LAST;
@@ -695,7 +798,7 @@ index 64bc68eaa88f..b21a4c87853e 100644
writel(command, bus->base + ASPEED_I2C_CMD_REG);
} else {
aspeed_i2c_next_msg_or_stop(bus);
-@@ -948,6 +1142,9 @@ static int aspeed_i2c_init(struct aspeed_i2c_bus *bus,
+@@ -947,6 +1135,9 @@ static int aspeed_i2c_init(struct aspeed_i2c_bus *bus,
if (ret < 0)
return ret;
@@ -705,11 +808,13 @@ index 64bc68eaa88f..b21a4c87853e 100644
if (of_property_read_bool(pdev->dev.of_node, "multi-master"))
bus->multi_master = true;
else
-@@ -1010,17 +1207,32 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+@@ -1007,16 +1198,15 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+ {
+ const struct of_device_id *match;
struct aspeed_i2c_bus *bus;
++ bool sram_enabled = true;
struct clk *parent_clk;
- struct resource *res;
-+ void __iomem *gc_reg;
+- struct resource *res;
int irq, ret;
bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL);
@@ -717,54 +822,65 @@ index 64bc68eaa88f..b21a4c87853e 100644
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "bus-regs");
- bus->base = devm_ioremap_resource(&pdev->dev, res);
+- bus->base = devm_ioremap_resource(&pdev->dev, res);
++ bus->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(bus->base))
return PTR_ERR(bus->base);
-+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "buf");
-+ bus->buf_base = devm_ioremap_resource(&pdev->dev, res);
-+ if (IS_ERR(bus->buf_base) || resource_size(res) < 2) {
-+ bus->buf_base = NULL;
-+ } else {
-+ bus->buf_size = resource_size(res);
-+ if (of_device_is_compatible(pdev->dev.of_node,
-+ "aspeed,ast2400-i2c-bus")) {
-+ bus->buf_page = (res->start >> 8) & GENMASK(3, 0) - 8;
-+ bus->buf_offset = (res->start >> 2) &
-+ ASPEED_I2CD_BUF_OFFSET_MASK;
+@@ -1050,6 +1240,42 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+ bus->get_clk_reg_val = (u32 (*)(struct device *, u32))
+ match->data;
+
++ /* Enable I2C SRAM in case of AST2500 */
++ if (of_device_is_compatible(pdev->dev.of_node,
++ "aspeed,ast2500-i2c-bus")) {
++ struct regmap *gr_regmap = syscon_regmap_lookup_by_compatible(
++ "aspeed,ast2500-i2c-gr");
++ if (IS_ERR(gr_regmap))
++ ret = PTR_ERR(gr_regmap);
++ else
++ ret = regmap_update_bits(gr_regmap,
++ ASPEED_I2CG_GLOBAL_CTRL_REG,
++ ASPEED_I2CG_SRAM_BUFFER_EN,
++ ASPEED_I2CG_SRAM_BUFFER_EN);
++
++ if (ret)
++ sram_enabled = false;
++ }
++
++ if (sram_enabled) {
++ struct resource *res = platform_get_resource(pdev,
++ IORESOURCE_MEM, 1);
++
++ bus->buf_base = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(bus->buf_base) || resource_size(res) < 2) {
++ bus->buf_base = NULL;
++ } else {
++ bus->buf_size = resource_size(res);
++ if (of_device_is_compatible(pdev->dev.of_node,
++ "aspeed,ast2400-i2c-bus")) {
++ bus->buf_page = ((res->start >> 8) &
++ GENMASK(3, 0)) - 8;
++ bus->buf_offset = (res->start >> 2) &
++ ASPEED_I2CD_BUF_OFFSET_MASK;
++ }
+ }
+ }
+
- parent_clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(parent_clk))
- return PTR_ERR(parent_clk);
-diff --git a/drivers/irqchip/irq-aspeed-i2c-ic.c b/drivers/irqchip/irq-aspeed-i2c-ic.c
-index f20200af0992..99985b22a9fa 100644
---- a/drivers/irqchip/irq-aspeed-i2c-ic.c
-+++ b/drivers/irqchip/irq-aspeed-i2c-ic.c
-@@ -18,6 +18,9 @@
- #include <linux/of_irq.h>
- #include <linux/io.h>
-
-+/* I2C Global Control Register (AST2500) */
-+#define ASPEED_I2C_GLOBAL_CTRL_REG 0xc
-+#define ASPEED_I2C_SRAM_BUFFER_EN BIT(0)
+ /* Initialize the I2C adapter */
+ spin_lock_init(&bus->lock);
+ init_completion(&bus->cmd_complete);
+@@ -1085,8 +1311,8 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
- #define ASPEED_I2C_IC_NUM_BUS 14
+ platform_set_drvdata(pdev, bus);
-@@ -100,6 +103,11 @@ static int __init aspeed_i2c_ic_of_init(struct device_node *node,
- irq_set_chained_handler_and_data(i2c_ic->parent_irq,
- aspeed_i2c_ic_irq_handler, i2c_ic);
-
-+ /* Enable I2C SRAM buffer in case of AST2500 */
-+ if (of_device_is_compatible(node, "aspeed,ast2500-i2c-ic"))
-+ writel(ASPEED_I2C_SRAM_BUFFER_EN,
-+ i2c_ic->base + ASPEED_I2C_GLOBAL_CTRL_REG);
-+
- pr_info("i2c controller registered, irq %d\n", i2c_ic->parent_irq);
+- dev_info(bus->dev, "i2c bus %d registered, irq %d\n",
+- bus->adap.nr, irq);
++ dev_info(bus->dev, "i2c bus %d registered (%s mode), irq %d\n",
++ bus->adap.nr, bus->buf_base ? "buffer" : "byte", irq);
return 0;
+ }
--
2.7.4
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0067-i2c-aspeed-add-DMA-mode-transfer-support.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0067-i2c-aspeed-add-DMA-mode-transfer-support.patch
new file mode 100644
index 000000000..a051dbc4d
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0067-i2c-aspeed-add-DMA-mode-transfer-support.patch
@@ -0,0 +1,442 @@
+From 7defe387ea07af3d48feb4daec78d54a284105f1 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Tue, 18 Jun 2019 08:47:50 -0700
+Subject: [PATCH] i2c: aspeed: add DMA mode transfer support
+
+This commit adds DMA mode transfer support.
+
+Only AST2500 supports DMA mode under some limitations:
+I2C is sharing the DMA H/W with UHCI host controller and MCTP
+controller. Since those controllers operate with DMA mode only, I2C
+has to use buffer mode or byte mode instead if one of those
+controllers is enabled. Also make sure that if SD/eMMC or Port80
+snoop uses DMA mode instead of PIO or FIFO respectively, I2C can't
+use DMA mode.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ .../devicetree/bindings/i2c/i2c-aspeed.txt | 25 +++
+ drivers/i2c/busses/i2c-aspeed.c | 231 +++++++++++++++++++--
+ 2 files changed, 241 insertions(+), 15 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
+index e1a0ae7a8c08..97142516399a 100644
+--- a/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
++++ b/Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
+@@ -19,6 +19,16 @@ Optional Properties:
+ - bus-frequency : frequency of the bus clock in Hz defaults to 100 kHz when not
+ specified
+ - multi-master : states that there is another master active on this bus.
++- aspeed,dma-buf-size : size of DMA buffer (from 2 to 4095 in case of AST2500).
++ Only AST2500 supports DMA mode under some limitations:
++ I2C is sharing the DMA H/W with UHCI host controller
++ and MCTP controller. Since those controllers operate
++ with DMA mode only, I2C has to use buffer mode or byte
++ mode instead if one of those controllers is enabled.
++ Also make sure that if SD/eMMC or Port80 snoop uses
++ DMA mode instead of PIO or FIFO respectively, I2C
++ can't use DMA mode. IF both DMA and buffer modes are
++ enabled, DMA mode will be selected.
+ - general-call : enables general call receiving.
+ - bus-timeout-ms: bus timeout in milliseconds defaults to 1 second when not
+ specified.
+@@ -75,4 +85,19 @@ i2c {
+ interrupts = <1>;
+ interrupt-parent = <&i2c_ic>;
+ };
++
++ /* DMA mode transfer enabled */
++ i2c2: i2c-bus@c0 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ #interrupt-cells = <1>;
++ reg = <0xc0 0x40>;
++ aspeed,dma-buf-size = <4095>;
++ compatible = "aspeed,ast2500-i2c-bus";
++ clocks = <&syscon ASPEED_CLK_APB>;
++ resets = <&syscon ASPEED_RESET_I2C>;
++ bus-frequency = <100000>;
++ interrupts = <2>;
++ interrupt-parent = <&i2c_ic>;
++ };
+ };
+diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
+index b721fb1d6d4c..127bc69952ca 100644
+--- a/drivers/i2c/busses/i2c-aspeed.c
++++ b/drivers/i2c/busses/i2c-aspeed.c
+@@ -10,6 +10,8 @@
+ #include <linux/bitfield.h>
+ #include <linux/clk.h>
+ #include <linux/completion.h>
++#include <linux/dma-mapping.h>
++#include <linux/dmapool.h>
+ #include <linux/err.h>
+ #include <linux/errno.h>
+ #include <linux/i2c.h>
+@@ -47,6 +49,8 @@
+ #define ASPEED_I2C_DEV_ADDR_REG 0x18
+ #define ASPEED_I2C_BUF_CTRL_REG 0x1c
+ #define ASPEED_I2C_BYTE_BUF_REG 0x20
++#define ASPEED_I2C_DMA_ADDR_REG 0x24
++#define ASPEED_I2C_DMA_LEN_REG 0x28
+
+ /* Device Register Definition */
+ /* 0x00 : I2CD Function Control Register */
+@@ -112,6 +116,8 @@
+ #define ASPEED_I2CD_BUS_RECOVER_CMD BIT(11)
+
+ /* Command Bit */
++#define ASPEED_I2CD_RX_DMA_ENABLE BIT(9)
++#define ASPEED_I2CD_TX_DMA_ENABLE BIT(8)
+ #define ASPEED_I2CD_RX_BUFF_ENABLE BIT(7)
+ #define ASPEED_I2CD_TX_BUFF_ENABLE BIT(6)
+ #define ASPEED_I2CD_M_STOP_CMD BIT(5)
+@@ -131,6 +137,14 @@
+ #define ASPEED_I2CD_BUF_TX_COUNT_MASK GENMASK(15, 8)
+ #define ASPEED_I2CD_BUF_OFFSET_MASK GENMASK(5, 0)
+
++/* 0x24 : I2CD DMA Mode Buffer Address Register */
++#define ASPEED_I2CD_DMA_ADDR_MASK GENMASK(31, 2)
++#define ASPEED_I2CD_DMA_ALIGN 4
++
++/* 0x28 : I2CD DMA Transfer Length Register */
++#define ASPEED_I2CD_DMA_LEN_SHIFT 0
++#define ASPEED_I2CD_DMA_LEN_MASK GENMASK(11, 0)
++
+ enum aspeed_i2c_master_state {
+ ASPEED_I2C_MASTER_INACTIVE,
+ ASPEED_I2C_MASTER_PENDING,
+@@ -183,6 +197,12 @@ struct aspeed_i2c_bus {
+ size_t buf_size;
+ u8 buf_offset;
+ u8 buf_page;
++ /* DMA mode */
++ struct dma_pool *dma_pool;
++ dma_addr_t dma_handle;
++ u8 *dma_buf;
++ size_t dma_buf_size;
++ size_t dma_len;
+ #if IS_ENABLED(CONFIG_I2C_SLAVE)
+ struct i2c_client *slave;
+ enum aspeed_i2c_slave_state slave_state;
+@@ -310,9 +330,13 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+
+ /* Slave was sent something. */
+ if (irq_status & ASPEED_I2CD_INTR_RX_DONE) {
+- if (bus->buf_base &&
++ if (bus->dma_buf &&
+ bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED &&
+ !(irq_status & ASPEED_I2CD_INTR_NORMAL_STOP))
++ value = bus->dma_buf[0];
++ else if (bus->buf_base &&
++ bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED &&
++ !(irq_status & ASPEED_I2CD_INTR_NORMAL_STOP))
+ value = readb(bus->buf_base);
+ else
+ value = readl(bus->base + ASPEED_I2C_BYTE_BUF_REG) >> 8;
+@@ -347,7 +371,18 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ if (irq_status & ASPEED_I2CD_INTR_NORMAL_STOP) {
+ if (bus->slave_state == ASPEED_I2C_SLAVE_WRITE_RECEIVED &&
+ irq_status & ASPEED_I2CD_INTR_RX_DONE) {
+- if (bus->buf_base) {
++ if (bus->dma_buf) {
++ len = bus->dma_buf_size -
++ FIELD_GET(ASPEED_I2CD_DMA_LEN_MASK,
++ readl(bus->base +
++ ASPEED_I2C_DMA_LEN_REG));
++ for (i = 0; i < len; i++) {
++ value = bus->dma_buf[i];
++ i2c_slave_event(slave,
++ I2C_SLAVE_WRITE_RECEIVED,
++ &value);
++ }
++ } else if (bus->buf_base) {
+ len = FIELD_GET(ASPEED_I2CD_BUF_RX_COUNT_MASK,
+ readl(bus->base +
+ ASPEED_I2C_BUF_CTRL_REG));
+@@ -391,7 +426,15 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ case ASPEED_I2C_SLAVE_WRITE_REQUESTED:
+ bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED;
+ i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
+- if (bus->buf_base) {
++ if (bus->dma_buf) {
++ writel(bus->dma_handle & ASPEED_I2CD_DMA_ADDR_MASK,
++ bus->base + ASPEED_I2C_DMA_ADDR_REG);
++ writel(FIELD_PREP(ASPEED_I2CD_DMA_LEN_MASK,
++ bus->dma_buf_size),
++ bus->base + ASPEED_I2C_DMA_LEN_REG);
++ writel(ASPEED_I2CD_RX_DMA_ENABLE,
++ bus->base + ASPEED_I2C_CMD_REG);
++ } else if (bus->buf_base) {
+ writel(FIELD_PREP(ASPEED_I2CD_BUF_RX_SIZE_MASK,
+ bus->buf_size - 1) |
+ FIELD_PREP(ASPEED_I2CD_BUF_OFFSET_MASK,
+@@ -403,7 +446,25 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ break;
+ case ASPEED_I2C_SLAVE_WRITE_RECEIVED:
+ i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value);
+- if (bus->buf_base) {
++ if (bus->dma_buf) {
++ len = bus->dma_buf_size -
++ FIELD_GET(ASPEED_I2CD_DMA_LEN_MASK,
++ readl(bus->base +
++ ASPEED_I2C_DMA_LEN_REG));
++ for (i = 1; i < len; i++) {
++ value = bus->dma_buf[i];
++ i2c_slave_event(slave,
++ I2C_SLAVE_WRITE_RECEIVED,
++ &value);
++ }
++ writel(bus->dma_handle & ASPEED_I2CD_DMA_ADDR_MASK,
++ bus->base + ASPEED_I2C_DMA_ADDR_REG);
++ writel(FIELD_PREP(ASPEED_I2CD_DMA_LEN_MASK,
++ bus->dma_buf_size),
++ bus->base + ASPEED_I2C_DMA_LEN_REG);
++ writel(ASPEED_I2CD_RX_DMA_ENABLE,
++ bus->base + ASPEED_I2C_CMD_REG);
++ } else if (bus->buf_base) {
+ len = FIELD_GET(ASPEED_I2CD_BUF_RX_COUNT_MASK,
+ readl(bus->base +
+ ASPEED_I2C_BUF_CTRL_REG));
+@@ -472,7 +533,23 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
+ if (msg->flags & I2C_M_RD) {
+ command |= ASPEED_I2CD_M_RX_CMD;
+
+- if (bus->buf_base && !(msg->flags & I2C_M_RECV_LEN)) {
++ if (bus->dma_buf && !(msg->flags & I2C_M_RECV_LEN)) {
++ command |= ASPEED_I2CD_RX_DMA_ENABLE;
++
++ if (msg->len > bus->dma_buf_size) {
++ len = bus->dma_buf_size;
++ } else {
++ len = msg->len;
++ command |= ASPEED_I2CD_M_S_RX_CMD_LAST;
++ }
++
++ writel(bus->dma_handle & ASPEED_I2CD_DMA_ADDR_MASK,
++ bus->base + ASPEED_I2C_DMA_ADDR_REG);
++ writel(FIELD_PREP(ASPEED_I2CD_DMA_LEN_MASK,
++ len),
++ bus->base + ASPEED_I2C_DMA_LEN_REG);
++ bus->dma_len = len;
++ } else if (bus->buf_base && !(msg->flags & I2C_M_RECV_LEN)) {
+ command |= ASPEED_I2CD_RX_BUFF_ENABLE;
+
+ if (msg->len > bus->buf_size) {
+@@ -493,7 +570,26 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
+ command |= ASPEED_I2CD_M_S_RX_CMD_LAST;
+ }
+ } else {
+- if (bus->buf_base) {
++ if (bus->dma_buf) {
++ command |= ASPEED_I2CD_TX_DMA_ENABLE;
++
++ if (msg->len + 1 > bus->dma_buf_size)
++ len = bus->dma_buf_size;
++ else
++ len = msg->len + 1;
++
++ bus->dma_buf[0] = slave_addr;
++ memcpy(bus->dma_buf + 1, msg->buf, len);
++
++ bus->buf_index = len - 1;
++
++ writel(bus->dma_handle & ASPEED_I2CD_DMA_ADDR_MASK,
++ bus->base + ASPEED_I2C_DMA_ADDR_REG);
++ writel(FIELD_PREP(ASPEED_I2CD_DMA_LEN_MASK,
++ len),
++ bus->base + ASPEED_I2C_DMA_LEN_REG);
++ bus->dma_len = len;
++ } else if (bus->buf_base) {
+ int i;
+
+ command |= ASPEED_I2CD_TX_BUFF_ENABLE;
+@@ -529,7 +625,8 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)
+ }
+ }
+
+- if (!(command & ASPEED_I2CD_TX_BUFF_ENABLE))
++ if (!(command & (ASPEED_I2CD_TX_BUFF_ENABLE |
++ ASPEED_I2CD_TX_DMA_ENABLE)))
+ writel(slave_addr, bus->base + ASPEED_I2C_BYTE_BUF_REG);
+ writel(command, bus->base + ASPEED_I2C_CMD_REG);
+ }
+@@ -685,7 +782,28 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ if (bus->buf_index < msg->len) {
+ command = ASPEED_I2CD_M_TX_CMD;
+
+- if (bus->buf_base) {
++ if (bus->dma_buf) {
++ command |= ASPEED_I2CD_TX_DMA_ENABLE;
++
++ if (msg->len - bus->buf_index >
++ bus->dma_buf_size)
++ len = bus->dma_buf_size;
++ else
++ len = msg->len - bus->buf_index;
++
++ memcpy(bus->dma_buf, msg->buf + bus->buf_index,
++ len);
++
++ bus->buf_index += len;
++
++ writel(bus->dma_handle &
++ ASPEED_I2CD_DMA_ADDR_MASK,
++ bus->base + ASPEED_I2C_DMA_ADDR_REG);
++ writel(FIELD_PREP(ASPEED_I2CD_DMA_LEN_MASK,
++ len),
++ bus->base + ASPEED_I2C_DMA_LEN_REG);
++ bus->dma_len = len;
++ } else if (bus->buf_base) {
+ u8 wbuf[4];
+ int i;
+
+@@ -736,7 +854,15 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ }
+ irq_handled |= ASPEED_I2CD_INTR_RX_DONE;
+
+- if (bus->buf_base && !(msg->flags & I2C_M_RECV_LEN)) {
++ if (bus->dma_buf && !(msg->flags & I2C_M_RECV_LEN)) {
++ len = bus->dma_len -
++ FIELD_GET(ASPEED_I2CD_DMA_LEN_MASK,
++ readl(bus->base +
++ ASPEED_I2C_DMA_LEN_REG));
++
++ memcpy(msg->buf + bus->buf_index, bus->dma_buf, len);
++ bus->buf_index += len;
++ } else if (bus->buf_base && !(msg->flags & I2C_M_RECV_LEN)) {
+ len = FIELD_GET(ASPEED_I2CD_BUF_RX_COUNT_MASK,
+ readl(bus->base +
+ ASPEED_I2C_BUF_CTRL_REG));
+@@ -764,7 +890,25 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ if (bus->buf_index < msg->len) {
+ command = ASPEED_I2CD_M_RX_CMD;
+ bus->master_state = ASPEED_I2C_MASTER_RX;
+- if (bus->buf_base) {
++ if (bus->dma_buf) {
++ command |= ASPEED_I2CD_RX_DMA_ENABLE;
++
++ if (msg->len - bus->buf_index >
++ bus->dma_buf_size) {
++ len = bus->dma_buf_size;
++ } else {
++ len = msg->len - bus->buf_index;
++ command |= ASPEED_I2CD_M_S_RX_CMD_LAST;
++ }
++
++ writel(bus->dma_handle &
++ ASPEED_I2CD_DMA_ADDR_MASK,
++ bus->base + ASPEED_I2C_DMA_ADDR_REG);
++ writel(FIELD_PREP(ASPEED_I2CD_DMA_LEN_MASK,
++ len),
++ bus->base + ASPEED_I2C_DMA_LEN_REG);
++ bus->dma_len = len;
++ } else if (bus->buf_base) {
+ command |= ASPEED_I2CD_RX_BUFF_ENABLE;
+
+ if (msg->len - bus->buf_index >
+@@ -1257,7 +1401,51 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+ sram_enabled = false;
+ }
+
+- if (sram_enabled) {
++ /*
++ * Only AST2500 supports DMA mode under some limitations:
++ * I2C is sharing the DMA H/W with UHCI host controller and MCTP
++ * controller. Since those controllers operate with DMA mode only, I2C
++ * has to use buffer mode or byte mode instead if one of those
++ * controllers is enabled. Also make sure that if SD/eMMC or Port80
++ * snoop uses DMA mode instead of PIO or FIFO respectively, I2C can't
++ * use DMA mode.
++ */
++ if (sram_enabled && !IS_ENABLED(CONFIG_USB_UHCI_ASPEED) &&
++ of_device_is_compatible(pdev->dev.of_node,
++ "aspeed,ast2500-i2c-bus")) {
++ u32 dma_len_max = ASPEED_I2CD_DMA_LEN_MASK >>
++ ASPEED_I2CD_DMA_LEN_SHIFT;
++
++ ret = device_property_read_u32(&pdev->dev,
++ "aspeed,dma-buf-size",
++ &bus->dma_buf_size);
++ if (!ret && bus->dma_buf_size > dma_len_max)
++ bus->dma_buf_size = dma_len_max;
++ }
++
++ if (bus->dma_buf_size) {
++ if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
++ dev_warn(&pdev->dev, "No suitable DMA available\n");
++ } else {
++ bus->dma_pool = dma_pool_create("i2c-aspeed",
++ &pdev->dev,
++ bus->dma_buf_size,
++ ASPEED_I2CD_DMA_ALIGN,
++ 0);
++ if (bus->dma_pool)
++ bus->dma_buf = dma_pool_alloc(bus->dma_pool,
++ GFP_KERNEL,
++ &bus->dma_handle);
++
++ if (!bus->dma_buf) {
++ dev_warn(&pdev->dev,
++ "Cannot allocate DMA buffer\n");
++ dma_pool_destroy(bus->dma_pool);
++ }
++ }
++ }
++
++ if (!bus->dma_buf && sram_enabled) {
+ struct resource *res = platform_get_resource(pdev,
+ IORESOURCE_MEM, 1);
+
+@@ -1297,24 +1485,33 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+ */
+ ret = aspeed_i2c_init(bus, pdev);
+ if (ret < 0)
+- return ret;
++ goto out_free_dma_buf;
+
+ irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+ ret = devm_request_irq(&pdev->dev, irq, aspeed_i2c_bus_irq,
+ 0, dev_name(&pdev->dev), bus);
+ if (ret < 0)
+- return ret;
++ goto out_free_dma_buf;
+
+ ret = i2c_add_adapter(&bus->adap);
+ if (ret < 0)
+- return ret;
++ goto out_free_dma_buf;
+
+ platform_set_drvdata(pdev, bus);
+
+ dev_info(bus->dev, "i2c bus %d registered (%s mode), irq %d\n",
+- bus->adap.nr, bus->buf_base ? "buffer" : "byte", irq);
++ bus->adap.nr, bus->dma_buf ? "dma" :
++ bus->buf_base ? "buffer" : "byte",
++ irq);
+
+ return 0;
++
++out_free_dma_buf:
++ if (bus->dma_buf)
++ dma_pool_free(bus->dma_pool, bus->dma_buf, bus->dma_handle);
++ dma_pool_destroy(bus->dma_pool);
++
++ return ret;
+ }
+
+ static int aspeed_i2c_remove_bus(struct platform_device *pdev)
+@@ -1332,6 +1529,10 @@ static int aspeed_i2c_remove_bus(struct platform_device *pdev)
+
+ reset_control_assert(bus->rst);
+
++ if (bus->dma_buf)
++ dma_pool_free(bus->dma_pool, bus->dma_buf, bus->dma_handle);
++ dma_pool_destroy(bus->dma_pool);
++
+ i2c_del_adapter(&bus->adap);
+
+ return 0;
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0068-i2c-aspeed-add-H-W-timeout-support.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0068-i2c-aspeed-add-H-W-timeout-support.patch
new file mode 100644
index 000000000..f4dfd6cfa
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0068-i2c-aspeed-add-H-W-timeout-support.patch
@@ -0,0 +1,181 @@
+From 9a43b47fb794fd195912c6956783b021a46307f8 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Thu, 11 Jul 2019 13:53:34 -0700
+Subject: [PATCH] i2c: aspeed: add H/W timeout support
+
+This commit adds I2C H/W timeout support.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ drivers/i2c/busses/i2c-aspeed.c | 79 +++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 73 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
+index 0ed9a27850e6..ecb5793036cc 100644
+--- a/drivers/i2c/busses/i2c-aspeed.c
++++ b/drivers/i2c/busses/i2c-aspeed.c
+@@ -71,10 +71,14 @@
+ #define ASPEED_I2CD_TIME_SCL_HIGH_MASK GENMASK(19, 16)
+ #define ASPEED_I2CD_TIME_SCL_LOW_SHIFT 12
+ #define ASPEED_I2CD_TIME_SCL_LOW_MASK GENMASK(15, 12)
++#define ASPEED_I2CD_TIME_TIMEOUT_BASE_DIVISOR_SHIFT 8
++#define ASPEED_I2CD_TIME_TIMEOUT_BASE_DIVISOR_MASK GENMASK(9, 8)
+ #define ASPEED_I2CD_TIME_BASE_DIVISOR_MASK GENMASK(3, 0)
+ #define ASPEED_I2CD_TIME_SCL_REG_MAX GENMASK(3, 0)
++
+ /* 0x08 : I2CD Clock and AC Timing Control Register #2 */
+-#define ASPEED_NO_TIMEOUT_CTRL 0
++#define ASPEED_I2CD_TIMEOUT_CYCLES_SHIFT 0
++#define ASPEED_I2CD_TIMEOUT_CYCLES_MASK GENMASK(4, 0)
+
+ /* 0x0c : I2CD Interrupt Control Register &
+ * 0x10 : I2CD Interrupt Status Register
+@@ -82,6 +86,7 @@
+ * These share bit definitions, so use the same values for the enable &
+ * status bits.
+ */
++#define ASPEED_I2CD_INTR_SLAVE_INACTIVE_TIMEOUT BIT(15)
+ #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14)
+ #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13)
+ #define ASPEED_I2CD_INTR_GCALL_ADDR BIT(8)
+@@ -98,8 +103,11 @@
+ ASPEED_I2CD_INTR_SCL_TIMEOUT | \
+ ASPEED_I2CD_INTR_ABNORMAL | \
+ ASPEED_I2CD_INTR_ARBIT_LOSS)
++#define ASPEED_I2CD_INTR_SLAVE_ERRORS \
++ ASPEED_I2CD_INTR_SLAVE_INACTIVE_TIMEOUT
+ #define ASPEED_I2CD_INTR_ALL \
+- (ASPEED_I2CD_INTR_SDA_DL_TIMEOUT | \
++ (ASPEED_I2CD_INTR_SLAVE_INACTIVE_TIMEOUT | \
++ ASPEED_I2CD_INTR_SDA_DL_TIMEOUT | \
+ ASPEED_I2CD_INTR_BUS_RECOVER_DONE | \
+ ASPEED_I2CD_INTR_SCL_TIMEOUT | \
+ ASPEED_I2CD_INTR_ABNORMAL | \
+@@ -180,6 +188,7 @@ struct aspeed_i2c_bus {
+ u32 divisor);
+ unsigned long parent_clk_frequency;
+ u32 bus_frequency;
++ u32 hw_timeout_ms;
+ /* Transaction state. */
+ enum aspeed_i2c_master_state master_state;
+ struct i2c_msg *msgs;
+@@ -297,6 +306,14 @@ static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus)
+ }
+
+ #if IS_ENABLED(CONFIG_I2C_SLAVE)
++static int aspeed_i2c_check_slave_error(u32 irq_status)
++{
++ if (irq_status & ASPEED_I2CD_INTR_SLAVE_INACTIVE_TIMEOUT)
++ return -EIO;
++
++ return 0;
++}
++
+ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ {
+ u32 command, irq_handled = 0;
+@@ -307,6 +324,14 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ if (!slave)
+ return 0;
+
++ if (aspeed_i2c_check_slave_error(irq_status)) {
++ dev_dbg(bus->dev, "received slave error interrupt: 0x%08x\n",
++ irq_status);
++ irq_handled |= (irq_status & ASPEED_I2CD_INTR_SLAVE_ERRORS);
++ bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE;
++ return irq_handled;
++ }
++
+ command = readl(bus->base + ASPEED_I2C_CMD_REG);
+
+ /* Slave was requested, restart state machine. */
+@@ -649,7 +674,7 @@ static void aspeed_i2c_next_msg_or_stop(struct aspeed_i2c_bus *bus)
+ }
+ }
+
+-static int aspeed_i2c_is_irq_error(u32 irq_status)
++static int aspeed_i2c_check_master_error(u32 irq_status)
+ {
+ if (irq_status & ASPEED_I2CD_INTR_ARBIT_LOSS)
+ return -EAGAIN;
+@@ -680,9 +705,9 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
+ * should clear the command queue effectively taking us back to the
+ * INACTIVE state.
+ */
+- ret = aspeed_i2c_is_irq_error(irq_status);
++ ret = aspeed_i2c_check_master_error(irq_status);
+ if (ret) {
+- dev_dbg(bus->dev, "received error interrupt: 0x%08x\n",
++ dev_dbg(bus->dev, "received master error interrupt: 0x%08x\n",
+ irq_status);
+ irq_handled |= (irq_status & ASPEED_I2CD_INTR_MASTER_ERRORS);
+ if (bus->master_state != ASPEED_I2C_MASTER_INACTIVE) {
+@@ -1251,6 +1276,7 @@ static u32 aspeed_i2c_25xx_get_clk_reg_val(struct device *dev, u32 divisor)
+ /* precondition: bus.lock has been acquired. */
+ static int aspeed_i2c_init_clk(struct aspeed_i2c_bus *bus)
+ {
++ u32 timeout_base_divisor, timeout_tick_us, timeout_cycles;
+ u32 divisor, clk_reg_val;
+
+ divisor = DIV_ROUND_UP(bus->parent_clk_frequency, bus->bus_frequency);
+@@ -1259,8 +1285,46 @@ static int aspeed_i2c_init_clk(struct aspeed_i2c_bus *bus)
+ ASPEED_I2CD_TIME_THDSTA_MASK |
+ ASPEED_I2CD_TIME_TACST_MASK);
+ clk_reg_val |= bus->get_clk_reg_val(bus->dev, divisor);
++
++ if (bus->hw_timeout_ms) {
++ u8 div_max = ASPEED_I2CD_TIME_TIMEOUT_BASE_DIVISOR_MASK >>
++ ASPEED_I2CD_TIME_TIMEOUT_BASE_DIVISOR_SHIFT;
++ u8 cycles_max = ASPEED_I2CD_TIMEOUT_CYCLES_MASK >>
++ ASPEED_I2CD_TIMEOUT_CYCLES_SHIFT;
++
++ timeout_base_divisor = 0;
++
++ do {
++ timeout_tick_us = 1000 * (16384 <<
++ (timeout_base_divisor << 1)) /
++ (bus->parent_clk_frequency / 1000);
++
++ if (timeout_base_divisor == div_max ||
++ timeout_tick_us * ASPEED_I2CD_TIMEOUT_CYCLES_MASK >=
++ bus->hw_timeout_ms * 1000)
++ break;
++ } while (timeout_base_divisor++ < div_max);
++
++ if (timeout_tick_us) {
++ timeout_cycles = DIV_ROUND_UP(bus->hw_timeout_ms * 1000,
++ timeout_tick_us);
++ if (timeout_cycles == 0)
++ timeout_cycles = 1;
++ else if (timeout_cycles > cycles_max)
++ timeout_cycles = cycles_max;
++ } else {
++ timeout_cycles = 0;
++ }
++ } else {
++ timeout_base_divisor = 0;
++ timeout_cycles = 0;
++ }
++
++ clk_reg_val |= FIELD_PREP(ASPEED_I2CD_TIME_TIMEOUT_BASE_DIVISOR_MASK,
++ timeout_base_divisor);
++
+ writel(clk_reg_val, bus->base + ASPEED_I2C_AC_TIMING_REG1);
+- writel(ASPEED_NO_TIMEOUT_CTRL, bus->base + ASPEED_I2C_AC_TIMING_REG2);
++ writel(timeout_cycles, bus->base + ASPEED_I2C_AC_TIMING_REG2);
+
+ return 0;
+ }
+@@ -1464,6 +1528,9 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
+ }
+ }
+
++ device_property_read_u32(&pdev->dev, "aspeed,hw-timeout-ms",
++ &bus->hw_timeout_ms);
++
+ /* Initialize the I2C adapter */
+ spin_lock_init(&bus->lock);
+ init_completion(&bus->cmd_complete);
+--
+2.7.4
+
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 ed5be3455..999c8d17c 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
@@ -13,6 +13,7 @@ SRC_URI += " \
file://0009-SGPIO-DT-and-pinctrl-fixup.patch \
file://0010-Update-PECI-drivers-to-sync-with-linux-upstreaming-v.patch \
file://0019-Add-I2C-IPMB-support.patch \
+ file://0020-misc-aspeed-add-lpc-mbox-driver.patch \
file://0021-Initial-Port-of-Aspeed-LPC-SIO-driver.patch \
file://0022-Add-AST2500-eSPI-driver.patch \
file://0026-Add-support-for-new-PECI-commands.patch \
@@ -24,14 +25,11 @@ SRC_URI += " \
file://0035-Implement-a-memory-driver-share-memory.patch \
file://0039-Add-Aspeed-PWM-driver-which-uses-FTTMR010-timer-IP.patch \
file://0040-i2c-Add-mux-hold-unhold-msg-types.patch \
- file://0041-Enable-passthrough-based-gpio-character-device.patch \
file://0042-Add-bus-timeout-ms-and-retries-device-tree-propertie.patch \
file://0043-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-BT.patch \
file://0044-misc-Add-clock-control-logic-into-Aspeed-LPC-SNOOP-d.patch \
file://0045-char-ipmi-Add-clock-control-logic-into-Aspeed-LPC-KC.patch \
- file://0046-misc-Add-clock-control-logic-into-Aspeed-LPC-MBOX-dr.patch \
file://0047-misc-Block-error-printing-on-probe-defer-case-in-Asp.patch \
- file://0048-ARM-dts-aspeed-Set-default-status-of-LPC-BT-as-disab.patch \
file://0049-Suppress-excessive-HID-gadget-error-logs.patch \
file://0051-Add-AST2500-JTAG-device.patch \
file://0052-drivers-jtag-Add-JTAG-core-driver.patch \
@@ -43,4 +41,7 @@ SRC_URI += " \
file://0058-i2c-aspeed-add-general-call-support.patch \
file://0065-i2c-aspeed-fix-master-pending-state-handling.patch \
file://0066-i2c-aspeed-add-buffer-mode-transfer-support.patch \
+ file://0067-i2c-aspeed-add-DMA-mode-transfer-support.patch \
+ file://0001-set-idle-disconnect-to-true-in-all-cases.patch \
+ file://0068-i2c-aspeed-add-H-W-timeout-support.patch \
"
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers/0001-Enable-passthrough-based-gpio-character-device.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers/0001-Enable-passthrough-based-gpio-character-device.patch
deleted file mode 100644
index 15e845ebc..000000000
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers/0001-Enable-passthrough-based-gpio-character-device.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 61a5796d151337fd537d1aeb3fb072dcdf96abbe Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Sun, 3 Feb 2019 16:08:11 +0800
-Subject: [PATCH] Enable passthrough based gpio character device.
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
----
- include/uapi/linux/gpio.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h
-index 1bf6e6df..8883ca90 100644
---- a/include/uapi/linux/gpio.h
-+++ b/include/uapi/linux/gpio.h
-@@ -62,7 +62,7 @@ struct gpioline_info {
- #define GPIOHANDLE_REQUEST_ACTIVE_LOW (1UL << 2)
- #define GPIOHANDLE_REQUEST_OPEN_DRAIN (1UL << 3)
- #define GPIOHANDLE_REQUEST_OPEN_SOURCE (1UL << 4)
--
-+#define GPIOHANDLE_REQUEST_PASS_THROUGH (1UL << 5)
- /**
- * struct gpiohandle_request - Information about a GPIO handle request
- * @lineoffsets: an array desired lines, specified by offset index for the
---
-2.16.2
-
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers_%.bbappend b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers_%.bbappend
deleted file mode 100644
index 703af71df..000000000
--- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-libc-headers_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += " \
- file://0001-Enable-passthrough-based-gpio-character-device.patch \
- "
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service
deleted file mode 100644
index bc05fa1a1..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Close Muxes
-ConditionFileNotEmpty=/usr/bin/CloseMuxes.py
-
-[Service]
-ExecStart=/usr/bin/env CloseMuxes.py
-Type=oneshot
-
-[Install]
-WantedBy=basic.target
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 8b9da74f0..d4b50df88 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,18 +1,8 @@
# this is here just to bump faster than upstream
SRC_URI = "git://github.com/openbmc/entity-manager.git"
-SRCREV = "15c49902cf030a91a5b4bd325d185ee74b760359"
+SRCREV = "441c7a86749b2331863b115e141033e735bd6ffc"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-RDEPENDS_${PN} += "python"
-SRC_URI += " file://xyz.openbmc_project.CloseMuxes.service"
-SYSTEMD_SERVICE_${PN} += " xyz.openbmc_project.CloseMuxes.service"
-
EXTRA_OECMAKE = "-DYOCTO=1 -DUSE_OVERLAYS=0"
-do_install_prepend() {
- install -d ${D}${bindir}
- install -m 0755 ${S}/scripts/CloseMuxes.py ${D}${bindir}
- install -d ${D}${base_libdir}/systemd/system
- install -m 0644 ${WORKDIR}/xyz.openbmc_project.CloseMuxes.service ${D}${base_libdir}/systemd/system
-}
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch
index 3ca81c388..fc09da3bd 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch
@@ -1,26 +1,24 @@
-From 068b816b3c9bf75dcd2a808fc81c67a32fbe29ea Mon Sep 17 00:00:00 2001
+From 62240a7ef12bb2ed3730a625ad7a809a9a6d0512 Mon Sep 17 00:00:00 2001
From: David Cobbley <david.j.cobbley@linux.intel.com>
Date: Wed, 6 Jun 2018 10:11:58 -0700
-Subject: [PATCH] Modify Dbus for IPv6.
+Subject: [PATCH 1/1] Modify Dbus for IPv6.
Add additional interfaces for IPv6 use.
+
+Signed-off-by: James Feist <james.feist@linux.intel.com>
---
- .../Network/EthernetInterface.interface.yaml | 17 ++++++++++++++++-
- xyz/openbmc_project/Network/IP.interface.yaml | 4 ++++
- 2 files changed, 20 insertions(+), 1 deletion(-)
+ .../Network/EthernetInterface.interface.yaml | 13 ++++++++++++-
+ xyz/openbmc_project/Network/IP.interface.yaml | 4 ++++
+ 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/xyz/openbmc_project/Network/EthernetInterface.interface.yaml b/xyz/openbmc_project/Network/EthernetInterface.interface.yaml
-index 744ac77..6b7cd9a 100644
+index 6fa1d0b..6b7cd9a 100644
--- a/xyz/openbmc_project/Network/EthernetInterface.interface.yaml
+++ b/xyz/openbmc_project/Network/EthernetInterface.interface.yaml
-@@ -42,6 +42,14 @@ properties:
+@@ -46,6 +46,10 @@ properties:
+ type: boolean
description: >
- This indicates link local auto configuration on this ethernet
- interface and configured on this ethernet interface.
-+ - name: IPv6AcceptRA
-+ type: boolean
-+ description: >
-+ Boolean for accepting router advertisements in IPv6
+ Boolean for accepting router advertisements in IPv6
+ - name: IPAddressEnables
+ type: enum[self.IPAllowed]
+ description: >
@@ -28,7 +26,7 @@ index 744ac77..6b7cd9a 100644
enumerations:
- name: LinkLocalConf
-@@ -52,4 +60,11 @@ enumerations:
+@@ -56,4 +60,11 @@ enumerations:
- name: v4
- name: v6
- name: none
@@ -42,13 +40,13 @@ index 744ac77..6b7cd9a 100644
+ - name: IPv4Only
+ - name: IPv6Only
diff --git a/xyz/openbmc_project/Network/IP.interface.yaml b/xyz/openbmc_project/Network/IP.interface.yaml
-index 565dcd6..2ffb016 100644
+index 5091ac9..b2442a5 100644
--- a/xyz/openbmc_project/Network/IP.interface.yaml
+++ b/xyz/openbmc_project/Network/IP.interface.yaml
-@@ -22,6 +22,10 @@ properties:
- type: string
- description: >
- This is the IP gateway for this address.
+@@ -34,6 +34,10 @@ properties:
+ errors:
+ - xyz::openbmc_project.Common.Error.NotAllowed
+
+ - name: BackupGateway
+ type: string
+ description: >
@@ -57,5 +55,5 @@ index 565dcd6..2ffb016 100644
type: enum[self.Protocol]
description: >
--
-2.7.4
+2.17.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch
deleted file mode 100644
index 0e25856ac..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-From a20f9fa9941533b591b6bbfe6b22a74b7c0dfe64 Mon Sep 17 00:00:00 2001
-From: Ed Tanous <ed.tanous@intel.com>
-Date: Thu, 24 Jan 2019 09:29:01 -0800
-Subject: [PATCH] Chassis Power Control are implemented.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Feature level:
-Power on server is ready
-Power off server is ready
-Power cycle server is ready
-Power reset server is ready
-
-Framework level:
-WebUI is enabled.
-IPMI Commands is enabled.
-Restful API is enabled.
-Physical buttons (Power/Reset/ID) are enabled.
-Chassis state manager is enabled.
-Host state manager is enabled.
-
-Enabled IPMI commands:
-ipmitool -H <ip_addr> -P <pass_word> -I lanplus chassis status
-ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power status
-ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power on
-ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power off
-ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power cycle
-ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power reset
-
-Enabled Restful APIs:
-Login: curl --noproxy <ip_addr> -c cjar -b cjar -k -H "Content-Type: application/json" -X POST https://<ip_addr>/login -d "{\"data\": [ \"root\", \"0penBmc\" ] }“
-Host State: curl --noproxy <ip_addr> -b cjar -k https://<ip_addr>/xyz/openbmc_project/state/host0
-Chassis State: curl --noproxy <ip_addr> -b cjar -k https://<ip_addr>/xyz/openbmc_project/state/chassis0
-Power state: curl --noproxy <ip_addr> -b cjar -k https://<ip_addr>/xyz/openbmc_project/Chassis/Control/Power0
-Power on/off: curl --noproxy <ip_addr> -q1c cjar -b cjar -k -H "Content-Type: application/json" -d '{"data": "xyz.openbmc_project.State.Host.Transition.Off"}' -X PUT https://<ip_addr>/xyz/openbmc_project/state/host0/attr/RequestedHostTransition
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- .../Chassis/Control/Chassis.interface.yaml | 94 ++++++++++++++++++++++
- .../Chassis/Control/Power.interface.yaml | 92 ++++++++++++++++++---
- 2 files changed, 173 insertions(+), 13 deletions(-)
- create mode 100644 xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml
-
-diff --git a/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml b/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml
-new file mode 100644
-index 0000000..c28492a
---- /dev/null
-+++ b/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml
-@@ -0,0 +1,94 @@
-+description: >
-+ chassis control service
-+methods:
-+ - name: powerOn
-+ description: >
-+ Power on system.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: powerOff
-+ description: >
-+ Power Off system.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: softPowerOff
-+ description: >
-+ Soft Power off system.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: reboot
-+ description: >
-+ reboot system.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: softReboot
-+ description: >
-+ Soft Reboot system.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: quiesce
-+ description: >
-+ Quiesce system.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: getPowerState
-+ description: >
-+ Get system power state.
-+ returns:
-+ - name: state
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-diff --git a/xyz/openbmc_project/Chassis/Control/Power.interface.yaml b/xyz/openbmc_project/Chassis/Control/Power.interface.yaml
-index 082586f..368beca 100644
---- a/xyz/openbmc_project/Chassis/Control/Power.interface.yaml
-+++ b/xyz/openbmc_project/Chassis/Control/Power.interface.yaml
-@@ -1,31 +1,97 @@
- description: >
-- Power control service
-+ Chassis control service
- methods:
-+ - name: setPowerState
-+ description: >
-+ set host power state.
-+ parameters:
-+ - name: state
-+ type: int32
-+ description: >
-+ 0 for force power off host
-+ 1 for power on host
-+ returns:
-+ - name: status
-+ type: int32
-+ description: >
-+ The result of command.
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
-+ - name: getPowerState
-+ description: >
-+ Get current host power status.
-+ returns:
-+ - name: status
-+ type: int32
-+ description: >
-+ Current host status,
-+ 0 for host power off
-+ 1 for host power on
-+ errors:
-+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
-+ - xyz.openbmc_project.Chassis.Common.Error.IOError
-+
- - name: forcePowerOff
- description: >
- Force power off the host.
- returns:
- - name: status
-- type: boolean
-+ type: int32
- description: >
- The result of power off command.
- errors:
- - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
-+
- - xyz.openbmc_project.Chassis.Common.Error.IOError
-
- properties:
-- - name: PGood
-- type: boolean
-- default: false
-+ - name: vrd_good
-+ type: int32
-+ default: 0
-+ description: >
-+ ACPI status
-+ - name: s4s5_state
-+ type: int32
-+ default: 0
-+ description: >
-+ ACPI status
-+ - name: pgood
-+ type: int32
-+ default: 0
- description: >
-- PSU Power good property
-- It is a read-only property.
-- - name: State
-+ pgood property
-+ - name: state
- type: int32
- default: 0
- description: >
-- System power status
-- 0: power is off
-- 1: power is on
-- Setting its value to change the system state
-- Read its value to get the system state.
-\ No newline at end of file
-+ state property
-+ - name: pgood_timeout
-+ type: int32
-+ default: 0
-+ description: >
-+ pgoodtimeout property
-+ - name: post_complete
-+ type: boolean
-+ default: false
-+ description: >
-+ The current BIOS POST state,
-+ false means not completed or system reset,
-+ true means BIOS POST completed.
-+ - name: PFail
-+ type: boolean
-+ default: true
-+ description: >
-+ The current booting status,
-+ true means booting from AC loss,
-+ false means not booting from AC loss.
-+signals:
-+ - name: PowerGood
-+ description: >
-+ Signal for powergood
-+ - name: PowerLost
-+ description: >
-+ Signal for powerlost
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch
deleted file mode 100644
index 1221a0ab4..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 72b7b30a5dda56c170ee2ce82c1082c26f4663e3 Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Tue, 31 Jul 2018 16:55:21 +0800
-Subject: [PATCH] Add host restart cause property.
-
-Add host restart cause property to track the information about what
-action last caused the system to restart.
-According to IPMI Spec, it includes 12 types as following:
-1. Unknown 0x0
-2. IpmiCommand 0x1
-3. ResetButton 0x2
-4. PowerButton 0x3
-5. WatchdogTimer 0x4
-6. OEM 0x5
-7. PowerPolicyAlwaysOn 0x6
-8. PowerPolicyPreviousState 0x7
-9. PEF-Reset 0x8
-10. PEF-PowerCycle 0x9
-11. SoftReset 0xA
-12. RTC-Wakeup 0xB
-
-Change-Id: Id2cc6a18b98e485a978940e5ffc085bf5c4fbed8
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
----
- xyz/openbmc_project/State/Host.interface.yaml | 52 +++++++++++++++++++
- 1 file changed, 52 insertions(+)
-
-diff --git a/xyz/openbmc_project/State/Host.interface.yaml b/xyz/openbmc_project/State/Host.interface.yaml
-index 8f481b8..a4d88d0 100644
---- a/xyz/openbmc_project/State/Host.interface.yaml
-+++ b/xyz/openbmc_project/State/Host.interface.yaml
-@@ -17,6 +17,12 @@ properties:
- comparing the CurrentHostState and the RequestedHostTransition
- properties.
-
-+ - name: HostRestartCause
-+ type: enum[self.RestartCause]
-+ default: Unknown
-+ description: >
-+ The information about what action last caused the system to restart.
-+
- enumerations:
- - name: Transition
- description: >
-@@ -45,3 +51,49 @@ enumerations:
- - name: 'Quiesced'
- description: >
- Host firmware is quiesced
-+
-+ - name: RestartCause
-+ description: >
-+ The information about what action last caused the system to restart.
-+ values:
-+ - name: Unknown
-+ description: >
-+ System start/restart detected but the reason is unknown.
-+ - name: IpmiCommand
-+ description: >
-+ System start/restart detected and caused by ipmi command.
-+ - name: ResetButton
-+ description: >
-+ System start/restart detected and caused by reset button.
-+ - name: PowerButton
-+ description: >
-+ System start/restart detected and caused by power button.
-+ - name: WatchdogTimer
-+ description: >
-+ System start/restart detected and casued by watchdog expiration.
-+ - name: OEM
-+ description: >
-+ System start/restart detected and caused by OEM command.
-+ - name: PowerPolicyAlwaysOn
-+ description: >
-+ System start/restart detected and caused by power restore policy
-+ "chassis always powers up after AC/mains is applied or returns".
-+ - name: PowerPolicyPreviousState
-+ description: >
-+ System start/restart detected and caused by power restore policy
-+ "after AC/mains is applied or returns, power is restored to the
-+ state was in effect when AC/mains removed or lost".
-+ - name: PEFReset
-+ description: >
-+ System start/restart detected and caused by PEF(reset).
-+ - name: PEFPowerCycle
-+ description: >
-+ System start/restart detected and caused by PEF(power-cycle).
-+ - name: SoftReset
-+ description: >
-+ System start/restart detected and caused by soft reset like
-+ "CTRL-ALT-DEL".
-+ - name: RTCWakeup
-+ description: >
-+ System start/restart detected and caused by system real time
-+ clock(RTC) wakeup.
-\ No newline at end of file
---
-2.17.0
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch
deleted file mode 100644
index a8d732dab..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 6d0069f4a2b4637c58fd321c9db3034ac9dd17c7 Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Wed, 12 Sep 2018 15:03:26 +0800
-Subject: [PATCH] Add multiple state signal for host start and stop
-
-Add six host state signals like following:
- - name: PreHostStart
- description: >
- This is the signal to indicate host is at pre start stage.
- - name: PostHostStart
- description: >
- This is the signal to indicate host is at start complete stage.
- - name: HostStarting
- description: >
- This is the signal to indicate host is at starting stage.
- - name: HostStoping
- description: >
- This is the signal to indicate host is at stoping stage.
- - name: PreHostStop
- description: >
- This is the signal to indicate host is at pre stop stage.
- - name: PostHostStop
- description: >
- This is the signal to indicate host is at stop complete stage.
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
----
- xyz/openbmc_project/State/Host.interface.yaml | 21 ++++++++++++++++++++-
- 1 file changed, 20 insertions(+), 1 deletion(-)
-
-diff --git a/xyz/openbmc_project/State/Host.interface.yaml b/xyz/openbmc_project/State/Host.interface.yaml
-index 8531a27..1ceba13 100644
---- a/xyz/openbmc_project/State/Host.interface.yaml
-+++ b/xyz/openbmc_project/State/Host.interface.yaml
-@@ -96,4 +96,23 @@ enumerations:
- - name: RTCWakeup
- description: >
- System start/restart detected and caused by system real time
-- clock(RTC) wakeup.
-\ No newline at end of file
-+ clock(RTC) wakeup.
-+signals:
-+ - name: PreHostStart
-+ description: >
-+ This is the signal to indicate host is at pre start stage.
-+ - name: PostHostStart
-+ description: >
-+ This is the signal to indicate host is at start complete stage.
-+ - name: HostStarting
-+ description: >
-+ This is the signal to indicate host is at starting stage.
-+ - name: HostStoping
-+ description: >
-+ This is the signal to indicate host is at stoping stage.
-+ - name: PreHostStop
-+ description: >
-+ This is the signal to indicate host is at pre stop stage.
-+ - name: PostHostStop
-+ description: >
-+ This is the signal to indicate host is at stop complete stage.
---
-2.16.2
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch
deleted file mode 100644
index 47fab819b..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 28fac58dc6ef975e1e9283163d9f1e4c7764c3cc Mon Sep 17 00:00:00 2001
-From: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
-Date: Sat, 2 Mar 2019 03:31:09 +0530
-Subject: [PATCH] Creating the Session interface- for Host and LAN
-
-Defined all needed session properites to manage the session in
-host and also in LAN
-
-Change-Id: Ic7cccfc3333a602ee07fcd60077ec58fd8f06304
-Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
-
-%% original patch: 0019-Creating-the-Session-interface-for-Host-and-LAN.patch
----
- xyz/openbmc_project/Ipmi/SESSION_README.md | 25 ++++++++++
- .../Ipmi/SessionInfo.interface.yaml | 57 ++++++++++++++++++++++
- 2 files changed, 82 insertions(+)
- create mode 100644 xyz/openbmc_project/Ipmi/SESSION_README.md
- create mode 100644 xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml
-
-diff --git a/xyz/openbmc_project/Ipmi/SESSION_README.md b/xyz/openbmc_project/Ipmi/SESSION_README.md
-new file mode 100644
-index 0000000..c59b251
---- /dev/null
-+++ b/xyz/openbmc_project/Ipmi/SESSION_README.md
-@@ -0,0 +1,25 @@
-+# Session Management
-+
-+## Overview
-+IPMI RMCP+ sessions are created and maintained by phosphor-ipmi-net daemon,
-+whereas we need to provide details about the same using phosphor-ipmi-host.
-+Hence IPMI RMCP+ session details has to be exposed through D-Bus interface,
-+so that both phosphor-ipmi-host & phosphr-ipmi-net will be in sync.
-+
-+
-+#### xyz.openbmc_project.Ipmi.SessionInfo interface
-+##### properties
-+* SessionHandle - SessionHandle,unique one-byte number to locate the session.
-+* Channel - Session created channel.
-+* SessionPrivilege - Privilege of the session.
-+* RemoteIPAddr – Remote IP address.
-+* RemotePort - Remote port address.
-+* RemoteMACAddress -Remote MAC Address.
-+* UserID - Session created by given user id.
-+
-+
-+
-+#### xyz.openbmc_project.Object.Delete
-+#### methods
-+* Delete - To delete the session object in the system.
-+
-diff --git a/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml b/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml
-new file mode 100644
-index 0000000..d461628
---- /dev/null
-+++ b/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml
-@@ -0,0 +1,57 @@
-+description: >
-+ Provides properties for IPMI RMCP+ session objects.
-+ Provides RMCP+ session information as session objects
-+ with Session ID (unique identifier) as path suffix.
-+
-+properties:
-+ - name: SessionHandle
-+ type: byte
-+ description: >
-+ Session Handle,unique number to locate the session.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: ChannelNum
-+ type: byte
-+ description: >
-+ channelnumber which session is created.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: CurrentPrivilege
-+ type: byte
-+ description: >
-+ Privilege of the session.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: RemoteIPAddr
-+ type: uint32
-+ description: >
-+ Remote IP address.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: RemotePort
-+ type: uint16
-+ description: >
-+ Remote IP Port.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: RemoteMACAddress
-+ type: array[byte]
-+ description: >
-+ Remote MAC address.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: UserID
-+ type: byte
-+ description: >
-+ Session created by given user ID.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+ - name: State
-+ type: byte
-+ default: 0
-+ description: >
-+ Session state.
-+ errors:
-+ - xyz.openbmc_project.Common.Error.InternalFailure
-+
-+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch
deleted file mode 100644
index f6e200cab..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 94fb1ac5dd4d54ea5a6d49597e1f15c384be7fd6 Mon Sep 17 00:00:00 2001
-From: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
-Date: Mon, 8 Apr 2019 11:48:22 +0530
-Subject: [PATCH] Add interface suppot for provisioning modes
-
-Support for provisioning modes are added in
-RestrictionMode.interface.yaml
-
-Tested:
-1. Verified build, and verified specified modes are available
-and able to set / get the same using busctl command
-
-Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
----
- .../Security/RestrictionMode.interface.yaml | 24 ++++++++++++++++++++++
- 1 file changed, 24 insertions(+)
-
-diff --git a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml
-index 8e4fd8d..d328dac 100644
---- a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml
-+++ b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml
-@@ -21,3 +21,27 @@ enumerations:
- - name: Blacklist
- description: >
- Prevent, if in the blacklist.
-+ - name: Provisioning
-+ description: >
-+ Indicate that system is in provisioning mode
-+ and all commands are allowed in KCS inteface
-+ in both pre and post BIOS boot.
-+ - name: ProvisionedKCSWhiteList
-+ description: >
-+ Commands in the whitelist will only be executed
-+ through KCS interface after BIOS POST complete.
-+ All KCS commands are supported before POST complete.
-+ - name: ProvisionedKCSDisabled
-+ description: >
-+ Commands through KCS interface are executed only
-+ till BIOS POST complete notification, after
-+ which no KCS commands will be executed(other
-+ than BIOS SMI based ones).
-+ - name: ValidationUnsecure
-+ description: >
-+ To indicate that BMC is in unsecure mode, and many
-+ operations which are not meant for end-user will be
-+ allowed in this mode. Interface which sets this
-+ property has to make sure due diligence is made
-+ as in this mode, many security intrinsic commands
-+ can be executed.
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch
new file mode 100644
index 000000000..62d5376d6
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch
@@ -0,0 +1,80 @@
+From 9b0630f40c7fb1143901f7d114c376426cc03501 Mon Sep 17 00:00:00 2001
+From: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
+Date: Sat, 15 Jun 2019 01:04:41 +0530
+Subject: [PATCH] [D-Bus Intf] Security modes property & intf update
+
+Defined new values for RestrictionMode property and defined
+SpecialMode interfaces to handle special cases like manufacturing
+and validation mode in OpenBMC.
+
+Note: Please refer Security mode design doc under review for more
+details
+https://gerrit.openbmc-project.xyz/#/c/openbmc/docs/+/21195/
+
+Change-Id: I270e7d23ca2ed260f2d121e3844c2ca79150070e
+Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
+---
+ .../Security/RestrictionMode.interface.yaml | 16 +++++++++++++
+ .../Control/Security/SpecialMode.interface.yaml | 26 ++++++++++++++++++++++
+ 2 files changed, 42 insertions(+)
+ create mode 100644 xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml
+
+diff --git a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml
+index 8e4fd8d..afd2279 100644
+--- a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml
++++ b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml
+@@ -21,3 +21,19 @@ enumerations:
+ - name: Blacklist
+ description: >
+ Prevent, if in the blacklist.
++ - name: Provisioning
++ description: >
++ Indicate that system is in provisioning mode
++ and all commands are allowed in system inteface
++ in both pre and post BIOS boot.
++ - name: ProvisionedHostWhitelist
++ description: >
++ Commands in the whitelist will only be executed
++ through system interface after BIOS POST complete.
++ All KCS commands are supported before POST complete.
++ - name: ProvisionedHostDisabled
++ description: >
++ Commands through system interface are executed only
++ till BIOS POST complete notification, after
++ which no system interface commands will be executed(other
++ than BIOS SMI based ones).
+diff --git a/xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml b/xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml
+new file mode 100644
+index 0000000..6760076
+--- /dev/null
++++ b/xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml
+@@ -0,0 +1,26 @@
++description: >
++ Implement to specify a special mode of operation
++
++properties:
++ - name: SpecialMode
++ type: enum[self.Modes]
++ description: >
++ The special mode.
++
++enumerations:
++ - name: Modes
++ description: >
++ Possible modes available.
++ values:
++ - name: None
++ description: >
++ BMC is under normal working condition.
++ - name: Manufacturing
++ description: >
++ Indicate that BMC is in manufacturing mode
++ and is allowed to perform any manufacturing related
++ activity
++ - name: ValidationUnsecure
++ description: >
++ Indicate that BMC is in validation mode, and can
++ execute any special validation related commands
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch
deleted file mode 100644
index 650fd3bc9..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 9c94439a5a55efbb72bee10e9cfa0827dbedf511 Mon Sep 17 00:00:00 2001
-From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
-Date: Mon, 3 Jun 2019 16:35:46 -0700
-Subject: [PATCH] Add host interrupt to the Host State
-
-This adds host Interrupt as possible Transition value for the
-Host State. This is to support an interrupt signal to the host
-firmware or software.
-
-Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
----
- xyz/openbmc_project/State/Host.interface.yaml | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/xyz/openbmc_project/State/Host.interface.yaml b/xyz/openbmc_project/State/Host.interface.yaml
-index 1ceba13..3d71280 100644
---- a/xyz/openbmc_project/State/Host.interface.yaml
-+++ b/xyz/openbmc_project/State/Host.interface.yaml
-@@ -28,6 +28,9 @@ enumerations:
- description: >
- The desired transition for host firmware
- values:
-+ - name: 'Interrupt'
-+ description: >
-+ Host firmware should be interrupted
- - name: 'Off'
- description: >
- Host firmware should be off
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch
new file mode 100644
index 000000000..d7e66abd2
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch
@@ -0,0 +1,39 @@
+From b7c487750c05dcc081219ccdd4ef539beef6aa30 Mon Sep 17 00:00:00 2001
+From: Ren Yu <yux.ren@intel.com>
+Date: Mon, 29 Jul 2019 10:51:12 +0800
+Subject: [PATCH] Add PreInterruptFlag properity in DBUS.
+
+PreTimeoutInterruptOccurFlag in DBUS would be set 'true'
+when watchdog pre-timeout interrupt occurred.
+
+Tested:
+Enable command(raw 0x06 0x31) that get message flag
+can set right bit about watchdog,
+need record PreTimeoutInterruptOccurFlag
+at xyz.openbmmc_project.State.Watchdog when watchdog
+pre-timeout interrupt occurred.
+
+Signed-off-by: Ren Yu <yux.ren@intel.com>
+---
+ xyz/openbmc_project/State/Watchdog.interface.yaml | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/xyz/openbmc_project/State/Watchdog.interface.yaml b/xyz/openbmc_project/State/Watchdog.interface.yaml
+index bf4cca0..6579368 100644
+--- a/xyz/openbmc_project/State/Watchdog.interface.yaml
++++ b/xyz/openbmc_project/State/Watchdog.interface.yaml
+@@ -59,6 +59,11 @@ properties:
+ description: >
+ The timer user at the time of expiration.
+ default: 'Reserved'
++ - name: PreTimeoutInterruptOccurFlag
++ type: boolean
++ description: >
++ PreTimeoutInterruptOccurFlag that preTimeoutInterrupt action occurred.
++ default: false
+
+ enumerations:
+ - name: Action
+--
+2.7.4
+
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 89b8da753..40b00e70f 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,22 +1,18 @@
SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git"
-SRCREV = "1f0e2ce6e1cb78a59a0015b160816b71156b03c6"
+SRCREV = "ddc9e9f9d6ed0282ec6c1421a706b45f3c09ebcc"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0002-Modify-Dbus-for-IPv6.patch \
- file://0003-Chassis-Power-Control-are-implemented.patch \
file://0005-Add-DBUS-interface-of-CPU-and-Memory-s-properties.patch \
file://0007-ipmi-set-BIOS-id.patch \
- file://0009-Add-host-restart-cause-property.patch \
file://0010-Increase-the-default-watchdog-timeout-value.patch \
file://0012-Add-RestoreDelay-interface-for-power-restore-delay.patch \
file://0013-Add-ErrConfig.yaml-interface-for-processor-error-config.patch \
- file://0014-Add-multiple-state-signal-for-host-start-and-stop.patch \
file://0016-Add-DBUS-interface-of-SMBIOS-MDR-V2.patch \
file://0018-Define-post-code-interfaces-for-post-code-manager.patch \
- file://0019-Creating-the-Session-interface-for-Host-and-LAN.patch \
- file://0021-Add-interface-suppot-for-provisioning-modes.patch \
+ file://0021-D-Bus-Intf-Security-modes-property-intf-update.patch \
file://0022-Add-chassis-power-cycle-and-reset-to-Chassis-State.patch \
- file://0023-Add-host-interrupt-to-the-Host-State.patch \
file://0024-Add-the-pre-timeout-interrupt-defined-in-IPMI-spec.patch \
+ file://0025-Add-PreInterruptFlag-properity-in-DBUS.patch \
"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
index e8baaa23e..0e80b554a 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
@@ -1,7 +1,7 @@
[Unit]
Description=Phosphor-Pid-Control Margin-based Fan Control Daemon
-After=xyz.openbmc_project.EntityManager
-After=xyz.openbmc_project.ObjectMapper
+After=xyz.openbmc_project.EntityManager.service
+After=xyz.openbmc_project.ObjectMapper.service
[Service]
Restart=always
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
index e1ec04ff6..30044eb6e 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
@@ -5,6 +5,6 @@ SYSTEMD_SERVICE_${PN} = "phosphor-pid-control.service"
EXTRA_OECONF = "--enable-configure-dbus=yes"
SRC_URI = "git://github.com/openbmc/phosphor-pid-control.git"
-SRCREV = "1dad21b935b8359806de9a9cc3aa7b7463cc8df3"
+SRCREV = "a7ec8350d17b70153cebe666d3fbe88bddd02a1a"
FILES_${PN} = "${bindir}/swampd ${bindir}/setsensor"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
index 719c2562a..2efe911ae 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend
@@ -3,8 +3,6 @@ EXTRA_OECONF += "--enable-fwupd_script"
SYSTEMD_SERVICE_${PN}-updater += "fwupd@.service"
-#Currently enforcing image signature validation only for PFR images
-PACKAGECONFIG_append = "${@bb.utils.contains('IMAGE_TYPE', 'pfr', ' verify_signature', '', d)}"
SRC_URI += "file://0002-Redfish-firmware-activation.patch \
file://0004-Changed-the-condition-of-software-version-service-wa.patch \
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb
deleted file mode 100644
index cef2fdcaa..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Gpio daemon service for handling gpio operations"
-DESCRIPTION = "Daemon allows to block gpio access under certain conditions"
-
-PV = "1.0+git${SRCPV}"
-
-S = "${WORKDIR}/git/gpiodaemon"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
-
-SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
-
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
-
-inherit cmake systemd
-SYSTEMD_SERVICE_${PN} = "gpiodaemon.service"
-
-DEPENDS = "boost systemd sdbusplus phosphor-logging"
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 3f870103b..8d13272bb 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 = "fa1a5a38551bd1b9f04ad2d4f9fea2e5ade5cc4c"
+SRCREV = "2c0feb0085ac3cc11c6fd77df7a8c7701f38fea5"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json
index c2f3c9a0e..92731f439 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json
@@ -22,13 +22,13 @@
}
},
"2" : {
- "name" : "eth2",
- "is_valid" : true,
+ "name" : "RESERVED",
+ "is_valid" : false,
"active_sessions" : 0,
"channel_info" : {
- "medium_type" : "lan-802.3",
- "protocol_type" : "ipmb-1.0",
- "session_supported" : "multi-session",
+ "medium_type" : "reserved",
+ "protocol_type" : "na",
+ "session_supported" : "session-less",
"is_ipmi" : true
}
},
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch
deleted file mode 100644
index 236bd18f4..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 39df500f277eca01d6a0538d4db8ec34894d9441 Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Mon, 17 Sep 2018 12:59:12 +0800
-Subject: [PATCH] Modify dbus interface for power control
-
-Switch power control service namespace from "org" to "xyz",
-to compatible with new intel-chassis services
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- chassishandler.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/chassishandler.cpp b/chassishandler.cpp
-index 6002e7a..0e83bba 100644
---- a/chassishandler.cpp
-+++ b/chassishandler.cpp
-@@ -786,8 +786,8 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_data_len_t data_len,
- ipmi_context_t context)
- {
-- const char* objname = "/org/openbmc/control/power0";
-- const char* intf = "org.openbmc.control.Power";
-+ const char* objname = "/xyz/openbmc_project/Chassis/Control/Power0";
-+ const char* intf = "xyz.openbmc_project.Chassis.Control.Power";
-
- sd_bus* bus = NULL;
- sd_bus_message* reply = NULL;
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch
index c1ec6ac6e..efee7cc26 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch
@@ -1,56 +1,36 @@
-From 4953a9f2233fd24a28da84443cea6aebecd14fbc Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Mon, 17 Sep 2018 13:20:54 +0800
-Subject: [PATCH] fix "get system GUID" ipmi command
+commit 72e6573f36fd3b9ce018e71b07bc1be63275d1f8
+Author: Vernon Mauery <vernon.mauery@linux.intel.com>
+Date: Fri Jun 21 12:27:20 2019 -0700
-Change-Id: I15c71607c24ad8b3e2c9065a5470002ecb1761bb
-Signed-off-by: Jia, Chunhui <chunhui.jia@intel.com>
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- apphandler.cpp | 7 ++-----
- host-ipmid-whitelist.conf | 1 +
- 2 files changed, 3 insertions(+), 5 deletions(-)
+ Fix 'Get System GUID' to use settings UUID
+
+ The upstream Get System GUID command looks first for a BMC interface
+ and then assumes that the UUID interface is next to that. But that is
+ not the case on Intel systems where the system GUID is found in the
+ settings daemon.
+
+ Change-Id: I924bd05e0a546f2b30288c1faf72157296ab6579
+ Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/apphandler.cpp b/apphandler.cpp
-index f2889c5..9149373 100644
+index 280d0db..25af6bb 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
-@@ -48,7 +48,7 @@ extern sd_bus* bus;
-
- constexpr auto bmc_state_interface = "xyz.openbmc_project.State.BMC";
- constexpr auto bmc_state_property = "CurrentBMCState";
--constexpr auto bmc_interface = "xyz.openbmc_project.Inventory.Item.Bmc";
-+// phosphor-setting-manager is the unique service that holds this interface
- constexpr auto bmc_guid_interface = "xyz.openbmc_project.Common.UUID";
- constexpr auto bmc_guid_property = "UUID";
- constexpr auto bmc_guid_len = 16;
-@@ -546,8 +545,7 @@ ipmi_ret_t ipmi_app_get_sys_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+@@ -799,8 +799,6 @@ auto ipmiAppGetBtCapabilities()
+
+ auto ipmiAppGetSystemGuid() -> ipmi::RspType<std::array<uint8_t, 16>>
+ {
+- static constexpr auto bmcInterface =
+- "xyz.openbmc_project.Inventory.Item.Bmc";
+ static constexpr auto uuidInterface = "xyz.openbmc_project.Common.UUID";
+ static constexpr auto uuidProperty = "UUID";
+
+@@ -809,7 +807,7 @@ auto ipmiAppGetSystemGuid() -> ipmi::RspType<std::array<uint8_t, 16>>
{
// Get the Inventory object implementing BMC interface
- ipmi::DbusObjectInfo bmcObject =
-- ipmi::getDbusObject(bus, bmc_interface);
--
-+ ipmi::getDbusObject(bus, bmc_guid_interface);
+ auto busPtr = getSdBus();
+- auto objectInfo = ipmi::getDbusObject(*busPtr, bmcInterface);
++ auto objectInfo = ipmi::getDbusObject(*busPtr, uuidInterface);
+
// Read UUID property value from bmcObject
// UUID is in RFC4122 format Ex: 61a39523-78f2-11e5-9862-e6402cfc3223
- auto variant =
-@@ -591,7 +589,6 @@ ipmi_ret_t ipmi_app_get_sys_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- catch (const InternalFailure& e)
- {
- log<level::ERR>("Failed in reading BMC UUID property",
-- entry("INTERFACE=%s", bmc_interface),
- entry("PROPERTY_INTERFACE=%s", bmc_guid_interface),
- entry("PROPERTY=%s", bmc_guid_property));
- return IPMI_CC_UNSPECIFIED_ERROR;
-diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
-index 2c37ac9..164edbe 100644
---- a/host-ipmid-whitelist.conf
-+++ b/host-ipmid-whitelist.conf
-@@ -40,3 +40,4 @@
- 0x2C:0x06 //<Group Extension>:<Get Asset Tag>
- 0x2C:0x07 //<Group Extension>:<Get Sensor Info>
- 0x2C:0x10 //<Group Extension>:<Get Temperature Readings>
-+0x30:0x41 //<OEM>:<Set System GUID>
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch
index ae10ab60a..396d2e949 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch
@@ -10,16 +10,13 @@ Signed-off-by: Jia, Chunhui <chunhui.jia@intel.com>
host-ipmid-whitelist.conf | 2 ++
1 file changed, 2 insertions(+)
-diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
-index 164edbe..db54a49 100644
---- a/host-ipmid-whitelist.conf
-+++ b/host-ipmid-whitelist.conf
-@@ -41,3 +41,5 @@
+Index: phosphor-host-ipmid/host-ipmid-whitelist.conf
+===================================================================
+--- phosphor-host-ipmid.orig/host-ipmid-whitelist.conf
++++ phosphor-host-ipmid/host-ipmid-whitelist.conf
+@@ -47,3 +47,5 @@
+ 0x2C:0x06 //<Group Extension>:<Get Asset Tag>
0x2C:0x07 //<Group Extension>:<Get Sensor Info>
0x2C:0x10 //<Group Extension>:<Get Temperature Readings>
- 0x30:0x41 //<OEM>:<Set System GUID>
+0x30:0x26 //<OEM>:<Set BIOS ID>
+0x30:0x27 //<OEM>:<Get Device Info>
---
-2.16.2
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch
deleted file mode 100644
index cba0cde32..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 6d5a372e0cf98de4d97a88d2cd42a00b7a8f034f Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Sun, 16 Sep 2018 21:32:38 +0800
-Subject: [PATCH] Implement IPMI Commmand - Get Host Restart Cause.
-
-It supports to track the information about what
-action last caused the system to restart.
-Return value includes: restart_cause and channel_number.
-
-According to IPMI Spec, it includes 12 types as following:
-1. Unknown 0x0
-2. IpmiCommand 0x1
-3. ResetButton 0x2
-4. PowerButton 0x3
-5. WatchdogTimer 0x4
-6. OEM 0x5
-7. PowerPolicyAlwaysOn 0x6
-8. PowerPolicyPreviousState 0x7
-9. PEF-Reset 0x8
-10. PEF-PowerCycle 0x9
-11. SoftReset 0xA
-12. RTC-Wakeup 0xB
-
-Change-Id: Id3b32e271b85b5fc4c69d5ca40227f8f9c08ce48
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- chassishandler.cpp | 54 +++++++++++++++++++++++++++++++++++++++
- chassishandler.hpp | 1 +
- host-ipmid-whitelist.conf | 1 +
- 3 files changed, 56 insertions(+)
-
-diff --git a/chassishandler.cpp b/chassishandler.cpp
-index d20b220..8a8cb26 100644
---- a/chassishandler.cpp
-+++ b/chassishandler.cpp
-@@ -90,6 +90,11 @@ static constexpr auto chassisPOHStateIntf =
- "xyz.openbmc_project.State.PowerOnHours";
- static constexpr auto pOHCounterProperty = "POHCounter";
- static constexpr auto match = "chassis0";
-+const static constexpr char* stateHostInterface =
-+ "xyz.openbmc_project.State.Host";
-+const static constexpr char* hostRestartCauseInterface =
-+ "xyz.openbmc_project.State.Host.HostRestartCause";
-+const static constexpr char* hostRestartCause = "HostRestartCause";
- const static constexpr char chassisCapIntf[] =
- "xyz.openbmc_project.Control.ChassisCapabilities";
- const static constexpr char chassisCapFlagsProp[] = "CapabilitiesFlags";
-@@ -176,6 +181,13 @@ struct set_sys_boot_options_t
- uint8_t data[SIZE_BOOT_OPTION];
- } __attribute__((packed));
-
-+struct GetSysRestartCauseResponse
-+{
-+ uint8_t restartCause;
-+ uint8_t channelNum;
-+
-+} __attribute__((packed));
-+
- int getHostNetworkData(get_sys_boot_options_response_t* respptr)
- {
- ipmi::PropertyMap properties;
-@@ -1584,6 +1596,44 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- return rc;
- }
-
-+ipmi_ret_t ipmi_chassis_get_sys_restart_cause(
-+ ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
-+ ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context)
-+{
-+ ipmi_ret_t rc = IPMI_CC_OK;
-+
-+ GetSysRestartCauseResponse* resp = (GetSysRestartCauseResponse*)response;
-+ std::fill(reinterpret_cast<uint8_t*>(resp),
-+ reinterpret_cast<uint8_t*>(resp) + sizeof(*resp), 0);
-+ if (*data_len != 0)
-+ {
-+ rc = IPMI_CC_REQ_DATA_LEN_INVALID;
-+ return rc;
-+ }
-+
-+ try
-+ {
-+ sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
-+ ipmi::DbusObjectInfo hostObject =
-+ ipmi::getDbusObject(bus, stateHostInterface);
-+ ipmi::Value variant =
-+ ipmi::getDbusProperty(bus, hostObject.second, hostObject.first,
-+ hostRestartCauseInterface, hostRestartCause);
-+ resp->restartCause = variant.get<uint8_t>();
-+ }
-+
-+ catch (std::exception& e)
-+ {
-+ log<level::ERR>(e.what());
-+ rc = IPMI_CC_UNSPECIFIED_ERROR;
-+ return rc;
-+ }
-+ resp->channelNum = 0; // Fix to primary channel.
-+ *data_len = sizeof(GetSysRestartCauseResponse);
-+
-+ return rc;
-+}
-+
- /** @brief implements Get POH counter command
- * @parameter
- * - none
-@@ -1739,4 +1789,8 @@ void register_netfn_chassis_functions()
- ipmi::chassis::cmdSetPowerRestorePolicy,
- ipmi::Privilege::Operator,
- ipmiChassisSetPowerRestorePolicy);
-+
-+ // <get Host Restart Cause>
-+ ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_SYS_RESTART_CAUSE, NULL,
-+ ipmi_chassis_get_sys_restart_cause, PRIVILEGE_USER);
- }
-diff --git a/chassishandler.hpp b/chassishandler.hpp
-index 49b5ef8..2c42b11 100644
---- a/chassishandler.hpp
-+++ b/chassishandler.hpp
-@@ -17,6 +17,7 @@ enum ipmi_netfn_chassis_cmds
- // Set Power Restore Policy
- IPMI_CMD_SET_RESTORE_POLICY = 0x06,
- // Get capability bits
-+ IPMI_CMD_GET_SYS_RESTART_CAUSE = 0x07,
- IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08,
- IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09,
- IPMI_CMD_GET_POH_COUNTER = 0x0F,
-diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
-index c1fca1d..94232de 100644
---- a/host-ipmid-whitelist.conf
-+++ b/host-ipmid-whitelist.conf
-@@ -4,6 +4,7 @@
- 0x00:0x02 //<Chassis>:<Chassis Control>
- 0x00:0x05 //<Chassis>:<Set Chassis Capabilities>
- 0x00:0x06 //<Chassis>:<Set Power Restore Policy>
-+0x00:0x07 //<Chassis>:<Get System Restart Cause>
- 0x00:0x08 //<Chassis>:<Set System Boot Options>
- 0x00:0x09 //<Chassis>:<Get System Boot Options>
- 0x00:0x0F //<Chassis>:<Get POH Counter Command>
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch
deleted file mode 100644
index aba5eb095..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 59287a8869b5253a1b4203e0cc8a92f063dcc7e6 Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Tue, 25 Sep 2018 16:08:22 +0800
-Subject: [PATCH] Fix "Unspecified error" on ipmi restart cause command
-
-Needs to convert the dbus value(enum) into ipmi value(uint8)
-
-Tested by:
-ipmitool chassis restart_cause
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- chassishandler.cpp | 28 ++++++++++++++++++++++++++--
- 1 file changed, 26 insertions(+), 2 deletions(-)
-
-diff --git a/chassishandler.cpp b/chassishandler.cpp
-index 40eb4f5..c3d4931 100644
---- a/chassishandler.cpp
-+++ b/chassishandler.cpp
-@@ -106,7 +106,7 @@ static constexpr auto match = "chassis0";
- const static constexpr char* stateHostInterface =
- "xyz.openbmc_project.State.Host";
- const static constexpr char* hostRestartCauseInterface =
-- "xyz.openbmc_project.State.Host.HostRestartCause";
-+ "xyz.openbmc_project.State.Host";
- const static constexpr char* hostRestartCause = "HostRestartCause";
- const static constexpr char chassisCapIntf[] =
- "xyz.openbmc_project.Control.ChassisCapabilities";
-@@ -1764,6 +1764,26 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- return rc;
- }
-
-+namespace restart_cause
-+{
-+
-+using namespace sdbusplus::xyz::openbmc_project::State::server;
-+
-+std::map<Host::RestartCause, uint8_t> dbusToIpmi = {
-+ {Host::RestartCause::Unknown, 0x0},
-+ {Host::RestartCause::IpmiCommand, 0x1},
-+ {Host::RestartCause::ResetButton, 0x2},
-+ {Host::RestartCause::PowerButton, 0x3},
-+ {Host::RestartCause::WatchdogTimer, 0x4},
-+ {Host::RestartCause::OEM, 0x5},
-+ {Host::RestartCause::PowerPolicyAlwaysOn, 0x6},
-+ {Host::RestartCause::PowerPolicyPreviousState, 0x7},
-+ {Host::RestartCause::PEFReset, 0x8},
-+ {Host::RestartCause::PEFPowerCycle, 0x9},
-+ {Host::RestartCause::SoftReset, 0xa},
-+ {Host::RestartCause::RTCWakeup, 0xb}};
-+} // namespace restart_cause
-+
- ipmi_ret_t ipmi_chassis_get_sys_restart_cause(
- ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
- ipmi_response_t response, ipmi_data_len_t data_len, ipmi_context_t context)
-@@ -1787,7 +1807,11 @@ ipmi_ret_t ipmi_chassis_get_sys_restart_cause(
- ipmi::Value variant =
- ipmi::getDbusProperty(bus, hostObject.second, hostObject.first,
- hostRestartCauseInterface, hostRestartCause);
-- resp->restartCause = variant.get<uint8_t>();
-+
-+ std::string restartCause =
-+ sdbusplus::message::variant_ns::get<std::string>(variant);
-+ resp->restartCause = restart_cause::dbusToIpmi.at(
-+ restart_cause::Host::convertRestartCauseFromString(restartCause));
- }
-
- catch (std::exception& e)
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch
deleted file mode 100644
index fd7cf1851..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-From b8b88a5c0f9e9cb6023cb8d5453e5cfadaa1a375 Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Fri, 4 Jan 2019 10:50:21 +0800
-Subject: [PATCH] Implement set front panel button enables command
-
-Through modify buttons' property "Enabled" to disable/enable
-corresponding button.
-Currently support power and reset button.
-
-Test-By: ipmitool raw 0x0 0xa 0x2 //disable reset button
- ipmitool raw 0x0 0xa 0x1 //disable power button
- ipmitool raw 0x0 0xa 0x0 //enable all buttons
-
-Change-Id: Ice6f58edb898689f7a7fa08ad078d25fccaab27e
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
----
- chassishandler.cpp | 98 +++++++++++++++++++++++++++++++++++++++
- chassishandler.hpp | 1 +
- host-ipmid-whitelist.conf | 1 +
- 3 files changed, 100 insertions(+)
-
-diff --git a/chassishandler.cpp b/chassishandler.cpp
-index 4b42b3c..1a5b805 100644
---- a/chassishandler.cpp
-+++ b/chassishandler.cpp
-@@ -112,6 +112,8 @@ const static constexpr char chassisSMDevAddrProp[] = "SMDeviceAddress";
- const static constexpr char chassisBridgeDevAddrProp[] = "BridgeDeviceAddress";
- static constexpr uint8_t chassisCapFlagMask = 0x0f;
- static constexpr uint8_t chassisCapAddrMask = 0xfe;
-+static constexpr uint8_t disableResetButton = 0x2;
-+static constexpr uint8_t disablePowerButton = 0x1;
- static constexpr const char* powerButtonIntf =
- "xyz.openbmc_project.Chassis.Buttons.Power";
- static constexpr const char* powerButtonPath =
-@@ -140,6 +142,19 @@ struct GetPOHCountResponse
- uint8_t front_panel_button_cap_status;
- } __attribute__((packed)) ipmi_get_chassis_status_t;
-
-+typedef struct
-+{
-+ uint8_t disables; // Front Panel Button Enables
-+ //[7:4] - reserved
-+ //[3] - 1b = disable Standby (sleep) button for entering standby (sleep)
-+ //(control can still be used to wake the system)
-+ //[2] - 1b = disable Diagnostic Interrupt button
-+ //[1] - 1b = disable Reset button
-+ //[0] - 1b = disable Power off button for power off only (in the case there
-+ // is a single combined power/standby (sleep) button, then this also
-+ // disables sleep requests via that button)
-+} __attribute__((packed)) IPMISetFrontPanelButtonEnablesReq;
-+
- // Phosphor Host State manager
- namespace State = sdbusplus::xyz::openbmc_project::State::server;
-
-@@ -1721,6 +1738,82 @@ ipmi_ret_t ipmi_chassis_set_power_restore_policy(
- return ipmi::responseSuccess(power_policy::allSupport);
- }
-
-+ipmi_ret_t ipmiSetFrontPanelButtonEnables(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-+ ipmi_request_t request,
-+ ipmi_response_t response,
-+ ipmi_data_len_t data_len,
-+ ipmi_context_t context)
-+{
-+ bool enable = false;
-+ constexpr const char* powerButtonIntf =
-+ "xyz.openbmc_project.Chassis.Buttons.Power";
-+ constexpr const char* powerButtonPath =
-+ "/xyz/openbmc_project/Chassis/Buttons/Power0";
-+ constexpr const char* resetButtonIntf =
-+ "xyz.openbmc_project.Chassis.Buttons.Reset";
-+ constexpr const char* resetButtonPath =
-+ "/xyz/openbmc_project/Chassis/Buttons/Reset0";
-+ using namespace chassis::internal;
-+
-+ IPMISetFrontPanelButtonEnablesReq* req =
-+ static_cast<IPMISetFrontPanelButtonEnablesReq*>(request);
-+ if (*data_len != 1)
-+ {
-+ *data_len = 0;
-+ log<level::ERR>("IPMI request len is invalid");
-+ return IPMI_CC_REQ_DATA_LEN_INVALID;
-+ }
-+ *data_len = 0;
-+ if (req->disables & disablePowerButton)
-+ {
-+ // Disable power button
-+ enable = false;
-+ }
-+ else
-+ {
-+ // Enable power button
-+ enable = true;
-+ }
-+ // set power button Enabled property
-+ try
-+ {
-+ auto service = ipmi::getService(dbus, powerButtonIntf, powerButtonPath);
-+ ipmi::setDbusProperty(dbus, service, powerButtonPath, powerButtonIntf,
-+ "Enabled", enable);
-+ }
-+ catch (sdbusplus::exception::SdBusError& e)
-+ {
-+ log<level::ERR>(e.what());
-+ log<level::ERR>("Fail to set power button Enabled property");
-+ return IPMI_CC_UNSPECIFIED_ERROR;
-+ }
-+
-+ if (req->disables & disableResetButton)
-+ {
-+ // disable reset button
-+ enable = false;
-+ }
-+ else
-+ {
-+ // enable reset button
-+ enable = true;
-+ }
-+ // set reset button Enabled property
-+ try
-+ {
-+ auto service = ipmi::getService(dbus, resetButtonIntf, resetButtonPath);
-+ ipmi::setDbusProperty(dbus, service, resetButtonPath, resetButtonIntf,
-+ "Enabled", enable);
-+ }
-+ catch (sdbusplus::exception::SdBusError& e)
-+ {
-+ log<level::ERR>(e.what());
-+ log<level::ERR>("Fail to set reset button Enabled property");
-+ return IPMI_CC_UNSPECIFIED_ERROR;
-+ }
-+ return IPMI_CC_OK;
-+}
-+
- void register_netfn_chassis_functions()
- {
- createIdentifyTimer();
-@@ -1733,6 +1826,11 @@ void register_netfn_chassis_functions()
- ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_CHASSIS_CAP, NULL,
- ipmi_get_chassis_cap, PRIVILEGE_USER);
-
-+ // Set Front Panel Button Enables
-+ ipmi_register_callback(NETFUN_CHASSIS,
-+ IPMI_CMD_SET_FRONT_PANEL_BUTTON_ENABLES, NULL,
-+ ipmiSetFrontPanelButtonEnables, PRIVILEGE_ADMIN);
-+
- // Set Chassis Capabilities
- ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_SET_CHASSIS_CAP, NULL,
- ipmi_set_chassis_cap, PRIVILEGE_USER);
-diff --git a/chassishandler.hpp b/chassishandler.hpp
-index 49b5ef8..f4a6bff 100644
---- a/chassishandler.hpp
-+++ b/chassishandler.hpp
-@@ -19,6 +19,7 @@ enum ipmi_netfn_chassis_cmds
- IPMI_CMD_GET_SYS_RESTART_CAUSE = 0x07,
- IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08,
- IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09,
-+ IPMI_CMD_SET_FRONT_PANEL_BUTTON_ENABLES = 0x0A,
- IPMI_CMD_GET_POH_COUNTER = 0x0F,
- };
-
-diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
-index e5cd0b5..d96d9ed 100644
---- a/host-ipmid-whitelist.conf
-+++ b/host-ipmid-whitelist.conf
-@@ -6,6 +6,7 @@
- 0x00:0x07 //<Chassis>:<Get System Restart Cause>
- 0x00:0x08 //<Chassis>:<Set System Boot Options>
- 0x00:0x09 //<Chassis>:<Get System Boot Options>
-+0x00:0x0A //<Chassis>:<Set Front Panel Button Enables>
- 0x00:0x0F //<Chassis>:<Get POH Counter Command>
- 0x04:0x02 //<Sensor/Event>:<Platform event>
- 0x04:0x2D //<Sensor/Event>:<Get Sensor Reading>
---
-2.19.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch
deleted file mode 100644
index 42bb682c4..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From f51bef8f7c5785405ee5c83a921efb1bc05e4947 Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Wed, 27 Mar 2019 16:11:25 +0800
-Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9CAC=20failed=E2=80=9D=20bit=20sup?=
- =?UTF-8?q?port=20for=20get=20chassis=20status=20command?=
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-PFail property is provided by power control service,
-ture means the booting is from AC loss.
-
-Tested:
-Remove the AC cable and reconnect it
-Ipmitool chassis status to check the status:
-Last Power Event : ac-failed
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- chassishandler.cpp | 26 ++++++++++++++++++++++++++
- 1 file changed, 26 insertions(+)
-
-diff --git a/chassishandler.cpp b/chassishandler.cpp
-index 7a522ad..40d2018 100644
---- a/chassishandler.cpp
-+++ b/chassishandler.cpp
-@@ -844,6 +844,7 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- sd_bus_message* reply = NULL;
- int r = 0;
- int pgood = 0;
-+ bool pFail = true;
- char* busname = NULL;
- ipmi_ret_t rc = IPMI_CC_OK;
- ipmi_get_chassis_status_t chassis_status{};
-@@ -904,6 +905,26 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- goto finish;
- }
-
-+ r = sd_bus_get_property(bus, busname, objname, intf, "PFail", NULL, &reply,
-+ "b");
-+ if (r < 0)
-+ {
-+ log<level::ERR>("Failed to call sd_bus_get_property",
-+ entry("PROPERTY=%s", "PFail"), entry("ERRNO=0x%X", -r),
-+ entry("BUS=%s", busname), entry("PATH=%s", objname),
-+ entry("INTERFACE=%s", intf));
-+ rc = IPMI_CC_UNSPECIFIED_ERROR;
-+ goto finish;
-+ }
-+
-+ r = sd_bus_message_read(reply, "b", &pFail);
-+ if (r < 0)
-+ {
-+ log<level::ERR>("Failed to read PFail:", entry("ERRNO=0x%X", -r));
-+ rc = IPMI_CC_UNSPECIFIED_ERROR;
-+ goto finish;
-+ }
-+
- s = dbusToIpmi.at(powerRestore);
-
- // Current Power State
-@@ -952,6 +973,11 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-
- chassis_status.last_power_event = 0;
-
-+ if (pFail)
-+ {
-+ chassis_status.last_power_event |= 1;
-+ }
-+
- // Misc. Chassis State
- // [7] – reserved
- // [6] – 1b = Chassis Identify command and state info supported (Optional)
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch
index 1dc55e2f4..5623d246d 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch
@@ -1,6 +1,6 @@
-From 1c15df9d82254286d0773086836767f23711c5d9 Mon Sep 17 00:00:00 2001
+From 55db62a92dff4bfc3d34c590b33d9da4e7706b9d Mon Sep 17 00:00:00 2001
From: Cheng C Yang <cheng.c.yang@intel.com>
-Date: Tue, 2 Apr 2019 00:34:34 +0800
+Date: Wed, 3 Jul 2019 06:12:55 +0800
Subject: [PATCH] Move Set SOL config parameter to host-ipmid
Move Set SOL config parameter command from net-ipmid to host-ipmid,
@@ -23,16 +23,15 @@ to 0 and other properties will not reset to default value.
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
---
host-ipmid-whitelist.conf | 1 +
- include/ipmid/api.h | 1 +
- transporthandler.cpp | 222 ++++++++++++++++++++++++++++++++++++++
- transporthandler.hpp | 97 +++++++++++++++++
- 4 files changed, 321 insertions(+)
+ transporthandler.cpp | 289 ++++++++++++++++++++++++++++++++++++++++++++++
+ transporthandler.hpp | 33 ++++++
+ 3 files changed, 323 insertions(+)
diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
-index 2a83347..544b766 100644
+index 2b72d23..856588e 100644
--- a/host-ipmid-whitelist.conf
+++ b/host-ipmid-whitelist.conf
-@@ -41,6 +41,7 @@
+@@ -42,6 +42,7 @@
0x0A:0x48 //<Storage>:<Get SEL Time>
0x0A:0x49 //<Storage>:<Set SEL Time>
0x0C:0x02 //<Transport>:<Get LAN Configuration Parameters>
@@ -40,20 +39,8 @@ index 2a83347..544b766 100644
0x2C:0x00 //<Group Extension>:<Group Extension Command>
0x2C:0x01 //<Group Extension>:<Get DCMI Capabilities>
0x2C:0x02 //<Group Extension>:<Get Power Reading>
-diff --git a/include/ipmid/api.h b/include/ipmid/api.h
-index f08ee11..2f366b4 100644
---- a/include/ipmid/api.h
-+++ b/include/ipmid/api.h
-@@ -113,6 +113,7 @@ enum ipmi_return_codes
- IPMI_DCMI_CC_NO_ACTIVE_POWER_LIMIT = 0x80,
- IPMI_WDOG_CC_NOT_INIT = 0x80,
- IPMI_CC_SYSTEM_INFO_PARAMETER_NOT_SUPPORTED = 0x80,
-+ IPMI_CC_SET_IN_PROGRESS_ACTIVE = 0x81,
- IPMI_CC_SYSTEM_INFO_PARAMETER_SET_READ_ONLY = 0x82,
- IPMI_CC_BUSY = 0xC0,
- IPMI_CC_INVALID = 0xC1,
diff --git a/transporthandler.cpp b/transporthandler.cpp
-index 8f18b76..a693279 100644
+index bb624c4..25062ae 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -36,6 +36,9 @@ static const std::array<std::string, 3> ipAddressEnablesType = {
@@ -61,37 +48,57 @@ index 8f18b76..a693279 100644
"xyz.openbmc_project.Network.EthernetInterface.IPAllowed.IPv4AndIPv6"};
+constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL";
-+constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol";
++constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol/";
+
std::map<int, std::unique_ptr<struct ChannelConfig_t>> channelConfig;
using namespace phosphor::logging;
-@@ -1633,6 +1636,219 @@ void createNetworkTimer()
+@@ -1631,6 +1634,285 @@ void createNetworkTimer()
}
}
-+static int setSOLParameter(std::string property, const ipmi::Value& value)
++static std::string
++ getSOLService(std::shared_ptr<sdbusplus::asio::connection> dbus,
++ const std::string& solPathWitheEthName)
+{
-+ auto dbus = getSdBus();
-+
+ static std::string solService{};
+ if (solService.empty())
+ {
+ try
+ {
-+ solService = ipmi::getService(*dbus, solInterface, solPath);
++ solService =
++ ipmi::getService(*dbus, solInterface, solPathWitheEthName);
+ }
+ catch (const sdbusplus::exception::SdBusError& e)
+ {
+ solService.clear();
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Error: get SOL service failed");
-+ return -1;
++ return solService;
+ }
+ }
++ return solService;
++}
++
++static int setSOLParameter(const std::string& property,
++ const ipmi::Value& value, const uint8_t& channelNum)
++{
++ auto dbus = getSdBus();
++
++ std::string ethdevice = ipmi::getChannelName(channelNum);
++
++ std::string solPathWitheEthName = std::string(solPath) + ethdevice;
++
++ std::string service = getSOLService(dbus, solPathWitheEthName);
++ if (service.empty())
++ {
++ phosphor::logging::log<phosphor::logging::level::ERR>(
++ "Unable to get SOL service failed");
++ return -1;
++ }
+ try
+ {
-+ ipmi::setDbusProperty(*dbus, solService, solPath, solInterface,
++ ipmi::setDbusProperty(*dbus, service, solPathWitheEthName, solInterface,
+ property, value);
+ }
+ catch (sdbusplus::exception_t&)
@@ -104,29 +111,26 @@ index 8f18b76..a693279 100644
+ return 0;
+}
+
-+static int getSOLParameter(std::string property, ipmi::Value& value)
++static int getSOLParameter(const std::string& property, ipmi::Value& value,
++ const uint8_t& channelNum)
+{
+ auto dbus = getSdBus();
+
-+ static std::string solService{};
-+ if (solService.empty())
++ std::string ethdevice = ipmi::getChannelName(channelNum);
++
++ std::string solPathWitheEthName = std::string(solPath) + ethdevice;
++
++ std::string service = getSOLService(dbus, solPathWitheEthName);
++ if (service.empty())
+ {
-+ try
-+ {
-+ solService = ipmi::getService(*dbus, solInterface, solPath);
-+ }
-+ catch (const sdbusplus::exception::SdBusError& e)
-+ {
-+ solService.clear();
-+ phosphor::logging::log<phosphor::logging::level::ERR>(
-+ "Error: get SOL service failed");
-+ return -1;
-+ }
++ phosphor::logging::log<phosphor::logging::level::ERR>(
++ "Unable to get SOL service failed");
++ return -1;
+ }
+ try
+ {
-+ value = ipmi::getDbusProperty(*dbus, solService, solPath, solInterface,
-+ property);
++ value = ipmi::getDbusProperty(*dbus, service, solPathWitheEthName,
++ solInterface, property);
+ }
+ catch (sdbusplus::exception_t&)
+ {
@@ -140,158 +144,208 @@ index 8f18b76..a693279 100644
+
+void initializeSOLInProgress()
+{
-+ if (setSOLParameter("Progress", static_cast<uint8_t>(0)) < 0)
++ ipmi::ChannelInfo chInfo;
++ for (int chNum = 0; chNum < ipmi::maxIpmiChannels; chNum++)
+ {
-+ phosphor::logging::log<phosphor::logging::level::ERR>(
-+ "Error initialize sol progress");
++ if (!ipmi::isValidChannel(static_cast<uint8_t>(chNum)))
++ {
++ continue;
++ }
++ ipmi_ret_t compCode =
++ ipmi::getChannelInfo(static_cast<uint8_t>(chNum), chInfo);
++ if (compCode != IPMI_CC_OK ||
++ chInfo.mediumType !=
++ static_cast<uint8_t>(ipmi::EChannelMediumType::lan8032))
++ {
++ continue;
++ }
++ if (setSOLParameter("Progress", static_cast<uint8_t>(0), chNum) < 0)
++ {
++ phosphor::logging::log<phosphor::logging::level::ERR>(
++ "Error initialize sol progress");
++ }
+ }
+}
+
-+ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-+ ipmi_request_t request, ipmi_response_t response,
-+ ipmi_data_len_t dataLen, ipmi_context_t context)
++static const constexpr uint8_t encryptMask = 0x80;
++static const constexpr uint8_t encryptShift = 7;
++static const constexpr uint8_t authMask = 0x40;
++static const constexpr uint8_t authShift = 6;
++static const constexpr uint8_t privilegeMask = 0xf;
++
++namespace ipmi
++{
++constexpr Cc ccParmNotSupported = 0x80;
++constexpr Cc ccSetInProgressActive = 0x81;
++constexpr Cc ccSystemInfoParameterSetReadOnly = 0x82;
++
++static inline auto responseParmNotSupported()
+{
-+ auto reqData = reinterpret_cast<const SetConfParamsRequest*>(request);
++ return response(ccParmNotSupported);
++}
++static inline auto responseSetInProgressActive()
++{
++ return response(ccSetInProgressActive);
++}
++static inline auto responseSystemInfoParameterSetReadOnly()
++{
++ return response(ccSystemInfoParameterSetReadOnly);
++}
+
-+ // Check request length first
-+ switch (static_cast<sol::Parameter>(reqData->paramSelector))
++} // namespace ipmi
++
++ipmi::RspType<> setSOLConfParams(ipmi::Context::ptr ctx, uint4_t chNum,
++ uint4_t reserved, uint8_t paramSelector,
++ uint8_t configParamData1,
++ std::optional<uint8_t> configParamData2)
++{
++ ipmi::ChannelInfo chInfo;
++ uint8_t channelNum = ipmi::convertCurrentChannelNum(
++ static_cast<uint8_t>(chNum), ctx->channel);
++ if (reserved != 0 ||
++ (!ipmi::isValidChannel(static_cast<uint8_t>(channelNum))))
+ {
-+ case sol::Parameter::progress:
-+ case sol::Parameter::enable:
-+ case sol::Parameter::authentication:
-+ {
-+ if (*dataLen != sizeof(SetConfParamsRequest) - 1)
-+ {
-+ *dataLen = 0;
-+ return IPMI_CC_REQ_DATA_LEN_INVALID;
-+ }
-+ break;
-+ }
-+ case sol::Parameter::accumulate:
-+ case sol::Parameter::retry:
-+ {
-+ if (*dataLen != sizeof(SetConfParamsRequest))
-+ {
-+ *dataLen = 0;
-+ return IPMI_CC_REQ_DATA_LEN_INVALID;
-+ }
-+ break;
-+ }
-+ default:
-+ break;
++ return ipmi::responseInvalidFieldRequest();
+ }
+
-+ *dataLen = 0;
++ ipmi_ret_t compCode =
++ ipmi::getChannelInfo(static_cast<uint8_t>(channelNum), chInfo);
++ if (compCode != IPMI_CC_OK ||
++ chInfo.mediumType !=
++ static_cast<uint8_t>(ipmi::EChannelMediumType::lan8032))
++ {
++ return ipmi::responseInvalidFieldRequest();
++ }
+
-+ switch (static_cast<sol::Parameter>(reqData->paramSelector))
++ switch (static_cast<sol::Parameter>(paramSelector))
+ {
+ case sol::Parameter::progress:
+ {
-+ uint8_t progress = reqData->value & progressMask;
++ if (configParamData2)
++ {
++ return ipmi::responseReqDataLenInvalid();
++ }
++ uint8_t progress = configParamData1 & progressMask;
+ ipmi::Value currentProgress = 0;
-+ if (getSOLParameter("Progress", currentProgress) < 0)
++ if (getSOLParameter("Progress", currentProgress, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+
+ if ((std::get<uint8_t>(currentProgress) == 1) && (progress == 1))
+ {
-+ return IPMI_CC_SET_IN_PROGRESS_ACTIVE;
++ return ipmi::responseSetInProgressActive();
+ }
+
-+ if (setSOLParameter("Progress", progress) < 0)
++ if (setSOLParameter("Progress", progress, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+ break;
+ }
+ case sol::Parameter::enable:
+ {
-+ bool enable = reqData->value & enableMask;
-+ if (setSOLParameter("Enable", enable) < 0)
++ if (configParamData2)
++ {
++ return ipmi::responseReqDataLenInvalid();
++ }
++ bool enable = configParamData1 & enableMask;
++ if (setSOLParameter("Enable", enable, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+ break;
+ }
+ case sol::Parameter::authentication:
+ {
-+ // if encryption is used authentication must also be used.
-+ if (reqData->auth.encrypt && !reqData->auth.auth)
++ if (configParamData2)
+ {
-+ return IPMI_CC_SYSTEM_INFO_PARAMETER_SET_READ_ONLY;
++ return ipmi::responseReqDataLenInvalid();
+ }
-+ else if (reqData->auth.privilege <
++ uint8_t encrypt = (configParamData1 & encryptMask) >> encryptShift;
++ uint8_t auth = (configParamData1 & authMask) >> authShift;
++ uint8_t privilege = configParamData1 & privilegeMask;
++ // For security considering encryption and authentication must be
++ // true.
++ if (!encrypt || !auth)
++ {
++ return ipmi::responseSystemInfoParameterSetReadOnly();
++ }
++ else if (privilege <
+ static_cast<uint8_t>(sol::Privilege::userPriv) ||
-+ reqData->auth.privilege >
-+ static_cast<uint8_t>(sol::Privilege::oemPriv))
++ privilege > static_cast<uint8_t>(sol::Privilege::oemPriv))
+ {
-+ return IPMI_CC_INVALID_FIELD_REQUEST;
++ return ipmi::responseInvalidFieldRequest();
+ }
+
-+ if ((setSOLParameter("Privilege", reqData->auth.privilege) < 0) ||
-+ (setSOLParameter("ForceEncryption",
-+ static_cast<bool>(reqData->auth.encrypt)) <
-+ 0) ||
-+ (setSOLParameter("ForceAuthentication",
-+ static_cast<bool>(reqData->auth.auth)) < 0))
++ if (setSOLParameter("Privilege", privilege, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+
+ break;
+ }
+ case sol::Parameter::accumulate:
+ {
-+ if (reqData->acc.threshold == 0)
++ if (!configParamData2)
+ {
-+ return IPMI_CC_INVALID_FIELD_REQUEST;
++ return ipmi::responseReqDataLenInvalid();
+ }
-+ if (setSOLParameter("AccumulateIntervalMS", reqData->acc.interval) <
-+ 0)
++ if (*configParamData2 == 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseInvalidFieldRequest();
+ }
-+ if (setSOLParameter("Threshold", reqData->acc.threshold) < 0)
++ if (setSOLParameter("AccumulateIntervalMS", configParamData1,
++ channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
++ }
++ if (setSOLParameter("Threshold", *configParamData2, channelNum) < 0)
++ {
++ return ipmi::responseUnspecifiedError();
+ }
+ break;
+ }
+ case sol::Parameter::retry:
+ {
-+ if ((setSOLParameter("RetryCount", reqData->retry.count) < 0) ||
-+ (setSOLParameter("RetryIntervalMS", reqData->retry.interval) <
-+ 0))
++ if (!configParamData2)
++ {
++ return ipmi::responseReqDataLenInvalid();
++ }
++ if ((setSOLParameter("RetryCount", (configParamData1 & 0x7),
++ channelNum) < 0) ||
++ (setSOLParameter("RetryIntervalMS", *configParamData2,
++ channelNum) < 0))
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+
+ break;
+ }
+ case sol::Parameter::port:
+ {
-+ return IPMI_CC_SYSTEM_INFO_PARAMETER_SET_READ_ONLY;
++ return ipmi::responseSystemInfoParameterSetReadOnly();
+ }
+ case sol::Parameter::nvbitrate:
+ case sol::Parameter::vbitrate:
+ case sol::Parameter::channel:
+ default:
-+ return IPMI_CC_PARM_NOT_SUPPORTED;
++ return ipmi::responseParmNotSupported();
+ }
+
-+ return IPMI_CC_OK;
++ return ipmi::responseSuccess();
+}
+
void register_netfn_transport_functions()
{
// As this timer is only for transport handler
-@@ -1650,5 +1866,11 @@ void register_netfn_transport_functions()
+@@ -1648,5 +1930,12 @@ void register_netfn_transport_functions()
ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_GET_LAN, NULL,
ipmi_transport_get_lan, PRIVILEGE_OPERATOR);
-+ ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_SOL_CONF_PARAMS, NULL,
-+ setConfParams, PRIVILEGE_ADMIN);
++ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnTransport,
++ ipmi::transport::cmdSetSolConfigParameters,
++ ipmi::Privilege::Admin, setSOLConfParams);
+
+ // Initialize dbus property progress to 0 every time sol manager restart.
+ initializeSOLInProgress();
@@ -299,10 +353,17 @@ index 8f18b76..a693279 100644
return;
}
diff --git a/transporthandler.hpp b/transporthandler.hpp
-index bd23391..3b5e9e1 100644
+index bd23391..1237658 100644
--- a/transporthandler.hpp
+++ b/transporthandler.hpp
-@@ -8,6 +8,8 @@ enum ipmi_netfn_storage_cmds
+@@ -1,5 +1,6 @@
+ #pragma once
+
++#include <ipmid/api-types.hpp>
+ #include <ipmid/types.hpp>
+ #include <string>
+ // IPMI commands for Transport net functions.
+@@ -8,6 +9,8 @@ enum ipmi_netfn_storage_cmds
// Get capability bits
IPMI_CMD_SET_LAN = 0x01,
IPMI_CMD_GET_LAN = 0x02,
@@ -311,7 +372,7 @@ index bd23391..3b5e9e1 100644
};
// Command specific completion codes
-@@ -186,3 +188,98 @@ void commitNetworkChanges();
+@@ -186,3 +189,33 @@ void commitNetworkChanges();
* @param[in] channel: channel number.
*/
void applyChanges(int channel);
@@ -345,71 +406,6 @@ index bd23391..3b5e9e1 100644
+
+constexpr uint8_t progressMask = 0x03;
+constexpr uint8_t enableMask = 0x01;
-+
-+struct Auth
-+{
-+#if BYTE_ORDER == LITTLE_ENDIAN
-+ uint8_t privilege : 4; //!< SOL privilege level.
-+ uint8_t reserved : 2; //!< Reserved.
-+ uint8_t auth : 1; //!< Force SOL payload Authentication.
-+ uint8_t encrypt : 1; //!< Force SOL payload encryption.
-+#endif
-+
-+#if BYTE_ORDER == BIG_ENDIAN
-+ uint8_t encrypt : 1; //!< Force SOL payload encryption.
-+ uint8_t auth : 1; //!< Force SOL payload Authentication.
-+ uint8_t reserved : 2; //!< Reserved.
-+ uint8_t privilege : 4; //!< SOL privilege level.
-+#endif
-+} __attribute__((packed));
-+
-+struct Accumulate
-+{
-+ uint8_t interval; //!< Character accumulate interval.
-+ uint8_t threshold; //!< Character send threshold.
-+} __attribute__((packed));
-+
-+struct Retry
-+{
-+#if BYTE_ORDER == LITTLE_ENDIAN
-+ uint8_t count : 3; //!< SOL retry count.
-+ uint8_t reserved : 5; //!< Reserved.
-+#endif
-+
-+#if BYTE_ORDER == BIG_ENDIAN
-+ uint8_t reserved : 5; //!< Reserved.
-+ uint8_t count : 3; //!< SOL retry count.
-+#endif
-+
-+ uint8_t interval; //!< SOL retry interval.
-+} __attribute__((packed));
-+
-+struct SetConfParamsRequest
-+{
-+#if BYTE_ORDER == LITTLE_ENDIAN
-+ uint8_t channelNumber : 4; //!< Channel number.
-+ uint8_t reserved : 4; //!< Reserved.
-+#endif
-+
-+#if BYTE_ORDER == BIG_ENDIAN
-+ uint8_t reserved : 4; //!< Reserved.
-+ uint8_t channelNumber : 4; //!< Channel number.
-+#endif
-+
-+ uint8_t paramSelector; //!< Parameter selector.
-+ union
-+ {
-+ uint8_t value; //!< Represents one byte SOL parameters.
-+ struct Accumulate acc; //!< Character accumulate values.
-+ struct Retry retry; //!< Retry values.
-+ struct Auth auth; //!< Authentication parameters.
-+ };
-+} __attribute__((packed));
-+
-+struct SetConfParamsResponse
-+{
-+ uint8_t completionCode; //!< Completion code.
-+} __attribute__((packed));
--
-2.17.1
+2.7.4
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch
index 24f355d80..01a3e49b8 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch
@@ -1,12 +1,12 @@
-From 3c95de833eba73b3585941ade42ad1775e723280 Mon Sep 17 00:00:00 2001
+From e8ad148601fc3b45fac9092fdd45c537433e662f Mon Sep 17 00:00:00 2001
From: Cheng C Yang <cheng.c.yang@intel.com>
-Date: Tue, 7 May 2019 08:03:56 +0800
+Date: Thu, 11 Jul 2019 00:32:58 +0800
Subject: [PATCH] Move Get SOL config parameter to host-ipmid
Move Get SOL config parameter command from net-ipmid to host-ipmid.
Tested:
-Run command ipmitool sol info
+Run command ipmitool sol info 1
Set in progress : set-complete
Enabled : true
Force Encryption : false
@@ -18,21 +18,20 @@ Retry Count : 6
Retry Interval (ms) : 200
Volatile Bit Rate (kbps) : IPMI-Over-Serial-Setting
Non-Volatile Bit Rate (kbps) : 115.2
-Payload Channel : 14 (0x0e)
+Payload Channel : 1 (0x01)
Payload Port : 623
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
---
host-ipmid-whitelist.conf | 1 +
- transporthandler.cpp | 198 ++++++++++++++++++++++++++++++++++++++++++++--
- transporthandler.hpp | 27 ++++++-
- 3 files changed, 217 insertions(+), 9 deletions(-)
+ transporthandler.cpp | 191 ++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 192 insertions(+)
diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
-index 2ce44c6..383b412 100644
+index 44c2181..0fcac4e 100644
--- a/host-ipmid-whitelist.conf
+++ b/host-ipmid-whitelist.conf
-@@ -43,6 +43,7 @@
+@@ -41,6 +41,7 @@
0x0A:0x49 //<Storage>:<Set SEL Time>
0x0C:0x02 //<Transport>:<Get LAN Configuration Parameters>
0x0C:0x21 //<Transport>:<Set SOL Configuration Parameters>
@@ -41,22 +40,15 @@ index 2ce44c6..383b412 100644
0x2C:0x01 //<Group Extension>:<Get DCMI Capabilities>
0x2C:0x02 //<Group Extension>:<Get Power Reading>
diff --git a/transporthandler.cpp b/transporthandler.cpp
-index 850172d..0c1223a 100644
+index 25062ae..9ba2868 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
-@@ -38,6 +38,8 @@ static const std::array<std::string, 3> ipAddressEnablesType = {
-
- constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL";
- constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol";
-+constexpr const char* consoleInterface = "xyz.openbmc_project.console";
-+constexpr const char* consolePath = "/xyz/openbmc_project/console";
-
- std::map<int, std::unique_ptr<struct ChannelConfig_t>> channelConfig;
-
-@@ -1668,6 +1670,26 @@ static int setSOLParameter(std::string property, const ipmi::Value& value)
+@@ -1719,6 +1719,28 @@ static int getSOLParameter(const std::string& property, ipmi::Value& value,
return 0;
}
++constexpr const char* consoleInterface = "xyz.openbmc_project.console";
++constexpr const char* consolePath = "/xyz/openbmc_project/console";
+static int getSOLBaudRate(ipmi::Value& value)
+{
+ auto dbus = getSdBus();
@@ -77,134 +69,142 @@ index 850172d..0c1223a 100644
+ return 0;
+}
+
- static int getSOLParameter(std::string property, ipmi::Value& value)
+ void initializeSOLInProgress()
{
- auto dbus = getSdBus();
-@@ -1711,11 +1733,170 @@ void initializeSOLInProgress()
- }
+ ipmi::ChannelInfo chInfo;
+@@ -1913,6 +1935,171 @@ ipmi::RspType<> setSOLConfParams(ipmi::Context::ptr ctx, uint4_t chNum,
+ return ipmi::responseSuccess();
}
--ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-- ipmi_request_t request, ipmi_response_t response,
-- ipmi_data_len_t dataLen, ipmi_context_t context)
+static const constexpr uint8_t retryCountMask = 0x07;
-+// For getsetSOLConfParams, there are still three tings TODO:
-+// 1. session less channel number request has to return error.
-+// 2. convert 0xE channel number.
-+// 3. have unique object for every session based channel.
-+ipmi_ret_t getSOLConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-+ ipmi_request_t request, ipmi_response_t response,
-+ ipmi_data_len_t dataLen, ipmi_context_t context)
++static constexpr uint16_t ipmiStdPort = 623;
++static constexpr uint8_t solParameterRevision = 0x11;
++ipmi::RspType<uint8_t, std::optional<uint8_t>, std::optional<uint8_t>>
++ getSOLConfParams(ipmi::Context::ptr ctx, uint4_t chNum, uint3_t reserved,
++ bool getParamRev, uint8_t paramSelector,
++ uint8_t setSelector, uint8_t blockSelector)
+{
-+ auto reqData = reinterpret_cast<const GetSOLConfParamsRequest*>(request);
-+ std::vector<uint8_t> outPayload;
-+
-+ if (*dataLen < sizeof(GetSOLConfParamsRequest) - 2)
++ ipmi::ChannelInfo chInfo;
++ uint8_t channelNum = ipmi::convertCurrentChannelNum(
++ static_cast<uint8_t>(chNum), ctx->channel);
++ if (reserved != 0 ||
++ (!ipmi::isValidChannel(static_cast<uint8_t>(channelNum))) ||
++ (ipmi::EChannelSessSupported::none ==
++ ipmi::getChannelSessionSupport(static_cast<uint8_t>(channelNum))))
+ {
-+ *dataLen = 0;
-+ return IPMI_CC_REQ_DATA_LEN_INVALID;
++ return ipmi::responseInvalidFieldRequest();
++ }
++ ipmi_ret_t compCode =
++ ipmi::getChannelInfo(static_cast<uint8_t>(channelNum), chInfo);
++ if (compCode != IPMI_CC_OK ||
++ chInfo.mediumType !=
++ static_cast<uint8_t>(ipmi::EChannelMediumType::lan8032))
++ {
++ return ipmi::responseInvalidFieldRequest();
+ }
+
-+ *dataLen = 0;
-+
-+ outPayload.push_back(solParameterRevision);
-+ if (reqData->getParamRev)
++ if (getParamRev)
+ {
-+ std::copy(outPayload.begin(), outPayload.end(),
-+ static_cast<uint8_t*>(response));
-+ *dataLen = outPayload.size();
-+ return IPMI_CC_OK;
++ return ipmi::responseSuccess(solParameterRevision, std::nullopt,
++ std::nullopt);
+ }
+
+ ipmi::Value value;
-+ switch (static_cast<sol::Parameter>(reqData->paramSelector))
++ switch (static_cast<sol::Parameter>(paramSelector))
+ {
+ case sol::Parameter::progress:
+ {
-+ if (getSOLParameter("Progress", value) < 0)
++ if (getSOLParameter("Progress", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
-+ outPayload.push_back(std::get<uint8_t>(value));
-+ break;
++ return ipmi::responseSuccess(
++ solParameterRevision, std::get<uint8_t>(value), std::nullopt);
+ }
+ case sol::Parameter::enable:
+ {
-+ if (getSOLParameter("Enable", value) < 0)
++ if (getSOLParameter("Enable", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
-+ outPayload.push_back(static_cast<uint8_t>(std::get<bool>(value)));
-+ break;
++ return ipmi::responseSuccess(
++ solParameterRevision,
++ static_cast<uint8_t>(std::get<bool>(value)), std::nullopt);
+ }
+ case sol::Parameter::authentication:
+ {
+ uint8_t authentication = 0;
-+ if (getSOLParameter("Privilege", value) < 0)
++ if (getSOLParameter("Privilege", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+ authentication = (std::get<uint8_t>(value) & 0x0f);
+
-+ if (getSOLParameter("ForceAuthentication", value) < 0)
++ if (getSOLParameter("ForceAuthentication", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+ authentication |=
+ (static_cast<uint8_t>(std::get<bool>(value)) << 6);
+
-+ if (getSOLParameter("ForceEncryption", value) < 0)
++ if (getSOLParameter("ForceEncryption", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+ authentication |=
+ (static_cast<uint8_t>(std::get<bool>(value)) << 7);
-+ outPayload.push_back(authentication);
-+ break;
++ return ipmi::responseSuccess(solParameterRevision, authentication,
++ std::nullopt);
+ }
+ case sol::Parameter::accumulate:
+ {
-+ if (getSOLParameter("AccumulateIntervalMS", value) < 0)
++ if (getSOLParameter("AccumulateIntervalMS", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
-+ outPayload.push_back(std::get<uint8_t>(value));
+
-+ if (getSOLParameter("Threshold", value) < 0)
++ ipmi::Value value1;
++ if (getSOLParameter("Threshold", value1, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
-+ outPayload.push_back(std::get<uint8_t>(value));
-+ break;
++ return ipmi::responseSuccess(solParameterRevision,
++ std::get<uint8_t>(value),
++ std::get<uint8_t>(value1));
+ }
+ case sol::Parameter::retry:
+ {
-+ if (getSOLParameter("RetryCount", value) < 0)
++ if (getSOLParameter("RetryCount", value, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
-+ outPayload.push_back(std::get<uint8_t>(value) & retryCountMask);
+
-+ if (getSOLParameter("RetryIntervalMS", value) < 0)
++ ipmi::Value value1;
++ if (getSOLParameter("RetryIntervalMS", value1, channelNum) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
-+ outPayload.push_back(std::get<uint8_t>(value));
-+ break;
++ return ipmi::responseSuccess(
++ solParameterRevision, std::get<uint8_t>(value) & retryCountMask,
++ std::get<uint8_t>(value1));
++ }
++ case sol::Parameter::channel:
++ {
++ return ipmi::responseSuccess(solParameterRevision, channelNum,
++ std::nullopt);
+ }
+ case sol::Parameter::port:
+ {
+ uint16_t port = htole16(ipmiStdPort);
+ auto buffer = reinterpret_cast<const uint8_t*>(&port);
-+ std::copy(buffer, buffer + sizeof(port),
-+ std::back_inserter(outPayload));
-+ break;
++ return ipmi::responseSuccess(solParameterRevision, buffer[0],
++ buffer[1]);
+ }
+ case sol::Parameter::nvbitrate:
+ {
+ if (getSOLBaudRate(value) < 0)
+ {
-+ return IPMI_CC_UNSPECIFIED_ERROR;
++ return ipmi::responseUnspecifiedError();
+ }
+ uint8_t bitRate = 0;
+ uint32_t* pBaudRate = std::get_if<uint32_t>(&value);
@@ -233,110 +233,28 @@ index 850172d..0c1223a 100644
+ default:
+ break;
+ }
-+ outPayload.push_back(bitRate);
-+ break;
++ return ipmi::responseSuccess(solParameterRevision, bitRate,
++ std::nullopt);
+ }
+ default:
-+ return IPMI_CC_PARM_NOT_SUPPORTED;
++ return ipmi::responseParmNotSupported();
+ }
-+ std::copy(outPayload.begin(), outPayload.end(),
-+ static_cast<uint8_t*>(response));
-+ *dataLen = outPayload.size();
-+
-+ return IPMI_CC_OK;
+}
+
-+ipmi_ret_t setSOLConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-+ ipmi_request_t request, ipmi_response_t response,
-+ ipmi_data_len_t dataLen, ipmi_context_t context)
+ void register_netfn_transport_functions()
{
-- auto reqData = reinterpret_cast<const SetConfParamsRequest*>(request);
-+ auto reqData = reinterpret_cast<const SetSOLConfParamsRequest*>(request);
-
- // Check request length first
- switch (static_cast<sol::Parameter>(reqData->paramSelector))
-@@ -1724,7 +1905,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- case sol::Parameter::enable:
- case sol::Parameter::authentication:
- {
-- if (*dataLen != sizeof(SetConfParamsRequest) - 1)
-+ if (*dataLen != sizeof(SetSOLConfParamsRequest) - 1)
- {
- *dataLen = 0;
- return IPMI_CC_REQ_DATA_LEN_INVALID;
-@@ -1734,7 +1915,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- case sol::Parameter::accumulate:
- case sol::Parameter::retry:
- {
-- if (*dataLen != sizeof(SetConfParamsRequest))
-+ if (*dataLen != sizeof(SetSOLConfParamsRequest))
- {
- *dataLen = 0;
- return IPMI_CC_REQ_DATA_LEN_INVALID;
-@@ -1865,7 +2046,10 @@ void register_netfn_transport_functions()
- ipmi_transport_get_lan, PRIVILEGE_OPERATOR);
+ // As this timer is only for transport handler
+@@ -1934,6 +2121,10 @@ void register_netfn_transport_functions()
+ ipmi::transport::cmdSetSolConfigParameters,
+ ipmi::Privilege::Admin, setSOLConfParams);
- ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_SOL_CONF_PARAMS, NULL,
-- setConfParams, PRIVILEGE_ADMIN);
-+ setSOLConfParams, PRIVILEGE_ADMIN);
++ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnTransport,
++ ipmi::transport::cmdGetSolConfigParameters,
++ ipmi::Privilege::User, getSOLConfParams);
+
-+ ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_GET_SOL_CONF_PARAMS, NULL,
-+ getSOLConfParams, PRIVILEGE_ADMIN);
-
// Initialize dbus property progress to 0 every time sol manager restart.
initializeSOLInProgress();
-diff --git a/transporthandler.hpp b/transporthandler.hpp
-index 3b5e9e1..a21862b 100644
---- a/transporthandler.hpp
-+++ b/transporthandler.hpp
-@@ -1,6 +1,7 @@
- #pragma once
-
- #include <ipmid/types.hpp>
-+#include <map>
- #include <string>
- // IPMI commands for Transport net functions.
- enum ipmi_netfn_storage_cmds
-@@ -257,7 +258,7 @@ struct Retry
- uint8_t interval; //!< SOL retry interval.
- } __attribute__((packed));
--struct SetConfParamsRequest
-+struct SetSOLConfParamsRequest
- {
- #if BYTE_ORDER == LITTLE_ENDIAN
- uint8_t channelNumber : 4; //!< Channel number.
-@@ -279,7 +280,29 @@ struct SetConfParamsRequest
- };
- } __attribute__((packed));
-
--struct SetConfParamsResponse
-+struct SetSOLConfParamsResponse
- {
- uint8_t completionCode; //!< Completion code.
- } __attribute__((packed));
-+
-+struct GetSOLConfParamsRequest
-+{
-+#if BYTE_ORDER == LITTLE_ENDIAN
-+ uint8_t channelNum : 4; //!< Channel number.
-+ uint8_t reserved : 3; //!< Reserved.
-+ uint8_t getParamRev : 1; //!< Get parameter or Get parameter revision
-+#endif
-+
-+#if BYTE_ORDER == BIG_ENDIAN
-+ uint8_t getParamRev : 1; //!< Get parameter or Get parameter revision
-+ uint8_t reserved : 3; //!< Reserved.
-+ uint8_t channelNum : 4; //!< Channel number.
-+#endif
-+
-+ uint8_t paramSelector; //!< Parameter selector.
-+ uint8_t setSelector; //!< Set selector.
-+ uint8_t blockSelector; //!< Block selector.
-+} __attribute__((packed));
-+
-+static constexpr uint16_t ipmiStdPort = 623;
-+static constexpr uint8_t solParameterRevision = 0x11;
--
2.7.4
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch
deleted file mode 100644
index 877c5336a..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From 514b76d1c05d7ed7fb7e1df27833e423e04c9a1c Mon Sep 17 00:00:00 2001
-From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
-Date: Tue, 21 May 2019 09:57:16 -0700
-Subject: [PATCH] Use xyz.openbmc_project.State.Chassis for IPMI chassis status
-
-Instead of directly using pgood on dbus, this change uses the
-xyz.openbmc_project.State.Chassis "CurrentPowerState" property
-for the IPMI chassis status command. This will allow us to
-remove pgood from dbus.
-
-Tested:
-Ran IPMI chassis commands and confirmed that they behave as
-expected:
-ipmitool power status
-Chassis Power is on
-
-ipmitool power off
-Chassis Power Control: Down/Off
-
-ipmitool power status
-Chassis Power is off
-
-ipmitool power on
-Chassis Power Control: Up/On
-
-ipmitool power status
-Chassis Power is on
-
-Change-Id: I7836c16b76c3b309f176186f3e2453082e4cd1af
-Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
----
- chassishandler.cpp | 61 ++++++++++++++++++++++++++++++++++++------------------
- 1 file changed, 41 insertions(+), 20 deletions(-)
-
-diff --git a/chassishandler.cpp b/chassishandler.cpp
-index 1738ccc..e4e842d 100644
---- a/chassishandler.cpp
-+++ b/chassishandler.cpp
-@@ -824,44 +824,65 @@ std::optional<uint2_t> getPowerRestorePolicy()
- */
- std::optional<bool> getPowerStatus()
- {
-- constexpr const char* powerControlObj =
-- "/xyz/openbmc_project/Chassis/Control/Power0";
-- constexpr const char* powerControlIntf =
-- "xyz.openbmc_project.Chassis.Control.Power";
- bool powerGood = false;
- std::shared_ptr<sdbusplus::asio::connection> busp = getSdBus();
- try
- {
-+ constexpr const char* chassisStatePath =
-+ "/xyz/openbmc_project/state/chassis0";
-+ constexpr const char* chassisStateIntf =
-+ "xyz.openbmc_project.State.Chassis";
- auto service =
-- ipmi::getService(*busp, powerControlIntf, powerControlObj);
-+ ipmi::getService(*busp, chassisStateIntf, chassisStatePath);
-
-- ipmi::Value variant = ipmi::getDbusProperty(
-- *busp, service, powerControlObj, powerControlIntf, "pgood");
-- powerGood = static_cast<bool>(std::get<int>(variant));
-+ ipmi::Value variant =
-+ ipmi::getDbusProperty(*busp, service, chassisStatePath,
-+ chassisStateIntf, "CurrentPowerState");
-+ std::string powerState = std::get<std::string>(variant);
-+ if (powerState == "xyz.openbmc_project.State.Chassis.PowerState.On")
-+ {
-+ powerGood = true;
-+ }
- }
- catch (const std::exception& e)
- {
- try
- {
-- // FIXME: some legacy modules use the older path; try that next
-- constexpr const char* legacyPwrCtrlObj =
-- "/org/openbmc/control/power0";
-- constexpr const char* legacyPwrCtrlIntf =
-- "org.openbmc.control.Power";
-+ // FIXME: some modules use pgood; try that next
-+ constexpr const char* powerControlObj =
-+ "/xyz/openbmc_project/Chassis/Control/Power0";
-+ constexpr const char* powerControlIntf =
-+ "xyz.openbmc_project.Chassis.Control.Power";
- auto service =
-- ipmi::getService(*busp, legacyPwrCtrlIntf, legacyPwrCtrlObj);
-+ ipmi::getService(*busp, powerControlIntf, powerControlObj);
-
- ipmi::Value variant = ipmi::getDbusProperty(
-- *busp, service, legacyPwrCtrlObj, legacyPwrCtrlIntf, "pgood");
-+ *busp, service, powerControlObj, powerControlIntf, "pgood");
- powerGood = static_cast<bool>(std::get<int>(variant));
- }
- catch (const std::exception& e)
- {
-- log<level::ERR>("Failed to fetch pgood property",
-- entry("ERROR=%s", e.what()),
-- entry("PATH=%s", powerControlObj),
-- entry("INTERFACE=%s", powerControlIntf));
-- return std::nullopt;
-+ try
-+ {
-+ // FIXME: some legacy modules use the older path; try that next
-+ constexpr const char* legacyPwrCtrlObj =
-+ "/org/openbmc/control/power0";
-+ constexpr const char* legacyPwrCtrlIntf =
-+ "org.openbmc.control.Power";
-+ auto service = ipmi::getService(*busp, legacyPwrCtrlIntf,
-+ legacyPwrCtrlObj);
-+
-+ ipmi::Value variant =
-+ ipmi::getDbusProperty(*busp, service, legacyPwrCtrlObj,
-+ legacyPwrCtrlIntf, "pgood");
-+ powerGood = static_cast<bool>(std::get<int>(variant));
-+ }
-+ catch (const std::exception& e)
-+ {
-+ log<level::ERR>("Failed to fetch pgood property",
-+ entry("ERROR=%s", e.what()));
-+ return std::nullopt;
-+ }
- }
- }
- return std::make_optional(powerGood);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch
index 498233881..f29111758 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch
@@ -1,4 +1,4 @@
-From f11928c6b39052c679c9300e9d836837ef60be06 Mon Sep 17 00:00:00 2001
+From 00fb92edcb4229eeb5b46c4eb206ba7d70e241fc Mon Sep 17 00:00:00 2001
From: "Jason M. Bills" <jason.m.bills@linux.intel.com>
Date: Mon, 3 Jun 2019 17:01:47 -0700
Subject: [PATCH] Update IPMI Chassis Control command
@@ -19,11 +19,11 @@ ipmitool power soft: soft power-off requested from system software
Change-Id: Ic9fba3ca4abd9a758eb88f1e6ee09f7ca64ff80a
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
---
- chassishandler.cpp | 138 +++++++++++++++++++++--------------------------------
- 1 file changed, 54 insertions(+), 84 deletions(-)
+ chassishandler.cpp | 206 ++++++++++++++---------------------------------------
+ 1 file changed, 52 insertions(+), 154 deletions(-)
diff --git a/chassishandler.cpp b/chassishandler.cpp
-index e4e842d..d71b95f 100644
+index 88bf84b..ad564e2 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -31,6 +31,7 @@
@@ -134,7 +134,84 @@ index e4e842d..d71b95f 100644
}
namespace power_policy
-@@ -1138,61 +1143,26 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl)
+@@ -1033,76 +1038,6 @@ ipmi::RspType<bool, // Power is on
+ diagButtonDisableAllow, sleepButtonDisableAllow);
+ }
+
+-//-------------------------------------------------------------
+-// Send a command to SoftPowerOff application to stop any timer
+-//-------------------------------------------------------------
+-int stop_soft_off_timer()
+-{
+- constexpr auto iface = "org.freedesktop.DBus.Properties";
+- constexpr auto soft_off_iface = "xyz.openbmc_project.Ipmi.Internal."
+- "SoftPowerOff";
+-
+- constexpr auto property = "ResponseReceived";
+- constexpr auto value = "xyz.openbmc_project.Ipmi.Internal."
+- "SoftPowerOff.HostResponse.HostShutdown";
+-
+- // Get the system bus where most system services are provided.
+- auto bus = ipmid_get_sd_bus_connection();
+-
+- // Get the service name
+- // TODO openbmc/openbmc#1661 - Mapper refactor
+- //
+- // See openbmc/openbmc#1743 for some details but high level summary is that
+- // for now the code will directly call the soft off interface due to a
+- // race condition with mapper usage
+- //
+- // char *busname = nullptr;
+- // auto r = mapper_get_service(bus, SOFTOFF_OBJPATH, &busname);
+- // if (r < 0)
+- //{
+- // fprintf(stderr, "Failed to get %s bus name: %s\n",
+- // SOFTOFF_OBJPATH, -r);
+- // return r;
+- //}
+-
+- // No error object or reply expected.
+- int rc = sd_bus_call_method(bus, SOFTOFF_BUSNAME, SOFTOFF_OBJPATH, iface,
+- "Set", nullptr, nullptr, "ssv", soft_off_iface,
+- property, "s", value);
+- if (rc < 0)
+- {
+- log<level::ERR>("Failed to set property in SoftPowerOff object",
+- entry("ERRNO=0x%X", -rc));
+- }
+-
+- // TODO openbmc/openbmc#1661 - Mapper refactor
+- // free(busname);
+- return rc;
+-}
+-
+-//----------------------------------------------------------------------
+-// Create file to indicate there is no need for softoff notification to host
+-//----------------------------------------------------------------------
+-void indicate_no_softoff_needed()
+-{
+- fs::path path{HOST_INBAND_REQUEST_DIR};
+- if (!fs::is_directory(path))
+- {
+- fs::create_directory(path);
+- }
+-
+- // Add the host instance (default 0 for now) to the file name
+- std::string file{HOST_INBAND_REQUEST_FILE};
+- auto size = std::snprintf(nullptr, 0, file.c_str(), 0);
+- size++; // null
+- std::unique_ptr<char[]> buf(new char[size]);
+- std::snprintf(buf.get(), size, file.c_str(), 0);
+-
+- // Append file name to directory and create it
+- path /= buf.get();
+- std::ofstream(path.c_str());
+-}
+-
+ /** @brief Implementation of chassis control command
+ *
+ * @param - chassisControl command byte
+@@ -1115,61 +1050,24 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl)
switch (chassisControl)
{
case CMD_POWER_ON:
@@ -204,8 +281,6 @@ index e4e842d..d71b95f 100644
+ rc = initiateHostStateTransition(State::Host::Transition::Off);
+ break;
+ case CMD_PULSE_DIAGNOSTIC_INTR:
-+ rc =
-+ initiateHostStateTransition(State::Host::Transition::Interrupt);
break;
default:
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch
new file mode 100644
index 000000000..6a7b056ab
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch
@@ -0,0 +1,29 @@
+diff --git a/app/watchdog.cpp b/app/watchdog.cpp
+index 2938d23..bc5df29 100644
+--- a/app/watchdog.cpp
++++ b/app/watchdog.cpp
+@@ -445,23 +445,21 @@ ipmi_ret_t ipmi_app_watchdog_get(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+ wdTimerUseToIpmiTimerUse(wd_prop.expiredTimerUse));
+ }
+
++ res.expire_flags = timerUseExpirationFlags;
+ if (wd_prop.enabled)
+ {
+ res.timer_use |= wd_running;
+ res.present_countdown = htole16(wd_prop.timeRemaining / 100);
+- res.expire_flags = 0;
+ }
+ else
+ {
+ if (wd_prop.expiredTimerUse == WatchdogService::TimerUse::Reserved)
+ {
+ res.present_countdown = res.initial_countdown;
+- res.expire_flags = 0;
+ }
+ else
+ {
+ res.present_countdown = 0;
+- res.expire_flags = timerUseExpirationFlags;
+ }
+ }
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch
new file mode 100644
index 000000000..57a31c991
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch
@@ -0,0 +1,286 @@
+From 3279300bb9afd1f169b35b7830d7f054045ab35f Mon Sep 17 00:00:00 2001
+From: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
+Date: Tue, 18 Jun 2019 19:42:30 +0530
+Subject: [PATCH] Update provisioning mode filter logic
+
+Updated provisioning mode filtering logic support. Based on the
+RestrictionMode property, Host (system) interface commands will be
+filtered as per the allowed list in ProvisionedHostWhitelist once
+POST complete is achieved. No commands will be allowed in
+ProvisionedHostDisabled after POST complete and in all other cases
+filterning logic will not be applied.
+
+Tested
+1. Verified the filtering logic through EFI shell and made sure
+filtering logic is applied when RestrictionMode is in
+ProvisionedHostWhitelist mode
+2. Verified no filtering logic is applied in normal modes
+3. Made sure BIOS is able to execute commands, which are not in
+whitelist (Note: New whitelist conf is under review).
+
+Change-Id: I7a14e827d70e2d8d6975e600a0fd00e2a790bc22
+Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
+---
+ whitelist-filter.cpp | 155 ++++++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 122 insertions(+), 33 deletions(-)
+
+diff --git a/whitelist-filter.cpp b/whitelist-filter.cpp
+index 9f1e7c8..2c56087 100644
+--- a/whitelist-filter.cpp
++++ b/whitelist-filter.cpp
+@@ -25,6 +25,7 @@ namespace
+ */
+ class WhitelistFilter
+ {
++
+ public:
+ WhitelistFilter();
+ ~WhitelistFilter() = default;
+@@ -35,17 +36,26 @@ class WhitelistFilter
+
+ private:
+ void postInit();
+- void cacheRestrictedMode();
++ void cacheRestrictedAndPostCompleteMode();
+ void handleRestrictedModeChange(sdbusplus::message::message& m);
++ void handlePostCompleteChange(sdbusplus::message::message& m);
+ ipmi::Cc filterMessage(ipmi::message::Request::ptr request);
+
+- bool restrictedMode = true;
++ sdbusplus::xyz::openbmc_project::Control::Security::server::
++ RestrictionMode::Modes restrictionMode =
++ sdbusplus::xyz::openbmc_project::Control::Security::server::
++ RestrictionMode::Modes::ProvisionedHostWhitelist;
++ bool postCompleted = false;
+ std::shared_ptr<sdbusplus::asio::connection> bus;
+ std::unique_ptr<settings::Objects> objects;
++ std::unique_ptr<settings::Objects> postCompleteObj;
+ std::unique_ptr<sdbusplus::bus::match::match> modeChangeMatch;
++ std::unique_ptr<sdbusplus::bus::match::match> postCompleteMatch;
+
+ static constexpr const char restrictionModeIntf[] =
+ "xyz.openbmc_project.Control.Security.RestrictionMode";
++ static constexpr const char* systemOsStatusIntf =
++ "xyz.openbmc_project.State.OperatingSystem.Status";
+ };
+
+ WhitelistFilter::WhitelistFilter()
+@@ -63,16 +73,22 @@ WhitelistFilter::WhitelistFilter()
+ post_work([this]() { postInit(); });
+ }
+
+-void WhitelistFilter::cacheRestrictedMode()
++void WhitelistFilter::cacheRestrictedAndPostCompleteMode()
+ {
+ using namespace sdbusplus::xyz::openbmc_project::Control::Security::server;
+ std::string restrictionModeSetting;
+ std::string restrictionModeService;
++ std::string systemOsStatusPath;
++ std::string systemOsStatusService;
+ try
+ {
+ restrictionModeSetting = objects->map.at(restrictionModeIntf).at(0);
+ restrictionModeService =
+ objects->service(restrictionModeSetting, restrictionModeIntf);
++
++ systemOsStatusPath = postCompleteObj->map.at(systemOsStatusIntf).at(0);
++ systemOsStatusService =
++ postCompleteObj->service(systemOsStatusPath, systemOsStatusIntf);
+ }
+ catch (const std::out_of_range& e)
+ {
+@@ -80,26 +96,50 @@ void WhitelistFilter::cacheRestrictedMode()
+ "Could not look up restriction mode interface from cache");
+ return;
+ }
++
+ bus->async_method_call(
+ [this](boost::system::error_code ec, ipmi::Value v) {
+ if (ec)
+ {
+ log<level::ERR>("Error in RestrictionMode Get");
+ // Fail-safe to true.
+- restrictedMode = true;
++ restrictionMode =
++ RestrictionMode::Modes::ProvisionedHostWhitelist;
+ return;
+ }
+ auto mode = std::get<std::string>(v);
+- auto restrictionMode =
+- RestrictionMode::convertModesFromString(mode);
+- restrictedMode =
+- (restrictionMode == RestrictionMode::Modes::Whitelist);
+- log<level::INFO>((restrictedMode ? "Set restrictedMode = true"
+- : "Set restrictedMode = false"));
++ restrictionMode = RestrictionMode::convertModesFromString(mode);
++ log<level::INFO>(
++ "Read restriction mode",
++ entry("VALUE=%d", static_cast<int>(restrictionMode)));
+ },
+ restrictionModeService, restrictionModeSetting,
+ "org.freedesktop.DBus.Properties", "Get", restrictionModeIntf,
+ "RestrictionMode");
++
++ bus->async_method_call(
++ [this](boost::system::error_code ec, const ipmi::Value& v) {
++ if (ec)
++ {
++ log<level::ERR>("Error in OperatingSystemState Get");
++ postCompleted = true;
++ return;
++ }
++ auto value = std::get<std::string>(v);
++ if (value == "Standby")
++ {
++ postCompleted = true;
++ }
++ else
++ {
++ postCompleted = false;
++ }
++ log<level::INFO>("Read POST complete value",
++ entry("VALUE=%d", postCompleted));
++ },
++ systemOsStatusService, systemOsStatusPath,
++ "org.freedesktop.DBus.Properties", "Get", systemOsStatusIntf,
++ "OperatingSystemState");
+ }
+
+ void WhitelistFilter::handleRestrictedModeChange(sdbusplus::message::message& m)
+@@ -112,23 +152,44 @@ void WhitelistFilter::handleRestrictedModeChange(sdbusplus::message::message& m)
+ {
+ if (property.first == "RestrictionMode")
+ {
+- RestrictionMode::Modes restrictionMode =
+- RestrictionMode::convertModesFromString(
+- std::get<std::string>(property.second));
+- restrictedMode =
+- (restrictionMode == RestrictionMode::Modes::Whitelist);
+- log<level::INFO>((restrictedMode
+- ? "Updated restrictedMode = true"
+- : "Updated restrictedMode = false"));
++ restrictionMode = RestrictionMode::convertModesFromString(
++ std::get<std::string>(property.second));
++ log<level::INFO>(
++ "Updated restriction mode",
++ entry("VALUE=%d", static_cast<int>(restrictionMode)));
++ }
++ }
++}
++void WhitelistFilter::handlePostCompleteChange(sdbusplus::message::message& m)
++{
++ std::string intf;
++ std::vector<std::pair<std::string, ipmi::Value>> propertyList;
++ m.read(intf, propertyList);
++ for (const auto& property : propertyList)
++ {
++ if (property.first == "OperatingSystemState")
++ {
++ std::string value = std::get<std::string>(property.second);
++ if (value == "Standby")
++ {
++ postCompleted = true;
++ }
++ else
++ {
++ postCompleted = false;
++ }
++ log<level::INFO>(postCompleted ? "Updated to POST Complete"
++ : "Updated to !POST Complete");
+ }
+ }
+ }
+-
+ void WhitelistFilter::postInit()
+ {
+ objects = std::make_unique<settings::Objects>(
+ *bus, std::vector<settings::Interface>({restrictionModeIntf}));
+- if (!objects)
++ postCompleteObj = std::make_unique<settings::Objects>(
++ *bus, std::vector<settings::Interface>({systemOsStatusIntf}));
++ if (!objects || !postCompleteObj)
+ {
+ log<level::ERR>(
+ "Failed to create settings object; defaulting to restricted mode");
+@@ -136,37 +197,65 @@ void WhitelistFilter::postInit()
+ }
+
+ // Initialize restricted mode
+- cacheRestrictedMode();
++ cacheRestrictedAndPostCompleteMode();
+ // Wait for changes on Restricted mode
+- std::string filterStr;
++ std::string filterStrModeChange;
++ std::string filterStrPostComplete;
+ try
+ {
+- filterStr = sdbusplus::bus::match::rules::propertiesChanged(
++ filterStrModeChange = sdbusplus::bus::match::rules::propertiesChanged(
+ objects->map.at(restrictionModeIntf).at(0), restrictionModeIntf);
++ filterStrPostComplete = sdbusplus::bus::match::rules::propertiesChanged(
++ postCompleteObj->map.at(systemOsStatusIntf).at(0),
++ systemOsStatusIntf);
+ }
+ catch (const std::out_of_range& e)
+ {
+- log<level::ERR>("Failed to determine restriction mode filter string");
++ log<level::ERR>("Failed to determine restriction mode / POST complete "
++ "filter string");
+ return;
+ }
+ modeChangeMatch = std::make_unique<sdbusplus::bus::match::match>(
+- *bus, filterStr, [this](sdbusplus::message::message& m) {
++ *bus, filterStrModeChange, [this](sdbusplus::message::message& m) {
+ handleRestrictedModeChange(m);
+ });
++ postCompleteMatch = std::make_unique<sdbusplus::bus::match::match>(
++ *bus, filterStrPostComplete, [this](sdbusplus::message::message& m) {
++ handlePostCompleteChange(m);
++ });
+ }
+
+ ipmi::Cc WhitelistFilter::filterMessage(ipmi::message::Request::ptr request)
+ {
+- if (request->ctx->channel == ipmi::channelSystemIface && restrictedMode)
++ using namespace sdbusplus::xyz::openbmc_project::Control::Security::server;
++
++ if (request->ctx->channel == ipmi::channelSystemIface &&
++ (restrictionMode != RestrictionMode::Modes::None &&
++ restrictionMode != RestrictionMode::Modes::Provisioning))
+ {
+- if (!std::binary_search(
+- whitelist.cbegin(), whitelist.cend(),
+- std::make_pair(request->ctx->netFn, request->ctx->cmd)))
++ if (!postCompleted)
+ {
+- log<level::ERR>("Net function not whitelisted",
+- entry("NETFN=0x%X", int(request->ctx->netFn)),
+- entry("CMD=0x%X", int(request->ctx->cmd)));
+- return ipmi::ccInsufficientPrivilege;
++ // Allow all commands, till POST is not completed
++ return ipmi::ccSuccess;
++ }
++ switch (restrictionMode)
++ {
++ case RestrictionMode::Modes::ProvisionedHostWhitelist:
++ {
++ if (!std::binary_search(
++ whitelist.cbegin(), whitelist.cend(),
++ std::make_pair(request->ctx->netFn, request->ctx->cmd)))
++ {
++ log<level::ERR>(
++ "Net function not whitelisted",
++ entry("NETFN=0x%X", int(request->ctx->netFn)),
++ entry("CMD=0x%X", int(request->ctx->cmd)));
++ return ipmi::ccInsufficientPrivilege;
++ }
++ break;
++ }
++ default: // for whitelist, blacklist & HostDisabled
++ return ipmi::ccInsufficientPrivilege;
+ }
+ }
+ return ipmi::ccSuccess;
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf
new file mode 100644
index 000000000..deed53b0b
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf
@@ -0,0 +1,50 @@
+#<NetFn>:<Command
+0x00:0x00 //<Chassis>:<Chassis Capabiliti>
+0x00:0x01 //<Chassis>:<Get Chassis Status>
+0x00:0x07 //<Chassis>:<Get System Restart Cause>
+0x00:0x09 //<Chassis>:<Get System Boot Options>
+0x00:0x0F //<Chassis>:<Get POH Counter Command>
+0x04:0x02 //<Sensor/Event>:<Platform event>
+0x04:0x2D //<Sensor/Event>:<Get Sensor Reading>
+0x04:0x2F //<Sensor/Event>:<Get Sensor Type>
+0x06:0x01 //<App>:<Get Device ID>
+0x06:0x04 //<App>:<Get Self Test Results>
+0x06:0x07 //<App>:<Get ACPI Power State>
+0x06:0x08 //<App>:<Get Device GUID>
+0x06:0x22 //<App>:<Reset Watchdog Timer>
+0x06:0x24 //<App>:<Set Watchdog Timer>
+0x06:0x25 //<App>:<Get Watchdog Timer>
+0x06:0x2F //<App>:<Get BMC Global Enables>
+0x06:0x31 //<App>:<Get Message Flags>
+0x06:0x35 //<App>:<Read Event Message Buffer>
+0x06:0x36 //<App>:<Get BT Interface Capabilities>
+0x06:0x37 //<App>:<Get System GUID>
+0x06:0x42 //<App>:<Get Channel Info Command>
+0x06:0x4E //<App>:<Get Channel Payload Support>
+0x06:0x54 //<App>:<Get Channel Cipher Suites>
+0x0A:0x10 //<Storage>:<Get FRU Inventory Area Info>
+0x0A:0x11 //<Storage>:<Read FRU Data>
+0x0A:0x20 //<Storage>:<Get SDR Repository Info>
+0x0A:0x22 //<Storage>:<Reserve SDR Repository>
+0x0A:0x23 //<Storage>:<Get SDR>
+0x0A:0x40 //<Storage>:<Get SEL Info>
+0x0A:0x42 //<Storage>:<Reserve SEL>
+0x0A:0x44 //<Storage>:<Add SEL Entry>
+0x0A:0x48 //<Storage>:<Get SEL Time>
+0x0A:0x49 //<Storage>:<Set SEL Time>
+0x0C:0x02 //<Transport>:<Get LAN Configuration Parameters>
+0x0C:0x22 //<Transport>:<Get SOL Configuration Parameters>
+0x2C:0x00 //<Group Extension>:<Group Extension Command>
+0x2C:0x01 //<Group Extension>:<Get DCMI Capabilities>
+0x2C:0x02 //<Group Extension>:<Get Power Reading>
+0x2C:0x03 //<Group Extension>:<Get Power Limit>
+0x2C:0x06 //<Group Extension>:<Get Asset Tag>
+0x2C:0x07 //<Group Extension>:<Get Sensor Info>
+0x2C:0x10 //<Group Extension>:<Get Temperature Readings>
+0x30:0x27 //<OEM>:<Get Device Info>
+0x30:0x31 //<OEM>:<Get AIC card FRU>
+0x30:0x55 //<OEM>:<Get Power Restore Delay>
+0x30:0x9A //<OEM>:<Get Processor Error Config>
+0x30:0xB0 //<OEM>:<Get LED Status>
+0x30:0xE9 //<OEM>:<Get BIOS Post Codes>
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service
index d855eaa5b..b09bbf890 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service
@@ -7,8 +7,10 @@ Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service
After=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service
Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service
After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service
-Wants=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service
-After=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service
+Wants=mapper-wait@-xyz-openbmc_project-control-security-restriction_mode.service
+After=mapper-wait@-xyz-openbmc_project-control-security-restriction_mode.service
+Wants=mapper-wait@-xyz-openbmc_project-state-os.service
+After=mapper-wait@-xyz-openbmc_project-state-os.service
Wants=clear-once.service
After=clear-once.service
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
index a6a142ec8..d8f9203c9 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
@@ -3,25 +3,24 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
# TODO: This should be removed, once up-stream bump up
# issue is resolved
#SRC_URI = "git://github.com/openbmc/phosphor-host-ipmid"
-SRCREV = "0b979b61c12ffe6ab8a27acf8ad2a0165d687195"
+SRCREV = "894d022017215acceafc9e3f21379534f5396d21"
SRC_URI += "file://phosphor-ipmi-host.service \
+ file://host-ipmid-whitelist.conf \
file://0009-IPv6-Network-changes.patch \
file://0010-fix-get-system-GUID-ipmi-command.patch \
file://0013-ipmi-add-set-bios-id-to-whitelist.patch \
- file://0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch \
file://0039-ipmi-add-oem-command-get-AIC-FRU-to-whitelist.patch \
- file://0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch \
file://0050-enable-6-oem-commands.patch \
file://0053-Fix-keep-looping-issue-when-entering-OS.patch \
- file://0055-Implement-set-front-panel-button-enables-command.patch \
file://0056-add-SetInProgress-to-get-set-boot-option-cmd.patch \
file://0057-Add-timer-use-actions-support.patch \
file://0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch \
file://0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch \
- file://0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch \
file://0062-Update-IPMI-Chassis-Control-command.patch \
file://0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch \
+ file://0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch \
+ file://0064-Update-provisioning-mode-filter-logic.patch \
"
# remove the softpoweroff service since we do not need it
@@ -35,6 +34,9 @@ FILES_${PN}_remove = " \
${systemd_unitdir}/system/obmc-host-shutdown@0.target.requires/ \
${systemd_unitdir}/system/obmc-host-shutdown@0.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \
"
+do_configure_append(){
+ cp -f ${WORKDIR}/host-ipmid-whitelist.conf ${S}
+}
do_install_append(){
rm -f ${D}/${bindir}/phosphor-softpoweroff
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
index 13d908ad1..f33be5760 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
@@ -1,2 +1,2 @@
SRC_URI = "git://github.com/openbmc/ipmbbridge.git"
-SRCREV = "8188d7651c23502f88f9bf850ab7e549f6463997"
+SRCREV = "bbfd00abdbc6d2f7c0389eae91cc055a1d4fe0c3"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch
deleted file mode 100644
index bbbe6ae4f..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch
+++ /dev/null
@@ -1,418 +0,0 @@
-From b05fb3231810865ef1b6e627bb0452ae7a6c61f8 Mon Sep 17 00:00:00 2001
-From: ssekar <suryakanth.sekar@linux.intel.com>
-Date: Wed, 12 Dec 2018 16:04:15 +0530
-Subject: [PATCH 1/2] Adding support for GetSessionInfo command
-
-Description: user can get all session info (remote ip,port,
-session id, priv, etc) using this command.
-
-Verification :we can get all active and non active session
-info by session handle session id.
-Updated the Remote IP addr and Port update for sessioninfo.
-Unit testing are done.
-
-Change-Id: I662ef2b9f0c1d6bda331eb6481d7b9f34534541b
-Signed-off-by: ssekar <suryakanth.sekar@linux.intel.com>
----
- comm_module.cpp | 8 +++
- command/session_cmds.cpp | 147 +++++++++++++++++++++++++++++++++++++++
- command/session_cmds.hpp | 55 +++++++++++++++
- message_handler.cpp | 1 +
- sessions_manager.cpp | 55 +++++++++++++++
- sessions_manager.hpp | 7 ++
- socket_channel.hpp | 17 +++++
- 7 files changed, 290 insertions(+)
-
-diff --git a/comm_module.cpp b/comm_module.cpp
-index acc9089..7a1a17d 100644
---- a/comm_module.cpp
-+++ b/comm_module.cpp
-@@ -53,6 +53,14 @@ void sessionSetupCommands()
- &closeSession,
- session::Privilege::CALLBACK,
- false},
-+ // Session Info Command
-+ {
-+ {
-+ (static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
-+ static_cast<uint16_t>(command::NetFns::APP) | 0x3D
-+ },
-+ &getSessionInfo, session::Privilege::USER, false
-+ },
- };
-
- for (auto& iter : commands)
-diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp
-index 8606ce5..4beeb6e 100644
---- a/command/session_cmds.cpp
-+++ b/command/session_cmds.cpp
-@@ -8,6 +8,14 @@
- namespace command
- {
-
-+// Defined as per IPMI sepcification
-+static constexpr uint8_t searchCurrentSession = 0x00;
-+static constexpr uint8_t searchSessionByHandle = 0xFE;
-+static constexpr uint8_t searchSessionByID = 0xFF;
-+
-+static constexpr uint8_t ipmi15VerSession = 0x00;
-+static constexpr uint8_t ipmi20VerSession = 0x01;
-+
- std::vector<uint8_t>
- setSessionPrivilegeLevel(const std::vector<uint8_t>& inPayload,
- const message::Handler& handler)
-@@ -92,4 +100,143 @@ std::vector<uint8_t> closeSession(const std::vector<uint8_t>& inPayload,
- return outPayload;
- }
-
-+std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
-+ const message::Handler& handler)
-+
-+{
-+ std::vector<uint8_t> outPayload(sizeof(GetSessionInfoResponse));
-+ auto request =
-+ reinterpret_cast<const GetSessionInfoRequest*>(inPayload.data());
-+ auto response =
-+ reinterpret_cast<GetSessionInfoResponse*>(outPayload.data());
-+ uint32_t reqSessionID = handler.sessionID;
-+ response->completionCode = IPMI_CC_OK;
-+ if (inPayload.size() == 1 && request->sessionIndex != 0)
-+ {
-+ if (request->sessionIndex <= session::MAX_SESSION_COUNT)
-+ {
-+ reqSessionID = std::get<session::Manager&>(singletonPool)
-+ .getSessionIDbyHandle(request->sessionIndex);
-+ }
-+ else
-+ {
-+ response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ }
-+
-+ // Here we look for session info according to session index parameter
-+ switch (request->sessionIndex)
-+ {
-+ // Look for current active session which this cmd is received over
-+ case searchCurrentSession:
-+ // Request data should only contain session index byte
-+ if (inPayload.size() != 1)
-+ {
-+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ // To look for current active session which the command came over,
-+ // the session ID cannot be 0.
-+ if (0 == reqSessionID)
-+ {
-+ response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ break;
-+ case searchSessionByHandle:
-+ // Request data should only contain session index byte and Session
-+ // handle
-+ if (inPayload.size() != 2)
-+ {
-+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+
-+ // Retrieve session id based on session handle
-+ if (request->sessionHandle <= session::MAX_SESSION_COUNT)
-+ {
-+ reqSessionID =
-+ std::get<session::Manager&>(singletonPool)
-+ .getSessionIDbyHandle(request->sessionHandle);
-+ }
-+ else
-+ {
-+ response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ break;
-+ case searchSessionByID:
-+ // Request data should only contain session index byte and Session
-+ // handle
-+ if (inPayload.size() != sizeof(GetSessionInfoRequest))
-+ {
-+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ reqSessionID = endian::from_ipmi(request->sessionID);
-+
-+ break;
-+ default:
-+ if (inPayload.size() != 1)
-+ {
-+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ }
-+
-+ response->totalSessionCount = session::MAX_SESSION_COUNT;
-+ response->activeSessioncount =
-+ std::get<session::Manager&>(singletonPool).getNoOfActiveSession();
-+ response->sessionHandle = 0;
-+ if (reqSessionID != 0)
-+ {
-+
-+ std::shared_ptr<session::Session> sessionInfo;
-+ try
-+ {
-+ sessionInfo = std::get<session::Manager&>(singletonPool)
-+ .getSession(reqSessionID);
-+ }
-+ catch (std::exception& e)
-+ {
-+ response->completionCode = IPMI_CC_UNSPECIFIED_ERROR;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ response->sessionHandle = std::get<session::Manager&>(singletonPool)
-+ .getSessionHandle(reqSessionID);
-+ uint8_t userId = ipmi::ipmiUserGetUserId(sessionInfo->userName);
-+ if (userId == ipmi::invalidUserId)
-+ {
-+ response->completionCode = IPMI_CC_UNSPECIFIED_ERROR;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return std::move(outPayload);
-+ }
-+ response->userID = userId; // userId;
-+ response->privLevel = static_cast<uint8_t>(sessionInfo->curPrivLevel);
-+ response->chanNum = sessionInfo->chNum; // byte7 3:0
-+ response->ipmiVer = ipmi20VerSession; // byte7 7:4
-+ response->remoteIpAddr =
-+ sessionInfo->channelPtr->getRemoteAddressInbytes();
-+ response->remotePort =
-+ sessionInfo->channelPtr->getPort(); // remoteSessionPort;
-+
-+ std::cerr << "\nSessionInfo:" << (int)reqSessionID;
-+ // TODO: Filling the Remote MACAddress
-+ }
-+ else
-+ {
-+ outPayload.resize(4);
-+ }
-+ return std::move(outPayload);
-+}
-+
- } // namespace command
-diff --git a/command/session_cmds.hpp b/command/session_cmds.hpp
-index 9737fdb..741de23 100644
---- a/command/session_cmds.hpp
-+++ b/command/session_cmds.hpp
-@@ -116,4 +116,59 @@ struct CloseSessionResponse
- std::vector<uint8_t> closeSession(const std::vector<uint8_t>& inPayload,
- const message::Handler& handler);
-
-+/**
-+ * @struct GetSessionInfoRequest
-+ *
-+ * IPMI Request data for getSession info command
-+ */
-+struct GetSessionInfoRequest
-+{
-+ uint8_t sessionIndex;
-+ union
-+ {
-+ uint8_t sessionHandle;
-+ uint32_t sessionID;
-+ };
-+} __attribute__((packed));
-+
-+/**
-+ * @struct getSessionInfoResponse
-+ *
-+ * IPMI Response data for getSession info command
-+ */
-+struct GetSessionInfoResponse
-+{
-+ uint8_t completionCode;
-+ uint8_t sessionHandle;
-+ uint8_t totalSessionCount;
-+ uint8_t activeSessioncount;
-+ uint8_t userID;
-+ uint8_t privLevel;
-+#if BYTE_ORDER == LITTLE_ENDIAN
-+ uint8_t chanNum : 4;
-+ uint8_t ipmiVer : 4;
-+#endif
-+#if BYTE_ORDER == BIG_ENDIAN
-+ uint8_t ipmiVer : 4;
-+ uint8_t chanNum : 4;
-+#endif
-+ uint32_t remoteIpAddr; // for channel private data
-+ uint8_t remoteMACAddr[6];
-+ uint16_t remotePort;
-+} __attribute__((packed));
-+
-+/**
-+ * @brief GetSessionInfo Command
-+ *
-+ * This command is used to get the session information based on
-+ * session handle or session ID. Retreive all session information.
-+
-+ * @param[in] inPayload - Request Data for the command
-+ * @param[in] handler - Reference to the Message Handler
-+ *
-+ * @return Response data for the command
-+ */
-+std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
-+ const message::Handler& handler);
-+
- } // namespace command
-diff --git a/message_handler.cpp b/message_handler.cpp
-index e2aafb3..b335236 100644
---- a/message_handler.cpp
-+++ b/message_handler.cpp
-@@ -43,6 +43,7 @@ bool Handler::receive()
- sessionID = inMessage->bmcSessionID;
- inMessage->rcSessionID = session->getRCSessionID();
- session->updateLastTransactionTime();
-+ session->channelPtr = channel;
-
- return true;
- }
-diff --git a/sessions_manager.cpp b/sessions_manager.cpp
-index 95a8a15..9f3210b 100644
---- a/sessions_manager.cpp
-+++ b/sessions_manager.cpp
-@@ -88,6 +88,9 @@ std::shared_ptr<Session>
- }
- sessionID = session->getBMCSessionID();
- sessionsMap.emplace(sessionID, session);
-+ storeSessionHandle(sessionID);
-+
-+
- return session;
- }
-
-@@ -149,12 +152,15 @@ std::shared_ptr<Session> Manager::getSession(SessionID sessionID,
-
- void Manager::cleanStaleEntries()
- {
-+ uint8_t sessionIndex = 0;
- for (auto iter = sessionsMap.begin(); iter != sessionsMap.end();)
- {
- auto session = iter->second;
- if ((session->getBMCSessionID() != SESSION_ZERO) &&
- !(session->isSessionActive()))
- {
-+ sessionIndex = getSessionHandle(session->getBMCSessionID());
-+ sessionHandleMap[sessionIndex] = 0;
- iter = sessionsMap.erase(iter);
- }
- else
-@@ -164,4 +170,53 @@ void Manager::cleanStaleEntries()
- }
- }
-
-+uint8_t Manager::storeSessionHandle(SessionID bmcSessionID)
-+{
-+ // Zero handler is reserved for invalid session.
-+ //index starts with 1, for direct usage. Index 0 reserved
-+ for (uint8_t i = 1; i <= MAX_SESSION_COUNT; i++)
-+ {
-+ if (sessionHandleMap[i] == 0)
-+ {
-+ sessionHandleMap[i] = bmcSessionID;
-+ break;
-+ }
-+ }
-+ return 0;
-+}
-+
-+uint32_t Manager::getSessionIDbyHandle(uint8_t sessionHandle) const
-+{
-+ if (sessionHandle <= MAX_SESSION_COUNT)
-+ {
-+ return sessionHandleMap[sessionHandle];
-+ }
-+ return 0;
-+}
-+
-+uint8_t Manager::getSessionHandle(SessionID bmcSessionID) const
-+{
-+
-+ for (uint8_t i = 1; i <= MAX_SESSION_COUNT; i++)
-+ {
-+ if (sessionHandleMap[i] == bmcSessionID)
-+ {
-+ return i;
-+ }
-+ }
-+ return 0;
-+}
-+uint8_t Manager::getNoOfActiveSession() const
-+{
-+ uint8_t count = 0;
-+ for (const auto& it : sessionsMap)
-+ {
-+ const auto& session = it.second;
-+ if (session->state == State::ACTIVE)
-+ {
-+ count++;
-+ }
-+ }
-+ return count;
-+}
- } // namespace session
-diff --git a/sessions_manager.hpp b/sessions_manager.hpp
-index 9fd38b1..f6ed1c3 100644
---- a/sessions_manager.hpp
-+++ b/sessions_manager.hpp
-@@ -82,8 +82,15 @@ class Manager
- std::shared_ptr<Session>
- getSession(SessionID sessionID,
- RetrieveOption option = RetrieveOption::BMC_SESSION_ID);
-+ uint8_t getNoOfActiveSession() const;
-+ uint8_t getSessionHandle(SessionID bmcSessionID) const;
-+ uint8_t storeSessionHandle(SessionID bmcSessionID);
-+ uint32_t getSessionIDbyHandle(uint8_t sessionHandle) const;
-
- private:
-+ //+1 for session, as 0 is reserved for sessionless command
-+ std::array<uint32_t, MAX_SESSION_COUNT + 1> sessionHandleMap;
-+
- /**
- * @brief Session Manager keeps the session objects as a sorted
- * associative container with Session ID as the unique key
-diff --git a/socket_channel.hpp b/socket_channel.hpp
-index ebe0c8f..349701e 100644
---- a/socket_channel.hpp
-+++ b/socket_channel.hpp
-@@ -64,6 +64,23 @@ class Channel
- return endpoint.port();
- }
-
-+ /**
-+ * @brief Return the binary representation of the remote IPv4 address
-+ *
-+ * getSessionInfo needs to return the remote IPv4 addresses of each session
-+ *
-+ * @return A uint32_t representation of the remote IPv4 address
-+ */
-+ std::uint32_t getRemoteAddressInbytes()
-+ {
-+ const boost::asio::ip::address& addr = endpoint.address();
-+ if (addr.is_v4())
-+ {
-+ return addr.to_v4().to_uint();
-+ }
-+ return 0;
-+ }
-+
- /**
- * @brief Read the incoming packet
- *
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch
deleted file mode 100644
index c6b87bf4f..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch
+++ /dev/null
@@ -1,282 +0,0 @@
-From a413e390563205476656a9005ca447f5b626872f Mon Sep 17 00:00:00 2001
-From: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
-Date: Wed, 6 Mar 2019 10:35:56 +0530
-Subject: [PATCH 2/2] Sync GetSession Info cmd based on Upstream review
-
-Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
----
- comm_module.cpp | 12 +++----
- command/session_cmds.cpp | 71 ++++++++++++++++++----------------------
- sessions_manager.cpp | 10 +++---
- sessions_manager.hpp | 2 +-
- socket_channel.hpp | 33 ++++++++++---------
- 5 files changed, 59 insertions(+), 69 deletions(-)
-
-diff --git a/comm_module.cpp b/comm_module.cpp
-index 7a1a17d..2546583 100644
---- a/comm_module.cpp
-+++ b/comm_module.cpp
-@@ -54,13 +54,11 @@ void sessionSetupCommands()
- session::Privilege::CALLBACK,
- false},
- // Session Info Command
-- {
-- {
-- (static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
-- static_cast<uint16_t>(command::NetFns::APP) | 0x3D
-- },
-- &getSessionInfo, session::Privilege::USER, false
-- },
-+ {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
-+ static_cast<uint16_t>(command::NetFns::APP) | 0x3D},
-+ &getSessionInfo,
-+ session::Privilege::USER,
-+ false},
- };
-
- for (auto& iter : commands)
-diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp
-index 4beeb6e..0c3a4ed 100644
---- a/command/session_cmds.cpp
-+++ b/command/session_cmds.cpp
-@@ -8,7 +8,7 @@
- namespace command
- {
-
--// Defined as per IPMI sepcification
-+// Defined as per IPMI specification
- static constexpr uint8_t searchCurrentSession = 0x00;
- static constexpr uint8_t searchSessionByHandle = 0xFE;
- static constexpr uint8_t searchSessionByID = 0xFF;
-@@ -111,20 +111,6 @@ std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
- reinterpret_cast<GetSessionInfoResponse*>(outPayload.data());
- uint32_t reqSessionID = handler.sessionID;
- response->completionCode = IPMI_CC_OK;
-- if (inPayload.size() == 1 && request->sessionIndex != 0)
-- {
-- if (request->sessionIndex <= session::MAX_SESSION_COUNT)
-- {
-- reqSessionID = std::get<session::Manager&>(singletonPool)
-- .getSessionIDbyHandle(request->sessionIndex);
-- }
-- else
-- {
-- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-- }
-- }
-
- // Here we look for session info according to session index parameter
- switch (request->sessionIndex)
-@@ -132,29 +118,22 @@ std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
- // Look for current active session which this cmd is received over
- case searchCurrentSession:
- // Request data should only contain session index byte
-- if (inPayload.size() != 1)
-+ if (inPayload.size() != sizeof(request->sessionIndex))
- {
- response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-- }
-- // To look for current active session which the command came over,
-- // the session ID cannot be 0.
-- if (0 == reqSessionID)
-- {
-- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
-- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
- break;
- case searchSessionByHandle:
- // Request data should only contain session index byte and Session
- // handle
-- if (inPayload.size() != 2)
-+ if (inPayload.size() != (sizeof(request->sessionIndex) +
-+ sizeof(request->sessionHandle)))
- {
- response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
-
- // Retrieve session id based on session handle
-@@ -168,7 +147,7 @@ std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
- {
- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
- break;
- case searchSessionByID:
-@@ -178,23 +157,38 @@ std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
- {
- response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
- reqSessionID = endian::from_ipmi(request->sessionID);
-
- break;
- default:
-- if (inPayload.size() != 1)
-+ if (inPayload.size() == sizeof(request->sessionIndex))
-+ {
-+ if (request->sessionIndex <= session::MAX_SESSION_COUNT)
-+ {
-+ reqSessionID =
-+ std::get<session::Manager&>(singletonPool)
-+ .getSessionIDbyHandle(request->sessionIndex);
-+ }
-+ else
-+ {
-+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
-+ outPayload.resize(sizeof(response->completionCode));
-+ return outPayload;
-+ }
-+ }
-+ else
- {
- response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
- }
-
- response->totalSessionCount = session::MAX_SESSION_COUNT;
- response->activeSessioncount =
-- std::get<session::Manager&>(singletonPool).getNoOfActiveSession();
-+ std::get<session::Manager&>(singletonPool).getActiveSessionCount();
- response->sessionHandle = 0;
- if (reqSessionID != 0)
- {
-@@ -207,9 +201,9 @@ std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
- }
- catch (std::exception& e)
- {
-- response->completionCode = IPMI_CC_UNSPECIFIED_ERROR;
-+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
- response->sessionHandle = std::get<session::Manager&>(singletonPool)
- .getSessionHandle(reqSessionID);
-@@ -218,25 +212,24 @@ std::vector<uint8_t> getSessionInfo(const std::vector<uint8_t>& inPayload,
- {
- response->completionCode = IPMI_CC_UNSPECIFIED_ERROR;
- outPayload.resize(sizeof(response->completionCode));
-- return std::move(outPayload);
-+ return outPayload;
- }
- response->userID = userId; // userId;
- response->privLevel = static_cast<uint8_t>(sessionInfo->curPrivLevel);
- response->chanNum = sessionInfo->chNum; // byte7 3:0
- response->ipmiVer = ipmi20VerSession; // byte7 7:4
-- response->remoteIpAddr =
-- sessionInfo->channelPtr->getRemoteAddressInbytes();
- response->remotePort =
- sessionInfo->channelPtr->getPort(); // remoteSessionPort;
-+ response->remoteIpAddr =
-+ sessionInfo->channelPtr->getRemoteAddressInBytes();
-
-- std::cerr << "\nSessionInfo:" << (int)reqSessionID;
- // TODO: Filling the Remote MACAddress
- }
- else
- {
- outPayload.resize(4);
- }
-- return std::move(outPayload);
-+ return outPayload;
- }
-
- } // namespace command
-diff --git a/sessions_manager.cpp b/sessions_manager.cpp
-index 9f3210b..c6897c6 100644
---- a/sessions_manager.cpp
-+++ b/sessions_manager.cpp
-@@ -152,15 +152,13 @@ std::shared_ptr<Session> Manager::getSession(SessionID sessionID,
-
- void Manager::cleanStaleEntries()
- {
-- uint8_t sessionIndex = 0;
- for (auto iter = sessionsMap.begin(); iter != sessionsMap.end();)
- {
- auto session = iter->second;
- if ((session->getBMCSessionID() != SESSION_ZERO) &&
- !(session->isSessionActive()))
- {
-- sessionIndex = getSessionHandle(session->getBMCSessionID());
-- sessionHandleMap[sessionIndex] = 0;
-+ sessionHandleMap[getSessionHandle(session->getBMCSessionID())] = 0;
- iter = sessionsMap.erase(iter);
- }
- else
-@@ -172,8 +170,8 @@ void Manager::cleanStaleEntries()
-
- uint8_t Manager::storeSessionHandle(SessionID bmcSessionID)
- {
-- // Zero handler is reserved for invalid session.
-- //index starts with 1, for direct usage. Index 0 reserved
-+ // Handler index 0 is reserved for invalid session.
-+ // index starts with 1, for direct usage. Index 0 reserved
- for (uint8_t i = 1; i <= MAX_SESSION_COUNT; i++)
- {
- if (sessionHandleMap[i] == 0)
-@@ -206,7 +204,7 @@ uint8_t Manager::getSessionHandle(SessionID bmcSessionID) const
- }
- return 0;
- }
--uint8_t Manager::getNoOfActiveSession() const
-+uint8_t Manager::getActiveSessionCount() const
- {
- uint8_t count = 0;
- for (const auto& it : sessionsMap)
-diff --git a/sessions_manager.hpp b/sessions_manager.hpp
-index f6ed1c3..3ff213e 100644
---- a/sessions_manager.hpp
-+++ b/sessions_manager.hpp
-@@ -82,7 +82,7 @@ class Manager
- std::shared_ptr<Session>
- getSession(SessionID sessionID,
- RetrieveOption option = RetrieveOption::BMC_SESSION_ID);
-- uint8_t getNoOfActiveSession() const;
-+ uint8_t getActiveSessionCount() const;
- uint8_t getSessionHandle(SessionID bmcSessionID) const;
- uint8_t storeSessionHandle(SessionID bmcSessionID);
- uint32_t getSessionIDbyHandle(uint8_t sessionHandle) const;
-diff --git a/socket_channel.hpp b/socket_channel.hpp
-index 349701e..8b64740 100644
---- a/socket_channel.hpp
-+++ b/socket_channel.hpp
-@@ -107,14 +107,15 @@ class Channel
- *
- * @return A uint32_t representation of the remote IPv4 address
- */
-- std::uint32_t getRemoteAddressInbytes()
-+ uint32_t getRemoteAddressInBytes() const
- {
-- const boost::asio::ip::address& addr = endpoint.address();
-- if (addr.is_v4())
-+ uint32_t v4addr = 0;
-+ if (sockAddrSize == sizeof(sockaddr_in))
- {
-- return addr.to_v4().to_uint();
-+ auto saddr = reinterpret_cast<const sockaddr_in*>(&remoteSockAddr);
-+ v4addr = ntohl(saddr->sin_addr.s_addr);
- }
-- return 0;
-+ return v4addr;
- }
-
- /**
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch
index c90cccf34..dc7f7357c 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch
@@ -1,6 +1,6 @@
-From 6b9aaf0304aed06e4b5ac53e7c163089568d4171 Mon Sep 17 00:00:00 2001
+From 97c21a556702a0d65096b30c07ef23f15cb6a7d9 Mon Sep 17 00:00:00 2001
From: Cheng C Yang <cheng.c.yang@intel.com>
-Date: Sat, 23 Mar 2019 04:03:07 +0800
+Date: Wed, 3 Jul 2019 07:39:47 +0800
Subject: [PATCH] Add dbus interface for sol commands
Add dbus interface for sol config parameters so that after move set/get
@@ -25,22 +25,24 @@ to 0 and other properties will not reset to default value.
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
---
- command/payload_cmds.cpp | 1 +
- command/sol_cmds.cpp | 84 ---------------------------------
- sol/sol_manager.cpp | 119 +++++++++++++++++++++++++++++++++++++++++++++++
+ command/payload_cmds.cpp | 3 ++
+ command/sol_cmds.cpp | 84 -------------------------------
+ sol/sol_manager.cpp | 125 +++++++++++++++++++++++++++++++++++++++++++++++
sol/sol_manager.hpp | 1 +
sol_module.cpp | 6 ---
- 5 files changed, 121 insertions(+), 90 deletions(-)
+ 5 files changed, 129 insertions(+), 90 deletions(-)
diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp
-index 3b5b4f8..570cdff 100644
+index c32a510..17167a7 100644
--- a/command/payload_cmds.cpp
+++ b/command/payload_cmds.cpp
-@@ -34,6 +34,7 @@ std::vector<uint8_t> activatePayload(const std::vector<uint8_t>& inPayload,
+@@ -34,6 +34,9 @@ std::vector<uint8_t> activatePayload(const std::vector<uint8_t>& inPayload,
return outPayload;
}
-+ std::get<sol::Manager&>(singletonPool).updateSOLParameter();
++ std::get<sol::Manager&>(singletonPool)
++ .updateSOLParameter(ipmi::convertCurrentChannelNum(
++ ipmi::currentChNum, getInterfaceIndex()));
if (!std::get<sol::Manager&>(singletonPool).enable)
{
response->completionCode = IPMI_CC_PAYLOAD_TYPE_DISABLED;
@@ -140,7 +142,7 @@ index a8fa410..804b5ea 100644
const message::Handler& handler)
{
diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp
-index 2046fe4..de36723 100644
+index 2046fe4..eedd28a 100644
--- a/sol/sol_manager.cpp
+++ b/sol/sol_manager.cpp
@@ -12,7 +12,13 @@
@@ -152,12 +154,12 @@ index 2046fe4..de36723 100644
+#include <sdbusplus/message/types.hpp>
+
+constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL";
-+constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol";
++constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol/";
+constexpr const char* PROP_INTF = "org.freedesktop.DBus.Properties";
namespace sol
{
-@@ -93,6 +99,119 @@ void Manager::stopHostConsole()
+@@ -93,6 +99,125 @@ void Manager::stopHostConsole()
}
}
@@ -221,17 +223,19 @@ index 2046fe4..de36723 100644
+ return properties;
+}
+
-+void Manager::updateSOLParameter()
++void Manager::updateSOLParameter(uint8_t channelNum)
+{
+ std::variant<uint8_t, bool> value;
+ sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection());
+ static std::string solService{};
+ ipmi::PropertyMap properties;
++ std::string ethdevice = ipmi::getChannelName(channelNum);
++ std::string solPathWitheEthName = solPath + ethdevice;
+ if (solService.empty())
+ {
+ try
+ {
-+ solService = getService(dbus, solInterface, solPath);
++ solService = getService(dbus, solInterface, solPathWitheEthName);
+ }
+ catch (const std::runtime_error& e)
+ {
@@ -243,8 +247,8 @@ index 2046fe4..de36723 100644
+ }
+ try
+ {
-+ properties =
-+ getAllDbusProperties(dbus, solService, solPath, solInterface);
++ properties = getAllDbusProperties(dbus, solService, solPathWitheEthName,
++ solInterface);
+ }
+ catch (const std::runtime_error&)
+ {
@@ -257,8 +261,12 @@ index 2046fe4..de36723 100644
+
+ enable = std::get<bool>(properties["Enable"]);
+
++ forceEncrypt = std::get<bool>(properties["ForceEncryption"]);
++
++ forceAuth = std::get<bool>(properties["ForceAuthentication"]);
++
+ solMinPrivilege = static_cast<session::Privilege>(
-+ std::get<uint8_t>(properties["Authentication"]));
++ std::get<uint8_t>(properties["Privilege"]));
+
+ accumulateInterval =
+ std::get<uint8_t>((properties["AccumulateIntervalMS"])) *
@@ -278,14 +286,14 @@ index 2046fe4..de36723 100644
session::SessionID sessionID)
{
diff --git a/sol/sol_manager.hpp b/sol/sol_manager.hpp
-index 5d96890..b7eb89e 100644
+index 5d96890..00da9fb 100644
--- a/sol/sol_manager.hpp
+++ b/sol/sol_manager.hpp
@@ -248,6 +248,7 @@ class Manager
* @return 0 on success and errno on failure.
*/
int writeConsoleSocket(const std::vector<uint8_t>& input) const;
-+ void updateSOLParameter(void);
++ void updateSOLParameter(uint8_t channelNum);
private:
SOLPayloadMap payloadMap;
@@ -307,5 +315,5 @@ index 8200e74..2b1fb46 100644
{{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
static_cast<uint16_t>(::command::NetFns::TRANSPORT) | 0x22},
--
-2.16.2
+2.7.4
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
index 214bea189..05f10d980 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
@@ -2,8 +2,8 @@ inherit useradd
# TODO: This should be removed, once up-stream bump up
# issue is resolved
-#SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid"
-#SRCREV = "b31e969504645f653b58b676d56b01d632dc395c"
+SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid"
+SRCREV = "0a269046d0d9fcd690ccbb129ae58a3c1450b04e"
USERADD_PACKAGES = "${PN}"
# add a group called ipmi
@@ -20,10 +20,7 @@ SYSTEMD_SERVICE_${PN} += " \
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += " file://0006-Modify-dbus-namespace-of-chassis-control-for-guid.patch \
- file://0007-Adding-support-for-GetSessionInfo-command.patch \
- file://0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch \
file://0009-Add-dbus-interface-for-sol-commands.patch \
- file://00010-Change-Authentication-Parameter.patch \
file://0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch \
"
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 af83facf6..b27961109 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://git@github.com/Intel-BMC/node-manager;protocol=ssh"
-SRCREV = "2ab90332828614c95e0ce22c0c95285734b55b65"
+SRCREV = "06e8a1072b05d42e63cf70e2ceac7390578c051d"
PV = "0.1+git${SRCPV}"
LICENSE = "Apache-2.0"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb
index 65f578338..177f5c98f 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb
@@ -2,7 +2,7 @@ SUMMARY = "Multi node manager"
DESCRIPTION = "Daemon to handle chassis level shared resources on multi-node platform"
SRC_URI = "git://git@github.com/Intel-BMC/multi-node-manager.git;protocol=ssh"
-SRCREV = "6a4cd36c0d46df11bdcd3b897bcc9c87e549a076"
+SRCREV = "34d959285a3ca12c4bfefa4040d82d571c78843b"
PV = "0.1+git${SRCPV}"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb
new file mode 100644
index 000000000..c35289a57
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Phosphor U-Boot environment manager"
+DESCRIPTION = "Daemon to read or write U-Boot environment variables"
+
+PV = "1.0+git${SRCPV}"
+
+S = "${WORKDIR}/git/phosphor-u-boot-env-mgr"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
+
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
+
+inherit cmake systemd
+SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.U_Boot.Environment.Manager.service"
+
+DEPENDS = "boost sdbusplus phosphor-logging"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init
index c7f78b1e3..e97c40c1c 100755
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init
@@ -18,11 +18,24 @@
# provide a couple of places in the RO root filesystem
# that can be made RW with an overlayfs
+log() {
+ [ -c /dev/kmsg ] && echo "init: $@" > /dev/kmsg
+ echo "init: $@"
+}
+
# start with /proc and /tmp mounted
[ -e /proc/mounts ] || mount -t proc proc /proc
grep -q /tmp /proc/mounts || mount -t tmpfs -o rw,nosuid,nodev tmp /tmp
grep -q /sys /proc/mounts || mount -t sysfs -o rw,nosuid,nodev,noexec sys /sys
+if grep -q debug-init /proc/cmdline; then
+ exec > /tmp/init.log 2>&1
+ set -x
+else
+ # silent bob
+ exec >/dev/null 2>&1
+fi
+
# list of things that need to be rw at boot
NV_OVERLAYS="/etc /var /home"
@@ -61,86 +74,100 @@ nvrw() {
mount -t overlay -o "$opts" "$mname" "$p"
}
-targetted_clean() {
- local LOG_TAG="restore-defaults"
- # Do not delete server certificates for the web server or ssh
- echo "removing targetted contents:"
- cd "${RWFS_MNT}/etc"
- for file in *; do
- case $file in
- # The only files that stay are here:
- CA|RestoreDefaultConfiguration|dropbear|sdr|server.pem);;
- # All else get removed.
- *) echo "remove $file"
- rm -rf $file;;
- esac
- done
+targeted_clean() {
+ log "restore-defaults: targeted_clean"
+ # Do not delete FRU info, ssh/ssl certs, or machine-id
+ (
+ cd "${RWFS_MNT}/etc"
+ find . ! -regex '.*\(/ssl\|/dropbear\|/machine-id\(_bkup\)\?\|/fru\).*' -exec rm -rf {} +
+ )
# nothing should be in the workdir, but clear it just in case
rm -rf "${RWFS_MNT}/etc.work"
- # Log files remaining - but not to stdout.
- echo "Files remaining: $(ls)"
+ # clean everything out of /home
+ rm -rf "${RWFS_MNT}/home" "${RWFS_MNT}/home.work"
# clean everything out of /var
rm -rf "${RWFS_MNT}/var" "${RWFS_MNT}/var.work"
+
+ echo "Files remaining: $(find $RWFS_MNT/)"
+ sync
}
full_clean() {
+ log "restore-defaults: full_clean"
local OVL=''
for OVL in $NV_OVERLAYS; do
rm -rf "${RWFS_MNT}${OVL}" "${RWFS_MNT}${OVL}.work"
done
+ sync
}
-
-# check for full factory reset: if so, ubiformat $NV_MTD_DEV
-bootflags="0x$(sed -n 's/^.*bootflags=\([0-9a-f]*\).*$/\1/p' /proc/cmdline)"
-bootflags=$((bootflags + 0))
-let "restore_op = $bootflags & 0x3"
-if [ $restore_op -eq 3 ]; then
- ubiformat -y "$NV_MTD_DEV"
-fi
-
# attach a UBI device to the MTD device
-NV_UBI_DEV="/dev/ubi${NV_MTD_NUM}"
-if [ ! -e $NV_UBI_DEV ]; then
- if ! ubiattach -m "$NV_MTD_NUM" -d "$NV_MTD_NUM"; then
- # the attach failed, so format the MTD device and try again
- echo "Warning! Failed to attach $NV_UBI_DEV to $NV_MTD_DEV."
- echo "UBI-formatting $NV_MTD_DEV to attach again. Data on this device will be lost."
- ubiformat -y "$NV_MTD_DEV"
- ubiattach -m "$NV_MTD_NUM" -d "$NV_MTD_NUM"
+prepare_ubi_volume() {
+ local nv_num="$1"
+ local mtd="/dev/mtd${nv_num}"
+ local ubi="/dev/ubi${nv_num}"
+ if [ ! -e $ubi ]; then
+ if ! ubiattach -m "$nv_num" -d "$nv_num"; then
+ # the attach failed, so format the MTD device and try again
+ log "Warning! Failed to attach $ubi to $mtd."
+ log "UBI-formatting $mtd to attach again. Data on this device will be lost."
+ ubiformat -y "$mtd"
+ ubiattach -m "$nv_num" -d "$nv_num"
+ fi
fi
-fi
-# make a UBI volume on the UBI device
-NV_UBI_VOL="${NV_UBI_DEV}_0"
-if [ ! -e $NV_UBI_VOL ]; then
- ubimkvol "$NV_UBI_DEV" -N "$NV_MTD" -m
-fi
+ # make a UBI volume on the UBI device
+ local vol="${ubi}_0"
+ if [ ! -e $vol ]; then
+ ubimkvol "$ubi" -N "$mtd" -m
+ fi
+}
+
+reformat_ubi_volume() {
+ local nv_num="$1"
+ local mnt="$2"
+ local ubi="/dev/ubi${nv_num}"
+ local vol="${ubi}_0"
+ # unmount the volume to reformat it
+ umount -f "$mnt"
+ ubidetach -m $nv_num
+ ubiformat -y "$ubi"
+ prepare_ubi_volume $nv_num
+ # remount the UBIFS on the UBI volume
+ mount -t ubifs "$vol" "$mnt"
+ if [ $? -ne 0 ]; then
+ log "Failed to mount reformatted NV volume; system unstable"
+ fi
+}
# mount a UBIFS on the UBI volume
-mount -t ubifs "$NV_UBI_VOL" "$RWFS_MNT"
+prepare_ubi_volume $NV_MTD_NUM
+mount -t ubifs "/dev/ubi${NV_MTD_NUM}_0" "$RWFS_MNT"
+if [ $? -ne 0 ]; then
+ log "Failed to mount NV volume; attempting recovery"
+ reformat_ubi_volume $NV_MTD_NUM $RWFS_MNT
+fi
+# check for full factory reset: if so, ubiformat $NV_MTD_DEV
+RESTORE_FLAG=$RWFS_MNT/.restore_op
+restore_op=$(cat $RESTORE_FLAG) # read from NV
+restore_op=${restore_op:-0} # set default value 0
+restore_op=$((restore_op & 3)) # mask off 2 bits
if [ $restore_op -eq 1 ]; then
- targetted_clean
+ targeted_clean
elif [ $restore_op -eq 2 ]; then
full_clean
+elif [ $restore_op -eq 3 ]; then
+ log "restore-defaults: reformat"
+ reformat_ubi_volume $NV_MTD_NUM $RWFS_MNT
fi
+rm -f $RESTORE_FLAG
for FS in $NV_OVERLAYS; do
nvrw "$FS"
done
-# make sure that /etc/fw_env.config mirrors our current uboot environment
-UENV_MTD_INFO=$(grep UENV /proc/mtd)
-if [ -n "$UENV_MTD_INFO" ]; then
- UENV_MTD_INFO=$(echo "$UENV_MTD_INFO" | sed 's,^\([^:]*\): \([0-9a-f]*\) \([0-9a-f]*\) .*,/dev/\1 0 0x\2 0x\3,')
- if ! grep -q "^${UENV_MTD_INFO}$" /etc/fw_env.config; then
- echo "${UENV_MTD_INFO}" > /etc/fw_env.config
- echo "Updated fw_env.config"
- fi
-fi
-
# work around bug where /etc/machine-id will be mounted with a temporary file
# if rootfs is read-only and the file is empty
MACHINE_ID=/etc/machine-id
@@ -163,41 +190,28 @@ if [ ! -s "$MACHINE_ID" ]; then
else
generate_machine_id
fi
- echo "Remounted /etc for machine-id origin mismatch"
+ log "Remounted /etc for machine-id origin mismatch"
else
generate_machine_id
fi
fi
# mount persistent NV filesystem, where immortal settings live
+SOFS_MNT=/var/sofs
if ! grep -q sofs /proc/mounts; then
- mkdir -p /var/sofs
+ mkdir -p $SOFS_MNT
SOFS_MTD=sofs
- SOFS_MTD_DEV="$(mtd_by_name ${SOFS_MTD})"
SOFS_MTD_NUM="$(mtdnum_by_name ${SOFS_MTD})"
- SOFS_UBI_DEV="/dev/ubi${SOFS_MTD_NUM}"
-
- # attach a UBI device to the MTD device
- if [ ! -e $SOFS_UBI_DEV ]; then
- if ! ubiattach -m "$SOFS_MTD_NUM" -d "$SOFS_MTD_NUM"; then
- # the attach failed, so format the MTD device and try again
- echo "Warning! Failed to attach $SOFS_UBI_DEV to $SOFS_MTD_DEV."
- echo "UBI-formatting $SOFS_MTD_DEV to attach again. Data on this device will be lost."
- ubiformat -y "$SOFS_MTD_DEV"
- ubiattach -m "$SOFS_MTD_NUM" -d "$SOFS_MTD_NUM"
- fi
- fi
-
- # make a UBI volume on the UBI device
- SOFS_UBI_VOL="${SOFS_UBI_DEV}_0"
- if [ ! -e $SOFS_UBI_VOL ]; then
- ubimkvol "$SOFS_UBI_DEV" -N "$SOFS_MTD" -m
- fi
# mount a UBIFS on the UBI volume
- mount -t ubifs "$SOFS_UBI_VOL" /var/sofs
+ prepare_ubi_volume $SOFS_MTD_NUM
+ mount -t ubifs "/dev/ubi${SOFS_MTD_NUM}_0" "$SOFS_MNT"
+ if [ $? -ne 0 ]; then
+ log "Failed to mount SOFS volume; attempting recovery"
+ reformat_ubi_volume $SOFS_MTD_NUM $SOFS_MNT
+ fi
fi
-echo "Finished mounting non-volatile overlays"
+log "Finished mounting non-volatile overlays"
exec /lib/systemd/systemd
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb
new file mode 100644
index 000000000..a37d3ec9c
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Provision mode daemon - RestrictionMode"
+DESCRIPTION = "Daemon allows to configure RestrictionMode property"
+
+PV = "1.0+git${SRCPV}"
+
+S = "${WORKDIR}/git/prov-mode-mgr"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
+
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
+
+inherit cmake systemd
+SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.RestrictionMode.Manager.service"
+
+DEPENDS = "boost sdbusplus phosphor-logging"
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 2cdc93e29..fcdef4e02 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,6 +1,6 @@
# Enable downstream autobump
SRC_URI = "git://github.com/openbmc/phosphor-sel-logger.git"
-SRCREV = "c4a336fb15464b9f4a7328c02cb43285a6eb1e58"
+SRCREV = "3d300fca24b30864b3e9a4f5768cfe5e769458ae"
# Enable threshold monitoring
EXTRA_OECMAKE += "-DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS=ON"
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 ca3c2eba0..3e3282f6f 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,7 +1,7 @@
-SRCREV = "52497fd0fbd8adfe099a99f23515cd0341898e2e"
+SRCREV = "1cbd1c6da17a85ec7213744cf2d1e56fcba3e34e"
SRC_URI = "git://github.com/openbmc/dbus-sensors.git"
DEPENDS_append = " libgpiod"
#todo(cheng) remove this when synced upstream
-SYSTEMD_SERVICE_${PN} += " xyz.openbmc_project.psusensor.service"
+SYSTEMD_SERVICE_${PN} += " xyz.openbmc_project.mcutempsensor.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend
deleted file mode 100644
index 436623234..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://defaults.yaml \
- "
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml
deleted file mode 100644
index 05d3df07e..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml
+++ /dev/null
@@ -1,209 +0,0 @@
-/xyz/openbmc_project/control/minimum_ship_level_required:
- - Interface: xyz.openbmc_project.Control.MinimumShipLevel
- Properties:
- MinimumShipLevelRequired:
- Default: 'true'
-
-/xyz/openbmc_project/control/host0/auto_reboot:
- - Interface: xyz.openbmc_project.Control.Boot.RebootPolicy
- Properties:
- AutoReboot:
- Default: 'false'
-
-/xyz/openbmc_project/control/host0/boot:
- - Interface: xyz.openbmc_project.Control.Boot.Source
- Properties:
- BootSource:
- Default: Source::Sources::Default
- - Interface: xyz.openbmc_project.Control.Boot.Mode
- Properties:
- BootMode:
- Default: Mode::Modes::Regular
-
-/xyz/openbmc_project/control/host0/boot/one_time:
- - Interface: xyz.openbmc_project.Control.Boot.Source
- Properties:
- BootSource:
- Default: Source::Sources::Default
- - Interface: xyz.openbmc_project.Control.Boot.Mode
- Properties:
- BootMode:
- Default: Mode::Modes::Regular
- - Interface: xyz.openbmc_project.Object.Enable
- Properties:
- Enabled:
- Default: 'true'
-
-/xyz/openbmc_project/control/host0/power_cap:
- - Interface: xyz.openbmc_project.Control.Power.Cap
- Properties:
- PowerCap:
- Default: 0
- Validation:
- Type: "range"
- Validator: "0..1000"
- Unit: "Watts"
- PowerCapEnable:
- Default: 'false'
-
-/xyz/openbmc_project/control/host0/power_restore_policy:
- - Interface: xyz.openbmc_project.Control.Power.RestorePolicy
- Properties:
- PowerRestorePolicy:
- Default: RestorePolicy::Policy::AlwaysOff
-
-/xyz/openbmc_project/control/power_restore_delay:
- - Interface: xyz.openbmc_project.Control.Power.RestoreDelay
- Properties:
- PowerRestoreDelay:
- Default: 0
-
-/xyz/openbmc_project/control/host0/acpi_power_state:
- - Interface: xyz.openbmc_project.Control.Power.ACPIPowerState
- Properties:
- SysACPIStatus:
- Default: ACPIPowerState::ACPI::Unknown
- DevACPIStatus:
- Default: ACPIPowerState::ACPI::Unknown
-
-/xyz/openbmc_project/time/owner:
- - Interface: xyz.openbmc_project.Time.Owner
- Properties:
- TimeOwner:
- Default: Owner::Owners::BMC
-
-/xyz/openbmc_project/time/sync_method:
- - Interface: xyz.openbmc_project.Time.Synchronization
- Properties:
- TimeSyncMethod:
- Default: Synchronization::Method::NTP
-
-/xyz/openbmc_project/network/host0/intf:
- - Interface: xyz.openbmc_project.Network.MACAddress
- Properties:
- MACAddress:
- Default: '"00:00:00:00:00:00"'
- Validation:
- Type: "regex"
- Validator: '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
-
-#needs to implement address validation TODO openbmc/issues/2046
-/xyz/openbmc_project/network/host0/intf/addr:
- - Interface: xyz.openbmc_project.Network.IP
- Properties:
- Address:
- Default: '"0.0.0.0"'
- PrefixLength:
- Default: 0
- Validation:
- Type: "range"
- Validator: 0..128
- Unit: "bits"
- Origin:
- Default: IP::AddressOrigin::Static
- Gateway:
- Default: '"0.0.0.0"'
- Type:
- Default: IP::Protocol::IPv4
-
-/xyz/openbmc_project/control/host0/restriction_mode:
- - Interface: xyz.openbmc_project.Control.Security.RestrictionMode
- Properties:
- RestrictionMode:
- Default: RestrictionMode::Modes::Provisioning
-
-/xyz/openbmc_project/control/host0/TPMEnable:
- - Interface: xyz.openbmc_project.Control.TPM.Policy
- Properties:
- TPMEnable:
- Default: 'false'
-
-/xyz/openbmc_project/control/power_supply_redundancy:
- - Interface: xyz.openbmc_project.Control.PowerSupplyRedundancy
- Properties:
- PowerSupplyRedundancyEnabled:
- Default: 'true'
-
-/xyz/openbmc_project/control/host0/turbo_allowed:
- - Interface: xyz.openbmc_project.Control.Host.TurboAllowed
- Properties:
- TurboAllowed:
- Default: 'true'
-
-/xyz/openbmc_project/control/host0/systemGUID:
- - Interface: xyz.openbmc_project.Common.UUID
- Properties:
- UUID:
- Default: '"00000000-0000-0000-0000-000000000000"'
-
-/xyz/openbmc_project/bios:
- - Interface: xyz.openbmc_project.Inventory.Item.Bios
- Properties:
- BiosId:
- Default: '"NA"'
-
-/xyz/openbmc_project/control/processor_error_config:
- - Interface: xyz.openbmc_project.Control.Processor.ErrConfig
- Properties:
- ResetCfg:
- Default: 0
- ResetErrorOccurrenceCounts:
- Default: 0
-
-/com/intel/control/ocotshutdown_policy_config:
- - Interface: com.intel.Control.OCOTShutdownPolicy
- Properties:
- OCOTPolicy:
- Default: OCOTShutdownPolicy::Policy::NoShutdownOnOCOT
-
-/xyz/openbmc_project/control/chassis_capabilities_config:
- - Interface: xyz.openbmc_project.Control.ChassisCapabilities
- Properties:
- CapabilitiesFlags:
- Default: 0
- FRUDeviceAddress:
- Default: 0x20
- SDRDeviceAddress:
- Default: 0x20
- SELDeviceAddress:
- Default: 0x20
- SMDeviceAddress:
- Default: 0x20
- BridgeDeviceAddress:
- Default: 0x20
-
-/xyz/openbmc_project/control/thermal_mode:
- - Interface: xyz.openbmc_project.Control.ThermalMode
- Properties:
- Current:
- Default: '"Performance"'
- Supported:
- Default: '{"Acoustic", "Performance"}'
-
-/xyz/openbmc_project/control/cfm_limit:
- - Interface: xyz.openbmc_project.Control.CFMLimit
- Properties:
- Limit:
- Default: 0
-
-/xyz/openbmc_project/ipmi/sol:
- - Interface: xyz.openbmc_project.Ipmi.SOL
- Properties:
- Progress:
- Default: 0
- Enable:
- Default: 'true'
- ForceEncryption:
- Default: 'true'
- ForceAuthentication:
- Default: 'true'
- Privilege:
- Default: 4
- AccumulateIntervalMS:
- Default: 12
- Threshold:
- Default: 96
- RetryCount:
- Default: 6
- RetryIntervalMS:
- Default: 20
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch
deleted file mode 100644
index fcf2415d6..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 9e99aa4f72f4420e03ec2e4a29816eae43c5e748 Mon Sep 17 00:00:00 2001
-From: "Jia, Chunhui" <chunhui.jia@intel.com>
-Date: Tue, 29 May 2018 16:16:06 +0800
-Subject: [PATCH] [settings] initialize data file with default setting
-
-Current code trys to load settings from file at startup. When file
-does not exist, it will just use default setting. However, it will
-still load default on next reboot because no one create files.
-
-This change creates file as well when daemon loads default so next
-time daemon could load/save from file.
-
-Signed-off-by: Jia, Chunhui <chunhui.jia@intel.com>
----
- settings_manager.mako.hpp | 3 +++
- 1 file changed, 3 insertions(+)
- mode change 100644 => 100755 settings_manager.mako.hpp
-
-diff --git a/settings_manager.mako.hpp b/settings_manager.mako.hpp
-old mode 100644
-new mode 100755
-index 09a5a1f..cd592a0
---- a/settings_manager.mako.hpp
-+++ b/settings_manager.mako.hpp
-@@ -323,6 +323,9 @@ class Manager
- else
- {
- initSetting${index}();
-+ std::ofstream ostr(path.c_str(), std::ios::out);
-+ cereal::JSONOutputArchive oarchive(ostr);
-+ oarchive(*std::get<${index}>(settings)); //create file with default
- }
- }
- catch (cereal::Exception& e)
---
-2.16.2
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend
deleted file mode 100644
index f5c924b31..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://0001-settings-initialize-data-file-with-default-setting.patch \
- "
-
-DEPENDS += "intel-dbus-interfaces intel-dbus-interfaces-native"
-RDEPENDS_${PN} += "intel-dbus-interfaces"
-
-EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lintel_dbus'"
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 aadb48fbf..50f644f37 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://git-amr-2.devtools.intel.com:29418/openbmc-provingground.git;protocol=ssh"
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
+SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
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 99cac7931..736277dce 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://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
inherit cmake systemd
SYSTEMD_SERVICE_${PN} = "specialmodemgr.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb
index 52ebdfd88..30d92ea38 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb
@@ -9,7 +9,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh"
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
inherit cmake systemd
SYSTEMD_SERVICE_${PN} = "srvcfg-manager.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch
deleted file mode 100644
index fac9b52f1..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d34a2a5f6ca0564275ed0e2664624525cad64585 Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Fri, 13 Jul 2018 09:08:52 +0800
-Subject: [PATCH] Modify dbus interface for power control
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Switch power control service namespace from “org” to “xyz”,
-to compatible with new intel-chassis services
-
-Change-Id: I1bf5e218f72eb9fd4fb6f203c35479818d12b1fa
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- chassis_state_manager.cpp | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
-index 03dd176..05e2440 100644
---- a/chassis_state_manager.cpp
-+++ b/chassis_state_manager.cpp
-@@ -63,10 +63,11 @@ void Chassis::determineInitialState()
- {
- sdbusplus::message::variant<int> pgood = -1;
- auto method = this->bus.new_method_call(
-- "org.openbmc.control.Power", "/org/openbmc/control/power0",
-+ "xyz.openbmc_project.Chassis.Control.Power",
-+ "/xyz/openbmc_project/Chassis/Control/Power0",
- "org.freedesktop.DBus.Properties", "Get");
-
-- method.append("org.openbmc.control.Power", "pgood");
-+ method.append("xyz.openbmc_project.Chassis.Control.Power", "pgood");
- try
- {
- auto reply = this->bus.call(method);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch
deleted file mode 100644
index 2adff372e..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch
+++ /dev/null
@@ -1,338 +0,0 @@
-From ed64fe7379a259a822aca69e70426a2b07aad25d Mon Sep 17 00:00:00 2001
-From: Kuiying Wang <kuiying.wang@intel.com>
-Date: Tue, 7 Aug 2018 16:43:00 +0800
-Subject: [PATCH] Capture host restart cause
-
-Capture host restart cause on power/reset button pressed,
-ipmi command/webui, host OS reboot(Ctrl-Alt-Del),
-and power restore policy settings.
-Save the restart cause into file system,
-and restore it when BMC boot up.
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- configure.ac | 4 +-
- discover_system_state.cpp | 14 +++++
- host_state_manager.cpp | 17 ++++++
- host_state_manager.hpp | 148 +++++++++++++++++++++++++++++++++++++++++++++-
- 4 files changed, 178 insertions(+), 5 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 7919ec5..051a0c0 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -52,9 +52,9 @@ AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running])
- AS_IF([test "x$HOST_RUNNING_FILE" == "x"], [HOST_RUNNING_FILE="/run/openbmc/host@%u-on"])
- AC_DEFINE_UNQUOTED([HOST_RUNNING_FILE], ["$HOST_RUNNING_FILE"], [File to create if host is running])
-
--AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing requested host state.])
-+AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing host state.])
- AS_IF([test "x$HOST_STATE_PERSIST_PATH" == "x"], \
-- [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/requestedHostTransition"])
-+ [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/hostState"])
- AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \
- [Path of file for storing requested host state.])
-
-diff --git a/discover_system_state.cpp b/discover_system_state.cpp
-index 3a38152..0b5798a 100644
---- a/discover_system_state.cpp
-+++ b/discover_system_state.cpp
-@@ -12,6 +12,7 @@
- #include "settings.hpp"
- #include "xyz/openbmc_project/Common/error.hpp"
- #include "xyz/openbmc_project/Control/Power/RestorePolicy/server.hpp"
-+#include <xyz/openbmc_project/State/Host/server.hpp>
-
- namespace phosphor
- {
-@@ -181,6 +182,10 @@ int main(int argc, char** argv)
- log<level::INFO>("power_policy=ALWAYS_POWER_ON, powering host on");
- setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition",
- convertForMessage(server::Host::Transition::On));
-+
-+ setProperty(
-+ bus, hostPath, HOST_BUSNAME, "HostRestartCause",
-+ convertForMessage(server::Host::RestartCause::PowerPolicyAlwaysOn));
- }
- else if (RestorePolicy::Policy::Restore ==
- RestorePolicy::convertPolicyFromString(powerPolicy))
-@@ -192,6 +197,15 @@ int main(int argc, char** argv)
- getProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition");
- setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition",
- hostReqState);
-+
-+ if (server::Host::convertTransitionFromString(hostReqState) ==
-+ server::Host::Transition::On)
-+ {
-+ setProperty(
-+ bus, hostPath, HOST_BUSNAME, "HostRestartCause",
-+ convertForMessage(
-+ server::Host::RestartCause::PowerPolicyPreviousState));
-+ }
- }
-
- return 0;
-diff --git a/host_state_manager.cpp b/host_state_manager.cpp
-index 7d661dd..0e00e78 100644
---- a/host_state_manager.cpp
-+++ b/host_state_manager.cpp
-@@ -308,6 +308,15 @@ bool Host::deserialize(const fs::path& path)
- }
- }
-
-+void Host::restoreHostRestartCause()
-+{
-+ if (!deserialize(HOST_STATE_PERSIST_PATH))
-+ {
-+ // set to default value
-+ server::Host::hostRestartCause(server::Host::RestartCause::Unknown);
-+ }
-+}
-+
- Host::Transition Host::requestedHostTransition(Transition value)
- {
- log<level::INFO>("Host State transaction request",
-@@ -321,6 +330,7 @@ Host::Transition Host::requestedHostTransition(Transition value)
- // check of this count will occur
- if (value != server::Host::Transition::Off)
- {
-+ hostRestartCause(RestartCause::IpmiCommand);
- decrementRebootCount();
- }
-
-@@ -353,6 +363,13 @@ Host::HostState Host::currentHostState(HostState value)
- return server::Host::currentHostState(value);
- }
-
-+Host::RestartCause Host::hostRestartCause(RestartCause value)
-+{
-+ auto retVal = server::Host::hostRestartCause(value);
-+ serialize();
-+ return retVal;
-+}
-+
- } // namespace manager
- } // namespace state
- } // namespace phosphor
-diff --git a/host_state_manager.hpp b/host_state_manager.hpp
-index 2b00777..afd8aa3 100644
---- a/host_state_manager.hpp
-+++ b/host_state_manager.hpp
-@@ -32,6 +32,22 @@ using namespace phosphor::logging;
- namespace sdbusRule = sdbusplus::bus::match::rules;
- namespace fs = std::experimental::filesystem;
-
-+const static constexpr char* powerButtonPath =
-+ "/xyz/openbmc_project/Chassis/Buttons/Power0";
-+const static constexpr char* powerButtonIntf =
-+ "xyz.openbmc_project.Chassis.Buttons.Power";
-+const static constexpr char* resetButtonPath =
-+ "/xyz/openbmc_project/Chassis/Buttons/Reset0";
-+const static constexpr char* resetButtonIntf =
-+ "xyz.openbmc_project.Chassis.Buttons.Reset";
-+
-+const static constexpr char* powerControlService =
-+ "xyz.openbmc_project.Chassis.Control.Power";
-+const static constexpr char* powerControlPath =
-+ "/xyz/openbmc_project/Chassis/Control/Power0";
-+const static constexpr char* powerControlInterface =
-+ "xyz.openbmc_project.Chassis.Control.Power";
-+
- /** @class Host
- * @brief OpenBMC host state management implementation.
- * @details A concrete implementation for xyz.openbmc_project.State.Host
-@@ -59,8 +75,93 @@ class Host : public HostInherit
- sdbusRule::interface("org.freedesktop.systemd1.Manager"),
- std::bind(std::mem_fn(&Host::sysStateChange), this,
- std::placeholders::_1)),
-- settings(bus)
-+ settings(bus),
-+ powerButtonPressedSignal(
-+ bus,
-+ sdbusRule::type::signal() + sdbusRule::member("Pressed") +
-+ sdbusRule::path(powerButtonPath) +
-+ sdbusRule::interface(powerButtonIntf),
-+ [this](sdbusplus::message::message& msg) {
-+ phosphor::logging::log<phosphor::logging::level::INFO>(
-+ "powerButtonPressedSignal callback function is called...");
-+ this->hostRestartCause(this->RestartCause::PowerButton);
-+ this->powerButtonPressed = true;
-+ return;
-+ }),
-+ resetButtonPressedSignal(
-+ bus,
-+ sdbusRule::type::signal() + sdbusRule::member("Pressed") +
-+ sdbusRule::path(resetButtonPath) +
-+ sdbusRule::interface(resetButtonIntf),
-+ [this](sdbusplus::message::message& msg) {
-+ phosphor::logging::log<phosphor::logging::level::INFO>(
-+ "resetButtonPressedSignal callback function is called...");
-+ this->hostRestartCause(this->RestartCause::ResetButton);
-+ this->resetButtonPressed = true;
-+ return;
-+ }),
-+ postCompletePropSignal(
-+ bus,
-+ sdbusplus::bus::match::rules::propertiesChanged(
-+ powerControlPath, powerControlInterface),
-+ [this](sdbusplus::message::message& msg) {
-+ phosphor::logging::log<phosphor::logging::level::INFO>(
-+ "postCompletePropSignal callback function is called...");
-+
-+ using DbusVariant = sdbusplus::message::variant<
-+ std::string, bool, uint8_t, uint16_t, int16_t, uint32_t,
-+ int32_t, uint64_t, int64_t, double>;
-+
-+ std::map<std::string, DbusVariant> props;
-+ std::vector<std::string> inval;
-+ std::string iface;
-+ msg.read(iface, props, inval);
-+
-+ for (const auto& t : props)
-+ {
-+ auto key = t.first;
-+ auto value = t.second;
-+
-+ if (key == "state")
-+ {
-+ this->powerStateChanged = true;
-+ }
-+
-+ else if (key == "pgood")
-+ {
-+ this->pgood =
-+ sdbusplus::message::variant_ns::get<int32_t>(value);
-+ }
-+
-+ else if (key == "post_complete")
-+ {
-+ bool postState =
-+ sdbusplus::message::variant_ns::get<bool>(value);
-+
-+ if (!postState && this->pgood)
-+ {
-+ if (!this->resetButtonPressed &&
-+ !this->powerButtonPressed &&
-+ !this->powerStateChanged)
-+ {
-+ phosphor::logging::log<
-+ phosphor::logging::level::INFO>(
-+ "OEM Reset");
-+ this->hostRestartCause(this->RestartCause::OEM);
-+ }
-+ this->powerButtonPressed = false;
-+ this->powerStateChanged = false;
-+ this->resetButtonPressed = false;
-+ }
-+ }
-+ }
-+ })
- {
-+ powerButtonPressed = false;
-+ powerStateChanged = false;
-+ resetButtonPressed = false;
-+ pgood = 0;
-+
- // Enable systemd signals
- subscribeToSystemdSignals();
-
-@@ -69,8 +170,29 @@ class Host : public HostInherit
-
- attemptsLeft(BOOT_COUNT_MAX_ALLOWED);
-
-+ restoreHostRestartCause(); // restore host restart cause from persisted
-+ // file
-+
- // We deferred this until we could get our property correct
- this->emit_object_added();
-+ sdbusplus::message::variant<int32_t> pgoodProp = -1;
-+ auto method =
-+ this->bus.new_method_call(powerControlService, powerControlPath,
-+ "org.freedesktop.DBus.Properties", "Get");
-+
-+ method.append(powerControlInterface, "pgood");
-+ try
-+ {
-+ auto reply = this->bus.call(method);
-+ reply.read(pgoodProp);
-+ pgood = sdbusplus::message::variant_ns::get<int>(pgoodProp);
-+ }
-+ catch (const sdbusplus::exception::SdBusError& e)
-+ {
-+ log<level::ERR>("Error performing call to get pgood",
-+ entry("NAME=%s", e.name()),
-+ entry("ERROR=%s", e.what()));
-+ }
- }
-
- /** @brief Set value of HostTransition */
-@@ -85,6 +207,9 @@ class Host : public HostInherit
- /** @brief Set value of CurrentHostState */
- HostState currentHostState(HostState value) override;
-
-+ /** @brief Set value of HostRestartCause */
-+ RestartCause hostRestartCause(RestartCause value) override;
-+
- /**
- * @brief Set host reboot count to default
- *
-@@ -192,7 +317,9 @@ class Host : public HostInherit
- server::Progress::bootProgress()),
- convertForMessage(
- sdbusplus::xyz::openbmc_project::State::OperatingSystem::
-- server::Status::operatingSystemState()));
-+ server::Status::operatingSystemState()),
-+ convertForMessage(sdbusplus::xyz::openbmc_project::State::
-+ server::Host::hostRestartCause()));
- }
-
- /** @brief Function required by Cereal to perform deserialization.
-@@ -208,7 +335,8 @@ class Host : public HostInherit
- std::string reqTranState;
- std::string bootProgress;
- std::string osState;
-- archive(reqTranState, bootProgress, osState);
-+ std::string restartCause;
-+ archive(reqTranState, bootProgress, osState, restartCause);
- auto reqTran = Host::convertTransitionFromString(reqTranState);
- // When restoring, set the requested state with persistent value
- // but don't call the override which would execute it
-@@ -219,6 +347,8 @@ class Host : public HostInherit
- sdbusplus::xyz::openbmc_project::State::OperatingSystem::server::
- Status::operatingSystemState(
- Host::convertOSStatusFromString(osState));
-+ sdbusplus::xyz::openbmc_project::State::server::Host::hostRestartCause(
-+ Host::convertRestartCauseFromString(restartCause));
- }
-
- /** @brief Serialize and persist requested host state
-@@ -239,6 +369,9 @@ class Host : public HostInherit
- */
- bool deserialize(const fs::path& path);
-
-+ /** @brief Used to restore HostRestartCause value from persisted file */
-+ void restoreHostRestartCause();
-+
- /** @brief Persistent sdbusplus DBus bus connection. */
- sdbusplus::bus::bus& bus;
-
-@@ -247,6 +380,15 @@ class Host : public HostInherit
-
- // Settings objects of interest
- settings::Objects settings;
-+
-+ bool resetButtonPressed;
-+ bool powerButtonPressed;
-+ bool powerStateChanged;
-+ int32_t pgood;
-+
-+ sdbusplus::bus::match_t powerButtonPressedSignal;
-+ sdbusplus::bus::match_t resetButtonPressedSignal;
-+ sdbusplus::bus::match_t postCompletePropSignal;
- };
-
- } // namespace manager
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch
deleted file mode 100644
index 40722c3c9..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 8a7f73a0688524c71023da89e8cb5578dac16f5d Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Fri, 8 Mar 2019 17:21:49 +0800
-Subject: [PATCH] Use warm-reboot for the Reboot host state transition
-
-The same as reset button pressing, the pgood signal will keep on during the reboot
-
-Tested By:
-ipmitool chassis power reset
-The pgood(gpio219) will be keep high during the reset process
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- host_state_manager.cpp | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/host_state_manager.cpp b/host_state_manager.cpp
-index 03d210d..8fac348 100644
---- a/host_state_manager.cpp
-+++ b/host_state_manager.cpp
-@@ -44,8 +44,9 @@ constexpr auto HOST_STATE_SOFT_POWEROFF_TGT = "obmc-host-shutdown@0.target";
- constexpr auto HOST_STATE_POWEROFF_TGT = "obmc-host-stop@0.target";
- constexpr auto HOST_STATE_POWERON_TGT = "obmc-host-start@0.target";
- constexpr auto HOST_STATE_POWERON_MIN_TGT = "obmc-host-startmin@0.target";
--constexpr auto HOST_STATE_REBOOT_TGT = "obmc-host-reboot@0.target";
-+constexpr auto HOST_STATE_REBOOT_TGT = "obmc-host-warm-reset@0.target";
- constexpr auto HOST_STATE_QUIESCE_TGT = "obmc-host-quiesce@0.target";
-+constexpr auto hostStateRebootService = "intel-power-warm-reset@0.service";
-
- constexpr auto ACTIVE_STATE = "active";
- constexpr auto ACTIVATING_STATE = "activating";
-@@ -168,6 +169,7 @@ bool Host::stateActive(const std::string& target)
-
- const auto& currentStateStr =
- sdbusplus::message::variant_ns::get<std::string>(currentState);
-+
- return currentStateStr == ACTIVE_STATE ||
- currentStateStr == ACTIVATING_STATE;
- }
-@@ -236,18 +238,22 @@ void Host::sysStateChange(sdbusplus::message::message& msg)
- // Read the msg and populate each variable
- msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
-
-- if ((newStateUnit == HOST_STATE_POWEROFF_TGT) &&
-- (newStateResult == "done") &&
-- (!stateActive(HOST_STATE_POWERON_MIN_TGT)))
-+ if (((newStateUnit == HOST_STATE_POWEROFF_TGT) &&
-+ (newStateResult == "done") &&
-+ (!stateActive(HOST_STATE_POWERON_MIN_TGT))) ||
-+ ((newStateUnit == hostStateRebootService) &&
-+ (newStateResult == "done")))
- {
- log<level::INFO>("Received signal that host is off");
- this->currentHostState(server::Host::HostState::Off);
- this->bootProgress(bootprogress::Progress::ProgressStages::Unspecified);
- this->operatingSystemState(osstatus::Status::OSStatus::Inactive);
- }
-- else if ((newStateUnit == HOST_STATE_POWERON_MIN_TGT) &&
-- (newStateResult == "done") &&
-- (stateActive(HOST_STATE_POWERON_MIN_TGT)))
-+ else if (((newStateUnit == HOST_STATE_POWERON_MIN_TGT) &&
-+ (newStateResult == "done") &&
-+ (stateActive(HOST_STATE_POWERON_MIN_TGT))) ||
-+ ((newStateUnit == HOST_STATE_REBOOT_TGT) &&
-+ (newStateResult == "done")))
- {
- log<level::INFO>("Received signal that host is running");
- this->currentHostState(server::Host::HostState::Running);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch
deleted file mode 100644
index 31cb31079..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-From 0edff651156ae63b6a73d9cb81e5e76cc6ae501a Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Fri, 12 Apr 2019 18:43:06 +0800
-Subject: [PATCH] Add Power Restore delay support
-
-That takes effect whenever the BMC
-automatically turns on the system due
-to the Power Restore Policy setting
-
-Tested:
-Set power restore delay:
-ipmitool raw 0x30 0x54 0 7
-Set restore policy as always-on:
-ipmitool chassis policy always-on
-AC off/on, check the journal log, the host will start boot after 7 seconds delay
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- discover_system_state.cpp | 71 +++++++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 68 insertions(+), 3 deletions(-)
-
-diff --git a/discover_system_state.cpp b/discover_system_state.cpp
-index 0b5798a..298ae5b 100644
---- a/discover_system_state.cpp
-+++ b/discover_system_state.cpp
-@@ -1,5 +1,4 @@
- #include <getopt.h>
--#include <iostream>
- #include <map>
- #include <string>
- #include <config.h>
-@@ -114,6 +113,49 @@ void setProperty(sdbusplus::bus::bus& bus, const std::string& path,
- return;
- }
-
-+int getPowerRestoreDelay(sdbusplus::bus::bus& bus, uint16_t& delay)
-+{
-+ static constexpr const char* powerRestoreDelayObjPath =
-+ "/xyz/openbmc_project/control/power_restore_delay";
-+ static constexpr const char* powerRestoreDelayIntf =
-+ "xyz.openbmc_project.Control.Power.RestoreDelay";
-+ static constexpr const char* powerRestoreDelayProp = "PowerRestoreDelay";
-+
-+ std::string service =
-+ getService(bus, powerRestoreDelayObjPath, powerRestoreDelayIntf);
-+
-+ sdbusplus::message::message method = bus.new_method_call(
-+ service.c_str(), powerRestoreDelayObjPath, PROPERTY_INTERFACE, "Get");
-+
-+ method.append(powerRestoreDelayIntf, powerRestoreDelayProp);
-+
-+ try
-+ {
-+ auto reply = bus.call(method);
-+ sdbusplus::message::variant<uint16_t> variant;
-+ reply.read(variant);
-+ delay = sdbusplus::message::variant_ns::get<uint16_t>(variant);
-+ }
-+ catch (sdbusplus::exception_t&)
-+ {
-+ phosphor::logging::log<phosphor::logging::level::ERR>(
-+ "Failed to get property",
-+ phosphor::logging::entry("PROPERTY=%s", powerRestoreDelayProp),
-+ phosphor::logging::entry("PATH=%s", powerRestoreDelayObjPath),
-+ phosphor::logging::entry("INTERFACE=%s", powerRestoreDelayIntf));
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+void applyPowerRestoreDelay(uint16_t delay)
-+{
-+ if (delay > 0)
-+ {
-+ log<level::INFO>("Apply Power Restore Delay", entry("DELAY=%d", delay));
-+ std::this_thread::sleep_for(std::chrono::milliseconds(1000 * delay));
-+ }
-+}
- } // namespace manager
- } // namespace state
- } // namespace phosphor
-@@ -176,13 +218,27 @@ int main(int argc, char** argv)
- log<level::INFO>("Host power is off, checking power policy",
- entry("POWER_POLICY=%s", powerPolicy.c_str()));
-
-+ uint16_t delay = 0;
-+ int ret = getPowerRestoreDelay(bus, delay);
-+
-+ if (ret != 0)
-+ {
-+ log<level::WARNING>("getPowerRestoreDelay failed!");
-+ delay = 0;
-+ }
-+
- if (RestorePolicy::Policy::AlwaysOn ==
- RestorePolicy::convertPolicyFromString(powerPolicy))
- {
-+ applyPowerRestoreDelay(delay);
-+
- log<level::INFO>("power_policy=ALWAYS_POWER_ON, powering host on");
-+
- setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition",
- convertForMessage(server::Host::Transition::On));
-
-+ // Host on, needs to set the restart cause after host transition
-+ // since host transition will change the restart cause
- setProperty(
- bus, hostPath, HOST_BUSNAME, "HostRestartCause",
- convertForMessage(server::Host::RestartCause::PowerPolicyAlwaysOn));
-@@ -195,17 +251,26 @@ int main(int argc, char** argv)
- // Read last requested state and re-request it to execute it
- auto hostReqState =
- getProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition");
-- setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition",
-- hostReqState);
-
- if (server::Host::convertTransitionFromString(hostReqState) ==
- server::Host::Transition::On)
- {
-+ applyPowerRestoreDelay(delay);
-+ setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition",
-+ hostReqState);
-+
-+ // Host on, needs to set the restart cause after host transition
-+ // since host transition will change the restart cause
- setProperty(
- bus, hostPath, HOST_BUSNAME, "HostRestartCause",
- convertForMessage(
- server::Host::RestartCause::PowerPolicyPreviousState));
- }
-+ else
-+ {
-+ setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition",
-+ hostReqState);
-+ }
- }
-
- return 0;
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service
deleted file mode 100644
index ffde01ca3..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service
+++ /dev/null
@@ -1,18 +0,0 @@
-[Unit]
-Description=Reboot host%i
-Wants=obmc-host-stop@%i.target
-After=obmc-host-stop@%i.target
-
-[Service]
-#ExecStart={base_bindir}/systemctl start obmc-host-start@%i.target
-# This service is starting another target that conflicts with the
-# target this service is running in. OpenBMC needs a refactor of
-# how it does its host reset path. Until then, this short term
-# solution does the job.
-# Since this is a part of the reboot target, call the startmin
-# target which does the minimum required to start the host.
-ExecStart=/bin/sh -c "sleep 10 && systemctl start obmc-host-startmin@%i.target"
-
-
-[Install]
-WantedBy=obmc-host-reboot@%i.target
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service
deleted file mode 100644
index 13b8f0fca..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service
+++ /dev/null
@@ -1,19 +0,0 @@
-[Unit]
-Description=Check Host%i status on BMC reset
-Wants=mapper-wait@-xyz-openbmc_project-control-host%i.service
-After=mapper-wait@-xyz-openbmc_project-control-host%i.service
-Wants=obmc-host-reset-running@%i.target
-Before=obmc-host-reset-running@%i.target
-Wants=op-reset-chassis-on@%i.service
-After=op-reset-chassis-on@%i.service
-Conflicts=obmc-host-stop@%i.target
-ConditionPathExists=/run/openbmc/chassis@%i-on
-
-[Service]
-RemainAfterExit=yes
-Type=oneshot
-ExecStart=/bin/sh -c "if [ $(busctl get-property `mapper get-service /xyz/openbmc_project/Chassis/Control/Power%i` /xyz/openbmc_project/Chassis/Control/Power%i xyz.openbmc_project.Chassis.Control.Power vrd_good | sed 's/i\s*[1]/on/' | grep on | wc -l) != 0 ]; then mkdir -p /run/openbmc/ && touch /run/openbmc/host@%i-on; fi"
-SyslogIdentifier=phosphor-host-check
-
-[Install]
-WantedBy=obmc-host-reset@%i.target
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service
deleted file mode 100644
index 87c750c57..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Reset host reboot counter
-Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service
-After=mapper-wait@-xyz-openbmc_project-state-host%i.service
-ConditionPathExists=!/run/openbmc/host@%i-on
-
-[Service]
-Restart=no
-Type=oneshot
-ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host%i` /xyz/openbmc_project/state/host%i xyz.openbmc_project.Control.Boot.RebootAttempts AttemptsLeft u 3"
-StartLimitInterval=0
-
-[Install]
-WantedBy=obmc-host-start@%i.target
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
deleted file mode 100644
index 63155ce0d..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend
+++ /dev/null
@@ -1,10 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://0001-Modify-dbus-interface-for-power-control.patch \
- file://phosphor-reboot-host@.service \
- file://phosphor-reset-host-reboot-attempts@.service \
- file://phosphor-reset-host-check@.service \
- file://0002-Capture-host-restart-cause.patch \
- file://0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch \
- file://0004-Add-Power-Restore-delay-support.patch \
- "
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb
index e272fdc96..e863b14e7 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb
@@ -7,7 +7,7 @@ inherit cmake systemd
DEPENDS = "boost sdbusplus"
PV = "0.1+git${SRCPV}"
-SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b"
+SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab"
S = "${WORKDIR}/git/callback-manager"
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 5c2879d8f..0af64698a 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,4 +1,4 @@
-From 726be648df955f5ae94f34391adc0e88f6956345 Mon Sep 17 00:00:00 2001
+From a519a128b9a44b1798419bf3a653d58e266c60fb 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
@@ -11,20 +11,20 @@ Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.co
---
Makefile.am | 5 +-
mainapp.cpp | 89 ++++++-
- user_mgr.cpp | 293 +++------------------
+ user_mgr.cpp | 290 ++-------------------
user_mgr.hpp | 9 +-
user_service.cpp | 781 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
user_service.hpp | 233 +++++++++++++++++
- 6 files changed, 1141 insertions(+), 269 deletions(-)
+ 6 files changed, 1139 insertions(+), 268 deletions(-)
create mode 100644 user_service.cpp
create mode 100644 user_service.hpp
diff --git a/Makefile.am b/Makefile.am
-index b138aea..288b780 100644
+index 7c7271e..58916b0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,12 @@
- sbin_PROGRAMS = phosphor-user-manager
+ bin_PROGRAMS = phosphor-user-manager
-noinst_HEADERS = user_mgr.hpp users.hpp
+noinst_HEADERS = user_mgr.hpp users.hpp user_service.hpp
@@ -150,7 +150,7 @@ 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 47edf7d..32f3f4c 100644
+index 17146e6..db6e7d5 100644
--- a/user_mgr.cpp
+++ b/user_mgr.cpp
@@ -14,26 +14,20 @@
@@ -540,7 +540,7 @@ index 47edf7d..32f3f4c 100644
}
DbusUserObj UserMgr::getPrivilegeMapperObject(void)
-@@ -1018,11 +784,9 @@ void UserMgr::initUserObjects(void)
+@@ -1052,11 +818,9 @@ void UserMgr::initUserObjects(void)
{
// All user management lock has to be based on /etc/shadow
phosphor::user::shadow::Lock lock();
@@ -554,29 +554,26 @@ index 47edf7d..32f3f4c 100644
if (!userNameList.empty())
{
-@@ -1077,8 +841,10 @@ void UserMgr::initUserObjects(void)
+@@ -1111,7 +875,8 @@ void UserMgr::initUserObjects(void)
}
}
-UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) :
-- UserMgrIface(bus, path), AccountPolicyIface(bus, path), bus(bus), path(path)
+UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path,
+ UserService::ServiceType srvc) :
-+ UserMgrIface(bus, path),
-+ AccountPolicyIface(bus, path), bus(bus), path(path)
+ Ifaces(bus, path, true), bus(bus), path(path)
{
UserMgrIface::allPrivileges(privMgr);
- std::sort(groupsMgr.begin(), groupsMgr.end());
-@@ -1186,6 +952,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) :
+@@ -1220,6 +985,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) :
}
AccountPolicyIface::accountUnlockTimeout(value32);
}
+ userSrvc = std::make_unique<UserService>(srvc, groupsMgr, privMgr);
initUserObjects();
- }
+ // emit the signal
diff --git a/user_mgr.hpp b/user_mgr.hpp
-index c78174d..9d9c842 100644
+index b25e9f2..c24733b 100644
--- a/user_mgr.hpp
+++ b/user_mgr.hpp
@@ -21,6 +21,7 @@
@@ -596,7 +593,7 @@ index c78174d..9d9c842 100644
using AccountPolicyIface =
sdbusplus::xyz::openbmc_project::User::server::AccountPolicy;
-@@ -71,8 +70,10 @@ class UserMgr : public UserMgrIface, AccountPolicyIface
+@@ -76,8 +75,10 @@ class UserMgr : public Ifaces
*
* @param[in] bus - sdbusplus handler
* @param[in] path - D-Bus path
@@ -608,7 +605,7 @@ index c78174d..9d9c842 100644
/** @brief create user method.
* This method creates a new user as requested
-@@ -181,6 +182,8 @@ class UserMgr : public UserMgrIface, AccountPolicyIface
+@@ -186,6 +187,8 @@ class UserMgr : public Ifaces
/** @brief object path */
const std::string path;
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 2cc081433..327be045d 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 = "75b5a6fc4c0c06f43623fe0e746fd55e667dceb3"
+#SRC_URI = "git://github.com/openbmc/phosphor-user-manager;nobranch=1"
+SRCREV = "1af1223304dbf7aaecd5f238227abee95cce8b39"
SRC_URI += " \
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb
new file mode 100644
index 000000000..f50ec86d1
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Virtual Media Service"
+DESCRIPTION = "Virtual Media Service"
+
+SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh;nobranch=1"
+SRCREV = "0de77d616866a6251ce7e36db3285fda76b13873"
+
+S = "${WORKDIR}/git/virtual-media/"
+PV = "1.0+git${SRCPV}"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.VirtualMedia.service"
+
+DEPENDS = "udev boost nlohmann-json systemd sdbusplus"
+
+inherit cmake systemd
+
+EXTRA_OECMAKE += "-DYOCTO_DEPENDENCIES=ON"
+
+FULL_OPTIMIZATION = "-Os -pipe -flto -fno-rtti"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch
deleted file mode 100644
index 28995d14b..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 38faf5c040660e752741dcf7f03e4bb1e9f3411b Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Thu, 4 Apr 2019 18:24:54 +0800
-Subject: [PATCH] Add redfish log support for IPMI watchdog timeout actions
-
-The current plan is that only threshold sensor events
-will be logged to the IPMI SEL,
-and all other events will be logged to the Redfish Event Log.
-
-Tested:
-Config IPMI watchdog: OEM hard reset after 10 seconds:
-ipmitool raw 0x06 0x24 0x5 0x1 0x0 0x0 0x64 0x00
-Start watchdog:
-Ipmitool mc watchdog reset
-Check the redfish logs in 10 seconds:
-https://BMCIP/redfish/v1/Systems/system/LogServices/EventLog/Entries
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- watchdog.cpp | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/watchdog.cpp b/watchdog.cpp
-index bc3ba95..4774fd8 100644
---- a/watchdog.cpp
-+++ b/watchdog.cpp
-@@ -1,5 +1,7 @@
- #include "watchdog.hpp"
-
-+#include <systemd/sd-journal.h>
-+
- #include <chrono>
- #include <phosphor-logging/elog.hpp>
- #include <phosphor-logging/log.hpp>
-@@ -101,6 +103,13 @@ void Watchdog::timeOutHandler()
- action = fallback->action;
- }
-
-+ // Log into redfish event log
-+ sd_journal_send("MESSAGE=IPMIWatchdog: Timed out ACTION=%s",
-+ convertForMessage(action).c_str(), "PRIORITY=%i", LOG_INFO,
-+ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.IPMIWatchdog",
-+ "REDFISH_MESSAGE_ARGS=%s",
-+ convertForMessage(action).c_str(), NULL);
-+
- expiredTimerUse(currentTimerUse());
-
- auto target = actionTargetMap.find(action);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch
new file mode 100644
index 000000000..627dacef1
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch
@@ -0,0 +1,198 @@
+From d15cf914ad51207021451b12863d4b7585f4666c Mon Sep 17 00:00:00 2001
+From: James Feist <james.feist@linux.intel.com>
+Date: Mon, 17 Jun 2019 12:00:58 -0700
+Subject: [PATCH] Move Phosphor-Watchdog to Not Use Service Files
+
+Our power control does not use service files, update it
+so that it calls properties directly.
+
+According to EPS, change the messageArgs in redfish about watchdog
+action and pre-interrupt action.
+
+Tested: used ipmi to create watchdog event and system
+was restarted.
+
+Set a watchdog (Timer action and pre-interrupt action both are none).
+ ipmitool raw 0x06 0x24 0x05 0x00 0x00 0x00 0x30 0x00
+Get the watchdog.
+ ipmitool mc watchdog get
+Start the watchdog.
+ ipmitool mc watchdog reset
+When timer expired, check messageArgs in Redfish with below url:
+https://IP/redfish/v1/Systems/system/LogServices/EventLog/Entries.
+
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+Signed-off-by: Ren Yu <yux.ren@intel.com>
+---
+ watchdog.cpp | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 108 insertions(+), 8 deletions(-)
+
+diff --git a/watchdog.cpp b/watchdog.cpp
+index 9090760..4c8e480 100644
+--- a/watchdog.cpp
++++ b/watchdog.cpp
+@@ -1,11 +1,14 @@
+ #include "watchdog.hpp"
+
++#include <systemd/sd-journal.h>
++
+ #include <algorithm>
+ #include <chrono>
+ #include <phosphor-logging/elog.hpp>
+ #include <phosphor-logging/log.hpp>
+ #include <sdbusplus/exception.hpp>
+ #include <xyz/openbmc_project/Common/error.hpp>
++#include <xyz/openbmc_project/State/Host/server.hpp>
+
+ namespace phosphor
+ {
+@@ -18,10 +21,44 @@ using namespace phosphor::logging;
+ using sdbusplus::exception::SdBusError;
+ using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
+
+-// systemd service to kick start a target.
+-constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
+-constexpr auto SYSTEMD_ROOT = "/org/freedesktop/systemd1";
+-constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
++const static constexpr char* powerActionHardReset =
++ "xyz.openbmc_project.State.Watchdog.Action.HardReset";
++const static constexpr char* powerActionOff =
++ "xyz.openbmc_project.State.Watchdog.Action.PowerOff";
++const static constexpr char* powerActionPowerCycle =
++ "xyz.openbmc_project.State.Watchdog.Action.PowerCycle";
++const static constexpr char* powerActionNone =
++ "xyz.openbmc_project.State.Watchdog.Action.None";
++const static constexpr char* preInterruptNoAction =
++ "xyz.openbmc_project.State.Watchdog.PreTimeoutInterruptAction.None";
++
++const static constexpr char* hardResteDescription =
++ "Hard Reset - System reset due to Watchdog timeout";
++const static constexpr char* powerOffDescription =
++ "Power Down - System power down due to Watchdog timeout";
++const static constexpr char* powerCycleDescription =
++ "Power Cycle - System power cycle due to Watchdog timeout";
++const static constexpr char* timerExpiredDescription = "Timer expired";
++const static constexpr char* preInterruptDescription = "Timer interrupt";
++
++namespace restart
++{
++static constexpr const char* busName = "xyz.openbmc_project.Settings";
++static constexpr const char* path =
++ "/xyz/openbmc_project/control/host0/restart_cause";
++static constexpr const char* interface =
++ "xyz.openbmc_project.Common.RestartCause";
++static constexpr const char* property = "RestartCause";
++} // namespace restart
++
++// chassis state manager service
++namespace chassis
++{
++static constexpr const char* busName = "xyz.openbmc_project.State.Chassis";
++static constexpr const char* path = "/xyz/openbmc_project/state/chassis0";
++static constexpr const char* interface = "xyz.openbmc_project.State.Chassis";
++static constexpr const char* request = "RequestedPowerTransition";
++} // namespace chassis
+
+ void Watchdog::resetTimeRemaining(bool enableWatchdog)
+ {
+@@ -102,12 +139,51 @@ uint64_t Watchdog::interval(uint64_t value)
+ // Optional callback function on timer expiration
+ void Watchdog::timeOutHandler()
+ {
++ PreTimeoutInterruptAction preTimeoutInterruptAction = preTimeoutInterrupt();
+ Action action = expireAction();
++ std::string actionMessageArgs{};
++
+ if (!this->enabled())
+ {
+ action = fallback->action;
+ }
+
++ if (convertForMessage(action) == powerActionHardReset)
++ {
++ actionMessageArgs = hardResteDescription;
++ }
++ else if (convertForMessage(action) == powerActionOff)
++ {
++ actionMessageArgs = powerOffDescription;
++ }
++ else if (convertForMessage(action) == powerActionPowerCycle)
++ {
++ actionMessageArgs = powerCycleDescription;
++ }
++ else if (convertForMessage(action) == powerActionNone)
++ {
++ actionMessageArgs = timerExpiredDescription;
++ }
++ else
++ {
++ actionMessageArgs = "Reserved";
++ }
++
++ // Log into redfish event log
++ sd_journal_send("MESSAGE=IPMIWatchdog: Timed out ACTION=%s",
++ convertForMessage(action).c_str(), "PRIORITY=%i", LOG_INFO,
++ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.IPMIWatchdog",
++ "REDFISH_MESSAGE_ARGS=%s", actionMessageArgs.c_str(), NULL);
++
++ if (preInterruptNoAction != convertForMessage(preTimeoutInterruptAction))
++ {
++ sd_journal_send("MESSAGE=IPMIWatchdog: Pre Timed out Interrupt=%s",
++ convertForMessage(preTimeoutInterruptAction).c_str(),
++ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s",
++ "OpenBMC.0.1.IPMIWatchdog", "REDFISH_MESSAGE_ARGS=%s",
++ preInterruptDescription, NULL);
++ }
++
+ expiredTimerUse(currentTimerUse());
+
+ auto target = actionTargetMap.find(action);
+@@ -128,10 +204,11 @@ void Watchdog::timeOutHandler()
+
+ try
+ {
+- auto method = bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_ROOT,
+- SYSTEMD_INTERFACE, "StartUnit");
+- method.append(target->second);
+- method.append("replace");
++ auto method =
++ bus.new_method_call(chassis::busName, chassis::path,
++ "org.freedesktop.DBus.Properties", "Set");
++ method.append(chassis::interface, chassis::request,
++ std::variant<std::string>(target->second));
+
+ bus.call_noreply(method);
+ }
+@@ -142,6 +219,29 @@ void Watchdog::timeOutHandler()
+ entry("ERROR=%s", e.what()));
+ commit<InternalFailure>();
+ }
++
++ // set restart cause for watchdog HardReset & PowerCycle actions
++ if ((action == Watchdog::Action::HardReset) ||
++ (action == Watchdog::Action::PowerCycle))
++ {
++ try
++ {
++ auto method = bus.new_method_call(
++ restart::busName, restart::path,
++ "org.freedesktop.DBus.Properties", "Set");
++ method.append(
++ restart::interface, restart::property,
++ std::variant<std::string>("xyz.openbmc_project.State.Host."
++ "RestartCause.WatchdogTimer"));
++ bus.call(method);
++ }
++ catch (sdbusplus::exception_t& e)
++ {
++ log<level::ERR>("Failed to set HostRestartCause property",
++ entry("ERROR=%s", e.what()));
++ commit<InternalFailure>();
++ }
++ }
+ }
+
+ tryFallbackOrDisable();
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch
deleted file mode 100644
index 05374e9db..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From af3a7d07b801c22a03350897c2186b1ee9507ff2 Mon Sep 17 00:00:00 2001
-From: Yong Li <yong.b.li@linux.intel.com>
-Date: Sun, 14 Apr 2019 11:14:09 +0800
-Subject: [PATCH] Add restart cause support
-
-Add restart cause support for watchdog expiration, to support
-Get system restart cause command defined in IPMI spec
-
-Tested:
-Set a hard reset watchdog:
-ipmitool raw 0x06 0x24 0x5 0x1 0x0 0x0 0x64 0x00
-
-Start the timer:
-ipmitool mc watchdog reset
-
-Wait for 10 seconds, host will be restart, query the restart cause:
-Ipmitool chassis restart_cause
-System restart cause: watchdog expired
-
-Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
----
- watchdog.cpp | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
-
-diff --git a/watchdog.cpp b/watchdog.cpp
-index 008cde5..7f1ec05 100644
---- a/watchdog.cpp
-+++ b/watchdog.cpp
-@@ -7,6 +7,7 @@
- #include <phosphor-logging/log.hpp>
- #include <sdbusplus/exception.hpp>
- #include <xyz/openbmc_project/Common/error.hpp>
-+#include <xyz/openbmc_project/State/Host/server.hpp>
-
- namespace phosphor
- {
-@@ -24,6 +25,12 @@ constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
- constexpr auto SYSTEMD_ROOT = "/org/freedesktop/systemd1";
- constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
-
-+// host state manager service
-+static constexpr const char* hostService = "xyz.openbmc_project.State.Host";
-+static constexpr const char* hostPath = "/xyz/openbmc_project/state/host0";
-+static constexpr const char* hostInterface = "xyz.openbmc_project.State.Host";
-+static constexpr const char* dbusPropIf = "org.freedesktop.DBus.Properties";
-+
- void Watchdog::resetTimeRemaining(bool enableWatchdog)
- {
- timeRemaining(interval());
-@@ -139,6 +146,29 @@ void Watchdog::timeOutHandler()
- entry("ERROR=%s", e.what()));
- commit<InternalFailure>();
- }
-+
-+ // set restart cause for watchdog HardReset & PowerCycle actions
-+ if ((action == Watchdog::Action::HardReset) ||
-+ (action == Watchdog::Action::PowerCycle))
-+ {
-+ sdbusplus::message::variant<std::string> property =
-+ convertForMessage(
-+ (sdbusplus::xyz::openbmc_project::State::server::Host::
-+ RestartCause::WatchdogTimer));
-+ try
-+ {
-+ auto method = bus.new_method_call(hostService, hostPath,
-+ dbusPropIf, "Set");
-+ method.append(hostInterface, "HostRestartCause", property);
-+ bus.call(method);
-+ }
-+ catch (sdbusplus::exception_t& e)
-+ {
-+ log<level::ERR>("Failed to set HostRestartCause property",
-+ entry("ERROR=%s", e.what()));
-+ commit<InternalFailure>();
-+ }
-+ }
- }
-
- tryFallbackOrDisable();
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch
new file mode 100644
index 000000000..016cf063a
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch
@@ -0,0 +1,118 @@
+From b05da90d7023199e23daf8fbb49455138332f241 Mon Sep 17 00:00:00 2001
+From: Ren Yu <yux.ren@intel.com>
+Date: Wed, 24 Jul 2019 16:21:13 +0800
+Subject: [PATCH] Stop the watchdog when the host is going to off
+
+After the host is off, check the WDT status, if it is running,
+needs to stop it
+
+Tested:
+Set a watchdog with a long time expiration(Timer action is none,
+Timer Use is OEM and Initial Countdown is 435.1 second).
+ ipmitool raw 0x06 0x24 0x05 0x00 0x00 0x00 0xff 0x10
+Get the watchdog.
+ ipmitool mc watchdog get
+Start the watchdog.
+ ipmitool mc watchdog reset
+Host off.
+ ipmitool chassis power off
+Get the watchdog.
+ ipmitool mc watchdog get
+Check the watchdog status, expect watchdog is stoped.
+
+Signed-off-by: Ren Yu <yux.ren@intel.com>
+---
+ watchdog.cpp | 21 +++++++++++++++++++++
+ watchdog.hpp | 23 ++++++++++++++++++++++-
+ 2 files changed, 43 insertions(+), 1 deletion(-)
+
+diff --git a/watchdog.cpp b/watchdog.cpp
+index 4c8e480..fa58ef4 100644
+--- a/watchdog.cpp
++++ b/watchdog.cpp
+@@ -21,6 +21,10 @@ using namespace phosphor::logging;
+ using sdbusplus::exception::SdBusError;
+ using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
+
++const static constexpr char* currentPowerState = "CurrentPowerState";
++const static constexpr char* powerStatusOff =
++ "xyz.openbmc_project.State.Chassis.PowerState.Off";
++
+ const static constexpr char* powerActionHardReset =
+ "xyz.openbmc_project.State.Watchdog.Action.HardReset";
+ const static constexpr char* powerActionOff =
+@@ -60,6 +64,23 @@ static constexpr const char* interface = "xyz.openbmc_project.State.Chassis";
+ static constexpr const char* request = "RequestedPowerTransition";
+ } // namespace chassis
+
++void Watchdog::powerStateChangedHandler(
++ const std::map<std::string, std::variant<std::string>>& props)
++{
++ const auto iter = props.find(currentPowerState);
++ if (iter != props.end())
++ {
++ const std::string* powerState = std::get_if<std::string>(&iter->second);
++ if (powerState && (*powerState == powerStatusOff))
++ {
++ if (timerEnabled())
++ {
++ enabled(false);
++ }
++ }
++ }
++}
++
+ void Watchdog::resetTimeRemaining(bool enableWatchdog)
+ {
+ timeRemaining(interval());
+diff --git a/watchdog.hpp b/watchdog.hpp
+index 7de9bb3..dcbecd1 100644
+--- a/watchdog.hpp
++++ b/watchdog.hpp
+@@ -68,7 +68,18 @@ class Watchdog : public WatchdogInherits
+ WatchdogInherits(bus, objPath),
+ bus(bus), actionTargetMap(std::move(actionTargetMap)),
+ fallback(std::move(fallback)), minInterval(minInterval),
+- timer(event, std::bind(&Watchdog::timeOutHandler, this))
++ timer(event, std::bind(&Watchdog::timeOutHandler, this)),
++ powerStateChangedSignal(
++ bus,
++ sdbusplus::bus::match::rules::propertiesChanged(
++ "/xyz/openbmc_project/state/chassis0",
++ "xyz.openbmc_project.State.Chassis"),
++ [this](sdbusplus::message::message& msg) {
++ std::string objectName;
++ std::map<std::string, std::variant<std::string>> props;
++ msg.read(objectName, props);
++ powerStateChangedHandler(props);
++ })
+ {
+ // We set the watchdog interval with the default value.
+ interval(interval());
+@@ -77,6 +88,12 @@ class Watchdog : public WatchdogInherits
+ tryFallbackOrDisable();
+ }
+
++ /** @brief Disable watchdog when power status change meet
++ * the specific requirement
++ */
++ void powerStateChangedHandler(
++ const std::map<std::string, std::variant<std::string>>& props);
++
+ /** @brief Resets the TimeRemaining to the configured Interval
+ * Optionally enables the watchdog.
+ *
+@@ -165,6 +182,10 @@ class Watchdog : public WatchdogInherits
+ /** @brief Contained timer object */
+ sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer;
+
++ /** @brief Optional Callback handler when power status change meet
++ * the specific requirement */
++ sdbusplus::bus::match_t powerStateChangedSignal;
++
+ /** @brief Optional Callback handler on timer expirartion */
+ void timeOutHandler();
+
+--
+2.7.4
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch
deleted file mode 100644
index 309a8c646..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 46e8e4fe6cb48145152e37380a4064c8957d2ff7 Mon Sep 17 00:00:00 2001
-From: Ren Yu <yux.ren@intel.com>
-Date: Tue, 28 May 2019 17:04:10 +0800
-Subject: [PATCH] Add redfish log support for IPMI watchdog pre-timeout
- interrupt
-
-Tested:
-Config IPMI watchdog: BIOS FRB2 Power Cycle after 1 seconds:
-ipmitool raw 0x06 0x24 0x01 0x13 0x0 0x2 0xa 0x00
-Start watchdog:
-Ipmitool mc watchdog reset
-Check the redfish logs in 1 seconds:
-https://BMCIP/redfish/v1/Systems/system/LogServices/EventLog/Entries
-
-Signed-off-by: Ren Yu <yux.ren@intel.com>
----
- watchdog.cpp | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/watchdog.cpp b/watchdog.cpp
-index d893237..5062049 100644
---- a/watchdog.cpp
-+++ b/watchdog.cpp
-@@ -104,6 +104,8 @@ uint64_t Watchdog::timeRemaining(uint64_t value)
- // Optional callback function on timer expiration
- void Watchdog::timeOutHandler()
- {
-+ PreTimeoutInterruptAction preTimeoutInterruptAction = preTimeoutInterrupt();
-+
- Action action = expireAction();
- if (!this->enabled())
- {
-@@ -117,6 +119,12 @@ void Watchdog::timeOutHandler()
- "REDFISH_MESSAGE_ARGS=%s",
- convertForMessage(action).c_str(), NULL);
-
-+ sd_journal_send("MESSAGE=IPMIWatchdog: Pre Timed out Interrupt=%s",
-+ convertForMessage(preTimeoutInterruptAction).c_str(),
-+ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s",
-+ "OpenBMC.0.1.IPMIWatchdog", "REDFISH_MESSAGE_ARGS=%s",
-+ convertForMessage(preTimeoutInterruptAction).c_str(), NULL);
-+
- expiredTimerUse(currentTimerUse());
-
- auto target = actionTargetMap.find(action);
---
-2.7.4
-
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service
deleted file mode 100644
index 87a662f7c..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Start FRB2 Watchdog%i
-Wants=obmc-host-started@%i.target
-After=obmc-host-started@%i.target
-Wants=mapper-wait@-xyz-openbmc_project-watchdog-host%i.service
-After=mapper-wait@-xyz-openbmc_project-watchdog-host%i.service
-Conflicts=obmc-host-stop@%i.target
-ConditionPathExists=!/run/openbmc/host@%i-on
-
-[Service]
-Restart=always
-ExecStart=/usr/bin/env frb2-watchdog
-ExecStopPost=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/watchdog/host%i` /xyz/openbmc_project/watchdog/host%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.State.Watchdog Enabled b false"
-SyslogIdentifier=obmc-enable-host-watchdog
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service
new file mode 100644
index 000000000..5ef1a4179
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Phosphor Watchdog
+
+[Service]
+ExecStart=/usr/bin/env phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog \
+ --path=/xyz/openbmc_project/watchdog/host0 \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=xyz.openbmc_project.State.Chassis.Transition.Reset \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=xyz.openbmc_project.State.Chassis.Transition.Off \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=xyz.openbmc_project.State.Chassis.Transition.PowerCycle
+
+SyslogIdentifier=phosphor-watchdog
+BusName =xyz.openbmc_project.Watchdog
+Type=dbus
+
+[Install]
+WantedBy=basic.target
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service
deleted file mode 100644
index 251c2257b..000000000
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Phosphor %I watchdog
-
-[Service]
-Restart=no
-EnvironmentFile={envfiledir}/obmc/watchdog/%I
-ExecStart=/usr/bin/env phosphor-watchdog --continue --service=${{SERVICE}} --path=${{DEVPATH}} \
- --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=obmc-host-warm-reset@0.target \
- --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=obmc-host-shutdown@0.target \
- --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=obmc-host-reboot@0.target
-
-SyslogIdentifier=phosphor-watchdog
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 c117102ee..caaca2670 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,9 +1,10 @@
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-SRC_URI += "file://0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch \
- file://0002-Add-restart-cause-support.patch \
- file://0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch \
+SRCREV = "c35135d32f9cb84b62de7b72eee3a2e87b4b3d4d"
+SRC_URI += "file://0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch \
+ file://0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch \
"
# Remove the override to keep service running after DC cycle
SYSTEMD_OVERRIDE_${PN}_remove = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf"
+SYSTEMD_SERVICE_${PN} = "phosphor-watchdog.service"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend
index f4b054acf..97270e982 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend
@@ -1,6 +1,6 @@
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
#SRC_URI = "git://github.com/openbmc/phosphor-webui.git"
-SRCREV = "e4ae854c217344b4f35717e922083a253f43bfa0"
+SRCREV = "ae0353989abe7d9194dba47ca26d803fe11f46b6"
SRC_URI += "file://0004-Implement-force-boot-to-bios-in-server-power-control.patch"
diff --git a/meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod/0001-Add-pass-through-setting-in-gpioset.patch b/meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod/0001-Add-pass-through-setting-in-gpioset.patch
deleted file mode 100644
index b9082468c..000000000
--- a/meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod/0001-Add-pass-through-setting-in-gpioset.patch
+++ /dev/null
@@ -1,266 +0,0 @@
-From 0c393ec7a71f21506334caa3a321fa013a9723ef Mon Sep 17 00:00:00 2001
-From: Ed Tanous <ed.tanous@intel.com>
-Date: Mon, 8 Apr 2019 11:46:09 -0700
-Subject: [PATCH] [PATCH] Add pass through setting in gpioset
-
-Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
-Signed-off-by: Ed Tanous <ed.tanous@intel.com>
----
- aclocal.m4 | 2 +-
- configure | 2 +-
- include/gpiod.h | 10 ++++++++--
- lib/core.c | 13 +++++++------
- lib/ctxless.c | 8 +++++---
- lib/helpers.c | 3 ++-
- tests/tests-ctxless.c | 2 +-
- tools/gpioset.c | 13 +++++++++----
- 8 files changed, 34 insertions(+), 19 deletions(-)
-
-diff --git a/aclocal.m4 b/aclocal.m4
-index b0db596..a5e28ad 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -911,7 +911,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
- # generated from the m4 files accompanying Automake X.Y.
- # (This private macro should not be called outside this file.)
- AC_DEFUN([AM_AUTOMAKE_VERSION],
--[am__api_version='1.15'
-+[am__api_version='1.16'
- dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
- dnl require some minimum version. Point them to the right macro.
- m4_if([$1], [1.15], [],
-diff --git a/configure b/configure
-index f5a0a23..c0cdbf1 100755
---- a/configure
-+++ b/configure
-@@ -2484,7 +2484,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
--am__api_version='1.15'
-+am__api_version='1.16'
-
- # Find a good install program. We prefer a C program (faster),
- # so one script is as good as another. But avoid the broken or
-diff --git a/include/gpiod.h b/include/gpiod.h
-index 2679478..7b5c186 100644
---- a/include/gpiod.h
-+++ b/include/gpiod.h
-@@ -121,6 +121,7 @@ typedef void (*gpiod_ctxless_set_value_cb)(void *);
- * @param offset The offset of the GPIO line.
- * @param value New value (0 or 1).
- * @param active_low The active state of this line - true if low.
-+ * @param pass_through The pass-through state of the lines - true if enabled.
- * @param consumer Name of the consumer.
- * @param cb Optional callback function that will be called right after setting
- * the value. Users can use this, for example, to pause the execution
-@@ -129,7 +130,7 @@ typedef void (*gpiod_ctxless_set_value_cb)(void *);
- * @return 0 if the operation succeeds, -1 on error.
- */
- int gpiod_ctxless_set_value(const char *device, unsigned int offset, int value,
-- bool active_low, const char *consumer,
-+ bool active_low, bool pass_through, const char *consumer,
- gpiod_ctxless_set_value_cb cb,
- void *data) GPIOD_API;
-
-@@ -140,6 +141,7 @@ int gpiod_ctxless_set_value(const char *device, unsigned int offset, int value,
- * @param values Array of integers containing new values.
- * @param num_lines Number of lines, must be > 0.
- * @param active_low The active state of the lines - true if low.
-+ * @param pass_through The pass-through state of the lines - true if enabled.
- * @param consumer Name of the consumer.
- * @param cb Optional callback function that will be called right after setting
- * all values. Works the same as in ::gpiod_ctxless_set_value.
-@@ -149,7 +151,7 @@ int gpiod_ctxless_set_value(const char *device, unsigned int offset, int value,
- int gpiod_ctxless_set_value_multiple(const char *device,
- const unsigned int *offsets,
- const int *values, unsigned int num_lines,
-- bool active_low, const char *consumer,
-+ bool active_low, bool pass_through, const char *consumer,
- gpiod_ctxless_set_value_cb cb,
- void *data) GPIOD_API;
-
-@@ -766,6 +768,8 @@ enum {
- /**< Request the line(s) for reading the GPIO line state. */
- GPIOD_LINE_REQUEST_DIRECTION_OUTPUT,
- /**< Request the line(s) for setting the GPIO line state. */
-+ GPIOD_LINE_REQUEST_DIRECTION_PASS_THROUGH,
-+ /**< Request the line(s) for setting the GPIO line state. */
- GPIOD_LINE_REQUEST_EVENT_FALLING_EDGE,
- /**< Monitor both types of events. */
- GPIOD_LINE_REQUEST_EVENT_RISING_EDGE,
-@@ -784,6 +788,8 @@ enum {
- /**< The line is an open-source port. */
- GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW = GPIOD_BIT(2),
- /**< The active state of the line is low (high is the default). */
-+ GPIOD_LINE_REQUEST_FLAG_PASS_THROUGH = GPIOD_BIT(5),
-+ /**< The line is a pass-through port*/
- };
-
- /**
-diff --git a/lib/core.c b/lib/core.c
-index 05e5a46..635569c 100644
---- a/lib/core.c
-+++ b/lib/core.c
-@@ -470,7 +470,6 @@ static int line_request_values(struct gpiod_line_bulk *bulk,
- struct gpiohandle_request req;
- unsigned int i;
- int rv, fd;
--
- if ((config->request_type != GPIOD_LINE_REQUEST_DIRECTION_OUTPUT) &&
- (config->flags & (GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN |
- GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE))) {
-@@ -497,14 +496,15 @@ static int line_request_values(struct gpiod_line_bulk *bulk,
- req.flags |= GPIOHANDLE_REQUEST_INPUT;
- else if (config->request_type == GPIOD_LINE_REQUEST_DIRECTION_OUTPUT)
- req.flags |= GPIOHANDLE_REQUEST_OUTPUT;
--
-+ else if (config->request_type == GPIOD_LINE_REQUEST_DIRECTION_PASS_THROUGH)
-+ req.flags |= GPIOHANDLE_REQUEST_PASS_THROUGH;
- req.lines = gpiod_line_bulk_num_lines(bulk);
-
- gpiod_line_bulk_foreach_line_off(bulk, line, i) {
- req.lineoffsets[i] = gpiod_line_offset(line);
-- if (config->request_type ==
-- GPIOD_LINE_REQUEST_DIRECTION_OUTPUT &&
-- default_vals)
-+ if ((config->request_type == GPIOD_LINE_REQUEST_DIRECTION_OUTPUT ||
-+ config->request_type == GPIOD_LINE_REQUEST_DIRECTION_PASS_THROUGH)&&
-+ default_vals)
- req.default_values[i] = !!default_vals[i];
- }
-
-@@ -615,7 +615,8 @@ static bool line_request_is_direction(int request)
- {
- return request == GPIOD_LINE_REQUEST_DIRECTION_AS_IS ||
- request == GPIOD_LINE_REQUEST_DIRECTION_INPUT ||
-- request == GPIOD_LINE_REQUEST_DIRECTION_OUTPUT;
-+ request == GPIOD_LINE_REQUEST_DIRECTION_OUTPUT ||
-+ request == GPIOD_LINE_REQUEST_DIRECTION_PASS_THROUGH;
- }
-
- static bool line_request_is_events(int request)
-diff --git a/lib/ctxless.c b/lib/ctxless.c
-index ba85018..88b0388 100644
---- a/lib/ctxless.c
-+++ b/lib/ctxless.c
-@@ -76,17 +76,17 @@ int gpiod_ctxless_get_value_multiple(const char *device,
- }
-
- int gpiod_ctxless_set_value(const char *device, unsigned int offset, int value,
-- bool active_low, const char *consumer,
-+ bool active_low, bool pass_through, const char *consumer,
- gpiod_ctxless_set_value_cb cb, void *data)
- {
- return gpiod_ctxless_set_value_multiple(device, &offset, &value, 1,
-- active_low, consumer, cb, data);
-+ active_low, pass_through, consumer, cb, data);
- }
-
- int gpiod_ctxless_set_value_multiple(const char *device,
- const unsigned int *offsets,
- const int *values, unsigned int num_lines,
-- bool active_low, const char *consumer,
-+ bool active_low, bool pass_through, const char *consumer,
- gpiod_ctxless_set_value_cb cb, void *data)
- {
- struct gpiod_line_bulk bulk;
-@@ -118,6 +118,8 @@ int gpiod_ctxless_set_value_multiple(const char *device,
-
- flags = active_low ? GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW : 0;
-
-+ flags |= pass_through ? GPIOD_LINE_REQUEST_FLAG_PASS_THROUGH : 0;
-+
- rv = gpiod_line_request_bulk_output_flags(&bulk, consumer,
- flags, values);
- if (rv < 0) {
-diff --git a/lib/helpers.c b/lib/helpers.c
-index 479f370..7b2884f 100644
---- a/lib/helpers.c
-+++ b/lib/helpers.c
-@@ -360,7 +360,8 @@ int gpiod_line_request_bulk_output_flags(struct gpiod_line_bulk *bulk,
- .request_type = GPIOD_LINE_REQUEST_DIRECTION_OUTPUT,
- .flags = flags,
- };
--
-+ if (flags & GPIOD_LINE_REQUEST_FLAG_PASS_THROUGH)
-+ config.request_type = GPIOD_LINE_REQUEST_DIRECTION_PASS_THROUGH;
- return gpiod_line_request_bulk(bulk, &config, default_vals);
- }
-
-diff --git a/tests/tests-ctxless.c b/tests/tests-ctxless.c
-index 638274f..b215f9c 100644
---- a/tests/tests-ctxless.c
-+++ b/tests/tests-ctxless.c
-@@ -20,7 +20,7 @@ static void ctxless_set_get_value(void)
- TEST_ASSERT_EQ(rv, 0);
-
- rv = gpiod_ctxless_set_value(test_chip_name(0), 3, 1,
-- false, TEST_CONSUMER, NULL, NULL);
-+ false, false, TEST_CONSUMER, NULL, NULL);
- TEST_ASSERT_RET_OK(rv);
-
- rv = gpiod_ctxless_get_value(test_chip_name(0), 3,
-diff --git a/tools/gpioset.c b/tools/gpioset.c
-index d9977a7..094d609 100644
---- a/tools/gpioset.c
-+++ b/tools/gpioset.c
-@@ -22,7 +22,8 @@
- static const struct option longopts[] = {
- { "help", no_argument, NULL, 'h' },
- { "version", no_argument, NULL, 'v' },
-- { "active-low", no_argument, NULL, 'l' },
-+ { "active-low", no_argument, NULL, 'l' },
-+ { "pass-through", no_argument, NULL, 'p' },
- { "mode", required_argument, NULL, 'm' },
- { "sec", required_argument, NULL, 's' },
- { "usec", required_argument, NULL, 'u' },
-@@ -30,7 +31,7 @@ static const struct option longopts[] = {
- { GETOPT_NULL_LONGOPT },
- };
-
--static const char *const shortopts = "+hvlm:s:u:b";
-+static const char *const shortopts = "+hvlpm:s:u:b";
-
- static void print_help(void)
- {
-@@ -40,8 +41,9 @@ static void print_help(void)
- printf("\n");
- printf("Options:\n");
- printf(" -h, --help:\t\tdisplay this message and exit\n");
-- printf(" -v, --version:\tdisplay the version and exit\n");
- printf(" -l, --active-low:\tset the line active state to low\n");
-+ printf(" -v, --version:\tdisplay the version and exit\n");
-+ printf(" -p, --pass-through:\tset it to pass through mode\n");
- printf(" -m, --mode=[exit|wait|time|signal] (defaults to 'exit'):\n");
- printf(" tell the program what to do after setting values\n");
- printf(" -s, --sec=SEC:\tspecify the number of seconds to wait (only valid for --mode=time)\n");
-@@ -185,6 +187,7 @@ int main(int argc, char **argv)
- int *values, rv, optc, opti;
- struct callback_data cbdata;
- bool active_low = false;
-+ bool pass_through = false;
- char *device, *end;
-
- memset(&cbdata, 0, sizeof(cbdata));
-@@ -203,6 +206,8 @@ int main(int argc, char **argv)
- return EXIT_SUCCESS;
- case 'l':
- active_low = true;
-+ case 'p':
-+ pass_through = true;
- break;
- case 'm':
- mode = parse_mode(optarg);
-@@ -269,7 +274,7 @@ int main(int argc, char **argv)
- }
-
- rv = gpiod_ctxless_set_value_multiple(device, offsets, values,
-- num_lines, active_low, "gpioset",
-+ num_lines, active_low, pass_through, "gpioset",
- mode->callback, &cbdata);
- if (rv < 0)
- die_perror("error setting the GPIO line values");
---
-2.17.1
-
diff --git a/meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod_%.bbappend b/meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod_%.bbappend
deleted file mode 100644
index 5c3c24ec5..000000000
--- a/meta-openbmc-mods/meta-common/recipes-support/libgpiod/libgpiod_%.bbappend
+++ /dev/null
@@ -1,7 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-PACKAGECONFIG += " cxx"
-
-SRC_URI += " \
- file://0001-Add-pass-through-setting-in-gpioset.patch \
- "
diff --git a/meta-openbmc-mods/meta-wht/conf/conf-notes.txt b/meta-openbmc-mods/meta-wht/conf/conf-notes.txt
index 558487db6..91059a72d 100644
--- a/meta-openbmc-mods/meta-wht/conf/conf-notes.txt
+++ b/meta-openbmc-mods/meta-wht/conf/conf-notes.txt
@@ -1,5 +1,6 @@
Common targets are:
intel-platforms
obmc-phosphor-image
+ qemu-helper-native
virtual/kernel
phosphor-ipmi-host
diff --git a/meta-openbmc-mods/meta-wht/conf/layer.conf b/meta-openbmc-mods/meta-wht/conf/layer.conf
index 99d7ee689..7f5bc8fa8 100644
--- a/meta-openbmc-mods/meta-wht/conf/layer.conf
+++ b/meta-openbmc-mods/meta-wht/conf/layer.conf
@@ -1,4 +1,4 @@
-LOCALCONF_VERSION = "3"
+LOCALCONF_VERSION = "4"
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
@@ -11,4 +11,4 @@ BBFILE_PATTERN_wht = ""
BBFILE_PRIORITY_wht = "7"
LAYERSERIES_COMPAT_wht = "warrior"
-PRODUCT_GENERATION_pn-os-release = "wht"
+PRODUCT_GENERATION = "wht" \ No newline at end of file
diff --git a/meta-openbmc-mods/meta-wht/conf/local.conf.sample b/meta-openbmc-mods/meta-wht/conf/local.conf.sample
index 31b18a76e..f92bf8b33 100644
--- a/meta-openbmc-mods/meta-wht/conf/local.conf.sample
+++ b/meta-openbmc-mods/meta-wht/conf/local.conf.sample
@@ -7,6 +7,12 @@ SANITY_TESTED_DISTROS_append ?= " RedHatEnterpriseWorkstation-6.*"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
+
+# PFR image Build
+# Before exporting the conf, please uncomment the below line
+# for building Intel PFR compliant images.
+#IMAGE_FSTYPES += "intel-pfr"
+
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
@@ -16,5 +22,8 @@ BB_DISKMON_DIRS = "\
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
-CONF_VERSION = "3"
+CONF_VERSION = "4"
#BB_NUMBER_THREADS = "70"
+
+FULL_OPTIMIZATION = "-Os -pipe ${DEBUG_FLAGS}"
+require conf/distro/include/security_flags.inc
diff --git a/meta-openbmc-mods/meta-wolfpass/conf/conf-notes.txt b/meta-openbmc-mods/meta-wolfpass/conf/conf-notes.txt
index 558487db6..91059a72d 100644
--- a/meta-openbmc-mods/meta-wolfpass/conf/conf-notes.txt
+++ b/meta-openbmc-mods/meta-wolfpass/conf/conf-notes.txt
@@ -1,5 +1,6 @@
Common targets are:
intel-platforms
obmc-phosphor-image
+ qemu-helper-native
virtual/kernel
phosphor-ipmi-host
diff --git a/meta-openbmc-mods/meta-wolfpass/conf/layer.conf b/meta-openbmc-mods/meta-wolfpass/conf/layer.conf
index 711850f6d..db27b43dc 100644
--- a/meta-openbmc-mods/meta-wolfpass/conf/layer.conf
+++ b/meta-openbmc-mods/meta-wolfpass/conf/layer.conf
@@ -11,4 +11,4 @@ BBFILE_PATTERN_wolfpass = ""
BBFILE_PRIORITY_wolfpass = "7"
LAYERSERIES_COMPAT_wolfpass = "warrior"
-PRODUCT_GENERATION_pn-os-release = "prl"
+PRODUCT_GENERATION = "prl"
diff --git a/meta-openbmc-mods/meta-wolfpass/conf/local.conf.sample b/meta-openbmc-mods/meta-wolfpass/conf/local.conf.sample
index 31b18a76e..0d8c780f3 100644
--- a/meta-openbmc-mods/meta-wolfpass/conf/local.conf.sample
+++ b/meta-openbmc-mods/meta-wolfpass/conf/local.conf.sample
@@ -18,3 +18,6 @@ BB_DISKMON_DIRS = "\
ABORT,/tmp,10M,1K"
CONF_VERSION = "3"
#BB_NUMBER_THREADS = "70"
+
+FULL_OPTIMIZATION = "-Os -pipe ${DEBUG_FLAGS}"
+require conf/distro/include/security_flags.inc