blob: 7de42165692d33e0d3fa6414b2a9578252a7c0e6 [file] [log] [blame]
Brad Bishopdd12ede2019-05-13 14:46:48 -04001FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
Brandon Wymanc50a8c42017-04-28 18:26:45 -05002
3# Package configuration
Brad Bishopa29c2d52019-07-17 17:35:55 -04004FAN_PACKAGES_append_ibm-ac-server = " \
Brandon Wymanc50a8c42017-04-28 18:26:45 -05005 phosphor-cooling-type \
Ben_Paifba51212019-08-05 18:34:34 +08006 "
7
8FAN_PACKAGES_append_mihawk = " \
9 phosphor-cooling-type \
10 "
Brandon Wyman5b42b742017-06-09 17:50:42 -050011
Brad Bishopa29c2d52019-07-17 17:35:55 -040012PACKAGECONFIG_append_ibm-ac-server = " cooling-type"
Ben_Paifba51212019-08-05 18:34:34 +080013PACKAGECONFIG_append_mihawk = " cooling-type"
Brandon Wyman5b42b742017-06-09 17:50:42 -050014
Brandon Wyman5b42b742017-06-09 17:50:42 -050015TMPL_COOLING = "phosphor-cooling-type@.service"
16INSTFMT_COOLING = "phosphor-cooling-type@{0}.service"
Matthew Barth1f005052019-09-20 09:56:35 -050017MULTI_USR_TGT = "multi-user.target"
18FMT_COOLING = "../${TMPL_COOLING}:${MULTI_USR_TGT}.requires/${INSTFMT_COOLING}"
Brandon Wymanc50a8c42017-04-28 18:26:45 -050019
Brad Bishopa29c2d52019-07-17 17:35:55 -040020FILES_phosphor-cooling-type_append_ibm-ac-server = " ${bindir}/phosphor-cooling-type"
21SYSTEMD_SERVICE_phosphor-cooling-type_append_ibm-ac-server = " ${TMPL_COOLING}"
22SYSTEMD_LINK_phosphor-cooling-type_append_ibm-ac-server = " ${@compose_list(d, 'FMT_COOLING', 'OBMC_CHASSIS_INSTANCES')}"
Ben_Paifba51212019-08-05 18:34:34 +080023FILES_phosphor-cooling-type_append_mihawk = " ${bindir}/phosphor-cooling-type"
24SYSTEMD_SERVICE_phosphor-cooling-type_append_mihawk = " ${TMPL_COOLING}"
25SYSTEMD_LINK_phosphor-cooling-type_append_mihawk = " ${@compose_list(d, 'FMT_COOLING', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wymanc50a8c42017-04-28 18:26:45 -050026
27COOLING_ENV_FMT = "obmc/phosphor-fan/phosphor-cooling-type-{0}.conf"
28
Brad Bishopa29c2d52019-07-17 17:35:55 -040029SYSTEMD_ENVIRONMENT_FILE_phosphor-cooling-type_append_ibm-ac-server = " ${@compose_list(d, 'COOLING_ENV_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Ben_Paifba51212019-08-05 18:34:34 +080030SYSTEMD_ENVIRONMENT_FILE_phosphor-cooling-type_append_mihawk = " ${@compose_list(d, 'COOLING_ENV_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Brandon Wymanc50a8c42017-04-28 18:26:45 -050031
Matthew Barth770a1de2017-10-24 14:07:09 -050032#These services are protected by the watchdog
Matthew Barthb2e743f2020-04-06 14:28:14 -050033SYSTEMD_OVERRIDE_phosphor-fan-control_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-control-init@0.service.d/fan-watchdog-monitor.conf"
Matthew Barth8921e372019-04-12 13:43:18 -050034SYSTEMD_OVERRIDE_phosphor-fan-control_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-control@0.service.d/fan-watchdog-monitor.conf"
35SYSTEMD_OVERRIDE_phosphor-fan-monitor_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-monitor-init@0.service.d/fan-watchdog-monitor.conf"
36SYSTEMD_OVERRIDE_phosphor-fan-monitor_witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-monitor@0.service.d/fan-watchdog-monitor.conf"
Adriana Kobylak62348722021-03-25 16:40:34 +000037SYSTEMD_OVERRIDE_phosphor-fan-control_p10bmc += "fan-watchdog-monitor.conf:phosphor-fan-control-init@0.service.d/fan-watchdog-monitor.conf"
38SYSTEMD_OVERRIDE_phosphor-fan-control_p10bmc += "fan-watchdog-monitor.conf:phosphor-fan-control@0.service.d/fan-watchdog-monitor.conf"
39SYSTEMD_OVERRIDE_phosphor-fan-monitor_p10bmc += "fan-watchdog-monitor.conf:phosphor-fan-monitor-init@0.service.d/fan-watchdog-monitor.conf"
40SYSTEMD_OVERRIDE_phosphor-fan-monitor_p10bmc += "fan-watchdog-monitor.conf:phosphor-fan-monitor@0.service.d/fan-watchdog-monitor.conf"
Matt Spinler99940142017-06-19 14:55:52 -050041
Matthew Barth770a1de2017-10-24 14:07:09 -050042#These services need to be stopped when watchdog expires
Matthew Barth8921e372019-04-12 13:43:18 -050043SYSTEMD_OVERRIDE_phosphor-fan-control_witherspoon += "fan-watchdog-conflicts.conf:phosphor-fan-control@0.service.d/fan-watchdog-conflicts.conf"
44SYSTEMD_OVERRIDE_phosphor-fan-monitor_witherspoon += "fan-watchdog-conflicts.conf:phosphor-fan-monitor@0.service.d/fan-watchdog-conflicts.conf"
Adriana Kobylak62348722021-03-25 16:40:34 +000045SYSTEMD_OVERRIDE_phosphor-fan-control_p10bmc += "fan-watchdog-conflicts.conf:phosphor-fan-control@0.service.d/fan-watchdog-conflicts.conf"
46SYSTEMD_OVERRIDE_phosphor-fan-monitor_p10bmc += "fan-watchdog-conflicts.conf:phosphor-fan-monitor@0.service.d/fan-watchdog-conflicts.conf"
Matthew Barth1f005052019-09-20 09:56:35 -050047
Matthew Barthb2e743f2020-04-06 14:28:14 -050048# Witherspoon fan control service linking
49# Link fan control init service
50SYSTEMD_LINK_${PN}-control_witherspoon += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth1f005052019-09-20 09:56:35 -050051# Link fan control service to be started at standby
52FMT_CONTROL_STDBY_witherspoon = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
53SYSTEMD_LINK_${PN}-control_witherspoon += "${@compose_list(d, 'FMT_CONTROL_STDBY', 'OBMC_CHASSIS_INSTANCES')}"
54# Link fan control service to also start at poweron
55FMT_CONTROL_PWRON_witherspoon = "../${TMPL_CONTROL}:${POWERON_TGT}.requires/${INSTFMT_CONTROL}"
56SYSTEMD_LINK_${PN}-control_witherspoon += "${@compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth035b6162020-01-14 14:21:46 -060057
58# Enable the use of JSON on the fan applications that support it
Matt Spinlerab79e2a2021-01-25 15:25:11 -060059PACKAGECONFIG_append_witherspoon = " json"
60EXTRA_OECONF_append_witherspoon = " --disable-json-control"
Matthew Barth035b6162020-01-14 14:21:46 -060061RDEPENDS_${PN}-presence-tach_append_witherspoon = " phosphor-fan-presence-config"
Matthew Barth8daae522020-06-19 13:48:27 -050062RDEPENDS_${PN}-monitor_append_witherspoon = " phosphor-fan-monitor-config"
Matthew Bartha3f54c82020-04-22 10:53:50 -050063
Adriana Kobylak62348722021-03-25 16:40:34 +000064PACKAGECONFIG_append_p10bmc = " json sensor-monitor"
65FAN_PACKAGES_append_p10bmc = " sensor-monitor"
66RDEPENDS_${PN}-presence-tach_append_p10bmc = " phosphor-fan-presence-config"
67RDEPENDS_${PN}-monitor_append_p10bmc = " phosphor-fan-monitor-config"
Matthew Barth530e1d82020-11-23 19:40:56 -060068
69# Install fan control JSON config files
Adriana Kobylak62348722021-03-25 16:40:34 +000070SRC_URI_append_p10bmc = " \
Matthew Barth530e1d82020-11-23 19:40:56 -060071 file://manager.json \
72 file://rainier/fans.json \
Andrew Geisslera8887be2021-03-23 16:34:45 -050073 file://rainier-1s4u/fans.json \
Matthew Barth530e1d82020-11-23 19:40:56 -060074 file://rainier-2u/zones.json \
75 file://rainier-4u/zones.json \
Andrew Geisslerc22ef042021-03-23 18:25:27 -050076 file://rainier-1s4u/zones.json \
Matthew Barth530e1d82020-11-23 19:40:56 -060077 file://everest/fans.json \
78 file://everest/zones.json"
Adriana Kobylak62348722021-03-25 16:40:34 +000079do_install_append_p10bmc() {
Matthew Barth530e1d82020-11-23 19:40:56 -060080 # Install fan control manager config file
81 install -d ${D}/${datadir}/phosphor-fan-presence/control/
82 install -m 0644 ${WORKDIR}/manager.json ${D}/${datadir}/phosphor-fan-presence/control/
83
84 # Install Rainier-2U/4U fan config files
85 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier
Andrew Geisslera8887be2021-03-23 16:34:45 -050086 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u
Matthew Barth530e1d82020-11-23 19:40:56 -060087 install -m 0644 ${WORKDIR}/rainier/fans.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier/
Andrew Geisslera8887be2021-03-23 16:34:45 -050088 install -m 0644 ${WORKDIR}/rainier-1s4u/fans.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/
Matthew Barth530e1d82020-11-23 19:40:56 -060089
90 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-2u/
91 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-4u/
Andrew Geisslerc22ef042021-03-23 18:25:27 -050092 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/
Matthew Barth530e1d82020-11-23 19:40:56 -060093 install -m 0644 ${WORKDIR}/rainier-2u/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-2u/
94 install -m 0644 ${WORKDIR}/rainier-4u/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-4u/
Andrew Geisslerc22ef042021-03-23 18:25:27 -050095 install -m 0644 ${WORKDIR}/rainier-1s4u/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/
Matthew Barth530e1d82020-11-23 19:40:56 -060096
97 # Install Everest fan config files
98 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,everest
99 install -m 0644 ${WORKDIR}/everest/fans.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,everest/
100 install -m 0644 ${WORKDIR}/everest/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,everest/
101}
Adriana Kobylak62348722021-03-25 16:40:34 +0000102FILES_${PN}-control_append_p10bmc = " \
Matthew Barth530e1d82020-11-23 19:40:56 -0600103 ${datadir}/phosphor-fan-presence/control/manager.json \
104 ${datadir}/phosphor-fan-presence/control/ibm,rainier/fans.json \
Andrew Geisslera8887be2021-03-23 16:34:45 -0500105 ${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/fans.json \
Matthew Barth530e1d82020-11-23 19:40:56 -0600106 ${datadir}/phosphor-fan-presence/control/ibm,rainier-2u/zones.json \
107 ${datadir}/phosphor-fan-presence/control/ibm,rainier-4u/zones.json \
Andrew Geisslerc22ef042021-03-23 18:25:27 -0500108 ${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/zones.json \
Matthew Barth530e1d82020-11-23 19:40:56 -0600109 ${datadir}/phosphor-fan-presence/control/ibm,everest/fans.json \
110 ${datadir}/phosphor-fan-presence/control/ibm,everest/zones.json"
111
Matthew Bartha3f54c82020-04-22 10:53:50 -0500112# Set the appropriate i2c address used within the overridden phosphor-fan-control@.service
113# file that's used for witherspoon type(including witherspoon-tacoma) machines
114SYSTEMD_SUBSTITUTIONS_witherspoon = "ADDR:100:phosphor-fan-control@.service"
115SYSTEMD_SUBSTITUTIONS_witherspoon-tacoma = "ADDR:200:phosphor-fan-control@.service"