blob: dbe9675b6a7ab71f73b0fea774f3ad64e4e84893 [file] [log] [blame]
Norman Jamesc9239a32015-10-06 16:54:31 -05001#! /usr/bin/python
2
3import dbus
4import Openbmc
5
6HOME_PATH = './'
Norman Jamesc9239a32015-10-06 16:54:31 -05007CACHE_PATH = HOME_PATH+'cache/'
8FRU_PATH = CACHE_PATH+'frus/'
Norman James25d80dd2015-10-08 07:02:25 -05009FLASH_DOWNLOAD_PATH = "/tmp"
10
11#use filename as system name, strip off path and ext
12parts = __file__.replace('.pyc','').split('/')
13SYSTEM_NAME = parts[len(parts)-1]
Norman Jamesc9239a32015-10-06 16:54:31 -050014
15SYSTEM_STATES = [
16 'INIT',
17 'STANDBY',
18 'POWERING_ON',
19 'POWERED_ON',
20 'BOOTING',
21 'HOST_UP',
22 'SHUTTING_DOWN',
23 'POWERING_DOWN'
24]
25
26ENTER_STATE_CALLBACK = {
27 'POWERED_ON' : {
28 'bus_name' : 'org.openbmc.control.Host',
29 'obj_name' : '/org/openbmc/control/Host_0',
30 'interface_name' : 'org.openbmc.control.Host',
31 'method_name' : 'boot'
32 }
33}
34
35SYSTEM_CONFIG = {}
36
37SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
38 'system_state' : 'INIT',
39 'start_process' : True,
40 'monitor_process' : True,
41 'process_name' : 'control_bmc.exe',
42 'heartbeat' : 'no',
43 'instances' : [ { 'name' : 'Bmc_0' } ]
44 }
45
46SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
47 'system_state' : 'STANDBY',
48 'start_process' : True,
49 'monitor_process' : True,
50 'process_name' : 'inventory_items.py',
51 'heartbeat' : 'no',
Norman James25d80dd2015-10-08 07:02:25 -050052 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -050053 }
54SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = {
Norman James25d80dd2015-10-08 07:02:25 -050055 'system_state' : 'POWERED_ON',
Norman Jamesc9239a32015-10-06 16:54:31 -050056 'start_process' : True,
57 'monitor_process' : False,
58 'process_name' : 'pcie_slot_present.exe',
59 'heartbeat' : 'no',
60 'instances' : [ { 'name' : 'Slots_0' } ]
61 }
62
63
64SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
65 'system_state' : 'STANDBY',
66 'start_process' : True,
67 'monitor_process' : True,
68 'process_name' : 'sensor_manager.py',
69 'heartbeat' : 'no',
Norman James25d80dd2015-10-08 07:02:25 -050070 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -050071 }
72
73SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
74 'system_state' : 'STANDBY',
75 'start_process' : True,
76 'monitor_process' : True,
77 'process_name' : 'host_watchdog.exe',
78 'heartbeat' : 'no',
79 'instances' : [
80 {
81 'name' : 'HostWatchdog_0',
82 'properties' : {
83 'org.openbmc.Watchdog' : {
84 'poll_interval': 3000,
85 }
86 }
87 }
88 ]
89 }
90
91SYSTEM_CONFIG['org.openbmc.control.Power'] = {
92 'system_state' : 'STANDBY',
93 'start_process' : True,
94 'monitor_process' : True,
95 'process_name' : 'power_control.exe',
96 'heartbeat' : 'yes',
97 'instances' : [
98 {
99 'name' : 'SystemPower_0',
100 'user_label': 'Power control',
101 'properties' : {
102 'org.openbmc.Control': {
103 'poll_interval' : 3000
104 },
105 'org.openbmc.control.Power': {
106 'pgood_timeout' : 10
107 }
108 }
109 }
110 ]
111 }
112
113SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
114 'system_state' : 'STANDBY',
115 'start_process' : True,
116 'monitor_process' : True,
117 'process_name' : 'sensor_ambient.exe',
118 'heartbeat' : 'yes',
119 'instances' : [
120 {
121 'name' : 'FrontChassis',
122 'user_label': 'Ambient Temperature 1',
123 'properties' : {
124 'org.openbmc.SensorValue': {
125 'poll_interval' : 5000,
126 },
127 'org.openbmc.SensorThreshold' : {
128 'lower_critical': 5,
129 'lower_warning' : 10,
130 'upper_warning' : 15,
131 'upper_critical': 20
132 },
133 'org.openbmc.SensorI2c' : {
134 'dev_path' : '/dev/i2c/i2c0',
135 'address' : '0xA0'
136 }
137 }
138 },
139 ]
140 }
141SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
142 'system_state' : 'STANDBY',
143 'start_process' : True,
144 'monitor_process' : True,
145 'process_name' : 'button_power.exe',
146 'heartbeat' : 'no',
147 'instances' : [ { 'name' : 'PowerButton_0' } ]
148 }
149SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
150 'system_state' : 'STANDBY',
151 'start_process' : True,
152 'monitor_process' : True,
153 'process_name' : 'sensor_host_status.exe',
154 'heartbeat' : "no",
155 'instances' : [ { 'name' : 'HostStatus_0' } ]
156 }
157SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
158 'system_state' : 'STANDBY',
159 'start_process' : True,
160 'monitor_process' : True,
161 'process_name' : 'chassis_identify.exe',
162 'heartbeat' : 'no',
163 'instances' : [ { 'name' : 'ChassisIdentify_0' } ]
164 }
165SYSTEM_CONFIG['org.openbmc.flash.Bios'] = {
166 'system_state' : 'STANDBY',
167 'start_process' : True,
168 'monitor_process' : True,
169 'process_name' : 'flash_bios.exe',
170 'heartbeat' : 'no',
171 'instances' : [ { 'name' : 'Bios_0' } ]
172 }
173
Norman Jamesf066e872015-10-07 15:29:51 -0500174SYSTEM_CONFIG['org.openbmc.manager.Download'] = {
Norman Jamesc9239a32015-10-06 16:54:31 -0500175 'system_state' : 'STANDBY',
176 'start_process' : True,
177 'monitor_process' : True,
Norman Jamesf066e872015-10-07 15:29:51 -0500178 'process_name' : 'download_manager.py',
Norman Jamesc9239a32015-10-06 16:54:31 -0500179 'heartbeat' : 'no',
Norman James25d80dd2015-10-08 07:02:25 -0500180 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500181 }
182
183SYSTEM_CONFIG['org.openbmc.control.Host'] = {
184 'system_state' : 'STANDBY',
185 'start_process' : True,
186 'monitor_process' : True,
187 'process_name' : 'control_host.exe',
188 'heartbeat' : 'no',
189 'instances' : [ { 'name' : 'Host_0' } ]
190 }
191SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
192 'system_state' : 'STANDBY',
193 'start_process' : True,
194 'monitor_process' : True,
195 'process_name' : 'chassis_control.py',
196 'heartbeat' : 'no',
197 'instances' : [ { 'name' : 'Chassis' } ]
198 }
199
200SYSTEM_CONFIG['org.openbmc.vpd'] = {
201 'system_state' : 'POWERING_ON',
202 'start_process' : True,
203 'monitor_process' : False,
204 'process_name' : 'board_vpd.exe',
205 'heartbeat' : 'no',
206 'instances' : [ { 'name' : 'MBVPD_0' } ]
207 }
208
209SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
210 'system_state' : 'BOOTED',
211 'start_process' : True,
212 'monitor_process' : True,
213 'process_name' : 'sensor_occ.exe',
214 'heartbeat' : 'no',
215 'instances' : [
216 {
217 'name' : 'Occ_0',
218 'properties' : {
219 'org.openbmc.Occ' : {
220 'poll_interval' : 3000,
221 }
222 }
223 },
224
225 ]
226 }
227
228SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
229 'system_state' : 'STANDBY',
230 'start_process' : True,
231 'monitor_process' : True,
232 'process_name' : 'fan.exe',
233 'heartbeat' : 'no',
234 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ]
235 }
236
237NON_CACHABLE_PROPERTIES = {
238 'name' : True,
239 'user_label' : True,
240 'location' : True,
241 'state' : True,
242 'cache' : True
243}
244INVENTORY_ROOT = '/org/openbmc/inventory/items'
245
246FRU_INSTANCES = {
247 '<inventory_root>/system' :
248 {
249 'fru_type' : Openbmc.FRU_TYPES['SYSTEM'],
250 'is_fru' : True,
251 },
252 '<inventory_root>/system/io_board' :
253 {
254 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
255 'manufacturer' : 'FOXCONN',
256 'is_fru' : True,
257 'location' : 'C1',
258 },
259
260 '<inventory_root>/system/motherboard' :
261 {
262 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
263 'manufacturer' : 'FOXCONN',
264 'is_fru' : True,
265 'location' : 'C0',
266 },
267 '<inventory_root>/system/fan0' :
268 {
269 'fru_type' : Openbmc.FRU_TYPES['FAN'],
270 'manufacturer' : 'DELTA',
271 'is_fru' : True,
272 'location' : 'F0',
273 },
274 '<inventory_root>/system/fan1' :
275 {
276 'fru_type' : Openbmc.FRU_TYPES['FAN'],
277 'manufacturer' : 'DELTA',
278 'is_fru' : True,
279 'location' : 'F1',
280 },
281 '<inventory_root>/system/io_board/bmc' :
282 {
283 'fru_type' : Openbmc.FRU_TYPES['BMC'],
284 'manufacturer' : 'ASPEED',
285 'is_fru' : False,
286 },
287 '<inventory_root>/system/motherboard/cpu0' :
288 {
289 'fru_type' : Openbmc.FRU_TYPES['CPU'],
290 'manufacturer' : 'IBM',
291 'is_fru' : True,
292 'location' : 'P0',
293 },
294 '<inventory_root>/system/motherboard/cpu0/core0' :
295 {
296 'fru_type' : Openbmc.FRU_TYPES['CORE'],
297 'is_fru' : False,
298 },
299 '<inventory_root>/system/motherboard/cpu0/core1' :
300 {
301 'fru_type' : Openbmc.FRU_TYPES['CORE'],
302 'is_fru' : False,
303 },
304 '<inventory_root>/system/motherboard/dimm0' :
305 {
306 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
307 'is_fru' : True,
308 },
309 '<inventory_root>/system/motherboard/dimm1' :
310 {
311 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
312 'is_fru' : True,
313 },
314 '<inventory_root>/system/motherboard/dimm2' :
315 {
316 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
317 'is_fru' : True,
318 },
319 '<inventory_root>/system/motherboard/dimm3' :
320 {
321 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
322 'is_fru' : True,
323 },
324 '<inventory_root>/system/io_board/pcie_slot0' :
325 {
326 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'],
327 'user_label' : 'PCIe card 0',
328 'is_fru' : True,
329 },
330 '<inventory_root>/system/io_board/pcie_slot1' :
331 {
332 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'],
333 'user_label' : 'PCIe card 1',
334 'is_fru' : True,
335 },
336}
337
338ID_LOOKUP = {
339 'FRU' : {
340 '14' : '<inventory_root>/system/motherboard/dimm0',
341 },
342 'SENSOR' : {
343 '21' : '<inventory_root>/system/motherboard/dimm0',
344 '14' : '/org/openbmc/sensors/HostStatus_0',
345 },
346 'GPIO_PRESENT' : {
347 'SLOT0_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_left_slot_riser',
348 'SLOT1_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_right_slot_riser',
349 'SLOT2_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_x16_slot_riser',
350 'SLOT0_PRESENT' : '<inventory_root>/system/io_board/pcie_slot0',
351 'SLOT1_PRESENT' : '<inventory_root>/system/io_board/pcie_slot1',
352 'SLOT2_PRESENT' : '<inventory_root>/system/io_board/pcie_slot2',
353 'MEZZ0_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz0',
354 'MEZZ1_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz1',
355 }
356}
357
358GPIO_CONFIG = {}
Norman James25d80dd2015-10-08 07:02:25 -0500359GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 484, 'direction': 'out' }
360GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 485, 'direction': 'out' }
361GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 504, 'direction': 'out' }
362GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 449, 'direction': 'out' }
363GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 486, 'direction': 'out' }
364GPIO_CONFIG['PGOOD'] = { 'gpio_num': 503, 'direction': 'in' }
365GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' }
366GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 448, 'direction': 'falling' }
Norman Jamesc9239a32015-10-06 16:54:31 -0500367GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 104, 'direction': 'in' }
368GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 105, 'direction': 'in' }
369GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 106, 'direction': 'in' }
370GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 107, 'direction': 'in' }
371GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 108, 'direction': 'in' }
372GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 109, 'direction': 'in' }
373GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 112, 'direction': 'in' }
374GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 113, 'direction': 'in' }
375
376