summaryrefslogtreecommitdiff
path: root/meta-openpower/recipes-phosphor/host
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openpower/recipes-phosphor/host')
-rw-r--r--meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl.bb15
-rw-r--r--meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service9
-rw-r--r--meta-openpower/recipes-phosphor/host/checkstop-monitor.bb30
-rw-r--r--meta-openpower/recipes-phosphor/host/checkstop-monitor/checkstop.conf3
-rw-r--r--meta-openpower/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop4
-rw-r--r--meta-openpower/recipes-phosphor/host/hostboot-settings.bb19
-rw-r--r--meta-openpower/recipes-phosphor/host/hostboot-settings/hb_settings110
-rw-r--r--meta-openpower/recipes-phosphor/host/hostboot-settings/hostboot-settings.service9
-rw-r--r--meta-openpower/recipes-phosphor/host/op-host-control/cfam_override@.service20
-rw-r--r--meta-openpower/recipes-phosphor/host/op-host-control/start_host@.service19
-rw-r--r--meta-openpower/recipes-phosphor/host/op-host-control/vcs_workaround@.service19
-rw-r--r--meta-openpower/recipes-phosphor/host/op-proc-control.bb26
-rw-r--r--meta-openpower/recipes-phosphor/host/p9-cfam-override.bb19
-rw-r--r--meta-openpower/recipes-phosphor/host/p9-host-start.bb23
-rw-r--r--meta-openpower/recipes-phosphor/host/p9-vcs-workaround.bb19
15 files changed, 344 insertions, 0 deletions
diff --git a/meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl.bb b/meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl.bb
new file mode 100644
index 0000000000..f37f2bec62
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl.bb
@@ -0,0 +1,15 @@
+SUMMARY = "ASPEED LPC Host Interface Control tool"
+DESCRIPTION = "Configures the BMC to expose memory regions to the host"
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit obmc-phosphor-systemd
+
+inherit autotools
+
+S = "${WORKDIR}/git"
+
+SYSTEMD_SERVICE_${PN} += "pnorboot.service"
+
+SRC_URI += "git://github.com/shenki/aspeed-lpc-control"
+SRCREV = "ab2012e749daf567049bf157c3bf037adc62c0e8"
diff --git a/meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service b/meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service
new file mode 100644
index 0000000000..fffe13c486
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=ASPEED LPC boot from PNOR
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/pnorboot --size 32
+
+[Install]
+WantedBy=obmc-standby.target
diff --git a/meta-openpower/recipes-phosphor/host/checkstop-monitor.bb b/meta-openpower/recipes-phosphor/host/checkstop-monitor.bb
new file mode 100644
index 0000000000..4959a3b73f
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/checkstop-monitor.bb
@@ -0,0 +1,30 @@
+SUMMARY = "OpenPOWER Host checkstop monitor application"
+PR = "r1"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
+inherit allarch
+
+DEPENDS += "virtual/obmc-gpio-monitor"
+RDEPENDS_${PN} += "virtual/obmc-gpio-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')}"
diff --git a/meta-openpower/recipes-phosphor/host/checkstop-monitor/checkstop.conf b/meta-openpower/recipes-phosphor/host/checkstop-monitor/checkstop.conf
new file mode 100644
index 0000000000..f47711ff62
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/checkstop-monitor/checkstop.conf
@@ -0,0 +1,3 @@
+[Unit]
+Conflicts=obmc-host-crash@0.target
+Conflicts=obmc-host-stop@0.target
diff --git a/meta-openpower/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop b/meta-openpower/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop
new file mode 100644
index 0000000000..e856339b0b
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop
@@ -0,0 +1,4 @@
+DEVPATH=/dev/input/by-path/platform-gpio-keys-event
+KEY=74
+POLARITY=1
+TARGET=obmc-host-crash@0.target
diff --git a/meta-openpower/recipes-phosphor/host/hostboot-settings.bb b/meta-openpower/recipes-phosphor/host/hostboot-settings.bb
new file mode 100644
index 0000000000..39beb480cd
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/hostboot-settings.bb
@@ -0,0 +1,19 @@
+SUMMARY = "OpenPower Hostboot Boot settings tool"
+PR = "r1"
+
+inherit obmc-phosphor-license
+inherit obmc-phosphor-systemd
+inherit allarch
+
+SRC_URI = "file://hb_settings"
+SYSTEMD_SERVICE_${PN} += "hostboot-settings.service"
+
+do_fetch[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/hb_settings ${D}${bindir}
+}
diff --git a/meta-openpower/recipes-phosphor/host/hostboot-settings/hb_settings b/meta-openpower/recipes-phosphor/host/hostboot-settings/hb_settings
new file mode 100644
index 0000000000..d75d4b74d1
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/hostboot-settings/hb_settings
@@ -0,0 +1,110 @@
+#!/bin/sh
+# Copyright 2018 IBM Corp
+# SPDX-License-Identifier: Apache-2.0
+# Authored May 2018, Joel Stanley <joel@jms.id.au>
+#
+# This script sets the SIO scratch registers 0x2D in order to configure
+# hostboot. It supports boot flags v1 as defined in hostboot source:
+# src/usr/initservice/bootconfig/bootconfig_ast2400.C
+# src/usr/console/ast2400.C
+#
+# BOOT_FLAGS_VERSION_REG = 0x28,
+# Serial config reg: 0x2d
+# Serial config mask: 0xc0
+#
+# NONE = 0x00, // No output selected
+# SELECT_SUART = 0x40, // SIO Uart
+# SELECT_VUART = 0x80, // SOL virtual uart
+# RESERVED = 0xc0, // Reserved
+
+
+SYSFS_SIO=/sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e789080.lpc-host/1e789080.lpc-host:regs
+SYSFS_SIO28=$SYSFS_SIO/sio_28
+SYSFS_SIO2D=$SYSFS_SIO/sio_2d
+
+FLAGS_VERSION1=$((0x42))
+
+usage()
+{
+ echo "usage: hb_settings [[-u|--uart vuart|suart|none] | [-s|--show] | [-h]]"
+}
+
+show_regs()
+{
+ SIO28=$(cat $SYSFS_SIO28)
+ SIO2D=$(cat $SYSFS_SIO2D)
+
+ case $SIO28 in
+ $FLAGS_VERSION1)
+ echo "Boot flags version 1"
+ ;;
+ * )
+ echo "Unknown boot flags version"
+ ;;
+ esac
+
+ case $(($SIO2D >> 6)) in
+ 0)
+ echo "Hostboot serial output disabled"
+ ;;
+ 1)
+ echo "Hostboot serial output on SUART"
+ ;;
+ 2)
+ echo "Hostboot serial output on VUART"
+ ;;
+ 3)
+ echo "Reserved value"
+ ;;
+ * )
+ echo "Invalid uart value"
+ ;;
+ esac
+}
+
+set_regs()
+{
+ case $uart in
+ suart)
+ echo "Hostboot serial output on SUART"
+ VAL=0x40
+ ;;
+ vuart)
+ echo "Hostboot serial output on VUART"
+ VAL=0x80
+ ;;
+ none)
+ echo "Hostboot serial output disabled"
+ VAL=0x00
+ ;;
+ * )
+ echo "Invalid uart value"
+ usage
+ exit 1
+ esac
+
+ echo $FLAGS_VERSION1 > $SYSFS_SIO28
+ echo $VAL > $SYSFS_SIO2D
+}
+
+while [ "$1" != "" ]; do
+ case $1 in
+ -u | --uart) shift
+ uart=$1
+ set_regs
+ exit
+ ;;
+ -s | --show ) show_regs
+ exit
+ ;;
+ -h | --help ) usage
+ exit
+ ;;
+ * ) usage
+ exit 1
+ esac
+ shift
+done
+
+usage
+exit 0
diff --git a/meta-openpower/recipes-phosphor/host/hostboot-settings/hostboot-settings.service b/meta-openpower/recipes-phosphor/host/hostboot-settings/hostboot-settings.service
new file mode 100644
index 0000000000..60e3ee998e
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/hostboot-settings/hostboot-settings.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hostboot Boot Settings
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/hb_settings --uart vuart
+
+[Install]
+WantedBy=obmc-standby.target
diff --git a/meta-openpower/recipes-phosphor/host/op-host-control/cfam_override@.service b/meta-openpower/recipes-phosphor/host/op-host-control/cfam_override@.service
new file mode 100644
index 0000000000..e6bc9389c4
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/op-host-control/cfam_override@.service
@@ -0,0 +1,20 @@
+[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
+ConditionPathExists=!/run/openbmc/chassis@%i-on
+ConditionPathExists=/var/lib/obmc/cfam_overrides
+
+[Service]
+ExecStart=/usr/bin/env openpower-proc-control CFAMOverride
+SyslogIdentifier=openpower-proc-control
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-chassis-poweron@%i.target
diff --git a/meta-openpower/recipes-phosphor/host/op-host-control/start_host@.service b/meta-openpower/recipes-phosphor/host/op-host-control/start_host@.service
new file mode 100644
index 0000000000..77a88e864a
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/op-host-control/start_host@.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Start host%i SBE
+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
+
+[Service]
+ExecStart=/usr/bin/env openpower-proc-control startHost
+SyslogIdentifier=openpower-proc-control
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-host-start@%i.target
diff --git a/meta-openpower/recipes-phosphor/host/op-host-control/vcs_workaround@.service b/meta-openpower/recipes-phosphor/host/op-host-control/vcs_workaround@.service
new file mode 100644
index 0000000000..bd9db809bf
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/op-host-control/vcs_workaround@.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Run VCS workaround on host%i
+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
+ConditionPathExists=!/run/openbmc/chassis@%i-on
+
+[Service]
+ExecStart=/usr/bin/env openpower-proc-control vcsWorkaround
+SyslogIdentifier=openpower-proc-control
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-chassis-poweron@%i.target
diff --git a/meta-openpower/recipes-phosphor/host/op-proc-control.bb b/meta-openpower/recipes-phosphor/host/op-proc-control.bb
new file mode 100644
index 0000000000..a9c030bdc2
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/op-proc-control.bb
@@ -0,0 +1,26 @@
+SUMMARY = "OpenPower procedure control"
+DESCRIPTION = "Provides procedures that run against the host chipset"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig pythonnative
+
+SRC_URI += "git://github.com/openbmc/openpower-proc-control"
+SRCREV = "6d83ddf7691fed618b8d9e871f608b8754e2134e"
+
+DEPENDS += " \
+ autoconf-archive-native \
+ phosphor-logging \
+ phosphor-dbus-interfaces \
+ openpower-dbus-interfaces \
+ "
+
+RDEPENDS_${PN} += " \
+ phosphor-logging \
+ phosphor-dbus-interfaces \
+ openpower-dbus-interfaces \
+ "
diff --git a/meta-openpower/recipes-phosphor/host/p9-cfam-override.bb b/meta-openpower/recipes-phosphor/host/p9-cfam-override.bb
new file mode 100644
index 0000000000..4f6a9c6532
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/p9-cfam-override.bb
@@ -0,0 +1,19 @@
+SUMMARY = "POWER9 CFAM override"
+DESCRIPTION = "Applies user CFAM register overrides from file"
+PR = "r1"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
+
+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')}"
diff --git a/meta-openpower/recipes-phosphor/host/p9-host-start.bb b/meta-openpower/recipes-phosphor/host/p9-host-start.bb
new file mode 100644
index 0000000000..24b1b9c1fa
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/p9-host-start.bb
@@ -0,0 +1,23 @@
+SUMMARY = "POWER9 start host"
+DESCRIPTION = "Service to start POWER9 IPL through SBE"
+PR = "r1"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/op-host-control:"
+
+PROVIDES += 'virtual/obmc-host-ctl'
+RPROVIDES_${PN} += 'virtual-obmc-host-ctl'
+
+RDEPENDS_${PN} += "p9-vcs-workaround op-proc-control"
+
+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')}"
diff --git a/meta-openpower/recipes-phosphor/host/p9-vcs-workaround.bb b/meta-openpower/recipes-phosphor/host/p9-vcs-workaround.bb
new file mode 100644
index 0000000000..11ad79cb10
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/host/p9-vcs-workaround.bb
@@ -0,0 +1,19 @@
+SUMMARY = "POWER9 VCS workaround"
+DESCRIPTION = "Apply fixes over FSI to POWER9 CPUs prior to host power on"
+PR = "r1"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/op-host-control:"
+RDEPENDS_${PN} += "virtual-p9-vcs-workaround op-proc-control"
+
+S = "${WORKDIR}"
+
+TMPL = "vcs_workaround@.service"
+INSTFMT = "vcs_workaround@{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')}"