Use openpower-proc-control in bitbake
The executable built from this repository will now be
used in start_host@.service and vcs_workaround@.service
instead of the shell scripts that use pdbg to do FSI commands.
Change-Id: I8ef3075449b562d64295ae330bd2c150264a0607
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host@.service b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-host-control/start_host@.service
similarity index 80%
rename from meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host@.service
rename to meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-host-control/start_host@.service
index 13f7c3b..20a2938 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host@.service
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-host-control/start_host@.service
@@ -1,5 +1,5 @@
[Unit]
-Description=Start host%i SBE (pdbg)
+Description=Start host%i SBE
After=obmc-host-start-pre@%i.target
Wants=obmc-host-start@%i.target
Before=obmc-host-start@%i.target
@@ -9,7 +9,7 @@
Conflicts=obmc-chassis-stop@%i.target
[Service]
-ExecStart={bindir}/start_host.sh {MACHINE}
+ExecStart={sbindir}/openpower-proc-control startHost
Type=oneshot
RemainAfterExit=yes
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service
similarity index 87%
rename from meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service
rename to meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service
index c9cd09a..8d3e26c 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround@.service
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service
@@ -10,7 +10,7 @@
ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
-ExecStart={bindir}/vcs_workaround.sh {MACHINE}
+ExecStart={sbindir}/openpower-proc-control vcsWorkaround
Type=oneshot
RemainAfterExit=yes
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh
deleted file mode 100755
index 43b433f..0000000
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh -e
-# Starts POWER9 IPL (boot)
-
-PDBG=${PDBG:-pdbg}
-
-putcfam()
-{
- $PDBG $1 putcfam $2 $3 $4
-}
-
-#Clock mux select override
-#Can maybe be removed in DD2
-putcfam -a 0x2918 0x0000000C 0x0000000C
-
-#Allow xstop/ATTN to flow to BMC
-putcfam -p0 0x081C 0x20000000 # Setup FSI2PIB to report
-putcfam -p0 0x100D 0x60000000 # Enable Xstop/ATTN interrupt
-putcfam -p0 0x100B 0xFFFFFFFF # Arm mechanism
-
-putcfam -p0 0x283f 0x20000000 # Write scratch register 8
-putcfam -p0 0x2801 0x80000000 0x80000000 # Set SBE start bit to start IPL
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh
deleted file mode 100755
index 9ebf601..0000000
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh -e
-# Apply fixes over FSI to POWER9 hosts. Required before VCS rail on.
-
-PDBG=${PDBG:-pdbg}
-
-putcfam()
-{
- $PDBG $1 putcfam $2 $3 $4
-}
-
-# P9 dd1 required workaround needed before powering VCS rails
-p9_dd1_vcs_workaround()
-{
- putcfam -a 0x2810 0x00000000 0x00010000 && # Unfence PLL controls
- putcfam -a 0x281A 0x40000000 0x40000000 && # Assert Perv chiplet endpoint reset, just in case
- putcfam -a 0x281A 0x00000001 0x00000001 # Enable Nest PLL
-}
-
-# Put the CFAM/FSI slave into async mode
-putcfam -p0 0x900 1
-
-#Set hMFSI error recovery
-putcfam -p0 0x34b8 0x0000c000
-
-#Set hMFSI timings
-putcfam -p0 0x3400 0xd0040110
-putcfam -p0 0x3401 0xffff0000
-
-#Enable hMFST ports
-putcfam -p0 0x3404 0xf0000000
-
-p9_dd1_vcs_workaround
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-proc-control.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-proc-control.bb
new file mode 100644
index 0000000..0999c82
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-proc-control.bb
@@ -0,0 +1,16 @@
+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
+
+DEPENDS += "autoconf-archive-native phosphor-logging"
+RDEPENDS_${PN} += "phosphor-logging"
+
+SRC_URI += "git://github.com/openbmc/openpower-proc-control"
+SRCREV = "0c0eeff6e991077f6a4570880b01396ac1b9e2e5"
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-host-start.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-host-start.bb
index 16d24c7..0caa074 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-host-start.bb
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-host-start.bb
@@ -5,22 +5,14 @@
inherit obmc-phosphor-systemd
inherit obmc-phosphor-license
-FILESEXTRAPATHS_prepend := "${THISDIR}/op-pdbg-host-control:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/op-host-control:"
PROVIDES += 'virtual/obmc-host-ctl'
RPROVIDES_${PN} += 'virtual-obmc-host-ctl'
-RDEPENDS_${PN} += "pdbg \
- p9-vcs-workaround"
+RDEPENDS_${PN} += "p9-vcs-workaround op-proc-control"
S = "${WORKDIR}"
-SRC_URI += "file://start_host.sh"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${WORKDIR}/start_host.sh \
- ${D}${bindir}/start_host.sh
-}
TMPL = "start_host@.service"
INSTFMT = "start_host@{0}.service"
@@ -29,4 +21,3 @@
SYSTEMD_SERVICE_${PN} += "${TMPL}"
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"
-SYSTEMD_SUBSTITUTIONS += "MACHINE:${MACHINE}:${TMPL}"
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-vcs-workaround.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-vcs-workaround.bb
index b03e26c..53b84a6 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-vcs-workaround.bb
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/p9-vcs-workaround.bb
@@ -5,19 +5,10 @@
inherit obmc-phosphor-systemd
inherit obmc-phosphor-license
-FILESEXTRAPATHS_prepend := "${THISDIR}/op-pdbg-host-control:"
-
-RDEPENDS_${PN} += "pdbg \
- virtual-p9-vcs-workaround"
+FILESEXTRAPATHS_prepend := "${THISDIR}/op-host-control:"
+RDEPENDS_${PN} += "virtual-p9-vcs-workaround op-proc-control"
S = "${WORKDIR}"
-SRC_URI += "file://vcs_workaround.sh"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${WORKDIR}/vcs_workaround.sh \
- ${D}${bindir}/vcs_workaround.sh
-}
TMPL = "vcs_workaround@.service"
INSTFMT = "vcs_workaround@{0}.service"
@@ -26,4 +17,3 @@
SYSTEMD_SERVICE_${PN} += "${TMPL}"
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"
-SYSTEMD_SUBSTITUTIONS += "MACHINE:${MACHINE}:${TMPL}"