blob: 2d5c800a0fade925cbe57c9b1de0dc2ffae3d34b [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 = './'
Norman James65a295a2015-09-26 22:21:10 -05008BIN_PATH = HOME_PATH+'bin/'
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 James65a295a2015-09-26 22:21:10 -050048SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
Norman James362a80f2015-09-14 14:04:39 -050049 'system_state' : 'STANDBY',
50 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050051 'monitor_process' : True,
Norman James65a295a2015-09-26 22:21:10 -050052 'process_name' : 'inventory_manager.py',
Norman James362a80f2015-09-14 14:04:39 -050053 'heartbeat' : 'no',
54 'rest_name' : 'frus',
55 'instances' : [
56 {
57 'name' : 'Barreleye',
Norman James65a295a2015-09-26 22:21:10 -050058 'user_label': 'Inventory Manager',
Norman James362a80f2015-09-14 14:04:39 -050059 }
60 ]
61 }
62
63
Norman James90baede2015-09-02 20:32:49 -050064SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman James362a80f2015-09-14 14:04:39 -050065 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050066 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050067 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -050068 'process_name' : 'sensor_manager.py',
Norman James90baede2015-09-02 20:32:49 -050069 'heartbeat' : 'no',
70 'rest_name' : 'sensors',
71 'instances' : [
72 {
73 'name' : 'Barreleye',
74 'user_label': 'Sensor Manager',
75 }
76 ]
77 }
78
Norman Jamesce46e3e2015-08-30 22:25:55 -050079SYSTEM_CONFIG['org.openbmc.loggers.EventLogger'] = {
Norman James88872672015-09-21 16:51:35 -050080 'system_state' : 'INIT',
81 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -050082 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -050083 'process_name' : 'eventlogger.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -050084 'heartbeat' : 'no',
85 'rest_name' : 'events',
86 'instances' : [
87 {
Norman James90baede2015-09-02 20:32:49 -050088 'name' : 'Barreleye',
89 'user_label': 'Event Logger',
Norman Jamesce46e3e2015-08-30 22:25:55 -050090 }
91 ]
92 }
93
Norman James362a80f2015-09-14 14:04:39 -050094SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
95 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050096 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050097 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -050098 'process_name' : 'host_watchdog.exe',
Norman James90baede2015-09-02 20:32:49 -050099 'heartbeat' : 'no',
Norman James362a80f2015-09-14 14:04:39 -0500100 'rest_name' : 'watchdog',
Norman James90baede2015-09-02 20:32:49 -0500101 'instances' : [
102 {
Norman James362a80f2015-09-14 14:04:39 -0500103 'name' : 'HostWatchdog_0',
104 'user_label': 'Host Watchdog',
105 'properties' : {
106 'org.openbmc.Watchdog' : {
107 'poll_interval': 3000,
108 }
109 }
Norman James90baede2015-09-02 20:32:49 -0500110 }
111 ]
112 }
113
Norman Jamesce46e3e2015-08-30 22:25:55 -0500114SYSTEM_CONFIG['org.openbmc.control.Power'] = {
Norman James362a80f2015-09-14 14:04:39 -0500115 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500116 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500117 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500118 'process_name' : 'power_control.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500119 'heartbeat' : 'yes',
120 'instances' : [
121 {
Norman James362a80f2015-09-14 14:04:39 -0500122 'name' : 'SystemPower_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500123 'user_label': 'Power control',
Norman James9e6acf92015-09-08 07:00:04 -0500124 'properties' : {
125 'org.openbmc.Control': {
126 'poll_interval' : 3000
Norman James32e74e22015-09-15 21:28:06 -0500127 },
128 'org.openbmc.control.Power': {
Norman James88872672015-09-21 16:51:35 -0500129 'pgood_timeout' : 10
Norman James9e6acf92015-09-08 07:00:04 -0500130 }
131 }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500132 }
133 ]
134 }
135
136SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
Norman James362a80f2015-09-14 14:04:39 -0500137 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500138 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500139 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500140 'process_name' : 'sensor_ambient.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500141 'heartbeat' : 'yes',
142 'instances' : [
143 {
Norman James362a80f2015-09-14 14:04:39 -0500144 'name' : 'FrontChassis',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500145 'user_label': 'Ambient Temperature 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500146 'properties' : {
Norman James9e6acf92015-09-08 07:00:04 -0500147 'org.openbmc.SensorValue': {
Norman James362a80f2015-09-14 14:04:39 -0500148 'poll_interval' : 5000,
Norman James9e6acf92015-09-08 07:00:04 -0500149 },
Norman James5d78b4d2015-09-05 13:34:34 -0500150 'org.openbmc.SensorThreshold' : {
Norman Jamesce46e3e2015-08-30 22:25:55 -0500151 'lower_critical': 5,
152 'lower_warning' : 10,
153 'upper_warning' : 15,
154 'upper_critical': 20
Norman James90baede2015-09-02 20:32:49 -0500155 },
156 'org.openbmc.SensorI2c' : {
157 'dev_path' : '/dev/i2c/i2c0',
158 'address' : '0xA0'
Norman Jamesce46e3e2015-08-30 22:25:55 -0500159 }
160 }
161 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500162 ]
163 }
Norman James362a80f2015-09-14 14:04:39 -0500164SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
165 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500166 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500167 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500168 'process_name' : 'button_power.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500169 'heartbeat' : 'no',
170 'instances' : [
171 {
Norman James362a80f2015-09-14 14:04:39 -0500172 'name' : 'PowerButton_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500173 'user_label': 'Main Power Button',
174 }
175 ]
176 }
177SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
Norman James362a80f2015-09-14 14:04:39 -0500178 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500179 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500180 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500181 'process_name' : 'sensor_host_status.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500182 'heartbeat' : "no",
183 'instances' : [
184 {
Norman James362a80f2015-09-14 14:04:39 -0500185 'name' : 'HostStatus_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500186 'user_label': 'Host Status',
Norman James362a80f2015-09-14 14:04:39 -0500187 'properties' : {
188 'org.openbmc.SensorValue': {
189 'ipmi_id' : 43,
190 },
191 }
192
Norman Jamesce46e3e2015-08-30 22:25:55 -0500193 }
194 ]
195 }
196SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
Norman James362a80f2015-09-14 14:04:39 -0500197 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500198 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500199 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500200 'process_name' : 'chassis_identify.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500201 'heartbeat' : 'no',
202 'instances' : [
203 {
Norman James362a80f2015-09-14 14:04:39 -0500204 'name' : 'ChassisIdentify_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500205 'user_label': 'Chassis Identify LED',
206 }
207 ]
208 }
209SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = {
Norman James362a80f2015-09-14 14:04:39 -0500210 'system_state' : 'STANDBY',
Norman James88872672015-09-21 16:51:35 -0500211 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -0500212 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500213 'process_name' : 'flash_bios.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500214 'heartbeat' : 'no',
215 'rest_name' : 'flash',
216 'instances' : [
217 {
Norman James362a80f2015-09-14 14:04:39 -0500218 'name' : 'BIOS_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500219 'user_label': 'BIOS SPI Flash',
220 }
221 ]
222 }
223SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman James362a80f2015-09-14 14:04:39 -0500224 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500225 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500226 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500227 'process_name' : 'control_host.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500228 'heartbeat' : 'no',
229 'instances' : [
230 {
Norman James362a80f2015-09-14 14:04:39 -0500231 'name' : 'Host_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500232 'user_label': 'Host Control',
233 }
234 ]
235 }
236SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
Norman James362a80f2015-09-14 14:04:39 -0500237 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500238 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500239 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500240 'process_name' : 'chassis_control.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500241 'heartbeat' : 'no',
242 'rest_name' : 'chassis',
243 'instances' : [
244 {
245 'name' : 'Chassis',
246 'user_label': 'Chassis Control',
247 }
248 ]
249 }
Norman James362a80f2015-09-14 14:04:39 -0500250
Norman James6f8d0422015-09-14 18:48:00 -0500251SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman James362a80f2015-09-14 14:04:39 -0500252 'system_state' : 'POWERED_ON',
253 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500254 'monitor_process' : False,
255 'process_name' : 'board_vpd.exe',
256 'heartbeat' : 'no',
257 'instances' : [
258 {
259 'name' : 'MBVPD_0',
260 'user_label': 'VPD',
261 },
262
263 ]
264 }
265
266SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
Norman James2d1ee892015-09-16 23:13:45 -0500267 'system_state' : 'BOOTED',
Norman James6f8d0422015-09-14 18:48:00 -0500268 'start_process' : True,
269 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500270 'process_name' : 'sensor_occ.exe',
271 'heartbeat' : 'no',
272 'instances' : [
273 {
274 'name' : 'Occ_0',
275 'user_label': 'CPU0',
276 'properties' : {
277 'org.openbmc.Occ' : {
278 'poll_interval' : 3000,
279 }
280 }
281 },
282
283 ]
284 }
285
286SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
287 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500288 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500289 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500290 'process_name' : 'fan.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500291 'heartbeat' : 'no',
Norman James90baede2015-09-02 20:32:49 -0500292 'instances' : [
293 {
Norman James362a80f2015-09-14 14:04:39 -0500294 'name' : 'Fan_0',
295 'user_label': 'FAN 0',
Norman James90baede2015-09-02 20:32:49 -0500296 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500297 {
Norman James362a80f2015-09-14 14:04:39 -0500298 'name' : 'Fan_1',
299 'user_label': 'FAN 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500300 },
301 {
Norman James362a80f2015-09-14 14:04:39 -0500302 'name' : 'Fan_2',
303 'user_label': 'FAN 2',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500304 },
305
306 ]
307 }
308
Norman James362a80f2015-09-14 14:04:39 -0500309NON_CACHABLE_PROPERTIES = {
310 'name' : True,
311 'user_label' : True,
312 'location' : True,
313 'cache' : True
314}
315
Norman James88872672015-09-21 16:51:35 -0500316FRU_INSTANCES = {
317 '/system' :
318 {
319 'ftype' : Openbmc.FRU_TYPES['SYSTEM'],
320 'fru' : True,
321 },
322 '/system/motherboard' :
323 {
324 'ftype' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
325 'manufacturer' : 'FOXCONN',
326 'fru' : True,
327 'fru_id' : 31,
328 'location' : 'C0',
329 },
330 '/system/fan0' :
331 {
332 'ftype' : Openbmc.FRU_TYPES['FAN'],
333 'manufacturer' : 'DELTA',
334 'fru' : True,
335 'location' : 'F0',
Norman James88872672015-09-21 16:51:35 -0500336 },
337 '/system/fan1' :
338 {
339 'ftype' : Openbmc.FRU_TYPES['FAN'],
340 'manufacturer' : 'DELTA',
341 'fru' : True,
342 'location' : 'F1',
Norman James88872672015-09-21 16:51:35 -0500343 },
344 '/system/motherboard/bmc' :
345 {
346 'ftype' : Openbmc.FRU_TYPES['BMC'],
347 'manufacturer' : 'ASPEED',
348 'fru' : True,
349 },
350 '/system/motherboard/cpu0' :
351 {
352 'ftype' : Openbmc.FRU_TYPES['CPU'],
353 'manufacturer' : 'IBM',
354 'fru' : True,
355 'location' : 'P0',
356 'fru_id' : 10,
357 },
358 '/system/motherboard/cpu0/core0' :
359 {
360 'ftype' : Openbmc.FRU_TYPES['CORE'],
361 'fru' : False,
Norman James65a295a2015-09-26 22:21:10 -0500362 'sensor_id' : 1,
Norman James88872672015-09-21 16:51:35 -0500363 },
364 '/system/motherboard/cpu0/core1' :
365 {
366 'ftype' : Openbmc.FRU_TYPES['CORE'],
367 'fru' : False,
Norman James65a295a2015-09-26 22:21:10 -0500368 'sensor_id' : 2,
Norman James88872672015-09-21 16:51:35 -0500369 },
370 '/system/motherboard/dimm0' :
371 {
372 'ftype' : Openbmc.FRU_TYPES['DIMM'],
373 'fru' : True,
374 'fru_id' : 12,
Norman James65a295a2015-09-26 22:21:10 -0500375 'sensor_id' : 20,
Norman James88872672015-09-21 16:51:35 -0500376 },
377 '/system/motherboard/dimm1' :
378 {
379 'ftype' : Openbmc.FRU_TYPES['DIMM'],
380 'fru' : True,
381 'fru_id' : 13,
Norman James65a295a2015-09-26 22:21:10 -0500382 'sensor_id' : 21,
Norman James88872672015-09-21 16:51:35 -0500383 },
384}
Norman James362a80f2015-09-14 14:04:39 -0500385
386
Norman Jamesce46e3e2015-08-30 22:25:55 -0500387GPIO_CONFIG = {}
Norman James362a80f2015-09-14 14:04:39 -0500388GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 4, 'direction': 'out' }
389GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 5, 'direction': 'out' }
390GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 24, 'direction': 'out' }
391GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 33, 'direction': 'out' }
392GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out' }
393GPIO_CONFIG['PGOOD'] = { 'gpio_num': 23, 'direction': 'in' }
394GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 34, 'direction': 'out' }
395GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500396