blob: 10d495bc3697411a3c9c3e6328f85e95889984e3 [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 \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050038 "
39
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000040RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060041
Eddie James88f28f62021-10-20 16:41:29 -050042EXTRA_OEMESON = " \
43 -Dyamldir=${STAGING_DATADIR_NATIVE}/${PN} \
44 -Dps-derating-factor=${POWER_SUPPLY_DERATING_FACTOR} \
Nan Zhoud6c0eef2022-07-27 02:26:22 +000045 -Dtests=disabled \
Matt Spinler25c9a632018-03-09 10:54:09 -060046 "
Patrick Williams8c561ee2021-10-22 14:20:12 -050047EXTRA_OEMESON:append = "${@bb.utils.contains('MACHINE_FEATURES', 'i2c-occ', ' -Di2c-occ=enabled', '', d)}"
Lei YU80caf062017-07-20 15:25:28 +080048
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053049OCC_ENABLE = "enable"
50OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070051HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053052HOST_STOP = "stop"
53
Andrew Geissler109ae012020-03-31 13:47:05 -050054# Ensure host-stop and host-startmin targets wants needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053055OCC_TMPL = "op-occ-{0}@.service"
56HOST_TGTFMT = "obmc-host-{1}@{2}.target"
57OCC_INSTFMT = "op-occ-{0}@{2}.service"
Andrew Geissler109ae012020-03-31 13:47:05 -050058HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.wants/${OCC_INSTFMT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050059SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
60SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050061
Edward A. Jamesbb022b92017-11-01 16:26:54 -050062# Set the occ disable service to be executed on host error
63HOST_ERROR_TARGETS = "crash timeout"
64
65OCC_DISABLE_TMPL = "op-occ-disable@.service"
66HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
67OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
68HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
69
Patrick Williamse83c2202021-09-01 16:17:33 -050070SYSTEMD_LINK:${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
Edward A. Jamesbb022b92017-11-01 16:26:54 -050071
Deepak Kodihallif98bd112017-03-24 07:44:16 -050072S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060073
74# Remove packages not required for native build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000075DEPENDS:remove:class-native = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060076 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060077 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050078 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060079 virtual/${PN}-config-native \
80 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060081RDEPENDS:${PN}:remove:class-native = "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060082
Marri Devender Raob867da72017-12-29 06:01:11 -060083# Remove packages not required for native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000084DEPENDS:remove:class-nativesdk = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060085 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060086 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050087 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060088 virtual/${PN}-config-native \
89 "
Patrick Williamsd5c716d2022-02-17 07:30:57 -060090RDEPENDS:${PN}:remove:class-nativesdk = "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060091
92# Provide a means to enable/disable install_error_yaml feature
93PACKAGECONFIG ??= "install_error_yaml"
94PACKAGECONFIG[install_error_yaml] = "\
Eddie James88f28f62021-10-20 16:41:29 -050095 -Dinstall-error-yaml=enabled,\
96 -Dinstall-error-yaml=disabled,\
Marri Devender Raob867da72017-12-29 06:01:11 -060097 ,\
98 "
99
100# Enable install_error_yaml during native and native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000101PACKAGECONFIG:add:class-native = "install_error_yaml"
102PACKAGECONFIG:add:class-nativesdk = "install_error_yaml"
Marri Devender Raob867da72017-12-29 06:01:11 -0600103
104# Disable install_error_yaml during target build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000105PACKAGECONFIG:remove:class-target = "install_error_yaml"
Marri Devender Raob867da72017-12-29 06:01:11 -0600106
Marri Devender Raob867da72017-12-29 06:01:11 -0600107BBCLASSEXTEND += "native nativesdk"