blob: 8b4e91e930aa7583a4efd959065525dad1f88d5e [file] [log] [blame]
Adriana Kobylakb96c7502021-08-06 16:25:30 +00001FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
Brandon Wymanc50a8c42017-04-28 18:26:45 -05002
3# Package configuration
Adriana Kobylakb96c7502021-08-06 16:25:30 +00004FAN_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
Adriana Kobylakb96c7502021-08-06 16:25:30 +00008FAN_PACKAGES:append:mihawk = " \
Ben_Paifba51212019-08-05 18:34:34 +08009 phosphor-cooling-type \
10 "
Brandon Wyman5b42b742017-06-09 17:50:42 -050011
Adriana Kobylakb96c7502021-08-06 16:25:30 +000012PACKAGECONFIG:append:ibm-ac-server = " cooling-type"
13PACKAGECONFIG: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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000020FILES: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')}"
23FILES: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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000029SYSTEMD_ENVIRONMENT_FILE_phosphor-cooling-type:append:ibm-ac-server = " ${@compose_list(d, 'COOLING_ENV_FMT', 'OBMC_CHASSIS_INSTANCES')}"
30SYSTEMD_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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000033SYSTEMD_OVERRIDE_phosphor-fan-control:witherspoon += "fan-watchdog-monitor.conf:phosphor-fan-control-init@0.service.d/fan-watchdog-monitor.conf"
34SYSTEMD_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"
37SYSTEMD_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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000043SYSTEMD_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"
45SYSTEMD_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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000050SYSTEMD_SERVICE:${PN}-control:witherspoon += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
51SYSTEMD_LINK_${PN}-control:witherspoon += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth1f005052019-09-20 09:56:35 -050052# Link fan control service to be started at standby
Adriana Kobylakb96c7502021-08-06 16:25:30 +000053FMT_CONTROL_STDBY:witherspoon = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
54SYSTEMD_LINK_${PN}-control:witherspoon += "${@compose_list(d, 'FMT_CONTROL_STDBY', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth1f005052019-09-20 09:56:35 -050055# Link fan control service to also start at poweron
Adriana Kobylakb96c7502021-08-06 16:25:30 +000056FMT_CONTROL_PWRON:witherspoon = "../${TMPL_CONTROL}:${POWERON_TGT}.requires/${INSTFMT_CONTROL}"
57SYSTEMD_LINK_${PN}-control:witherspoon += "${@compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES')}"
Matthew Barth035b6162020-01-14 14:21:46 -060058
59# Enable the use of JSON on the fan applications that support it
Adriana Kobylakb96c7502021-08-06 16:25:30 +000060PACKAGECONFIG:append:witherspoon = " json"
61EXTRA_OECONF:append:witherspoon = " --disable-json-control"
62RDEPENDS:${PN}-presence-tach:append:witherspoon = " phosphor-fan-presence-config"
63RDEPENDS:${PN}-monitor:append:witherspoon = " phosphor-fan-monitor-config"
Matthew Bartha3f54c82020-04-22 10:53:50 -050064
Adriana Kobylakb96c7502021-08-06 16:25:30 +000065PACKAGECONFIG:append:p10bmc = " json sensor-monitor"
66FAN_PACKAGES:append:p10bmc = " sensor-monitor"
67RDEPENDS:${PN}-presence-tach:append:p10bmc = " phosphor-fan-presence-config"
68RDEPENDS:${PN}-monitor:append:p10bmc = " phosphor-fan-monitor-config"
Matthew Barth530e1d82020-11-23 19:40:56 -060069
70# Install fan control JSON config files
Adriana Kobylakb96c7502021-08-06 16:25:30 +000071SRC_URI:append:p10bmc = " \
Matthew Barth530e1d82020-11-23 19:40:56 -060072 file://manager.json \
73 file://rainier/fans.json \
Andrew Geisslera8887be2021-03-23 16:34:45 -050074 file://rainier-1s4u/fans.json \
Matthew Barth530e1d82020-11-23 19:40:56 -060075 file://rainier-2u/zones.json \
76 file://rainier-4u/zones.json \
Andrew Geisslerc22ef042021-03-23 18:25:27 -050077 file://rainier-1s4u/zones.json \
Matthew Barth530e1d82020-11-23 19:40:56 -060078 file://everest/fans.json \
79 file://everest/zones.json"
Adriana Kobylakb96c7502021-08-06 16:25:30 +000080do_install:append:p10bmc() {
Matthew Barth530e1d82020-11-23 19:40:56 -060081 # Install fan control manager config file
82 install -d ${D}/${datadir}/phosphor-fan-presence/control/
83 install -m 0644 ${WORKDIR}/manager.json ${D}/${datadir}/phosphor-fan-presence/control/
84
85 # Install Rainier-2U/4U fan config files
86 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier
Andrew Geisslera8887be2021-03-23 16:34:45 -050087 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u
Matthew Barth530e1d82020-11-23 19:40:56 -060088 install -m 0644 ${WORKDIR}/rainier/fans.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier/
Andrew Geisslera8887be2021-03-23 16:34:45 -050089 install -m 0644 ${WORKDIR}/rainier-1s4u/fans.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/
Matthew Barth530e1d82020-11-23 19:40:56 -060090
91 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-2u/
92 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-4u/
Andrew Geisslerc22ef042021-03-23 18:25:27 -050093 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/
Matthew Barth530e1d82020-11-23 19:40:56 -060094 install -m 0644 ${WORKDIR}/rainier-2u/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-2u/
95 install -m 0644 ${WORKDIR}/rainier-4u/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-4u/
Andrew Geisslerc22ef042021-03-23 18:25:27 -050096 install -m 0644 ${WORKDIR}/rainier-1s4u/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/
Matthew Barth530e1d82020-11-23 19:40:56 -060097
98 # Install Everest fan config files
99 install -d ${D}/${datadir}/phosphor-fan-presence/control/ibm,everest
100 install -m 0644 ${WORKDIR}/everest/fans.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,everest/
101 install -m 0644 ${WORKDIR}/everest/zones.json ${D}/${datadir}/phosphor-fan-presence/control/ibm,everest/
102}
Adriana Kobylakb96c7502021-08-06 16:25:30 +0000103FILES:${PN}-control:append:p10bmc = " \
Matthew Barth530e1d82020-11-23 19:40:56 -0600104 ${datadir}/phosphor-fan-presence/control/manager.json \
105 ${datadir}/phosphor-fan-presence/control/ibm,rainier/fans.json \
Andrew Geisslera8887be2021-03-23 16:34:45 -0500106 ${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/fans.json \
Matthew Barth530e1d82020-11-23 19:40:56 -0600107 ${datadir}/phosphor-fan-presence/control/ibm,rainier-2u/zones.json \
108 ${datadir}/phosphor-fan-presence/control/ibm,rainier-4u/zones.json \
Andrew Geisslerc22ef042021-03-23 18:25:27 -0500109 ${datadir}/phosphor-fan-presence/control/ibm,rainier-1s4u/zones.json \
Matthew Barth530e1d82020-11-23 19:40:56 -0600110 ${datadir}/phosphor-fan-presence/control/ibm,everest/fans.json \
111 ${datadir}/phosphor-fan-presence/control/ibm,everest/zones.json"
112
Matthew Bartha3f54c82020-04-22 10:53:50 -0500113# Set the appropriate i2c address used within the overridden phosphor-fan-control@.service
114# file that's used for witherspoon type(including witherspoon-tacoma) machines
Adriana Kobylakb96c7502021-08-06 16:25:30 +0000115SYSTEMD_SUBSTITUTIONS:witherspoon = "ADDR:100:phosphor-fan-control@.service"
116SYSTEMD_SUBSTITUTIONS:witherspoon-tacoma = "ADDR:200:phosphor-fan-control@.service"