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
+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 += "jade-layer"
BBFILE_PATTERN_jade-layer := "^${LAYERDIR}/"
LAYERSERIES_COMPAT_jade-layer = "langdale mickledore"
@@ -0,0 +1,44 @@
KMACHINE = "aspeed"
KERNEL_DEVICETREE = "${KMACHINE}-bmc-ampere-${MACHINE}.dtb"
UBOOT_MACHINE = "evb-ast2500_defconfig"
UBOOT_DEVICETREE = "ast2500-evb"
require conf/machine/include/ast2500.inc
require conf/machine/include/obmc-bsp-common.inc
require conf/distro/include/phosphor-aspeed-spi-master-mode.inc
# Reformat SPI flash layout to 64MB
FLASH_SIZE = "65536"
MACHINE_FEATURES += "\
obmc-phosphor-chassis-mgmt \
obmc-phosphor-flash-mgmt \
obmc-phosphor-fan-mgmt \
obmc-chassis-state-mgmt \
obmc-host-state-mgmt \
obmc-bmc-state-mgmt \
obmc-host-ipmi \
"
VOLATILE_LOG_DIR = "no"
OBMC_IMAGE_EXTRA_INSTALL:append = "\
ampere-utils \
ampere-usbnet \
ampere-mac-update \
mtjade-gpio-config \
ampere-platform-init \
ampere-ipmi-oem \
phosphor-ipmi-blobs \
phosphor-ipmi-blobs-binarystore \
ampere-driver-binder \
ampere-fault-monitor \
"
PREFERRED_PROVIDER_virtual/obmc-chassis-mgmt = "packagegroup-ampere-apps"
PREFERRED_PROVIDER_virtual/obmc-system-mgmt = "packagegroup-ampere-apps"
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-ssif"
PREFERRED_PROVIDER_virtual/obmc-flash-mgmt = "packagegroup-ampere-apps"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "hostboot-inventory-config-native"
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "mtjade-led-manager-config-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-ampere \
##OEROOT##/meta-ampere/meta-jade \
"
@@ -0,0 +1,2 @@
Common targets are:
obmc-phosphor-image
@@ -0,0 +1,214 @@
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
#
# Machine Selection
#
MACHINE ??= "mtjade"
#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
#DL_DIR ?= "${TOPDIR}/downloads"
#
# Where to place shared-state files
#
# BitBake has the capability to accelerate builds based on previously built output.
# This is done using "shared state" files which can be thought of as cache objects
# and this option determines where those files are placed.
#
# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
# from these files if no changes were made to the configuration. If changes were made
# to the configuration, only shared state files where the state was still valid would
# be used (done using checksums).
#
# The default is a sstate-cache directory under TOPDIR.
#
#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
#
# Where to place the build output
#
# This option specifies where the bulk of the building work should be done and
# where BitBake should place its temporary files and output. Keep in mind that
# this includes the extraction and compilation of many applications and the toolchain
# which can use Gigabytes of hard disk space.
#
# The default is a tmp directory under TOPDIR.
#
#TMPDIR = "${TOPDIR}/tmp"
#
# Default policy config
#
# The distribution setting controls which policy settings are used as defaults.
# The default value is fine for general Yocto project use, at least initially.
# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
DISTRO ?= "openbmc-phosphor"
# As an example of a subclass there is a "bleeding" edge policy configuration
# where many versions are set to the absolute latest code from the upstream
# source control systems. This is just mentioned here as an example, its not
# useful to most new users.
# DISTRO ?= "poky-bleeding"
#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends
# can be enabled at once and the first item listed in the variable will be used
# to generate the root filesystems.
# Options are:
# - 'package_deb' for debian style deb files
# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to ipk:
PACKAGE_CLASSES ?= "package_ipk"
#
# SDK/ADT target architecture
#
# This variable specifies the architecture to build SDK/ADT items for and means
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host).
# Supported values are i686 and x86_64
#SDKMACHINE ?= "i686"
SANITY_TESTED_DISTROS:append ?= " *"
#
# Extra image configuration defaults
#
# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
# images. Some of these options are added to certain image types automatically. The
# variable can contain the following options:
# "dbg-pkgs" - add -dbg packages for all installed packages
# (adds symbol information for debugging/profiling)
# "dev-pkgs" - add -dev packages for all installed packages
# (useful if you want to develop against libs in the image)
# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
# (useful if you want to run the package test suites)
# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
# "tools-debug" - add debugging tools (gdb, strace)
# "eclipse-debug" - add Eclipse remote debugging support
# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind)
# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
# "debug-tweaks" - make an image suitable for development
# e.g. ssh root access has a blank password
# There are other application targets that can be used here too, see
# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
# We default to enabling the debugging tweaks.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
#
# Additional image features
#
# The following is a list of additional classes to use when building images which
# enable extra features. Some available options which can be included in this variable
# are:
# - 'buildstats' collect build statistics
# - 'image-swab' to perform host system intrusion detection
# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
USER_CLASSES ?= "buildstats"
#
# Runtime testing of images
#
# The build system can test booting virtual machine images under qemu (an emulator)
# after any root filesystems are created and run tests against those images. To
# enable this uncomment this line. See classes/testimage(-auto).bbclass for
# further details.
#TEST_IMAGE = "1"
#
# Interactive shell configuration
#
# Under certain circumstances the system may need input from you and to do this it
# can launch an interactive shell. It needs to do this since the build is
# multithreaded and needs to be able to handle the case where more than one parallel
# process may require the user's attention. The default is iterate over the available
# terminal types to find one that works.
#
# Examples of the occasions this may happen are when resolving patches which cannot
# be applied, to use the devshell or the kernel menuconfig
#
# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
# Note: currently, Konsole support only works for KDE 3.x due to the way
# newer Konsole versions behave
#OE_TERMINAL = "auto"
# By default disable interactive patch resolution (tasks will just fail instead):
PATCHRESOLVE = "noop"
#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
# It's necessary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
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"
#
# Shared-state files from other locations
#
# As mentioned above, shared state files are prebuilt cache data objects which can
# used to accelerate build time. This variable can be used to configure the system
# to search other mirror locations for these objects before it builds the data itself.
#
# This can be a filesystem directory, or a remote url such as http or ftp. These
# would contain the sstate-cache results from previous builds (possibly from other
# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
# cache locations to check for the shared objects.
# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
# at the end as shown in the examples below. This will be substituted with the
# correct path within the directory structure.
#SSTATE_MIRRORS ?= "\
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
#file://.* file:///some/local/dir/sstate/PATH"
#
# Qemu configuration
#
# By default qemu will build with a builtin VNC server where graphical output can be
# seen. The two lines below enable the SDL backend too. This assumes there is a
# libsdl library available on your build system.
#PACKAGECONFIG_append_pn-qemu-native = " sdl"
#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
#ASSUME_PROVIDED += "libsdl-native"
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "2"
@@ -0,0 +1,51 @@
SUMMARY = "OpenBMC for Ampere - Applications"
PR = "r1"
inherit packagegroup
inherit obmc-phosphor-utils
PROVIDES = "${PACKAGES}"
PACKAGES = " \
${PN}-chassis \
${PN}-flash \
${PN}-system \
${PN}-fans \
"
PROVIDES += "virtual/obmc-chassis-mgmt"
PROVIDES += "virtual/obmc-flash-mgmt"
PROVIDES += "virtual/obmc-system-mgmt"
PROVIDES += "virtual/obmc-fan-mgmt"
RPROVIDES:${PN}-chassis += "virtual-obmc-chassis-mgmt"
RPROVIDES:${PN}-flash += "virtual-obmc-flash-mgmt"
RPROVIDES:${PN}-system += "virtual-obmc-system-mgmt"
RPROVIDES:${PN}-fans += "virtual-obmc-fan-mgmt"
SUMMARY:${PN}-chassis = "Ampere Chassis"
RDEPENDS:${PN}-chassis = " \
obmc-phosphor-buttons-signals \
obmc-phosphor-buttons-handler \
phosphor-skeleton-control-power \
ampere-hostctrl \
phosphor-hostlogger \
phosphor-sel-logger \
phosphor-logging \
ac01-boot-progress \
phosphor-post-code-manager \
phosphor-host-postd \
"
SUMMARY:${PN}-system = "Ampere System"
RDEPENDS:${PN}-system = " \
smbios-mdr \
"
SUMMARY:${PN}-flash = "Ampere Flash"
RDEPENDS:${PN}-flash = " \
phosphor-software-manager \
"
SUMMARY:${PN}-fans = "Ampere Fans"
RDEPENDS:${PN}-fans = " \
"
@@ -0,0 +1,14 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
RDEPENDS:${PN} = "bash"
SRC_URI += " \
file://ampere_fault_monitor.sh \
file://ampere_check_gpio_fault.sh \
"
do_install() {
install -d ${D}/${sbindir}
install -m 755 ${WORKDIR}/ampere_fault_monitor.sh ${D}/${sbindir}/
install -m 755 ${WORKDIR}/ampere_check_gpio_fault.sh ${D}/${sbindir}/
}
@@ -0,0 +1,205 @@
#!/bin/bash
# This script monitors S0/S1 fault GPIO and detects errors or warnings from CPUs
#
# According to OpenBMC_Software_Funcional_Specification, section 3.16,
#
# When the BMC detects the GPIO_FAULT signal indicating an SCP booting failure:
# • If a non-critical error/warning from the SCP occurs, the BMC blinks the Fault LED once.
# • If a critical error from the SCP occurs, the BMC turns on the Fault LED.
# The BMC monitors the GPIO_FAULT signal from the SCP during SCP booting to determine whether
# the error is non-critical or critical. A fatal error is indicated when the signal is On and then Off
# continuously, followed by a “quiet” period of about three seconds, and this pattern repeats. If the “quiet”
# period is longer than three seconds, the error is non-fatal. The BMC must set up appropriate debounce
# times to detect such errors. The BMC is expected to turn on the Fault LED forever for fatal errors, or to
# turn on the Fault LED and turn it off when the fault clears for non-fatal errors.
#
# Usage: <app_name> <socket 0/1>
# shellcheck source=/dev/null
source /usr/sbin/gpio-lib.sh
# global variables
error_flag='/tmp/fault_err'
warning_flag='/tmp/fault_warning'
duty_cycle=250000
scan_pulse=100000
blank_num=8
curr_pattern=0
prev_pattern=0
gpio_status=0
repeat=0
socket=$1
socket1_present=15
socket1_status=1
S0_fault_gpio=73
S1_fault_gpio=201
map_event_name() {
case $curr_pattern in
1)
event_name="RAS_GPIO_INVALID_LCS"
;;
2)
event_name="RAS_GPIO_FILE_HDR_INVALID"
;;
3)
event_name="RAS_GPIO_FILE_INTEGRITY_INVALID"
;;
4)
event_name="RAS_GPIO_KEY_CERT_AUTH_ERR"
;;
5)
event_name="RAS_GPIO_CNT_CERT_AUTH_ERR"
;;
6)
event_name="RAS_GPIO_I2C_HARDWARE_ERR"
;;
7)
event_name="RAS_GPIO_CRYPTO_ENGINE_ERR"
;;
8)
event_name="RAS_GPIO_ROTPK_EFUSE_INVALID"
;;
9)
event_name="RAS_GPIO_SEED_EFUSE_INVALID"
;;
10)
event_name="RAS_GPIO_LCS_FROM_EFUSE_INVALID"
;;
11)
event_name="RAS_GPIO_PRIM_ROLLBACK_EFUSE_INVALID"
;;
12)
event_name="RAS_GPIO_SEC_ROLLBACK_EFUSE_INVALID"
;;
13)
event_name="RAS_GPIO_HUK_EFUSE_INVALID"
;;
14)
event_name="RAS_GPIO_CERT_DATA_INVALID"
;;
15)
event_name="RAS_GPIO_INTERNAL_HW_ERR"
;;
*)
event_name="NOT_SUPPORT"
;;
esac
}
detect_patern_repeat() {
local prev=0
local curr=0
local cnt=13
while true
do
usleep $scan_pulse
gpio_status=$(cat /sys/class/gpio/gpio"$gpio_Id"/value)
prev=$curr
curr=$gpio_status
if [ "$prev" == 0 ] && [ "$curr" == 1 ]; then
# patern start repeating, check if previous and current pattern are the same
repeat=1
break
fi
if [ "$cnt" == 0 ]; then
map_event_name
echo "detected a warning from fault GPIO #$fault_gpio $socket, event $event_name"
# pattern not repeat, this is a warning, turn on warning flag
touch $warning_flag
break
fi
cnt=$(( cnt - 1 ))
done
}
detect_pattern() {
local cnt_falling_edge=0
local cnt_blank=0
local prev=0
local curr=0
while true
do
prev=$curr
curr=$gpio_status
# count the falling edges, if they appear, just reset cnt_blank
if [ "$prev" == 1 ] && [ "$curr" == 0 ]; then
cnt_falling_edge=$(( cnt_falling_edge + 1 ))
cnt_blank=0
continue
# check if we are in the quite gap
elif [ "$prev" == 0 ] && [ "$curr" == 0 ]; then
cnt_blank=$(( cnt_blank + 1 ))
if [ "$cnt_blank" == "$blank_num" ]; then
# echo "pattern number falling_edge=$cnt_falling_edge blank=$cnt_blank"
curr_pattern=$cnt_falling_edge
# after count all falling edges, now check if patern repeat after 3s
detect_patern_repeat
break
fi
fi
usleep $scan_pulse
gpio_status=$(cat /sys/class/gpio/gpio"$gpio_Id"/value)
done
}
gpio_config_input() {
echo "$gpio_Id" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio"${gpio_Id}"/direction
}
init_sysfs_fault_gpio() {
gpio_Id=$(gpio_number "$fault_gpio")
if [ -d /sys/class/gpio/gpio"$gpio_Id" ]; then
return
fi
gpio_config_input "$fault_gpio"
}
# init
if [ "$socket" == "0" ]; then
fault_gpio=$S0_fault_gpio
else
socket1_status=$(gpioget 0 "$socket1_present")
if [ "$socket1_status" == 1 ]; then
echo "socket 1 not present"
exit 1
fi
fault_gpio=$S1_fault_gpio
fi
init_sysfs_fault_gpio
# daemon start
while true
do
# detect when pattern starts
if [ "$gpio_status" == 1 ]; then
# now, there is something on gpio, check if that is a pattern
detect_pattern
if [ "$repeat" == 1 ] && [ "$prev_pattern" == "$curr_pattern" ]; then
map_event_name
echo "detected an error from fault GPIO #$fault_gpio $socket, event#$curr_pattern $event_name"
touch $error_flag
repeat=0
fi
prev_pattern=$curr_pattern
curr_pattern=0
continue
fi
usleep $duty_cycle
gpio_status=$(cat /sys/class/gpio/gpio"$gpio_Id"/value)
done
exit 1
@@ -0,0 +1,180 @@
#!/bin/bash
# This script monitors fan, over-temperature, PSU, CPU/SCP failure and update fault LED status
# shellcheck disable=SC2004
# shellcheck disable=SC2046
# shellcheck source=/dev/null
# common variables
warning_fault_flag='/tmp/fault_warning'
error_fault_flag='/tmp/fault_err'
overtemp_fault_flag='/tmp/fault_overtemp'
fault_RAS_UE_flag='/tmp/fault_RAS_UE'
blink_rate=100000
fault="false"
on="true"
off="false"
gpio_fault="false"
# fan variables
fan_failed="false"
fan_failed_flag='/tmp/fan_failed'
# PSU variables
psu_failed="false"
psu_bus=6
psu0_addr=0x58
psu1_addr=0x59
status_word_cmd=0x79
# Following the PMBus Specification
# Bit[1]: CML faults
# Bit[2]: Over temperature faults
# Bit[3]: Under voltage faults
# Bit[4]: Over current faults
# Bit[5]: Over voltage fault
# Bit[10]: Fan faults
psu_fault_bitmask=0x43e
# led variables
led_service='xyz.openbmc_project.LED.GroupManager'
led_fault_path='/xyz/openbmc_project/led/groups/system_fault'
led_fault_interface='xyz.openbmc_project.Led.Group'
fault_led_status=$off
# functions declaration
check_fan_failed() {
if [[ -f $fan_failed_flag ]]; then
fan_failed="true"
else
fan_failed="false"
fi
}
turn_on_off_fault_led() {
busctl set-property $led_service $led_fault_path $led_fault_interface Asserted b "$1" >> /dev/null
}
check_psu_failed() {
local psu0_presence
local psu1_presence
local psu0_value
local psu1_value
psu0_presence=$(gpioget $(gpiofind PSU1_PRESENT))
psu0_failed="true"
if [ "$psu0_presence" == "0" ]; then
# PSU0 presence, monitor the PSUs using pmbus, check the STATUS_WORD
psu0_value=$(i2cget -f -y $psu_bus $psu0_addr $status_word_cmd w)
psu0_bit_fault=$(($psu0_value & $psu_fault_bitmask))
if [ "$psu0_bit_fault" == "0" ]; then
psu0_failed="false"
fi
fi
psu1_presence=$(gpioget $(gpiofind PSU2_PRESENT))
psu1_failed="true"
if [ "$psu1_presence" == "0" ]; then
# PSU1 presence, monitor the PSUs using pmbus, check the STATUS_WORD
psu1_value=$(i2cget -f -y $psu_bus $psu1_addr $status_word_cmd w)
psu1_bit_fault=$(($psu1_value & $psu_fault_bitmask))
if [ "$psu1_bit_fault" == "0" ]; then
psu1_failed="false"
fi
fi
if [ "$psu0_failed" == "true" ] || [ "$psu1_failed" == "true" ]; then
psu_failed="true"
else
psu_failed="false"
fi
}
check_fault() {
if [[ "$fan_failed" == "true" ]] || [[ "$psu_failed" == "true" ]] \
|| [[ "$gpio_fault" == "true" ]] \
|| [[ "$RAS_UE_occured" == "true" ]] \
|| [[ "$overtemp_occured" == "true" ]]; then
fault="true"
else
fault="false"
fi
}
control_fault_led() {
if [ "$fault" == "true" ]; then
if [ "$fault_led_status" == $off ]; then
turn_on_off_fault_led $on
fault_led_status=$on
fi
else
if [ "$fault_led_status" == $on ]; then
turn_on_off_fault_led $off
fault_led_status=$off
fi
fi
}
blink_fault_led() {
if [ "$fault_led_status" == $off ]; then
turn_on_off_fault_led $on
usleep $blink_rate
turn_on_off_fault_led $off
else
turn_on_off_fault_led $off
usleep $blink_rate
turn_on_off_fault_led $on
fi
}
check_gpio_fault() {
if [[ -f $error_fault_flag ]]; then
gpio_fault="true"
else
if [ -f $warning_fault_flag ]; then
blink_fault_led
rm $warning_fault_flag
fi
gpio_fault="false"
fi
}
check_RAS_UE_occured() {
if [[ -f $fault_RAS_UE_flag ]]; then
echo "RAS UE error occured, turn on fault LED"
RAS_UE_occured="true"
else
RAS_UE_occured="false"
fi
}
check_overtemp_occured() {
if [[ -f $overtemp_fault_flag ]]; then
echo "Over temperature occured, turn on fault LED"
overtemp_occured="true"
else
overtemp_occured="false"
fi
}
# daemon start
while true
do
check_gpio_fault
check_fan_failed
check_overtemp_occured
check_RAS_UE_occured
# Monitors PSU presence
check_psu_failed
check_fault
control_fault_led
sleep 2
done
exit 1
@@ -0,0 +1,18 @@
SUMMARY = "Ampere Computing LLC Update MAC Address from FRU Inventory Information"
DESCRIPTION = "Update MAC Address from FRU Inventory Information for Ampere systems"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
inherit obmc-phosphor-systemd
DEPENDS = "systemd"
RDEPENDS:${PN} = "bash"
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
SYSTEMD_SERVICE:${PN} = "ampere_update_mac.service"
@@ -0,0 +1,13 @@
[Unit]
Description=Updating MAC Address Service From FRU inventory
Requires=xyz.openbmc_project.EntityManager.service
After=xyz.openbmc_project.EntityManager.service
[Service]
ExecStart=/usr/sbin/ampere_update_mac.sh eth1 3 80
SyslogIdentifier=ampere_update_mac.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy={SYSTEMD_DEFAULT_TARGET}
@@ -0,0 +1,32 @@
SUMMARY = "Phosphor OpenBMC Mt.Jade Platform Init Service"
DESCRIPTION = "Phosphor OpenBMC Mt.Jade Platform Init Daemon"
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
DEPENDS += "systemd"
RDEPENDS:${PN} += "libsystemd"
RDEPENDS:${PN} += "bash"
SRC_URI = " \
file://ampere_platform_init.sh \
file://ampere_uart_console_setup.sh \
file://ampere_uartmux_ctrl.sh \
file://ampere-platform-init.service \
"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "ampere-platform-init.service"
do_install () {
install -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/ampere_platform_init.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/ampere_uart_console_setup.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/ampere_uartmux_ctrl.sh ${D}/${sbindir}/
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/ampere-platform-init.service ${D}${systemd_unitdir}/system
}
@@ -0,0 +1,11 @@
[Unit]
Description = Mt.Jade Platform Initialization
[Service]
Restart=no
RemainAfterExit=true
Type=oneshot
ExecStart=/usr/sbin/ampere_platform_init.sh
[Install]
WantedBy=sysinit.target
@@ -0,0 +1,51 @@
#!/bin/bash
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-lib.sh
source /usr/sbin/gpio-lib.sh
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
source /usr/sbin/gpio-defs.sh
source /usr/sbin/ampere_uart_console_setup.sh
# Configure to boot from MAIN SPI-HOST
gpio_configure_output "$SPI0_BACKUP_SEL" 0
gpio_configure_input "$S0_I2C9_ALERT_L"
gpio_configure_input "$S1_I2C9_ALERT_L"
gpio_configure_input "$GPIO_BMC_VGA_FRONT_PRES_L"
gpio_configure_input "$GPIO_S0_VRHOT_L"
gpio_configure_input "$GPIO_S1_VRHOT_L"
gpio_configure_output "$BMC_VGA_SEL" 1
# =======================================================
# Below GPIOs are controlled by other services so just
# initialize in A/C power only.
bootstatus=$(cat /sys/class/watchdog/watchdog0/bootstatus)
if [ "$bootstatus" == '32' ]; then
gpio_configure_output "$BMC_GPIOR2_EXT_HIGHTEMP_L" 1
gpio_configure_output "$GPIO_BMC_VR_PMBUS_SEL_L" 1
gpio_configure_output "$GPIO_BMC_I2C6_RESET_L" 1
# Initialize OCP register
gpio_configure_output "$OCP_MAIN_PWREN" 0
# Configure SPI-NOR/EEPROM switching
gpio_configure_output "$SPI0_PROGRAM_SEL" 0
gpio_configure_output "$BMC_I2C_BACKUP_SEL" 1
gpio_configure_output "$SPI0_BACKUP_SEL" 0
# Initialize BMC_SYS_PSON_L, SHD_REQ_L, BMC_SYSRESET_L
gpio_configure_output "$SYS_PSON_L" 1
gpio_configure_output "$S0_SHD_REQ_L" 1
gpio_configure_output "$S0_SYSRESET_L" 1
gpio_configure_output "$S1_SYSRESET_L" 1
# RTC Lock, SPECIAL_BOOT
gpio_configure_output "$RTC_LOCK" 0
gpio_configure_output "$S0_SPECIAL_BOOT" 0
gpio_configure_output "$S1_SPECIAL_BOOT" 0
fi
gpio_configure_output "$BMC_READY" 1
# =======================================================
# Setting uart muxes to BMC as default
uart_console_setup
@@ -0,0 +1,57 @@
#!/bin/sh -e
#
# Copyright (c) 2020 Ampere Computing 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.
# shellcheck disable=SC2039
# shellcheck disable=SC2112
# shellcheck disable=SC3010
# shellcheck disable=SC3030
# shellcheck disable=SC3054
export obmc_console_tty=("ttyS0" "ttyS1" "ttyS2" "ttyS3")
function get_uart_port()
{
tty=$1
case "${tty}" in
"ttyS0") uart=1
;;
"ttyS1") uart=2
;;
"ttyS2") uart=3
;;
"ttyS3") uart=4
;;
*) echo "Invalid tty passed to $0. Exiting!"
exit 1;
;;
esac
echo $uart
}
function uart_console_setup()
{
# Default the host routing through the mux to use the BMC (2)
# This allows the SoL console in webui, and the ssh port 2200, to work
# upon startup. If UART transcievers are installed on the header and required,
# this value should be set to 1
for tty in "${obmc_console_tty[@]}"; do
uart=$(get_uart_port "$tty")
if [ "${uart}" -ne 0 ]
then
/usr/sbin/ampere_uartmux_ctrl.sh "${uart}" 2
fi
done
}
@@ -0,0 +1,55 @@
#!/bin/bash
#
# Copyright (c) 2021 Ampere Computing 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.
# Ampere Computing LLC: UART MUX/DEMUX for CPU0 UART0,1,4 and CPU1 UART1
# Usage: ampere_uartmux_ctrl.sh <CPU UART port number> <UARTx_MODE>
# <UARTx_MODE> of 1 sets CPU To HDR_CONN
# <UARTx_MODE> of 2 sets BMC to CPU (eg dropbear ssh server on port 2200)
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-lib.sh
source /usr/sbin/gpio-lib.sh
if [ $# -lt 2 ]; then
exit 1
fi
case "$1" in
1) GPIO_UARTx_MODE0=56
;;
2) GPIO_UARTx_MODE0=57
;;
3) GPIO_UARTx_MODE0=58
;;
4) GPIO_UARTx_MODE0=59
;;
*) echo "Invalid UART port selection"
exit 1
;;
esac
echo "Ampere UART MUX CTRL UART port $1 to mode $2"
case "$2" in
1) gpio_configure_output "${GPIO_UARTx_MODE0}" 0
exit 0
;;
2) gpio_configure_output "${GPIO_UARTx_MODE0}" 1
exit 0
;;
*) echo "Invalid UART mode selection"
exit 1
;;
esac
@@ -0,0 +1,20 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
SRC_URI:append = " \
file://gpio-defs.sh \
file://gpio-lib.sh \
file://ampere_power_util.sh \
file://ampere_firmware_upgrade.sh \
file://ampere_flash_bios.sh \
file://ampere_driver_binder.sh \
"
do_install:append() {
install -d ${D}/usr/sbin
install -m 0755 ${WORKDIR}/gpio-lib.sh ${D}/${sbindir}/
install -m 0755 ${WORKDIR}/gpio-defs.sh ${D}/${sbindir}/
install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/
install -m 0755 ${WORKDIR}/ampere_firmware_upgrade.sh ${D}/${sbindir}/
install -m 0755 ${WORKDIR}/ampere_flash_bios.sh ${D}/${sbindir}/
install -m 0755 ${WORKDIR}/ampere_driver_binder.sh ${D}/${sbindir}/
}
@@ -0,0 +1,29 @@
#!/bin/bash
DELAY_BEFORE_BIND=5000000
# Each driver include driver name and driver path
declare -a DRIVER_NAMEs=("2-004f"
"2-004e"
)
# Driver path should include / at the end
declare -a DRIVER_PATHs=("/sys/bus/i2c/drivers/smpro-core/"
"/sys/bus/i2c/drivers/smpro-core/"
)
# get length of an array
arraylength=${#DRIVER_NAMEs[@]}
usleep $DELAY_BEFORE_BIND
# use for loop to read all values and indexes
for (( i=0; i<"${arraylength}"; i++ ));
do
bindFile="${DRIVER_PATHs[$i]}bind"
driverDir="${DRIVER_PATHs[$i]}${DRIVER_NAMEs[$i]}"
if [ -d "$driverDir" ]; then
echo "Driver ${DRIVER_NAMEs[$i]} is already bound."
continue;
fi
echo "${DRIVER_NAMEs[$i]}" > "$bindFile"
done
exit 0
@@ -0,0 +1,151 @@
#!/bin/bash
do_fru_upgrade() {
FRU_DEVICE="/sys/bus/i2c/devices/3-0050/eeprom"
if ! command -v ampere_fru_upgrade;
then
echo "Bypass fru update as no ampere_fru_upgrade available"
exit
fi
ampere_fru_upgrade -d $FRU_DEVICE -f "$IMAGE"
systemctl restart xyz.openbmc_project.FruDevice.service
systemctl restart phosphor-ipmi-host.service
}
do_smpmpro_upgrade() {
I2C_BUS_DEV="1"
EEPROM_ADDR="0x50"
if ! command -v ampere_eeprom_prog;
then
echo "Bypass SCP firmware update as no ampere_eeprom_prog available"
exit
fi
echo "SECPRO mode: $SECPRO"
# Turn off the Host if it is currently ON
chassisstate=$(obmcutil chassisstate | awk -F. '{print $NF}')
echo "Current Chassis State: $chassisstate"
if [ "$chassisstate" == 'On' ];
then
echo "Turning the Chassis off"
obmcutil chassisoff
# Wait 60s until Chassis is off
cnt=30
while [ "$cnt" -gt 0 ];
do
cnt=$((cnt - 1))
sleep 2
# Check if HOST was OFF
chassisstate_off=$(obmcutil chassisstate | awk -F. '{print $NF}')
if [ "$chassisstate_off" != 'On' ];
then
break
fi
if [ "$cnt" == "0" ];
then
echo "--- Error : Failed turning the Chassis off"
exit 1
fi
done
fi
if [[ $SECPRO == 1 ]]; then
# 3 is S0_SPECIAL_BOOT
gpioset 0 3=1
# 66 is S1_SPECIAL_BOOT
gpioset 0 66=1
fi
# Switch EEPROM control to BMC AST2500 I2C
# 226 is BMC_GPIOAC2_SPI0_PROGRAM_SEL
gpioset 0 226=0
# 08 is BMC_GPIOB0_I2C_BACKUP_SEL
if [[ $DEV_SEL == 1 ]]; then
echo "Run update primary Boot EEPROM"
gpioset 0 8=1 # Main EEPROM
elif [[ $DEV_SEL == 2 ]]; then
echo "Run update secondary Boot EEPROM"
gpioset 0 8=0 # Second EEPROM
else
echo "Please choose Main (1) or Second EEPROM (2)"
exit 0
fi
# Write Firmware to EEPROM and read back for validation
ampere_eeprom_prog -b $I2C_BUS_DEV -s $EEPROM_ADDR -p -f "$IMAGE"
# Switch EEPROM control to Host
# 08 is BMC_GPIOB0_I2C_BACKUP_SEL
gpioset 0 8=1
# 226 is BMC_GPIOAC2_SPI0_PROGRAM_SEL
gpioset 0 226=1
# Deassert SECPRO GPIO PINs
if [[ $SECPRO == 1 ]]; then
echo "De-asserting special GPIO PINs"
# 3 is S0_SPECIAL_BOOT
gpioset 0 3=0
# 66 is S1_SPECIAL_BOOT
gpioset 0 66=0
fi
if [ "$chassisstate" == 'On' ];
then
sleep 5
echo "Turn on the Host"
obmcutil poweron
fi
}
if [ $# -eq 0 ]; then
echo "Usage:"
echo " $(basename "$0") <Type> <Image file> <DEV_SEL> [SECPRO]"
echo "Where:"
echo " <Type>: smpmpro or fru"
echo " If Type is smpmpro, then DEV_SEL must is 1 (MAIN EEPROM), 2 (Failover)"
echo " SECPRO: Optional, input '1' to enter & flash secpro mode. Default: 0"
exit 0
fi
TYPE=$1
IMAGE=$2
if [ -z "$3" ]
then
DEV_SEL="1" # by default, select Main image
else
DEV_SEL=$3
fi
SECPRO=0
if [ -n "$4" ]; then
if [[ "$4" == "1" ]]; then
SECPRO=1
fi
fi
MANIFEST="$(echo "$IMAGE" | cut -d'/' -f-4)/MANIFEST"
if [ -f "$MANIFEST" ]; then
echo "MANIFEST: $MANIFEST"
if grep -qF "SECPRO" "$MANIFEST"; then
SECPRO=1
fi
fi
# Restrict to flash failover in case of SECPRO
if [ $SECPRO == 1 ] && [ "$DEV_SEL" == 2 ]; then
echo "Not allow to flash the failover with SECPRO image"
exit
fi
if [[ $TYPE == "smpmpro" ]]; then
do_smpmpro_upgrade
elif [[ $TYPE == "fru" ]]; then
do_fru_upgrade
fi
@@ -0,0 +1,129 @@
#!/bin/bash
#
# Copyright (c) 2021 Ampere Computing 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.
do_flash () {
# Check the PNOR partition available
HOST_MTD=$(< /proc/mtd grep "pnor-uefi" | sed -n 's/^\(.*\):.*/\1/p')
if [ -z "$HOST_MTD" ];
then
# Check the ASpeed SMC driver bound before
HOST_SPI=/sys/bus/platform/drivers/spi-aspeed-smc/1e630000.spi
if [ -d "$HOST_SPI" ]; then
echo "Unbind the ASpeed SMC driver"
echo 1e630000.spi > /sys/bus/platform/drivers/spi-aspeed-smc/unbind
sleep 2
fi
# If the PNOR partition is not available, then bind again driver
echo "--- Bind the ASpeed SMC driver"
echo 1e630000.spi > /sys/bus/platform/drivers/spi-aspeed-smc/bind
sleep 2
HOST_MTD=$(< /proc/mtd grep "pnor-uefi" | sed -n 's/^\(.*\):.*/\1/p')
if [ -z "$HOST_MTD" ];
then
echo "Fail to probe Host SPI-NOR device"
exit 1
fi
fi
echo "--- Flashing firmware to @/dev/$HOST_MTD"
flashcp -v "$IMAGE" /dev/"$HOST_MTD"
}
if [ $# -eq 0 ]; then
echo "Usage: $(basename "$0") <BIOS image file>"
exit 0
fi
IMAGE="$1"
if [ ! -f "$IMAGE" ]; then
echo "The image file $IMAGE does not exist"
exit 1
fi
if [ -z "$2" ]; then
DEV_SEL="1" # by default, select primary device
else
DEV_SEL="$2"
fi
# Turn off the Host if it is currently ON
chassisstate=$(obmcutil chassisstate | awk -F. '{print $NF}')
echo "--- Current Chassis State: $chassisstate"
if [ "$chassisstate" == 'On' ];
then
echo "--- Turning the Chassis off"
obmcutil chassisoff
# Wait 60s until Chassis is off
cnt=30
while [ "$cnt" -gt 0 ];
do
cnt=$((cnt - 1))
sleep 2
# Check if HOST was OFF
chassisstate_off=$(obmcutil chassisstate | awk -F. '{print $NF}')
if [ "$chassisstate_off" != 'On' ];
then
break
fi
if [ "$cnt" == "0" ];
then
echo "--- Error : Failed turning the Chassis off"
exit 1
fi
done
fi
# Switch the host SPI bus to BMC"
echo "--- Switch the host SPI bus to BMC."
if ! gpioset 0 226=0; then
echo "ERROR: Switch the host SPI bus to BMC. Please check gpio state"
exit 1
fi
# Switch the host SPI bus (between primary and secondary)
# 227 is BMC_SPI0_BACKUP_SEL
if [[ $DEV_SEL == 1 ]]; then
echo "Run update primary Host SPI-NOR"
gpioset 0 227=0 # Primary SPI
elif [[ $DEV_SEL == 2 ]]; then
echo "Run update secondary Host SPI-NOR"
gpioset 0 227=1 # Second SPI
else
echo "Please choose primary SPI (1) or second SPI (2)"
exit 0
fi
# Flash the firmware
do_flash
# Switch the host SPI bus to HOST."
echo "--- Switch the host SPI bus to HOST."
if ! gpioset 0 226=1; then
echo "ERROR: Switch the host SPI bus to HOST. Please check gpio state"
exit 1
fi
if [ "$chassisstate" == 'On' ];
then
sleep 5
echo "Turn on the Host"
obmcutil poweron
fi
@@ -0,0 +1,120 @@
#!/bin/bash
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
source /usr/sbin/gpio-defs.sh
# Usage of this utility
function usage() {
echo "Usage:"
echo " ampere_power_util.sh mb [status|shutdown_ack|force_reset|soft_off]";
}
power_status() {
st=$(busctl get-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis CurrentPowerState | cut -d"." -f6)
if [ "$st" == "On\"" ]; then
echo "on"
else
echo "off"
fi
}
shutdown_ack() {
if [ -f "/run/openbmc/host@0-softpoweroff" ]; then
echo "Receive shutdown ACK triggered after softportoff the host."
touch /run/openbmc/host@0-softpoweroff-shutdown-ack
else
echo "Receive shutdown ACK triggered"
sleep 3
systemctl start obmc-chassis-poweroff@0.target
fi
}
soft_off() {
# Trigger shutdown_req
touch /run/openbmc/host@0-softpoweroff
gpioset -l 0 "$S0_SHD_REQ_L"=1
sleep 1s
gpioset -l 0 "$S0_SHD_REQ_L"=0
# Wait for shutdown_ack from the host in 30 seconds
cnt=30
while [ $cnt -gt 0 ];
do
# Wait for SHUTDOWN_ACK and create the host@0-softpoweroff-shutdown-ack
if [ -f "/run/openbmc/host@0-softpoweroff-shutdown-ack" ]; then
break
fi
sleep 1
cnt=$((cnt - 1))
done
# Softpoweroff is successed
sleep 2
rm -rf /run/openbmc/host@0-softpoweroff
if [ -f "/run/openbmc/host@0-softpoweroff-shutdown-ack" ]; then
rm -rf /run/openbmc/host@0-softpoweroff-shutdown-ack
fi
echo 0
}
force_reset() {
if [ -f "/run/openbmc/host@0-softpoweroff" ]; then
# In graceful host reset, after trigger os shutdown,
# the phosphor-state-manager will call force-warm-reset
# in this case the force_reset should wait for shutdown_ack from host
cnt=30
while [ $cnt -gt 0 ];
do
if [ -f "/run/openbmc/host@0-softpoweroff-shutdown-ack" ]; then
break
fi
echo "Waiting for shutdown-ack count down $cnt"
sleep 1
cnt=$((cnt - 1))
done
# The host OS is failed to shutdown
if [ $cnt == 0 ]; then
echo "Shutdown-ack time out after 30s."
exit 0
fi
fi
echo "Triggering sysreset pin"
gpioset -l 0 "$S0_SYSRESET_L"=1
sleep 1
gpioset -l 0 "$S0_SYSRESET_L"=0
}
if [ $# -lt 2 ]; then
echo "Total number of parameter=$#"
echo "Insufficient parameter"
usage;
exit 0;
fi
if [ "$1" != "mb" ]; then
echo "Invalid parameter1=$1"
usage;
exit 0;
fi
mkdir -p /run/openbmc/
if [ "$2" == "shutdown_ack" ]; then
shutdown_ack
elif [ "$2" == "status" ]; then
power_status
elif [ "$2" == "force_reset" ]; then
force_reset
elif [ "$2" == "soft_off" ]; then
ret=$(soft_off)
if [ "$ret" == 0 ]; then
echo "The host is already softoff"
else
echo "Failed to softoff the host"
fi
exit "$ret";
else
echo "Invalid parameter2=$2"
usage;
fi
exit 0;
@@ -0,0 +1,59 @@
#!/bin/sh
# shellcheck disable=SC2034
# Index of GPIO device in gpioget/gpioset
GPIO_CHIP0_IDX=0
GPIO_CHIP1_IDX=1
# Base of GPIO chip in /sys/class/gpio
GPIO_CHIP0_BASE=792
GPIO_CHIP1_BASE=780
### Power control configuration
# Power control gpios
S0_SHD_REQ_L=49
S0_SHD_ACK_L=50
S0_REBOOT_ACK_L=75
S0_SYSRESET_L=91
S1_SYSRESET_L=92
### Table 1: GPIO Assignments
BMC_I2C_BACKUP_SEL=8
S0_CPU_FW_BOOT_OK=48
CPU_BMC_OVERTEMP_L=51
CPU_BMC_HIGHTEMP_L=72
CPU_FAULT_ALERT=73
S1_CPU_FW_BOOT_OK=202
S0_SPECIAL_BOOT=3
S1_SPECIAL_BOOT=66
RTC_LOCK=203
### Table 2: Alert and Additional Miscellaneous Signals
S0_SCP_AUTH_FAILURE=74
S1_SCP_AUTH_FAILURE=205
BMC_OK=228
SLAVE_PRESENT_L=230
### Common GPIOs
SYS_PSON_L=42
BMC_READY=229
### OCP power selection
OCP_AUX_PWREN=139
OCP_MAIN_PWREN=140
### SPI0 Mode selection
SPI0_PROGRAM_SEL=226
SPI0_BACKUP_SEL=227
### Mt.Jade specific GPIOs
S0_I2C9_ALERT_L=100
S1_I2C9_ALERT_L=101
GPIO_BMC_VGA_FRONT_PRES_L=135
GPIO_S0_VRHOT_L=144
GPIO_S1_VRHOT_L=145
BMC_VGA_SEL=195
BMC_GPIOR2_EXT_HIGHTEMP_L=138
GPIO_BMC_VR_PMBUS_SEL_L=149
GPIO_BMC_I2C6_RESET_L=63
@@ -0,0 +1,33 @@
#!/bin/bash
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
source /usr/sbin/gpio-defs.sh
function gpio_number() {
GPIO_BASE=$(cat /sys/class/gpio/gpiochip"$GPIO_CHIP0_BASE"/base)
echo $((GPIO_BASE + $1))
}
# Configure GPIO as output and set its value
function gpio_configure_output() {
gpioId=$(gpio_number "$1")
echo "$gpioId" > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio"${gpioId}"/direction
echo "$2" > /sys/class/gpio/gpio"${gpioId}"/value
echo "$gpioId" > /sys/class/gpio/unexport
}
function gpio_get_val() {
gpioId=$(gpio_number "$1")
echo "$gpioId" > /sys/class/gpio/export
cat /sys/class/gpio/gpio"$gpioId"/value
echo "$gpioId" > /sys/class/gpio/unexport
}
# Configure GPIO as input
function gpio_configure_input() {
gpioId=$(gpio_number "$1")
echo "$gpioId" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio"${gpioId}"/direction
echo "$gpioId" > /sys/class/gpio/unexport
}
@@ -0,0 +1,44 @@
SUMMARY = "Ampere Computing LLC Utilities"
DESCRIPTION = "Ampere Utilities for Mt.Jade systems"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
inherit obmc-phosphor-systemd
S = "${WORKDIR}"
SRC_URI = " \
file://ampere_gpio_utils.sh \
"
DEPENDS = "systemd"
RDEPENDS:${PN} = "bash"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = " \
ampere-gpio-poweroff@.service \
ampere-gpio-poweron@.service \
"
# chassis power on
CHASSIS_POWERON_SVC = "ampere-gpio-poweron@.service"
CHASSIS_POWERON_INSTMPL = "ampere-gpio-poweron@{0}.service"
CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_INSTMPL}"
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
# chassis power off
CHASSIS_POWEROFF_SVC = "ampere-gpio-poweroff@.service"
CHASSIS_POWEROFF_INSTMPL = "ampere-gpio-poweroff@{0}.service"
CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target"
CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_INSTMPL}"
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
do_install() {
install -d ${D}/usr/sbin
install -m 0755 ${WORKDIR}/ampere_gpio_utils.sh ${D}/${sbindir}/
}
@@ -0,0 +1,9 @@
[Unit]
Description=Ampere set GPIOs before power off
Before=phosphor-wait-power-off@%i.service
Conflicts=obmc-chassis-poweron@%i.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ampere_gpio_utils.sh power off
SyslogIdentifier=ampere_gpio_utils
@@ -0,0 +1,10 @@
[Unit]
Description=Ampere set GPIOs before power on
Before=phosphor-wait-power-on@%i.service
After=obmc-power-start-pre@%i.target
Conflicts=obmc-chassis-poweroff@%i.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ampere_gpio_utils.sh power on
SyslogIdentifier=ampere_gpio_utils
@@ -0,0 +1,44 @@
#!/bin/bash
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-lib.sh
source /usr/sbin/gpio-defs.sh
# shellcheck source=meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
source /usr/sbin/gpio-lib.sh
function usage() {
echo "usage: ampere_gpio_utils.sh [power] [on|off]";
}
set_gpio_power_off() {
echo "Setting GPIO before Power off"
}
set_gpio_power_on() {
echo "Setting GPIO before Power on"
val=$(gpio_get_val "$S0_CPU_FW_BOOT_OK")
if [ "$val" == 1 ]; then
exit
fi
gpio_configure_output "$SPI0_PROGRAM_SEL" 1
gpio_configure_output "$SPI0_BACKUP_SEL" 0
}
if [ $# -lt 2 ]; then
echo "Total number of parameter=$#"
echo "Insufficient parameter"
usage;
exit 0;
fi
if [ "$1" == "power" ]; then
if [ "$2" == "on" ]; then
set_gpio_power_on
elif [ "$2" == "off" ]; then
set_gpio_power_off
fi
exit 0;
else
echo "Invalid parameter1=$1"
usage;
exit 0;
fi
@@ -0,0 +1,4 @@
CONFIG_PHY_NCSI=n
CONFIG_CMD_MMC=n
CONFIG_MMC_SDHCI_ASPEED=n
CONFIG_SYS_DCACHE_OFF=n
@@ -0,0 +1,5 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += " \
file://ampere.cfg \
"
@@ -0,0 +1,35 @@
#
# BOM
#
CONFIG_RTC_DRV_PCF85063=y
CONFIG_IIO_MUX=y
CONFIG_MUX_GPIO=y
CONFIG_I2C_MUX=y
#
# Mtjade driver build flags
#
CONFIG_SENSORS_IIO_HWMON=y
CONFIG_ASPEED_ADC=y
CONFIG_SENSORS_LM75=y
CONFIG_I2C_SLAVE=y
CONFIG_SENSORS_SMPRO=y
CONFIG_SENSORS_ASPEED=y
CONFIG_USB_PHY=y
CONFIG_USB_GADGET=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_ASPEED_VHUB=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_SSIF_IPMI_BMC=y
CONFIG_NCSI_OEM_CMD_GET_MAC=y
CONFIG_HWMON=y
CONFIG_MFD_SMPRO=y
CONFIG_SMPRO_MISC=y
CONFIG_SMPRO_ERRMON=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_CIFS=y
CONFIG_CIFS_XATTR=y
@@ -0,0 +1,6 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += " \
file://mtjade.cfg \
"
@@ -0,0 +1,3 @@
EXTRA_OEMESON:append = " \
-Dreset-button-do-warm-reboot=enabled \
"
@@ -0,0 +1,26 @@
SUMMARY = "YAML configuration for Mt.Jade"
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://${MACHINE}-ipmi-sensors.yaml \
file://mtjade-ipmi-fru.yaml \
"
S = "${WORKDIR}"
do_install() {
install -m 0644 -D ${MACHINE}-ipmi-sensors.yaml \
${D}${datadir}/${BPN}/ipmi-sensors.yaml
install -m 0644 -D mtjade-ipmi-fru.yaml \
${D}${datadir}/${BPN}/ipmi-fru-read.yaml
}
FILES:${PN}-dev = " \
${datadir}/${BPN}/ipmi-sensors.yaml \
${datadir}/${BPN}/ipmi-fru-read.yaml \
"
ALLOW_EMPTY:${PN} = "1"
@@ -0,0 +1,643 @@
1: &TEMP_DEFAULTS
bExp: 0
entityID: 30
entityInstance: 1
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
255:
type: double
multiplierM: 1
mutability: Mutability::Write|Mutability::Read
offsetB: 0
path: /xyz/openbmc_project/sensors/temperature/TS1_Temp
rExp: 0
readingType: readingData
sensorNamePattern: nameLeaf
sensorReadingType: 1
sensorType: 1
serviceInterface: org.freedesktop.DBus.Properties
unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC
2:
<<: *TEMP_DEFAULTS
entityInstance: 2
path: /xyz/openbmc_project/sensors/temperature/TS2_Temp
3:
<<: *TEMP_DEFAULTS
entityInstance: 3
path: /xyz/openbmc_project/sensors/temperature/TS3_Temp
4:
<<: *TEMP_DEFAULTS
entityInstance: 4
path: /xyz/openbmc_project/sensors/temperature/TS4_Temp
5:
<<: *TEMP_DEFAULTS
entityInstance: 5
path: /xyz/openbmc_project/sensors/temperature/TS5_Temp
6:
<<: *TEMP_DEFAULTS
entityInstance: 6
path: /xyz/openbmc_project/sensors/temperature/TS6_Temp
243:
<<: *TEMP_DEFAULTS
entityInstance: 58
path: /xyz/openbmc_project/sensors/temperature/PSU0_TEMP
244:
<<: *TEMP_DEFAULTS
entityInstance: 59
path: /xyz/openbmc_project/sensors/temperature/PSU1_TEMP
37: &FAN_DEFAULTS
entityID: 29
entityInstance: 13
sensorType: 4
path: /xyz/openbmc_project/sensors/fan_tach/FAN3_1
sensorReadingType: 1
multiplierM: 100
offsetB: 0
rExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
mutability: Mutability::Write|Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
sensorNamePattern: nameLeaf
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
40:
<<: *FAN_DEFAULTS
entityInstance: 16
path: /xyz/openbmc_project/sensors/fan_tach/FAN3_2
43:
<<: *FAN_DEFAULTS
entityInstance: 19
path: /xyz/openbmc_project/sensors/fan_tach/FAN4_1
46:
<<: *FAN_DEFAULTS
entityInstance: 22
path: /xyz/openbmc_project/sensors/fan_tach/FAN4_2
49:
<<: *FAN_DEFAULTS
entityInstance: 25
path: /xyz/openbmc_project/sensors/fan_tach/FAN5_1
52:
<<: *FAN_DEFAULTS
entityInstance: 28
path: /xyz/openbmc_project/sensors/fan_tach/FAN5_2
55:
<<: *FAN_DEFAULTS
entityInstance: 31
path: /xyz/openbmc_project/sensors/fan_tach/FAN6_1
58:
<<: *FAN_DEFAULTS
entityInstance: 34
path: /xyz/openbmc_project/sensors/fan_tach/FAN6_2
61:
<<: *FAN_DEFAULTS
entityInstance: 37
path: /xyz/openbmc_project/sensors/fan_tach/FAN7_1
64:
<<: *FAN_DEFAULTS
entityInstance: 40
path: /xyz/openbmc_project/sensors/fan_tach/FAN7_2
67:
<<: *FAN_DEFAULTS
entityInstance: 43
path: /xyz/openbmc_project/sensors/fan_tach/FAN8_1
70:
<<: *FAN_DEFAULTS
entityInstance: 46
path: /xyz/openbmc_project/sensors/fan_tach/FAN8_2
245:
<<: *FAN_DEFAULTS
entityInstance: 60
path: /xyz/openbmc_project/sensors/fan_tach/PSU0_fan1
246:
<<: *FAN_DEFAULTS
entityInstance: 61
path: /xyz/openbmc_project/sensors/fan_tach/PSU1_fan1
73: &VOLTAGE_DEFAULTS
entityID: 0x13
entityInstance: 9
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/S0_0V8_VDDC_SOC
sensorReadingType: 0x01
multiplierM: 5
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
74:
<<: *VOLTAGE_DEFAULTS
entityInstance: 11
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_0V75_PCP
75:
<<: *VOLTAGE_DEFAULTS
entityInstance: 13
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_1V2_VDDQ0123
76:
<<: *VOLTAGE_DEFAULTS
entityInstance: 15
multiplierM: 4
path: /xyz/openbmc_project/sensors/voltage/S0_0V6_VTT0123
77:
<<: *VOLTAGE_DEFAULTS
entityInstance: 17
multiplierM: 15
path: /xyz/openbmc_project/sensors/voltage/S0_2V5_VPP0123
78:
<<: *VOLTAGE_DEFAULTS
entityInstance: 19
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_1V2_VDDQ4567
79:
<<: *VOLTAGE_DEFAULTS
entityInstance: 21
multiplierM: 4
path: /xyz/openbmc_project/sensors/voltage/S0_0V6_VTT4567
80:
<<: *VOLTAGE_DEFAULTS
entityInstance: 23
multiplierM: 15
path: /xyz/openbmc_project/sensors/voltage/S0_2V5_VPP4567
81:
<<: *VOLTAGE_DEFAULTS
entityInstance: 25
multiplierM: 5
path: /xyz/openbmc_project/sensors/voltage/S0_0V85_RCA
82:
<<: *VOLTAGE_DEFAULTS
entityInstance: 27
multiplierM: 11
path: /xyz/openbmc_project/sensors/voltage/S0_1V8_VDDH
83:
<<: *VOLTAGE_DEFAULTS
entityInstance: 29
multiplierM: 9
path: /xyz/openbmc_project/sensors/voltage/S0_1V5_VDDH
84:
<<: *VOLTAGE_DEFAULTS
entityInstance: 31
multiplierM: 11
path: /xyz/openbmc_project/sensors/voltage/S0_1V8_SOC
85:
<<: *VOLTAGE_DEFAULTS
entityInstance: 33
multiplierM: 11
path: /xyz/openbmc_project/sensors/voltage/S0_1V8_PCP
86:
<<: *VOLTAGE_DEFAULTS
entityInstance: 35
multiplierM: 20
path: /xyz/openbmc_project/sensors/voltage/S0_3V3_SOC
87:
<<: *VOLTAGE_DEFAULTS
entityInstance: 10
multiplierM: 5
path: /xyz/openbmc_project/sensors/voltage/S1_0V8_VDDC_SOC
88:
<<: *VOLTAGE_DEFAULTS
entityInstance: 12
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_0V75_PCP
89:
<<: *VOLTAGE_DEFAULTS
entityInstance: 14
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_1V2_VDDQ0123
90:
<<: *VOLTAGE_DEFAULTS
entityInstance: 16
multiplierM: 4
path: /xyz/openbmc_project/sensors/voltage/S1_0V6_VTT0123
91:
<<: *VOLTAGE_DEFAULTS
entityInstance: 18
multiplierM: 15
path: /xyz/openbmc_project/sensors/voltage/S1_2V5_VPP0123
92:
<<: *VOLTAGE_DEFAULTS
entityInstance: 20
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_1V2_VDDQ4567
93:
<<: *VOLTAGE_DEFAULTS
entityInstance: 22
multiplierM: 4
path: /xyz/openbmc_project/sensors/voltage/S1_0V6_VTT4567
94:
<<: *VOLTAGE_DEFAULTS
entityInstance: 24
multiplierM: 15
path: /xyz/openbmc_project/sensors/voltage/S1_2V5_VPP4567
95:
<<: *VOLTAGE_DEFAULTS
entityInstance: 26
multiplierM: 5
path: /xyz/openbmc_project/sensors/voltage/S1_0V85_RCA
96:
<<: *VOLTAGE_DEFAULTS
entityInstance: 28
multiplierM: 11
path: /xyz/openbmc_project/sensors/voltage/S1_1V8_VDDH
97:
<<: *VOLTAGE_DEFAULTS
entityInstance: 30
multiplierM: 9
path: /xyz/openbmc_project/sensors/voltage/S1_1V5_VDDH
98:
<<: *VOLTAGE_DEFAULTS
entityInstance: 32
multiplierM: 11
path: /xyz/openbmc_project/sensors/voltage/S1_1V8_SOC
99:
<<: *VOLTAGE_DEFAULTS
entityInstance: 34
multiplierM: 11
path: /xyz/openbmc_project/sensors/voltage/S1_1V8_PCP
100:
<<: *VOLTAGE_DEFAULTS
entityInstance: 36
multiplierM: 20
path: /xyz/openbmc_project/sensors/voltage/S1_3V3_SOC
101:
<<: *VOLTAGE_DEFAULTS
entityInstance: 37
multiplierM: 20
path: /xyz/openbmc_project/sensors/voltage/3V3_SB
102:
<<: *VOLTAGE_DEFAULTS
entityInstance: 38
multiplierM: 18
path: /xyz/openbmc_project/sensors/voltage/VBAT_RTC
230:
<<: *VOLTAGE_DEFAULTS
entityInstance: 74
multiplierM: 20
rExp: -1
path: /xyz/openbmc_project/sensors/voltage/PSU0_VINPUT
231:
<<: *VOLTAGE_DEFAULTS
entityInstance: 75
multiplierM: 20
rExp: -1
path: /xyz/openbmc_project/sensors/voltage/PSU1_VINPUT
232:
<<: *VOLTAGE_DEFAULTS
entityInstance: 76
multiplierM: 20
rExp: -2
path: /xyz/openbmc_project/sensors/voltage/PSU0_VOUTPUT
233:
<<: *VOLTAGE_DEFAULTS
entityInstance: 77
multiplierM: 20
rExp: -2
path: /xyz/openbmc_project/sensors/voltage/PSU1_VOUTPUT
105:
<<: *TEMP_DEFAULTS
entityInstance: 13
path: /xyz/openbmc_project/sensors/temperature/S0_DIMMG1_Temp
106:
<<: *TEMP_DEFAULTS
entityInstance: 14
path: /xyz/openbmc_project/sensors/temperature/S1_DIMMG1_Temp
107:
<<: *TEMP_DEFAULTS
entityInstance: 15
path: /xyz/openbmc_project/sensors/temperature/S0_SOC_Temp
108:
<<: *TEMP_DEFAULTS
entityInstance: 16
path: /xyz/openbmc_project/sensors/temperature/S0_SOC_VRD_Temp
109:
<<: *TEMP_DEFAULTS
entityInstance: 17
path: /xyz/openbmc_project/sensors/temperature/S0_DIMM_VRD_Temp
110:
<<: *TEMP_DEFAULTS
entityInstance: 18
path: /xyz/openbmc_project/sensors/temperature/S0_Core_VRD_Temp
111:
<<: *TEMP_DEFAULTS
entityInstance: 19
path: /xyz/openbmc_project/sensors/temperature/S0_DIMMG0_Temp
112: &power
sensorType: 0x08
path: /xyz/openbmc_project/sensors/power/S0_CPU_Pwr
entityID: 19
entityInstance: 39
sensorReadingType: 0x01
multiplierM: 200
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Watts
rExp: -2
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
113:
<<: *power
entityInstance: 40
multiplierM: 39
path: /xyz/openbmc_project/sensors/power/S0_DIMM_VR1_Pwr
114:
<<: *power
entityInstance: 41
multiplierM: 39
path: /xyz/openbmc_project/sensors/power/S0_DIMM_VR2_Pwr
115:
<<: *power
entityInstance: 42
multiplierM: 80
path: /xyz/openbmc_project/sensors/power/S0_MEM_Pwr
116:
<<: *VOLTAGE_DEFAULTS
entityInstance: 43
multiplierM: 10
path: /xyz/openbmc_project/sensors/voltage/S0_CPU_VCORE
117:
<<: *VOLTAGE_DEFAULTS
entityInstance: 44
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_DIMM_VR1_Volt
118:
<<: *VOLTAGE_DEFAULTS
entityInstance: 45
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_DIMM_VR2_Volt
119:
<<: *VOLTAGE_DEFAULTS
entityInstance: 46
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_DIMM_DDR_Volt
123:
<<: *TEMP_DEFAULTS
entityInstance: 20
path: /xyz/openbmc_project/sensors/temperature/S1_SOC_Temp
124:
<<: *TEMP_DEFAULTS
entityInstance: 21
path: /xyz/openbmc_project/sensors/temperature/S1_SOC_VRD_Temp
125:
<<: *TEMP_DEFAULTS
entityInstance: 22
path: /xyz/openbmc_project/sensors/temperature/S1_DIMM_VRD_Temp
126:
<<: *TEMP_DEFAULTS
entityInstance: 23
path: /xyz/openbmc_project/sensors/temperature/S1_Core_VRD_Temp
127:
<<: *TEMP_DEFAULTS
entityInstance: 24
path: /xyz/openbmc_project/sensors/temperature/S1_DIMMG0_Temp
128:
<<: *power
entityInstance: 47
multiplierM: 200
path: /xyz/openbmc_project/sensors/power/S1_CPU_Pwr
129:
<<: *power
entityInstance: 48
multiplierM: 39
path: /xyz/openbmc_project/sensors/power/S1_DIMM_VR1_Pwr
130:
<<: *power
entityInstance: 49
multiplierM: 39
path: /xyz/openbmc_project/sensors/power/S1_DIMM_VR2_Pwr
131:
<<: *power
entityInstance: 50
multiplierM: 80
path: /xyz/openbmc_project/sensors/power/S1_MEM_Pwr
132:
<<: *VOLTAGE_DEFAULTS
entityInstance: 51
multiplierM: 10
path: /xyz/openbmc_project/sensors/voltage/S1_CPU_VCORE
133:
<<: *VOLTAGE_DEFAULTS
entityInstance: 52
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_DIMM_VR1_Volt
134:
<<: *VOLTAGE_DEFAULTS
entityInstance: 53
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_DIMM_VR2_Volt
135:
<<: *VOLTAGE_DEFAULTS
entityInstance: 54
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_DIMM_DDR_Volt
145:
<<: *VOLTAGE_DEFAULTS
entityInstance: 58
multiplierM: 5
path: /xyz/openbmc_project/sensors/voltage/S0_SOC_Volt
146:
<<: *VOLTAGE_DEFAULTS
entityInstance: 59
multiplierM: 5
path: /xyz/openbmc_project/sensors/voltage/S1_SOC_Volt
152:
<<: *power
entityInstance: 60
multiplierM: 80
path: /xyz/openbmc_project/sensors/power/S0_RCA_VR_Pwr
153:
<<: *VOLTAGE_DEFAULTS
entityInstance: 55
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S0_RCA_VR_Volt
154:
<<: *TEMP_DEFAULTS
entityInstance: 25
path: /xyz/openbmc_project/sensors/temperature/S0_RCA_VR_Temp
155:
<<: *power
entityInstance: 61
multiplierM: 80
path: /xyz/openbmc_project/sensors/power/S1_RCA_VR_Pwr
156:
<<: *VOLTAGE_DEFAULTS
entityInstance: 56
multiplierM: 7
path: /xyz/openbmc_project/sensors/voltage/S1_RCA_VR_Volt
157:
<<: *TEMP_DEFAULTS
entityInstance: 26
path: /xyz/openbmc_project/sensors/temperature/S1_RCA_VR_Temp
240:
<<: *power
entityInstance: 84
multiplierM: 80
rExp: -1
path: /xyz/openbmc_project/sensors/power/PSU0_POUTPUT
241:
<<: *power
entityInstance: 85
multiplierM: 80
rExp: -1
path: /xyz/openbmc_project/sensors/power/PSU1_POUTPUT
242:
<<: *power
entityInstance: 57
multiplierM: 80
rExp: -1
path: /xyz/openbmc_project/sensors/power/total_power
238:
<<: *power
entityInstance: 82
multiplierM: 80
rExp: -1
path: /xyz/openbmc_project/sensors/power/PSU0_PINPUT
239:
<<: *power
entityInstance: 83
multiplierM: 80
rExp: -1
path: /xyz/openbmc_project/sensors/power/PSU1_PINPUT
169: &current
sensorType: 0x03
path: /xyz/openbmc_project/sensors/current/S0_Core_VRD_Curr
entityID: 19
entityInstance: 64
sensorReadingType: 0x01
multiplierM: 160
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Amperes
rExp: -3
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
170:
<<: *current
entityInstance: 66
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S0_SOC_VRD_Curr
171:
<<: *current
entityInstance: 68
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S0_DIMM_VR1_Curr
172:
<<: *current
entityInstance: 70
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S0_DIMM_VR2_Curr
173:
<<: *current
entityInstance: 72
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S0_RCA_VRD_Curr
174:
<<: *current
entityInstance: 65
multiplierM: 160
path: /xyz/openbmc_project/sensors/current/S1_Core_VRD_Curr
175:
<<: *current
entityInstance: 67
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S1_SOC_VRD_Curr
176:
<<: *current
entityInstance: 69
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S1_DIMM_VR1_Curr
177:
<<: *current
entityInstance: 71
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S1_DIMM_VR2_Curr
178:
<<: *current
entityInstance: 73
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/S1_RCA_VRD_Curr
234:
<<: *current
entityInstance: 78
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/PSU0_IINPUT
235:
<<: *current
entityInstance: 79
multiplierM: 80
path: /xyz/openbmc_project/sensors/current/PSU1_IINPUT
236:
<<: *current
entityInstance: 80
multiplierM: 160
path: /xyz/openbmc_project/sensors/current/PSU0_IOUTPUT
237:
<<: *current
entityInstance: 81
multiplierM: 160
path: /xyz/openbmc_project/sensors/current/PSU1_IOUTPUT
@@ -0,0 +1 @@
# console-id is default to obmc-console
@@ -0,0 +1 @@
console-id = ttyS1
@@ -0,0 +1 @@
console-id = ttyS2
@@ -0,0 +1 @@
console-id = ttyS3
@@ -0,0 +1,3 @@
# console-id is default to obmc-console
local-tty = ttyS0
local-tty-baud = 115200
@@ -0,0 +1,3 @@
local-tty = ttyS1
local-tty-baud = 115200
console-id = ttyS1
@@ -0,0 +1,3 @@
local-tty = ttyS2
local-tty-baud = 115200
console-id = ttyS2
@@ -0,0 +1,3 @@
local-tty = ttyS3
local-tty-baud = 115200
console-id = ttyS3
@@ -0,0 +1,29 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
RDEPENDS:${PN} += "bash"
# Declare port spcific config files
OBMC_CONSOLE_TTYS = "ttyS0 ttyS1 ttyS2 ttyS3"
CONSOLE_CLIENT = "2200 2201 2202 2203"
CONSOLE_SERVER_CONF_FMT = "file://server.{0}.conf"
CONSOLE_CLIENT_CONF_FMT = "file://client.{0}.conf"
CONSOLE_CLIENT_SERVICE_FMT = "obmc-console-ssh@{0}.service"
SRC_URI += " \
${@compose_list(d, 'CONSOLE_SERVER_CONF_FMT', 'OBMC_CONSOLE_TTYS')} \
${@compose_list(d, 'CONSOLE_CLIENT_CONF_FMT', 'CONSOLE_CLIENT')} \
"
SYSTEMD_SERVICE:${PN}:append = " \
${@compose_list(d, 'CONSOLE_CLIENT_SERVICE_FMT', 'CONSOLE_CLIENT')} \
"
SYSTEMD_SERVICE:${PN}:remove = "obmc-console-ssh.socket"
FILES:${PN}:remove = "${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf"
PACKAGECONFIG:append = " concurrent-servers"
do_install:append() {
# Install the console client configurations
install -m 0644 ${WORKDIR}/client.*.conf ${D}${sysconfdir}/${BPN}/
}
@@ -0,0 +1,7 @@
#!/bin/bash
# shellcheck disable=SC2086
for filename in /sys/class/hwmon/*/pwm*
do
echo 255 > $filename
done;
@@ -0,0 +1,394 @@
[
{
"name": "set_target_fan_not_present",
"groups": [
{
"name": "air_cooled_zone0_fans",
"interface": "xyz.openbmc_project.Inventory.Item",
"property": { "name": "Present" }
}
],
"triggers": [
{
"class": "init",
"method": "get_properties"
},
{
"class": "signal",
"signal": "properties_changed"
}
],
"actions": [
{
"name": "count_state_before_target",
"count": 1,
"state": false,
"target": 255
}
]
},
{
// Hold fans at the given target when a number of rotors are nonfunctional.
"name": "set_target_fan_not_functional",
"groups": [
{
"name": "fan3",
"interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
"property": { "name": "Functional" }
},
{
"name": "fan4",
"interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
"property": { "name": "Functional" }
},
{
"name": "fan5",
"interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
"property": { "name": "Functional" }
},
{
"name": "fan6",
"interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
"property": { "name": "Functional" }
},
{
"name": "fan7",
"interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
"property": { "name": "Functional" }
},
{
"name": "fan8",
"interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
"property": { "name": "Functional" }
}
],
"triggers": [
{
"class": "init",
"method": "get_properties"
},
{
"class": "signal",
"signal": "properties_changed"
}
],
"actions": [
{
"name": "count_state_before_target",
"count": 1,
"state": false,
"target": 255
}
]
},
{
"name": "default_fan_floor_on_missing_service",
"groups": [
{
"name": "zone0_ambient",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"triggers": [
{
"class": "init",
"method": "name_has_owner"
},
{
"class": "signal",
"signal": "name_owner_changed"
}
],
"actions": [
{
"name": "call_actions_based_on_timer",
"timer": {
"interval": 5000000,
"type": "oneshot"
},
"actions": [
{
"name": "default_floor_on_missing_owner",
"groups": [
{
"name": "zone0_ambient",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
]
}
]
}
]
},
{
"name": "target_mapping_from_TS_temp",
"groups": [
{
"name": "zone0_ambient",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"triggers": [
{
"class": "init",
"method": "get_properties"
},
{
"class": "signal",
"signal": "properties_changed"
},
{
"class": "timer",
"type": "repeating",
"interval": 5000000,
"preload_groups": true
}
],
"actions": [
{
"name": "target_from_group_max",
"groups": [
{
"name": "zone0_ambient",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"neg_hysteresis": 1,
"pos_hysteresis": 0,
"index": 0,
"map": [
{ "value": 10.0, "target": 38.0 },
{ "value": 18.0, "target": 38.0 },
{ "value": 20.0, "target": 41.0 },
{ "value": 21.0, "target": 43.0 },
{ "value": 22.0, "target": 46.0 },
{ "value": 24.0, "target": 48.0 },
{ "value": 28.0, "target": 51.0 },
{ "value": 32.0, "target": 56.0 },
{ "value": 34.0, "target": 59.0 },
{ "value": 36.0, "target": 61.0 },
{ "value": 40.0, "target": 64.0 },
{ "value": 41.0, "target": 66.0 },
{ "value": 42.0, "target": 69.0 },
{ "value": 43.0, "target": 71.0 },
{ "value": 44.0, "target": 74.0 },
{ "value": 45.0, "target": 77.0 },
{ "value": 46.0, "target": 79.0 },
{ "value": 47.0, "target": 82.0 },
{ "value": 48.0, "target": 84.0 },
{ "value": 49.0, "target": 87.0 },
{ "value": 50.0, "target": 89.0 }
]
}
]
},
{
"name": "target_mapping_from_OCP_temp",
"groups": [
{
"name": "zone0_ocp",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"triggers": [
{
"class": "init",
"method": "get_properties"
},
{
"class": "signal",
"signal": "properties_changed"
},
{
"class": "timer",
"type": "repeating",
"interval": 5000000,
"preload_groups": true
}
],
"actions": [
{
"name": "target_from_group_max",
"groups": [
{
"name": "zone0_ocp",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"neg_hysteresis": 2,
"pos_hysteresis": 2,
"index": 3,
"map": [
{ "value": 10.0, "target": 38.0 },
{ "value": 65.0, "target": 38.0 },
{ "value": 66.0, "target": 43.0 },
{ "value": 67.0, "target": 51.0 },
{ "value": 68.0, "target": 54.0 },
{ "value": 69.0, "target": 56.0 },
{ "value": 70.0, "target": 61.0 },
{ "value": 71.0, "target": 66.0 },
{ "value": 72.0, "target": 71.0 },
{ "value": 73.0, "target": 77.0 },
{ "value": 74.0, "target": 82.0 },
{ "value": 75.0, "target": 87.0 },
{ "value": 76.0, "target": 92.0 },
{ "value": 77.0, "target": 97.0 },
{ "value": 78.0, "target": 102.0 },
{ "value": 79.0, "target": 107.0 },
{ "value": 80.0, "target": 112.0 },
{ "value": 81.0, "target": 122.0 },
{ "value": 82.0, "target": 128.0 },
{ "value": 83.0, "target": 133.0 },
{ "value": 84.0, "target": 140.0 },
{ "value": 85.0, "target": 148.0 },
{ "value": 86.0, "target": 156.0 },
{ "value": 87.0, "target": 163.0 },
{ "value": 88.0, "target": 171.0 },
{ "value": 89.0, "target": 179.0 },
{ "value": 90.0, "target": 186.0 },
{ "value": 91.0, "target": 194.0 },
{ "value": 92.0, "target": 201.0 },
{ "value": 93.0, "target": 209.0 },
{ "value": 94.0, "target": 217.0 },
{ "value": 95.0, "target": 224.0 },
{ "value": 96.0, "target": 232.0 },
{ "value": 97.0, "target": 240.0 },
{ "value": 98.0, "target": 247.0 },
{ "value": 99.0, "target": 255.0 }
]
}
]
},
{
"name": "target_mapping_from_BP_NVME_temp",
"groups": [
{
"name": "zone0_bp_nvme",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"triggers": [
{
"class": "init",
"method": "get_properties"
},
{
"class": "signal",
"signal": "properties_changed"
},
{
"class": "timer",
"type": "repeating",
"interval": 5000000,
"preload_groups": true
}
],
"actions": [
{
"name": "target_from_group_max",
"groups": [
{
"name": "zone0_bp_nvme",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"neg_hysteresis": 2,
"pos_hysteresis": 0,
"index": 4,
"map": [
{ "value": 10.0, "target": 38.0 },
{ "value": 35.0, "target": 38.0 },
{ "value": 36.0, "target": 43.0 },
{ "value": 37.0, "target": 48.0 },
{ "value": 38.0, "target": 54.0 },
{ "value": 39.0, "target": 59.0 },
{ "value": 40.0, "target": 64.0 },
{ "value": 41.0, "target": 66.0 },
{ "value": 42.0, "target": 69.0 },
{ "value": 43.0, "target": 71.0 },
{ "value": 44.0, "target": 74.0 },
{ "value": 45.0, "target": 77.0 },
{ "value": 46.0, "target": 79.0 },
{ "value": 47.0, "target": 82.0 },
{ "value": 48.0, "target": 84.0 },
{ "value": 49.0, "target": 87.0 },
{ "value": 50.0, "target": 89.0 },
{ "value": 51.0, "target": 99.0 },
{ "value": 52.0, "target": 99.0 },
{ "value": 53.0, "target": 105.0 },
{ "value": 54.0, "target": 110.0 },
{ "value": 55.0, "target": 115.0 },
{ "value": 56.0, "target": 120.0 },
{ "value": 57.0, "target": 125.0 },
{ "value": 58.0, "target": 130.0 },
{ "value": 59.0, "target": 135.0 },
{ "value": 60.0, "target": 140.0 },
{ "value": 61.0, "target": 150.0 },
{ "value": 62.0, "target": 161.0 },
{ "value": 63.0, "target": 171.0 },
{ "value": 64.0, "target": 181.0 },
{ "value": 65.0, "target": 191.0 },
{ "value": 66.0, "target": 204.0 },
{ "value": 67.0, "target": 217.0 },
{ "value": 68.0, "target": 230.0 },
{ "value": 69.0, "target": 255.0 }
]
}
]
},
{
"name": "target_mapping_from_M2_NVME_temp",
"groups": [
{
"name": "zone0_m2_nvme",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"triggers": [
{
"class": "init",
"method": "get_properties"
},
{
"class": "signal",
"signal": "properties_changed"
},
{
"class": "timer",
"type": "repeating",
"interval": 5000000,
"preload_groups": true
}
],
"actions": [
{
"name": "target_from_group_max",
"groups": [
{
"name": "zone0_m2_nvme",
"interface": "xyz.openbmc_project.Sensor.Value",
"property": { "name": "Value" }
}
],
"neg_hysteresis": 2,
"pos_hysteresis": 0,
"index": 5,
"map": [
{ "value": 10.0, "target": 38.0 },
{ "value": 61.0, "target": 38.0 },
{ "value": 68.0, "target": 38.0 },
{ "value": 69.0, "target": 204.0 }
]
}
]
}
]
@@ -0,0 +1,44 @@
[
{
"name": "FAN3",
"zone": "0",
"sensors": ["PWM3"],
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/"
},
{
"name": "FAN4",
"zone": "0",
"sensors": ["PWM4"],
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/"
},
{
"name": "FAN5",
"zone": "0",
"sensors": ["PWM5"],
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/"
},
{
"name": "FAN6",
"zone": "0",
"sensors": ["PWM6"],
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/"
},
{
"name": "FAN7",
"zone": "0",
"sensors": ["PWM7"],
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/"
},
{
"name": "FAN8",
"zone": "0",
"sensors": ["PWM8"],
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/"
}
]
@@ -0,0 +1,80 @@
[
{
"name": "air_cooled_zone0_fans",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN3",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN4",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN5",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN6",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN7",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN8"
]
},
{
"name": "fan3",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN3/FAN3_1",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN3/FAN3_2"
]
},
{
"name": "fan4",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN4/FAN4_1",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN4/FAN4_2"
]
},
{
"name": "fan5",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN5/FAN5_1",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN5/FAN5_2"
]
},
{
"name": "fan6",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN6/FAN6_1",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN6/FAN6_2"
]
},
{
"name": "fan7",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN7/FAN7_1",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN7/FAN7_2"
]
},
{
"name": "fan8",
"members": [
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN8/FAN8_1",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade/FAN8/FAN8_2"
]
},
{
"name": "zone0_ambient",
"service": "xyz.openbmc_project.HwmonTempSensor",
"members": [
"/xyz/openbmc_project/sensors/temperature/TS4_Temp"
]
},
{
"name": "zone0_ocp",
"members": [
"/xyz/openbmc_project/sensors/temperature/OCP_Temp"
]
},
{
"name": "zone0_bp_nvme",
"members": [
"/xyz/openbmc_project/sensors/temperature/nvme_bp_max"
]
},
{
"name": "zone0_m2_nvme",
"members": [
"/xyz/openbmc_project/sensors/temperature/nvme_m2_max"
]
}
]
@@ -0,0 +1,160 @@
{
"fans": [
{
"inventory": "/system/chassis/Mt_Jade/FAN3",
"allowed_out_of_range_time": 10,
"deviation": 25,
"num_sensors_nonfunc_for_fan_nonfunc": 1,
"monitor_start_delay": 30,
"set_func_on_present": false,
"sensors": [
{
"name": "FAN3_1",
"has_target": true,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM3",
"factor": 82,
"offset": 0
},
{
"name": "FAN3_2",
"has_target": false,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM3",
"factor": 82,
"offset": 0
}
]
},
{
"inventory": "/system/chassis/Mt_Jade/FAN4",
"allowed_out_of_range_time": 10,
"deviation": 25,
"num_sensors_nonfunc_for_fan_nonfunc": 1,
"monitor_start_delay": 30,
"set_func_on_present": false,
"sensors": [
{
"name": "FAN4_1",
"has_target": true,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM4",
"factor": 82,
"offset": 0
},
{
"name": "FAN4_2",
"has_target": false,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM4",
"factor": 82,
"offset": 0
}
]
},
{
"inventory": "/system/chassis/Mt_Jade/FAN5",
"allowed_out_of_range_time": 10,
"deviation": 25,
"num_sensors_nonfunc_for_fan_nonfunc": 1,
"monitor_start_delay": 30,
"set_func_on_present": false,
"sensors": [
{
"name": "FAN5_1",
"has_target": true,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM5",
"factor": 82,
"offset": 0
},
{
"name": "FAN5_2",
"has_target": false,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM5",
"factor": 82,
"offset": 0
}
]
},
{
"inventory": "/system/chassis/Mt_Jade/FAN6",
"allowed_out_of_range_time": 10,
"deviation": 25,
"num_sensors_nonfunc_for_fan_nonfunc": 1,
"monitor_start_delay": 30,
"set_func_on_present": false,
"sensors": [
{
"name": "FAN6_1",
"has_target": true,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM6",
"factor": 82,
"offset": 0
},
{
"name": "FAN6_2",
"has_target": false,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM6",
"factor": 82,
"offset": 0
}
]
},
{
"inventory": "/system/chassis/Mt_Jade/FAN7",
"allowed_out_of_range_time": 10,
"deviation": 25,
"num_sensors_nonfunc_for_fan_nonfunc": 1,
"monitor_start_delay": 30,
"set_func_on_present": false,
"sensors": [
{
"name": "FAN7_1",
"has_target": true,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM7",
"factor": 82,
"offset": 0
},
{
"name": "FAN7_2",
"has_target": false,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM7",
"factor": 82,
"offset": 0
}
]
},
{
"inventory": "/system/chassis/Mt_Jade/FAN8",
"allowed_out_of_range_time": 10,
"deviation": 25,
"num_sensors_nonfunc_for_fan_nonfunc": 1,
"monitor_start_delay": 30,
"set_func_on_present": false,
"sensors": [
{
"name": "FAN8_1",
"has_target": true,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM8",
"factor": 82,
"offset": 0
},
{
"name": "FAN8_2",
"has_target": false,
"target_interface": "xyz.openbmc_project.Control.FanPwm",
"target_path": "/xyz/openbmc_project/control/fanpwm/PWM8",
"factor": 82,
"offset": 0
}
]
}
]
}
@@ -0,0 +1,99 @@
[
{
"name": "FAN3",
"path": "/system/chassis/Mt_Jade/FAN3",
"methods": [
{
"type": "tach",
"sensors": [
"FAN3_1",
"FAN3_2"
]
}
],
"rpolicy": {
"type": "anyof"
}
},
{
"name": "FAN4",
"path": "/system/chassis/Mt_Jade/FAN4",
"methods": [
{
"type": "tach",
"sensors": [
"FAN4_1",
"FAN4_2"
]
}
],
"rpolicy": {
"type": "anyof"
}
},
{
"name": "FAN5",
"path": "/system/chassis/Mt_Jade/FAN5",
"methods": [
{
"type": "tach",
"sensors": [
"FAN5_1",
"FAN5_2"
]
}
],
"rpolicy": {
"type": "anyof"
}
},
{
"name": "FAN6",
"path": "/system/chassis/Mt_Jade/FAN6",
"methods": [
{
"type": "tach",
"sensors": [
"FAN6_1",
"FAN6_2"
]
}
],
"rpolicy": {
"type": "anyof"
}
},
{
"name": "FAN7",
"path": "/system/chassis/Mt_Jade/FAN7",
"methods": [
{
"type": "tach",
"sensors": [
"FAN7_1",
"FAN7_2"
]
}
],
"rpolicy": {
"type": "anyof"
}
},
{
"name": "FAN8",
"path": "/system/chassis/Mt_Jade/FAN8",
"methods": [
{
"type": "tach",
"sensors": [
"FAN8_1",
"FAN8_2"
]
}
],
"rpolicy": {
"type": "anyof"
}
}
]
@@ -0,0 +1,10 @@
[
{
"name": "0",
"poweron_target": 153,
"default_ceiling": 255,
"default_floor": 255,
"increase_delay": 5,
"decrease_interval": 30
}
]
@@ -0,0 +1,12 @@
[Unit]
Description=Phosphor Fan Control Daemon
Wants=xyz.openbmc_project.fansensor.service
After=xyz.openbmc_project.fansensor.service
StartLimitIntervalSec=30
StartLimitBurst=3
[Service]
Restart=on-failure
ExecStart=phosphor-fan-control
RestartSec=20
ExecStopPost=/usr/bin/ampere_set_fan_max_speed.sh
@@ -0,0 +1,12 @@
[Unit]
Description=Phosphor Fan Monitor Daemon
Wants=xyz.openbmc_project.fansensor.service
After=xyz.openbmc_project.fansensor.service
StartLimitIntervalSec=30
StartLimitBurst=3
[Service]
Restart=on-failure
ExecStart=phosphor-fan-monitor
RestartSec=20
ExecStopPost=/usr/bin/ampere_set_fan_max_speed.sh
@@ -0,0 +1,45 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
FILESEXTRAPATHS:append := "${THISDIR}/${PN}/${MACHINE}:"
RDEPENDS:${PN}-monitor += "bash"
PACKAGECONFIG:append = " json"
SRC_URI:append = " file://events.json \
file://fans.json \
file://groups.json \
file://zones.json \
file://monitor.json \
file://presence.json \
file://phosphor-fan-control@.service \
file://phosphor-fan-monitor@.service \
file://ampere_set_fan_max_speed.sh \
"
FILES:${PN}-monitor += " \
${bindir}/ampere_set_fan_max_speed.sh \
"
do_configure:prepend() {
mkdir -p ${S}/control/config_files/${MACHINE}
cp ${WORKDIR}/events.json ${S}/control/config_files/${MACHINE}/events.json
cp ${WORKDIR}/fans.json ${S}/control/config_files/${MACHINE}/fans.json
cp ${WORKDIR}/groups.json ${S}/control/config_files/${MACHINE}/groups.json
cp ${WORKDIR}/zones.json ${S}/control/config_files/${MACHINE}/zones.json
mkdir -p ${S}/monitor/config_files/${MACHINE}
cp ${WORKDIR}/monitor.json ${S}/monitor/config_files/${MACHINE}/config.json
mkdir -p ${S}/presence/config_files/${MACHINE}
cp ${WORKDIR}/presence.json ${S}/presence/config_files/${MACHINE}/config.json
}
do_install:append() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/ampere_set_fan_max_speed.sh ${D}${bindir}/ampere_set_fan_max_speed.sh
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/phosphor-fan-monitor@.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/phosphor-fan-control@.service ${D}${systemd_system_unitdir}
}
@@ -0,0 +1,8 @@
[Unit]
Description=Ampere Computing LLC host shutdown ACK
Conflicts=obmc-chassis-poweron@0.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ampere_power_util.sh mb shutdown_ack
SyslogIdentifier=ampere_host_shutdown_ack
@@ -0,0 +1,72 @@
#!/bin/sh
# When system only use single PSU ( ex : PSU1 ) to power ON normal 12V,
# HSC2 will be trigged Fault event (FET health).
# At this time, to plug-in PSU2 in system, PSU2 won't deliver power to
# +12V_MB because HSC2 is protected by Fault event.
# Due to HSC2 protected, the PSU redundancy mechanism can't be created.
# Once PSU1 is plugged out at this moment, system will crash ( reset )
# because +12V_MB dropped.
# BMC SW work-around solution:
# - When BMC detect event PSU is plugged in system, BMC will reset HSC
# by disbale HOT SWAP and then enable HOT SWAP through pmbus command to clear
# Fault event.
# Note:
# In case hot swap occurs during BMC reset, BMC still not in operation state,
# BMC can't detect PSU plug/unplug, then the work-around won't be executed
# Author: Chanh Nguyen <chnguyen@amperecomputing.com>
HSC1_PMBUS_NUM=10
HSC2_PMBUS_NUM=10
HSC1_SLAVE_ADDR=0x10
HSC2_SLAVE_ADDR=0x11
OPERATION=0x01
STATUS_MFR_SPECIFIC=0x80
# $1 will be the name of the psu
PSU=$1
if [ "$PSU" = 0 ]; then
HSC_PMBUS_NUM=$HSC1_PMBUS_NUM
HSC_SLAVE_ADDR=$HSC1_SLAVE_ADDR
elif [ "$PSU" = 1 ]; then
HSC_PMBUS_NUM=$HSC2_PMBUS_NUM
HSC_SLAVE_ADDR=$HSC2_SLAVE_ADDR
else
echo "Please choose PSU1 (0) or PSU2 (1)"
echo "Ex: ampere_psu_reset_hotswap.sh 0"
exit 0
fi
# Check HOST state
chassisstate=$(obmcutil chassisstate | awk -F. '{print $NF}')
if [ "$chassisstate" = 'Off' ]; then
echo "HOST is being OFF, so can't access the i2c $HSC_PMBUS_NUM. Please Turn ON HOST !"
exit 1
fi
# Check FET health problems
if ! data=$(i2cget -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $STATUS_MFR_SPECIFIC); then
echo "ERROR: Can't access the i2c. Please check /dev/i2c-$HSC_PMBUS_NUM"
exit 1
fi
psu_sts=$(((data & 0x80) != 0))
if [ $psu_sts = 1 ]; then
echo "PSU $PSU: FET health problems have been detected"
echo "Reset Hot swap output on PSU $PSU"
# Disable Hot swap output
write_data=0x00
i2cset -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $OPERATION $write_data b
# Enable Hot swap output
write_data=0x80;
i2cset -f -y $HSC_PMBUS_NUM $HSC_SLAVE_ADDR $OPERATION $write_data b
else
echo "PSU $PSU: FET health problems have not been detected"
fi
@@ -0,0 +1,6 @@
[Unit]
Description=Ampere Computing LLC Ampere failover event service
[Service]
Restart=no
ExecStart=/usr/sbin/ampere_scp_failover.sh
@@ -0,0 +1,34 @@
#!/bin/bash
# Handle the SCP Failover feature in which:
# - If the BMC receives the SCP_AUTH_FAILURE signal from Socket0,
# attempts to boot from the failover boot EEPROM.
# - If the second boot fails, treats this as a permanent boot failure
# and logs an event in SEL.
# shellcheck disable=SC1091
# shellcheck disable=SC2046
source /usr/sbin/gpio-lib.sh
source /usr/sbin/gpio-defs.sh
# Check the I2C_BACKUP_SEL
I2C_BACKUP_SEL=$(gpio_get_val "$BMC_I2C_BACKUP_SEL")
if [ "${I2C_BACKUP_SEL}" == "1" ]; then
# If it is HIGH, set it LOW. Then reset the Host to boot from
# the failover Boot EEPROM.
echo "scp-failover: switch HOST to failover boot EEPROM"
gpioset $(gpiofind BMC_SELECT_EEPROM)=0
# Reset the Host to boot on the failover EEPROM
ampere_power_util.sh mb force_reset
else
# Turn OFF Host as SCP firmware on both Boot EEPROM fail
obmcutil chassisoff
echo "scp-failover: switch HOST back to the main Boot EEPROM"
gpioset $(gpiofind BMC_SELECT_EEPROM)=1
# Log event
ampere_add_redfishevent.sh OpenBMC.0.1.GeneralFirmwareSecurityViolation.Critical "SCP Authentication failure"
fi
@@ -0,0 +1,73 @@
[
{
"Name": "REBOOT_ACK",
"ChipId": "0",
"GpioNum": 75,
"EventMon": "FALLING",
"Target": "obmc-host-force-warm-reboot@0.target",
"Continue": true
},
{
"Name": "SHUTDOWN_ACK",
"ChipId": "0",
"GpioNum": 50,
"EventMon": "FALLING",
"Target": "ampere-host-shutdown-ack@0.service",
"Continue": true
},
{
"Name": "S0_OVERTEMP",
"LineName": "S0_OVERTEMP_L",
"EventMon": "FALLING",
"Target": "ampere_overtemp@0.service",
"Continue": true
},
{
"Name": "S1_OVERTEMP",
"LineName": "S1_OVERTEMP_L",
"EventMon": "FALLING",
"Target": "ampere_overtemp@1.service",
"Continue": true
},
{
"Name": "S0_HIGHTEMP",
"LineName": "S0_HIGHTEMP_L",
"EventMon": "BOTH",
"Targets": {
"FALLING": ["ampere_hightemp_start@0.service"],
"RISING": ["ampere_hightemp_stop@0.service"]
},
"Continue": true
},
{
"Name": "S1_HIGHTEMP",
"LineName": "S1_HIGHTEMP_L",
"EventMon": "BOTH",
"Targets": {
"FALLING": ["ampere_hightemp_start@1.service"],
"RISING": ["ampere_hightemp_stop@1.service"]
},
"Continue": true
},
{
"Name": "S0_SCP_AUTH_FAIL",
"LineName": "S0_SCP_AUTH_FAIL_L",
"EventMon": "FALLING",
"Target": "ampere_scp_failover.service",
"Continue": true
},
{
"Name": "PSU1_VIN_GOOD",
"LineName": "PSU1_VIN_GOOD",
"EventMon": "RISING",
"Target": "psu_hotswap_reset@0.service",
"Continue": true
},
{
"Name": "PSU2_VIN_GOOD",
"LineName": "PSU2_VIN_GOOD",
"EventMon": "RISING",
"Target": "psu_hotswap_reset@1.service",
"Continue": true
}
]
@@ -0,0 +1,6 @@
[Unit]
Description=Ampere Computing LLC PSU1 reset hotswap
[Service]
Restart=no
ExecStart=/usr/sbin/ampere_psu_reset_hotswap.sh %i
@@ -0,0 +1,31 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
inherit systemd
inherit obmc-phosphor-systemd
RDEPENDS:${PN}-monitor += "bash"
RDEPENDS:${PN} += "bash"
SRC_URI += " \
file://phosphor-multi-gpio-monitor.json \
file://ampere_scp_failover.sh \
file://ampere_psu_reset_hotswap.sh \
"
SYSTEMD_SERVICE:${PN}-monitor += " \
ampere_scp_failover.service \
psu_hotswap_reset@.service \
"
FILES:${PN}-monitor += " \
${datadir}/${PN}/phosphor-multi-gpio-monitor.json \
/usr/sbin/ampere_scp_failover.sh \
/usr/sbin/ampere_psu_reset_hotswap.sh \
"
do_install:append() {
install -d ${D}${sbindir}
install -m 0644 ${WORKDIR}/phosphor-multi-gpio-monitor.json ${D}${datadir}/${PN}/
install -m 0755 ${WORKDIR}/ampere_scp_failover.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/ampere_psu_reset_hotswap.sh ${D}${sbindir}/
}
@@ -0,0 +1,3 @@
SOCKET_ID=default
MODE=stream
STREAM_DST=/run/rsyslog/console/cpu
@@ -0,0 +1,3 @@
SOCKET_ID=ttyS1
MODE=stream
STREAM_DST=/run/rsyslog/console/scp0
@@ -0,0 +1,3 @@
SOCKET_ID=ttyS2
MODE=stream
STREAM_DST=/run/rsyslog/console/atf
@@ -0,0 +1,3 @@
SOCKET_ID=ttyS3
MODE=stream
STREAM_DST=/run/rsyslog/console/scp1
@@ -0,0 +1,18 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " \
file://ttyS0.conf \
file://ttyS1.conf \
file://ttyS2.conf \
file://ttyS3.conf \
"
do_install:append() {
# Install the configurations
install -m 0755 -d ${D}${sysconfdir}/${BPN}
install -m 0644 ${WORKDIR}/*.conf ${D}${sysconfdir}/${BPN}/
# Remove upstream-provided default configuration
rm -f ${D}${sysconfdir}/${BPN}/ttyVUART0.conf
}
@@ -0,0 +1,7 @@
# This is the default password for the OpenBMC root user account (0penBmc)
# Override salted and hashed value. The salted and hashed value are generated
# by command "openssl passwd -6 -salt rounds=1000\$UGMqyqdG 0penBmc"
AMPERE_DEFAULT_OPENBMC_PASSWORD = "'\$6\$rounds=1000\$UGMqyqdG\$uaE7HvA2vYhZYpIslelD1bsZMkXWV7YjL3wS2Vwj8rXyf90umESUzuR5if64N1LkNzTX.HUIi6D8s108y5GOB/'"
EXTRA_USERS_PARAMS:pn-obmc-phosphor-image = " \
usermod -p ${AMPERE_DEFAULT_OPENBMC_PASSWORD} root; \
"
@@ -0,0 +1 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
@@ -0,0 +1,30 @@
{
"inlet": [
{"instance": 1, "dbus": "/xyz/openbmc_project/sensors/temperature/PSU0_TEMP", "record_id": 243},
{"instance": 2, "dbus": "/xyz/openbmc_project/sensors/temperature/PSU1_TEMP", "record_id": 244}
],
"baseboard": [
{"instance": 1, "dbus": "/xyz/openbmc_project/sensors/temperature/TS1_Temp", "record_id": 1},
{"instance": 2, "dbus": "/xyz/openbmc_project/sensors/temperature/TS2_Temp", "record_id": 2},
{"instance": 3, "dbus": "/xyz/openbmc_project/sensors/temperature/TS3_Temp", "record_id": 3},
{"instance": 4, "dbus": "/xyz/openbmc_project/sensors/temperature/TS4_Temp", "record_id": 4},
{"instance": 5, "dbus": "/xyz/openbmc_project/sensors/temperature/TS5_Temp", "record_id": 5},
{"instance": 6, "dbus": "/xyz/openbmc_project/sensors/temperature/TS6_Temp", "record_id": 6}
],
"cpu": [
{ "instance": 1, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_SOC_Temp", "record_id": 107 },
{ "instance": 2, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_SOC_VRD_Temp", "record_id": 108 },
{ "instance": 3, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_DIMM_VRD_Temp", "record_id": 109 },
{ "instance": 4, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_Core_VRD_Temp", "record_id": 110 },
{ "instance": 5, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_DIMMG0_Temp", "record_id": 111 },
{ "instance": 6, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_RCA_VR_Temp", "record_id": 154 },
{ "instance": 7, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_SOC_Temp", "record_id": 123 },
{ "instance": 8, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_SOC_VRD_Temp", "record_id": 124 },
{ "instance": 9, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_DIMM_VRD_Temp", "record_id": 125 },
{ "instance": 10, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_Core_VRD_Temp", "record_id": 126 },
{ "instance": 11, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_DIMMG0_Temp", "record_id": 127 },
{ "instance": 12, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_RCA_VR_Temp", "record_id": 157 },
{ "instance": 13, "dbus": "/xyz/openbmc_project/sensors/temperature/S0_DIMMG1_Temp", "record_id": 105 },
{ "instance": 14, "dbus": "/xyz/openbmc_project/sensors/temperature/S1_DIMMG1_Temp", "record_id": 106 }
]
}
@@ -0,0 +1,2 @@
{"id": 32, "revision": 1, "addn_dev_support": 141,
"manuf_id": 52538, "prod_id": 130, "aux": 0}
@@ -0,0 +1,10 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
PACKAGECONFIG:append = " dynamic-storages-only"
DEPENDS:append = " mtjade-yaml-config"
EXTRA_OEMESON = " \
-Dsensor-yaml-gen=${STAGING_DIR_HOST}${datadir}/mtjade-yaml-config/ipmi-sensors.yaml \
-Dfru-yaml-gen=${STAGING_DIR_HOST}${datadir}/mtjade-yaml-config/ipmi-fru-read.yaml \
"
@@ -0,0 +1,7 @@
DEFAULT_RMCPP_IFACE = "eth1"
ALT_RMCPP_IFACE = "eth0"
SYSTEMD_SERVICE:${PN} += " \
${PN}@${ALT_RMCPP_IFACE}.service \
${PN}@${ALT_RMCPP_IFACE}.socket \
"
@@ -0,0 +1,3 @@
[Service]
ExecStopPost=/bin/sh -c "/usr/bin/gpioset 0 228=0"
ExecStartPost=/bin/sh -c "/usr/bin/gpioset 0 228=1"
@@ -0,0 +1,11 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
SRC_URI += " file://ssifbridge-override.conf"
FILES:${PN} += "${systemd_system_unitdir}/ssifbridge.service.d"
do_install:append() {
install -d ${D}${systemd_system_unitdir}/ssifbridge.service.d
install -m 644 ${WORKDIR}/ssifbridge-override.conf \
${D}${systemd_system_unitdir}/ssifbridge.service.d
}
@@ -0,0 +1,19 @@
SUMMARY = "Phosphor LED Group Management for Mt. Jade"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit native
PROVIDES += "virtual/phosphor-led-manager-config-native"
SRC_URI += "file://led.yaml"
S = "${WORKDIR}"
# Overwrite the example led layout yaml file prior
# to building the phosphor-led-manager package
do_install() {
SRC=${S}
DEST=${D}${datadir}/phosphor-led-manager
install -D ${SRC}/led.yaml ${DEST}/led.yaml
}
@@ -0,0 +1,32 @@
bmc_booted:
power:
Action: 'Blink'
DutyOn: 50
Period: 1000
Priority: 'On'
power_on:
power:
Action: 'On'
DutyOn: 50
Period: 0
Priority: 'On'
systemFault:
fault:
Action: 'On'
DutyOn: 50
Period: 0
Priority: 'Blink'
enclosure_identify:
identify:
Action: 'On'
DutyOn: 50
Period: 1000
enclosure_identify_blink:
identify:
Action: 'Blink'
DutyOn: 50
Period: 1000
@@ -0,0 +1,16 @@
RDEPENDS:${PN}-extras:append = " \
webui-vue \
phosphor-image-signing \
phosphor-virtual-sensor \
phosphor-misc-usb-ctrl \
phosphor-gpio-monitor-monitor \
"
RDEPENDS:${PN}-inventory:append = " \
dbus-sensors \
entity-manager \
"
RDEPENDS:${PN}-extras:remove = " phosphor-hwmon"
VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "dbus-sensors"
RDEPENDS:${PN}-extras:append = " phosphor-virtual-sensor"
@@ -0,0 +1,279 @@
[
{
"Desc":
{
"Name": "total_power",
"SensorType": "power"
},
"Threshold" :
{
},
"Associations":
[
[
"chassis",
"all_sensors",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade"
],
[
"inventory",
"sensors",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade"
]
],
"Params":
{
"DbusParam":
[
{
"ParamName": "P0",
"Desc":
{
"Name": "PSU0_POUTPUT",
"SensorType": "power"
}
},
{
"ParamName": "P1",
"Desc":
{
"Name": "PSU1_POUTPUT",
"SensorType": "power"
}
}
]
},
"Expression": "((P0 == P0) ? P0 : 0) + ((P1 == P1) ? P1 : 0)"
},
{
"Desc":{
"Name":"nvme_bp_max",
"SensorType":"temperature"
},
"Associations":
[
[
"chassis",
"all_sensors",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade"
],
[
"inventory",
"sensors",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade"
]
],
"Params":{
"DbusParam": [
{
"ParamName": "n0",
"Desc": {
"Name": "nvme0",
"SensorType": "temperature"
}
},
{
"ParamName": "n1",
"Desc": {
"Name": "nvme1",
"SensorType": "temperature"
}
},
{
"ParamName": "n2",
"Desc": {
"Name": "nvme2",
"SensorType": "temperature"
}
},
{
"ParamName": "n3",
"Desc": {
"Name": "nvme3",
"SensorType": "temperature"
}
},
{
"ParamName": "n4",
"Desc": {
"Name": "nvme4",
"SensorType": "temperature"
}
},
{
"ParamName": "n5",
"Desc": {
"Name": "nvme5",
"SensorType": "temperature"
}
},
{
"ParamName": "n6",
"Desc": {
"Name": "nvme6",
"SensorType": "temperature"
}
},
{
"ParamName": "n7",
"Desc": {
"Name": "nvme7",
"SensorType": "temperature"
}
},
{
"ParamName": "n8",
"Desc": {
"Name": "nvme8",
"SensorType": "temperature"
}
},
{
"ParamName": "n9",
"Desc": {
"Name": "nvme9",
"SensorType": "temperature"
}
},
{
"ParamName": "n10",
"Desc": {
"Name": "nvme10",
"SensorType": "temperature"
}
},
{
"ParamName": "n11",
"Desc": {
"Name": "nvme11",
"SensorType": "temperature"
}
},
{
"ParamName": "n12",
"Desc": {
"Name": "nvme12",
"SensorType": "temperature"
}
},
{
"ParamName": "n13",
"Desc": {
"Name": "nvme13",
"SensorType": "temperature"
}
},
{
"ParamName": "n14",
"Desc": {
"Name": "nvme14",
"SensorType": "temperature"
}
},
{
"ParamName": "n15",
"Desc": {
"Name": "nvme15",
"SensorType": "temperature"
}
},
{
"ParamName": "n16",
"Desc": {
"Name": "nvme16",
"SensorType": "temperature"
}
},
{
"ParamName": "n17",
"Desc": {
"Name": "nvme17",
"SensorType": "temperature"
}
},
{
"ParamName": "n18",
"Desc": {
"Name": "nvme18",
"SensorType": "temperature"
}
},
{
"ParamName": "n19",
"Desc": {
"Name": "nvme19",
"SensorType": "temperature"
}
},
{
"ParamName": "n20",
"Desc": {
"Name": "nvme20",
"SensorType": "temperature"
}
},
{
"ParamName": "n21",
"Desc": {
"Name": "nvme21",
"SensorType": "temperature"
}
},
{
"ParamName": "n22",
"Desc": {
"Name": "nvme22",
"SensorType": "temperature"
}
},
{
"ParamName": "n23",
"Desc": {
"Name": "nvme23",
"SensorType": "temperature"
}
}
]
},
"Expression": "max((n0 == n0) ? n0 : 0,(n1 == n1) ? n1 : 0,(n2 == n2) ? n2 : 0,(n3 == n3) ? n3 : 0,(n4 == n4) ? n4 : 0,(n5 == n5) ? n5 : 0,(n6 == n6) ? n6 : 0,(n7 == n7) ? n7 : 0,(n8 == n8) ? n8 : 0,(n9 == n9) ? n9 : 0,(n10 == n10) ? n10 : 0,(n11 == n11) ? n11 : 0,(n12 == n12) ? n12 : 0,(n13 == n13) ? n13 : 0,(n14 == n14) ? n14 : 0,(n15 == n15) ? n15 : 0,(n16 == n16) ? n16 : 0,(n17 == n17) ? n17 : 0,(n18 == n18) ? n18 : 0,(n19 == n19) ? n19 : 0,(n20 == n20) ? n20 : 0,(n21 == n21) ? n21 : 0,(n22 == n22) ? n22 : 0,(n23 == n23) ? n23 : 0)"
},
{
"Desc":{
"Name":"nvme_m2_max",
"SensorType":"temperature"
},
"Associations":
[
[
"chassis",
"all_sensors",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade"
],
[
"inventory",
"sensors",
"/xyz/openbmc_project/inventory/system/chassis/Mt_Jade"
]
],
"Params":{
"DbusParam": [
{
"ParamName": "n24",
"Desc": {
"Name": "nvme24",
"SensorType": "temperature"
}
},
{
"ParamName": "n25",
"Desc": {
"Name": "nvme25",
"SensorType": "temperature"
}
}
]
},
"Expression": "max((n24 == n24) ? n24 : 0,(n25 == n25) ? n25 : 0)"
}
]
@@ -0,0 +1,10 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " \
file://virtual_sensor_config.json \
"
do_install:append() {
install -m 0644 ${WORKDIR}/virtual_sensor_config.json ${D}${datadir}/phosphor-virtual-sensor/
}
@@ -0,0 +1,59 @@
{
"gpio_configs": {
"power_config": {
"power_good_in": "PGOOD",
"power_up_outs": [
{"name": "OCP_MAIN_PWREN", "polarity": true},
{"name": "BMC_SYS_PSON_L", "polarity": false}
],
"reset_outs": [
{"name": "BMC_S0_SYSRESET_L", "polarity": false},
{"name": "BMC_S1_SYSRESET_L", "polarity": false}
]
}
},
"gpio_definitions": [
{
"name": "PGOOD",
"pin": "F4",
"direction": "in"
},
{
"name": "BMC_SYS_PSON_L",
"pin": "F2",
"direction": "out"
},
{
"name": "OCP_MAIN_PWREN",
"pin": "R4",
"direction": "out"
},
{
"name": "BMC_S0_SYSRESET_L",
"pin": "L3",
"direction": "out"
},
{
"name": "BMC_S1_SYSRESET_L",
"pin": "L4",
"direction": "out"
},
{
"name": "POWER_BUTTON",
"pin": "B4",
"direction": "both"
},
{
"name": "RESET_BUTTON",
"pin": "R5",
"direction": "both"
},
{
"name": "ID_BTN",
"pin": "Q5",
"direction": "both"
}
]
}
@@ -0,0 +1 @@
FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"