blob: b78b85bfb9f1a72085459898a392311d4a1c0aae [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} \
Matt Spinler25c9a632018-03-09 10:54:09 -060045 "
Eddie James88f28f62021-10-20 16:41:29 -050046EXTRA_OEMESON:append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' -Di2c-occ=enabled', '', d)}"
Lei YU80caf062017-07-20 15:25:28 +080047
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053048OCC_ENABLE = "enable"
49OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070050HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053051HOST_STOP = "stop"
52
Andrew Geissler109ae012020-03-31 13:47:05 -050053# Ensure host-stop and host-startmin targets wants needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053054OCC_TMPL = "op-occ-{0}@.service"
55HOST_TGTFMT = "obmc-host-{1}@{2}.target"
56OCC_INSTFMT = "op-occ-{0}@{2}.service"
Andrew Geissler109ae012020-03-31 13:47:05 -050057HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.wants/${OCC_INSTFMT}"
Patrick Williamse83c2202021-09-01 16:17:33 -050058SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
59SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050060
Edward A. Jamesbb022b92017-11-01 16:26:54 -050061# Set the occ disable service to be executed on host error
62HOST_ERROR_TARGETS = "crash timeout"
63
64OCC_DISABLE_TMPL = "op-occ-disable@.service"
65HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
66OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
67HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
68
Patrick Williamse83c2202021-09-01 16:17:33 -050069SYSTEMD_LINK:${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
Edward A. Jamesbb022b92017-11-01 16:26:54 -050070
Deepak Kodihallif98bd112017-03-24 07:44:16 -050071S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060072
73# Remove packages not required for native build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000074DEPENDS:remove:class-native = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060075 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060076 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050077 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060078 virtual/${PN}-config-native \
79 "
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000080RDEPENDS:${PN}:remove:class-native += "phosphor-state-manager-obmc-targets"
Andrew Geissler5c459852020-02-10 08:19:46 -060081
Marri Devender Raob867da72017-12-29 06:01:11 -060082# Remove packages not required for native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000083DEPENDS:remove:class-nativesdk = " \
Marri Devender Raob867da72017-12-29 06:01:11 -060084 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060085 systemd \
Patrick Williams14708462020-04-08 07:25:26 -050086 sdbusplus \
Marri Devender Raob867da72017-12-29 06:01:11 -060087 virtual/${PN}-config-native \
88 "
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000089RDEPENDS:${PN}:remove:class-nativesdk += "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060090
91# Provide a means to enable/disable install_error_yaml feature
92PACKAGECONFIG ??= "install_error_yaml"
93PACKAGECONFIG[install_error_yaml] = "\
Eddie James88f28f62021-10-20 16:41:29 -050094 -Dinstall-error-yaml=enabled,\
95 -Dinstall-error-yaml=disabled,\
Marri Devender Raob867da72017-12-29 06:01:11 -060096 ,\
97 "
98
99# Enable install_error_yaml during native and native SDK build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000100PACKAGECONFIG:add:class-native = "install_error_yaml"
101PACKAGECONFIG:add:class-nativesdk = "install_error_yaml"
Marri Devender Raob867da72017-12-29 06:01:11 -0600102
103# Disable install_error_yaml during target build
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000104PACKAGECONFIG:remove:class-target = "install_error_yaml"
Marri Devender Raob867da72017-12-29 06:01:11 -0600105
Marri Devender Raob867da72017-12-29 06:01:11 -0600106BBCLASSEXTEND += "native nativesdk"