blob: 83e7e09d7f73c94fed43a6373e13724910200d03 [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 \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050025 autoconf-archive-native \
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050026 systemd \
Eddie James64e28192020-03-05 09:28:18 -060027 ${PYTHON_PN}-native \
28 ${PYTHON_PN}-pyyaml-native \
29 ${PYTHON_PN}-setuptools-native \
30 ${PYTHON_PN}-mako-native \
Eddie Jamesdd8f6522022-12-09 09:45:25 -060031 nlohmann-json \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050032 "
33
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000034RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060035
Eddie James88f28f62021-10-20 16:41:29 -050036EXTRA_OEMESON = " \
37 -Dyamldir=${STAGING_DATADIR_NATIVE}/${PN} \
38 -Dps-derating-factor=${POWER_SUPPLY_DERATING_FACTOR} \
Nan Zhoud6c0eef2022-07-27 02:26:22 +000039 -Dtests=disabled \
Matt Spinler25c9a632018-03-09 10:54:09 -060040 "
Patrick Williams8c561ee2021-10-22 14:20:12 -050041EXTRA_OEMESON:append = "${@bb.utils.contains('MACHINE_FEATURES', 'i2c-occ', ' -Di2c-occ=enabled', '', d)}"
Lei YU80caf062017-07-20 15:25:28 +080042
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053043OCC_ENABLE = "enable"
44OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070045HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053046HOST_STOP = "stop"
47
Andrew Geissler109ae012020-03-31 13:47:05 -050048# Ensure host-stop and host-startmin targets wants needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053049OCC_TMPL = "op-occ-{0}@.service"
50HOST_TGTFMT = "obmc-host-{1}@{2}.target"
51OCC_INSTFMT = "op-occ-{0}@{2}.service"
Andrew Geissler109ae012020-03-31 13:47:05 -050052HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.wants/${OCC_INSTFMT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050053SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
54SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050055
Edward A. Jamesbb022b92017-11-01 16:26:54 -050056# Set the occ disable service to be executed on host error
57HOST_ERROR_TARGETS = "crash timeout"
58
59OCC_DISABLE_TMPL = "op-occ-disable@.service"
60HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
61OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
62HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
63
Patrick Williamse83c2202021-09-01 16:17:33 -050064SYSTEMD_LINK:${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
Edward A. Jamesbb022b92017-11-01 16:26:54 -050065
Deepak Kodihallif98bd112017-03-24 07:44:16 -050066S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060067
68# Remove packages not required for native build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000069DEPENDS:remove:class-native = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060070 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060071 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050072 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060073 virtual/${PN}-config-native \
74 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060075RDEPENDS:${PN}:remove:class-native = "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060076
Marri Devender Raob867da72017-12-29 06:01:11 -060077# Remove packages not required for native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000078DEPENDS:remove:class-nativesdk = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060079 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060080 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050081 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060082 virtual/${PN}-config-native \
83 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060084RDEPENDS:${PN}:remove:class-nativesdk = "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060085
Marri Devender Raob867da72017-12-29 06:01:11 -060086BBCLASSEXTEND += "native nativesdk"