blob: 0f90160e6f133c53e6493d15bd7a10289752fd9e [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
Deepak Kodihalli615bdc12017-04-06 23:50:34 -05007inherit autotools \
8 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
13require ${PN}.inc
14
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050015SRC_URI += "file://occ-active.sh"
16do_install_append() {
17 install -d ${D}${bindir}
18 install -m 0755 ${WORKDIR}/occ-active.sh \
19 ${D}${bindir}/occ-active.sh
20}
21
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050022DBUS_SERVICE_${PN} += "org.open_power.OCC.Control.service"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053023SYSTEMD_SERVICE_${PN} += "op-occ-enable@.service"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050024SYSTEMD_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 \
29 sdbusplus-native \
30 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
Andrew Geissler5c459852020-02-10 08:19:46 -060040RDEPENDS_${PN} += "phosphor-state-manager-obmc-targets"
41
Matt Spinler25c9a632018-03-09 10:54:09 -060042EXTRA_OECONF = " \
43 YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN} \
44 PS_DERATING_FACTOR=${POWER_SUPPLY_DERATING_FACTOR} \
45 "
Lei YU80caf062017-07-20 15:25:28 +080046EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}"
47
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}"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053058SYSTEMD_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
69SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
70
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
74DEPENDS_remove_class-native = " \
75 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060076 systemd \
77 virtual/${PN}-config-native \
78 "
Andrew Geissler5c459852020-02-10 08:19:46 -060079RDEPENDS_${PN}_remove_class-native += "phosphor-state-manager-obmc-targets"
80
Marri Devender Raob867da72017-12-29 06:01:11 -060081# Remove packages not required for native SDK build
82DEPENDS_remove_class-nativesdk = " \
83 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060084 systemd \
85 virtual/${PN}-config-native \
86 "
Andrew Geissler5c459852020-02-10 08:19:46 -060087RDEPENDS_${PN}_remove_class-nativesdk += "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060088
89# Provide a means to enable/disable install_error_yaml feature
90PACKAGECONFIG ??= "install_error_yaml"
91PACKAGECONFIG[install_error_yaml] = "\
92 --enable-install_error_yaml,\
93 --disable-install_error_yaml,\
94 ,\
95 "
96
97# Enable install_error_yaml during native and native SDK build
98PACKAGECONFIG_add_class-native = "install_error_yaml"
99PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
100
101# Disable install_error_yaml during target build
102PACKAGECONFIG_remove_class-target = "install_error_yaml"
103
Marri Devender Raob867da72017-12-29 06:01:11 -0600104BBCLASSEXTEND += "native nativesdk"