Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+175
View File
@@ -0,0 +1,175 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
+12
View File
@@ -0,0 +1,12 @@
Different components of meta-quanta are under different licenses (a mix
of MIT and Apache-2.0). Please see:
COPYING.Apache-2.0
COPYING.MIT (MIT)
All metadata is MIT licensed unless otherwise stated. Source code
included in tree for individual recipes is under the LICENSE stated in
the associated recipe (.bb file) unless otherwise stated.
License information for any other files is either explicitly stated
or defaults to Apache-2.0.
+5
View File
@@ -0,0 +1,5 @@
owners:
- benjaminfair@google.com
- brandonkim@google.com
- fran.hsu@quantatw.com
- george.hung@quantatw.com
+11
View File
@@ -0,0 +1,11 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/meta-common/recipes-*/*/*.bb \
${LAYERDIR}/meta-common/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "quanta-layer"
BBFILE_PATTERN_quanta-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_quanta-layer = "langdale mickledore"
LAYERDEPENDS_quanta-layer = "phosphor-layer"
@@ -0,0 +1,15 @@
{
"CPU" : {
"Frequency" : 1,
"Window_size": 120
},
"Memory" : {
"Frequency" : 1,
"Window_size": 120
},
"Storage_RW" : {
"Path" : "/run/initramfs/rw",
"Frequency" : 1,
"Window_size": 120
}
}
@@ -0,0 +1,3 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI:append = " file://bmc_health_config.json \
"
@@ -0,0 +1,25 @@
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
SRC_URI = "git://github.com/quanta-bmc/read-margin-temp.git;branch=master;protocol=https"
SRCREV = "7a9eec77ec9b90eb5ec5de294f3d9a0363193ef8"
S = "${WORKDIR}/git"
inherit autotools pkgconfig
inherit meson
DEPENDS += " nlohmann-json"
DEPENDS += " sdbusplus"
DEPENDS += " sdeventplus"
DEPENDS += " phosphor-dbus-interfaces"
RDEPENDS:${PN} += " bash"
FILES:${PN} = "${bindir}/read-margin-temp"
do_install() {
install -d ${D}${bindir}
install -m 0755 read-margin-temp ${D}${bindir}
}
@@ -0,0 +1,21 @@
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
inherit cmake pkgconfig
inherit systemd
RDEPENDS:${PN} += " bash"
S = "${WORKDIR}/git"
SRC_URI = "git://github.com/quanta-bmc/mac-address.git;protocol=https;branch=master"
SRCREV = "93756c78539160a7c15e02c7c3ecf2d6941d56af"
DEPENDS += "systemd"
FILES:${PN} += "${bindir}/mac-address"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "mac-address.service"
EXTRA_OECMAKE:append = " \
-DENABLE_TEST=OFF \
"
@@ -0,0 +1,25 @@
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
SRC_URI:append = " file://usb-network.sh"
SRC_URI:append = " file://usb-network.service"
inherit systemd
DEPENDS += "systemd"
RDEPENDS:${PN} += "libsystemd"
RDEPENDS:${PN} += "bash"
FILES:${PN}:append = " ${sysconfdir_native}/systemd/network/00-bmc-usb0.network"
do_install() {
install -d ${D}/${sbindir}
install -m 0755 ${WORKDIR}/usb-network.sh ${D}/${sbindir}
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/usb-network.service \
${D}${systemd_unitdir}/system
}
SYSTEMD_SERVICE:${PN}:append = "usb-network.service"
@@ -0,0 +1,10 @@
[Unit]
Description=Enable USB Network
[Service]
Type=oneshot
ExecStart=/usr/sbin/usb-network.sh
EnvironmentFile=/usr/share/usb-network/usb-network.conf
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,61 @@
#!/bin/bash
mac_config="/usr/share/mac-address/config.txt"
dev_mac_path="/tmp/usb0_dev"
host_mac_path="/tmp/usb0_host"
check_usb_local_administered() {
is_enable="$(cat ${mac_config} | grep 'USBLAA')"
echo "${is_enable}"
}
# Set the locally administered bit (the second least-significant
# bit of the first octet) of the MAC address
set_local_administered_bit() {
mac="$(tr -d '\0' < "$1")"
first_byte="${mac:0:2}"
first_byte="$((0x$first_byte|2))"
first_byte="$(printf "%02x\n" "$first_byte")"
mac="${first_byte}${mac:2}"
echo "$mac"
}
cd /sys/kernel/config/usb_gadget || exit 1
if [ ! -f "g1" ]; then
mkdir g1
cd g1 || exit 1
echo 0x1d6b > idVendor # Linux foundation
echo 0x0104 > idProduct # Multifunction composite gadget
mkdir -p strings/0x409
echo "Linux" > strings/0x409/manufacturer
echo "Etherned/ECM gadget" > strings/0x409/product
mkdir -p configs/c.1
echo 100 > configs/c.1/MaxPower
mkdir -p configs/c.1/strings/0x409
echo "ECM" > configs/c.1/strings/0x409/configuration
if [[ $(check_usb_local_administered) == "USBLAA=true" ]]; then
dev_mac="$(set_local_administered_bit $dev_mac_path)"
host_mac="$(set_local_administered_bit $host_mac_path)"
echo "$dev_mac" > $dev_mac_path
echo "$host_mac" > $host_mac_path
fi
mkdir -p functions/ecm.usb0
cat $dev_mac_path > functions/ecm.usb0/dev_addr # write device mac address
cat $host_mac_path > functions/ecm.usb0/host_addr # write usb mac address
ln -s functions/ecm.usb0 configs/c.1
echo "$UDC" > UDC
rm $dev_mac_path
rm $host_mac_path
fi
exit 0
+10
View File
@@ -0,0 +1,10 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "f0b-layer"
BBFILE_PATTERN_f0b-layer = ""
LAYERSERIES_COMPAT_f0b-layer = "langdale mickledore"
@@ -0,0 +1,28 @@
KMACHINE = "aspeed"
# The device tree of F0B is not ready yet, temporarily replace it with aspeed-ast2500-evb.dtb
KERNEL_DEVICETREE = "${KMACHINE}-ast2500-evb.dtb"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-aspeed"
PREFERRED_PROVIDER_u-boot = "u-boot-aspeed"
PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-aspeed"
UBOOT_MACHINE = "ast_g5_phy_config"
MACHINE_EXTRA_RRECOMMENDS = "kernel-modules"
# Overwrite flash offsets
FLASH_UBOOT_OFFSET = "0"
FLASH_KERNEL_OFFSET = "512"
FLASH_UBI_OFFSET = "${FLASH_KERNEL_OFFSET}"
FLASH_ROFS_OFFSET = "4864"
FLASH_RWFS_OFFSET = "49152"
FLASH_SIZE = "65536"
require conf/machine/include/ast2500.inc
require conf/machine/include/obmc-bsp-common.inc
IMAGE_FEATURES:remove = "obmc-system-mgmt"
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-kcs"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "f0b-ipmi-inventory-map-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-read-inventory = "f0b-ipmi-fru-read-inventory-native"
@@ -0,0 +1,17 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-phosphor \
##OEROOT##/meta-aspeed \
##OEROOT##/meta-quanta \
##OEROOT##/meta-quanta/meta-f0b \
"
@@ -0,0 +1,2 @@
Common targets are:
obmc-phosphor-image
@@ -0,0 +1,17 @@
MACHINE ??= "f0b"
DISTRO ?= "openbmc-phosphor"
PACKAGE_CLASSES ?= "package_ipk"
SANITY_TESTED_DISTROS:append ?= " *"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
CONF_VERSION = "2"
@@ -0,0 +1,38 @@
CONFIG_DEVMEM=y
CONFIG_DEVKMEM=y
CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_MQUEUE=y
CONFIG_SENSORS_TPS53622=y
CONFIG_SENSORS_TPS53659=y
CONFIG_SENSORS_TPS53679=y
CONFIG_SENSORS_INA2XX=y
CONFIG_EEPROM_AT24=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_SIT=y
CONFIG_IPV6_SIT_6RD=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_IPV6_SEG6_LWTUNNEL=y
CONFIG_IPV6_SEG6_HMAC=y
CONFIG_MODULES=y
CONFIG_ARM_MODULE_PLTS=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_USB_ASPEED_VHUB=m
CONFIG_USB_LIBCOMPOSITE=m
CONFIG_USB_F_MASS_STORAGE=m
CONFIG_USB_GADGETFS=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_CONFIGFS_FS=m
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += " file://f0b.cfg"
@@ -0,0 +1,19 @@
SUMMARY = "F0B inventory map for phosphor-ipmi-host"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit phosphor-ipmi-host
inherit native
SRC_URI += "file://config.yaml"
PROVIDES += "virtual/phosphor-ipmi-fru-read-inventory"
S = "${WORKDIR}"
do_install() {
DEST=${D}${config_datadir}
install -d ${DEST}
install config.yaml ${DEST}
}
@@ -0,0 +1,19 @@
SUMMARY = "F0B IPMI to DBus Inventory mapping."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit phosphor-ipmi-fru
inherit native
SRC_URI += "file://config.yaml"
PROVIDES += "virtual/phosphor-ipmi-fru-inventory"
S = "${WORKDIR}"
do_install() {
DEST=${D}${config_datadir}
install -d ${DEST}
install config.yaml ${DEST}
}
@@ -0,0 +1,75 @@
0x01:
/system:
entityID: 23
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Product
/system/motherboard:
entityID: 7
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
/system/motherboard/Self:
entityID: 7
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item.Board:
/system/motherboard/product:
entityID: 7
entityInstance: 2
interfaces:
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.Asset:
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Product
PartNumber:
IPMIFruProperty: Model Number
IPMIFruSection: Product
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/6-0054/eeprom
FRUID=1
@@ -0,0 +1,20 @@
inherit obmc-phosphor-systemd
FILESEXTRAPATHS:prepend:f0b := "${THISDIR}/${PN}:"
EEPROM_NAMES = "motherboard "
EEPROMFMT = "system/{0}"
EEPROM_ESCAPEDFMT = "system-{0}"
EEPROMS = "${@compose_list(d, 'EEPROMFMT', 'EEPROM_NAMES')}"
EEPROMS_ESCAPED = "${@compose_list(d, 'EEPROM_ESCAPEDFMT', 'EEPROM_NAMES')}"
ENVFMT = "obmc/eeproms/{0}"
SYSTEMD_ENVIRONMENT_FILE:${PN}:append:f0b := " ${@compose_list(d, 'ENVFMT', 'EEPROMS')}"
TMPL = "obmc-read-eeprom@.service"
TGT = "multi-user.target"
INSTFMT = "obmc-read-eeprom@{0}.service"
FMT = "../${TMPL}:${TGT}.wants/${INSTFMT}"
SYSTEMD_LINK:${PN}:append:f0b := " ${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
@@ -0,0 +1,5 @@
LABEL_curr1 = "p0_dimm_vr0_lin"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
@@ -0,0 +1,5 @@
LABEL_curr1 = "p0_dimm_vr1_lin"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p0_vccio_vr_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p0_vccio_vr_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p0_vccio_vr_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p0_vccio_vr_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p0_vccio_vr_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p1_vccio_vr_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p1_vccio_vr_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p1_vccio_vr_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p1_vccio_vr_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p1_vccio_vr_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p0_dimm_vr0_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p0_dimm_vr0_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p0_dimm_vr0_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p0_dimm_vr0_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p0_dimm_vr0_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p0_dimm_vr1_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p0_dimm_vr1_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p0_dimm_vr1_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p0_dimm_vr1_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p0_dimm_vr1_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p1_dimm_vr0_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p1_dimm_vr0_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p1_dimm_vr0_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p1_dimm_vr0_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p1_dimm_vr0_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p1_dimm_vr1_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p1_dimm_vr1_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p1_dimm_vr1_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p1_dimm_vr1_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p1_dimm_vr1_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p0_vccin_vr_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p0_vccin_vr_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p0_vccin_vr_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p0_vccin_vr_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p0_vccin_vr_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,29 @@
LABEL_temp1 = "p1_vccin_vr_temp"
WARNHI_temp1 = "10500"
WARNLO_temp1 = "0"
CRITHI_temp1 = "11500"
CRITLO_temp1 = "0"
LABEL_curr1 = "p1_vccin_vr_current"
WARNLO_curr1 = "0"
CRITLO_curr1 = "0"
WARNHI_curr1 = "231000"
CRITHI_curr1 = "288000"
LABEL_in1 = "p1_vccin_vr_voltage"
WARNLO_in1 = "0"
CRITLO_in1 = "9500"
WARNHI_in1 = "0"
CRITHI_in1 = "17000"
LABEL_power1 = "p1_vccin_vr_pin"
WARNLO_power1 = "0"
CRITLO_power1 = "0"
WARNHI_power1 = "0"
CRITHI_power1 = "0"
LABEL_power2 = "p1_vccin_vr_pout"
WARNLO_power2 = "0"
CRITLO_power2 = "0"
WARNHI_power2 = "0"
CRITHI_power2 = "0"
@@ -0,0 +1,5 @@
LABEL_temp1 = "inlet"
WARNHI_temp1 = "60000"
WARNLO_temp1 = "0"
CRITHI_temp1 = "70000"
CRITLO_temp1 = "0"
@@ -0,0 +1,5 @@
LABEL_temp1 = "outlet"
WARNHI_temp1 = "60000"
WARNLO_temp1 = "0"
CRITHI_temp1 = "70000"
CRITLO_temp1 = "0"
@@ -0,0 +1,22 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
EXTRA_OEMESON:append:f0b = " -Dnegative-errno-on-fail=true"
NAME = " \
bus@1e78a000/i2c-bus@80/tmp421@4c \
bus@1e78a000/i2c-bus@1c0/tmp421@4c \
bus@1e78a000/i2c-bus@180/tps53679@60\
bus@1e78a000/i2c-bus@180/tps53659@62\
bus@1e78a000/i2c-bus@180/tps53659@64\
bus@1e78a000/i2c-bus@180/tps53679@70\
bus@1e78a000/i2c-bus@180/tps53659@72\
bus@1e78a000/i2c-bus@180/tps53659@74\
bus@1e78a000/i2c-bus@180/ina219@40\
bus@1e78a000/i2c-bus@180/ina219@41\
"
ITEMSFMT = "ahb/apb/{0}.conf"
ITEMS = "${@compose_list(d, 'ITEMSFMT', 'NAME')}"
ENVS = "obmc/hwmon/{0}"
SYSTEMD_ENVIRONMENT_FILE:${PN} += "${@compose_list(d, 'ENVS', 'ITEMS')}"
+11
View File
@@ -0,0 +1,11 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "gbs-layer"
BBFILE_PATTERN_gbs-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_gbs-layer = "langdale mickledore"
LAYERDEPENDS_gbs-layer = "core phosphor-layer google-layer quanta-layer"
@@ -0,0 +1,58 @@
KMACHINE = "nuvoton"
KERNEL_DEVICETREE = "${KMACHINE}-npcm730-gbs.dtb"
UBOOT_MACHINE = "PolegSVB_spinor_minimal_config"
UBOOT_DEVICETREE = "nuvoton-npcm730-gbs"
IGPS_MACHINE = "GBS"
MACHINEOVERRIDES .= ":npcm7xx"
require conf/machine/include/npcm7xx.inc
require conf/machine/include/obmc-bsp-common.inc
SERIAL_CONSOLES = "115200;ttyS0"
GBMC_NCSI_IF_NAME = "eth0"
# Overwrite flash offsets
FLASH_KERNEL_OFFSET:flash-65536 = "2048"
FLASH_ROFS_OFFSET:flash-65536 = "7168"
FLASH_RWFS_OFFSET:flash-65536 = "62400"
FLASH_SIZE = "65536"
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-kcs"
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "gbs-led-manager-config-native"
PREFERRED_PROVIDER_virtual/bios-update = "gbs-bios-update"
PREFERRED_PROVIDER_virtual/bmc-update = "gbs-bmc-update"
# Remove unneeded binaries from image
IMAGE_FEATURES:remove = "obmc-bmc-state-mgmt"
IMAGE_FEATURES:remove = "obmc-bmcweb"
IMAGE_FEATURES:remove = "obmc-chassis-mgmt"
IMAGE_FEATURES:remove = "obmc-chassis-state-mgmt"
IMAGE_FEATURES:remove = "obmc-console"
IMAGE_FEATURES:remove = "obmc-devtools"
IMAGE_FEATURES:remove = "obmc-fan-control"
IMAGE_FEATURES:remove = "obmc-fan-mgmt"
IMAGE_FEATURES:remove = "obmc-flash-mgmt"
IMAGE_FEATURES:remove = "obmc-fru-ipmi"
IMAGE_FEATURES:remove = "obmc-health-monitor"
IMAGE_FEATURES:remove = "obmc-host-ipmi"
IMAGE_FEATURES:remove = "obmc-host-state-mgmt"
IMAGE_FEATURES:remove = "obmc-ikvm"
IMAGE_FEATURES:remove = "obmc-inventory"
IMAGE_FEATURES:remove = "obmc-leds"
IMAGE_FEATURES:remove = "obmc-logging-mgmt"
IMAGE_FEATURES:remove = "obmc-remote-logging-mgmt"
IMAGE_FEATURES:remove = "obmc-rng"
IMAGE_FEATURES:remove = "obmc-net-ipmi"
IMAGE_FEATURES:remove = "obmc-sensors"
IMAGE_FEATURES:remove = "obmc-software"
IMAGE_FEATURES:remove = "obmc-system-mgmt"
IMAGE_FEATURES:remove = "obmc-telemetry"
IMAGE_FEATURES:remove = "obmc-debug-collector"
IMAGE_FEATURES:remove = "obmc-settings-mgmt"
IMAGE_FEATURES:remove = "obmc-network-mgmt"
IMAGE_FEATURES:remove = "obmc-user-mgmt"
IMAGE_FEATURES:remove = "obmc-user-mgmt-ldap"
IMAGE_FEATURES:remove = "obmc-dmtf-pmci"
OBMC_IMAGE_BASE_INSTALL:remove = "packagegroup-obmc-apps-extras"
@@ -0,0 +1,19 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-security/meta-tpm \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-phosphor \
##OEROOT##/meta-nuvoton \
##OEROOT##/meta-google \
##OEROOT##/meta-quanta \
##OEROOT##/meta-quanta/meta-gbs \
"
@@ -0,0 +1,2 @@
Common targets are:
obmc-phosphor-image
@@ -0,0 +1,17 @@
MACHINE ??= "gbs"
DISTRO ?= "gbmc"
PACKAGE_CLASSES ?= "package_ipk"
SANITY_TESTED_DISTROS:append ?= " *"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
CONF_VERSION = "2"
@@ -0,0 +1,276 @@
<!-- SPDX-License-Identifier: GPL-2.0
#
# Nuvoton IGPS: Image Generation And Programming Scripts For Poleg BMC
#
# Copyright (C) 2018 Nuvoton Technologies, All Rights Reserved
#--------------------------------------------------------------------------->
<?xml version="1.0" encoding="UTF-8"?>
<Bin_Ecc_Map>
<!-- BMC mandatory fields -->
<ImageProperties>
<BinSize>0</BinSize> <!-- If 0 the binary size will be calculated by the tool -->
<PadValue>0xFF</PadValue> <!-- Byte value to pad the empty areas, default is 0 -->
</ImageProperties>
<BinField>
<!-- BootBlock tag (0x50 0x07 0x55 0xAA 0x54 0x4F 0x4F 0x42) or
uboot tag (0x55 0x42 0x4F 0x4F 0x54 0x42 0x4C 0x4B) -->
<name>StartTag</name> <!-- name of field -->
<config>
<offset>0</offset>
<size>0x8</size>
</config>
<content format='bytes'>0x50 0x07 0x55 0xAA 0x54 0x4F 0x4F 0x42</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Code destination address, 32-bit aligned: for BootBlock should be 0xFFFD5E00 so code will run in 0xFFFD6000 as linked for -->
<name>DestAddr</name> <!-- name of field -->
<config>
<offset>0x140</offset>
<size>0x4</size>
</config>
<content format='32bit'>0xFFFD5E00</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- BootBlock or u-boot Code size -->
<name>CodeSize</name> <!-- name of field -->
<config>
<offset>0x144</offset>
<size>0x4</size>
</config>
<content format='FileSize'>Poleg_bootblock.bin</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- The BootBlock or u-boot binary file -->
<name>Code</name> <!-- name of field -->
<config>
<offset>0x200</offset>
<size format='FileSize'>Poleg_bootblock.bin</size> <!-- size in the header calculated by tool-->
</config>
<content format='FileContent'>Poleg_bootblock.bin</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
<BinField>
<!-- Word contents copied by ROM code to FIU0 FIU_DRD_CFG register -->
<name>FIU0_DRD_CFG_Set</name> <!-- name of field -->
<config>
<offset>0x108</offset>
<size>0x4</size>
</config>
<content format='32bit'>0x0300100B</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines the clock divide ratio from AHB to FIU0 clock -->
<name>FIU_Clk_Divider</name> <!-- name of field -->
<config>
<offset>0x10C</offset>
<size>0x1</size>
</config>
<content format='bytes'>0x0A</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Version (Major.Minor) -->
<name>Version</name> <!-- name of field -->
<config>
<offset>0x148</offset>
<size>0x4</size>
</config>
<content format='32bit'>0x0201</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Board manufaturer ( Dell = 0, Nuvoton = 100, Google = 1, MS = 2) -->
<name>BOARD_VENDOR</name> <!-- name of field -->
<config>
<offset>0x14C</offset>
<size>0x4</size>
</config>
<content format='32bit'>100</content> <!--Board_manufacturer: Nuvoton-->
</BinField>
<BinField>
<!-- Board type ( DRB = 0, SVB = 1, EB = 2,HORIZON = 3, SANDSTORM = 4, ROCKAWAY = 100 RunBMC = 10) -->
<!-- WARNING: Currently this value is only printed to serial. Set BOARD_VENDOR to 1 get Dell specific customization. -->
<name>BOARD_TYPE</name> <!-- name of field -->
<config>
<offset>0x150</offset>
<size>0x4</size>
</config>
<content format='32bit'>0x64</content> <!--Board_type: EB-->
</BinField>
<!-- the next two fields are available since version 10.7.0 -->
<BinField>
<!-- supported values: 333,444,500,600,666,700,720,750,775,787,800,825,850,900,950,1000,1060 -->
<name>MC_FREQ_IN_MHZ</name> <!-- name of field -->
<config>
<offset>0x11C</offset>
<size>0x2</size>
</config>
<content format='32bit'>800</content>
</BinField>
<BinField>
<!-- supporeted values: 333,500,600,666,700,720,750,800,825,850,900,950,1000,1060 -->
<name>CPU_FREQ_IN_MHZ</name> <!-- name of field -->
<config>
<offset>0x154</offset>
<size>0x2</size>
</config>
<content format='32bit'>800</content>
</BinField>
<BinField>
<!-- MC_CONFIG.
Bit 0: MC_DISABLE_CAPABILITY_INPUT_DQS_ENHANCE_TRAINING (0x01)
Bit 1: MC_CAPABILITY_IGNORE_ECC_DEVICE (0x02) -->
<name>MC_CONFIG</name> <!-- name of field -->
<config>
<offset>0x156</offset>
<size>0x1</size>
</config>
<content format='32bit'>0x00</content>
</BinField>
<BinField>
<!-- HOST_IF.
0xFF: LPC backward compatible
0x00: LPC.
0x01: eSPI
0x02: GPIOs TRIS. -->
<name>HOST_IF</name> <!-- name of field -->
<config>
<offset>0x157</offset>
<size>0x1</size>
</config>
<content format='32bit'>0x00</content>
</BinField>
<BinField>
<!-- SECURITY_LEVEL_T.
0xFF: SECURITY_LEVEL_UNKNOWN: backward compatible
0x00: SECURITY_LEVEL_NONE.
0x01: SECURITY_LEVEL_STANDARD
0x02: SECURITY_LEVEL_NIST. (require BootBlock with NIST support) -->
<name>SECURITY_LEVEL_T</name> <!-- name of field -->
<config>
<offset>0x15C</offset>
<size>0x1</size>
</config>
<content format='32bit'>0xFF</content>
</BinField>
<BinField>
<!-- Key revoke (bitwise). Set bit 0 to revoke key 0 etc. -->
<name>SECURITY_REVOKE_KEYS</name> <!-- name of field -->
<config>
<offset>0x1D7</offset>
<size>0x1</size>
</config>
<content format='bytes'>0x00</content>
</BinField>
<BinField>
<!-- security log offset -->
<name>SECURITY_LOG</name> <!-- name of field -->
<config>
<offset>0x1D8</offset>
<size>0x4</size>
</config>
<content format='32bit'>0x090000</content>
</BinField>
<BinField>
<!-- hole 0 size: used for NIST security. -->
<name>SECURITY_LOG_SIZE</name> <!-- name of field -->
<config>
<offset>0x1DC</offset>
<size>0x4</size>
</config>
<content format='32bit'>0x3000</content>
</BinField>
<BinField>
<!-- hole 0: used for NIST security. -->
<name>HOLE0</name> <!-- name of field -->
<config>
<offset>0x1E0</offset>
<size>0x4</size>
</config>
<content format='32bit'>0x0A0000</content>
</BinField>
<BinField>
<!-- hole 0 size: used for NIST security. -->
<name>HOLE0_SIZE</name> <!-- name of field -->
<config>
<offset>0x1E4</offset>
<size>0x4</size>
</config>
<content format='32bit'>0xF70000</content>
</BinField>
<BinField>
<!-- hole 1: used for NIST security. -->
<name>HOLE1</name> <!-- name of field -->
<config>
<offset>0x1E8</offset>
<size>0x4</size>
</config>
<content format='32bit'>0</content>
</BinField>
<BinField>
<!-- hole 1 size: used for NIST security. -->
<name>HOLE1_SIZE</name> <!-- name of field -->
<config>
<offset>0x1EC</offset>
<size>0x4</size>
</config>
<content format='32bit'>0</content>
</BinField>
<BinField>
<!-- hole 2: used for NIST security. -->
<name>HOLE2</name> <!-- name of field -->
<config>
<offset>0x1F0</offset>
<size>0x4</size>
</config>
<content format='32bit'>0xFFFFFFFF</content>
</BinField>
<BinField>
<!-- hole 2 size: used for NIST security. -->
<name>HOLE2_SIZE</name> <!-- name of field -->
<config>
<offset>0x1F4</offset>
<size>0x4</size>
</config>
<content format='32bit'>0</content>
</BinField>
<BinField>
<!-- hole 3: used for NIST security. -->
<name>HOLE3</name> <!-- name of field -->
<config>
<offset>0x1F8</offset>
<size>0x4</size>
</config>
<content format='32bit'>0</content>
</BinField>
<BinField>
<!-- hole 3 size: used for NIST security. -->
<name>HOLE3_SIZE</name> <!-- name of field -->
<config>
<offset>0x1FC</offset>
<size>0x4</size>
</config>
<content format='32bit'>0</content>
</BinField>
</Bin_Ecc_Map>
@@ -0,0 +1,194 @@
<!-- SPDX-License-Identifier: GPL-2.0
#
# Nuvoton IGPS: Image Generation And Programming Scripts For Poleg BMC
#
# Copyright (C) 2018 Nuvoton Technologies, All Rights Reserved
#--------------------------------------------------------------------------->
<?xml version="1.0" encoding="UTF-8"?>
<Bin_Ecc_Map>
<!-- BMC mandatory fields -->
<ImageProperties>
<BinSize>0</BinSize> <!-- If 0 the binary size will be calculated by the tool -->
<PadValue>0xFF</PadValue> <!-- Byte value to pad the empty areas, default is 0 -->
</ImageProperties>
<BinField>
<!-- BootBlock tag (0x50 0x07 0x55 0xAA 0x54 0x4F 0x4F 0x42) or
uboot tag (0x55 0x42 0x4F 0x4F 0x54 0x42 0x4C 0x4B) -->
<name>StartTag</name> <!-- name of field -->
<config>
<offset>0</offset> <!-- offset in the header -->
<size>0x8</size> <!-- size in the header -->
</config>
<content format='bytes'>0x55 0x42 0x4F 0x4F 0x54 0x42 0x4C 0x4B</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Code destination address, 32-bit aligned: for u-boot should be 0x80005000 so code will run in 0x80005200 as linked for -->
<name>DestAddr</name> <!-- name of field -->
<config>
<offset>0x140</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='32bit'>0x8000</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- BootBlock or u-boot Code size -->
<name>CodeSize</name> <!-- name of field -->
<config>
<offset>0x144</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='FileSize'>u-boot.bin</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- The BootBlock or u-boot binary file -->
<name>Code</name> <!-- name of field -->
<config>
<offset>0x200</offset> <!-- offset in the header -->
<size format='FileSize'>u-boot.bin</size> <!-- size in the header calculated by tool-->
</config>
<content format='FileContent'>u-boot.bin</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
<BinField>
<!-- Word contents copied by ROM code to FIU0 FIU_DRD_CFG register -->
<name>FIU0_DRD_CFG_Set</name> <!-- name of field -->
<config>
<offset>0x108</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='32bit'>0x0300100B</content> <!-- content the user should fill 0x030032EB -->
</BinField>
<BinField>
<!-- Defines the clock divide ratio from AHB to FIU0 clock -->
<name>FIU0_Clk_Divider</name> <!-- name of field -->
<config>
<offset>0x10C</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines if FIU0 CS1 is enabled -->
<name>fiu0_cs1_en</name> <!-- name of field -->
<config>
<offset>0x10D</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines if FIU0 CS2 is enabled -->
<name>fiu0_cs2_en</name> <!-- name of field -->
<config>
<offset>0x10E</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines if FIU0 CS3 is enabled -->
<name>fiu0_cs3_en</name> <!-- name of field -->
<config>
<offset>0x10F</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
<BinField>
<!-- Word contents copied by ROM code to FIU3 FIU_DRD_CFG register -->
<name>FIU3_DRD_CFG_Set</name> <!-- name of field -->
<config>
<offset>0x110</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='32bit'>0x0</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
<BinField>
<!-- Word contents copied by ROM code to FIU3 FIU_DRD_CFG register -->
<name>FIU3_DWR_CFG_Set</name> <!-- name of field -->
<config>
<offset>0x114</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='32bit'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines the clock divide ratio from AHB to FIU3 clock -->
<name>FIU3_Clk_Divider</name> <!-- name of field -->
<config>
<offset>0x118</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines if FIU3 CS1 is enabled -->
<name>fiu3_cs1_en</name> <!-- name of field -->
<config>
<offset>0x119</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines if FIU3 CS2 is enabled -->
<name>fiu3_cs2_en</name> <!-- name of field -->
<config>
<offset>0x11A</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Defines if FIU3 CS3 is enabled -->
<name>fiu3_cs3_en</name> <!-- name of field -->
<config>
<offset>0x11B</offset> <!-- offset in the header -->
<size>0x1</size> <!-- size in the header -->
</config>
<content format='bytes'>0x0</content> <!-- content the user should fill -->
</BinField>
<BinField>
<!-- Version (Major.Minor) -->
<name>Version</name> <!-- name of field -->
<config>
<offset>0x148</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='32bit'>0</content> <!-- content the user should fill -->
</BinField>
<!-- BMC optional fields -->
<BinField>
<!-- Word contents copied by BB code to FIU0 FIU_DWR_CFG register -->
<name>FIU0_DWR_CFG_Set</name> <!-- name of field -->
<config>
<offset>0x14C</offset> <!-- offset in the header -->
<size>0x4</size> <!-- size in the header -->
</config>
<content format='32bit'>0x03001102</content> <!-- content the user should fill -->
</BinField>
</Bin_Ecc_Map>
@@ -0,0 +1,12 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://BootBlockAndHeader_GBS.xml"
SRC_URI:append = " file://UbootHeader_GBS.xml"
# Prepare the Bootblock XMLs.
do_gbs_prepare_xmls() {
cp ${WORKDIR}/BootBlockAndHeader_GBS.xml ${S}/ImageGeneration/references/
cp ${WORKDIR}/UbootHeader_GBS.xml ${S}/ImageGeneration/references/
}
addtask do_gbs_prepare_xmls after do_patch before do_install
@@ -0,0 +1,2 @@
CONFIG_LSUSB=y
CONFIG_DEVMEM=y
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend:gbs := "${THISDIR}/${PN}:"
SRC_URI:append:gbs = " file://busybox.cfg"
@@ -0,0 +1,12 @@
[Unit]
Description=Boot Status LED Manager
After=xyz.openbmc_project.LED.GroupManager.service
Wants=xyz.openbmc_project.LED.GroupManager.service
[Service]
ExecStart=/usr/bin/boot-status-led.sh
Type=simple
Restart=on-failure
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,50 @@
#!/bin/bash
BOOT_SERVICE_NAME="xyz.openbmc_project.State.Host"
BOOT_STATUS_OBJPATH="/xyz/openbmc_project/state/os"
BOOT_INTERFACE_NAME="xyz.openbmc_project.State.OperatingSystem.Status"
BOOT_Property="OperatingSystemState"
LED_SERVICE_NAME="xyz.openbmc_project.LED.GroupManager"
LED_INACTIVE_OBJPATH="/xyz/openbmc_project/led/groups/boot_status_inactive"
LED_STANDBY_OBJPATH="/xyz/openbmc_project/led/groups/boot_status_standby"
LED_INTERFACE_NAME="xyz.openbmc_project.Led.Group"
LED_Property="Asserted"
PWR_STATE_SERVICE="xyz.openbmc_project.State.Chassis"
PWR_STATE_OBJPATH="/xyz/openbmc_project/state/chassis0"
PWR_STATE_INTERFACE_NAME="xyz.openbmc_project.State.Chassis"
PWR_STATE_Property="CurrentPowerState"
boot_status=""
power_state=""
led_status=""
mapper wait $LED_INACTIVE_OBJPATH
mapper wait $LED_STANDBY_OBJPATH
while true; do
power_state="$(busctl get-property $PWR_STATE_SERVICE $PWR_STATE_OBJPATH $PWR_STATE_INTERFACE_NAME $PWR_STATE_Property | awk '{print $2}')"
boot_status="$(busctl get-property $BOOT_SERVICE_NAME $BOOT_STATUS_OBJPATH $BOOT_INTERFACE_NAME $BOOT_Property | awk '{print $2}')"
if [[ $power_state != "\"xyz.openbmc_project.State.Chassis.PowerState.On\"" ]];then
if [[ $led_status != "OFF" ]];then
busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b false
busctl set-property $LED_SERVICE_NAME $LED_STANDBY_OBJPATH $LED_INTERFACE_NAME $LED_Property b false
led_status="OFF"
fi
continue
else
if [[ $boot_status != "\"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Standby\"" ]] && [[ $led_status != "BLINKING" ]];then
busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b true
led_status="BLINKING"
elif [[ $boot_status == "\"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Standby\"" ]] && [[ $led_status != "ON" ]];then
busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b false
busctl set-property $LED_SERVICE_NAME $LED_STANDBY_OBJPATH $LED_INTERFACE_NAME $LED_Property b true
led_status="ON"
fi
fi
sleep 1
done
exit 0
@@ -0,0 +1,25 @@
SUMMARY = "OpenBMC Quanta Boot Status LED Service"
DESCRIPTION = "OpenBMC Quanta Boot Status LED Daemon."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
DEPENDS += "systemd"
RDEPENDS:${PN} += "bash"
SRC_URI = " file://boot-status-led.sh \
file://boot-status-led.service \
"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/boot-status-led.sh ${D}${bindir}/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/boot-status-led.service ${D}${systemd_system_unitdir}
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "boot-status-led.service"
@@ -0,0 +1,10 @@
[Unit]
Description=Report CPLD Version
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/bin/cpld_version.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,124 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#################################################################
# Prints CPLD version and save it in file /run/cpld0.version
#
# CPLD version format: Major.Minor.Point.Subpoint
#
# Major/Minor: base vendor image version, encoded in register 0x0 of the CPLD
# I2C bus.
# Major = higher 4 bits of register 0x00
# Minor = lower 4 bits of register 0x00
# Point/SubPoint: reserved as 0x0 for now
#
# e.g. reg[0] = 0x25 -> ver 2.5.0.0
#
#################################################################
CPLD_I2C_BUS_NUM=13
CPLD_I2C_BUS_ADDR='0x21'
CPLD_I2C_BASEVER_REG='0x00'
VER_ENV_FILE='/run/cpld0.version'
#################################################################
# Parse the byte value from i2cget and sanity checks the hex format
# Arguments:
# $1: i2c_bus_num
# $2: i2c_bus_addr
# $3: i2c_reg
# Global:
# 'byte_val' will be written with the numeric value from i2cget
# Returns:
# 0 if success, non-zero if failed to get the value or value is malformed
#################################################################
read_and_check_i2c_get() {
if ! (( $# == 3 )); then
echo "Usage: read_and_check_i2c_get i2c_bus_num i2c_bus_addr i2c_reg"
return 1
fi
local i2c_bus_num=$1
local i2c_bus_addr=$2
local i2c_reg=$3
local i2c_val_raw
i2c_val_raw=$(i2cget -y "${i2c_bus_num}" "${i2c_bus_addr}" "${i2c_reg}") || return
# Verify that it is of format 0x[hex][hex].
local HEXBYTE_RE='^0x[0-9A-Fa-f]{2}$'
if ! [[ ${i2c_val_raw} =~ ${HEXBYTE_RE} ]]; then
echo "i2cget $* outputs invalid value: ${i2c_val_raw}"
return 1
fi
((byte_val = i2c_val_raw))
return 0
}
#################################################################
# Prints CPLD version in Major.Minor.Point.Subpoint format.
# Each dot separated field is decimal number with no leading zeros.
# Arguments:
# None
# Globals:
# Write parsed version into the following global variables:
# cpld_ver_major
# cpld_ver_minor
# cpld_point
# cpld_subpoint
# Returns:
# 0 if success, non-zero otherwise
#################################################################
parse_cpld_ver() {
# Stores the output of read_and_check_i2c_get
local byte_val
# Read a byte, assign higher 4 bits to cpld_ver_major and lower 4 bits to
# cpld_ver_minor.
# e.g. cpld_ver_raw = 0x09 => major_hex = 0, minor_hex = 9
read_and_check_i2c_get ${CPLD_I2C_BUS_NUM} ${CPLD_I2C_BUS_ADDR} ${CPLD_I2C_BASEVER_REG} ||
return
local cpld_ver
((cpld_ver = byte_val))
((cpld_ver_major = cpld_ver >> 4))
((cpld_ver_minor = cpld_ver & 0xf))
((cpld_point = 0))
((cpld_subpoint = 0))
return 0
}
main() {
local cpld_ver_major
local cpld_ver_minor
local cpld_point
local cpld_subpoint
parse_cpld_ver || return
# Write CPLD version to file.
cpld_ver="${cpld_ver_major}.${cpld_ver_minor}.${cpld_point}.${cpld_subpoint}"
echo "CPLD version ${cpld_ver}"
echo "${cpld_ver}" > "${VER_ENV_FILE}"
return 0
}
# Exit without running main() if sourced
if ! (return 0 2>/dev/null); then
main "$@"
fi
@@ -0,0 +1,25 @@
DESCRIPTION = "Report CPLD Version"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
SRC_URI = " file://cpld_version.sh \
file://cpld-version.service \
"
S = "${WORKDIR}"
DEPENDS = "systemd"
RDEPENDS:${PN} = "bash"
SYSTEMD_SERVICE:${PN} = "cpld-version.service"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}/cpld_version.sh ${D}${bindir}/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${S}/cpld-version.service ${D}${systemd_system_unitdir}
}
@@ -0,0 +1,90 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2020 Quanta Computer Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Global variables
# GPIO to control the host SPI mux
SPI_SW_SELECT=169
# Kernel control string for bind/unbind
KERNEL_FIU_ID="c0000000.spi"
# Kernel sysfs path for bind/unbind
KERNEL_SYSFS_FIU="/sys/bus/platform/drivers/NPCM-FIU"
# the node of FIU is spi for kernel 5.10, but
# for less than or equal kernel 5.4, the node
# is fiu
if ls "$KERNEL_SYSFS_FIU"/*.fiu 1> /dev/null 2>&1; then
KERNEL_FIU_ID="c0000000.fiu"
fi
IMAGE_FILE="/tmp/image-bios"
# Taken from /run/initramfs/update
# Given label name, return mtd node. e.g. `findmtd bmc` returns 'mtd0'
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
m=${m%/name}
m=${m##*/}
echo "$m"
}
cleanup() {
if [ -d "${KERNEL_SYSFS_FIU}/${KERNEL_FIU_ID}" ]; then
echo "${KERNEL_FIU_ID}" > "${KERNEL_SYSFS_FIU}"/unbind
fi
echo low > /sys/class/gpio/gpio${SPI_SW_SELECT}/direction # Switch mux to host
rm -f ${IMAGE_FILE}
}
trap cleanup EXIT SIGHUP SIGINT SIGTERM
main() {
if [ ! -f ${IMAGE_FILE} ]; then
echo "Invalid bios image file!"
exit 1
fi
echo "Starting bios update..."
if [ ! -d "/sys/class/gpio/gpio${SPI_SW_SELECT}" ]; then
echo "${SPI_SW_SELECT}" > /sys/class/gpio/export
fi
echo high > /sys/class/gpio/gpio${SPI_SW_SELECT}/direction # Switch mux to BMC
if [ -d "${KERNEL_SYSFS_FIU}/${KERNEL_FIU_ID}" ]; then
echo "${KERNEL_FIU_ID}" > "${KERNEL_SYSFS_FIU}"/unbind
fi
echo "${KERNEL_FIU_ID}" > "${KERNEL_SYSFS_FIU}"/bind
# BIOS flash is labelled 'bios-primary'
bios_mtd=$(findmtd bios-primary)
if [ -z "${bios_mtd}" ]; then
echo "Cannot find bios flash mtd partition!"
exit 1
fi
if flashcp -v $IMAGE_FILE /dev/"${bios_mtd}" ; then
echo "bios update successfully..."
else
echo "bios update failed..."
exit 1
fi
}
# Exit without running main() if sourced
if ! (return 0 2>/dev/null); then
main "$@"
fi
@@ -0,0 +1,32 @@
#!/bin/sh
# Copyright (c) 2019-present Lenovo
# Copyright (c) 2020 Quanta Computer Inc.
# Licensed under BSD-3, see COPYING.BSD file for details.
IMAGE_FILE="/tmp/bios-image"
SIG_FILE="/tmp/bmc.sig"
BURN_IMAGE="/tmp/image-bios"
sha256_image="FFFF"
sha256_file="EEEE"
echo "Verify bios image..."
if [ -e $IMAGE_FILE ] && [ -e $SIG_FILE ];
then
sha256_image=$(sha256sum "$IMAGE_FILE" | awk '{print $1}')
sha256_file=$(awk '{print $1}' $SIG_FILE)
fi
if [ "$sha256_image" != "$sha256_file" ];
then
echo "bios image verify fail."
rm -f $IMAGE_FILE
echo "Remove bios image"
exit 1
else
echo "bios image verify ok."
mv $IMAGE_FILE $BURN_IMAGE
rm -f $SIG_FILE
exit 0
fi
@@ -0,0 +1,20 @@
[{
"blob": "/flash/bios",
"handler": {
"type": "file",
"path": "/tmp/bios-image"
},
"actions": {
"preparation": {
"type": "skip"
},
"verification": {
"type": "systemd",
"unit": "phosphor-ipmi-flash-bios-verify.service"
},
"update": {
"type": "systemd",
"unit": "phosphor-ipmi-flash-bios-update.service"
}
}
}]
@@ -0,0 +1,9 @@
[Unit]
Description=Phosphor-ipmi-flash update BIOS service
[Service]
ExecStart=/usr/bin/bios-update.sh
Type=oneshot
[Install]
WantedBy=phosphor-ipmi-flash-bios-update.target
@@ -0,0 +1,9 @@
[Unit]
Description=Phosphor-ipmi-flash verify BIOS service
[Service]
ExecStart=/usr/bin/bios-verify.sh
Type=oneshot
[Install]
WantedBy=phosphor-ipmi-flash-bios-verify.target
@@ -0,0 +1,42 @@
PR = "r1"
LICENSE = "Apache-2.0 & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10 \
file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
"
inherit systemd
inherit obmc-phosphor-systemd
DEPENDS += "systemd"
DEPENDS += "phosphor-ipmi-flash"
RDEPENDS:${PN} += "bash"
PROVIDES += "virtual/bios-update"
RPROVIDES:${PN} += "virtual/bios-update"
SRC_URI += " file://bios-verify.sh \
file://bios-update.sh \
file://phosphor-ipmi-flash-bios-verify.service \
file://phosphor-ipmi-flash-bios-update.service \
file://config-bios.json \
"
FILES:${PN} += "${datadir}/phosphor-ipmi-flash/config-bios.json"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/bios-verify.sh ${D}${bindir}/
install -m 0755 ${WORKDIR}/bios-update.sh ${D}${bindir}/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/phosphor-ipmi-flash-bios-verify.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/phosphor-ipmi-flash-bios-update.service ${D}${systemd_system_unitdir}
install -d ${D}${datadir}/phosphor-ipmi-flash
install -m 0644 ${WORKDIR}/config-bios.json ${D}${datadir}/phosphor-ipmi-flash
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "phosphor-ipmi-flash-bios-verify.service phosphor-ipmi-flash-bios-update.service"
@@ -0,0 +1,22 @@
#!/bin/sh
sigfile="/tmp/bmc.sig"
imagebmc="/run/initramfs/image-bmc"
bmcimage="/run/initramfs/bmc-image"
publickey="/etc/activationdata/OpenBMC/publickey"
bmclog="/tmp/update-bmc.log"
if [ -f $publickey ];then
r="$(openssl dgst -verify $publickey -sha256 -signature $sigfile $bmcimage)"
echo "$r" > $bmclog
if [ "Verified OK" = "$r" ]; then
mv $bmcimage $imagebmc
rm -f $sigfile
exit 0
else
exit 1
fi
else
echo "No $publickey file" > $bmclog
exit 1
fi
@@ -0,0 +1,21 @@
[{
"blob": "/flash/image",
"handler": {
"type": "file",
"path": "/run/initramfs/bmc-image"
},
"actions": {
"preparation": {
"type": "skip"
},
"verification": {
"type": "systemd",
"unit": "phosphor-ipmi-flash-bmc-verify.service"
},
"update": {
"type": "systemd",
"unit": "reboot.target",
"mode": "replace-irreversibly"
}
}
}]
@@ -0,0 +1,9 @@
[Unit]
Description=Phosphor-ipmi-flash bmc verify service
[Service]
ExecStart=/usr/bin/bmc-verify.sh
Type=oneshot
[Install]
WantedBy=phosphor-ipmi-flash-bmc-verify.target
@@ -0,0 +1,35 @@
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
inherit obmc-phosphor-systemd
SRC_URI = " file://phosphor-ipmi-flash-bmc-verify.service \
file://bmc-verify.sh \
file://config-bmc.json \
"
FILES:${PN} += "${datadir}/phosphor-ipmi-flash/config-bmc.json"
PROVIDES += "virtual/bmc-update"
RPROVIDES:${PN} += "virtual/bmc-update"
DEPENDS += "systemd"
DEPENDS += "phosphor-ipmi-flash"
RDEPENDS:${PN} = "bash"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/bmc-verify.sh ${D}${bindir}/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/phosphor-ipmi-flash-bmc-verify.service ${D}${systemd_system_unitdir}
install -d ${D}${datadir}/phosphor-ipmi-flash
install -m 0644 ${WORKDIR}/config-bmc.json ${D}${datadir}/phosphor-ipmi-flash
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "phosphor-ipmi-flash-bmc-verify.service"
@@ -0,0 +1,11 @@
[Unit]
Description=Detect GPIO Present Manager
After=phosphor-gpio-presence@.service
Wants=phosphor-gpio-presence@.service
[Service]
ExecStart=/usr/bin/detect-gpio-present.sh
Type=simple
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,53 @@
#!/bin/bash
SERVICE_NAME="xyz.openbmc_project.Inventory.Manager"
PRESENT_OBJPATH=("/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab0_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab1_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab2_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab3_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/cable/hsbp_cab_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/cable/fanbd_cab_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/cable/bp12v_cab_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/entity/sata0_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot0_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/entity/fans_efuse_pg"
"/xyz/openbmc_project/inventory/system/chassis/entity/pwrgd_p12v_slots")
INTERFACE_NAME="xyz.openbmc_project.Inventory.Item"
IPMI_LOG_SERVICE="xyz.openbmc_project.Logging.IPMI"
IPMI_LOG_OBJPATH="/xyz/openbmc_project/Logging/IPMI"
IPMI_LOG_INTERFACE="xyz.openbmc_project.Logging.IPMI"
IPMI_LOG_FUNCT="IpmiSelAdd"
IPMI_LOG_PARA_FORMAT="ssaybq" #5 parameters, s : string, s : string, ay : byte array, b : boolean, y : UINT16
LOG_ERR="Configuration Error(Incorrect_interconnection)"
LOG_EVENT_DATA="3 0x01 0xff 0xfe"
LOG_ASSERT_FLAG="true"
LOG_DEASSERT_FLAG="false"
LOG_GENID_FLAG="0x0020"
present_state=("true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true")
for i in "${!PRESENT_OBJPATH[@]}"
do
mapper wait "${PRESENT_OBJPATH[$i]}"
done
while true; do
for i in "${!PRESENT_OBJPATH[@]}"
do
boot_status="$(busctl get-property $SERVICE_NAME "${PRESENT_OBJPATH[$i]}" $INTERFACE_NAME Present | awk '{print $2}')"
if [ "$boot_status" == "false" ] && [ "${present_state[$i]}" == "true" ];then
echo "Update cable $((i+1)) state."
present_state[i]="false"
busctl call $IPMI_LOG_SERVICE $IPMI_LOG_OBJPATH $IPMI_LOG_INTERFACE $IPMI_LOG_FUNCT $IPMI_LOG_PARA_FORMAT "$LOG_ERR" "${PRESENT_OBJPATH[$i]}" "$LOG_EVENT_DATA" $LOG_ASSERT_FLAG $LOG_GENID_FLAG
elif [ "$boot_status" == "true" ] && [ "${present_state[$i]}" == "false" ];then
echo "Update cable $((i+1)) state."
present_state[i]="true"
busctl call $IPMI_LOG_SERVICE $IPMI_LOG_OBJPATH $IPMI_LOG_INTERFACE $IPMI_LOG_FUNCT $IPMI_LOG_PARA_FORMAT "$LOG_ERR" "${PRESENT_OBJPATH[$i]}" "$LOG_EVENT_DATA" $LOG_DEASSERT_FLAG $LOG_GENID_FLAG
fi
done
sleep 1
done
exit 0
@@ -0,0 +1,25 @@
SUMMARY = "OpenBMC Quanta Detect Present Service"
DESCRIPTION = "OpenBMC Quanta Detect Present Daemon."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
DEPENDS += "systemd"
RDEPENDS:${PN} += "bash"
SRC_URI = " file://detect-gpio-present.sh \
file://detect-gpio-present.service \
"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/detect-gpio-present.sh ${D}${bindir}/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/detect-gpio-present.service ${D}${systemd_system_unitdir}
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "detect-gpio-present.service"
@@ -0,0 +1,30 @@
{
"system_board": [
{"instance": 1, "name": "/"},
{"instance": 28, "name": "/i2cool_0"},
{"instance": 29, "name": "/i2cool_1"},
{"instance": 30, "name": "/i2cool_2"}
],
"system_internal_expansion_board": [
{"instance": 1, "name": "/"}
],
"power_system_board": [
{"instance": 1, "name": "/"}
],
"add_in_card": [
{"instance": 0, "name": "/PE0"},
{"instance": 1, "name": "/PE1"}
],
"fan": [
{"instance": 0, "name": "/fan0"},
{"instance": 1, "name": "/fan1"},
{"instance": 2, "name": "/fb_fan0"},
{"instance": 3, "name": "/fb_fan1"},
{"instance": 4, "name": "/fb_fan2"}
],
"cooling_unit": [
{"instance": 0, "name": "/ZONE0"},
{"instance": 1, "name": "/ZONE1"},
{"instance": 2, "name": "/ZONE2"}
]
}
@@ -0,0 +1,16 @@
SUMMARY = "GBS IPMI Entity association mapping."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
SRC_URI += "file://entity_association_map.json"
FILES:${PN} = " \
${datadir}/ipmi-entity-association/entity_association_map.json \
"
do_install() {
install -d ${D}${datadir}/ipmi-entity-association
install -m 0644 -D ${WORKDIR}/entity_association_map.json \
${D}${datadir}/ipmi-entity-association/entity_association_map.json
}
@@ -0,0 +1,165 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2020 Quanta Computer Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Common GPIO functions.
# Map names of GPIOs to GPIO number
declare -A GPIO_NAMES_TO_NUMBER=(
['RST_BMC_PHY_N']=15
['BMC_BRD_REV_ID6']=37
['BMC_BRD_REV_ID5']=38
['BMC_BRD_SKU_ID3']=39
['BMC_BRD_SKU_ID2']=40
['FM_BMC_CPU_UART_EN']=76
['RST_BMC_RSMRST_N']=87
['RST_KBRST_BMC_CPLD_N']=94
['FAN_BRD_REV_ID0']=122
['FAN_BRD_REV_ID1']=123
['HSBP_BRD_REV_ID3']=124
['HSBP_BRD_REV_ID2']=125
['HSBP_BRD_REV_ID1']=126
['BMC_BRD_REV_ID0']=136
['BMC_BRD_REV_ID1']=137
['BMC_BRD_REV_ID2']=138
['BMC_BRD_REV_ID3']=139
['BMC_BRD_REV_ID4']=140
['BMC_BRD_SKU_ID0']=141
['BMC_BRD_SKU_ID1']=142
['HDD_PRSNT_N']=160
['SPI_SW_SELECT']=169
['BMC_BRD_REV_ID7']=194
['HSBP_BRD_REV_ID0']=196
)
# 1 is active_low 0 is active_high
declare -A GPIO_NAMES_TO_ACTIVE_LOW=(
['RST_BMC_PHY_N']=1
['BMC_BRD_REV_ID6']=0
['BMC_BRD_REV_ID5']=0
['BMC_BRD_SKU_ID3']=0
['BMC_BRD_SKU_ID2']=0
['FM_BMC_CPU_UART_EN']=0
['RST_BMC_RSMRST_N']=1
['RST_KBRST_BMC_CPLD_N']=1
['FAN_BRD_REV_ID0']=0
['FAN_BRD_REV_ID1']=0
['HSBP_BRD_REV_ID3']=0
['HSBP_BRD_REV_ID2']=0
['HSBP_BRD_REV_ID1']=0
['BMC_BRD_REV_ID0']=0
['BMC_BRD_REV_ID1']=0
['BMC_BRD_REV_ID2']=0
['BMC_BRD_REV_ID3']=0
['BMC_BRD_REV_ID4']=0
['BMC_BRD_SKU_ID0']=0
['BMC_BRD_SKU_ID1']=0
['HDD_PRSNT_N']=1
['SPI_SW_SELECT']=0
['BMC_BRD_REV_ID7']=0
['HSBP_BRD_REV_ID0']=0
)
##################################################
# Initializes the gpio state
# This operation is idempotent and can be applied
# repeatedly to the same gpio. It will make sure the
# gpio ends up in the initialized state even if it
# was.
# Arguments:
# $1: GPIO name
# Return:
# 0 if success, non-zero if error
##################################################
init_gpio() {
if (( $# != 1 )); then
echo "Usage: init_gpio name" >&2
return 1
fi
local name=$1
local number=${GPIO_NAMES_TO_NUMBER["${name}"]}
if [[ -z ${number} ]]; then
echo "Missing number info for: ${name}" >&2
return 2
fi
local active_low=${GPIO_NAMES_TO_ACTIVE_LOW["${name}"]}
if [[ -z ${active_low} ]]; then
echo "Missing active_low info for: ${name}" >&2
return 2
fi
if [[ ! -e "/sys/class/gpio/gpio${number}" ]]; then
echo "${number}" >'/sys/class/gpio/export'
fi
echo "${active_low}" >"/sys/class/gpio/gpio${number}/active_low"
}
##################################################
# Set output GPIO direction.
# Arguments:
# $1: GPIO name
# $2: GPIO direction, "high" or "low"
# Return:
# 0 if success, non-zero if error
##################################################
set_gpio_direction() {
if (( $# != 2 )); then
echo 'Usage: set_gpio_direction name direction' >&2
return 1
fi
local name=$1
local direction=$2
local number=${GPIO_NAMES_TO_NUMBER["${name}"]}
if [[ -z ${number} ]]; then
echo "Missing number info for: ${name}" >&2
return 2
fi
init_gpio "${name}" || return
echo "${direction}" >"/sys/class/gpio/gpio${number}/direction"
echo "Set gpio ${name} #${number} to direction ${direction}" >&2
}
##################################################
# Get GPIO value
# Arguments:
# $1: GPIO name
# Return:
# 0 if success, non-zero if error
# stdout: The value of the gpio
##################################################
get_gpio_value() {
if (( $# != 1 )); then
echo 'Usage: get_gpio_value name' >&2
return 1
fi
local name=$1
local number=${GPIO_NAMES_TO_NUMBER["${name}"]}
if [[ -z ${number} ]]; then
echo "Missing number info for: ${name}" >&2
return 2
fi
init_gpio "${name}" || return
cat "/sys/class/gpio/gpio${number}/value"
}
@@ -0,0 +1,15 @@
[Unit]
Description = Initialization for GBS boot up
Requires=gbs-host-ready.target
After=gbs-host-ready.target
Wants=mapper-wait@-xyz-openbmc_project-inventory.service
After=mapper-wait@-xyz-openbmc_project-inventory.service
Wants=mapper-wait@-xyz-openbmc_project-control-nvme.service
After=mapper-wait@-xyz-openbmc_project-control-nvme.service
[Service]
Type=oneshot
ExecStart=/usr/bin/gbs-sysinit.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,278 @@
#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2020 Quanta Computer Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# shellcheck source=meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-gpio-common.sh
source /usr/libexec/gbs-gpio-common.sh
WD1RCR_ADDR=0xf080103c
CORSTC_ADDR=0xf080105c
BOARD_VER="" # Set by check_board_ver
pe_eeprom_addr=( 50 54 )
SERVICE_NAME="xyz.openbmc_project.Inventory.Manager"
INTERFACE_NAME="xyz.openbmc_project.Inventory.Item"
PE_PRESENT_OBJPATH=("/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot0_prsnt"
"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt")
SATA0_PRESENT_OBJPATH="/xyz/openbmc_project/inventory/system/chassis/entity/sata0_prsnt"
set_gpio_persistence() {
reg_val=$(devmem ${WD1RCR_ADDR} 32)
# Clear bit 16-23 to perserve all GPIO states across warm resets
reg_val=$(printf "0x%08x" $((reg_val & ~0xff0000)))
echo "Setting WD1RCR_ADDR to ${reg_val}"
devmem "${WD1RCR_ADDR}" 32 "${reg_val}"
reg_val=$(devmem ${CORSTC_ADDR} 32)
# Clear bit 16-23 of CORSTC
reg_val=$(printf "0x%08x" $((reg_val & ~0xff0000)))
echo "Setting CORSTC_ADDR to ${reg_val}"
devmem "${CORSTC_ADDR}" 32 "${reg_val}"
}
get_board_rev_id() {
echo "$(get_gpio_value 'BMC_BRD_REV_ID7')"\
"$(get_gpio_value 'BMC_BRD_REV_ID6')"\
"$(get_gpio_value 'BMC_BRD_REV_ID5')"\
"$(get_gpio_value 'BMC_BRD_REV_ID4')"\
"$(get_gpio_value 'BMC_BRD_REV_ID3')"\
"$(get_gpio_value 'BMC_BRD_REV_ID2')"\
"$(get_gpio_value 'BMC_BRD_REV_ID1')"\
"$(get_gpio_value 'BMC_BRD_REV_ID0')"\
| sed 's/ //g' > ~/board_rev_id.txt
}
get_board_sku_id() {
echo "$(get_gpio_value 'BMC_BRD_SKU_ID3')"\
"$(get_gpio_value 'BMC_BRD_SKU_ID2')"\
"$(get_gpio_value 'BMC_BRD_SKU_ID1')"\
"$(get_gpio_value 'BMC_BRD_SKU_ID0')"\
| sed 's/ //g' > ~/board_sku_id.txt
}
get_hsbp_board_rev_id() {
echo "$(get_gpio_value 'HSBP_BRD_REV_ID3')"\
"$(get_gpio_value 'HSBP_BRD_REV_ID2')"\
"$(get_gpio_value 'HSBP_BRD_REV_ID1')"\
"$(get_gpio_value 'HSBP_BRD_REV_ID0')"\
| sed 's/ //g' > ~/hsbp_board_rev_id.txt
}
get_fan_board_rev_id() {
echo "$(get_gpio_value 'FAN_BRD_REV_ID1')"\
"$(get_gpio_value 'FAN_BRD_REV_ID0')"\
| sed 's/ //g' > ~/fan_board_rev_id.txt
}
check_board_ver() {
# Sets BOARD_VER to either "PREPVT" or "PVT"
#
# BOARD_REV_ID[7:6] =
# 0x00 - EVT
# 0x01 - DVT
# 0x10 - PVT
# 0x11 - MP
rev7_val=$(get_gpio_value 'BMC_BRD_REV_ID7')
if (( rev7_val == 0 )); then
echo "EVT/DVT rev!"
BOARD_VER="PREPVT"
else
echo "PVT/MP rev!"
BOARD_VER="PVT"
fi
}
check_board_sku() {
sku1_val=$(get_gpio_value 'BMC_BRD_SKU_ID1')
if (( sku1_val == 1 )); then
echo "GBS SKU!"
else
echo "Other SKU!"
fi
}
set_uart_en_low() {
# GPIO76 UART_EN polarity inverted between DVT/PVT
# Pin direction was set high in the kernel.
set_gpio_direction 'FM_BMC_CPU_UART_EN' low
}
set_hdd_prsnt() {
# On PVT need to forward SATA0_PRSNT_N to HDD_PRSNT_N
# The signal is safe to set on DVT boards so just set universally.
mapper wait ${SATA0_PRESENT_OBJPATH}
sata_prsnt_n="$(busctl get-property $SERVICE_NAME ${SATA0_PRESENT_OBJPATH} \
$INTERFACE_NAME Present)"
# sata_prsnt_n is active low => value "true" means low
if [[ ${sata_prsnt_n} == "b true" ]]; then
set_gpio_direction 'HDD_PRSNT_N' low
else
set_gpio_direction 'HDD_PRSNT_N' high
fi
}
KERNEL_FIU_ID="c0000000.spi"
KERNEL_SYSFS_FIU="/sys/bus/platform/drivers/NPCM-FIU"
# the node of FIU is spi for kernel 5.10, but
# for less than or equal kernel 5.4, the node
# is fiu
if ls "$KERNEL_SYSFS_FIU"/*.fiu 1> /dev/null 2>&1; then
KERNEL_FIU_ID="c0000000.fiu"
fi
bind_host_mtd() {
set_gpio_direction 'SPI_SW_SELECT' high
if [[ -d ${KERNEL_SYSFS_FIU}/${KERNEL_FIU_ID} ]]; then
echo "${KERNEL_FIU_ID}" > "${KERNEL_SYSFS_FIU}"/unbind
fi
echo "${KERNEL_FIU_ID}" > "${KERNEL_SYSFS_FIU}"/bind
}
unbind_host_mtd() {
if [[ -d ${KERNEL_SYSFS_FIU}/${KERNEL_FIU_ID} ]]; then
echo "${KERNEL_FIU_ID}" > "${KERNEL_SYSFS_FIU}"/unbind
fi
set_gpio_direction 'SPI_SW_SELECT' low
}
trap unbind_host_mtd EXIT SIGHUP SIGINT SIGTERM
# Taken from /run/initramfs/update
# Given label name, return mtd node. e.g. `findmtd bmc` returns 'mtd0'
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
m=${m%/name}
m=${m##*/}
echo "$m"
}
verify_host_bios() {
echo "BIOS verification start!"
# placeholder for verifying host BIOS. For now time BIOS read
# with dd
bind_host_mtd || { echo "Failed to bind FIU driver for host MTD"; return 1; }
pnor_mtd=$(findmtd pnor)
[[ -z "${pnor_mtd}" ]] && { echo "Failed to find host MTD partition!"; return 1; }
# Test timing by computing SHA256SUM.
sha256sum "/dev/${pnor_mtd}ro"
echo "BIOS verification complete!"
unbind_host_mtd
}
parse_pe_fru() {
pe_fruid=3
for i in {1..2};
do
mapper wait "${PE_PRESENT_OBJPATH[$((i-1))]}"
pe_prsnt_n="$(busctl get-property $SERVICE_NAME "${PE_PRESENT_OBJPATH[$((i-1))]}" \
$INTERFACE_NAME Present)"
if [[ ${pe_prsnt_n} == "b false" ]]; then
pe_fruid=$((pe_fruid+1))
continue
fi
# Output is the i2c bus number for the PCIE cards on PE0/PE1
# i2c-0 -> i2c mux (addr: 0x71) -> PE0/PE1
# PE0: channel 0
# PE1: channel 1
# shellcheck disable=SC2010
pe_fru_bus="$(ls -al /sys/bus/i2c/drivers/pca954x/0-0071/ | grep channel \
| awk -F "/" '{print $(NF)}' | awk -F "-" '{print $2}' | sed -n "${i}p")"
# If the PE FRU EEPROM syspath does not exist, create it ("24c02" is the
# EEPROM part number) and perform a phosphor-read-eeprom
for ((j=0; j < ${#pe_eeprom_addr[@]}; j++));
do
if i2cget -f -y "$pe_fru_bus" "0x${pe_eeprom_addr[$j]}" 0x01 > /dev/null 2>&1 ; then
if [ ! -f "/sys/bus/i2c/devices/$pe_fru_bus-00${pe_eeprom_addr[$j]}/eeprom" ]; then
echo 24c02 "0x${pe_eeprom_addr[$j]}" > "/sys/bus/i2c/devices/i2c-$pe_fru_bus/new_device"
fi
pe_fru_bus="/sys/bus/i2c/devices/$pe_fru_bus-00${pe_eeprom_addr[$j]}/eeprom"
phosphor-read-eeprom --eeprom "$pe_fru_bus" --fruid $pe_fruid
break
fi
done
pe_fruid=$((pe_fruid+1))
done
}
check_power_status() {
res0="$(busctl get-property -j xyz.openbmc_project.State.Chassis \
/xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis \
CurrentPowerState | jq -r '.["data"]')"
echo "$res0"
}
clk_buf_bus_switch="11-0076"
clk_buf_driver="/sys/bus/i2c/drivers/pca954x/"
bind_clk_buf_switch() {
echo "Re-bind i2c bus 11 clk_buf_switch"
echo "${clk_buf_bus_switch}" > "${clk_buf_driver}"/bind
}
main() {
get_board_rev_id
get_board_sku_id
get_hsbp_board_rev_id
get_fan_board_rev_id
check_board_ver
if [[ "${BOARD_VER}" == "PREPVT" ]]; then
set_uart_en_low
fi
check_board_sku
if [[ $(check_power_status) != \
'xyz.openbmc_project.State.Chassis.PowerState.On' ]]; then
verify_host_bios
echo "Release host from reset!" >&2
set_gpio_direction 'RST_BMC_RSMRST_N' high
set_gpio_direction 'RST_KBRST_BMC_CPLD_N' high
# TODO: remove the hack once kernel driver is ready
# Set the GPIO states to preserve across reboots
set_gpio_persistence
echo "Starting host power!" >&2
busctl set-property xyz.openbmc_project.State.Host \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.Host \
RequestedHostTransition s \
xyz.openbmc_project.State.Host.Transition.On
sleep 1
bind_clk_buf_switch
else
echo "Host is already running, doing nothing!" >&2
fi
set_hdd_prsnt
parse_pe_fru
}
# Exit without running main() if sourced
if ! (return 0 2>/dev/null) ; then
main "$@"
fi
@@ -0,0 +1,32 @@
SUMMARY = "Phosphor OpenBMC Quanta GBS System Initialization Service"
DESCRIPTION = "Phosphor OpenBMC Quanta GBS System Init"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
DEPENDS += "systemd"
RDEPENDS:${PN} += "bash"
RDEPENDS:${PN} += "i2c-tools"
RDEPENDS:${PN} += "jq"
RDEPENDS:${PN} += "libsystemd"
SRC_URI = "file://gbs-sysinit.sh \
file://gbs-gpio-common.sh \
file://gbs-sysinit.service \
"
do_install () {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/gbs-sysinit.sh ${D}${bindir}/
install -d ${D}${libexecdir}
install -m 0755 ${WORKDIR}/gbs-gpio-common.sh ${D}${libexecdir}/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/gbs-sysinit.service ${D}${systemd_system_unitdir}
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "gbs-sysinit.service"
@@ -0,0 +1,10 @@
[Unit]
Description=Power Cycle by Hotswap Controller
After=gbmc-psu-hardreset.target
[Service]
Type=oneshot
ExecStart=/usr/bin/tray_powercycle.sh
[Install]
WantedBy=gbmc-psu-hardreset.target
@@ -0,0 +1,38 @@
#!/bin/bash
#
# PSU hard reset (power cycle) script.
#
# Power cycle the entire tray by setting the PSU hotswap reset (GPIO218) to high
#
# Global variable: PSU_HARDRESET_DELAY specifies the number of seconds to wait
# before pulling the trigger. If not specified or zero, the script power cycles
# immediately.
##################################################
# Stop the phosphor-hwmon daemon
# Return:
# 0 if success, non-zero if error
##################################################
stop_phosphor_hwmon() {
if (( $# != 0 )); then
echo 'Usage: stop_phosphor_hwmon' >&2
return 1
fi
echo "Stopping phosphor-hwmon" >&2
local srv='system-xyz.openbmc_project.Hwmon.slice'
systemctl stop "${srv}"
}
main() {
# Stop phosphor-hwmon so that ADM1272 powercycle doesn't happen
# in the middle of an i2c transaction and stuck the bus low
stop_phosphor_hwmon "$@"
gpioset gpiochip6 26=1
}
# Exit without running main() if sourced
if ! (return 0 2>/dev/null) ; then
main "$@"
fi
@@ -0,0 +1,27 @@
SUMMARY = "Power Cycle by Hotswap Controller"
DESCRIPTION = "Power Cycle by Hotswap Controller Daemon"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
DEPENDS += "systemd"
RDEPENDS:${PN} += "bash"
RDEPENDS:${PN} += "libgpiod-tools"
SRC_URI = " file://hotswap-power-cycle.service \
file://tray_powercycle.sh \
"
do_install() {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/hotswap-power-cycle.service ${D}${systemd_system_unitdir}
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/tray_powercycle.sh ${D}${bindir}
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "hotswap-power-cycle.service"
@@ -0,0 +1,10 @@
[Unit]
Description = Check Host State to set fan failsafe speed
[Service]
Type=simple
Restart=on-failure
ExecStart=/usr/bin/gbs-check-host-state.sh
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,13 @@
#!/bin/bash
state="xyz.openbmc_project.State.Chassis.PowerState.Off"
dbus-monitor --system type='signal',interface='org.freedesktop.DBus.Properties',\
member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Chassis' | \
while read -r line; do
grep -q member <<< "$line" && continue
if grep -q $state <<< "$line"; then
echo "Setting failsafe assuming host is off" >&2
systemctl start --no-block gbs-host-s5-set-failsafe
fi
done
@@ -0,0 +1,8 @@
[Unit]
Description=Host is ready to be powered on
Wants=phosphor-ipmi-host.service
After=phosphor-ipmi-host.service
Wants=obmc-console@ttyS1.service
After=obmc-console@ttyS1.service
After=postcode-7seg@seven_seg_disp_val.service
RefuseManualStop=yes
@@ -0,0 +1,15 @@
[Unit]
Description=Increase GBS fan failsafe speed on host kernel entrance
PartOf=host-s0-state.target
Requires=phosphor-pid-control.service
After=phosphor-pid-control.service
Wants=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service
After=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service
[Service]
Type=oneshot
# 255: 100% duty cycle
ExecStart=/usr/bin/gbs-set-failsafe.sh 255
[Install]
WantedBy=host-s0-state.target
@@ -0,0 +1,15 @@
[Unit]
Description=Decrease GBS fan failsafe speed on host shutdown
PartOf=host-s5-state.target
Requires=phosphor-pid-control.service
After=phosphor-pid-control.service
Wants=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service
After=mapper-wait@-xyz-openbmc_project-settings-fanctrl.service
[Service]
Type=oneshot
# 102: 40% duty cycle
ExecStart=/usr/bin/gbs-set-failsafe.sh 102
[Install]
WantedBy=host-s5-state.target
@@ -0,0 +1,14 @@
[Unit]
Description=Set gBMC boot time failsafe
Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
After=acpi-power-state.service
Before=gbs-sysinit.service
[Service]
Type=exec
ExecStart=/usr/bin/gbs-set-boot-failsafe.sh
RemainAfterExit=yes
[Install]
WantedBy=gbs-host-ready.target
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright 2021 Google LLC
# Copyright 2021 Quanta Computer Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
main() {
local pgd_val
pgd_val="$(busctl get-property -j xyz.openbmc_project.State.Chassis \
/xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis \
CurrentPowerState | jq -r '.["data"]')"
if [[ $pgd_val != 'xyz.openbmc_project.State.Chassis.PowerState.On' ]]; then
echo "Setting failsafe assuming host is off" >&2
systemctl start --no-block gbs-host-s5-set-failsafe
else
echo "Setting failsafe assuming host is running" >&2
systemctl start --no-block gbs-host-s0-set-failsafe
fi
}
# Exit without running main() if sourced
if ! (return 0 2>/dev/null); then
main "$@"
fi
@@ -0,0 +1,53 @@
#!/bin/bash
# Copyright 2021 Google LLC
# Copyright 2021 Quanta Computer Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
target_pwm="$1"
if [ -z "$target_pwm" ]; then
echo "Target_pwm is not set" >&2
exit 1
fi
zone_num="$(busctl tree xyz.openbmc_project.State.FanCtrl | grep -c zone)"
result=0
for (( i = 0; i < zone_num; i++ )); do
retries=4
busctl_error=-1
while (( retries > 0 )) && (( busctl_error != 0 )); do
busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone${i} xyz.openbmc_project.Control.FanSpeed Target t "${target_pwm}"
busctl_error=$?
if (( busctl_error != 0 )); then
#Retry setting failsafe. Swampd may be running but zone aren't yet built
#so sleep a second to let them be built
sleep 1
fi
(( retries-=1 )) || true
done
if (( busctl_error != 0 )); then
echo "Failure setting zone${i} fan failsafe to ${target_pwm}" >&2
result=$busctl_error
else
echo "Setting zone${i} fan failsafe to ${target_pwm}"
fi
done
exit $result
@@ -0,0 +1,59 @@
FILESEXTRAPATHS:prepend:gbs := "${THISDIR}/${PN}:"
SRC_URI:append:gbs = " \
file://gbs-host-s0-set-failsafe.service \
file://gbs-host-s5-set-failsafe.service \
file://gbs-host-set-boot-failsafe@.service \
file://gbs-check-host-state.service \
file://gbs-set-boot-failsafe.sh \
file://gbs-set-failsafe.sh \
file://gbs-check-host-state.sh \
file://gbs-host-ready.target \
"
RDEPENDS:${PN}:append:gbs = "bash"
CHASSIS_INSTANCE="0"
SYSTEMD_SERVICE:${PN}:append:gbs = " \
gbs-host-s0-set-failsafe.service \
gbs-host-s5-set-failsafe.service \
gbs-check-host-state.service \
gbs-host-ready.target \
"
FILES:${PN}:append:gbs = " \
${systemd_system_unitdir}/gbs-host-set-boot-failsafe@.service \
"
do_install:append:gbs() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/gbs-set-failsafe.sh ${D}${bindir}/.
install -m 0755 ${WORKDIR}/gbs-set-boot-failsafe.sh ${D}${bindir}/.
install -m 0755 ${WORKDIR}/gbs-check-host-state.sh ${D}${bindir}/.
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/gbs-host-s0-set-failsafe.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/gbs-host-s5-set-failsafe.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/gbs-host-set-boot-failsafe@.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/gbs-check-host-state.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/gbs-host-ready.target ${D}${systemd_system_unitdir}
}
pkg_postinst:${PN}:append() {
mkdir -p $D$systemd_system_unitdir/gbs-host-ready.target.wants
for i in ${OBMC_CHASSIS_INSTANCES};
do
LINK="$D$systemd_system_unitdir/gbs-host-ready.target.wants/gbs-host-set-boot-failsafe@${i}.service"
TARGET="../gbs-host-set-boot-failsafe@.service"
ln -s $TARGET $LINK
done
}
pkg_prerm:${PN}:append() {
for i in ${OBMC_CHASSIS_INSTANCES};
do
LINK="$D$systemd_system_unitdir/gbs-host-ready.target.wants/gbs-host-set-boot-failsafe@${i}.service"
rm $LINK
done
}
@@ -0,0 +1,126 @@
# Support full 1G memory for userspace on BMC
CONFIG_VMSPLIT_3G_OPT=y
CONFIG_NET_NCSI=y
# Enable available sensors
CONFIG_HWMON=y
CONFIG_PMBUS=y
CONFIG_SENSORS_PMBUS=y
CONFIG_SENSORS_MAX34440=y
CONFIG_SENSORS_LM75=y
CONFIG_SENSORS_SBTSI=y
CONFIG_SENSORS_ISL68137=y
CONFIG_SENSORS_ADM1275=y
CONFIG_NPCM7XX_ADC=y
CONFIG_SENSORS_IIO_HWMON=y
CONFIG_SENSORS_FAN=y
CONFIG_SENSORS_JC42=y
CONFIG_SENSORS_MAX31790=y
CONFIG_SENSORS_UCD9000=y
# Enable for firmware update LPC.
CONFIG_DEVMEM=y
# Enable seven seg display
CONFIG_SEVEN_SEGMENT_DISPLAY=y
CONFIG_SEVEN_SEGMENT_GPIO=y
# Enable GPIO LEDS
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
# Allow userspace to blink LEDs
CONFIG_LEDS_TRIGGER_TIMER=y
# Blink BMC fault when kernel panics
CONFIG_LEDS_TRIGGER_PANIC=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
# Enable pstore(ramoops) to capture kernel panics
CONFIG_PSTORE=y
CONFIG_PSTORE_RAM=y
CONFIG_PSTORE_DEFLATE_COMPRESS=y
# Enable Nuvoton ECC
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_DEBUG=y
CONFIG_EDAC_LEGACY_SYSFS=y
CONFIG_EDAC_NPCM7XX=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EDAC=y
CONFIG_RAS=y
# Enable Nuvoton JTAG
CONFIG_NPCM7XX_JTAG_MASTER=y
# USB
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_SUBSET=y
CONFIG_USB_GADGET_NPCM_USB2=y
CONFIG_USB_NPCM_UDC=y
CONFIG_USB_OHCI_HCD_NPCM7XX=y
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_U_ETHER=y
# SPI
CONFIG_SPI=y
CONFIG_SPI_NPCM_FIU=y
CONFIG_SPI_NPCM_PSPI=y
# I2C support
CONFIG_I2C_MUX_LTC4306=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_MUX=y
CONFIG_I2C_SLAVE_EEPROM=y
CONFIG_I2C_SLAVE_MQUEUE=y
CONFIG_I2C_SLAVE=y
# I2C GPIO expanders
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCF857X=y
# Enable phsophor-gpio-keys feature
CONFIG_INPUT_EVDEV=y
# Need for CONFIG_KEYBOARD_GPIO Kconfig
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_GPIO=y
# Enable the IPMI KCS driver
CONFIG_IPMI_KCS_BMC_CDEV_IPMI=y
# Misc
CONFIG_OVERLAY_FS=y
CONFIG_JFFS2_FS=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RESET_NPCM=y
CONFIG_IPVLAN=y
CONFIG_VLAN_8021Q=y
CONFIG_DEVKMEM=y
CONFIG_EEPROM_AT24=y
CONFIG_FORCE_MAX_ZONEORDER=12
CONFIG_IIO_MUX=y
CONFIG_IIO=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MFD_SYSCON=y
CONFIG_MTD_M25P80=y
CONFIG_MUX_MMIO=y
CONFIG_NPCM7XX_LPC_BPC=y
CONFIG_MTD_PARTITIONED_MASTER=y
# Enable hmac api for UUID
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_USER_API_HASH=y
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend:gbs := "${THISDIR}/linux-nuvoton:"
SRC_URI:append:gbs = " file://gbs.cfg"
@@ -0,0 +1,35 @@
SUMMARY = "YAML configuration for gbs"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit allarch
SRC_URI = " \
file://gbs-ipmi-fru.yaml \
file://gbs-ipmi-sensors.yaml \
file://gbs-ipmi-fru-properties.yaml \
file://gbs-ipmi-inventory-sensors.yaml \
"
S = "${WORKDIR}"
do_install() {
install -m 0644 -D gbs-ipmi-fru.yaml \
${D}${datadir}/${BPN}/ipmi-fru-read.yaml
install -m 0644 -D gbs-ipmi-sensors.yaml \
${D}${datadir}/${BPN}/ipmi-sensors.yaml
install -m 0644 -D gbs-ipmi-fru-properties.yaml \
${D}${datadir}/${BPN}/ipmi-extra-properties.yaml
install -m 0644 -D gbs-ipmi-inventory-sensors.yaml \
${D}${datadir}/${BPN}/ipmi-inventory-sensors.yaml
}
FILES:${PN}-dev = " \
${datadir}/${BPN}/ipmi-fru-read.yaml \
${datadir}/${BPN}/ipmi-sensors.yaml \
${datadir}/${BPN}/ipmi-extra-properties.yaml \
${datadir}/${BPN}/ipmi-inventory-sensors.yaml \
"
ALLOW_EMPTY:${PN} = "1"
@@ -0,0 +1,183 @@
/system/chassis/motherboard:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/hsbp:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/fan:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/PE0:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/PE0/PE0:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/PE1:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/PE1/PE1:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme0:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme1:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme2:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme3:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme4:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme5:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme6:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme7:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme8:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme9:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme10:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme11:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme12:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme13:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme14:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
/system/chassis/motherboard/nvme15:
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: 'true'
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: 'true'
xyz.openbmc_project.Inventory.Item:
Present: 'true'
@@ -0,0 +1,228 @@
0x00:
/system/chassis/motherboard:
entityID: 7
entityInstance: 0x00
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item.System:
0x01:
/system/chassis/hsbp:
entityID: 7
entityInstance: 0x01
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
0x02:
/system/chassis/fan:
entityID: 7
entityInstance: 0x02
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
0x03:
/system/chassis/PE0: &ADD_IN_CARD_BOARD_DEFAULTS
entityID: 11
entityInstance: 0x00
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
/system/chassis/PE0/PE0: &ADD_IN_CARD_PRODUCT_DEFAULTS
entityID: 11
entityInstance: 0x00
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Product
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Product
Model:
IPMIFruProperty: Model Number
IPMIFruSection: Product
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Product
0x04:
/system/chassis/PE1:
entityInstance: 0x01
<<: *ADD_IN_CARD_BOARD_DEFAULTS
/system/chassis/PE1/PE1:
entityInstance: 0x01
<<: *ADD_IN_CARD_PRODUCT_DEFAULTS
0x05:
/system/chassis/motherboard/nvme0: &NVME_BOARD_DEFAULTS
entityID: 4
entityInstance: 0x60
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Product
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Product
Model:
IPMIFruProperty: Model Number
IPMIFruSection: Product
0x06:
/system/chassis/motherboard/nvme1:
entityInstance: 0x61
<<: *NVME_BOARD_DEFAULTS
0x07:
/system/chassis/motherboard/nvme2:
entityInstance: 0x62
<<: *NVME_BOARD_DEFAULTS
0x08:
/system/chassis/motherboard/nvme3:
entityInstance: 0x63
<<: *NVME_BOARD_DEFAULTS
0x09:
/system/chassis/motherboard/nvme4:
entityInstance: 0x64
<<: *NVME_BOARD_DEFAULTS
0x0A:
/system/chassis/motherboard/nvme5:
entityInstance: 0x65
<<: *NVME_BOARD_DEFAULTS
0x0B:
/system/chassis/motherboard/nvme6:
entityInstance: 0x66
<<: *NVME_BOARD_DEFAULTS
0x0C:
/system/chassis/motherboard/nvme7:
entityInstance: 0x67
<<: *NVME_BOARD_DEFAULTS
0x0D:
/system/chassis/motherboard/nvme8:
entityInstance: 0x68
<<: *NVME_BOARD_DEFAULTS
0x0E:
/system/chassis/motherboard/nvme9:
entityInstance: 0x69
<<: *NVME_BOARD_DEFAULTS
0x0F:
/system/chassis/motherboard/nvme10:
entityInstance: 0x6A
<<: *NVME_BOARD_DEFAULTS
0x10:
/system/chassis/motherboard/nvme11:
entityInstance: 0x6B
<<: *NVME_BOARD_DEFAULTS
0x11:
/system/chassis/motherboard/nvme12:
entityInstance: 0x6C
<<: *NVME_BOARD_DEFAULTS
0x12:
/system/chassis/motherboard/nvme13:
entityInstance: 0x6D
<<: *NVME_BOARD_DEFAULTS
0x13:
/system/chassis/motherboard/nvme14:
entityInstance: 0x6E
<<: *NVME_BOARD_DEFAULTS
0x14:
/system/chassis/motherboard/nvme15:
entityInstance: 0x6F
<<: *NVME_BOARD_DEFAULTS
@@ -0,0 +1,446 @@
/xyz/openbmc_project/sensors/temperature/i2cool_0:
eventReadingType: 1
sensorID: 0x10
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/i2cool_1:
eventReadingType: 1
sensorID: 0x11
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/i2cool_2:
eventReadingType: 1
sensorID: 0x12
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/powerseq_temp:
eventReadingType: 1
sensorID: 0x13
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/cputemp:
eventReadingType: 1
sensorID: 0x14
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme0:
eventReadingType: 1
sensorID: 0x15
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme1:
eventReadingType: 1
sensorID: 0x16
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme2:
eventReadingType: 1
sensorID: 0x17
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme3:
eventReadingType: 1
sensorID: 0x18
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme4:
eventReadingType: 1
sensorID: 0x19
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme5:
eventReadingType: 1
sensorID: 0x1A
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme6:
eventReadingType: 1
sensorID: 0x1B
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme7:
eventReadingType: 1
sensorID: 0x1C
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme8:
eventReadingType: 1
sensorID: 0x1D
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme9:
eventReadingType: 1
sensorID: 0x1E
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme10:
eventReadingType: 1
sensorID: 0x1F
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme11:
eventReadingType: 1
sensorID: 0x20
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme12:
eventReadingType: 1
sensorID: 0x21
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme13:
eventReadingType: 1
sensorID: 0x22
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme14:
eventReadingType: 1
sensorID: 0x23
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/nvme15:
eventReadingType: 1
sensorID: 0x24
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/vddcr_cpu:
eventReadingType: 1
sensorID: 0x27
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/vddcr_soc:
eventReadingType: 1
sensorID: 0x28
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/vddio_abcd:
eventReadingType: 1
sensorID: 0x29
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/vddio_efgh:
eventReadingType: 1
sensorID: 0x2A
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/p12v_mobo:
eventReadingType: 1
sensorID: 0x2B
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/p12v_fan:
eventReadingType: 1
sensorID: 0x2C
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/hotswap:
eventReadingType: 1
sensorID: 0x2D
sensorType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p1v8_stby:
eventReadingType: 1
sensorID: 0x30
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddcr_soc_stby:
eventReadingType: 1
sensorID: 0x31
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p2v5_stby:
eventReadingType: 1
sensorID: 0x32
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p1v2_stby:
eventReadingType: 1
sensorID: 0x33
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p1v175_stby:
eventReadingType: 1
sensorID: 0x34
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p1v8:
eventReadingType: 1
sensorID: 0x35
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p3v3:
eventReadingType: 1
sensorID: 0x36
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/pwrgd_pvpp:
eventReadingType: 1
sensorID: 0x37
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/pwrgd_pvddio:
eventReadingType: 1
sensorID: 0x38
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/pwrgd_cpuvr:
eventReadingType: 1
sensorID: 0x39
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p3v3_stby:
eventReadingType: 1
sensorID: 0x3A
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p5v_stby:
eventReadingType: 1
sensorID: 0x3B
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddcr_cpu_in:
eventReadingType: 1
sensorID: 0x3C
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddcr_cpu_out:
eventReadingType: 1
sensorID: 0x3D
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddcr_soc_in:
eventReadingType: 1
sensorID: 0x3E
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddcr_soc_out:
eventReadingType: 1
sensorID: 0x3F
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddio_abcd_out:
eventReadingType: 1
sensorID: 0x40
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddio_abcd_in:
eventReadingType: 1
sensorID: 0x41
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddio_efgh_out:
eventReadingType: 1
sensorID: 0x42
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/vddio_efgh_in:
eventReadingType: 1
sensorID: 0x43
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/hotswap_vin:
eventReadingType: 1
sensorID: 0x44
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/hotswap_vout:
eventReadingType: 1
sensorID: 0x45
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p3v_bat_adc:
eventReadingType: 1
sensorID: 0x46
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p12v_mobo_out:
eventReadingType: 1
sensorID: 0x47
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p12v_mobo_in:
eventReadingType: 1
sensorID: 0x48
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p12v_fan_out:
eventReadingType: 1
sensorID: 0x49
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/voltage/p12v_fan_in:
eventReadingType: 1
sensorID: 0x4A
sensorType: 2
offset: 0xff
/xyz/openbmc_project/sensors/current/vddcr_cpu_in:
eventReadingType: 1
sensorID: 0x50
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddcr_cpu_out:
eventReadingType: 1
sensorID: 0x51
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddcr_soc_in:
eventReadingType: 1
sensorID: 0x52
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddcr_soc_out:
eventReadingType: 1
sensorID: 0x53
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddio_abcd_in:
eventReadingType: 1
sensorID: 0x55
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddio_abcd_out:
eventReadingType: 1
sensorID: 0x54
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddio_efgh_in:
eventReadingType: 1
sensorID: 0x57
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/vddio_efgh_out:
eventReadingType: 1
sensorID: 0x56
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/p12v_mobo_in:
eventReadingType: 1
sensorID: 0x5A
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/p12v_mobo_out:
eventReadingType: 1
sensorID: 0x59
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/p12v_fan_in:
eventReadingType: 1
sensorID: 0x5C
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/p12v_fan_out:
eventReadingType: 1
sensorID: 0x5B
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/current/hotswap_iout:
eventReadingType: 1
sensorID: 0x58
sensorType: 3
offset: 0xff
/xyz/openbmc_project/sensors/power/hotswap_pout:
eventReadingType: 1
sensorID: 0x70
sensorType: 0x0B
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/fan0:
eventReadingType: 1
sensorID: 0x60
sensorType: 4
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/fan1:
eventReadingType: 1
sensorID: 0x61
sensorType: 4
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/fb_fan0:
eventReadingType: 1
sensorID: 0x62
sensorType: 4
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/fb_fan1:
eventReadingType: 1
sensorID: 0x63
sensorType: 4
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/fb_fan2:
eventReadingType: 1
sensorID: 0x64
sensorType: 4
offset: 0xff
/xyz/openbmc_project/metrics/memory/BmcECC:
eventReadingType: 0x6f
sensorID: 0xF0
sensorType: 0x0C
offset: 0x00
/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab0_prsnt:
eventReadingType: 0x6f
sensorID: 0xF1
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab1_prsnt:
eventReadingType: 0x6f
sensorID: 0xF2
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab2_prsnt:
eventReadingType: 0x6f
sensorID: 0xF3
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/cable/ss_cab3_prsnt:
eventReadingType: 0x6f
sensorID: 0xF4
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/entity/sata0_prsnt:
eventReadingType: 0x6f
sensorID: 0xF5
sensorType: 0x25
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/cable/hsbp_cab_prsnt:
eventReadingType: 0x6f
sensorID: 0xF6
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/cable/fanbd_cab_prsnt:
eventReadingType: 0x6f
sensorID: 0xF7
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/cable/bp12v_cab_prsnt:
eventReadingType: 0x6f
sensorID: 0xF8
sensorType: 0x1B
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot0_prsnt:
eventReadingType: 0x6f
sensorID: 0xF9
sensorType: 0x25
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt:
eventReadingType: 0x6f
sensorID: 0xFA
sensorType: 0x25
offset: 0x01
/xyz/openbmc_project/watchdog/host0:
eventReadingType: 0x6f
sensorID: 0xFB
sensorType: 0x23
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/entity/fans_efuse_pg:
eventReadingType: 0x6f
sensorID: 0xFC
sensorType: 0x25
offset: 0x01
/xyz/openbmc_project/inventory/system/chassis/entity/pwrgd_p12v_slots:
eventReadingType: 0x6f
sensorID: 0xFD
sensorType: 0x25
offset: 0x01
# map non-IPMI-SEL to the system event sensor as "Undetermined system hardware failure."
/xyz/openbmc_project/inventory/system:
eventReadingType: 0x6f
sensorID: 0xFE
sensorType: 0x12
offset: 0x02
@@ -0,0 +1 @@
baud = 115200
@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend:gbs := "${THISDIR}/files:"
OBMC_CONSOLE_FRONT_TTY:gbs = "ttyS3"
OBMC_CONSOLE_HOST_TTY:gbs = "ttyS1"
@@ -0,0 +1,947 @@
{
"version": "R05",
"sensors": [
{
"name": "fan0",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/fan0",
"writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm1",
"min": 0,
"max": 255
},
{
"name": "fan1",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/fan1",
"writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm2",
"min": 0,
"max": 255
},
{
"name": "fb_fan0",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/fb_fan0",
"writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm3",
"min": 0,
"max": 255
},
{
"name": "fb_fan1",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/fb_fan1",
"writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm4",
"min": 0,
"max": 255
},
{
"name": "fb_fan2",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/fb_fan2",
"writePath": "/sys/devices/platform/ahb/ahb:apb/f0103000.pwm-fan-controller/hwmon/@Fan_0_To_4_Hwmon@/pwm5",
"min": 0,
"max": 255
},
{
"name": "fleeting0",
"type": "margin",
"readPath": "/xyz/openbmc_project/extsensors/margin/fleeting0",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "fleeting1",
"type": "margin",
"readPath": "/xyz/openbmc_project/extsensors/margin/fleeting1",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "fleeting2",
"type": "margin",
"readPath": "/xyz/openbmc_project/extsensors/margin/fleeting2",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "cputemp",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/cputemp",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "vddcr_cpu",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/vddcr_cpu",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "vddcr_soc",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/vddcr_soc",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "vddio_abcd",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/vddio_abcd",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "vddio_efgh",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/vddio_efgh",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "p12v_mobo",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/p12v_mobo",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "powerseq_temp",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/powerseq_temp",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "p12v_fan",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/p12v_fan",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme0",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme0",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme1",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme1",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme2",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme2",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme3",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme3",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme4",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme4",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme5",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme5",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme6",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme6",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme7",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme7",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme8",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme8",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme9",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme9",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme10",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme10",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme11",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme11",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme12",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme12",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme13",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme13",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme14",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme14",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "nvme15",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/nvme15",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
}
],
"zones": [
{
"id": 0,
"minThermalOutput": 0.0,
"failsafePercent": 100.0,
"pids": [
{
"name": "fan0",
"type": "fan",
"inputs": [
"fan0"
],
"setpoint": 0.0,
"pid": {
"samplePeriod": 0.1,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0056,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 15.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "fan1",
"type": "fan",
"inputs": [
"fan1"
],
"setpoint": 0.0,
"pid": {
"samplePeriod": 0.1,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0056,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 15.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "cputemp",
"type": "temp",
"inputs": [
"cputemp"
],
"setpoint": 80.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -714.0,
"integralCoeff": -9.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "zone0_vr",
"type": "temp",
"inputs": [
"vddcr_cpu",
"vddcr_soc",
"vddio_abcd",
"vddio_efgh",
"p12v_mobo",
"powerseq_temp"
],
"setpoint": 90.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -536.0,
"integralCoeff": -9.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "fleeting0",
"type": "margin",
"inputs": [
"fleeting0"
],
"setpoint": 10.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 536.0,
"integralCoeff": 9.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "fleeting1",
"type": "margin",
"inputs": [
"fleeting1"
],
"setpoint": 10.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 536.0,
"integralCoeff": 18.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "fleeting2",
"type": "margin",
"inputs": [
"fleeting2"
],
"setpoint": 10.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 536.0,
"integralCoeff": 18.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
}
]
},
{
"id": 1,
"minThermalOutput": 0.0,
"failsafePercent": 100.0,
"pids": [
{
"name": "fb_fan0",
"type": "fan",
"inputs": [
"fb_fan0"
],
"setpoint": 0.0,
"pid": {
"samplePeriod": 0.1,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0056,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 15.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "fb_fan1",
"type": "fan",
"inputs": [
"fb_fan1"
],
"setpoint": 0.0,
"pid": {
"samplePeriod": 0.1,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0056,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 15.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "fb_fan2",
"type": "fan",
"inputs": [
"fb_fan2"
],
"setpoint": 0.0,
"pid": {
"samplePeriod": 0.1,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0056,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 15.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "p12v_fan",
"type": "temp",
"inputs": [
"p12v_fan"
],
"setpoint": 90.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -268.0,
"integralCoeff": -4.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme0",
"type": "temp",
"inputs": [
"nvme0"
],
"setpoint": @WCTemp00@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme1",
"type": "temp",
"inputs": [
"nvme1"
],
"setpoint": @WCTemp01@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme2",
"type": "temp",
"inputs": [
"nvme2"
],
"setpoint": @WCTemp02@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme3",
"type": "temp",
"inputs": [
"nvme3"
],
"setpoint": @WCTemp03@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme4",
"type": "temp",
"inputs": [
"nvme4"
],
"setpoint": @WCTemp04@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme5",
"type": "temp",
"inputs": [
"nvme5"
],
"setpoint": @WCTemp05@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme6",
"type": "temp",
"inputs": [
"nvme6"
],
"setpoint": @WCTemp06@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme7",
"type": "temp",
"inputs": [
"nvme7"
],
"setpoint": @WCTemp07@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme8",
"type": "temp",
"inputs": [
"nvme8"
],
"setpoint": @WCTemp08@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme9",
"type": "temp",
"inputs": [
"nvme9"
],
"setpoint": @WCTemp09@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme10",
"type": "temp",
"inputs": [
"nvme10"
],
"setpoint": @WCTemp10@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme11",
"type": "temp",
"inputs": [
"nvme11"
],
"setpoint": @WCTemp11@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme12",
"type": "temp",
"inputs": [
"nvme12"
],
"setpoint": @WCTemp12@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme13",
"type": "temp",
"inputs": [
"nvme13"
],
"setpoint": @WCTemp13@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme14",
"type": "temp",
"inputs": [
"nvme14"
],
"setpoint": @WCTemp14@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
},
{
"name": "nvme15",
"type": "temp",
"inputs": [
"nvme15"
],
"setpoint": @WCTemp15@,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": -1250.0,
"integralCoeff": -12.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 0.0,
"integralLimit_min": 2679.0,
"integralLimit_max": 18000.0,
"outLim_min": 2679.0,
"outLim_max": 18000.0,
"slewNeg": 0.0,
"slewPos": 0.0,
"positiveHysteresis": 0.0,
"negativeHysteresis": 0.0
}
}
]
}
]
}
@@ -0,0 +1,88 @@
#!/bin/bash
FAN_TABLE_FILE_IN="/usr/share/swampd/config.json.in"
TEMP_FILE="$(mktemp)"
cp "$FAN_TABLE_FILE_IN" "$TEMP_FILE"
# wait for fan dbus
mapper wait /xyz/openbmc_project/sensors/fan_tach/fan0
mapper wait /xyz/openbmc_project/sensors/fan_tach/fan1
mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan0
mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan1
mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan2
# generate fan table writePath
Fan_0_To_4_Hwmon="$(ls /sys/devices/platform/ahb/ahb:*/*pwm-fan-controller/hwmon/)"
if [[ "$Fan_0_To_4_Hwmon" != "" ]]; then
sed -i "s/@Fan_0_To_4_Hwmon@/$Fan_0_To_4_Hwmon/g" "$TEMP_FILE"
fi
presentGpio=()
presentState=()
gpioPath="/sys/class/gpio/gpio"
if [[ -f "/etc/nvme/nvme_config.json" ]]; then
# shellcheck disable=SC2207
presentGpio=($(grep NVMeDrivePresentPin /etc/nvme/nvme_config.json \
| awk '{print $2}' | cut -d "," -f 0))
fi
nvmePath="/xyz/openbmc_project/sensors/temperature/nvme"
# Get and Set WCTEMP
for ((i = 0; i < 16; i++)); do
name="@WCTemp$(printf "%02d" $i)@"
wcTemp=72000
if [[ -d "${gpioPath}${presentGpio[i]}" ]] &&
[[ "$(cat "${gpioPath}${presentGpio[i]}/value")" == "0" ]]; then
presentState[i]="true"
else
presentState[i]="false"
fi
if [[ "${presentState[i]}" == "true" ]]; then
actualWCTemp=0
for ((j = 0; j < 3; j++)); do
actualWCTemp="$(
busctl get-property xyz.openbmc_project.nvme.manager \
${nvmePath}${i} \
xyz.openbmc_project.Sensor.Threshold.Critical \
CriticalHigh | awk '{print $2}'
)"
if [[ "${actualWCTemp}" -ne 0 ]]; then
break
fi
echo "${nvmePath}${i} WCTemp was read to be 0, retrying after 1 sec sleep"
sleep 1
done
if [[ "${actualWCTemp}" -ne 0 ]]; then
wcTemp="$(echo "${actualWCTemp} -7" | awk '{printf $1 + $2}')"
else
echo "${nvmePath}${i} WCTemp was read to be 0, using default WCTemp: ${wcTemp}"
fi
fi
sed -i "s/$name/${wcTemp}/g" "$TEMP_FILE"
if [[ "${presentState[i]}" == "false" ]]; then
sensorPath="${nvmePath}${i}"
pathLine=$(grep -nw "$sensorPath" "$TEMP_FILE" | awk -F ':' '{print $1}')
sed -i "$TEMP_FILE" -re "$((pathLine - 3)),$((pathLine + 6))d"
if [ $i -eq 15 ]; then
sed -i "$((pathLine - 4))s/,//" "$TEMP_FILE"
fi
listLine=$(grep -n "\"name\": \"nvme${i}\"" "$TEMP_FILE" | awk -F ':' '{print $1}')
sed -i "$TEMP_FILE" -re "$((listLine - 1)),$((listLine + 21))d"
if [ $i -eq 15 ]; then
sed -i "$((listLine - 2))s/,//" "$TEMP_FILE"
fi
fi
done
# Use shell parameter expansion to trim the ".in" suffix
mv "$TEMP_FILE" "${FAN_TABLE_FILE_IN%".in"}"
exit 0
@@ -0,0 +1,15 @@
[Unit]
Description=Swampd Margin-based Fan Control Daemon
After=xyz.openbmc_project.Hwmon@-ahb-apb-pwm\x2dfan\x2dcontroller\x40103000.service
After=xyz.openbmc_project.nvme.manager.service
[Service]
Type=simple
ExecStartPre=/usr/bin/fan-table-init.sh
ExecStart=/usr/bin/swampd
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=basic.target
@@ -0,0 +1,25 @@
FILESEXTRAPATHS:prepend:gbs := "${THISDIR}/${PN}:"
SRC_URI:append:gbs = " file://config.json.in \
file://fan-table-init.sh \
file://phosphor-pid-control.service \
"
FILES:${PN}:append:gbs = " ${datadir}/swampd/config.json.in"
FILES:${PN}:append:gbs = " ${bindir}/fan-table-init.sh"
RDEPENDS:${PN} += "bash"
SYSTEMD_SERVICE:${PN}:append:gbs = " phosphor-pid-control.service"
do_install:append:gbs() {
install -d ${D}/${bindir}
install -m 0755 ${WORKDIR}/fan-table-init.sh ${D}/${bindir}
install -d ${D}${datadir}/swampd
install -m 0644 -D ${WORKDIR}/config.json.in \
${D}${datadir}/swampd/
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/phosphor-pid-control.service \
${D}${systemd_system_unitdir}
}
@@ -0,0 +1,6 @@
#The gpio 73 is a real gpio, which is used to
#store the sas cable 0 present signal
INVENTORY=/system/chassis/cable/ss_cab0_prsnt
DEVPATH=/dev/input/event0
KEY=73
NAME=ss_cab0_prsnt
@@ -0,0 +1,6 @@
#The gpio 72 is a real gpio, which is used to
#store the sas cable 1 present signal
INVENTORY=/system/chassis/cable/ss_cab1_prsnt
DEVPATH=/dev/input/event0
KEY=72
NAME=ss_cab1_prsnt
@@ -0,0 +1,6 @@
#The gpio 146 is a real gpio, which is used to
#store the PWRGD_P12V_ALL_FANS signal
INVENTORY=/system/chassis/entity/fans_efuse_pg
DEVPATH=/dev/input/event0
KEY=146
NAME=fans_efuse_pg

Some files were not shown because too many files have changed in this diff Show More