blob: d7c596be68c4336c38762582f7c52a6788cda1c9 [file] [log] [blame]
Norman Jamesce46e3e2015-08-30 22:25:55 -05001#! /usr/bin/python
Norman James9e6acf92015-09-08 07:00:04 -05002
3## todos: event logger,
Norman Jamesce46e3e2015-08-30 22:25:55 -05004import dbus
5import Openbmc
6
Norman James88872672015-09-21 16:51:35 -05007HOME_PATH = './'
8BIN_PATH = HOME_PATH
Norman James5d78b4d2015-09-05 13:34:34 -05009CACHE_PATH = HOME_PATH+'cache/'
Norman James362a80f2015-09-14 14:04:39 -050010FRU_PATH = CACHE_PATH+'frus/'
Norman James5d78b4d2015-09-05 13:34:34 -050011
Norman James362a80f2015-09-14 14:04:39 -050012SYSTEM_STATES = [
13 'INIT',
14 'STANDBY',
15 'POWERING_ON',
16 'POWERED_ON',
17 'BOOTING',
18 'HOST_UP',
19 'SHUTTING_DOWN',
20 'POWERING_DOWN'
21]
22
23ENTER_STATE_CALLBACK = {
24 'POWERED_ON' : {
25 'bus_name' : 'org.openbmc.control.Host',
26 'obj_name' : '/org/openbmc/control/Host_0',
27 'interface_name' : 'org.openbmc.control.Host',
28 'method_name' : 'boot'
29 }
Norman James90baede2015-09-02 20:32:49 -050030}
31
Norman Jamesce46e3e2015-08-30 22:25:55 -050032SYSTEM_CONFIG = {}
33
Norman James362a80f2015-09-14 14:04:39 -050034SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
35 'system_state' : 'INIT',
Norman James9e6acf92015-09-08 07:00:04 -050036 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050037 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -050038 'process_name' : 'control_bmc.exe',
Norman James9e6acf92015-09-08 07:00:04 -050039 'heartbeat' : 'no',
Norman James9e6acf92015-09-08 07:00:04 -050040 'instances' : [
41 {
Norman James362a80f2015-09-14 14:04:39 -050042 'name' : 'Bmc_0',
43 'user_label': 'Master Bmc',
Norman James9e6acf92015-09-08 07:00:04 -050044 }
45 ]
46 }
47
Norman James362a80f2015-09-14 14:04:39 -050048SYSTEM_CONFIG['org.openbmc.managers.Frus'] = {
49 'system_state' : 'STANDBY',
50 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050051 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -050052 'process_name' : 'fru_manager.py',
53 'heartbeat' : 'no',
54 'rest_name' : 'frus',
55 'instances' : [
56 {
57 'name' : 'Barreleye',
58 'user_label': 'Fru Manager',
59 }
60 ]
61 }
62
63SYSTEM_CONFIG['org.openbmc.managers.Ipmi'] = {
64 'system_state' : 'STANDBY',
65 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050066 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -050067 'process_name' : 'ipmi_manager.py',
68 'heartbeat' : 'no',
69 'rest_name' : 'frus',
70 'instances' : [
71 {
72 'name' : 'Barreleye',
Norman James88872672015-09-21 16:51:35 -050073 'user_label': 'Ipmi Manager',
Norman James362a80f2015-09-14 14:04:39 -050074 }
75 ]
76 }
77
78
Norman James90baede2015-09-02 20:32:49 -050079SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman James362a80f2015-09-14 14:04:39 -050080 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050081 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050082 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -050083 'process_name' : 'sensor_manager.py',
Norman James90baede2015-09-02 20:32:49 -050084 'heartbeat' : 'no',
85 'rest_name' : 'sensors',
86 'instances' : [
87 {
88 'name' : 'Barreleye',
89 'user_label': 'Sensor Manager',
90 }
91 ]
92 }
93
Norman Jamesce46e3e2015-08-30 22:25:55 -050094SYSTEM_CONFIG['org.openbmc.loggers.EventLogger'] = {
Norman James88872672015-09-21 16:51:35 -050095 'system_state' : 'INIT',
96 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -050097 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -050098 'process_name' : 'eventlogger.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -050099 'heartbeat' : 'no',
100 'rest_name' : 'events',
101 'instances' : [
102 {
Norman James90baede2015-09-02 20:32:49 -0500103 'name' : 'Barreleye',
104 'user_label': 'Event Logger',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500105 }
106 ]
107 }
108
Norman James362a80f2015-09-14 14:04:39 -0500109SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
110 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500111 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500112 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500113 'process_name' : 'host_watchdog.exe',
Norman James90baede2015-09-02 20:32:49 -0500114 'heartbeat' : 'no',
Norman James362a80f2015-09-14 14:04:39 -0500115 'rest_name' : 'watchdog',
Norman James90baede2015-09-02 20:32:49 -0500116 'instances' : [
117 {
Norman James362a80f2015-09-14 14:04:39 -0500118 'name' : 'HostWatchdog_0',
119 'user_label': 'Host Watchdog',
120 'properties' : {
121 'org.openbmc.Watchdog' : {
122 'poll_interval': 3000,
123 }
124 }
Norman James90baede2015-09-02 20:32:49 -0500125 }
126 ]
127 }
128
Norman Jamesce46e3e2015-08-30 22:25:55 -0500129SYSTEM_CONFIG['org.openbmc.control.Power'] = {
Norman James362a80f2015-09-14 14:04:39 -0500130 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500131 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500132 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500133 'process_name' : 'power_control.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500134 'heartbeat' : 'yes',
135 'instances' : [
136 {
Norman James362a80f2015-09-14 14:04:39 -0500137 'name' : 'SystemPower_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500138 'user_label': 'Power control',
Norman James9e6acf92015-09-08 07:00:04 -0500139 'properties' : {
140 'org.openbmc.Control': {
141 'poll_interval' : 3000
Norman James32e74e22015-09-15 21:28:06 -0500142 },
143 'org.openbmc.control.Power': {
Norman James88872672015-09-21 16:51:35 -0500144 'pgood_timeout' : 10
Norman James9e6acf92015-09-08 07:00:04 -0500145 }
146 }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500147 }
148 ]
149 }
150
151SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
Norman James362a80f2015-09-14 14:04:39 -0500152 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500153 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500154 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500155 'process_name' : 'sensor_ambient.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500156 'heartbeat' : 'yes',
157 'instances' : [
158 {
Norman James362a80f2015-09-14 14:04:39 -0500159 'name' : 'FrontChassis',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500160 'user_label': 'Ambient Temperature 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500161 'properties' : {
Norman James9e6acf92015-09-08 07:00:04 -0500162 'org.openbmc.SensorValue': {
Norman James362a80f2015-09-14 14:04:39 -0500163 'poll_interval' : 5000,
Norman James9e6acf92015-09-08 07:00:04 -0500164 },
Norman James5d78b4d2015-09-05 13:34:34 -0500165 'org.openbmc.SensorThreshold' : {
Norman Jamesce46e3e2015-08-30 22:25:55 -0500166 'lower_critical': 5,
167 'lower_warning' : 10,
168 'upper_warning' : 15,
169 'upper_critical': 20
Norman James90baede2015-09-02 20:32:49 -0500170 },
171 'org.openbmc.SensorI2c' : {
172 'dev_path' : '/dev/i2c/i2c0',
173 'address' : '0xA0'
Norman Jamesce46e3e2015-08-30 22:25:55 -0500174 }
175 }
176 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500177 ]
178 }
Norman James362a80f2015-09-14 14:04:39 -0500179SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
180 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500181 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500182 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500183 'process_name' : 'button_power.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500184 'heartbeat' : 'no',
185 'instances' : [
186 {
Norman James362a80f2015-09-14 14:04:39 -0500187 'name' : 'PowerButton_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500188 'user_label': 'Main Power Button',
189 }
190 ]
191 }
192SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
Norman James362a80f2015-09-14 14:04:39 -0500193 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500194 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500195 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500196 'process_name' : 'sensor_host_status.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500197 'heartbeat' : "no",
198 'instances' : [
199 {
Norman James362a80f2015-09-14 14:04:39 -0500200 'name' : 'HostStatus_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500201 'user_label': 'Host Status',
Norman James362a80f2015-09-14 14:04:39 -0500202 'properties' : {
203 'org.openbmc.SensorValue': {
204 'ipmi_id' : 43,
205 },
206 }
207
Norman Jamesce46e3e2015-08-30 22:25:55 -0500208 }
209 ]
210 }
211SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
Norman James362a80f2015-09-14 14:04:39 -0500212 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500213 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500214 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500215 'process_name' : 'chassis_identify.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500216 'heartbeat' : 'no',
217 'instances' : [
218 {
Norman James362a80f2015-09-14 14:04:39 -0500219 'name' : 'ChassisIdentify_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500220 'user_label': 'Chassis Identify LED',
221 }
222 ]
223 }
224SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = {
Norman James362a80f2015-09-14 14:04:39 -0500225 'system_state' : 'STANDBY',
Norman James88872672015-09-21 16:51:35 -0500226 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -0500227 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500228 'process_name' : 'flash_bios.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500229 'heartbeat' : 'no',
230 'rest_name' : 'flash',
231 'instances' : [
232 {
Norman James362a80f2015-09-14 14:04:39 -0500233 'name' : 'BIOS_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500234 'user_label': 'BIOS SPI Flash',
235 }
236 ]
237 }
238SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman James362a80f2015-09-14 14:04:39 -0500239 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500240 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500241 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500242 'process_name' : 'control_host.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500243 'heartbeat' : 'no',
244 'instances' : [
245 {
Norman James362a80f2015-09-14 14:04:39 -0500246 'name' : 'Host_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500247 'user_label': 'Host Control',
248 }
249 ]
250 }
251SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
Norman James362a80f2015-09-14 14:04:39 -0500252 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500253 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500254 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500255 'process_name' : 'chassis_control.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500256 'heartbeat' : 'no',
257 'rest_name' : 'chassis',
258 'instances' : [
259 {
260 'name' : 'Chassis',
261 'user_label': 'Chassis Control',
262 }
263 ]
264 }
Norman James362a80f2015-09-14 14:04:39 -0500265
Norman James6f8d0422015-09-14 18:48:00 -0500266SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman James362a80f2015-09-14 14:04:39 -0500267 'system_state' : 'POWERED_ON',
268 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500269 'monitor_process' : False,
270 'process_name' : 'board_vpd.exe',
271 'heartbeat' : 'no',
272 'instances' : [
273 {
274 'name' : 'MBVPD_0',
275 'user_label': 'VPD',
276 },
277
278 ]
279 }
280
281SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
Norman James2d1ee892015-09-16 23:13:45 -0500282 'system_state' : 'BOOTED',
Norman James6f8d0422015-09-14 18:48:00 -0500283 'start_process' : True,
284 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500285 'process_name' : 'sensor_occ.exe',
286 'heartbeat' : 'no',
287 'instances' : [
288 {
289 'name' : 'Occ_0',
290 'user_label': 'CPU0',
291 'properties' : {
292 'org.openbmc.Occ' : {
293 'poll_interval' : 3000,
294 }
295 }
296 },
297
298 ]
299 }
300
301SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
302 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500303 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500304 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500305 'process_name' : 'fan.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500306 'heartbeat' : 'no',
Norman James90baede2015-09-02 20:32:49 -0500307 'instances' : [
308 {
Norman James362a80f2015-09-14 14:04:39 -0500309 'name' : 'Fan_0',
310 'user_label': 'FAN 0',
Norman James90baede2015-09-02 20:32:49 -0500311 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500312 {
Norman James362a80f2015-09-14 14:04:39 -0500313 'name' : 'Fan_1',
314 'user_label': 'FAN 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500315 },
316 {
Norman James362a80f2015-09-14 14:04:39 -0500317 'name' : 'Fan_2',
318 'user_label': 'FAN 2',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500319 },
320
321 ]
322 }
323
Norman James362a80f2015-09-14 14:04:39 -0500324NON_CACHABLE_PROPERTIES = {
325 'name' : True,
326 'user_label' : True,
327 'location' : True,
328 'cache' : True
329}
330
Norman James88872672015-09-21 16:51:35 -0500331FRU_INSTANCES = {
332 '/system' :
333 {
334 'ftype' : Openbmc.FRU_TYPES['SYSTEM'],
335 'fru' : True,
336 },
337 '/system/motherboard' :
338 {
339 'ftype' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
340 'manufacturer' : 'FOXCONN',
341 'fru' : True,
342 'fru_id' : 31,
343 'location' : 'C0',
344 },
345 '/system/fan0' :
346 {
347 'ftype' : Openbmc.FRU_TYPES['FAN'],
348 'manufacturer' : 'DELTA',
349 'fru' : True,
350 'location' : 'F0',
351 'sensor_link' : 'fans/Fan_0',
352 },
353 '/system/fan1' :
354 {
355 'ftype' : Openbmc.FRU_TYPES['FAN'],
356 'manufacturer' : 'DELTA',
357 'fru' : True,
358 'location' : 'F1',
359 'sensor_link' : 'fans/Fan_1',
360 },
361 '/system/motherboard/bmc' :
362 {
363 'ftype' : Openbmc.FRU_TYPES['BMC'],
364 'manufacturer' : 'ASPEED',
365 'fru' : True,
366 },
367 '/system/motherboard/cpu0' :
368 {
369 'ftype' : Openbmc.FRU_TYPES['CPU'],
370 'manufacturer' : 'IBM',
371 'fru' : True,
372 'location' : 'P0',
373 'fru_id' : 10,
374 },
375 '/system/motherboard/cpu0/core0' :
376 {
377 'ftype' : Openbmc.FRU_TYPES['CORE'],
378 'fru' : False,
379 'sensor_link' : 1,
380 },
381 '/system/motherboard/cpu0/core1' :
382 {
383 'ftype' : Openbmc.FRU_TYPES['CORE'],
384 'fru' : False,
385 'sensor_link' : 2,
386 },
387 '/system/motherboard/dimm0' :
388 {
389 'ftype' : Openbmc.FRU_TYPES['DIMM'],
390 'fru' : True,
391 'fru_id' : 12,
392 'sensor_link' : 20,
393 },
394 '/system/motherboard/dimm1' :
395 {
396 'ftype' : Openbmc.FRU_TYPES['DIMM'],
397 'fru' : True,
398 'fru_id' : 13,
399 'sensor_link' : 21,
400 },
401}
Norman James362a80f2015-09-14 14:04:39 -0500402
403
Norman Jamesce46e3e2015-08-30 22:25:55 -0500404GPIO_CONFIG = {}
Norman James362a80f2015-09-14 14:04:39 -0500405GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 4, 'direction': 'out' }
406GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 5, 'direction': 'out' }
407GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 24, 'direction': 'out' }
408GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 33, 'direction': 'out' }
409GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out' }
410GPIO_CONFIG['PGOOD'] = { 'gpio_num': 23, 'direction': 'in' }
411GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 34, 'direction': 'out' }
412GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500413