From 194ff4f1f5d44b12e9cb06ddafa6adb20174a13c Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Wed, 22 Aug 2018 21:40:54 -0400 Subject: [Subtree] Bring openbmc machines to top level The new subtree model brings the subtrees up from the openbmc-machines layer. Change-Id: I58a03ae1be374bc79ae1438e65e888375d12d0c0 Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- meta-openpower/common/recipes-bsp/ffs/ffs.inc | 17 + meta-openpower/common/recipes-bsp/ffs/ffs_git.bb | 8 + meta-openpower/common/recipes-bsp/fsidbg/fsidbg.bb | 18 + .../pdbg/0001-CFAM-reg-0x2918-access-hack.patch | 34 ++ meta-openpower/common/recipes-bsp/pdbg/pdbg_1.0.bb | 13 + meta-openpower/common/recipes-bsp/skiboot/gard.bb | 5 + .../common/recipes-bsp/skiboot/pflash.bb | 8 + .../common/recipes-bsp/skiboot/skiboot.inc | 27 ++ ...enpower-dbus-interfaces-mapper-config-native.bb | 11 + .../dbus/openpower-dbus-interfaces.bb | 32 ++ .../dbus/phosphor-mapper-config-native%.bbappend | 1 + .../debug/openpower-debug-collector.bb | 77 +++++ .../debug/openpower-debug-collector.inc | 5 + .../openpower-debug-collector-checkstop@.service | 13 + ...power-debug-collector-watchdog-timeout@.service | 9 + .../openpower-debug-collector-watchdog@.service | 9 + .../flash/openpower-software-manager.bb | 71 ++++ .../openpower-software-manager/obmc-flash-bios | 362 +++++++++++++++++++++ .../obmc-flash-bios-check-clearvolatile@.service | 14 + .../obmc-flash-bios-cleanup.service | 8 + .../obmc-flash-bios-enable-clearvolatile@.service | 14 + .../obmc-flash-bios-ubiattach.service | 8 + .../obmc-flash-bios-ubimount@.service | 13 + .../obmc-flash-bios-ubipatch.service | 11 + .../obmc-flash-bios-ubiremount.service | 13 + .../obmc-flash-bios-ubiumount-ro@.service | 10 + .../obmc-flash-bios-ubiumount-rw@.service | 10 + .../obmc-flash-bios-updatesymlinks.service | 16 + .../org.open_power.Software.Host.Updater.service | 19 ++ .../flash/phosphor-software-manager.bbappend | 4 + .../software-bmc-updater.conf | 3 + .../common/recipes-phosphor/fsi/op-fsi.bb | 18 + .../fsi/op-fsi/fsi-disable.service | 9 + .../recipes-phosphor/fsi/op-fsi/fsi-enable.service | 10 + .../recipes-phosphor/fsi/op-fsi/fsi-scan@.service | 17 + .../recipes-phosphor/host/aspeed-lpc-ctrl.bb | 15 + .../host/aspeed-lpc-ctrl/pnorboot.service | 9 + .../recipes-phosphor/host/checkstop-monitor.bb | 30 ++ .../host/checkstop-monitor/checkstop.conf | 3 + .../host/checkstop-monitor/obmc/gpio/checkstop | 4 + .../recipes-phosphor/host/hostboot-settings.bb | 19 ++ .../host/hostboot-settings/hb_settings | 110 +++++++ .../hostboot-settings/hostboot-settings.service | 9 + .../host/op-host-control/cfam_override@.service | 20 ++ .../host/op-host-control/start_host@.service | 19 ++ .../host/op-host-control/vcs_workaround@.service | 19 ++ .../recipes-phosphor/host/op-proc-control.bb | 26 ++ .../recipes-phosphor/host/p9-cfam-override.bb | 19 ++ .../common/recipes-phosphor/host/p9-host-start.bb | 23 ++ .../recipes-phosphor/host/p9-vcs-workaround.bb | 19 ++ .../initfs/obmc-phosphor-initfs.bbappend | 1 + .../interfaces/phosphor-rest.bbappend | 1 + .../interfaces/phosphor-rest/url_config.json | 14 + .../inventory-upload/inventory-upload.bb | 31 ++ .../inventory-upload/op-inventory-upload@.service | 16 + .../ipmi/hostboot-inventory-config-native.bb | 19 ++ .../ipmi/hostboot-inventory-config/config.yaml | 117 +++++++ .../ipmi/openpower-ipmi-oem-error-native.bb | 19 ++ ...enpower-ipmi-oem-sensor-inventory-mrw-native.bb | 16 + .../openpower-config.yaml | 34 ++ .../ipmi/openpower-ipmi-oem-whitelist-native.bb | 6 + .../openpower-ipmi-oem-whitelist-native.conf | 2 + .../recipes-phosphor/ipmi/openpower-ipmi-oem.bb | 35 ++ .../recipes-phosphor/ipmi/openpower-ipmi-oem.inc | 5 + .../phosphor-ipmi-sensor-config-native.bbappend | 1 + .../phosphor-logging-error-logs-native.bbappend | 1 + .../logging/phosphor-logging.bbappend | 5 + .../openpower-occ-control-config-example-native.bb | 17 + .../occ/openpower-occ-control-config-mrw-native.bb | 19 ++ .../recipes-phosphor/occ/openpower-occ-control.bb | 111 +++++++ .../recipes-phosphor/occ/openpower-occ-control.inc | 5 + .../occ/openpower-occ-control/occ-active.sh | 20 ++ .../openpower-occ-control/op-occ-disable@.service | 12 + .../openpower-occ-control/op-occ-enable@.service | 17 + .../org.open_power.OCC.Control.service | 14 + .../nativesdk-packagegroup-sdk-host.bbappend | 4 + .../packagegroups/packagegroup-obmc-apps.bbappend | 24 ++ .../packagegroup-obmc-ipmid-providers.bbappend | 1 + .../packagegroup-obmc-phosphor-debugtools.bbappend | 5 + .../packagegroups/packagegroup-op-apps.bb | 61 ++++ .../vpd/openpower-fru-inventory-example-native.bb | 22 ++ .../vpd/openpower-fru-inventory-example/inventory | 2 + .../vpd/openpower-fru-inventory-mrw-native.bb | 28 ++ .../vpd/openpower-fru-properties-example-native.bb | 22 ++ .../openpower-fru-properties-example/example.yaml | 6 + .../vpd/openpower-fru-properties-mrw-native.bb | 29 ++ .../vpd/openpower-fru-properties-mrw/config.yaml | 11 + .../vpd/openpower-fru-vpd-layout-native.bb | 19 ++ .../vpd/openpower-fru-vpd-layout/layout.yaml | 15 + .../recipes-phosphor/vpd/openpower-fru-vpd.bb | 47 +++ .../recipes-phosphor/vpd/openpower-fru-vpd.inc | 5 + .../vpd/openpower-fru-vpd/70-op-vpd.rules | 1 + .../vpd/openpower-fru-vpd/op-vpd-parser.service | 12 + .../recipes-phosphor/webui/phosphor-webui.bbappend | 16 + 94 files changed, 2129 insertions(+) create mode 100644 meta-openpower/common/recipes-bsp/ffs/ffs.inc create mode 100644 meta-openpower/common/recipes-bsp/ffs/ffs_git.bb create mode 100644 meta-openpower/common/recipes-bsp/fsidbg/fsidbg.bb create mode 100644 meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-CFAM-reg-0x2918-access-hack.patch create mode 100644 meta-openpower/common/recipes-bsp/pdbg/pdbg_1.0.bb create mode 100644 meta-openpower/common/recipes-bsp/skiboot/gard.bb create mode 100644 meta-openpower/common/recipes-bsp/skiboot/pflash.bb create mode 100644 meta-openpower/common/recipes-bsp/skiboot/skiboot.inc create mode 100644 meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces-mapper-config-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces.bb create mode 100644 meta-openpower/common/recipes-phosphor/dbus/phosphor-mapper-config-native%.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb create mode 100644 meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.inc create mode 100644 meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service create mode 100644 meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service create mode 100644 meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager.bb create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-check-clearvolatile@.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-cleanup.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-enable-clearvolatile@.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service create mode 100644 meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager/software-bmc-updater.conf create mode 100644 meta-openpower/common/recipes-phosphor/fsi/op-fsi.bb create mode 100644 meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-disable.service create mode 100644 meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service create mode 100644 meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-scan@.service create mode 100644 meta-openpower/common/recipes-phosphor/host/aspeed-lpc-ctrl.bb create mode 100644 meta-openpower/common/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service create mode 100644 meta-openpower/common/recipes-phosphor/host/checkstop-monitor.bb create mode 100644 meta-openpower/common/recipes-phosphor/host/checkstop-monitor/checkstop.conf create mode 100644 meta-openpower/common/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop create mode 100644 meta-openpower/common/recipes-phosphor/host/hostboot-settings.bb create mode 100644 meta-openpower/common/recipes-phosphor/host/hostboot-settings/hb_settings create mode 100644 meta-openpower/common/recipes-phosphor/host/hostboot-settings/hostboot-settings.service create mode 100644 meta-openpower/common/recipes-phosphor/host/op-host-control/cfam_override@.service create mode 100644 meta-openpower/common/recipes-phosphor/host/op-host-control/start_host@.service create mode 100644 meta-openpower/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service create mode 100644 meta-openpower/common/recipes-phosphor/host/op-proc-control.bb create mode 100644 meta-openpower/common/recipes-phosphor/host/p9-cfam-override.bb create mode 100644 meta-openpower/common/recipes-phosphor/host/p9-host-start.bb create mode 100644 meta-openpower/common/recipes-phosphor/host/p9-vcs-workaround.bb create mode 100644 meta-openpower/common/recipes-phosphor/initfs/obmc-phosphor-initfs.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json create mode 100644 meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload.bb create mode 100644 meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config/config.yaml create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-error-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw/openpower-config.yaml create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist/openpower-ipmi-oem-whitelist-native.conf create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.bb create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.inc create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/ipmi/phosphor-logging-error-logs-native.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/logging/phosphor-logging.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-example-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-mrw-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.inc create mode 100755 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service create mode 100644 meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service create mode 100644 meta-openpower/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bbappend create mode 100644 meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules create mode 100644 meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service create mode 100644 meta-openpower/common/recipes-phosphor/webui/phosphor-webui.bbappend (limited to 'meta-openpower/common') diff --git a/meta-openpower/common/recipes-bsp/ffs/ffs.inc b/meta-openpower/common/recipes-bsp/ffs/ffs.inc new file mode 100644 index 000000000..f144884aa --- /dev/null +++ b/meta-openpower/common/recipes-bsp/ffs/ffs.inc @@ -0,0 +1,17 @@ +SUMMARY = "Tools for manipulating FFS flash images." +DESCRIPTION = "FFS is the FSP Flash File Structure which is also currently \ +used on OpenPOWER machines for the flash layout." + +HOMEPAGE = "https://github.com/open-power/ffs" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658" + +inherit autotools pkgconfig + +ALLOW_EMPTY_${PN} = "1" +PACKAGE_BEFORE_PN += "${PN}-ecc ${PN}-deprecated" + +FILES_${PN}-ecc = "${bindir}/ecc" +FILES_${PN}-deprecated = "${bindir}" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openpower/common/recipes-bsp/ffs/ffs_git.bb b/meta-openpower/common/recipes-bsp/ffs/ffs_git.bb new file mode 100644 index 000000000..2340121bd --- /dev/null +++ b/meta-openpower/common/recipes-bsp/ffs/ffs_git.bb @@ -0,0 +1,8 @@ +require ffs.inc + +PV = "v0.1.0+git${SRCPV}" + +SRCREV = "3ec70fbc458e32eef0d0b1de79688b4dc48cbd57" +SRC_URI += "git://github.com/open-power/ffs.git" + +S = "${WORKDIR}/git" diff --git a/meta-openpower/common/recipes-bsp/fsidbg/fsidbg.bb b/meta-openpower/common/recipes-bsp/fsidbg/fsidbg.bb new file mode 100644 index 000000000..b6fed556a --- /dev/null +++ b/meta-openpower/common/recipes-bsp/fsidbg/fsidbg.bb @@ -0,0 +1,18 @@ +SUMMARY = "FSI debug tool" +DESCRIPTION = "fsidbg is a tool to access remote FSI engines and perform client driver operations" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=84dcc94da3adb52b53ae4fa38fe49e5d" + +SRC_URI += "git://github.com/eddiejames/fsidbg.git" + +SRCREV = "dfe278065c877724242dfae15a4c627fd2e3611c" +PV = "git${SRCREV}" + +S = "${WORKDIR}/git" + +do_install() { + install -d ${D}${bindir} + install -m 0755 fsidbg ${D}${bindir} +} + +TARGET_CC_ARCH += "${LDFLAGS}" diff --git a/meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-CFAM-reg-0x2918-access-hack.patch b/meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-CFAM-reg-0x2918-access-hack.patch new file mode 100644 index 000000000..dba62e3fe --- /dev/null +++ b/meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-CFAM-reg-0x2918-access-hack.patch @@ -0,0 +1,34 @@ +From e21d90ae8c131eae9d78e3d06f29cab55c952884 Mon Sep 17 00:00:00 2001 +From: Matt Spinler +Date: Thu, 19 Jan 2017 09:06:48 -0600 +Subject: [PATCH] CFAM reg 0x2918 access hack + +--- + libpdbg/bmcfsi.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/libpdbg/bmcfsi.c b/libpdbg/bmcfsi.c +index 64dbd69..f763f2a 100644 +--- a/libpdbg/bmcfsi.c ++++ b/libpdbg/bmcfsi.c +@@ -247,7 +247,16 @@ static uint64_t fsi_abs_ar(uint32_t addr, int read) + /* Reformat the address. I'm not sure I fully understand this + * yet but we basically shift the bottom byte and add 0b01 + * (for the write word?) */ +- addr = ((addr & 0x1fff00) | ((addr & 0xff) << 2)) << 1; ++ ++ /* Hack: this shifting doesn't work for all addresses, but it does ++ * work for 2918 and (and 2nd chip 2918) so use it just for that */ ++ if ((addr == 0x2918) || (addr == 0x102918)) { ++ addr = ((addr & 0x1ffe00) | ((addr & 0x1ff) << 2)) << 1; ++ } ++ else { ++ addr = ((addr & 0x1fff00) | ((addr & 0xff) << 2)) << 1; ++ } ++ + addr |= 0x3; + addr |= slave_id << 26; + addr |= (0x8ULL | !!(read)) << 22; +-- +2.11.0 + diff --git a/meta-openpower/common/recipes-bsp/pdbg/pdbg_1.0.bb b/meta-openpower/common/recipes-bsp/pdbg/pdbg_1.0.bb new file mode 100644 index 000000000..4d48a0ddf --- /dev/null +++ b/meta-openpower/common/recipes-bsp/pdbg/pdbg_1.0.bb @@ -0,0 +1,13 @@ +SUMMARY = "PowerPC FSI Debugger" +DESCRIPTION = "pdbg allows JTAG-like debugging of the host POWER processors" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" + +SRC_URI += "git://github.com/open-power/pdbg.git;branch=master" +SRCREV = "3f1c06d62f81dfbfbb1723d15a6ff3c2f23708f1" + +DEPENDS += "dtc-native" + +S = "${WORKDIR}/git" + +inherit autotools diff --git a/meta-openpower/common/recipes-bsp/skiboot/gard.bb b/meta-openpower/common/recipes-bsp/skiboot/gard.bb new file mode 100644 index 000000000..214e905ef --- /dev/null +++ b/meta-openpower/common/recipes-bsp/skiboot/gard.bb @@ -0,0 +1,5 @@ +SUMMARY = "gard record tool for OpenPower" +DESCRIPTION = "gard record tool for OpenPower machines" + +require skiboot.inc +EXTRA_OEMAKE_append = " PFLASH_VERSION=${PV} GARD_VERSION=${PV}" diff --git a/meta-openpower/common/recipes-bsp/skiboot/pflash.bb b/meta-openpower/common/recipes-bsp/skiboot/pflash.bb new file mode 100644 index 000000000..05aa2fcca --- /dev/null +++ b/meta-openpower/common/recipes-bsp/skiboot/pflash.bb @@ -0,0 +1,8 @@ +SUMMARY = "pflash programmer for OpenPower" +DESCRIPTION = "pflash firmware programming tool for OpenPower machines" + +require skiboot.inc +EXTRA_OEMAKE_append = " PFLASH_VERSION=${PV} LINKAGE=dynamic" + +#TODO: openbmc/openbmc#1361 - Fix GNU_HASH warnings in pflash +TARGET_CC_ARCH += "${LDFLAGS}" diff --git a/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc b/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc new file mode 100644 index 000000000..169b207b7 --- /dev/null +++ b/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc @@ -0,0 +1,27 @@ +HOMEPAGE = "https://github.com/open-power" +LICENSE = "Apache-2.0" + +SRC_URI += "git://github.com/open-power/skiboot.git;nobranch=1" + +FILESEXTRAPATHS_append := "${THISDIR}/skiboot:" + +LIC_FILES_CHKSUM = "file://${S}/LICENCE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +SRCREV = "452998f4be5973d8884e3db5aa362bf40e11467a" +PV = "v6.1" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} SKIBOOT_VERSION=${PV} V=1" + +SKIBOOT_SUBDIR ?= "external/${PN}" + +do_compile() { + oe_runmake -C ${SKIBOOT_SUBDIR} all +} + +# TODO: remove PREFIX=$prefix when updating to a version that has +# http://patchwork.ozlabs.org/patch/923741/ is merged upstream +do_install() { + oe_runmake -C ${SKIBOOT_SUBDIR} install DESTDIR=${D} prefix=/usr PREFIX=$prefix +} diff --git a/meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces-mapper-config-native.bb b/meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces-mapper-config-native.bb new file mode 100644 index 000000000..1ef4adca2 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces-mapper-config-native.bb @@ -0,0 +1,11 @@ +SUMMARY="Add /org/open_power namespace to phosphor-mapper" +DESCRIPTION="Add the /org/open_power path namespace and \ +org.open_power interface prefix to the mapper \ +watch list." + +inherit phosphor-mapper +inherit native +inherit obmc-phosphor-license + +PHOSPHOR_MAPPER_NAMESPACE_append = " /org/open_power" +PHOSPHOR_MAPPER_INTERFACE_append = " org.open_power" diff --git a/meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces.bb b/meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces.bb new file mode 100644 index 000000000..18ce1adf1 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/dbus/openpower-dbus-interfaces.bb @@ -0,0 +1,32 @@ +SUMMARY = "Open POWER DBus Interfaces" +DESCRIPTION = "Generated bindings, using sdbus++, for the openpower YAML" +PR = "r1" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit obmc-phosphor-license +inherit pythonnative +inherit phosphor-dbus-yaml + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbus++-native" + +SRC_URI += "git://github.com/openbmc/openpower-dbus-interfaces" +SRCREV = "db61501f7a2ad964555b3fb482a2bb4cffcbbb9d" + +DEPENDS_remove_class-native = "sdbus++-native" +DEPENDS_remove_class-nativesdk = "sdbus++-native" + +PACKAGECONFIG ??= "libopenpower_dbus" +PACKAGECONFIG[libopenpower_dbus] = " \ + --enable-libopenpower_dbus, \ + --disable-libopenpower_dbus, \ + systemd sdbusplus, \ + libsystemd sdbusplus \ + " + +PACKAGECONFIG_remove_class-native = "libopenpower_dbus" +PACKAGECONFIG_remove_class-nativesdk = "libopenpower_dbus" + +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-openpower/common/recipes-phosphor/dbus/phosphor-mapper-config-native%.bbappend b/meta-openpower/common/recipes-phosphor/dbus/phosphor-mapper-config-native%.bbappend new file mode 100644 index 000000000..04df9733b --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/dbus/phosphor-mapper-config-native%.bbappend @@ -0,0 +1 @@ +PHOSPHOR_MAPPER_CONFIGS_append_df-openpower = " openpower-dbus-interfaces-mapper-config-native" diff --git a/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb new file mode 100644 index 000000000..ac4cd0141 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb @@ -0,0 +1,77 @@ +SUMMARY = "OpenPOWER Debug Collector" +DESCRIPTION = "Application to log error during host checkstop and watchdog timeout" + +PR = "r1" + +inherit autotools \ + pkgconfig \ + obmc-phosphor-systemd \ + pythonnative \ + phosphor-dbus-yaml + +require ${PN}.inc + +DEPENDS += " \ + phosphor-logging \ + autoconf-archive-native \ + sdbus++-native \ + " +RDEPENDS_${PN} += " \ + phosphor-logging \ + " + +S = "${WORKDIR}/git" + +# This provides below 2 applications that are called into in case +# of host checkstop and host watchdog timeout respectively. +APPS = "checkstop watchdog" + +DEBUG_TMPL = "openpower-debug-collector-{0}@.service" +SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'DEBUG_TMPL', 'APPS')}" + +# This needs to be executed as part of host crash +CHECKSTOP_TMPL = "openpower-debug-collector-checkstop@.service" +CRASH_TGTFMT = "obmc-host-crash@{0}.target" +CHECKSTOP_INSTFMT = "openpower-debug-collector-checkstop@{0}.service" +CRASH_CHECKSTOP_FMT = "../${CHECKSTOP_TMPL}:${CRASH_TGTFMT}.wants/${CHECKSTOP_INSTFMT}" + +# Make watchdog part of obmc-host-timeout target +WDOG_TMPL = "openpower-debug-collector-watchdog@.service" +TIMEOUT_TGTFMT = "obmc-host-timeout@{0}.target" +WDOG_INSTFMT = "openpower-debug-collector-watchdog@{0}.service" +TIMEOUT_WDOG_FMT = "../${WDOG_TMPL}:${TIMEOUT_TGTFMT}.wants/${WDOG_INSTFMT}" + +# Capture debug information on watchdog timeout +DEBUG_WD_TIMEOUT_TMPL = "openpower-debug-collector-watchdog-timeout@.service" +DEBUG_WD_TIMEOUT_INSTFMT = "openpower-debug-collector-watchdog-timeout@{0}.service" +DEBUG_WD_TIMEOUT_FMT = "../${DEBUG_WD_TIMEOUT_TMPL}:${TIMEOUT_TGTFMT}.wants/${DEBUG_WD_TIMEOUT_INSTFMT}" + +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CRASH_CHECKSTOP_FMT', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'TIMEOUT_WDOG_FMT', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'DEBUG_WD_TIMEOUT_FMT', 'OBMC_HOST_INSTANCES')}" + +# Do not depend on phosphor-logging for native build +DEPENDS_remove_class-native = "phosphor-logging" + +# Do not depend on phosphor-logging for native SDK build +DEPENDS_remove_class-nativesdk = "phosphor-logging" + +# Provide a means to enable/disable install_error_yaml feature +PACKAGECONFIG ??= "install_error_yaml" +PACKAGECONFIG[install_error_yaml] = " \ + --enable-install_error_yaml, \ + --disable-install_error_yaml, ,\ + " + +# Enable install_error_yaml during native and native SDK build +PACKAGECONFIG_add_class-native = "install_error_yaml" +PACKAGECONFIG_add_class-nativesdk = "install_error_yaml" + +# Disable install_error_yaml during target build +PACKAGECONFIG_remove_class-target = "install_error_yaml" + +# Disable generating elog error header file during bitbake. Applications +# should be using the elog header generated by phosphor-logging recipe +EXTRA_OECONF += "--disable-gen_errors" + +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.inc b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.inc new file mode 100644 index 000000000..4b1435625 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/openpower-debug-collector" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/openpower-debug-collector" +SRCREV = "5bc32f24a05de75b3a11d93cdae7b99ee718efcb" diff --git a/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service new file mode 100644 index 000000000..5e8cf3dcd --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-checkstop@.service @@ -0,0 +1,13 @@ +[Unit] +Description=OpenPOWER debug data collector for host checkstop +Before=obmc-host-quiesce@%i.target + +[Service] +# Adding 10 seconds to allow OCC to collect debug data +# before processing checkstop. OCC has to wait 5 seconds +# for our driver to stop using the SBEFIFO. +ExecStart={base_bindir}/sleep 10 +ExecStart=/usr/bin/env checkstop_app +SyslogIdentifier=checkstop_app +Type=oneshot +Restart=no diff --git a/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service new file mode 100644 index 000000000..55ba40351 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenPOWER debug data collector for host %I watchdog timeout +Before=obmc-host-quiesce@%i.target + +[Service] +ExecStart=/usr/bin/env openpower-proc-control collectSBEHBData +SyslogIdentifier=openpower-proc-control +Type=oneshot +Restart=no diff --git a/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service new file mode 100644 index 000000000..6fc3fec82 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog@.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenPOWER debug data collector for host watchdog timeout +Before=obmc-host-quiesce@%i.target + +[Service] +ExecStart=/usr/bin/env watchdog_timeout +SyslogIdentifier=watchdog_timeout +Type=oneshot +Restart=no diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager.bb b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager.bb new file mode 100644 index 000000000..cd17e0d5c --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager.bb @@ -0,0 +1,71 @@ +SUMMARY = "OpenPower Software Management" +DESCRIPTION = "OpenPower Software Manager provides a set of host software \ +management daemons. It is suitable for use on a wide variety of OpenPower \ +platforms." +HOMEPAGE = "https://github.com/openbmc/openpower-pnor-code-mgmt" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service +inherit pythonnative + +PACKAGECONFIG[verify_pnor_signature] = "--enable-verify_pnor_signature,--disable-verify_pnor_signature" + +DEPENDS += " \ + autoconf-archive-native \ + phosphor-dbus-interfaces \ + phosphor-logging \ + sdbusplus \ + sdbusplus-native \ + " + +RDEPENDS_${PN} += " \ + mtd-utils-ubifs \ + phosphor-dbus-interfaces \ + phosphor-logging \ + sdbusplus \ + virtual-obmc-image-manager \ + " + +S = "${WORKDIR}/git" + +SRC_URI += "git://github.com/openbmc/openpower-pnor-code-mgmt" + +SRC_URI += "file://obmc-flash-bios" + +SRCREV = "c39d923fee581533775e37be3f59f77c021718ee" + +do_install_append() { + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/obmc-flash-bios ${D}${sbindir}/obmc-flash-bios +} + +DBUS_SERVICE_${PN} += "org.open_power.Software.Host.Updater.service" + +SYSTEMD_SERVICE_${PN} += " \ + obmc-flash-bios-ubiattach.service \ + obmc-flash-bios-ubimount@.service \ + obmc-flash-bios-ubiumount-ro@.service \ + obmc-flash-bios-ubiumount-rw@.service \ + obmc-flash-bios-ubipatch.service \ + obmc-flash-bios-ubiremount.service \ + obmc-flash-bios-updatesymlinks.service \ + obmc-flash-bios-cleanup.service \ + obmc-flash-bios-enable-clearvolatile@.service \ + obmc-flash-bios-check-clearvolatile@.service \ + " + +ENABLE_CLEAR_VOLATILE_TMPL = "obmc-flash-bios-enable-clearvolatile@.service" +HOST_START_TGTFMT = "obmc-host-start@{0}.target" +ENABLE_CLEAR_VOLATILE_INSTFMT = "obmc-flash-bios-enable-clearvolatile@{0}.service" +ENABLE_CLEAR_VOLATILE_START_FMT = "../${ENABLE_CLEAR_VOLATILE_TMPL}:${HOST_START_TGTFMT}.requires/${ENABLE_CLEAR_VOLATILE_INSTFMT}" + +CHECK_CLEAR_VOLATILE_TMPL = "obmc-flash-bios-check-clearvolatile@.service" +HOST_STARTMIN_TGTFMT = "obmc-host-startmin@{0}.target" +CHECK_CLEAR_VOLATILE_INSTFMT = "obmc-flash-bios-check-clearvolatile@{0}.service" +CHECK_CLEAR_VOLATILE_START_FMT = "../${CHECK_CLEAR_VOLATILE_TMPL}:${HOST_STARTMIN_TGTFMT}.requires/${CHECK_CLEAR_VOLATILE_INSTFMT}" + +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ENABLE_CLEAR_VOLATILE_START_FMT', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHECK_CLEAR_VOLATILE_START_FMT', 'OBMC_HOST_INSTANCES')}" diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios new file mode 100644 index 000000000..ff8818518 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios @@ -0,0 +1,362 @@ +#!/bin/sh + +# Get the mtd device number (mtdX) +findmtd() { + m="$(grep -xl "$1" /sys/class/mtd/*/name)" + m="${m%/name}" + m="${m##*/}" + echo "${m}" +} + +# Get the ubi device number (ubiX_Y) +findubi() { + u="$(grep -xl "$1" /sys/class/ubi/ubi?/subsystem/ubi*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get the mount information +is_mounted() { + grep -q "$1" /proc/mounts + return $? +} + +# Attach the pnor mtd device to ubi. +attach_ubi() { + pnormtd="$(findmtd pnor)" + pnor="${pnormtd#mtd}" + pnordev="/dev/mtd${pnor}" + + if [ -d "/sys/class/ubi/ubi${pnor}" ]; then + # Already attached + return 0 + fi + + ubiattach /dev/ubi_ctrl -m "${pnor}" -d "${pnor}" + rc=$? + if [ ${rc} -ne 0 ]; then + # Check the pnor mtd device is formatted as ubi by reading the first 3 byes, + # which should be the ascii chars 'UBI' + magic="$(hexdump -C -n 3 ${pnordev})" + if [[ "${magic}" =~ "UBI" ]]; then + # Device already formatted as ubi, ubiattach failed for some other reason + return ${rc} + else + # Format device as ubi + echo "Starting ubiformat ${pnordev}" + ubiformat "${pnordev}" -y -q + # Retry the ubiattach + ubiattach /dev/ubi_ctrl -m "${pnor}" -d "${pnor}" + fi + fi +} + +mount_squashfs() { + pnormtd="$(findmtd pnor)" + ubidev="/dev/ubi${pnormtd#mtd}" + mountdir="/media/${name}" + vol="$(findubi "${name}")" + img="/tmp/images/${version}/pnor.xz.squashfs" + filesize="$(ls -sh $img | awk -F " " {'print $1'})" + + if is_mounted "${name}"; then + echo "${name} is already mounted." + return 0 + fi + + if [ ! -z "${vol}" ]; then + ubirmvol "${ubidev}" -N "${name}" + fi + + if [ ! -d "${mountdir}" ]; then + mkdir "${mountdir}" + fi + + # Set size of read-only partition equal to pnor.xz.squashfs + ubimkvol "${ubidev}" -N "${name}" -s "${filesize}"KiB --type=static + vol="$(findubi "${name}")" + + if [ $? != 0 ]; then + echo "Unable to create RO volume!" + return 1 + fi + + ubidevid="${vol#ubi}" + ubiupdatevol "/dev/ubi${ubidevid}" "${img}" + + if [ $? != 0 ]; then + echo "Unable to update RO volume!" + return 1 + fi + + ubiblock --create "/dev/ubi${ubidevid}" + + if [ $? != 0 ]; then + echo "Unable to create UBI block for RO volume!" + return 1 + fi + + mount -t squashfs -o ro "/dev/ubiblock${ubidevid}" "${mountdir}" + + if [ $? != 0 ]; then + echo "Unable to mount RO volume!" + return 1 + fi +} + +mount_ubi() { + pnormtd="$(findmtd pnor)" + pnor="${pnormtd#mtd}" + ubidev="/dev/ubi${pnor}" + pnordev="/dev/mtd${pnor}" + + if [[ "${name}" == "pnor-patch" ]]; then + if [[ "$(fw_printenv fieldmode 2>/dev/null)" == "fieldmode=true" ]]; then + return 0 + fi + if [[ ! "$(hexdump -C -n 3 ${pnordev})" =~ "UBI" ]]; then + return 0 + fi + mountdir="/usr/local/share/pnor" + else + mountdir="/media/${name}" + fi + + if [[ "${name}" == "pnor-prsv" ]]; then + size="2MiB" + else + size="16MiB" + fi + + if [ ! -d "${mountdir}" ]; then + mkdir -p "${mountdir}" + fi + + vol="$(findubi "${name}")" + if [ -z "${vol}" ]; then + ubimkvol "${ubidev}" -N "${name}" -s "${size}" + fi + + if ! is_mounted "${name}"; then + mountdev="ubi${pnor}:${name}" + mount -t ubifs "${mountdev}" "${mountdir}" + fi +} + +umount_ubi() { + pnormtd="$(findmtd pnor)" + pnor="${pnormtd#mtd}" + ubidev="/dev/ubi${pnor}" + mountdir="/media/${name}" + + if is_mounted "${name}"; then + umount "${mountdir}" + fi + + vol="$(findubi "${name}")" + id="${vol##*_}" + if [ -n "${id}" ]; then + ubirmvol "${ubidev}" -n "${id}" + fi + + if [ -d "${mountdir}" ]; then + rm -r "${mountdir}" + fi +} + +remount_ubi() { + pnormtd="$(findmtd pnor)" + pnor="${pnormtd#mtd}" + pnordev="/dev/mtd${pnor}" + + # Re-Attach the pnor mtd device to ubi + if [[ $(hexdump -C -n 3 ${pnordev}) =~ "UBI" ]]; then + ubiattach /dev/ubi_ctrl -m "${pnor}" -d "${pnor}" + else + # Device not formatted as ubi. + return 0 + fi + + # Get information on all ubi volumes + ubinfo=$(ubinfo -d ${pnor}) + presentVolumes=${ubinfo##*:} + IFS=', ' read -r -a array <<< "$presentVolumes" + for element in ${array[@]}; + do + elementProperties=$(ubinfo -d $pnor -n $element) + # Get ubi volume name by getting rid of additional properties + name=${elementProperties#*Name:} + name="${name%Character*}" + name="$(echo -e "${name}" | tr -d '[:space:]')" + + if [[ ${name} == pnor-prsv ]] || [[ ${name} == pnor-rw* ]] || [[ ${name} == pnor-ro* ]]; then + mountdir="/media/${name}" + if [ ! -d "${mountdir}" ]; then + mkdir -p "${mountdir}" + fi + + if [[ ${name} == pnor-ro* ]] + then + ubiblock --create /dev/ubi${pnor}_${element} + mount -t squashfs -o ro "/dev/ubiblock${pnor}_${element}" "${mountdir}" + else + mount -t ubifs "ubi${pnor}:${name}" "${mountdir}" + fi + fi + done +} + +update_symlinks() { + PNOR_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/" + PNOR_RO_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/ro" + PNOR_RO_PREFIX="/media/pnor-ro-" + PNOR_RW_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/rw" + PNOR_RW_PREFIX="/media/pnor-rw-" + PNOR_PRSV_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/prsv" + PNOR_PRSV="/media/pnor-prsv" + PERSISTENCE_PATH="/var/lib/obmc/openpower-pnor-code-mgmt/" + PNOR_PATCH_LOCATION="/usr/local/share/pnor/" + + # Get a list of all active PNOR versions + data="$(ls -d ${PNOR_RO_PREFIX}*)" + IFS=$'\n' array=(${data}) + + currentVersion="" + lowestPriority=255 + for element in ${array[@]}; do + #Remove the PNOR_RO_PREFIX from the path to get version ID. + versionId="${element#${PNOR_RO_PREFIX}}" + + # Get the priority of active versions from persistence files. + if [[ -f "${PERSISTENCE_PATH}${versionId}" ]]; then + data="$(grep -r "priority" ${PERSISTENCE_PATH}${versionId})" + priority="${data: -1}" + if [[ priority -le lowestPriority ]]; then + lowestPriority=${priority} + currentVersion=${versionId} + fi + fi + done + + # Return if no active version found + if [ -z $currentVersion ]; then + return 0; + fi + + if [ ! -d "${PNOR_ACTIVE_PATH}" ]; then + mkdir -p "${PNOR_ACTIVE_PATH}" + fi + + # If the RW or RO active links doesn't point to the version with + # lowest priority, then remove the symlink and create new ones. + if [[ $(readlink -f "${PNOR_RO_ACTIVE_PATH}") != ${PNOR_RO_PREFIX}${currentVersion} ]]; then + rm -f ${PNOR_RO_ACTIVE_PATH} + rm -rf ${PNOR_PATCH_LOCATION}* + ln -sfv ${PNOR_RO_PREFIX}${currentVersion} ${PNOR_RO_ACTIVE_PATH} + fi + + if [[ $(readlink -f "${PNOR_RW_ACTIVE_PATH}") != ${PNOR_RW_PREFIX}${currentVersion} ]]; then + rm -f ${PNOR_RW_ACTIVE_PATH} + ln -sfv ${PNOR_RW_PREFIX}${currentVersion} ${PNOR_RW_ACTIVE_PATH} + fi + + if [[ ! -h ${PNOR_PRSV_ACTIVE_PATH} ]]; then + ln -sfv ${PNOR_PRSV} ${PNOR_PRSV_ACTIVE_PATH} + fi +} + +ubi_cleanup() { + # When ubi_cleanup is run, it expects one or no active version. + activeVersion=$(busctl --list --no-pager tree \ + org.open_power.Software.Host.Updater | \ + grep /xyz/openbmc_project/software/ | tail -c 9) + + if [[ -z "$activeVersion" ]]; then + vols=$(ubinfo -a | grep -e "pnor-ro-" -e "pnor-rw-" | cut -c 14-) + vols=(${vols}) + else + vols=$(ubinfo -a | grep -e "pnor-ro-" -e "pnor-rw-" | \ + grep -v "$activeVersion" | cut -c 14-) + vols=(${vols}) + fi + + for (( index=0; index<${#vols[@]}; index++ )); do + name=${vols[index]} + umount_ubi + done +} + +clear_volatile() { + service=$(mapper get-service /org/open_power/control/volatile) + clearVolatileEnabled=$(busctl get-property $service /org/open_power/control/volatile xyz.openbmc_project.Object.Enable Enabled) + if [[ "$clearVolatileEnabled" != "b true" ]]; then + return 0 + fi + + PNOR_TOC_FILE="pnor.toc" + PNOR_RO_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/ro/" + PNOR_RW_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/rw/" + PNOR_PRSV_ACTIVE_PATH="/var/lib/phosphor-software-manager/pnor/prsv/" + + # toc partition string format: + # partition27=HB_VOLATILE,0x02ba9000,0x02bae000,00,ECC,VOLATILE,READWRITE + tocFilePath="${PNOR_RO_ACTIVE_PATH}${PNOR_TOC_FILE}" + volatiles=($(grep VOLATILE "${tocFilePath}" | grep -Eo '^partition([0-9]+)=([A-Za-z0-9_]+)')) + for (( index=0; index<${#volatiles[@]}; index++ )); do + volatileName="$(echo ${volatiles[${index}]} | awk -F '=' '{print $2}')" + + rwVolatile="${PNOR_RW_ACTIVE_PATH}${volatileName}" + if [ -f "${rwVolatile}" ]; then + echo "Clear $rwVolatile" + rm "${rwVolatile}" + fi + prsvVolatile="${PNOR_PRSV_ACTIVE_PATH}${volatileName}" + if [ -f "${prsvVolatile}" ]; then + echo "Clear $prsvVolatile" + rm "${prsvVolatile}" + fi + done + # Always reset the sensor after clearing + busctl set-property $service /org/open_power/control/volatile xyz.openbmc_project.Object.Enable Enabled b false +} + +case "$1" in + ubiattach) + attach_ubi + ;; + squashfsmount) + name="$2" + version="$3" + mount_squashfs + ;; + ubimount) + name="$2" + mount_ubi + ;; + ubiumount) + name="$2" + umount_ubi + ;; + ubiremount) + remount_ubi + ;; + updatesymlinks) + update_symlinks + ;; + ubicleanup) + ubi_cleanup + ;; + clearvolatile) + clear_volatile + ;; + *) + echo "Invalid argument" + exit 1 + ;; +esac +rc=$? +if [ ${rc} -ne 0 ]; then + echo "$0: error ${rc}" + exit ${rc} +fi diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-check-clearvolatile@.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-check-clearvolatile@.service new file mode 100644 index 000000000..af66b4db9 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-check-clearvolatile@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Clear the Volatile PNOR partitions in host%i if Enabled +After=obmc-flash-bios-enable-clearvolatile@%i.service +Before=obmc-host-start-pre@%i.target +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios clearvolatile +SyslogIdentifier=obmc-flash-bios-check-clearvolatile + +[Install] +RequiredBy=obmc-host-startmin@%i.target diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-cleanup.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-cleanup.service new file mode 100644 index 000000000..07642a0e0 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-cleanup.service @@ -0,0 +1,8 @@ +[Unit] +Description=Clean up UBI volumes unattached to a Host version + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios ubicleanup +SyslogIdentifier=obmc-flash-bios diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-enable-clearvolatile@.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-enable-clearvolatile@.service new file mode 100644 index 000000000..e040738c7 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-enable-clearvolatile@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Enable the clearing of the Volatile PNOR partitions in host%i +After=mapper-wait@-org-open_power-control-volatile.service +Before=obmc-flash-bios-check-clearvolatile@%i.service +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/bin/sh -c "busctl set-property `mapper get-service /org/open_power/control/volatile` /org/open_power/control/volatile xyz.openbmc_project.Object.Enable Enabled b true" +SyslogIdentifier=obmc-flash-bios-enable-clearvolatile + +[Install] +RequiredBy=obmc-host-start@%i.target diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service new file mode 100644 index 000000000..d0785c9b0 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiattach.service @@ -0,0 +1,8 @@ +[Unit] +Description=Attach the PNOR mtd device to UBI + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env obmc-flash-bios ubiattach +SyslogIdentifier=obmc-flash-bios diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service new file mode 100644 index 000000000..d03041dad --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubimount@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Mount UBIFS volumes pnor-ro-%I, pnor-rw-%I and pnor-prsv +Requires=obmc-flash-bios-ubiattach.service +After=obmc-flash-bios-ubiattach.service +OnFailure=obmc-flash-bios-ubiumount-ro@%i.service obmc-flash-bios-ubiumount-rw@%i.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios squashfsmount pnor-ro-%i %i +ExecStart=/usr/bin/env obmc-flash-bios ubimount pnor-rw-%i +ExecStart=/usr/bin/env obmc-flash-bios ubimount pnor-prsv +SyslogIdentifier=obmc-flash-bios diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service new file mode 100644 index 000000000..206d31448 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubipatch.service @@ -0,0 +1,11 @@ +[Unit] +Description=Create a ubi volume for pnor patches +Before=mboxd.service +Wants=usr-local.mount +After=usr-local.mount + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios ubimount pnor-patch +SyslogIdentifier=obmc-flash-bios diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service new file mode 100644 index 000000000..f52cac684 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiremount.service @@ -0,0 +1,13 @@ +[Unit] +Description=Remount the squashfs and ubi volumes after a reboot +Wants=org.open_power.Software.Host.Updater.service +Before=org.open_power.Software.Host.Updater.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios ubiremount +SyslogIdentifier=obmc-flash-bios + +[Install] +WantedBy=multi-user.target diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service new file mode 100644 index 000000000..c6dc553f4 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-ro@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Remove UBIFS volume pnor-ro-%I +Wants=obmc-flash-bios-ubiattach.service +After=obmc-flash-bios-ubiattach.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios ubiumount pnor-ro-%i +SyslogIdentifier=obmc-flash-bios diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service new file mode 100644 index 000000000..c0ea8e628 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-ubiumount-rw@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Remove UBIFS volume pnor-rw-%I +Wants=obmc-flash-bios-ubiattach.service +After=obmc-flash-bios-ubiattach.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios ubiumount pnor-rw-%i +SyslogIdentifier=obmc-flash-bios diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service new file mode 100644 index 000000000..8323ccf29 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios-updatesymlinks.service @@ -0,0 +1,16 @@ +[Unit] +Description=Updates symlinks for active PNOR version +Before=mboxd.service +Before=mboxd-reload@0.service +After=org.open_power.Software.Host.Updater.service +After=op-reset-chassis-running@0.service +ConditionPathExists=!/run/openbmc/chassis@0-on + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bios updatesymlinks +SyslogIdentifier=obmc-flash-bios + +[Install] +WantedBy=mboxd.service mboxd-reload@.service diff --git a/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service new file mode 100644 index 000000000..2def481f7 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/org.open_power.Software.Host.Updater.service @@ -0,0 +1,19 @@ +[Unit] +Description=OpenPower Software Update Manager +Wants=xyz.openbmc_project.Software.Version.service +Before=xyz.openbmc_project.Software.Version.service +Before=mboxd.service +Wants=obmc-flash-bios-ubipatch.service +Before=obmc-flash-bios-ubipatch.service +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env openpower-update-manager +SyslogIdentifier=openpower-update-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager.bbappend b/meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager.bbappend new file mode 100644 index 000000000..c1799f127 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" + +SYSTEMD_OVERRIDE_${PN}-updater += \ + "software-bmc-updater.conf:xyz.openbmc_project.Software.BMC.Updater.service.d/software-bmc-updater.conf" diff --git a/meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager/software-bmc-updater.conf b/meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager/software-bmc-updater.conf new file mode 100644 index 000000000..587476244 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/flash/phosphor-software-manager/software-bmc-updater.conf @@ -0,0 +1,3 @@ +[Unit] +Wants=op-vpd-parser.service +After=op-vpd-parser.service diff --git a/meta-openpower/common/recipes-phosphor/fsi/op-fsi.bb b/meta-openpower/common/recipes-phosphor/fsi/op-fsi.bb new file mode 100644 index 000000000..840b649f6 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/fsi/op-fsi.bb @@ -0,0 +1,18 @@ +SUMMARY = "FSI Services" +DESCRIPTION = "Install FSI related services" +PR = "r1" + +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license + +RDEPENDS_${PN} += "op-proc-control" + +TGTFMT = "obmc-chassis-poweron@{0}.target" + +TMPL_SCAN = "fsi-scan@.service" +INSTFMT_SCAN = "fsi-scan@{0}.service" +FMT_SCAN = "../${TMPL_SCAN}:${TGTFMT}.requires/${INSTFMT_SCAN}" + +SYSTEMD_SERVICE_${PN} += "${TMPL_SCAN} fsi-enable.service fsi-disable.service" + +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_SCAN', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-disable.service b/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-disable.service new file mode 100644 index 000000000..11c8563f3 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-disable.service @@ -0,0 +1,9 @@ +[Unit] +Description=Disable FSI +Conflicts=fsi-enable.service + +[Service] +ExecStart=/usr/sbin/openpower-proc-control setSyncFSIClock +ExecStart=/bin/sh -c "echo 1 > /sys/devices/platform/gpio-fsi/external_mode" +Type=oneshot +RemainAfterExit=yes diff --git a/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service b/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service new file mode 100644 index 000000000..e14803204 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service @@ -0,0 +1,10 @@ +[Unit] +Description=Enable FSI +Conflicts=fsi-disable.service +Wants=fsi-scan@0.service +Before=fsi-scan@0.service + +[Service] +ExecStart=/bin/sh -c "echo 0 > /sys/devices/platform/gpio-fsi/external_mode" +Type=oneshot +RemainAfterExit=yes diff --git a/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-scan@.service b/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-scan@.service new file mode 100644 index 000000000..d8f28882a --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/fsi/op-fsi/fsi-scan@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Scan FSI devices +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Wants=obmc-host-start-pre@%i.target +Before=obmc-host-start-pre@%i.target +Conflicts=obmc-chassis-poweroff@%i.target + +[Service] +ExecStart=/usr/bin/env openpower-proc-control scanFSI +SyslogIdentifier=openpower-proc-control + +Type=oneshot +RemainAfterExit=yes + +[Install] +RequiredBy=obmc-chassis-poweron@%i.target diff --git a/meta-openpower/common/recipes-phosphor/host/aspeed-lpc-ctrl.bb b/meta-openpower/common/recipes-phosphor/host/aspeed-lpc-ctrl.bb new file mode 100644 index 000000000..f37f2bec6 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service b/meta-openpower/common/recipes-phosphor/host/aspeed-lpc-ctrl/pnorboot.service new file mode 100644 index 000000000..fffe13c48 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/checkstop-monitor.bb b/meta-openpower/common/recipes-phosphor/host/checkstop-monitor.bb new file mode 100644 index 000000000..4959a3b73 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/checkstop-monitor/checkstop.conf b/meta-openpower/common/recipes-phosphor/host/checkstop-monitor/checkstop.conf new file mode 100644 index 000000000..f47711ff6 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop b/meta-openpower/common/recipes-phosphor/host/checkstop-monitor/obmc/gpio/checkstop new file mode 100644 index 000000000..e856339b0 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/hostboot-settings.bb b/meta-openpower/common/recipes-phosphor/host/hostboot-settings.bb new file mode 100644 index 000000000..39beb480c --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/hostboot-settings/hb_settings b/meta-openpower/common/recipes-phosphor/host/hostboot-settings/hb_settings new file mode 100644 index 000000000..d75d4b74d --- /dev/null +++ b/meta-openpower/common/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 +# +# 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/common/recipes-phosphor/host/hostboot-settings/hostboot-settings.service b/meta-openpower/common/recipes-phosphor/host/hostboot-settings/hostboot-settings.service new file mode 100644 index 000000000..60e3ee998 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/op-host-control/cfam_override@.service b/meta-openpower/common/recipes-phosphor/host/op-host-control/cfam_override@.service new file mode 100644 index 000000000..e6bc9389c --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/op-host-control/start_host@.service b/meta-openpower/common/recipes-phosphor/host/op-host-control/start_host@.service new file mode 100644 index 000000000..77a88e864 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service b/meta-openpower/common/recipes-phosphor/host/op-host-control/vcs_workaround@.service new file mode 100644 index 000000000..bd9db809b --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/op-proc-control.bb b/meta-openpower/common/recipes-phosphor/host/op-proc-control.bb new file mode 100644 index 000000000..a9c030bdc --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/p9-cfam-override.bb b/meta-openpower/common/recipes-phosphor/host/p9-cfam-override.bb new file mode 100644 index 000000000..4f6a9c653 --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/p9-host-start.bb b/meta-openpower/common/recipes-phosphor/host/p9-host-start.bb new file mode 100644 index 000000000..24b1b9c1f --- /dev/null +++ b/meta-openpower/common/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/common/recipes-phosphor/host/p9-vcs-workaround.bb b/meta-openpower/common/recipes-phosphor/host/p9-vcs-workaround.bb new file mode 100644 index 000000000..11ad79cb1 --- /dev/null +++ b/meta-openpower/common/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')}" diff --git a/meta-openpower/common/recipes-phosphor/initfs/obmc-phosphor-initfs.bbappend b/meta-openpower/common/recipes-phosphor/initfs/obmc-phosphor-initfs.bbappend new file mode 100644 index 000000000..283f0b15c --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/initfs/obmc-phosphor-initfs.bbappend @@ -0,0 +1 @@ +RDEPENDS_${PN} += "cf-fsi-firmware" diff --git a/meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest.bbappend b/meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest.bbappend new file mode 100644 index 000000000..72d991c7e --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json b/meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json new file mode 100644 index 000000000..9d955f22f --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json @@ -0,0 +1,14 @@ +{ + "urls": [ + "/org/openbmc/*", + "/org/open_power/*", + "/xyz/openbmc_project/*", + "/enumerate", + "/list", + "/login", + "/logout", + "/subscribe", + "/upload/image", + "/download/dump/*" + ] +} diff --git a/meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload.bb b/meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload.bb new file mode 100644 index 000000000..8dcd48973 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload.bb @@ -0,0 +1,31 @@ +SUMMARY = "Inventory upload" +DESCRIPTION = "Inventory upload." +HOMEPAGE = "http://github.com/openbmc/openpower-inventory-upload" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit allarch +inherit setuptools +inherit obmc-phosphor-systemd + +RDEPENDS_${PN} += " \ + python-dbus \ + python-pygobject \ + pyphosphor \ + dtc \ + " + +SRC_URI += "git://github.com/openbmc/openpower-inventory-upload" + +SRCREV = "c115852fb5aa0890373d8c2dfca9b9f7b1e06527" + +S = "${WORKDIR}/git" + +TMPL = "op-inventory-upload@.service" +INSTFMT = "op-inventory-upload@{0}.service" +TGTFMT = "obmc-host-start@{0}.target" +FMT = "../${TMPL}:${TGTFMT}.wants/${INSTFMT}" + +SYSTEMD_SERVICE_${PN} += "${TMPL}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service b/meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service new file mode 100644 index 000000000..022f6e73e --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/inventory-upload/inventory-upload/op-inventory-upload@.service @@ -0,0 +1,16 @@ +[Unit] +Description=Inventory Upload +Wants=obmc-host-start-pre@%i.target +Before=obmc-host-start-pre@%i.target +Conflicts=obmc-host-stop@%i.target + +[Service] +Restart=no +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env inventory_upload.py +SyslogIdentifier=inventory_upload.py +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config-native.bb b/meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config-native.bb new file mode 100644 index 000000000..31aee2d7c --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "Hostboot hostfw inventory map for phosphor-ipmi-fru" +PR = "r1" + +inherit native +inherit phosphor-ipmi-fru +inherit obmc-phosphor-license + +SRC_URI += "file://config.yaml" + +PROVIDES += "virtual/phosphor-ipmi-fru-hostfw-config" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${hostfw_datadir} + + install -d ${DEST} + install config.yaml ${DEST} +} diff --git a/meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config/config.yaml b/meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config/config.yaml new file mode 100644 index 000000000..2233913aa --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/hostboot-inventory-config/config.yaml @@ -0,0 +1,117 @@ +PROC: + EntityID: 3 + Interfaces: + xyz.openbmc_project.Inventory.Decorator.Asset: + BuildDate: + IPMIFruSection: Board + IPMIFruProperty: "Mfg Date" + Manufacturer: + IPMIFruSection: Board + IPMIFruProperty: "Manufacturer" + PartNumber: + IPMIFruSection: Board + IPMIFruProperty: "Part Number" + SerialNumber: + IPMIFruSection: Board + IPMIFruProperty: "Serial Number" + xyz.openbmc_project.Inventory.Item: + PrettyName: + IPMIFruSection: Board + IPMIFruProperty: "Name" + xyz.openbmc_project.Inventory.Decorator.Revision: + Version: + IPMIFruSection: Board + # Custom Field 2 is EC. + IPMIFruProperty: "Custom Field 2" + # Delimiter value in ascii as YAML parser + # was not allowing certain characters like ":" as value + IPMIFruValueDelimiter: "58" + xyz.openbmc_project.Inventory.Item.Cpu: + +SYS: + # same entity ID as it is Associated type of NODE + EntityID: 7 + Interfaces: + xyz.openbmc_project.Inventory.Decorator.Asset: + Model: + IPMIFruSection: Chassis + IPMIFruProperty: "Part Number" + SerialNumber: + IPMIFruSection: Chassis + IPMIFruProperty: "Serial Number" + xyz.openbmc_project.Inventory.Item.System: + +NODE: + EntityID: 7 + Interfaces: + xyz.openbmc_project.Inventory.Decorator.Asset: + BuildDate: + IPMIFruSection: Board + IPMIFruProperty: "Mfg Date" + Manufacturer: + IPMIFruSection: Board + IPMIFruProperty: "Manufacturer" + PartNumber: + IPMIFruSection: Board + IPMIFruProperty: "Part Number" + SerialNumber: + IPMIFruSection: Board + IPMIFruProperty: "Serial Number" + xyz.openbmc_project.Inventory.Item: + PrettyName: + IPMIFruSection: Board + IPMIFruProperty: "Name" + xyz.openbmc_project.Inventory.Item.Board: + AssociatedTypes: + - SYS + +DIMM: + EntityID: 32 + Interfaces: + xyz.openbmc_project.Inventory.Decorator.Asset: + BuildDate: + IPMIFruSection: Product + IPMIFruProperty: "Mfg Date" + Manufacturer: + IPMIFruSection: Product + IPMIFruProperty: "Manufacturer" + PartNumber: + IPMIFruSection: Product + IPMIFruProperty: "Part Number" + SerialNumber: + IPMIFruSection: Product + IPMIFruProperty: "Serial Number" + Model: + IPMIFruSection: Product + IPMIFruProperty: "Model Number" + xyz.openbmc_project.Inventory.Item: + PrettyName: + IPMIFruSection: Product + IPMIFruProperty: "Name" + xyz.openbmc_project.Inventory.Decorator.Revision: + Version: + IPMIFruSection: Product + IPMIFruProperty: "Version" + xyz.openbmc_project.Inventory.Item.Dimm: + +MEMBUFF: + EntityID: 8 + Interfaces: + xyz.openbmc_project.Inventory.Decorator.Asset: + BuildDate: + IPMIFruSection: Board + IPMIFruProperty: "Mfg Date" + Manufacturer: + IPMIFruSection: Board + IPMIFruProperty: "Manufacturer" + PartNumber: + IPMIFruSection: Board + IPMIFruProperty: "Part Number" + SerialNumber: + IPMIFruSection: Board + IPMIFruProperty: "Serial Number" + xyz.openbmc_project.Inventory.Item: + PrettyName: + IPMIFruSection: Board + IPMIFruProperty: "Name" + xyz.openbmc_project.Inventory.Item.MemoryBuffer: diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-error-native.bb b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-error-native.bb new file mode 100644 index 000000000..b02976074 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-error-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "Copy error yaml files to known path for elog parsing" + +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-dbus-yaml + +require openpower-ipmi-oem.inc + +S = "${WORKDIR}/git" + +do_install_append() { + SRC=${S}/org/open_power/OCC + DEST=${D}${yaml_dir}/org/open_power/OCC + install -d ${DEST} + install ${SRC}/Metrics.errors.yaml ${DEST} + install ${SRC}/Metrics.metadata.yaml ${DEST} +} diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw-native.bb b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw-native.bb new file mode 100644 index 000000000..3e434b52f --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw-native.bb @@ -0,0 +1,16 @@ +SUMMARY = "OEM sensor config for phosphor-host-ipmid" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-host + +SRC_URI += "file://openpower-config.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${sensor_yamldir} + install -d ${DEST} + install openpower-config.yaml ${DEST}/openpower-config.yaml +} diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw/openpower-config.yaml b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw/openpower-config.yaml new file mode 100644 index 000000000..cf61b0521 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-sensor-inventory-mrw/openpower-config.yaml @@ -0,0 +1,34 @@ +occ_active_sensor: + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + org.open_power.OCC.Status: + OccActive: + Offsets: + 0x00: + type: "bool" + assert: "false" + deassert: "true" + 0x01: + type: "bool" + assert: "true" + deassert: "false" + +hb_volatile_sensor: + path: /org/open_power/control/volatile + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.Object.Enable: + Enabled: + Offsets: + 0x00: + type: "bool" + assert: false + 0x01: + type: "bool" + assert: true diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist-native.bb b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist-native.bb new file mode 100644 index 000000000..425901894 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist-native.bb @@ -0,0 +1,6 @@ +SUMMARY = "Whitelisted OpenBMC IPMI OEM commands" +DESCRIPTION = "Whitelisted OpenBMC IPMI OEM commands for OpenPOWER based systems" + +inherit obmc-phosphor-license +inherit native +inherit phosphor-ipmi-host-whitelist \ No newline at end of file diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist/openpower-ipmi-oem-whitelist-native.conf b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist/openpower-ipmi-oem-whitelist-native.conf new file mode 100644 index 000000000..402056c67 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem-whitelist/openpower-ipmi-oem-whitelist-native.conf @@ -0,0 +1,2 @@ +#: +0x3A:0xF0 //: diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.bb b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.bb new file mode 100644 index 000000000..118c1c2b0 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.bb @@ -0,0 +1,35 @@ +SUMMARY = "Phosphor IPMI plugin for OpenPOWER OEM Commands" +DESCRIPTION = "Phosphor IPMI plugin for OpenPOWER OEM Commands" +PR = "r1" + +inherit autotools pkgconfig +inherit obmc-phosphor-license +inherit obmc-phosphor-ipmiprovider-symlink +inherit pythonnative + +require ${PN}.inc + +DEPENDS += "phosphor-ipmi-host" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-logging" +DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" +DEPENDS += "openpower-dbus-interfaces openpower-dbus-interfaces-native" +DEPENDS += "sdbus++-native" + +RDEPENDS_${PN} += " \ + sdbusplus \ + phosphor-logging \ + openpower-dbus-interfaces \ + phosphor-dbus-interfaces \ + " + +TARGET_CFLAGS += "-fpic" + +HOSTIPMI_PROVIDER_LIBRARY += "liboemhandler.so" + +S = "${WORKDIR}/git" + +FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" diff --git a/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.inc b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.inc new file mode 100644 index 000000000..784ff9c52 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/openpower-ipmi-oem.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/openpower-host-ipmi-oem" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" +SRC_URI += "git://github.com/openbmc/openpower-host-ipmi-oem" +SRCREV = "8fb3f03c0d34cfe89acb3f373fa820a53dc5ba35" diff --git a/meta-openpower/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bbappend b/meta-openpower/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bbappend new file mode 100644 index 000000000..ad56a88cd --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bbappend @@ -0,0 +1 @@ +OBMC_IPMI_SENSORS_PROVIDERS_append_df-openpower = " openpower-ipmi-oem-sensor-inventory-mrw-native" diff --git a/meta-openpower/common/recipes-phosphor/ipmi/phosphor-logging-error-logs-native.bbappend b/meta-openpower/common/recipes-phosphor/ipmi/phosphor-logging-error-logs-native.bbappend new file mode 100644 index 000000000..00d44c886 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/ipmi/phosphor-logging-error-logs-native.bbappend @@ -0,0 +1 @@ +DEPENDS_append_df-openpower = " openpower-ipmi-oem-error-native" diff --git a/meta-openpower/common/recipes-phosphor/logging/phosphor-logging.bbappend b/meta-openpower/common/recipes-phosphor/logging/phosphor-logging.bbappend new file mode 100644 index 000000000..e5de414f7 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/logging/phosphor-logging.bbappend @@ -0,0 +1,5 @@ +DEPENDS_append_df-openpower = " \ + openpower-debug-collector-native \ + openpower-dbus-interfaces-native \ + openpower-occ-control-native \ + " diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-example-native.bb b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-example-native.bb new file mode 100644 index 000000000..72b82a0b3 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-example-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "OpenPower OCC Control with example occ sensor IDs" +PR = "r1" + +inherit native +require openpower-occ-control.inc +inherit openpower-occ-control + +PROVIDES += "virtual/openpower-occ-control-config-native" + +S = "${WORKDIR}/git" + +# Copies example occ sensor ID yaml file +do_install() { + SRC=${S} + install -d ${YAML_DEST}/ + install -D ${SRC}/example/occ_sensor.yaml ${YAML_DEST}/occ_sensor.yaml +} diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-mrw-native.bb b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-mrw-native.bb new file mode 100644 index 000000000..e851ee1b3 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control-config-mrw-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "OpenPower OCC Control with MRW generated sensor IDs" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-occ-control +inherit mrw-xml + +PROVIDES += "virtual/openpower-occ-control-config-native" +DEPENDS += "mrw-native mrw-perl-tools-native" + +# Generate a YAML files based on MRW input +do_install_append() { + install -d ${YAML_DEST}/ + ${STAGING_BINDIR_NATIVE}/perl-native/perl \ + ${STAGING_BINDIR_NATIVE}/gen_occ_map.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -o ${YAML_DEST}/occ_sensor.yaml +} diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb new file mode 100644 index 000000000..18b298cc3 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb @@ -0,0 +1,111 @@ +SUMMARY = "OpenPOWER OCC controller" +DESCRIPTION = "Application to control the OpenPOWER On-Chip-Controller" +HOMEPAGE = "https://github.com/openbmc/openpower-occ-control" +PR = "r1" + +inherit autotools \ + pkgconfig \ + obmc-phosphor-dbus-service \ + pythonnative \ + phosphor-dbus-yaml + +require ${PN}.inc + +SRC_URI += "file://occ-active.sh" +do_install_append() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/occ-active.sh \ + ${D}${bindir}/occ-active.sh +} + +DBUS_SERVICE_${PN} += "org.open_power.OCC.Control.service" +SYSTEMD_SERVICE_${PN} += "op-occ-enable@.service" +SYSTEMD_SERVICE_${PN} += "op-occ-disable@.service" + +DEPENDS += "virtual/${PN}-config-native" +DEPENDS += " \ + sdbusplus \ + sdbusplus-native \ + phosphor-logging \ + openpower-dbus-interfaces \ + phosphor-dbus-interfaces \ + openpower-dbus-interfaces-native \ + autoconf-archive-native \ + obmc-targets \ + systemd \ + " + +RDEPENDS_${PN} += " \ + sdbusplus \ + phosphor-logging \ + openpower-dbus-interfaces \ + phosphor-dbus-interfaces \ + " + +EXTRA_OECONF = " \ + YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN} \ + PS_DERATING_FACTOR=${POWER_SUPPLY_DERATING_FACTOR} \ + " +EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}" + +OCC_ENABLE = "enable" +OCC_DISABLE = "disable" +HOST_START = "startmin" +HOST_STOP = "stop" + +# Ensure host-stop and host-startmin targets require needed occ states +OCC_TMPL = "op-occ-{0}@.service" +HOST_TGTFMT = "obmc-host-{1}@{2}.target" +OCC_INSTFMT = "op-occ-{0}@{2}.service" +HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}" + +# Set the occ disable service to be executed on host error +HOST_ERROR_TARGETS = "crash timeout" + +OCC_DISABLE_TMPL = "op-occ-disable@.service" +HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target" +OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service" +HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}" + +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}" + +S = "${WORKDIR}/git" + +# Remove packages not required for native build +DEPENDS_remove_class-native = " \ + phosphor-logging \ + obmc-targets \ + systemd \ + virtual/${PN}-config-native \ + " +# Remove packages not required for native SDK build +DEPENDS_remove_class-nativesdk = " \ + phosphor-logging \ + obmc-targets \ + systemd \ + virtual/${PN}-config-native \ + " + +# Provide a means to enable/disable install_error_yaml feature +PACKAGECONFIG ??= "install_error_yaml" +PACKAGECONFIG[install_error_yaml] = "\ + --enable-install_error_yaml,\ + --disable-install_error_yaml,\ + ,\ + " + +# Enable install_error_yaml during native and native SDK build +PACKAGECONFIG_add_class-native = "install_error_yaml" +PACKAGECONFIG_add_class-nativesdk = "install_error_yaml" + +# Disable install_error_yaml during target build +PACKAGECONFIG_remove_class-target = "install_error_yaml" + +# Disable generating elog error header file during bitbake. Applications +# should be using the elog header generated by phosphor-logging recipe +EXTRA_OECONF += "--disable-gen_errors" + +BBCLASSEXTEND += "native nativesdk" + diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.inc b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.inc new file mode 100644 index 000000000..a54412e4b --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/openpower-occ-control" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/openpower-occ-control" +SRCREV = "f7d9e76dc7094214ab11bb4cb21ff6bd853ce750" diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh new file mode 100755 index 000000000..a6097e527 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# set and unset occ active for all occ's in system + +if [ "$1" == "disable" ]; then + value='false' +elif [ "$1" == "enable" ]; then + value='true' +else + echo "Usage: occ-active.sh [argument]" + echo " enable - set occ's to active state" + echo " disable - set occ's to inactive state" + exit -1 +fi + +OCC_CONTROL_SERVICE="org.open_power.OCC.Control" + +busctl tree $OCC_CONTROL_SERVICE --list | grep occ | xargs -r -n1 -I{} \ + busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \ + OccActive b $value +exit 0 diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service new file mode 100644 index 000000000..0179a5083 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service @@ -0,0 +1,12 @@ +[Unit] +Description=OpenPOWER OCC Active Disable +Before=obmc-host-stop-pre@%i.target +Conflicts=op-occ-enable@%i.service + +[Service] +ExecStart=/usr/bin/env occ-active.sh disable +SyslogIdentifier=occ-active.sh +Type=oneshot + +[Install] +WantedBy=obmc-host-stop@%i.target diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service new file mode 100644 index 000000000..b97253cf0 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service @@ -0,0 +1,17 @@ +[Unit] +Description=OpenPOWER OCC Active Enable for host %I +Conflicts=obmc-host-stop@%i.target +Conflicts=op-occ-disable@%i.service +Wants=org.open_power.OCC.Control.service +After=org.open_power.OCC.Control.service +Wants=fsi-scan@%i.service +After=fsi-scan@%i.service +ConditionPathExists=/run/openbmc/host@%i-on + +[Service] +ExecStart=/usr/bin/env occ-active.sh enable +SyslogIdentifier=occ-active.sh +Type=oneshot + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service new file mode 100644 index 000000000..a63e18611 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service @@ -0,0 +1,14 @@ +[Unit] +Description=OpenPOWER OCC controller +Wants=mapper-wait@-xyz-openbmc_project-inventory.service +After=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +ExecStart=/usr/bin/env openpower-occ-control +SyslogIdentifier=openpower-occ-control +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-openpower/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/meta-openpower/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend new file mode 100644 index 000000000..adccb9b12 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/packagegroups/nativesdk-packagegroup-sdk-host.bbappend @@ -0,0 +1,4 @@ +RDEPENDS_${PN}_append_df-openpower = " \ + nativesdk-openpower-dbus-interfaces-yaml \ + nativesdk-openpower-debug-collector-yaml \ + " diff --git a/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend new file mode 100644 index 000000000..7eb88fb71 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend @@ -0,0 +1,24 @@ +RDEPENDS_${PN}-extrasdevtools_append_df-openpower = " obmc-pydevtools" + +# Add the deprecated /org/openbmc inventory namespace providing +# obmc-mgr-inventory application to the inventory packagegroup +# until all applications have been updated to use the new, +# officially spec'ed xyz.openbmc_project.Inventory.Manager +# provider (VIRTUAL-RUNTIME_obmc-inventory-manager). +RDEPENDS_${PN}-inventory_append_df-openpower = " obmc-mgr-inventory" + +# Add the deprecated /org/openbmc sensor namespace providing +# the obmc-mgr-sensor application to the sensor +# packagegroup until all applications have been updated to use +# the new, officially spec'ed xyz.openbmc_project.SensorValue +# providers (VIRTUAL-RUNTIME_obmc-sensor-hwmon). +RDEPENDS_${PN}-sensors_append_df-openpower = " obmc-mgr-sensor" + +# Add checkstop monitor as part of host state management package +# This will kick start a gpio monitor that will catch the +# host checkstop conditions and takes necessary actions +RDEPENDS_${PN}-host-state-mgmt_append_df-openpower = " checkstop-monitor" + +# Add openpower debug collector as a requirement for state-mgmt +# since it is used during checkstop handling. +RDEPENDS_${PN}-host-state-mgmt_append_df-openpower = " openpower-debug-collector" diff --git a/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bbappend b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bbappend new file mode 100644 index 000000000..20e12e618 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bbappend @@ -0,0 +1 @@ +VIRTUAL-RUNTIME_phosphor-ipmi-providers_append_df-openpower = " openpower-ipmi-oem" diff --git a/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bbappend b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bbappend new file mode 100644 index 000000000..5ba7c47eb --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bbappend @@ -0,0 +1,5 @@ +RDEPENDS_${PN}_append_df-openpower = " \ + pflash \ + gard \ + fsidbg \ + " diff --git a/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb new file mode 100644 index 000000000..fa5e5350a --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb @@ -0,0 +1,61 @@ +SUMMARY = "OpenBMC for OpenPOWER - Applications" +PR = "r1" + +inherit packagegroup +inherit obmc-phosphor-license +inherit obmc-phosphor-utils + +PROVIDES = "${PACKAGES}" +PACKAGES = " \ + ${PN}-chassis \ + ${PN}-fans \ + ${PN}-flash \ + ${PN}-system \ + " + +PROVIDES += "virtual/obmc-chassis-mgmt" +PROVIDES += "virtual/obmc-fan-mgmt" +PROVIDES += "virtual/obmc-flash-mgmt" +PROVIDES += "virtual/obmc-system-mgmt" + +RPROVIDES_${PN}-chassis += "virtual-obmc-chassis-mgmt" +RPROVIDES_${PN}-fans += "virtual-obmc-fan-mgmt" +RPROVIDES_${PN}-flash += "virtual-obmc-flash-mgmt" +RPROVIDES_${PN}-system += "virtual-obmc-system-mgmt" + +SUMMARY_${PN}-chassis = "OpenPOWER Chassis" +RDEPENDS_${PN}-chassis = " \ + obmc-button-power \ + obmc-button-reset \ + obmc-control-chassis \ + obmc-op-control-power \ + obmc-pcie-detect \ + obmc-host-failure-reboots \ + " +#Pull in obmc-fsi on all P9 OpenPOWER systems +RDEPENDS_${PN}-chassis += "${@mf_enabled(d, 'op-fsi', 'op-fsi')}" + +#Pull in p9-cfam-override on all P9 OpenPOWER systems +RDEPENDS_${PN}-chassis += "${@mf_enabled(d, 'p9-cfam-override', 'p9-cfam-override')}" + +SUMMARY_${PN}-fans = "OpenPOWER Fans" +RDEPENDS_${PN}-fans = " \ + obmc-control-fan \ + " + +SUMMARY_${PN}-flash = "OpenPOWER Flash" +RDEPENDS_${PN}-flash = " \ + obmc-flash-bios \ + obmc-mgr-download \ + obmc-op-flasher \ + " +RDEPENDS_${PN}-flash_df-openpower-ubi-fs = " \ + openpower-software-manager \ + " + +SUMMARY_${PN}-system = "OpenPOWER System" +RDEPENDS_${PN}-system = " \ + obmc-mgr-system \ + hostboot-settings \ + pdbg \ + " diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb new file mode 100644 index 000000000..8f9bd050b --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example-native.bb @@ -0,0 +1,22 @@ +SUMMARY = "Inventory config for openpower-vpd-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-fru-vpd + +SRC_URI += "file://inventory" + +PROVIDES += "virtual/openpower-fru-inventory" + +S = "${WORKDIR}" + +do_install() { + # This recipe is supposed to create a systemd environment file + # with values for FRU types and paths. This example recipe + # uses a pre-defined file ($PN/inventory). + + DEST=${D}${inventory_datadir_native} + install -d ${DEST} + install inventory ${DEST} +} diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory new file mode 100644 index 000000000..1f6a5e349 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-example/inventory @@ -0,0 +1,2 @@ +FRUS=BMC +PATHS=/system/chassis/bmc diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb new file mode 100644 index 000000000..6eb76ac4e --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-inventory-mrw-native.bb @@ -0,0 +1,28 @@ +SUMMARY = "Inventory config for openpower-vpd-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-fru-vpd +inherit mrw-xml + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + virtual/openpower-fru-vpd-layout \ + " + +PROVIDES += "virtual/openpower-fru-inventory" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${inventory_datadir_native} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_openpower_fru.pl \ + -m ${mrw_datadir}/${MRW_XML} \ + -c ${vpdlayout_datadir}/layout.yaml \ + -o ${DEST}/inventory +} diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb new file mode 100644 index 000000000..7ed83b3a4 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example-native.bb @@ -0,0 +1,22 @@ +SUMMARY = "FRU properties config for openpower-vpd-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-fru-vpd + +SRC_URI += "file://example.yaml" + +PROVIDES += "virtual/openpower-fru-properties" + +S = "${WORKDIR}" + +do_install() { + # This recipe is supposed to create an output yaml file with + # FRU property values extracted from the MRW. This example recipe + # provides a sample output file. + + DEST=${D}${properties_datadir} + install -d ${DEST} + install example.yaml ${DEST}/out.yaml +} diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml new file mode 100644 index 000000000..6ec9b0c35 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-example/example.yaml @@ -0,0 +1,6 @@ +/system/chassis/motherboard/boxelder/bmc: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' +/system/chassis/motherboard/boxelder/bmc/ethernet: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb new file mode 100644 index 000000000..2dc5820e3 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw-native.bb @@ -0,0 +1,29 @@ +SUMMARY = "FRU properties config for openpower-vpd-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit openpower-fru-vpd +inherit mrw-xml + +SRC_URI += "file://config.yaml" + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/openpower-fru-properties" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${properties_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_fru_properties.pl \ + -m ${mrw_datadir}/${MRW_XML} \ + -c config.yaml \ + -o ${DEST}/out.yaml +} diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml new file mode 100644 index 000000000..7a9f34ec5 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-properties-mrw/config.yaml @@ -0,0 +1,11 @@ +BMC: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' + +ETHERNET: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb new file mode 100644 index 000000000..de0cc649f --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "VPD layout for openpower-fru-vpd" +PR = "r1" + +inherit native +inherit openpower-fru-vpd +inherit obmc-phosphor-license + +SRC_URI += "file://layout.yaml" + +PROVIDES += "virtual/openpower-fru-vpd-layout" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${vpdlayout_datadir} + + install -d ${DEST} + install layout.yaml ${DEST} +} diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml new file mode 100644 index 000000000..9aa746232 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd-layout/layout.yaml @@ -0,0 +1,15 @@ +BMC: + xyz.openbmc_project.Inventory.Decorator.Asset: + OPFR,VP: PartNumber + OPFR,VS: SerialNumber + OPFR,VN: Manufacturer + xyz.openbmc_project.Inventory.Item: + VINI,DR: PrettyName + xyz.openbmc_project.Common.UUID: + OPFR,UD: UUID + xyz.openbmc_project.Inventory.Item.Bmc: +ETHERNET: + xyz.openbmc_project.Inventory.Item.NetworkInterface: + VINI,B1: MACAddress + OPFR,B1: MACAddress + xyz.openbmc_project.Inventory.Item.Ethernet: diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb new file mode 100644 index 000000000..4d7114a73 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.bb @@ -0,0 +1,47 @@ +SUMMARY = "Parser for OpenPOWER-format FRU VPD" +DESCRIPTION = "Parse OpenPOWER-format FRU VPD and update inventory" +PR = "r1" + +inherit autotools pkgconfig +inherit openpower-fru-vpd +inherit pythonnative +inherit obmc-phosphor-systemd + +require ${PN}.inc + +SRC_URI += "file://70-op-vpd.rules" + +DEPENDS += " \ + virtual/openpower-fru-vpd-layout \ + virtual/openpower-fru-inventory \ + virtual/openpower-fru-properties \ + sdbusplus \ + phosphor-logging \ + python-mako-native \ + python-pyyaml-native \ + autoconf-archive-native \ + " + +RDEPENDS_${PN} += " \ + sdbusplus \ + phosphor-logging \ + " + +SYSTEMD_SERVICE_${PN} += "op-vpd-parser.service" + +S = "${WORKDIR}/git" + +EXTRA_OECONF = " \ + FRU_YAML=${STAGING_DIR_NATIVE}${vpdlayout_datadir}/layout.yaml \ + PROP_YAML=${STAGING_DIR_NATIVE}${properties_datadir}/out.yaml \ + " + +do_install_append() { + SRC=${STAGING_DATADIR_NATIVE}${inventory_datadir_name} + DEST=${D}${inventory_envdir} + install -d ${DEST} + install ${SRC}/inventory ${DEST} + + install -d ${D}/${base_libdir}/udev/rules.d/ + install ${WORKDIR}/70-op-vpd.rules ${D}/${base_libdir}/udev/rules.d/ +} diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc new file mode 100644 index 000000000..db1b736d6 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/openpower-vpd-parser" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/openpower-vpd-parser" +SRCREV = "0097cced1f5633d14e3304fbcc6279e7026c3abf" diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules new file mode 100644 index 000000000..4b86b9186 --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules @@ -0,0 +1 @@ +SUBSYSTEM=="i2c", ENV{OF_NAME}=="eeprom", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="op-vpd-parser" diff --git a/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service new file mode 100644 index 000000000..6eadebf8d --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/vpd/openpower-fru-vpd/op-vpd-parser.service @@ -0,0 +1,12 @@ +[Unit] +Description=Read OpenPOWER-format VPD from EEPROM +ConditionFileNotEmpty={envfiledir}/obmc/inventory +Wants=mapper-wait@-xyz-openbmc_project-inventory.service +After=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +Restart=no +Type=oneshot +EnvironmentFile={envfiledir}/obmc/inventory +ExecStart=/usr/bin/env openpower-read-vpd --vpd $EEPROM --fru $FRUS --object $PATHS +SyslogIdentifier=openpower-read-vpd diff --git a/meta-openpower/common/recipes-phosphor/webui/phosphor-webui.bbappend b/meta-openpower/common/recipes-phosphor/webui/phosphor-webui.bbappend new file mode 100644 index 000000000..ea818947e --- /dev/null +++ b/meta-openpower/common/recipes-phosphor/webui/phosphor-webui.bbappend @@ -0,0 +1,16 @@ +do_install_append () { + +# The webui content is served as pre-compressed gzip content. While nginx can +# handle this via the gzip_static directive (and we use that), the nginx +# try_files directive (which we also use) searches the URI as-is. The suggested +# workaround is to have an empty uncompressed file with the same name as the +# compressed file. This does not impact the functionality of gzip_static. +# So for eg if there's an index.html.gz, create an empty index.html. Same goes +# for all the webui content. +# https://serverfault.com/questions/571733/nginx-gzip-static-why-are-the-non-compressed-files-required +# https://www.ruby-forum.com/topic/4402481 +# https://trac.nginx.org/nginx/ticket/1367 + +find ${D}${datadir}/www -type f -name '*.gz' -exec sh -c 'touch `dirname "$0"`/`basename "$0" .gz`' '{}' \; + +} -- cgit v1.2.3