Initial commit
This commit is contained in:
@@ -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 += "rl300-g11-layer"
|
||||
BBFILE_PATTERN_rl300-g11-layer := "^${LAYERDIR}/"
|
||||
LAYERSERIES_COMPAT_rl300-g11-layer := "mickledore"
|
||||
@@ -0,0 +1,9 @@
|
||||
KERNEL_DEVICETREE = "gxp.dtb"
|
||||
|
||||
UBOOT_MACHINE = "gxp2_defconfig"
|
||||
|
||||
require conf/machine/include/gxp.inc
|
||||
require conf/machine/include/obmc-bsp-common.inc
|
||||
require conf/machine/include/hpe.inc
|
||||
|
||||
PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-ssif"
|
||||
@@ -0,0 +1,20 @@
|
||||
# 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-perl \
|
||||
##OEROOT##/meta-openembedded/meta-python \
|
||||
##OEROOT##/meta-openembedded/meta-webserver \
|
||||
##OEROOT##/meta-phosphor \
|
||||
##OEROOT##/meta-hpe \
|
||||
##OEROOT##/meta-hpe/meta-common \
|
||||
##OEROOT##/meta-hpe/meta-gxp \
|
||||
##OEROOT##/meta-hpe/meta-rl300-g11 \
|
||||
"
|
||||
@@ -0,0 +1,282 @@
|
||||
#
|
||||
# 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. More adventurous users can look at
|
||||
# local.conf.sample.extended which contains other examples of configuration which
|
||||
# can be placed in this file but new users likely won't need any of them
|
||||
# initially. There's also site.conf.sample which contains examples of site specific
|
||||
# information such as proxy server addresses.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# You need to select a specific machine to target the build with. There are a selection
|
||||
# of emulated machines available which can boot and run in the QEMU emulator:
|
||||
#
|
||||
#MACHINE ?= "qemuarm"
|
||||
#MACHINE ?= "qemuarm64"
|
||||
#MACHINE ?= "qemumips"
|
||||
#MACHINE ?= "qemumips64"
|
||||
#MACHINE ?= "qemuppc"
|
||||
#MACHINE ?= "qemux86"
|
||||
#MACHINE ?= "qemux86-64"
|
||||
#
|
||||
# There are also the following hardware board target machines included for
|
||||
# demonstration purposes:
|
||||
#
|
||||
#MACHINE ?= "beaglebone-yocto"
|
||||
#MACHINE ?= "genericx86"
|
||||
#MACHINE ?= "genericx86-64"
|
||||
#MACHINE ?= "edgerouter"
|
||||
#
|
||||
# This sets the default machine to be qemux86-64 if no other machine is selected:
|
||||
MACHINE ??= "rl300-g11"
|
||||
|
||||
# These are some of the more commonly used values. Looking at the files in the
|
||||
# meta/conf/machine directory, or the conf/machine directory of any additional layers
|
||||
# you add in will show all the available machines.
|
||||
|
||||
#
|
||||
# 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"
|
||||
# OE-Core defaults to ipkg, whilst Poky defaults to rpm:
|
||||
# PACKAGE_CLASSES ?= "package_rpm"
|
||||
|
||||
#
|
||||
# SDK target architecture
|
||||
#
|
||||
# This variable specifies the architecture to build SDK 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, x86_64, aarch64
|
||||
#SDKMACHINE ?= "i686"
|
||||
|
||||
#
|
||||
# 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)
|
||||
# "src-pkgs" - add -src packages for all installed packages
|
||||
# (adds source code for debugging)
|
||||
# "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, 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-recipe/image.bbclass and
|
||||
# meta/classes-recipe/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
|
||||
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. It can also
|
||||
# run tests against any SDK that are built. To enable this uncomment these lines.
|
||||
# See meta/classes-recipe/test{image,sdk}.bbclass for further details.
|
||||
#IMAGE_CLASSES += "testimage testsdk"
|
||||
#TESTIMAGE_AUTO:qemuall = "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 than 100MB or 1K inodes, perform a hard halt
|
||||
# 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 be
|
||||
# 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 https 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://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \
|
||||
#file://.* file:///some/local/dir/sstate/PATH"
|
||||
|
||||
#
|
||||
# Yocto Project SState Mirror
|
||||
#
|
||||
# The Yocto Project has prebuilt artefacts available for its releases, you can enable
|
||||
# use of these by uncommenting the following lines. This will mean the build uses
|
||||
# the network to check for artefacts at the start of builds, which does slow it down
|
||||
# equally, it will also speed up the builds by not having to build things if they are
|
||||
# present in the cache. It assumes you can download something faster than you can build it
|
||||
# which will depend on your network.
|
||||
# Note: For this to work you also need hash-equivalence passthrough to the matching server
|
||||
#
|
||||
#BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"
|
||||
#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
|
||||
|
||||
#
|
||||
# Qemu configuration
|
||||
#
|
||||
# By default native qemu will build with a builtin VNC server where graphical output can be
|
||||
# seen. The line below enables the SDL UI frontend too.
|
||||
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
|
||||
# By default libsdl2-native will be built, if you want to use your host's libSDL instead of
|
||||
# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
|
||||
#ASSUME_PROVIDED += "libsdl2-native"
|
||||
|
||||
# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
|
||||
# a handy set of menus for controlling the emulator.
|
||||
#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
|
||||
|
||||
#
|
||||
# Hash Equivalence
|
||||
#
|
||||
# Enable support for automatically running a local hash equivalence server and
|
||||
# instruct bitbake to use a hash equivalence aware signature generator. Hash
|
||||
# equivalence improves reuse of sstate by detecting when a given sstate
|
||||
# artifact can be reused as equivalent, even if the current task hash doesn't
|
||||
# match the one that generated the artifact.
|
||||
#
|
||||
# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format
|
||||
#
|
||||
#BB_HASHSERVE = "auto"
|
||||
#BB_SIGNATURE_HANDLER = "OEEquivHash"
|
||||
|
||||
#
|
||||
# Memory Resident Bitbake
|
||||
#
|
||||
# Bitbake's server component can stay in memory after the UI for the current command
|
||||
# has completed. This means subsequent commands can run faster since there is no need
|
||||
# for bitbake to reload cache files and so on. Number is in seconds, after which the
|
||||
# server will shut down.
|
||||
#
|
||||
#BB_SERVER_TIMEOUT = "60"
|
||||
|
||||
# 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 @@
|
||||
inherit gxp2-bootblock-n
|
||||
@@ -0,0 +1 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
devmem 0xd1000008 8 128
|
||||
devmem 0xd1000009 8 36
|
||||
devmem 0xd1000041 8 255
|
||||
devmem 0xd100004b 8 8
|
||||
# Configure UART
|
||||
# 4d is allocating UEFI SOC ROM to GXP
|
||||
# 5d is allocating UEFI VAR ROM access to GXP
|
||||
# devmem 0xd1000119 8 0x4d
|
||||
devmem 0xc00000af 8 9
|
||||
# enable UART on rl300
|
||||
systemctl start obmc-console@ttyS1.service
|
||||
devmem 0xd100011a 8 0x00
|
||||
# setup PCIe ID
|
||||
devmem 0x802f002e 16 0x03d8
|
||||
|
||||
# Check the current power status
|
||||
|
||||
currentstate=$(busctl get-property xyz.openbmc_project.State.Chassis0 /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis CurrentPowerState | awk '{ print $2 }')
|
||||
|
||||
if [ "$currentstate" = "\"xyz.openbmc_project.State.Chassis.PowerState.On\"" ]
|
||||
then
|
||||
systemctl stop phosphor-virtual-sensor.service
|
||||
modprobe smpro-misc
|
||||
modprobe smpro-errmon
|
||||
modprobe smpro-hwmon
|
||||
modprobe smpro-mfd
|
||||
systemctl restart xyz.openbmc_project.ampere_host_error_monitor.service
|
||||
systemctl restart xyz.openbmc_project.amperecpusensor.service
|
||||
systemctl restart xyz.openbmc_project.EntityManager.service
|
||||
systemctl restart phosphor-pid-control.service
|
||||
systemctl start phosphor-virtual-sensor.service
|
||||
else
|
||||
# We can start the ROM Version check services
|
||||
rmmod gxp_spifi_ctrl1
|
||||
devmem 0xd1000119 8 0x4d
|
||||
modprobe gxp_spifi_ctrl1
|
||||
systemctl start com.hpe.hpe-uefi-version.service
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
@@ -0,0 +1 @@
|
||||
RDEPENDS:${PN}-system += "ampere-platform-mgmt"
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
# File which is managing GPIOS when detected. First parameter is which GPIOs that switched
|
||||
if [ "$1" = "up" ]
|
||||
then
|
||||
systemctl stop xyz.openbmc_project.ampere_host_error_monitor.service
|
||||
rmmod smpro_hwmon smpro_errmon smpro_misc smpro_mfd
|
||||
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PGood b true
|
||||
smproStatus=$(lsmod | grep smpro-mfd)
|
||||
if [ "$smproStatus" = "" ]
|
||||
then
|
||||
# sleep 15
|
||||
# We need to wait for the SoC to be ready to communicate - We just received the PGOOD signal
|
||||
# The status is reported through an interrupt that we can poll at 2e within the CPLD address space (0xd100_00e2)
|
||||
max_retry=5
|
||||
sleep_time=5
|
||||
success=0
|
||||
while [ "$max_retry" != "0" ]
|
||||
do
|
||||
waitForSoC=$(devmem 0xd10000e2 8)
|
||||
isAvailable=$(( waitForSoC & 0x2 ))
|
||||
if [ "r$isAvailable" = "r2" ]
|
||||
then
|
||||
max_retry=0
|
||||
success=1
|
||||
else
|
||||
max_retry=$(( max_retry - 1))
|
||||
sleep $sleep_time
|
||||
fi
|
||||
done
|
||||
if [ "$success" = "1" ]
|
||||
then
|
||||
# Activate local UBM (front NVME drive)
|
||||
devmem 0xd1000087 8 5
|
||||
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
|
||||
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
|
||||
|
||||
devmem 0xd1000087 8 7
|
||||
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
|
||||
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
|
||||
|
||||
devmem 0xd1000087 8 9
|
||||
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
|
||||
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
|
||||
|
||||
devmem 0xd1000087 8 0xb
|
||||
i2ctransfer -y 3 w4@0x40 0x34 0xbf 0x00 0xe8
|
||||
i2ctransfer -y 3 w2@0x40 0x34 0xa7 r1
|
||||
|
||||
devmem 0xd1000088 8 5
|
||||
i2ctransfer -y 4 w4@0x40 0x34 0xbf 0x00 0xe8
|
||||
i2ctransfer -y 4 w2@0x40 0x34 0xa7 r1
|
||||
|
||||
modprobe smpro-misc
|
||||
modprobe smpro-errmon
|
||||
modprobe smpro-hwmon
|
||||
modprobe smpro-mfd
|
||||
systemctl restart xyz.openbmc_project.ampere_host_error_monitor.service
|
||||
systemctl restart xyz.openbmc_project.amperecpusensor.service
|
||||
systemctl restart xyz.openbmc_project.EntityManager.service
|
||||
systemctl restart phosphor-pid-control.service
|
||||
fi
|
||||
# We shall add a condition here to make an emergency stop
|
||||
fi
|
||||
else
|
||||
if [ "$1" = "down" ]
|
||||
then
|
||||
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PGood b false
|
||||
# We can re-init the system
|
||||
devmem 0xd1000009 8 0x24
|
||||
# We need to check the reason why we have been shutdown
|
||||
shutdownReason=$(devmem 0x80000074 16)
|
||||
# If bit 10 is set Software initiated a shutdown we need to restart
|
||||
isSet2=$( ${shutdownReason} | 0xFBFF )
|
||||
if [ "$isSet2" = "65535" ]
|
||||
then
|
||||
echo "Restarting" >> /tmp/gpios
|
||||
obmcutil poweron
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "$1" >> /tmp/gpios.txt
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PowerOK
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/gpios-manager down
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PowerOK
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/gpios-manager up
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
dbus-monitor --system --profile "type='method_call',path='/xyz/openbmc_project/state/host0',interface='org.freedesktop.DBus.Properties',member='Set'" | awk '/xyz.openbmc_project.State.Host/ { print "DONE" }' | while read -r ; do
|
||||
/usr/bin/rl300Start.sh
|
||||
done
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=RL300 IPMI power sequencing request
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ExecStart=/usr/bin/ipmi-power-button-monitoring.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# File which is managing GPIOS when detected. First parameter is which GPIOs that switched
|
||||
if [ "$1" = "pressed" ]
|
||||
then
|
||||
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PButton b true
|
||||
else
|
||||
if [ "$1" = "released" ]
|
||||
then
|
||||
busctl set-property xyz.openbmc_project.Chassis.Gpios /xyz/openbmc_project/chassis/gpios xyz.openbmc_project.Chassis.Gpios PButton b false
|
||||
fi
|
||||
fi
|
||||
echo "$1" >> /tmp/buttons.txt
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=RL300 power sequencing manager
|
||||
#After=dbus.service
|
||||
After=xyz.openbmc_project.Chassis.Control.Power@0.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ExecStart=/usr/bin/startMonitoring.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 Power Button
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/power-button pressed
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 Power Button Release
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/power-button released
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# A power up request has been made we must setup the system properly
|
||||
# RL300 requires UEFI VAR ROM export through spi controller 1
|
||||
# the machine needs to get out of Hold too
|
||||
|
||||
rmmod gxp_spifi_ctrl1
|
||||
# vejmarie was 58
|
||||
devmem 0xd1000119 32 0x5d
|
||||
modprobe gxp_spifi_ctrl1
|
||||
|
||||
# clear previous reset reason
|
||||
devmem 0x80000074 16 0x0
|
||||
# Release the Soc
|
||||
currentVal=$(devmem 0xD100011A 8)
|
||||
currentVal=$(( currentVal | 1 << 3 ))
|
||||
devmem 0xD100011A 8 "0x""${currentVal}"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
# We just started we have to update the Gpios status
|
||||
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/test.json
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"Name": "PowerGoodUp",
|
||||
"LineName": "PS_PWROK",
|
||||
"EventMon": "BOTH",
|
||||
"TargetRising": "gpiosup.service",
|
||||
"TargetFalling": "gpiosdown.service",
|
||||
"Continue": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,31 @@
|
||||
inherit obmc-phosphor-systemd
|
||||
SUMMARY = "Power Sequencing for HPE RL300 Gen11"
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
SYSTEMD_SERVICE:${PN} = "monitor-ipmi-power-transition.service power-sequencing.service gpiosdown.service gpiosup.service powerbuttonpressed.service powerbuttonreleased.service"
|
||||
SRC_URI:append = " file://monitor-ipmi-power-transition.service file://ipmi-power-button-monitoring.sh file://rl300Start.sh file://power-sequencing.service file://gpiosdown.service file://gpiosup.service file://gpios-manager.sh file://test.json file://powerbuttonreleased.service file://powerbuttonpressed.service file://power-button.sh file://startMonitoring.sh"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
IMAGE_INSTALL += "power-sequencing "
|
||||
|
||||
FILES:${PN} = "/usr/share/gpios/* /usr/bin/* /etc/system/*"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}/system/
|
||||
install -d ${D}/usr/share/gpios
|
||||
install -d ${D}/usr/bin
|
||||
install -m 0644 ${WORKDIR}/test.json ${D}/usr/share/gpios/test.json
|
||||
install -m 0644 ${WORKDIR}/power-sequencing.service ${D}${sysconfdir}/system/power-sequencing.service
|
||||
install -m 0644 ${WORKDIR}/gpiosup.service ${D}${sysconfdir}/system/gpiosup.service
|
||||
install -m 0644 ${WORKDIR}/gpiosdown.service ${D}${sysconfdir}/system/gpiosdown.service
|
||||
install -m 0644 ${WORKDIR}/powerbuttonpressed.service ${D}${sysconfdir}/system/powerbuttonpressed.service
|
||||
install -m 0644 ${WORKDIR}/powerbuttonreleased.service ${D}${sysconfdir}/system/powerbuttonreleased.service
|
||||
install -m 0644 ${WORKDIR}/monitor-ipmi-power-transition.service ${D}${sysconfdir}/system/monitor-ipmi-power-transition.service
|
||||
install -m 0755 ${WORKDIR}/gpios-manager.sh ${D}/usr/bin/gpios-manager.sh
|
||||
install -m 0755 ${WORKDIR}/startMonitoring.sh ${D}/usr/bin/startMonitoring.sh
|
||||
install -m 0755 ${WORKDIR}/rl300Start.sh ${D}/usr/bin/rl300Start.sh
|
||||
install -m 0755 ${WORKDIR}/ipmi-power-button-monitoring.sh ${D}/usr/bin/ipmi-power-button-monitoring.sh
|
||||
install -m 0755 ${WORKDIR}/power-button.sh ${D}/usr/bin/power-button.sh
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=RL300 power supply 1 monitoring
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ExecStart=startMonitoring1.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"Name": "PowerGoodUp",
|
||||
"LineName": "PSU1_INST",
|
||||
"EventMon": "BOTH",
|
||||
"TargetRising": "psu1up.service",
|
||||
"TargetFalling": "psu1down.service",
|
||||
"Continue": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU1 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 1 down
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU1 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 1 up
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=RL300 power supply 2 monitoring
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
ExecStart=startMonitoring2.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"Name": "psu2",
|
||||
"LineName": "PSU2_INST",
|
||||
"EventMon": "BOTH",
|
||||
"TargetRising": "psu2up.service",
|
||||
"TargetFalling": "psu2down.service",
|
||||
"Continue": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU2 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 2 down
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HPE RL300 PSU2 Manager
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/psus-manager.sh 2 up
|
||||
|
||||
[Install]
|
||||
# WantedBy=multi-user.target
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# we need to restart FRU service and PSU Monitor everything else shall be ok
|
||||
systemctl stop xyz.openbmc_project.psusensor.service
|
||||
systemctl stop xyz.openbmc_project.GxpFruDevice.service
|
||||
|
||||
systemctl start xyz.openbmc_project.GxpFruDevice.service
|
||||
systemctl start xyz.openbmc_project.psusensor.service
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
myaddress=$(gpiofind PSU1_INST)
|
||||
state=$(gpioget "$myaddress")
|
||||
if [ "r$state" = "r1" ]
|
||||
then
|
||||
psus-manager 1 up
|
||||
else
|
||||
psus-manager 1 down
|
||||
fi
|
||||
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/psu1.json
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
myaddress=$(gpiofind PSU2_INST)
|
||||
state=$(gpioget "$myaddress")
|
||||
if [ "r$state" = "r1" ]
|
||||
then
|
||||
psus-manager 2 up
|
||||
else
|
||||
psus-manager 2 down
|
||||
fi
|
||||
/usr/bin/phosphor-multi-gpio-monitor --config /usr/share/gpios/psu2.json
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
inherit obmc-phosphor-systemd
|
||||
SUMMARY = "Power Supplies monitoring for HPE RL300 Gen11"
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
SYSTEMD_SERVICE:${PN} = "psu2-monitoring.service psu1-monitoring.service psu2up.service psu2down.service psu1down.service psu1up.service"
|
||||
SRC_URI:append = " file://psu2-monitoring.service file://psu1-monitoring.service file://psus-manager.sh file://psu2up.service file://psu2down.service file://psu1down.service file://psu1up.service file://psu2.json file://psu1.json file://startMonitoring1.sh file://startMonitoring2.sh"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
IMAGE_INSTALL += "power-supplies-monitoring "
|
||||
|
||||
FILES:${PN} = "/usr/share/gpios/* /usr/bin/* /etc/system/*"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}/system/
|
||||
install -d ${D}/usr/share/gpios
|
||||
install -d ${D}/usr/bin
|
||||
install -m 0644 ${WORKDIR}/psu1.json ${D}/usr/share/gpios/psu1.json
|
||||
install -m 0644 ${WORKDIR}/psu2.json ${D}/usr/share/gpios/psu2.json
|
||||
install -m 0644 ${WORKDIR}/psu2-monitoring.service ${D}${sysconfdir}/system/psu2-monitoring.service
|
||||
install -m 0644 ${WORKDIR}/psu1-monitoring.service ${D}${sysconfdir}/system/psu1-monitoring.service
|
||||
install -m 0644 ${WORKDIR}/psu2up.service ${D}${sysconfdir}/system/psu2up.service
|
||||
install -m 0644 ${WORKDIR}/psu1up.service ${D}${sysconfdir}/system/psu1up.service
|
||||
install -m 0644 ${WORKDIR}/psu1down.service ${D}${sysconfdir}/system/psu1down.service
|
||||
install -m 0644 ${WORKDIR}/psu1down.service ${D}${sysconfdir}/system/psu1down.service
|
||||
install -m 0755 ${WORKDIR}/psus-manager.sh ${D}/usr/bin/psus-manager.sh
|
||||
install -m 0755 ${WORKDIR}/startMonitoring1.sh ${D}/usr/bin/startMonitoring1.sh
|
||||
install -m 0755 ${WORKDIR}/startMonitoring2.sh ${D}/usr/bin/startMonitoring2.sh
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"gpio_configs":[
|
||||
{
|
||||
"Name" : "IdButton",
|
||||
"LineName" : "ID_BUTTON",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveLow"
|
||||
},
|
||||
{
|
||||
"Name" : "NMIButton",
|
||||
"LineName" : "NMI_BUTTON",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveLow"
|
||||
},
|
||||
{
|
||||
"Name" : "NMIOut",
|
||||
"LineName" : "NMI_OUT",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveHigh"
|
||||
},
|
||||
{
|
||||
"Name" : "PostComplete",
|
||||
"LineName" : "POST_COMPLETE",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveLow"
|
||||
},
|
||||
{
|
||||
"Name" : "PowerButton",
|
||||
"DbusName" : "xyz.openbmc_project.Chassis.Gpios",
|
||||
"Path" : "/xyz/openbmc_project/chassis/gpios",
|
||||
"Interface" : "xyz.openbmc_project.Chassis.Gpios",
|
||||
"Property" : "PButton",
|
||||
"Type" : "DBUS"
|
||||
},
|
||||
{
|
||||
"Name" : "PowerOk",
|
||||
"DbusName" : "xyz.openbmc_project.Chassis.Gpios",
|
||||
"Path" : "/xyz/openbmc_project/chassis/gpios",
|
||||
"Interface" : "xyz.openbmc_project.Chassis.Gpios",
|
||||
"Property" : "PGood",
|
||||
"Type" : "DBUS"
|
||||
},
|
||||
{
|
||||
"Name" : "PowerOut",
|
||||
"LineName" : "POWER_OUT",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveHigh"
|
||||
},
|
||||
{
|
||||
"Name" : "ResetButton",
|
||||
"LineName" : "RESET_BUTTON",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveLow"
|
||||
},
|
||||
{
|
||||
"Name" : "ResetOut",
|
||||
"LineName" : "RESET_OUT",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveHigh"
|
||||
},
|
||||
{
|
||||
"Name" : "SioOnControl",
|
||||
"LineName" : "",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveLow"
|
||||
},
|
||||
{
|
||||
"Name" : "SioPowerGood",
|
||||
"LineName" : "",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveHigh"
|
||||
},
|
||||
{
|
||||
"Name" : "SIOS5",
|
||||
"LineName" : "",
|
||||
"Type" : "GPIO",
|
||||
"Polarity" : "ActiveLow"
|
||||
}
|
||||
],
|
||||
"timing_configs":{
|
||||
"PowerPulseMs": 200,
|
||||
"ForceOffPulseMs": 15000,
|
||||
"ResetPulseMs": 500,
|
||||
"PowerCycleMs": 5000,
|
||||
"SioPowerGoodWatchdogMs": 1000,
|
||||
"PsPowerOKWatchdogMs": 8000,
|
||||
"GracefulPowerOffS": 300,
|
||||
"WarmResetCheckMs": 500,
|
||||
"PowerOffSaveMs": 7000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI += "file://power-config-host0.json"
|
||||
|
||||
do_configure:prepend() {
|
||||
cp ${WORKDIR}/power-config-host0.json ${S}/power-control-x86/config
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user