blob: 9309015652096f9ec9b79e5ffe7e65bb8255ff41 [file] [log] [blame]
Gunnar Mills55651ee2017-08-15 15:45:07 -05001# Witherspoon power supply policy for PDM.
2#
3# Create an error if a power supply is removed while the system is powered on
4
5- name: power supply0
6 class: group
7 group: path
8 members:
9 - meta: POWER SUPPLY
Brandon Wyman8d5dacf2017-11-02 18:50:37 -050010 path: /xyz/openbmc_project/inventory/system/chassis/powersupply0
Gunnar Mills55651ee2017-08-15 15:45:07 -050011
12- name: power supply1
13 class: group
14 group: path
15 members:
16 - meta: POWER SUPPLY
Brandon Wyman8d5dacf2017-11-02 18:50:37 -050017 path: /xyz/openbmc_project/inventory/system/chassis/powersupply1
Gunnar Mills55651ee2017-08-15 15:45:07 -050018
19- name: power supplies
20 description: >
21 'A Witherspoon has two power supplies to monitor.'
22 class: group
23 group: path
24 members:
25 - meta: POWER SUPPLY
Brandon Wyman8d5dacf2017-11-02 18:50:37 -050026 path: /xyz/openbmc_project/inventory/system/chassis/powersupply0
Gunnar Mills55651ee2017-08-15 15:45:07 -050027 - meta: POWER SUPPLY
Brandon Wyman8d5dacf2017-11-02 18:50:37 -050028 path: /xyz/openbmc_project/inventory/system/chassis/powersupply1
Gunnar Mills55651ee2017-08-15 15:45:07 -050029
30- name: chassis state
31 description: >
32 'A Witherspoon has a single chassis to monitor.'
33 class: group
34 group: path
35 members:
36 - meta: CHASSISSTATE
37 path: /xyz/openbmc_project/state/chassis0
38
39- name: power supply present
40 description: >
41 'Monitor the presence state of each power supply.'
42 class: group
43 group: property
44 type: boolean
45 members:
46 - interface: xyz.openbmc_project.Inventory.Item
47 meta: PRESENT
48 property: Present
49
50- name: chassis powered
51 description: >
52 'Monitor the chassis power state.'
53 class: group
54 group: property
55 type: string
56 members:
57 - interface: xyz.openbmc_project.State.Chassis
58 meta: CHASSIS_STATE
59 property: CurrentPowerState
60
61- name: watch power supply present
62 description: >
63 'Trigger logic on power supply presence state changes.'
64 class: watch
65 watch: property
66 paths: power supplies
67 properties: power supply present
68 callback: check power
69
70- name: watch chassis state
71 description: >
72 'Trigger logic on chassis power state changes.'
73 class: watch
74 watch: property
75 paths: chassis state
76 properties: chassis powered
77 callback: check power
78
79- name: check power
80 description: >
81 'If the chassis has power, check for power supplies.'
82 class: condition
83 condition: count
84 paths: chassis state
85 properties: chassis powered
86 callback: check power supplies
87 countop: '>'
88 countbound: 0
89 op: '=='
90 bound: xyz.openbmc_project.State.Chassis.PowerState.On
91
92- name: check power supplies
93 description: >
94 'Create an error if a power supply is not present.'
95 class: callback
96 callback: group
97 members:
98 - check power supply0 presence
99 - check power supply1 presence
100
101- name: check power supply0 presence
102 description: >
103 'If this condition passes power supply0 has been unplugged for more than
104 5 seconds. Count present power supplies rather than non-present
105 power supplies since the latter would pass if the power supply has not
106 been created for some reason.
107
108 For a more detailed definition of unplugged, consult the documentation
109 of xyz.openbmc_project.Inventory.Item and/or the documentation
110 of the power supply inventory object implementation.'
111 class: condition
112 condition: count
113 paths: power supply0
114 properties: power supply present
115 defer: 5000000us
116 callback: notpresent power supply0 error
117 countop: '<'
118 countbound: 1
119 op: '=='
120 bound: true
121
122- name: check power supply1 presence
123 description: >
124 'If this condition passes power supply1 has been unplugged for more than
125 5 seconds.'
126 class: condition
127 condition: count
128 paths: power supply1
129 properties: power supply present
130 defer: 5000000us
131 callback: notpresent power supply1 error
132 countop: '<'
133 countbound: 1
134 op: '=='
135 bound: true
136
137- name: notpresent power supply0 error
138 class: callback
139 callback: elog
140 paths: power supply0
141 properties: power supply present
142 error: xyz::openbmc_project::Inventory::Error::NotPresent
143 metadata:
144 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
Brandon Wyman8d5dacf2017-11-02 18:50:37 -0500145 value: /xyz/openbmc_project/inventory/system/chassis/powersupply0
Gunnar Mills55651ee2017-08-15 15:45:07 -0500146 type: string
147
148- name: notpresent power supply1 error
149 class: callback
150 callback: elog
151 paths: power supply1
152 properties: power supply present
153 error: xyz::openbmc_project::Inventory::Error::NotPresent
154 metadata:
155 - name: xyz::openbmc_project::Inventory::NotPresent::CALLOUT_INVENTORY_PATH
Brandon Wyman8d5dacf2017-11-02 18:50:37 -0500156 value: /xyz/openbmc_project/inventory/system/chassis/powersupply1
Gunnar Mills55651ee2017-08-15 15:45:07 -0500157 type: string