blob: 3c16c8cb26967ff94e2980fae439780f8d5f365d [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 James5d78b4d2015-09-05 13:34:34 -05007HOME_PATH = '/media/sf_vbox/openbmc/'
8BIN_PATH = HOME_PATH+'bin/'
9CACHE_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',
73 'user_label': 'Fru Manager',
74 }
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 James362a80f2015-09-14 14:04:39 -050095 '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 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
142 }
143 }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500144 }
145 ]
146 }
147
148SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
Norman James362a80f2015-09-14 14:04:39 -0500149 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500150 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500151 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500152 'process_name' : 'sensor_ambient.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500153 'heartbeat' : 'yes',
154 'instances' : [
155 {
Norman James362a80f2015-09-14 14:04:39 -0500156 'name' : 'FrontChassis',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500157 'user_label': 'Ambient Temperature 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500158 'properties' : {
Norman James9e6acf92015-09-08 07:00:04 -0500159 'org.openbmc.SensorValue': {
Norman James362a80f2015-09-14 14:04:39 -0500160 'poll_interval' : 5000,
Norman James9e6acf92015-09-08 07:00:04 -0500161 },
Norman James5d78b4d2015-09-05 13:34:34 -0500162 'org.openbmc.SensorThreshold' : {
Norman Jamesce46e3e2015-08-30 22:25:55 -0500163 'lower_critical': 5,
164 'lower_warning' : 10,
165 'upper_warning' : 15,
166 'upper_critical': 20
Norman James90baede2015-09-02 20:32:49 -0500167 },
168 'org.openbmc.SensorI2c' : {
169 'dev_path' : '/dev/i2c/i2c0',
170 'address' : '0xA0'
Norman Jamesce46e3e2015-08-30 22:25:55 -0500171 }
172 }
173 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500174 ]
175 }
Norman James362a80f2015-09-14 14:04:39 -0500176SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
177 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500178 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500179 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500180 'process_name' : 'button_power.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500181 'heartbeat' : 'no',
182 'instances' : [
183 {
Norman James362a80f2015-09-14 14:04:39 -0500184 'name' : 'PowerButton_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500185 'user_label': 'Main Power Button',
186 }
187 ]
188 }
189SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
Norman James362a80f2015-09-14 14:04:39 -0500190 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500191 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500192 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500193 'process_name' : 'sensor_host_status.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500194 'heartbeat' : "no",
195 'instances' : [
196 {
Norman James362a80f2015-09-14 14:04:39 -0500197 'name' : 'HostStatus_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500198 'user_label': 'Host Status',
Norman James362a80f2015-09-14 14:04:39 -0500199 'properties' : {
200 'org.openbmc.SensorValue': {
201 'ipmi_id' : 43,
202 },
203 }
204
Norman Jamesce46e3e2015-08-30 22:25:55 -0500205 }
206 ]
207 }
208SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
Norman James362a80f2015-09-14 14:04:39 -0500209 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500210 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500211 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500212 'process_name' : 'chassis_identify.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500213 'heartbeat' : 'no',
214 'instances' : [
215 {
Norman James362a80f2015-09-14 14:04:39 -0500216 'name' : 'ChassisIdentify_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500217 'user_label': 'Chassis Identify LED',
218 }
219 ]
220 }
221SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = {
Norman James362a80f2015-09-14 14:04:39 -0500222 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500223 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500224 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500225 'process_name' : 'flash_bios.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500226 'heartbeat' : 'no',
227 'rest_name' : 'flash',
228 'instances' : [
229 {
Norman James362a80f2015-09-14 14:04:39 -0500230 'name' : 'BIOS_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500231 'user_label': 'BIOS SPI Flash',
232 }
233 ]
234 }
235SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman James362a80f2015-09-14 14:04:39 -0500236 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500237 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500238 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500239 'process_name' : 'control_host.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500240 'heartbeat' : 'no',
241 'instances' : [
242 {
Norman James362a80f2015-09-14 14:04:39 -0500243 'name' : 'Host_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500244 'user_label': 'Host Control',
245 }
246 ]
247 }
248SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
Norman James362a80f2015-09-14 14:04:39 -0500249 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500250 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500251 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500252 'process_name' : 'chassis_control.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500253 'heartbeat' : 'no',
254 'rest_name' : 'chassis',
255 'instances' : [
256 {
257 'name' : 'Chassis',
258 'user_label': 'Chassis Control',
259 }
260 ]
261 }
Norman James362a80f2015-09-14 14:04:39 -0500262
Norman James6f8d0422015-09-14 18:48:00 -0500263SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman James362a80f2015-09-14 14:04:39 -0500264 'system_state' : 'POWERED_ON',
265 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500266 'monitor_process' : False,
267 'process_name' : 'board_vpd.exe',
268 'heartbeat' : 'no',
269 'instances' : [
270 {
271 'name' : 'MBVPD_0',
272 'user_label': 'VPD',
273 },
274
275 ]
276 }
277
278SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
279 'system_state' : 'HOST_UP',
280 'start_process' : True,
281 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500282 'process_name' : 'sensor_occ.exe',
283 'heartbeat' : 'no',
284 'instances' : [
285 {
286 'name' : 'Occ_0',
287 'user_label': 'CPU0',
288 'properties' : {
289 'org.openbmc.Occ' : {
290 'poll_interval' : 3000,
291 }
292 }
293 },
294
295 ]
296 }
297
298SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
299 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500300 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500301 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500302 'process_name' : 'fan.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500303 'heartbeat' : 'no',
Norman James90baede2015-09-02 20:32:49 -0500304 'instances' : [
305 {
Norman James362a80f2015-09-14 14:04:39 -0500306 'name' : 'Fan_0',
307 'user_label': 'FAN 0',
Norman James90baede2015-09-02 20:32:49 -0500308 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500309 {
Norman James362a80f2015-09-14 14:04:39 -0500310 'name' : 'Fan_1',
311 'user_label': 'FAN 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500312 },
313 {
Norman James362a80f2015-09-14 14:04:39 -0500314 'name' : 'Fan_2',
315 'user_label': 'FAN 2',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500316 },
317
318 ]
319 }
320
Norman James362a80f2015-09-14 14:04:39 -0500321NON_CACHABLE_PROPERTIES = {
322 'name' : True,
323 'user_label' : True,
324 'location' : True,
325 'cache' : True
326}
327
328FRUS = {}
329
330## key is IPMI FRU ID
331
332FRUS[32] = {
333 'name' : 'CPU0',
334 'user_label' : "IBM POWER8 CPU",
335 'ftype' : Openbmc.FRU_TYPES['CPU'],
336 'location' : "P0",
337 'manufacturer' : "IBM",
338 'cache' : True,
339 'state' : Openbmc.FRU_STATES['NORMAL'],
340 'sensor_id' : 10,
341 }
342
343FRUS[21] = {
344 'name' : 'IO_PLANAR',
345 'user_label' : "BARRELEYE IO PLANAR",
346 'ftype' : Openbmc.FRU_TYPES['BACKPLANE'],
347 'cache' : False,
348 'state' : Openbmc.FRU_STATES['NORMAL'],
349 'sensor_id' : 11,
350 }
351
352
Norman Jamesce46e3e2015-08-30 22:25:55 -0500353GPIO_CONFIG = {}
Norman James362a80f2015-09-14 14:04:39 -0500354GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 4, 'direction': 'out' }
355GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 5, 'direction': 'out' }
356GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 24, 'direction': 'out' }
357GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 33, 'direction': 'out' }
358GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out' }
359GPIO_CONFIG['PGOOD'] = { 'gpio_num': 23, 'direction': 'in' }
360GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 34, 'direction': 'out' }
361GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500362