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
@@ -0,0 +1,9 @@
[Unit]
Description=ASPEED LPC boot from PNOR
[Service]
Type=oneshot
ExecStart=/usr/sbin/pnorboot --size 32
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,17 @@
SUMMARY = "ASPEED LPC Host Interface Control tool"
DESCRIPTION = "Configures the BMC to expose memory regions to the host"
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
inherit obmc-phosphor-systemd
inherit autotools
S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} += "pnorboot.service"
SRC_URI = "git://github.com/shenki/aspeed-lpc-control;branch=master;protocol=https"
SRCREV = "af42b7ff01e71c0dd4c60214dd46ed487611f36d"
@@ -0,0 +1,31 @@
SUMMARY = "OpenPOWER Host checkstop monitor application"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit obmc-phosphor-systemd
inherit allarch
DEPENDS += "phosphor-gpio-monitor"
RDEPENDS:${PN} += "phosphor-gpio-monitor-monitor"
# For now, monitoring checkstop is the only usecase
OBMC_HOST_MONITOR_INSTANCES = "checkstop"
# Copies config file having arguments for monitoring host checkstop
# via GPIO assertion
SYSTEMD_ENVIRONMENT_FILE:${PN} +="obmc/gpio/checkstop"
# This package is not supplying the unit file and also this is not a native
# recipe since state-mgmt needs this package at runtime. Unsetting this below
# variable will let the build go through
SYSTEMD_SERVICE:${PN} ?=""
# Install the override to set up a Conflicts relation
SYSTEMD_OVERRIDE:${PN} +="checkstop.conf:phosphor-gpio-monitor@checkstop.service.d/checkstop.conf"
STATES = "startmin"
GPIO_MONITOR_TMPL = "phosphor-gpio-monitor@.service"
GPIO_MONITOR_TGTFMT = "phosphor-gpio-monitor@{1}.service"
CHECKSTOP_MONITOR_FMT = "../${GPIO_MONITOR_TMPL}:obmc-host-{0}@{2}.target.wants/${GPIO_MONITOR_TGTFMT}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'CHECKSTOP_MONITOR_FMT', 'STATES', 'OBMC_HOST_MONITOR_INSTANCES', 'OBMC_HOST_INSTANCES')}"
@@ -0,0 +1,3 @@
[Unit]
Conflicts=obmc-host-crash@0.target
Conflicts=obmc-host-stop@0.target
@@ -0,0 +1,4 @@
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=74
POLARITY=1
TARGET=obmc-host-crash@0.target
@@ -0,0 +1,21 @@
[Unit]
Description=Applies user CFAM register overrides from file
Wants=obmc-host-start-pre@%i.target
Before=obmc-host-start-pre@%i.target
Wants=obmc-power-on@%i.target
After=obmc-power-on@%i.target
Wants=fsi-scan@%i.service
After=fsi-scan@%i.service
Conflicts=obmc-chassis-poweroff@%i.target
Conflicts=obmc-host-stop@%i.target
ConditionPathExists=!/run/openbmc/chassis@%i-on
ConditionPathExists=/var/lib/obmc/cfam_overrides
[Service]
ExecStart=/usr/bin/openpower-proc-control CFAMOverride
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=obmc-chassis-poweron@%i.target
WantedBy=obmc-host-startmin@%i.target
@@ -0,0 +1,20 @@
[Unit]
Description=Start host%i SBE
Wants=obmc-host-start-pre@%i.target
After=obmc-host-start-pre@%i.target
Wants=obmc-host-starting@%i.target
Before=obmc-host-starting@%i.target
Before=obmc-host-started@%i.target
Wants=obmc-power-on@%i.target
After=obmc-power-on@%i.target
Conflicts=obmc-host-stop@%i.target
ConditionPathExists=!/run/openbmc/host@%i-on
ConditionPathExists=!/run/openbmc/mpreboot@%i
[Service]
ExecStart=/usr/bin/openpower-proc-control startHost
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=obmc-host-start@%i.target
@@ -0,0 +1,190 @@
SUMMARY = "OpenPOWER processor control services installation"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit allarch
RDEPENDS:${PN} += "op-proc-control"
RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets"
ALLOW_EMPTY:${PN} = "1"
pkg_postinst:${PN}() {
mkdir -p $D$systemd_system_unitdir/obmc-host-stop@0.target.wants
mkdir -p $D$systemd_system_unitdir/obmc-host-force-warm-reboot@0.target.requires
mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.requires
mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
mkdir -p $D$systemd_system_unitdir/obmc-host-diagnostic-mode@0.target.requires
mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires
mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
TARGET="../op-stop-instructions@.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/op-clear-sys-dump-active@0.service"
TARGET="../op-clear-sys-dump-active@.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/op-stop-instructions@0.service"
TARGET="../op-stop-instructions@.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
TARGET="../op-cfam-reset.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/xyz.openbmc_project.Control.Host.NMI.service"
TARGET="../xyz.openbmc_project.Control.Host.NMI.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
TARGET="../op-cfam-reset.service"
ln -s $TARGET $LINK
# Only install cfam override if p9 system
if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.requires
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
TARGET="../cfam_override@.service"
ln -s $TARGET $LINK
fi
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
TARGET="../op-continue-mpreboot@.service"
ln -s $TARGET $LINK
# Only install certain units if phal enabled
if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then
LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-clear-sys-dump-active@0.service"
TARGET="../op-clear-sys-dump-active@.service"
ln -s $TARGET $LINK
mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
LINK="$D$systemd_system_unitdir/multi-user.target.wants/op-clear-sys-dump-active@0.service"
TARGET="../op-clear-sys-dump-active@.service"
ln -s $TARGET $LINK
mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.requires
LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
TARGET="../phal-reinit-devtree.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
TARGET="../proc-pre-poweroff@.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/op-reset-host-check@0.service"
TARGET="../op-reset-host-check@.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service"
TARGET="../phal-import-devtree@.service"
ln -s $TARGET $LINK
mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service"
TARGET="../phal-export-devtree@.service"
ln -s $TARGET $LINK
mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service"
TARGET="../phal-create-boottime-guard-indicator.service"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service"
ln -s $TARGET $LINK
mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/op-clock-data-logger@0.service"
TARGET="../op-clock-data-logger@.service"
ln -s $TARGET $LINK
mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants/set-spi-mux.service"
TARGET="../set-spi-mux.service"
ln -s $TARGET $LINK
fi
# If the memory preserving reboot feature is enabled, set it up
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
# on mpreboot systems, obmc-host-crash@.target is used for mpreboot
mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
TARGET="../obmc-host-force-warm-reboot@.target"
ln -s $TARGET $LINK
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
TARGET="../op-enter-mpreboot@.service"
ln -s $TARGET $LINK
# ensure diagnostic mode is shown for MPREBOOT
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target"
TARGET="../obmc-host-diagnostic-mode@.target"
ln -s $TARGET $LINK
else
# If not a mpreboot system, default to quiesce target in crash target to support
# older system designs like witherspoon
mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
TARGET="../obmc-host-quiesce@.target"
ln -s $TARGET $LINK
fi
}
pkg_prerm:${PN}() {
LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/xyz.openbmc_project.Control.Host.NMI.service"
rm $LINK
# Only uninstall cfam override if p9 system
if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
rm $LINK
fi
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
rm $LINK
# Remove phal specific units if enabled
if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then
LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants/set-spi-mux.service"
rm $LINK
LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/op-clock-data-logger@0.service"
rm $LINK
fi
# Remove mpreboot specific units if enabled
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
rm $LINK
else
LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
rm $LINK
fi
}
@@ -0,0 +1,58 @@
SUMMARY = "OpenPower procedure control"
DESCRIPTION = "Provides procedures that run against the host chipset"
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
S = "${WORKDIR}/git"
inherit meson obmc-phosphor-utils pkgconfig
inherit systemd
SRC_URI = "git://github.com/openbmc/openpower-proc-control;branch=master;protocol=https"
SRCREV = "3f97eaa4b6f6a4c7cf97a0c80566eb6783d7e8af"
DEPENDS += " \
phosphor-logging \
phosphor-dbus-interfaces \
libgpiod \
"
RDEPENDS:${PN} += " op-proc-control-systemd-links"
EXTRA_OEMESON += "-Dtests=disabled"
# For libpdbg, provided by the pdbg package
DEPENDS += "pdbg"
PACKAGECONFIG ??= "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal op-fsi', d)}"
PACKAGECONFIG[phal] = "-Dphal=enabled, -Dphal=disabled -Dp9=enabled, ipl pdata"
PACKAGECONFIG[op-fsi] = "-Dopenfsi=enabled, -Dopenfsi=disabled"
# By default all openpower systems support op-fsi
PACKAGECONFIG = " op-fsi"
TEMPLATE = "pcie-poweroff@.service"
INSTANCE_FORMAT = "pcie-poweroff@{}.service"
INSTANCES = "${@compose_list(d, 'INSTANCE_FORMAT', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "${TEMPLATE} ${INSTANCES}"
SYSTEMD_SERVICE:${PN} += " \
op-cfam-reset.service \
op-continue-mpreboot@.service \
op-enter-mpreboot@.service \
op-stop-instructions@.service \
xyz.openbmc_project.Control.Host.NMI.service \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-reset-host-check@.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-reset-host-clear.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-export-devtree@.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-import-devtree@.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-reinit-devtree.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'proc-pre-poweroff@.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'set-spi-mux.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-create-boottime-guard-indicator.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-clear-sys-dump-active@.service', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-clock-data-logger@.service', '', d)} \
"
@@ -0,0 +1,20 @@
SUMMARY = "POWER9 CFAM override"
DESCRIPTION = "Applies user CFAM register overrides from file"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit obmc-phosphor-systemd
FILESEXTRAPATHS:prepend := "${THISDIR}/op-host-control:"
RDEPENDS:${PN} += "op-proc-control"
S = "${WORKDIR}"
TMPL = "cfam_override@.service"
INSTFMT = "cfam_override@{0}.service"
TGTFMT = "obmc-chassis-poweron@{0}.target"
FMT = "../${TMPL}:${TGTFMT}.requires/${INSTFMT}"
SYSTEMD_SERVICE:${PN} += "${TMPL}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"
@@ -0,0 +1,25 @@
SUMMARY = "POWER9 start host"
DESCRIPTION = "Service to start POWER9 IPL through SBE"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit obmc-phosphor-systemd
FILESEXTRAPATHS:prepend := "${THISDIR}/op-host-control:"
PROVIDES += 'virtual/obmc-host-ctl'
RPROVIDES:${PN} += 'virtual-obmc-host-ctl'
RDEPENDS:${PN} += "op-proc-control \
op-proc-control-systemd-links"
S = "${WORKDIR}"
TMPL = "start_host@.service"
INSTFMT = "start_host@{0}.service"
TGTFMT = "obmc-host-startmin@{0}.target"
FMT = "../${TMPL}:${TGTFMT}.requires/${INSTFMT}"
SYSTEMD_SERVICE:${PN} += "${TMPL}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"