control:p10bmc: Events to set DVFS temp params

Create the events that use the set_parameter_from_group_max action to
set parameters with the processor core and IO ring DVFS (Dynamic
Frequency and Voltage Slewing) temperatures, minus 3 degrees.
Subtracting 3 degrees allows the fans to start increasing before the
DVFS kicks in.  The value chosen is just a starting point.

Parameter names:
* proc_N_core_dvfs_temp
* proc_N_ioring_dvfs_temp

These parameters can then be used by the set_net_increase_target action
as the value to compare the actual temperatures against to know when to
start increasing fan targets.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I40320ef87b2e3ccd5ea6761b61b3c3fcc3f0b526
diff --git a/control/config_files/p10bmc/ibm,everest/events.json b/control/config_files/p10bmc/ibm,everest/events.json
index b52d0bd..8d9b8fa 100644
--- a/control/config_files/p10bmc/ibm,everest/events.json
+++ b/control/config_files/p10bmc/ibm,everest/events.json
@@ -160,5 +160,549 @@
         "floor": 10700
       }
     ]
-  }
+  },
+  {
+     "name": "Set Proc 0 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 0 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_0_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 1 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 1 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_1_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 2 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 2 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_2_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 3 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 3 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_3_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 4 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 4 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_4_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 5 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 5 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_5_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 6 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 6 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_6_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 7 Core DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 7 core dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_7_core_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 0 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 0 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_0_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 1 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 1 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_1_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 2 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 2 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_2_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 3 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 3 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_3_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 4 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 4 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_4_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 5 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 5 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_5_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 6 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 6 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_6_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   },
+   {
+     "name": "Set Proc 7 IO Ring DVFS parameter",
+     "groups": [
+       {
+         "name": "proc 7 ioring dvfs temp",
+         "interface": "xyz.openbmc_project.Sensor.Value",
+         "property": { "name": "Value" }
+       }
+     ],
+     "triggers": [
+       {
+         "class": "init",
+         "method": "get_properties"
+       },
+       {
+         "class": "signal",
+         "signal": "interfaces_added"
+       },
+       {
+         "class": "signal",
+         "signal": "properties_changed"
+       }
+     ],
+     "actions": [
+       {
+         "name": "set_parameter_from_group_max",
+         "parameter_name": "proc_7_ioring_dvfs_temp",
+         "modifier": {
+             "operator": "minus",
+             "value": 3
+         }
+       }
+     ]
+   }
 ]