Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 1 | SUMMARY = "OpenPOWER OCC controller" |
Gunnar Mills | 8b8ba53 | 2018-06-13 15:54:55 -0500 | [diff] [blame] | 2 | DESCRIPTION = "Application to control the OpenPOWER On-Chip-Controller" |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 3 | HOMEPAGE = "https://github.com/openbmc/openpower-occ-control" |
| 4 | PR = "r1" |
Patrick Venture | f30336b | 2018-10-17 07:51:18 -0700 | [diff] [blame] | 5 | PV = "1.0+git${SRCPV}" |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 6 | |
Eddie James | 88f28f6 | 2021-10-20 16:41:29 -0500 | [diff] [blame] | 7 | inherit meson \ |
Deepak Kodihalli | 615bdc1 | 2017-04-06 23:50:34 -0500 | [diff] [blame] | 8 | pkgconfig \ |
Vishwanatha Subbanna | 359eee8 | 2017-05-04 09:45:29 -0500 | [diff] [blame] | 9 | obmc-phosphor-dbus-service \ |
Eddie James | 8b68ec7 | 2020-02-21 15:44:39 +0000 | [diff] [blame] | 10 | python3native \ |
Marri Devender Rao | bdaa6d2 | 2018-01-17 11:34:02 -0600 | [diff] [blame] | 11 | phosphor-dbus-yaml |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 12 | |
Patrick Williams | 6c9e014 | 2020-04-03 15:45:27 -0500 | [diff] [blame] | 13 | require ${BPN}.inc |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 14 | |
Andrew Geissler | 4cd9d0a | 2017-08-15 14:04:51 -0500 | [diff] [blame] | 15 | SRC_URI += "file://occ-active.sh" |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 16 | do_install:append() { |
Andrew Geissler | 4cd9d0a | 2017-08-15 14:04:51 -0500 | [diff] [blame] | 17 | install -d ${D}${bindir} |
| 18 | install -m 0755 ${WORKDIR}/occ-active.sh \ |
| 19 | ${D}${bindir}/occ-active.sh |
| 20 | } |
| 21 | |
Patrick Williams | 57b7624 | 2021-08-11 15:27:06 -0500 | [diff] [blame] | 22 | DBUS_SERVICE:${PN} += "org.open_power.OCC.Control.service" |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 23 | SYSTEMD_SERVICE:${PN} += "op-occ-enable@.service" |
| 24 | SYSTEMD_SERVICE:${PN} += "op-occ-disable@.service" |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 25 | |
Vishwanatha Subbanna | fcf5076 | 2017-08-09 15:00:34 +0530 | [diff] [blame] | 26 | DEPENDS += "virtual/${PN}-config-native" |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 27 | DEPENDS += " \ |
| 28 | sdbusplus \ |
Patrick Williams | ba5282b | 2020-03-31 16:43:15 -0500 | [diff] [blame] | 29 | ${PYTHON_PN}-sdbus++-native \ |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 30 | phosphor-logging \ |
Vishwanatha Subbanna | 5f74f13 | 2017-07-07 02:55:58 -0500 | [diff] [blame] | 31 | phosphor-dbus-interfaces \ |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 32 | autoconf-archive-native \ |
Andrew Geissler | 4cd9d0a | 2017-08-15 14:04:51 -0500 | [diff] [blame] | 33 | systemd \ |
Eddie James | 64e2819 | 2020-03-05 09:28:18 -0600 | [diff] [blame] | 34 | ${PYTHON_PN}-native \ |
| 35 | ${PYTHON_PN}-pyyaml-native \ |
| 36 | ${PYTHON_PN}-setuptools-native \ |
| 37 | ${PYTHON_PN}-mako-native \ |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 38 | " |
| 39 | |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 40 | RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets" |
Andrew Geissler | 5c45985 | 2020-02-10 08:19:46 -0600 | [diff] [blame] | 41 | |
Eddie James | 88f28f6 | 2021-10-20 16:41:29 -0500 | [diff] [blame] | 42 | EXTRA_OEMESON = " \ |
| 43 | -Dyamldir=${STAGING_DATADIR_NATIVE}/${PN} \ |
| 44 | -Dps-derating-factor=${POWER_SUPPLY_DERATING_FACTOR} \ |
Matt Spinler | 25c9a63 | 2018-03-09 10:54:09 -0600 | [diff] [blame] | 45 | " |
Patrick Williams | 8c561ee | 2021-10-22 14:20:12 -0500 | [diff] [blame^] | 46 | EXTRA_OEMESON:append = "${@bb.utils.contains('MACHINE_FEATURES', 'i2c-occ', ' -Di2c-occ=enabled', '', d)}" |
Lei YU | 80caf06 | 2017-07-20 15:25:28 +0800 | [diff] [blame] | 47 | |
Vishwanatha Subbanna | 79bc0a4 | 2017-08-22 21:34:43 +0530 | [diff] [blame] | 48 | OCC_ENABLE = "enable" |
| 49 | OCC_DISABLE = "disable" |
Andrew Geissler | 5c76e0c | 2018-03-27 13:56:26 -0700 | [diff] [blame] | 50 | HOST_START = "startmin" |
Vishwanatha Subbanna | 79bc0a4 | 2017-08-22 21:34:43 +0530 | [diff] [blame] | 51 | HOST_STOP = "stop" |
| 52 | |
Andrew Geissler | 109ae01 | 2020-03-31 13:47:05 -0500 | [diff] [blame] | 53 | # Ensure host-stop and host-startmin targets wants needed occ states |
Vishwanatha Subbanna | 79bc0a4 | 2017-08-22 21:34:43 +0530 | [diff] [blame] | 54 | OCC_TMPL = "op-occ-{0}@.service" |
| 55 | HOST_TGTFMT = "obmc-host-{1}@{2}.target" |
| 56 | OCC_INSTFMT = "op-occ-{0}@{2}.service" |
Andrew Geissler | 109ae01 | 2020-03-31 13:47:05 -0500 | [diff] [blame] | 57 | HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.wants/${OCC_INSTFMT}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 58 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}" |
| 59 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}" |
Andrew Geissler | 4cd9d0a | 2017-08-15 14:04:51 -0500 | [diff] [blame] | 60 | |
Edward A. James | bb022b9 | 2017-11-01 16:26:54 -0500 | [diff] [blame] | 61 | # Set the occ disable service to be executed on host error |
| 62 | HOST_ERROR_TARGETS = "crash timeout" |
| 63 | |
| 64 | OCC_DISABLE_TMPL = "op-occ-disable@.service" |
| 65 | HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target" |
| 66 | OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service" |
| 67 | HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}" |
| 68 | |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 69 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}" |
Edward A. James | bb022b9 | 2017-11-01 16:26:54 -0500 | [diff] [blame] | 70 | |
Deepak Kodihalli | f98bd11 | 2017-03-24 07:44:16 -0500 | [diff] [blame] | 71 | S = "${WORKDIR}/git" |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 72 | |
| 73 | # Remove packages not required for native build |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 74 | DEPENDS:remove:class-native = " \ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 75 | phosphor-logging \ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 76 | systemd \ |
Patrick Williams | 1470846 | 2020-04-08 07:25:26 -0500 | [diff] [blame] | 77 | sdbusplus \ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 78 | virtual/${PN}-config-native \ |
| 79 | " |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 80 | RDEPENDS:${PN}:remove:class-native += "phosphor-state-manager-obmc-targets" |
Andrew Geissler | 5c45985 | 2020-02-10 08:19:46 -0600 | [diff] [blame] | 81 | |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 82 | # Remove packages not required for native SDK build |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 83 | DEPENDS:remove:class-nativesdk = " \ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 84 | phosphor-logging \ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 85 | systemd \ |
Patrick Williams | 1470846 | 2020-04-08 07:25:26 -0500 | [diff] [blame] | 86 | sdbusplus \ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 87 | virtual/${PN}-config-native \ |
| 88 | " |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 89 | RDEPENDS:${PN}:remove:class-nativesdk += "phosphor-state-manager-obmc-targets" |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 90 | |
| 91 | # Provide a means to enable/disable install_error_yaml feature |
| 92 | PACKAGECONFIG ??= "install_error_yaml" |
| 93 | PACKAGECONFIG[install_error_yaml] = "\ |
Eddie James | 88f28f6 | 2021-10-20 16:41:29 -0500 | [diff] [blame] | 94 | -Dinstall-error-yaml=enabled,\ |
| 95 | -Dinstall-error-yaml=disabled,\ |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 96 | ,\ |
| 97 | " |
| 98 | |
| 99 | # Enable install_error_yaml during native and native SDK build |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 100 | PACKAGECONFIG:add:class-native = "install_error_yaml" |
| 101 | PACKAGECONFIG:add:class-nativesdk = "install_error_yaml" |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 102 | |
| 103 | # Disable install_error_yaml during target build |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 104 | PACKAGECONFIG:remove:class-target = "install_error_yaml" |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 105 | |
Marri Devender Rao | b867da7 | 2017-12-29 06:01:11 -0600 | [diff] [blame] | 106 | BBCLASSEXTEND += "native nativesdk" |