summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update gitignoreBrad Bishop2017-06-152-0/+4
| | | | | | | | | Add VIM swap files. Add testcase data and log files. Add testcase binary. Change-Id: I0bc59b9d74c157556e95ce0cc41974c9c42335e0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: build: Add yaml file to generated depsBrad Bishop2017-06-133-18/+5
| | | | | | | | Makefile updates such that updates to the YAML file result in a retrigger of the python script. Change-Id: I83b637f71dc380a56be0fd40390176d3b201b29a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update gitignoreBrad Bishop2017-06-081-0/+1
| | | | | | | Ignore test-driver Change-Id: Id2dfa273021f0ea67835b2d2c3a22d00f835c2ab Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Use updated match methods for signal callbacksMatthew Barth2017-06-054-46/+23
| | | | | | | | Attach the event handler callback function to the match along with generating the match string using the new match methods Change-Id: I7595d65cbc615f29db60e2a65534ee5b635d6f96 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Check initial event's group members' propertiesMatthew Barth2017-05-312-0/+68
| | | | | | | | On start of fan control, check the current event's group members' property states and envoke the defined action function on the results. Change-Id: I12509403328d90f85d67b393dbdd97d8710c83ef Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add an active state for automatic fan controlMatthew Barth2017-05-313-1/+38
| | | | | | | | | | | | Each zone contains an active state that determines whether the automatic fan control algorithm is active and controlling the fan speeds dynamically or not. This will be used to determine if the fan speeds within the zone are set dynamically or rather held at another speed for a determined reason. Change-Id: I2f81de168c5f7d859b3ec917022c4749e1a28d4e Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Only setup set speed events when not init modeMatthew Barth2017-05-315-33/+42
| | | | | Change-Id: Ia6987295a3eb4e23b9d6ae13a383e440386572de Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Fixed alignment issuesMatthew Barth2017-05-311-61/+65
| | | | | | | Fixed resulting pep8 alignment issues in the generated template Change-Id: I26d316a86c40896cda729683b26ccf06a3f89d5f Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Generate list of property change signalsMatthew Barth2017-05-311-0/+31
| | | | | | | | Add the list of property(s) associated to a set speed event where the handler updates the property cached on the zone for the action Change-Id: Ifac61dda6eb200ca28735ddfaab3d34c9a9df758 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Generate set speed event actionsMatthew Barth2017-05-311-0/+38
| | | | | | | | Adds the set speed event action functions with the associated parameters in the order required for the function Change-Id: Ib08f2442d8ff1fb3d49ab5234eacc2db8304a20d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Parse set speed event groupsMatthew Barth2017-05-312-2/+63
| | | | | | | | Adds the groups for a set speed event for each zone listed within the event. The groups are for maintaining a cached property value. Change-Id: I2de9cf62215f9861e8ea2e6807df11e6a04638fb Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Example set speed event yamlMatthew Barth2017-05-311-0/+67
| | | | | | | | | An example yaml file to define set speed events based on groups of dbus object properties and a set of actions that can be performed based on those property values Change-Id: I2f713920f9ce25859855cfec783df0adb505f31d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add setting zone speed actionMatthew Barth2017-05-315-21/+118
| | | | | | | | Enable an action to be defined that sets the zone to a given speed when a number of properties are set to a given value Change-Id: I5252a20a24bdb14dee63080f2c08b080c82ad7e8 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add property changed signal handlerMatthew Barth2017-05-315-1/+247
| | | | | | | | Enable the control application to handle property changed signals to set or update a cached set of these properties Change-Id: Ib84ffe1e801ee7dd85d17fdbb122d124d307dbd3 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Have cooling-type use the common argument.hppMatt Spinler2017-05-245-44/+6
| | | | | | | | | | | | The cooling-type application should use the common header file for the ArgumentParser class now that one is available. Also fixed where a static ArgumentParser constant was being initialized. Change-Id: I1fb0dfe3bd0c6e0200ad7c718ef2a3def5476f3f Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Change example/zones.yaml to full_speedGunnar Mills2017-05-241-3/+3
| | | | | | | initial_speed should be full_speed in example/zones.yaml Change-Id: I64b4803a26006cf78f6d29859bb8dd43a5cf63b3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Implement changes to read GPIO device for cooling type.Brandon Wyman2017-05-227-62/+126
| | | | | Change-Id: If40a54510fb05d67ee0bfdf24026c1d7470897ca Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
* Fix bitbake build break due to <utility.hpp>Brandon Wyman2017-05-191-1/+1
| | | | | | | | Should have used #include "utility.hpp" to include that header file in the phosphor-fan-presence repo. Change-Id: I01ac9a0cd4b3942f4b052ae3f52abd828cf8dc20 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
* Implement updating the inventory propertiesBrandon Wyman2017-05-194-7/+71
| | | | | | | | Implement code needed to update the chassis AirCooled and WaterCooled properties. Change-Id: I9a67d1129e99f841200241e2daae08fb6119d9d3 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
* Fill in shell functions/files for cooling type.Brandon Wyman2017-05-1911-24/+378
| | | | | Change-Id: I8d18d3141e955adeffdd8122ebb17549c88edd77 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
* Fix typo in configure.acMatt Spinler2017-05-191-2/+2
| | | | | Change-Id: I5589183c80c97f2a2a5ed6ed209f529e8f732138 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add modes to phosphor-fan-controlMatt Spinler2017-05-166-30/+157
| | | | | | | | | | | | | | | phosphor-fan-control can behave differently based on its command line arguments --init: Set fans to full speed, delay for a configurable amount of time to allow fans to ramp up, start the fan control ready target, and then exit. --control: Start the control algorithm. Never exits. Will be started as part of the fan control ready target. Change-Id: I453daf8cc05a5c85a19c098e1cca64cac2ad9520 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* ArgumentParser for fan controlMatt Spinler2017-05-162-0/+135
| | | | | | | | | | | | Parses arguments for phosphor-fan-control. The header file is in the base directory of the repository and can be common to all fan applications. The cpp file needs to be in the subdirectory of the application that uses it, in this case control. Change-Id: I93dba60daf8f78667df970ab47ec018d90a8c14f Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Move Fan objects back to heapMatt Spinler2017-05-121-2/+2
| | | | | | | | Turns out that with the objects on the stack, some of them were corrupt in the callbacks. Change-Id: Ifd4179839d4e05fdb1f05e417093cb14cec3addc Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Use unique_ptr for sd_event object wrapperMatt Spinler2017-05-119-37/+60
| | | | | | | | Convert the sd_event object wrapper from a shared_ptr to a unique_ptr. Requires a new header file. Change-Id: I868a9e88ed93878c2e0bb12e58f8d3a604510da0 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Generate data from yaml during buildMatt Spinler2017-05-115-55/+65
| | | | | | | Run the python script to generate fan_zone_defs.cpp Change-Id: I242aa4246a277509ddbcf1c62fec96782a48b37b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Python script to generate monitor dataMatt Spinler2017-05-111-0/+73
| | | | | | | Generate the data structures from yaml data. Change-Id: I8e21fa099f9365b8c8c7d2227c4debc263601b72 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add inventory update supportMatt Spinler2017-05-112-2/+94
| | | | | | | | | Set a fan's Functional property to false when it has been out of spec for too long. When it is back in spec, set it back to functional. Change-Id: I264129479c58fd296df7c3a1d3d42f5d7aa7b60b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add timer start/stop supportMatt Spinler2017-05-111-1/+43
| | | | | | | | | | In Fan's tachChanged handler, start up the timer for a sensor if it is running too slow. If it is within spec, stop the timer if running and make the sensor functional again if necessary. Change-Id: Ib18de2b69942d334da0cb8cd4cc4de8a2784efab Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fill in main() functionMatt Spinler2017-05-111-1/+43
| | | | | | | Create the Fan objects, and start the dbus/event loop. Change-Id: I7c6a60bb5d2c20578b529e7e5f3dc13f50e55dd7 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add Timer support to TachSensorMatt Spinler2017-05-114-8/+59
| | | | | | | Add a Timer object to the TachSensor class Change-Id: I419b5712de9e8e94f2a08de84d13170e44c33c7a Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add dbus support to TachSensorMatt Spinler2017-05-115-1/+283
| | | | | | | | | | | | | | | TachSensor will match on properties changed signals for the Value and Target properties. When these occur, it will load in those properties and then tell the Fan class there was a change. Also, TachSensor will read in the Target property during construction so it will have a valid value to check against right away. Change-Id: I2dc2cacf5804826c6b0e0ea91196cbdaa4d5b893 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan and TachSensor class introductionMatt Spinler2017-05-115-1/+445
| | | | | | | | | | | | | A Fan object has one or more TachSensor objects. The TachSensor class is used to keep track of the the actual and expected speeds. It only tracks expected speeds if the _hasTarget attribute is true. Future commits will add more functionality. Change-Id: I9bb5fac39f25c5c31c18457ebedf82838fcf6641 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan monitor dataMatt Spinler2017-05-114-0/+94
| | | | | | | | | | | This commit contains the data that will be used by the monitor code. The generated.cpp file will later be generated during the build by a python script. Change-Id: I4dc4552ae8e58cd27478416888dd3363e7c2bf3f Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* phosphor-fan-monitor frameworkMatt Spinler2017-05-115-0/+47
| | | | | | | | | | | | | | | | This application will monitor the actual speeds of fans (via their sensors) and compare them to their expected speeds. If a fan is too slow for too long, it will have its Functional property in the inventory set to false. If it starts working again, the property will be set back to true. It will use configuration data to say which fans to check and which values to use for various timeout and deviation parameters. Change-Id: Ic61613018a758727835b70f2df0ecd1bf12e8256 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* phosphor-fan: Testcases for Timer classMatt Spinler2017-05-114-2/+395
| | | | | Change-Id: Id8b752cc6e494dcf76d9668553292a65a3fd19d6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* phosphor-fan: Create timer classMatt Spinler2017-05-113-1/+352
| | | | | | | | | This class can be used to call an arbitrary function after a certain amount of time, which is set in microseconds. Change-Id: Ifd65bbf0c3482db4e37efc3b1ccc868e62fa0afa Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Enable data generationMatt Spinler2017-05-046-26/+113
| | | | | | | | | | | | Start running the python script that generates the fan zone data structures during the build. If the paths to the 2 yaml files aren't provided during configure, then the yaml in the example directory will be used instead. Change-Id: I9f67c1b94b5302c30ac87b0f80746854c42776b2 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Generate structures from YAMLMatt Spinler2017-04-271-23/+103
| | | | | | | | | Using data from the zone and fan definition yaml files, generate a .cpp file with data structures that define the fan zones and the fans in those zones for a system. Change-Id: I5679ee692856e01138750f41bc23eb0cbb7f9464 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Python script frameworkMatt Spinler2017-04-271-0/+78
| | | | | | | | | The basics of a python script that will generate the fan zone data structures for the fan control code from zone and fan yaml files using a mako template. Change-Id: I1d92dc55c2b6dd986e5aaae0d3440ef85cbe79c0 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Fill in Manager classMatt Spinler2017-04-272-1/+44
| | | | | | | | Create Zone objects for the fan zones defined in the definition data that meet all conditions. Change-Id: I9c29be93716cd137f1c714355a0bd2a1c93271cd Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Create Zone classMatt Spinler2017-04-273-1/+137
| | | | | | | | This class represents a fan zone, which is a collection of fans that are always set to a speed together. Change-Id: I5646f07b7b136aad216dabded3b5da3e9da0a531 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Create Fan classMatt Spinler2017-04-273-0/+171
| | | | | | | | | | | This class contains the inventory name of the fan, and the sensor names representing the rotors. Calling setSpeed on this object will set the speed on all contained sensors. Change-Id: I850e2d69067813005270105618fcf69b04382b03 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Add getService() utility functionMatt Spinler2017-04-263-9/+35
| | | | | | | | | | | This function returns the service name from the mapper based on the dbus path and interface passed in. Eventually, getInvService can be removed and this call can be used instead. Change-Id: Ieb090a9b650803e8cfaf2f24143f25a4bbf1cd23 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Add Manager class and fan dataMatt Spinler2017-04-265-1/+120
| | | | | | | | | | | Create the fan manager class. Check in the fan zone data as a normal file. In a future commit this will be generated during the compile. It is required now for review and so everything compiles. Change-Id: I5733b81db80c5e072abdbffd42e335fa46c61ef8 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fan control: Add types for use with generated dataMatt Spinler2017-04-261-0/+34
| | | | | Change-Id: I9cb2037dc459516f577fc2bff91cccafea539eff Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* control: build: Use LDADD instead of LDFLAGSBrad Bishop2017-04-251-2/+7
| | | | | | | | LDFLAGS is for linker flags other than -lfoo: https://www.gnu.org/software/automake/manual/html_node/Linking.html Change-Id: I813e093ff8c7b824178d7170ca7c71982e49a53b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Create framework for phosphor-cooling-type appBrandon Wyman2017-04-245-0/+42
| | | | | | | | | | | | | | | | | An application called phosphor-cooling-type is being created in the phosphor-fan-presence repo under the chassis-cooling-type subdirectory. This application will update the D-Bus CoolingType properties for a cooling zone via passed in parameters. The current properties to be updated are AirCooling and WaterCooling. They will be set to true or false based the passed in parameters --air (set AirCooling to true), --water (set WaterCooling to true), and/or --gpio=<path> (path to a GPIO pin to read to determine if one or more properties should be set to true or false). Change-Id: I774065e29849aaa54653ae6188dc42aa846a1cf0 Signed-off-by: Brandon Wyman <bjwyman@gmail.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: Add disables for control and presence pkgsBrad Bishop2017-04-242-13/+36
| | | | | | | Allow granular control of built packages. Change-Id: Idaded1f149991b1d767f29e0762015f3ba4a0d9d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: Move presence to a subdirectoryBrad Bishop2017-04-2414-25/+37
| | | | | Change-Id: I33b28922107b9b041de3699e4a6eebd3d05ebdef Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud