blob: 593b52b11cb9c726994352a93ba6ca28ccb4cba0 [file] [log] [blame]
Deepak Kodihallif98bd112017-03-24 07:44:16 -05001SUMMARY = "OpenPOWER OCC controller"
Gunnar Mills8b8ba532018-06-13 15:54:55 -05002DESCRIPTION = "Application to control the OpenPOWER On-Chip-Controller"
Deepak Kodihallif98bd112017-03-24 07:44:16 -05003HOMEPAGE = "https://github.com/openbmc/openpower-occ-control"
4PR = "r1"
Patrick Venturef30336b2018-10-17 07:51:18 -07005PV = "1.0+git${SRCPV}"
Deepak Kodihallif98bd112017-03-24 07:44:16 -05006
Eddie James88f28f62021-10-20 16:41:29 -05007inherit meson \
Deepak Kodihalli615bdc12017-04-06 23:50:34 -05008 pkgconfig \
Vishwanatha Subbanna359eee82017-05-04 09:45:29 -05009 obmc-phosphor-dbus-service \
Eddie James8b68ec72020-02-21 15:44:39 +000010 python3native \
Marri Devender Raobdaa6d22018-01-17 11:34:02 -060011 phosphor-dbus-yaml
Deepak Kodihallif98bd112017-03-24 07:44:16 -050012
Patrick Williams6c9e0142020-04-03 15:45:27 -050013require ${BPN}.inc
Deepak Kodihallif98bd112017-03-24 07:44:16 -050014
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050015SRC_URI += "file://occ-active.sh"
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000016do_install:append() {
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050017 install -d ${D}${bindir}
18 install -m 0755 ${WORKDIR}/occ-active.sh \
19 ${D}${bindir}/occ-active.sh
20}
21
Patrick Williams57b76242021-08-11 15:27:06 -050022DBUS_SERVICE:${PN} += "org.open_power.OCC.Control.service"
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000023SYSTEMD_SERVICE:${PN} += "op-occ-enable@.service"
24SYSTEMD_SERVICE:${PN} += "op-occ-disable@.service"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050025
Vishwanatha Subbannafcf50762017-08-09 15:00:34 +053026DEPENDS += "virtual/${PN}-config-native"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050027DEPENDS += " \
28 sdbusplus \
Patrick Williamsba5282b2020-03-31 16:43:15 -050029 ${PYTHON_PN}-sdbus++-native \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050030 phosphor-logging \
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050031 phosphor-dbus-interfaces \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050032 autoconf-archive-native \
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050033 systemd \
Eddie James64e28192020-03-05 09:28:18 -060034 ${PYTHON_PN}-native \
35 ${PYTHON_PN}-pyyaml-native \
36 ${PYTHON_PN}-setuptools-native \
37 ${PYTHON_PN}-mako-native \
Eddie Jamesdd8f6522022-12-09 09:45:25 -060038 nlohmann-json \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050039 "
40
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000041RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060042
Eddie James88f28f62021-10-20 16:41:29 -050043EXTRA_OEMESON = " \
44 -Dyamldir=${STAGING_DATADIR_NATIVE}/${PN} \
45 -Dps-derating-factor=${POWER_SUPPLY_DERATING_FACTOR} \
Nan Zhoud6c0eef2022-07-27 02:26:22 +000046 -Dtests=disabled \
Matt Spinler25c9a632018-03-09 10:54:09 -060047 "
Patrick Williams8c561ee2021-10-22 14:20:12 -050048EXTRA_OEMESON:append = "${@bb.utils.contains('MACHINE_FEATURES', 'i2c-occ', ' -Di2c-occ=enabled', '', d)}"
Lei YU80caf062017-07-20 15:25:28 +080049
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053050OCC_ENABLE = "enable"
51OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070052HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053053HOST_STOP = "stop"
54
Andrew Geissler109ae012020-03-31 13:47:05 -050055# Ensure host-stop and host-startmin targets wants needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053056OCC_TMPL = "op-occ-{0}@.service"
57HOST_TGTFMT = "obmc-host-{1}@{2}.target"
58OCC_INSTFMT = "op-occ-{0}@{2}.service"
Andrew Geissler109ae012020-03-31 13:47:05 -050059HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.wants/${OCC_INSTFMT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050060SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
61SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050062
Edward A. Jamesbb022b92017-11-01 16:26:54 -050063# Set the occ disable service to be executed on host error
64HOST_ERROR_TARGETS = "crash timeout"
65
66OCC_DISABLE_TMPL = "op-occ-disable@.service"
67HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
68OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
69HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
70
Patrick Williamse83c2202021-09-01 16:17:33 -050071SYSTEMD_LINK:${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
Edward A. Jamesbb022b92017-11-01 16:26:54 -050072
Deepak Kodihallif98bd112017-03-24 07:44:16 -050073S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060074
75# Remove packages not required for native build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000076DEPENDS:remove:class-native = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060077 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060078 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050079 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060080 virtual/${PN}-config-native \
81 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060082RDEPENDS:${PN}:remove:class-native = "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060083
Marri Devender Raob867da72017-12-29 06:01:11 -060084# Remove packages not required for native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000085DEPENDS:remove:class-nativesdk = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060086 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060087 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050088 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060089 virtual/${PN}-config-native \
90 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060091RDEPENDS:${PN}:remove:class-nativesdk = "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060092
93# Provide a means to enable/disable install_error_yaml feature
94PACKAGECONFIG ??= "install_error_yaml"
95PACKAGECONFIG[install_error_yaml] = "\
Eddie James88f28f62021-10-20 16:41:29 -050096 -Dinstall-error-yaml=enabled,\
97 -Dinstall-error-yaml=disabled,\
Marri Devender Raob867da72017-12-29 06:01:11 -060098 ,\
99 "
100
101# Enable install_error_yaml during native and native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000102PACKAGECONFIG:add:class-native = "install_error_yaml"
103PACKAGECONFIG:add:class-nativesdk = "install_error_yaml"
Marri Devender Raob867da72017-12-29 06:01:11 -0600104
105# Disable install_error_yaml during target build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000106PACKAGECONFIG:remove:class-target = "install_error_yaml"
Marri Devender Raob867da72017-12-29 06:01:11 -0600107
Marri Devender Raob867da72017-12-29 06:01:11 -0600108BBCLASSEXTEND += "native nativesdk"