blob: 7a814628cf57745d2307814e14215cf2d709e19b [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
Patrick Williams57b76242021-08-11 15:27:06 -050015DBUS_SERVICE:${PN} += "org.open_power.OCC.Control.service"
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000016SYSTEMD_SERVICE:${PN} += "op-occ-enable@.service"
17SYSTEMD_SERVICE:${PN} += "op-occ-disable@.service"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050018
Vishwanatha Subbannafcf50762017-08-09 15:00:34 +053019DEPENDS += "virtual/${PN}-config-native"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050020DEPENDS += " \
21 sdbusplus \
Patrick Williamsba5282b2020-03-31 16:43:15 -050022 ${PYTHON_PN}-sdbus++-native \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050023 phosphor-logging \
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050024 phosphor-dbus-interfaces \
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050025 systemd \
Eddie James64e28192020-03-05 09:28:18 -060026 ${PYTHON_PN}-native \
27 ${PYTHON_PN}-pyyaml-native \
28 ${PYTHON_PN}-setuptools-native \
29 ${PYTHON_PN}-mako-native \
Eddie Jamesdd8f6522022-12-09 09:45:25 -060030 nlohmann-json \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050031 "
32
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000033RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060034
Eddie James88f28f62021-10-20 16:41:29 -050035EXTRA_OEMESON = " \
36 -Dyamldir=${STAGING_DATADIR_NATIVE}/${PN} \
37 -Dps-derating-factor=${POWER_SUPPLY_DERATING_FACTOR} \
Nan Zhoud6c0eef2022-07-27 02:26:22 +000038 -Dtests=disabled \
Matt Spinler25c9a632018-03-09 10:54:09 -060039 "
Patrick Williams8c561ee2021-10-22 14:20:12 -050040EXTRA_OEMESON:append = "${@bb.utils.contains('MACHINE_FEATURES', 'i2c-occ', ' -Di2c-occ=enabled', '', d)}"
Lei YU80caf062017-07-20 15:25:28 +080041
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053042OCC_ENABLE = "enable"
43OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070044HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053045HOST_STOP = "stop"
46
Andrew Geissler109ae012020-03-31 13:47:05 -050047# Ensure host-stop and host-startmin targets wants needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053048OCC_TMPL = "op-occ-{0}@.service"
49HOST_TGTFMT = "obmc-host-{1}@{2}.target"
50OCC_INSTFMT = "op-occ-{0}@{2}.service"
Andrew Geissler109ae012020-03-31 13:47:05 -050051HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.wants/${OCC_INSTFMT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050052SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
53SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050054
Edward A. Jamesbb022b92017-11-01 16:26:54 -050055# Set the occ disable service to be executed on host error
56HOST_ERROR_TARGETS = "crash timeout"
57
58OCC_DISABLE_TMPL = "op-occ-disable@.service"
59HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
60OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
61HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
62
Patrick Williamse83c2202021-09-01 16:17:33 -050063SYSTEMD_LINK:${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
Edward A. Jamesbb022b92017-11-01 16:26:54 -050064
Deepak Kodihallif98bd112017-03-24 07:44:16 -050065S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060066
67# Remove packages not required for native build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000068DEPENDS:remove:class-native = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060069 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060070 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050071 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060072 virtual/${PN}-config-native \
73 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060074RDEPENDS:${PN}:remove:class-native = "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060075
Marri Devender Raob867da72017-12-29 06:01:11 -060076# Remove packages not required for native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000077DEPENDS:remove:class-nativesdk = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060078 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060079 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050080 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060081 virtual/${PN}-config-native \
82 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060083RDEPENDS:${PN}:remove:class-nativesdk = "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060084
Marri Devender Raob867da72017-12-29 06:01:11 -060085BBCLASSEXTEND += "native nativesdk"