1c77b60a5SMatthew Barth# Repository Details 2871bfeaeSMatt Spinler 3c77b60a5SMatthew Barth## Table of Contents 4a49e3f19SPatrick Williams 5a49e3f19SPatrick Williams- [Overview](#overview) 6a49e3f19SPatrick Williams- [Building](#building) 7a49e3f19SPatrick Williams- [Contents](#contents) 8871bfeaeSMatt Spinler 9c77b60a5SMatthew Barth## Overview 10a49e3f19SPatrick Williams 11c77b60a5SMatthew BarthThe phosphor-fan-presence repository provides a set of thermal related 12c77b60a5SMatthew Barthapplications that control and monitor the cooling of a system using fans. Each 13c77b60a5SMatthew Barthapplication independently controls or monitors an area related to the thermal 14c77b60a5SMatthew Barthstatus of a system that uses fans as its primary cooling mechanism. Since each 15c77b60a5SMatthew Barthapplication independent in its functionality, they can individually be included 16a49e3f19SPatrick Williamsin a BMC image at _configure_ time to provide only the functionality needed by a 17a49e3f19SPatrick Williamsuser's machine. 18871bfeaeSMatt Spinler 19c77b60a5SMatthew Barth## Building 20a49e3f19SPatrick Williams 213fc3161fSMatt SpinlerBy default, runtime JSON configuration file(s) are used for each application. 223fc3161fSMatt SpinlerThe use of YAML configuration file(s) has been deprecated in favor of the JSON 233fc3161fSMatt Spinlermethod. Support for the use of YAML based configuration files may be removed 243fc3161fSMatt Spinleronce all applications completely support getting their configuration from JSON 253fc3161fSMatt Spinlerfile(s) at runtime. 26871bfeaeSMatt Spinler 27c77b60a5SMatthew BarthThe following applications are built by default: 28a49e3f19SPatrick Williams 29a49e3f19SPatrick Williams- [Fan Control](#fan-control) 30c65df28aSGeorge Liu 31a49e3f19SPatrick Williams - To disable from building, use the `-Dcontrol-service=disabled` meson option: 32c65df28aSGeorge Liu 33bf8e56f6SMike Capps meson build -Dcontrol-service=disabled 34c65df28aSGeorge Liu 35a49e3f19SPatrick Williams- [Fan Presence Detection](#fan-presence-detection) 36c65df28aSGeorge Liu 37a49e3f19SPatrick Williams - To disable from building, use the `-Dpresence-service=disabled` meson 383fc3161fSMatt Spinler option: 39c65df28aSGeorge Liu 40bf8e56f6SMike Capps meson build -Dpresence-service=disabled 41c65df28aSGeorge Liu 42a49e3f19SPatrick Williams- [Fan Monitoring](#fan-monitoring) 43c65df28aSGeorge Liu 44a49e3f19SPatrick Williams - To disable from building, use the `-Dmonitor-service=disabled` meson option: 45c65df28aSGeorge Liu 46bf8e56f6SMike Capps meson build -Dmonitor-service=disabled 47c65df28aSGeorge Liu 48a49e3f19SPatrick Williams- [Sensor Monitoring](#sensor-monitoring) 49c65df28aSGeorge Liu 50a49e3f19SPatrick Williams - To disable from building, use the `-Dsensor-monitor-service=disabled` meson 513fc3161fSMatt Spinler option: 52c65df28aSGeorge Liu 533fc3161fSMatt Spinler meson build -Dsensor-monitor-service=disabled 54871bfeaeSMatt Spinler 55a49e3f19SPatrick WilliamsThe following applications must be enabled at _configure_ time to be built: 56a49e3f19SPatrick Williams 57a49e3f19SPatrick Williams- [Cooling Type](#cooling-type) 58c65df28aSGeorge Liu 59a49e3f19SPatrick Williams - To enable building this, set the `-Dcooling-type-service=enable` meson 603fc3161fSMatt Spinler option: 61c65df28aSGeorge Liu 623fc3161fSMatt Spinler meson build -Dcooling-type-service=enabled 63871bfeaeSMatt Spinler 64c77b60a5SMatthew Barth### YAML (Deprecated) 65a49e3f19SPatrick Williams 66a49e3f19SPatrick WilliamsThe location of the YAML configuration file(s) are provided at _configure_ time 67a49e3f19SPatrick Williamsto each application thru environment variables. The default YAML configuration 68a49e3f19SPatrick Williamsfile(s) used are the examples found within each application's example directory. 69a49e3f19SPatrick WilliamsSee each application below ([Contents](#contents)) for more information on how 70a49e3f19SPatrick Williamsto set their specific _configure_ time options, including the location of the 71a49e3f19SPatrick WilliamsYAML configuration file(s). 72871bfeaeSMatt Spinler 733fc3161fSMatt SpinlerMeson defaults to JSON based runtime configuration, so to select the YAML 743fc3161fSMatt Spinlerconfiguration use the '-Djson-config=disabled' option when building: 75a49e3f19SPatrick Williams 763fc3161fSMatt Spinler1. meson build -Djson-config=disabled 773fc3161fSMatt Spinler2. ninja -C build 7821b46e24SMatthew Barth 79c77b60a5SMatthew Barth### JSON 80a49e3f19SPatrick Williams 81c77b60a5SMatthew BarthSee each application below ([Contents](#contents)) for more information on how 82a49e3f19SPatrick Williamsto set their specific _configure_ time options and details on how to configure 83c77b60a5SMatthew Bartheach using JSON. 84c77b60a5SMatthew Barth 85a49e3f19SPatrick WilliamsAs JSON based runtime configuration is the default option, no extra options are 86a49e3f19SPatrick Williamsrequired to build: 87a49e3f19SPatrick Williams 883fc3161fSMatt Spinler1. meson build 893fc3161fSMatt Spinler2. ninja -C build 90a49e3f19SPatrick Williams 91c77b60a5SMatthew Barth**Note: Features/Restrictions of applications in this package that are only 92c77b60a5SMatthew Barthsupported using the JSON based configuration are listed below:** 93f2fb8992SGunnar Mills 94a49e3f19SPatrick Williams#### Features 95a49e3f19SPatrick Williams 96a49e3f19SPatrick Williams- [Fan Presence Detection](#fan-presence-detection) 97a49e3f19SPatrick Williams - Error logging for missing fans 98a49e3f19SPatrick Williams- [Fan Monitoring](#fan-monitoring) 99a49e3f19SPatrick Williams - Error logging for nonfunctional fans 100a49e3f19SPatrick Williams - System power off due to missing or nonfunctional fans 101a49e3f19SPatrick Williams- [Sensor Monitoring](#sensor-monitoring) - Only supports JSON 102c77b60a5SMatthew Barth 103c77b60a5SMatthew Barth## Contents 104c77b60a5SMatthew Barth 105c77b60a5SMatthew Barth### Fan Control 106a49e3f19SPatrick Williams 107c77b60a5SMatthew BarthControls the fans based on a set of events that are configured using a group of 108c77b60a5SMatthew BarthD-Bus objects and one-or-more triggers that run a configured set of actions. 109a49e3f19SPatrick WilliamsThese events are meant to be configured to handle all aspects of controlling the 110a49e3f19SPatrick Williamsfans within a system. Fans are added to zones that then have events configured 111a49e3f19SPatrick Williamsagainst the zone to control the fans based on the state of any sized group of 112a49e3f19SPatrick WilliamsD-Bus objects. 113c77b60a5SMatthew Barth 114a49e3f19SPatrick Williams- Available meson options: 115a49e3f19SPatrick Williams - `control-persist-root-path` - Base location to persist zone property states 116c77b60a5SMatthew Barth on the BMC 117a49e3f19SPatrick Williams - Default = '/var/lib/phosphor-fan-presence/control' 118c77b60a5SMatthew Barth 119c77b60a5SMatthew Barth#### YAML (Deprecated) 120a49e3f19SPatrick Williams 121a49e3f19SPatrick Williams- Available meson options: 122a49e3f19SPatrick Williams - `fan-def-yaml-file` - Build time fan configuration file 123a49e3f19SPatrick Williams - Default = ['control/example/fans.yaml'](control/example/fans.yaml) 124a49e3f19SPatrick Williams - `fan-zone-yaml-file` - Build time zone configuration file 125a49e3f19SPatrick Williams - Default = ['control/example/zones.yaml'](control/example/zones.yaml) 126a49e3f19SPatrick Williams - `fan-events-yaml-file` - Build time events configuration file 127a49e3f19SPatrick Williams - Default = ['control/example/events.yaml'](control/example/events.yaml) 128a49e3f19SPatrick Williams - `zone-conditions-yaml-file` Build time zone conditions configuration file 129a49e3f19SPatrick Williams - Default = 130a49e3f19SPatrick Williams ['control/example/zone_conditions.yaml'](control/example/zone_conditions.yaml) 131c77b60a5SMatthew Barth 132c77b60a5SMatthew Barth[Example](control/example/) 133c77b60a5SMatthew Barth 134c77b60a5SMatthew Barth#### JSON 135a49e3f19SPatrick Williams 136c77b60a5SMatthew Barth[README](docs/control/README.md) 137c77b60a5SMatthew Barth 138c77b60a5SMatthew Barth--- 139c77b60a5SMatthew Barth 140c77b60a5SMatthew Barth### Fan Presence Detection 141a49e3f19SPatrick Williams 142c77b60a5SMatthew BarthMonitors the presence state of fans using GPIOs, nonzero tach feedbacks, or a 143c77b60a5SMatthew Barthcombination of both. This updates a configured location of a fan D-Bus object's 144c77b60a5SMatthew Barth`Present` property according to the state of the methods used to detect the 145c77b60a5SMatthew Barthfan's presence. 146c77b60a5SMatthew Barth 147a49e3f19SPatrick Williams- Available meson options: 148a49e3f19SPatrick Williams - `num-presence-log-entries` - Maximum number of entries in the message log 149a49e3f19SPatrick Williams - Default = 50 150c77b60a5SMatthew Barth 151c77b60a5SMatthew Barth#### YAML (Deprecated) 152a49e3f19SPatrick Williams 153a49e3f19SPatrick Williams- Available meson options: 154a49e3f19SPatrick Williams - `presence-config` - Location of the config file 155a49e3f19SPatrick Williams - Default = ['presence/example/example.yaml'](presence/example/example.yaml) 156c77b60a5SMatthew Barth 157c77b60a5SMatthew BarthExample: [example.yaml](presence/example/example.yaml) 158c77b60a5SMatthew Barth 159c77b60a5SMatthew Barth#### JSON 160a49e3f19SPatrick Williams 161c77b60a5SMatthew Barth[README](docs/presence/README.md) 162c77b60a5SMatthew Barth 163c77b60a5SMatthew Barth--- 164c77b60a5SMatthew Barth 165c77b60a5SMatthew Barth### Fan Monitoring 166a49e3f19SPatrick Williams 167c77b60a5SMatthew BarthMonitors the functional state of fans by comparing the fan feedback speed 168c77b60a5SMatthew Barthagainst the current target, applying any configured adjustments to the target 169c77b60a5SMatthew Barthdue to fan hardware properties. In addition to updating the configured location 170c77b60a5SMatthew Barthof a fan D-Bus object's `Functional` property in inventory, actions can be 171a49e3f19SPatrick Williamsconfigured\* to be taken based on the state of fans, i.e.) creating event logs 172a49e3f19SPatrick Williamsor powering off the system. 173c77b60a5SMatthew Barth 174c77b60a5SMatthew BarthAnother feature that can be configured is the ability to cancel the monitoring 175a49e3f19SPatrick Williamsof a set of fans that may be necessary to workaround designs of the fan hardware 176a49e3f19SPatrick Williamsand/or controller used. 177c77b60a5SMatthew Barth 178a49e3f19SPatrick Williams\*_Actions to be taken based on the state of fans is only available using a JSON 179a49e3f19SPatrick Williamsbased configuration_ 180c77b60a5SMatthew Barth 181a49e3f19SPatrick Williams- Available meson options: 182a49e3f19SPatrick Williams - `num-monitor-log-entries` - Maximum number of entries in the message log 183a49e3f19SPatrick Williams - Default = 75 184c77b60a5SMatthew Barth 185c77b60a5SMatthew Barth#### YAML (Deprecated) 186a49e3f19SPatrick Williams 187a49e3f19SPatrick Williams- Available meson options: 188a49e3f19SPatrick Williams - `fan-monitor-yaml-file` - Location of the config file 189a49e3f19SPatrick Williams - Default = ['monitor/example/monitor.yaml'](monitor/example/monitor.yaml) 190c77b60a5SMatthew Barth 191c77b60a5SMatthew BarthExample: [monitor.yaml](monitor/example/monitor.yaml) 192c77b60a5SMatthew Barth 193c77b60a5SMatthew Barth#### JSON 194a49e3f19SPatrick Williams 195c77b60a5SMatthew Barth[README](docs/monitor/README.md) 196c77b60a5SMatthew Barth 197c77b60a5SMatthew Barth--- 198c77b60a5SMatthew Barth 199c77b60a5SMatthew Barth### Cooling Type 200a49e3f19SPatrick Williams 201c77b60a5SMatthew BarthSets the `AirCooled` and `WaterCooled` property on the 202c77b60a5SMatthew Barth`xyz.openbmc_project.Inventory.Decorator.CoolingType` interface in inventory 203c77b60a5SMatthew Barthbased on a given GPIO. No configuration files are used with this application as 204c77b60a5SMatthew Barthit is command line driven. 205c77b60a5SMatthew Barth 206c77b60a5SMatthew Barth--- 207c77b60a5SMatthew Barth 208c77b60a5SMatthew Barth### Sensor Monitoring 209a49e3f19SPatrick Williams 210c77b60a5SMatthew BarthTakes actions, such as powering off the system, based on sensor thresholds and 211c77b60a5SMatthew Barthvalues. 212c77b60a5SMatthew Barth 213a49e3f19SPatrick Williams- Available meson options: 214a49e3f19SPatrick Williams - `sensor-monitor-persist-root-path` - Base location to persist sensor 215c77b60a5SMatthew Barth monitoring data 216a49e3f19SPatrick Williams - Default = '/var/lib/phosphor-fan-presence/sensor-monitor' 217a49e3f19SPatrick Williams - `sensor-monitor-hard-shutdown-delay` - Milliseconds to delay the alarm hard 218a49e3f19SPatrick Williams shutdown 219a49e3f19SPatrick Williams - Default = 23000 220a49e3f19SPatrick Williams - `sensor-monitor-soft-shutdown-delay` - Milliseconds to delay the alarm soft 221a49e3f19SPatrick Williams shutdown 222a49e3f19SPatrick Williams - Default = 900000 223a49e3f19SPatrick Williams - `use-host-power-state` - Use the host state for the power state as opposed 224a49e3f19SPatrick Williams to the PGOOD state. 225*35fb3a05SJerry C Chen - `skip-power-checking` - Skip power state checking while sending threshold 226*35fb3a05SJerry C Chen alarm event. 227c77b60a5SMatthew Barth 228c77b60a5SMatthew Barth[README](docs/sensor-monitor/README.md) 229c77b60a5SMatthew Barth 230c77b60a5SMatthew Barth--- 231