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": 17000
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": 17000
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": 17000
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": 17000
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                "delay": 5,
254                "floor": 17000
255            }
256        ]
257    },
258    {
259        "name": "Set Proc 0 Core DVFS parameter",
260        "groups": [
261            {
262                "name": "proc 0 core dvfs temp",
263                "interface": "xyz.openbmc_project.Sensor.Value",
264                "property": { "name": "Value" }
265            }
266        ],
267        "triggers": [
268            {
269                "class": "init",
270                "method": "get_properties"
271            },
272            {
273                "class": "signal",
274                "signal": "interfaces_added"
275            },
276            {
277                "class": "signal",
278                "signal": "properties_changed"
279            }
280        ],
281        "actions": [
282            {
283                "name": "set_parameter_from_group_max",
284                "parameter_name": "proc_0_core_dvfs_increase_temp",
285                "modifier": {
286                    "operator": "minus",
287                    "value": 10
288                }
289            },
290            {
291                "name": "set_parameter_from_group_max",
292                "parameter_name": "proc_0_core_dvfs_decrease_temp",
293                "modifier": {
294                    "operator": "minus",
295                    "value": 13
296                }
297            }
298        ]
299    },
300    {
301        "name": "Set Proc 0 IO Ring DVFS parameter",
302        "groups": [
303            {
304                "name": "proc 0 ioring dvfs temp",
305                "interface": "xyz.openbmc_project.Sensor.Value",
306                "property": { "name": "Value" }
307            }
308        ],
309        "triggers": [
310            {
311                "class": "init",
312                "method": "get_properties"
313            },
314            {
315                "class": "signal",
316                "signal": "interfaces_added"
317            },
318            {
319                "class": "signal",
320                "signal": "properties_changed"
321            }
322        ],
323        "actions": [
324            {
325                "name": "set_parameter_from_group_max",
326                "parameter_name": "proc_0_ioring_dvfs_increase_temp",
327                "modifier": {
328                    "operator": "minus",
329                    "value": 10
330                }
331            },
332            {
333                "name": "set_parameter_from_group_max",
334                "parameter_name": "proc_0_ioring_dvfs_decrease_temp",
335                "modifier": {
336                    "operator": "minus",
337                    "value": 13
338                }
339            }
340        ]
341    },
342    {
343        // Collect group temperatures each iteration the repeating timer expires
344        "name": "Fan control timer loop",
345        "groups": [
346            {
347                "name": "proc0 core temps",
348                "interface": "xyz.openbmc_project.Sensor.Value",
349                "property": { "name": "Value" }
350            },
351            {
352                "name": "proc0 ioring temp",
353                "interface": "xyz.openbmc_project.Sensor.Value",
354                "property": { "name": "Value" }
355            },
356            {
357                "name": "dram temps",
358                "interface": "xyz.openbmc_project.Sensor.Value",
359                "property": { "name": "Value" }
360            },
361            {
362                "name": "internal memory buffer temps",
363                "interface": "xyz.openbmc_project.Sensor.Value",
364                "property": { "name": "Value" }
365            },
366            {
367                "name": "vdd vrm temps",
368                "interface": "xyz.openbmc_project.Sensor.Value",
369                "property": { "name": "Value" }
370            },
371            {
372                "name": "nvme temps",
373                "interface": "xyz.openbmc_project.Sensor.Value",
374                "property": { "name": "Value" }
375            }
376        ],
377        "triggers": [
378            {
379                "class": "timer",
380                "type": "repeating",
381                "interval": 2000000,
382                "preload_groups": true
383            }
384        ],
385        "actions": [
386            {
387                "name": "set_net_increase_target",
388                "groups": [
389                    {
390                        "name": "proc0 core temps",
391                        "interface": "xyz.openbmc_project.Sensor.Value",
392                        "property": { "name": "Value" }
393                    }
394                ],
395                "state_parameter_name": "proc_0_core_dvfs_increase_temp",
396                "delta": 300
397            },
398            {
399                "name": "set_net_increase_target",
400                "groups": [
401                    {
402                        "name": "proc0 ioring temp",
403                        "interface": "xyz.openbmc_project.Sensor.Value",
404                        "property": { "name": "Value" }
405                    }
406                ],
407                "state_parameter_name": "proc_0_ioring_dvfs_increase_temp",
408                "delta": 300
409            },
410            {
411                "name": "set_net_increase_target",
412                "groups": [
413                    {
414                        "name": "dram temps",
415                        "interface": "xyz.openbmc_project.Sensor.Value",
416                        "property": { "name": "Value" }
417                    }
418                ],
419                "state": 64.0,
420                "delta": 100
421            },
422            {
423                "name": "set_net_increase_target",
424                "groups": [
425                    {
426                        "name": "internal memory buffer temps",
427                        "interface": "xyz.openbmc_project.Sensor.Value",
428                        "property": { "name": "Value" }
429                    }
430                ],
431                "state": 74.0,
432                "delta": 100
433            },
434            {
435                "name": "set_net_increase_target",
436                "groups": [
437                    {
438                        "name": "vdd vrm temps",
439                        "interface": "xyz.openbmc_project.Sensor.Value",
440                        "property": { "name": "Value" }
441                    }
442                ],
443                "state": 82.0,
444                "delta": 300
445            },
446            {
447                "name": "set_net_increase_target",
448                "groups": [
449                    {
450                        "name": "nvme temps",
451                        "interface": "xyz.openbmc_project.Sensor.Value",
452                        "property": { "name": "Value" }
453                    }
454                ],
455                "state": 58.0,
456                "delta": 200
457            },
458            {
459                "name": "set_net_decrease_target",
460                "groups": [
461                    {
462                        "name": "proc0 core temps",
463                        "interface": "xyz.openbmc_project.Sensor.Value",
464                        "property": { "name": "Value" }
465                    }
466                ],
467                "state_parameter_name": "proc_0_core_dvfs_decrease_temp",
468                "delta": 50
469            },
470            {
471                "name": "set_net_decrease_target",
472                "groups": [
473                    {
474                        "name": "proc0 ioring temp",
475                        "interface": "xyz.openbmc_project.Sensor.Value",
476                        "property": { "name": "Value" }
477                    }
478                ],
479                "state_parameter_name": "proc_0_ioring_dvfs_decrease_temp",
480                "delta": 50
481            },
482            {
483                "name": "set_net_decrease_target",
484                "groups": [
485                    {
486                        "name": "dram temps",
487                        "interface": "xyz.openbmc_project.Sensor.Value",
488                        "property": { "name": "Value" }
489                    }
490                ],
491                "state": 61.0,
492                "delta": 40
493            },
494            {
495                "name": "set_net_decrease_target",
496                "groups": [
497                    {
498                        "name": "internal memory buffer temps",
499                        "interface": "xyz.openbmc_project.Sensor.Value",
500                        "property": { "name": "Value" }
501                    }
502                ],
503                "state": 71.0,
504                "delta": 40
505            },
506            {
507                "name": "set_net_decrease_target",
508                "groups": [
509                    {
510                        "name": "vdd vrm temps",
511                        "interface": "xyz.openbmc_project.Sensor.Value",
512                        "property": { "name": "Value" }
513                    }
514                ],
515                "state": 79.0,
516                "delta": 30
517            },
518            {
519                "name": "set_net_decrease_target",
520                "groups": [
521                    {
522                        "name": "nvme temps",
523                        "interface": "xyz.openbmc_project.Sensor.Value",
524                        "property": { "name": "Value" }
525                    }
526                ],
527                "state": 55.0,
528                "delta": 40
529            }
530        ]
531    },
532    {
533        // Remove NVMe temperature objects from cache when they are removed from
534        // dbus. There's no need to react to their removal.
535        "name": "remove nvme objects",
536        "groups": [
537            {
538                "name": "nvme temps",
539                "interface": "xyz.openbmc_project.Sensor.Value",
540                "property": { "name": "Value" }
541            },
542            {
543                "name": "nvme temps",
544                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
545                "property": { "name": "Functional" }
546            }
547        ],
548        "triggers": [
549            {
550                "class": "signal",
551                "signal": "interfaces_removed"
552            }
553        ]
554    },
555    {
556        "name": "set pcie floor index",
557        "groups": [
558            {
559                "name": "pcie slots",
560                "interface": "xyz.openbmc_project.State.Decorator.PowerState",
561                "property": {
562                    "name": "PowerState"
563                }
564            },
565            {
566                "name": "pcie cards",
567                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
568                "property": {
569                    "name": "Function0DeviceId"
570                }
571            },
572            {
573                "name": "pcie cards",
574                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
575                "property": {
576                    "name": "Function0VendorId"
577                }
578            },
579            {
580                "name": "pcie cards",
581                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
582                "property": {
583                    "name": "Function0SubsystemId"
584                }
585            },
586            {
587                "name": "pcie cards",
588                "interface": "xyz.openbmc_project.Inventory.Item.PCIeDevice",
589                "property": {
590                    "name": "Function0SubsystemVendorId"
591                }
592            }
593        ],
594        "triggers": [
595            {
596                "class": "init",
597                "method": "get_properties"
598            },
599            {
600                "class": "signal",
601                "signal": "properties_changed"
602            },
603            {
604                "class": "signal",
605                "signal": "interfaces_added"
606            }
607        ],
608        "actions": [
609            {
610                "name": "pcie_card_floors",
611                "use_config_specific_files": true,
612                "settle_time": 2
613            }
614        ]
615    },
616    {
617        "name": "Set altitude offset parameter",
618        "groups": [
619            {
620                "name": "altitude",
621                "interface": "xyz.openbmc_project.Sensor.Value",
622                "property": { "name": "Value" }
623            }
624        ],
625        "triggers": [
626            {
627                "class": "init",
628                "method": "get_properties"
629            },
630            {
631                "class": "signal",
632                "signal": "interfaces_added"
633            },
634            {
635                // Refresh altitude every 24hrs
636                "class": "timer",
637                "type": "repeating",
638                "interval": 86400000000,
639                "preload_groups": true
640            }
641        ],
642        "actions": [
643            {
644                "name": "set_parameter_from_group_max",
645                "parameter_name": "ambient_24_5_altitude_offset",
646                "modifier": {
647                    "operator": "less_than",
648                    "default_value": 10000,
649                    "value": [
650                        { "arg_value": 500, "parameter_value": 0 },
651                        { "arg_value": 1000, "parameter_value": 180 },
652                        { "arg_value": 1500, "parameter_value": 320 },
653                        { "arg_value": 2000, "parameter_value": 650 },
654                        { "arg_value": 2500, "parameter_value": 1010 },
655                        { "arg_value": 3050, "parameter_value": 1370 }
656                    ]
657                }
658            },
659            {
660                "name": "set_parameter_from_group_max",
661                "parameter_name": "ambient_29_5_altitude_offset",
662                "modifier": {
663                    "operator": "less_than",
664                    "default_value": 10000,
665                    "value": [
666                        { "arg_value": 500, "parameter_value": 0 },
667                        { "arg_value": 1000, "parameter_value": 200 },
668                        { "arg_value": 1500, "parameter_value": 340 },
669                        { "arg_value": 2000, "parameter_value": 580 },
670                        { "arg_value": 2500, "parameter_value": 950 },
671                        { "arg_value": 3050, "parameter_value": 1500 }
672                    ]
673                }
674            },
675            {
676                "name": "set_parameter_from_group_max",
677                "parameter_name": "ambient_34_5_altitude_offset",
678                "modifier": {
679                    "operator": "less_than",
680                    "default_value": 10000,
681                    "value": [
682                        { "arg_value": 500, "parameter_value": 0 },
683                        { "arg_value": 1000, "parameter_value": 250 },
684                        { "arg_value": 1500, "parameter_value": 580 },
685                        { "arg_value": 2000, "parameter_value": 980 },
686                        { "arg_value": 2500, "parameter_value": 1430 },
687                        { "arg_value": 3050, "parameter_value": 1930 }
688                    ]
689                }
690            },
691            {
692                "name": "set_parameter_from_group_max",
693                "parameter_name": "ambient_39_5_altitude_offset",
694                "modifier": {
695                    "operator": "less_than",
696                    "default_value": 10000,
697                    "value": [
698                        { "arg_value": 500, "parameter_value": 0 },
699                        { "arg_value": 1000, "parameter_value": 340 },
700                        { "arg_value": 1500, "parameter_value": 720 },
701                        { "arg_value": 2000, "parameter_value": 1180 },
702                        { "arg_value": 2500, "parameter_value": 1800 },
703                        { "arg_value": 3050, "parameter_value": 2550 }
704                    ]
705                }
706            },
707            {
708                "name": "set_parameter_from_group_max",
709                "parameter_name": "ambient_44_5_altitude_offset",
710                "modifier": {
711                    "operator": "less_than",
712                    "default_value": 10000,
713                    "value": [
714                        { "arg_value": 500, "parameter_value": 0 },
715                        { "arg_value": 1000, "parameter_value": 450 },
716                        { "arg_value": 1500, "parameter_value": 1050 },
717                        { "arg_value": 2000, "parameter_value": 1820 },
718                        { "arg_value": 2500, "parameter_value": 2590 },
719                        { "arg_value": 3050, "parameter_value": 3360 }
720                    ]
721                }
722            }
723        ]
724    },
725    {
726        "name": "Fan floors",
727        "groups": [
728            {
729                "name": "ambient temp",
730                "interface": "xyz.openbmc_project.Sensor.Value",
731                "property": { "name": "Value" }
732            }
733        ],
734        "triggers": [
735            {
736                "class": "init",
737                "method": "get_properties"
738            },
739            {
740                "class": "signal",
741                "signal": "properties_changed"
742            },
743            {
744                "class": "signal",
745                "signal": "interfaces_added"
746            },
747            {
748                "class": "parameter",
749                "parameter": "pcie_floor_index"
750            },
751            {
752                "class": "parameter",
753                "parameter": "ambient_24_5_altitude_offset"
754            },
755            {
756                "class": "parameter",
757                "parameter": "ambient_29_5_altitude_offset"
758            },
759            {
760                "class": "parameter",
761                "parameter": "ambient_34_5_altitude_offset"
762            },
763            {
764                "class": "parameter",
765                "parameter": "ambient_39_5_altitude_offset"
766            },
767            {
768                "class": "parameter",
769                "parameter": "ambient_44_5_altitude_offset"
770            }
771        ],
772        "actions": [
773            {
774                "name": "mapped_floor",
775                "key_group": "ambient temp",
776                "fan_floors": [
777                    {
778                        // Entry valid for temps < 24.5
779                        "key": 24.5,
780                        "default_floor": 4130,
781                        "floor_offset_parameter": "ambient_24_5_altitude_offset",
782                        "floors": [
783                            {
784                                "parameter": "pcie_floor_index",
785                                "floors": []
786                            }
787                        ]
788                    },
789                    {
790                        // Entry valid for temps < 29.5
791                        "key": 29.5,
792                        "default_floor": 4810,
793                        "floor_offset_parameter": "ambient_29_5_altitude_offset",
794                        "floors": [
795                            {
796                                "parameter": "pcie_floor_index",
797                                "floors": []
798                            }
799                        ]
800                    },
801                    {
802                        // Entry valid for temps < 34.5
803                        "key": 34.5,
804                        "default_floor": 5930,
805                        "floor_offset_parameter": "ambient_34_5_altitude_offset",
806                        "floors": [
807                            {
808                                "parameter": "pcie_floor_index",
809                                "floors": []
810                            }
811                        ]
812                    },
813                    {
814                        // Entry valid for temps < 39.5
815                        "key": 39.5,
816                        "default_floor": 7940,
817                        "floor_offset_parameter": "ambient_39_5_altitude_offset",
818                        "floors": [
819                            {
820                                "parameter": "pcie_floor_index",
821                                "floors": []
822                            }
823                        ]
824                    },
825                    {
826                        // Entry valid for temps < 44.5
827                        "key": 44.5,
828                        "default_floor": 10670,
829                        "floor_offset_parameter": "ambient_44_5_altitude_offset",
830                        "floors": [
831                            {
832                                "parameter": "pcie_floor_index",
833                                "floors": []
834                            }
835                        ]
836                    }
837                ]
838            }
839        ]
840    }
841]
842