1[
2    {
3        // Hold fans at the given target when a number of fans are missing.
4        "name": "fan(s) missing",
5        "groups": [
6            {
7                "name": "fan inventory",
8                "interface": "xyz.openbmc_project.Inventory.Item",
9                "property": { "name": "Present" }
10            }
11        ],
12        "triggers": [
13            {
14                "class": "init",
15                "method": "get_properties"
16            },
17            {
18                "class": "signal",
19                "signal": "properties_changed"
20            }
21        ],
22        "actions": [
23            {
24                "name": "count_state_before_target",
25                "count": 1,
26                "state": false,
27                "target": 18000
28            }
29        ]
30    },
31    {
32        // Hold fans at the given target when a number of rotors are nonfunctional.
33        "name": "fan rotor(s) faulted",
34        "groups": [
35            {
36                "name": "fan0 rotor inventory",
37                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
38                "property": { "name": "Functional" }
39            },
40            {
41                "name": "fan1 rotor inventory",
42                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
43                "property": { "name": "Functional" }
44            }
45        ],
46        "triggers": [
47            {
48                "class": "init",
49                "method": "get_properties"
50            },
51            {
52                "class": "signal",
53                "signal": "properties_changed"
54            }
55        ],
56        "actions": [
57            {
58                "name": "count_state_before_target",
59                "count": 1,
60                "state": false,
61                "target": 18000
62            }
63        ]
64    },
65    {
66        // Hold fans at the given target when any critical service
67        // is not running for 5 seconds.
68        "name": "service(s) missing",
69        "groups": [
70            {
71                "name": "fan inventory",
72                "interface": "xyz.openbmc_project.Inventory.Item",
73                "property": { "name": "Present" }
74            },
75            {
76                "name": "occ objects",
77                "interface": "org.open_power.OCC.Status",
78                "property": { "name": "OccActive" }
79            },
80            {
81                "name": "nvme temps",
82                "interface": "xyz.openbmc_project.Sensor.Value",
83                "property": { "name": "Value" }
84            },
85            {
86                "name": "ambient temp",
87                "interface": "xyz.openbmc_project.Sensor.Value",
88                "property": { "name": "Value" }
89            },
90            {
91                "name": "altitude",
92                "interface": "xyz.openbmc_project.Sensor.Value",
93                "property": { "name": "Value" }
94            }
95        ],
96        "triggers": [
97            {
98                "class": "init",
99                "method": "name_has_owner"
100            },
101            {
102                "class": "signal",
103                "signal": "name_owner_changed"
104            }
105        ],
106        "actions": [
107            {
108                "name": "call_actions_based_on_timer",
109                "timer": {
110                    "interval": 5000000,
111                    "type": "oneshot"
112                },
113                "actions": [
114                    {
115                        "name": "set_target_on_missing_owner",
116                        "groups": [
117                            {
118                                "name": "fan inventory",
119                                "interface": "xyz.openbmc_project.Inventory.Item",
120                                "property": { "name": "Present" }
121                            },
122                            {
123                                "name": "occ objects",
124                                "interface": "org.open_power.OCC.Status",
125                                "property": { "name": "OccActive" }
126                            },
127                            {
128                                "name": "nvme temps",
129                                "interface": "xyz.openbmc_project.Sensor.Value",
130                                "property": { "name": "Value" }
131                            },
132                            {
133                                "name": "ambient temp",
134                                "interface": "xyz.openbmc_project.Sensor.Value",
135                                "property": { "name": "Value" }
136                            },
137                            {
138                                "name": "altitude",
139                                "interface": "xyz.openbmc_project.Sensor.Value",
140                                "property": { "name": "Value" }
141                            }
142                        ],
143                        "target": 18000
144                    }
145                ]
146            }
147        ]
148    },
149    {
150        // Set a fan floor if an OCC isn't active
151        "name": "Non-active OCCs",
152        "groups": [
153            {
154                "name": "occ objects",
155                "interface": "org.open_power.OCC.Status",
156                "property": {
157                    "name": "OccActive"
158                }
159            }
160        ],
161        "triggers": [
162            {
163                "class": "signal",
164                "signal": "properties_changed"
165            },
166            {
167                "class": "signal",
168                "signal": "interfaces_added"
169            },
170            {
171                "class": "init",
172                "method": "get_properties"
173            }
174        ],
175        "actions": [
176            {
177                "name": "count_state_floor",
178                "count": 1,
179                "state": false,
180                "floor": 18000
181            }
182        ]
183    },
184    {
185        // Set a raised fan floor when any temperature or altitude sensor is
186        // nonfunctional
187        "name": "Nonfunctional temperature sensors",
188        "groups": [
189            {
190                "name": "proc0 core temps",
191                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
192                "property": { "name": "Functional" }
193            },
194            {
195                "name": "proc0 ioring temp",
196                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
197                "property": { "name": "Functional" }
198            },
199            {
200                "name": "dram temps",
201                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
202                "property": { "name": "Functional" }
203            },
204            {
205                "name": "internal memory buffer temps",
206                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
207                "property": { "name": "Functional" }
208            },
209            {
210                "name": "vdd vrm temps",
211                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
212                "property": { "name": "Functional" }
213            },
214            {
215                "name": "nvme temps",
216                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
217                "property": { "name": "Functional" }
218            },
219            {
220                "name": "ambient temp",
221                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
222                "property": { "name": "Functional" }
223            },
224            {
225                "name": "altitude",
226                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
227                "property": { "name": "Functional" }
228            }
229        ],
230        "triggers": [
231            {
232                "class": "signal",
233                "signal": "properties_changed"
234            },
235            {
236                "class": "signal",
237                "signal": "interfaces_added"
238            },
239            {
240                "class": "signal",
241                "signal": "interfaces_removed"
242            },
243            {
244                "class": "init",
245                "method": "get_properties"
246            }
247        ],
248        "actions": [
249            {
250                "name": "count_state_floor",
251                "count": 1,
252                "state": false,
253                "floor": 18000
254            }
255        ]
256    },
257    {
258        "name": "Set Proc 0 Core DVFS parameter",
259        "groups": [
260            {
261                "name": "proc 0 core dvfs temp",
262                "interface": "xyz.openbmc_project.Sensor.Value",
263                "property": { "name": "Value" }
264            }
265        ],
266        "triggers": [
267            {
268                "class": "init",
269                "method": "get_properties"
270            },
271            {
272                "class": "signal",
273                "signal": "interfaces_added"
274            },
275            {
276                "class": "signal",
277                "signal": "properties_changed"
278            }
279        ],
280        "actions": [
281            {
282                "name": "set_parameter_from_group_max",
283                "parameter_name": "proc_0_core_dvfs_increase_temp",
284                "modifier": {
285                    "operator": "minus",
286                    "value": 10
287                }
288            },
289            {
290                "name": "set_parameter_from_group_max",
291                "parameter_name": "proc_0_core_dvfs_decrease_temp",
292                "modifier": {
293                    "operator": "minus",
294                    "value": 13
295                }
296            }
297        ]
298    },
299    {
300        "name": "Set Proc 0 IO Ring DVFS parameter",
301        "groups": [
302            {
303                "name": "proc 0 ioring dvfs temp",
304                "interface": "xyz.openbmc_project.Sensor.Value",
305                "property": { "name": "Value" }
306            }
307        ],
308        "triggers": [
309            {
310                "class": "init",
311                "method": "get_properties"
312            },
313            {
314                "class": "signal",
315                "signal": "interfaces_added"
316            },
317            {
318                "class": "signal",
319                "signal": "properties_changed"
320            }
321        ],
322        "actions": [
323            {
324                "name": "set_parameter_from_group_max",
325                "parameter_name": "proc_0_ioring_dvfs_increase_temp",
326                "modifier": {
327                    "operator": "minus",
328                    "value": 10
329                }
330            },
331            {
332                "name": "set_parameter_from_group_max",
333                "parameter_name": "proc_0_ioring_dvfs_decrease_temp",
334                "modifier": {
335                    "operator": "minus",
336                    "value": 13
337                }
338            }
339        ]
340    },
341    {
342        // Collect group temperatures each iteration the repeating timer expires
343        "name": "Fan control timer loop",
344        "groups": [
345            {
346                "name": "proc0 core temps",
347                "interface": "xyz.openbmc_project.Sensor.Value",
348                "property": { "name": "Value" }
349            },
350            {
351                "name": "proc0 ioring temp",
352                "interface": "xyz.openbmc_project.Sensor.Value",
353                "property": { "name": "Value" }
354            },
355            {
356                "name": "dram temps",
357                "interface": "xyz.openbmc_project.Sensor.Value",
358                "property": { "name": "Value" }
359            },
360            {
361                "name": "internal memory buffer temps",
362                "interface": "xyz.openbmc_project.Sensor.Value",
363                "property": { "name": "Value" }
364            },
365            {
366                "name": "vdd vrm temps",
367                "interface": "xyz.openbmc_project.Sensor.Value",
368                "property": { "name": "Value" }
369            },
370            {
371                "name": "nvme temps",
372                "interface": "xyz.openbmc_project.Sensor.Value",
373                "property": { "name": "Value" }
374            }
375        ],
376        "triggers": [
377            {
378                "class": "timer",
379                "type": "repeating",
380                "interval": 2000000,
381                "preload_groups": true
382            }
383        ],
384        "actions": [
385            {
386                "name": "set_net_increase_target",
387                "groups": [
388                    {
389                        "name": "proc0 core temps",
390                        "interface": "xyz.openbmc_project.Sensor.Value",
391                        "property": { "name": "Value" }
392                    }
393                ],
394                "state_parameter_name": "proc_0_core_dvfs_increase_temp",
395                "delta": 300
396            },
397            {
398                "name": "set_net_increase_target",
399                "groups": [
400                    {
401                        "name": "proc0 ioring temp",
402                        "interface": "xyz.openbmc_project.Sensor.Value",
403                        "property": { "name": "Value" }
404                    }
405                ],
406                "state_parameter_name": "proc_0_ioring_dvfs_increase_temp",
407                "delta": 300
408            },
409            {
410                "name": "set_net_increase_target",
411                "groups": [
412                    {
413                        "name": "dram temps",
414                        "interface": "xyz.openbmc_project.Sensor.Value",
415                        "property": { "name": "Value" }
416                    }
417                ],
418                "state": 68.0,
419                "delta": 100
420            },
421            {
422                "name": "set_net_increase_target",
423                "groups": [
424                    {
425                        "name": "internal memory buffer temps",
426                        "interface": "xyz.openbmc_project.Sensor.Value",
427                        "property": { "name": "Value" }
428                    }
429                ],
430                "state": 74.0,
431                "delta": 100
432            },
433            {
434                "name": "set_net_increase_target",
435                "groups": [
436                    {
437                        "name": "vdd vrm temps",
438                        "interface": "xyz.openbmc_project.Sensor.Value",
439                        "property": { "name": "Value" }
440                    }
441                ],
442                "state": 82.0,
443                "delta": 300
444            },
445            {
446                "name": "set_net_increase_target",
447                "groups": [
448                    {
449                        "name": "nvme temps",
450                        "interface": "xyz.openbmc_project.Sensor.Value",
451                        "property": { "name": "Value" }
452                    }
453                ],
454                "state": 58.0,
455                "delta": 200
456            },
457            {
458                "name": "set_net_decrease_target",
459                "groups": [
460                    {
461                        "name": "proc0 core temps",
462                        "interface": "xyz.openbmc_project.Sensor.Value",
463                        "property": { "name": "Value" }
464                    }
465                ],
466                "state_parameter_name": "proc_0_core_dvfs_decrease_temp",
467                "delta": 50
468            },
469            {
470                "name": "set_net_decrease_target",
471                "groups": [
472                    {
473                        "name": "proc0 ioring temp",
474                        "interface": "xyz.openbmc_project.Sensor.Value",
475                        "property": { "name": "Value" }
476                    }
477                ],
478                "state_parameter_name": "proc_0_ioring_dvfs_decrease_temp",
479                "delta": 50
480            },
481            {
482                "name": "set_net_decrease_target",
483                "groups": [
484                    {
485                        "name": "dram temps",
486                        "interface": "xyz.openbmc_project.Sensor.Value",
487                        "property": { "name": "Value" }
488                    }
489                ],
490                "state": 65.0,
491                "delta": 40
492            },
493            {
494                "name": "set_net_decrease_target",
495                "groups": [
496                    {
497                        "name": "internal memory buffer temps",
498                        "interface": "xyz.openbmc_project.Sensor.Value",
499                        "property": { "name": "Value" }
500                    }
501                ],
502                "state": 71.0,
503                "delta": 40
504            },
505            {
506                "name": "set_net_decrease_target",
507                "groups": [
508                    {
509                        "name": "vdd vrm temps",
510                        "interface": "xyz.openbmc_project.Sensor.Value",
511                        "property": { "name": "Value" }
512                    }
513                ],
514                "state": 79.0,
515                "delta": 30
516            },
517            {
518                "name": "set_net_decrease_target",
519                "groups": [
520                    {
521                        "name": "nvme temps",
522                        "interface": "xyz.openbmc_project.Sensor.Value",
523                        "property": { "name": "Value" }
524                    }
525                ],
526                "state": 55.0,
527                "delta": 40
528            }
529        ]
530    },
531    {
532        // Remove NVMe temperature objects from cache when they are removed from
533        // dbus. There's no need to react to their removal.
534        "name": "remove nvme objects",
535        "groups": [
536            {
537                "name": "nvme temps",
538                "interface": "xyz.openbmc_project.Sensor.Value",
539                "property": { "name": "Value" }
540            },
541            {
542                "name": "nvme temps",
543                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
544                "property": { "name": "Functional" }
545            }
546        ],
547        "triggers": [
548            {
549                "class": "signal",
550                "signal": "interfaces_removed"
551            }
552        ]
553    },
554    {
555        "name": "set pcie floor index",
556        "groups": [
557            {
558                "name": "pcie slots",
559                "interface": "xyz.openbmc_project.State.Decorator.PowerState",
560                "property": {
561                    "name": "PowerState"
562                }
563            },
564            {
565                "name": "pcie cards",
566                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
567                "property": {
568                    "name": "Function0DeviceId"
569                }
570            },
571            {
572                "name": "pcie cards",
573                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
574                "property": {
575                    "name": "Function0VendorId"
576                }
577            },
578            {
579                "name": "pcie cards",
580                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
581                "property": {
582                    "name": "Function0SubsystemId"
583                }
584            },
585            {
586                "name": "pcie cards",
587                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
588                "property": {
589                    "name": "Function0SubsystemVendorId"
590                }
591            }
592        ],
593        "triggers": [
594            {
595                "class": "init",
596                "method": "get_properties"
597            },
598            {
599                "class": "signal",
600                "signal": "properties_changed"
601            },
602            {
603                "class": "signal",
604                "signal": "interfaces_added"
605            }
606        ],
607        "actions": [
608            {
609                "name": "pcie_card_floors",
610                "use_config_specific_files": true,
611                "settle_time": 2
612            }
613        ]
614    },
615    {
616        "name": "Set altitude offset parameter",
617        "groups": [
618            {
619                "name": "altitude",
620                "interface": "xyz.openbmc_project.Sensor.Value",
621                "property": { "name": "Value" }
622            }
623        ],
624        "triggers": [
625            {
626                "class": "init",
627                "method": "get_properties"
628            },
629            {
630                "class": "signal",
631                "signal": "interfaces_added"
632            },
633            {
634                // Refresh altitude every 24hrs
635                "class": "timer",
636                "type": "repeating",
637                "interval": 86400000000,
638                "preload_groups": true
639            }
640        ],
641        "actions": [
642            {
643                "name": "set_parameter_from_group_max",
644                "parameter_name": "ambient_20_altitude_offset",
645                "modifier": {
646                    "operator": "less_than",
647                    "default_value": 10000,
648                    "value": [
649                        { "arg_value": 500, "parameter_value": 0 },
650                        { "arg_value": 1000, "parameter_value": 700 },
651                        { "arg_value": 1500, "parameter_value": 1600 },
652                        { "arg_value": 2000, "parameter_value": 2300 },
653                        { "arg_value": 2500, "parameter_value": 3200 },
654                        { "arg_value": 3300, "parameter_value": 4000 }
655                    ]
656                }
657            },
658            {
659                "name": "set_parameter_from_group_max",
660                "parameter_name": "ambient_25_altitude_offset",
661                "modifier": {
662                    "operator": "less_than",
663                    "default_value": 10000,
664                    "value": [
665                        { "arg_value": 500, "parameter_value": 0 },
666                        { "arg_value": 1000, "parameter_value": 1000 },
667                        { "arg_value": 1500, "parameter_value": 2100 },
668                        { "arg_value": 2000, "parameter_value": 3100 },
669                        { "arg_value": 2500, "parameter_value": 4100 },
670                        { "arg_value": 3300, "parameter_value": 4900 }
671                    ]
672                }
673            },
674            {
675                "name": "set_parameter_from_group_max",
676                "parameter_name": "ambient_30_altitude_offset",
677                "modifier": {
678                    "operator": "less_than",
679                    "default_value": 10000,
680                    "value": [
681                        { "arg_value": 500, "parameter_value": 0 },
682                        { "arg_value": 1000, "parameter_value": 1000 },
683                        { "arg_value": 1500, "parameter_value": 2100 },
684                        { "arg_value": 2000, "parameter_value": 3200 },
685                        { "arg_value": 2500, "parameter_value": 4000 },
686                        { "arg_value": 3300, "parameter_value": 4800 }
687                    ]
688                }
689            },
690            {
691                "name": "set_parameter_from_group_max",
692                "parameter_name": "ambient_35_altitude_offset",
693                "modifier": {
694                    "operator": "less_than",
695                    "default_value": 10000,
696                    "value": [
697                        { "arg_value": 500, "parameter_value": 0 },
698                        { "arg_value": 1000, "parameter_value": 900 },
699                        { "arg_value": 1500, "parameter_value": 1700 },
700                        { "arg_value": 2000, "parameter_value": 2500 },
701                        { "arg_value": 2500, "parameter_value": 3400 },
702                        { "arg_value": 3300, "parameter_value": 4200 }
703                    ]
704                }
705            },
706            {
707                "name": "set_parameter_from_group_max",
708                "parameter_name": "ambient_40_altitude_offset",
709                "modifier": {
710                    "operator": "less_than",
711                    "default_value": 10000,
712                    "value": [
713                        { "arg_value": 500, "parameter_value": 0 },
714                        { "arg_value": 1000, "parameter_value": 1000 },
715                        { "arg_value": 1500, "parameter_value": 1900 },
716                        { "arg_value": 2000, "parameter_value": 2800 },
717                        { "arg_value": 2500, "parameter_value": 3700 },
718                        { "arg_value": 3300, "parameter_value": 4500 }
719                    ]
720                }
721            }
722        ]
723    },
724    {
725        "name": "Fan floors",
726        "groups": [
727            {
728                "name": "ambient temp",
729                "interface": "xyz.openbmc_project.Sensor.Value",
730                "property": { "name": "Value" }
731            }
732        ],
733        "triggers": [
734            {
735                "class": "init",
736                "method": "get_properties"
737            },
738            {
739                "class": "signal",
740                "signal": "properties_changed"
741            },
742            {
743                "class": "signal",
744                "signal": "interfaces_added"
745            },
746            {
747                "class": "parameter",
748                "parameter": "pcie_floor_index"
749            },
750            {
751                "class": "parameter",
752                "parameter": "ambient_20_altitude_offset"
753            },
754            {
755                "class": "parameter",
756                "parameter": "ambient_25_altitude_offset"
757            },
758            {
759                "class": "parameter",
760                "parameter": "ambient_30_altitude_offset"
761            },
762            {
763                "class": "parameter",
764                "parameter": "ambient_35_altitude_offset"
765            },
766            {
767                "class": "parameter",
768                "parameter": "ambient_40_altitude_offset"
769            }
770        ],
771        "actions": [
772            {
773                "name": "mapped_floor",
774                "key_group": "ambient temp",
775                "fan_floors": [
776                    {
777                        // Entry valid for temps < 20
778                        "key": 20,
779                        "default_floor": 5400,
780                        "floor_offset_parameter": "ambient_20_altitude_offset",
781                        "floors": [
782                            {
783                                "parameter": "pcie_floor_index",
784                                "floors": [
785                                    { "value": 1, "floor": 5600 },
786                                    { "value": 2, "floor": 9000 },
787                                    { "value": 3, "floor": 9000 },
788                                    { "value": 4, "floor": 9200 },
789                                    { "value": 5, "floor": 10600 }
790                                ]
791                            }
792                        ]
793                    },
794                    {
795                        // Entry valid for temps < 25
796                        "key": 25,
797                        "default_floor": 6500,
798                        "floor_offset_parameter": "ambient_25_altitude_offset",
799                        "floors": [
800                            {
801                                "parameter": "pcie_floor_index",
802                                "floors": [
803                                    { "value": 1, "floor": 7800 },
804                                    { "value": 2, "floor": 10700 },
805                                    { "value": 3, "floor": 11300 },
806                                    { "value": 4, "floor": 12700 },
807                                    { "value": 5, "floor": 13900 }
808                                ]
809                            }
810                        ]
811                    },
812                    {
813                        // Entry valid for temps < 30
814                        "key": 30,
815                        "default_floor": 6500,
816                        "floor_offset_parameter": "ambient_30_altitude_offset",
817                        "floors": [
818                            {
819                                "parameter": "pcie_floor_index",
820                                "floors": [
821                                    { "value": 1, "floor": 10300 },
822                                    { "value": 2, "floor": 12100 },
823                                    { "value": 3, "floor": 14400 },
824                                    { "value": 4, "floor": 16300 },
825                                    { "value": 5, "floor": 17200 }
826                                ]
827                            }
828                        ]
829                    },
830                    {
831                        // Entry valid for temps < 35
832                        "key": 35,
833                        "default_floor": 8500,
834                        "floor_offset_parameter": "ambient_35_altitude_offset",
835                        "floors": [
836                            {
837                                "parameter": "pcie_floor_index",
838                                "floors": [
839                                    { "value": 1, "floor": 12700 },
840                                    { "value": 2, "floor": 13500 },
841                                    { "value": 3, "floor": 17400 },
842                                    { "value": 4, "floor": 18000 },
843                                    { "value": 5, "floor": 18000 }
844                                ]
845                            }
846                        ]
847                    },
848                    {
849                        // Entry valid for temps < 40
850                        "key": 40,
851                        "default_floor": 12600,
852                        "floor_offset_parameter": "ambient_40_altitude_offset",
853                        "floors": [
854                            {
855                                "parameter": "pcie_floor_index",
856                                "floors": [
857                                    { "value": 1, "floor": 15000 },
858                                    { "value": 2, "floor": 15500 },
859                                    { "value": 3, "floor": 18000 },
860                                    { "value": 4, "floor": 18000 },
861                                    { "value": 5, "floor": 18000 }
862                                ]
863                            }
864                        ]
865                    }
866                ]
867            }
868        ]
869    }
870]
871