blob: 328da307b5185881afd6828d200c3ed86b8f7261 [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 James362a80f2015-09-14 14:04:39 -050037 'process_name' : 'control_bmc.exe',
Norman James9e6acf92015-09-08 07:00:04 -050038 'heartbeat' : 'no',
Norman James9e6acf92015-09-08 07:00:04 -050039 'instances' : [
40 {
Norman James362a80f2015-09-14 14:04:39 -050041 'name' : 'Bmc_0',
42 'user_label': 'Master Bmc',
Norman James9e6acf92015-09-08 07:00:04 -050043 }
44 ]
45 }
46
Norman James362a80f2015-09-14 14:04:39 -050047SYSTEM_CONFIG['org.openbmc.managers.Frus'] = {
48 'system_state' : 'STANDBY',
49 'start_process' : True,
50 'process_name' : 'fru_manager.py',
51 'heartbeat' : 'no',
52 'rest_name' : 'frus',
53 'instances' : [
54 {
55 'name' : 'Barreleye',
56 'user_label': 'Fru Manager',
57 }
58 ]
59 }
60
61SYSTEM_CONFIG['org.openbmc.managers.Ipmi'] = {
62 'system_state' : 'STANDBY',
63 'start_process' : True,
64 'process_name' : 'ipmi_manager.py',
65 'heartbeat' : 'no',
66 'rest_name' : 'frus',
67 'instances' : [
68 {
69 'name' : 'Barreleye',
70 'user_label': 'Fru Manager',
71 }
72 ]
73 }
74
75
Norman James90baede2015-09-02 20:32:49 -050076SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman James362a80f2015-09-14 14:04:39 -050077 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050078 'start_process' : True,
79 'process_name' : 'sensor_manager.py',
Norman James90baede2015-09-02 20:32:49 -050080 'heartbeat' : 'no',
81 'rest_name' : 'sensors',
82 'instances' : [
83 {
84 'name' : 'Barreleye',
85 'user_label': 'Sensor Manager',
86 }
87 ]
88 }
89
Norman Jamesce46e3e2015-08-30 22:25:55 -050090SYSTEM_CONFIG['org.openbmc.loggers.EventLogger'] = {
Norman James362a80f2015-09-14 14:04:39 -050091 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050092 'start_process' : True,
93 'process_name' : 'eventlogger.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -050094 'heartbeat' : 'no',
95 'rest_name' : 'events',
96 'instances' : [
97 {
Norman James90baede2015-09-02 20:32:49 -050098 'name' : 'Barreleye',
99 'user_label': 'Event Logger',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500100 }
101 ]
102 }
103
Norman James362a80f2015-09-14 14:04:39 -0500104SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
105 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500106 'start_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500107 'process_name' : 'host_watchdog.exe',
Norman James90baede2015-09-02 20:32:49 -0500108 'heartbeat' : 'no',
Norman James362a80f2015-09-14 14:04:39 -0500109 'rest_name' : 'watchdog',
Norman James90baede2015-09-02 20:32:49 -0500110 'instances' : [
111 {
Norman James362a80f2015-09-14 14:04:39 -0500112 'name' : 'HostWatchdog_0',
113 'user_label': 'Host Watchdog',
114 'properties' : {
115 'org.openbmc.Watchdog' : {
116 'poll_interval': 3000,
117 }
118 }
Norman James90baede2015-09-02 20:32:49 -0500119 }
120 ]
121 }
122
Norman Jamesce46e3e2015-08-30 22:25:55 -0500123SYSTEM_CONFIG['org.openbmc.control.Power'] = {
Norman James362a80f2015-09-14 14:04:39 -0500124 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500125 'start_process' : True,
126 'process_name' : 'power_control.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500127 'heartbeat' : 'yes',
128 'instances' : [
129 {
Norman James362a80f2015-09-14 14:04:39 -0500130 'name' : 'SystemPower_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500131 'user_label': 'Power control',
Norman James9e6acf92015-09-08 07:00:04 -0500132 'properties' : {
133 'org.openbmc.Control': {
134 'poll_interval' : 3000
135 }
136 }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500137 }
138 ]
139 }
140
141SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
Norman James362a80f2015-09-14 14:04:39 -0500142 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500143 'start_process' : True,
144 'process_name' : 'sensor_ambient.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500145 'heartbeat' : 'yes',
146 'instances' : [
147 {
Norman James362a80f2015-09-14 14:04:39 -0500148 'name' : 'FrontChassis',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500149 'user_label': 'Ambient Temperature 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500150 'properties' : {
Norman James9e6acf92015-09-08 07:00:04 -0500151 'org.openbmc.SensorValue': {
Norman James362a80f2015-09-14 14:04:39 -0500152 'poll_interval' : 5000,
Norman James9e6acf92015-09-08 07:00:04 -0500153 },
Norman James5d78b4d2015-09-05 13:34:34 -0500154 'org.openbmc.SensorThreshold' : {
Norman Jamesce46e3e2015-08-30 22:25:55 -0500155 'lower_critical': 5,
156 'lower_warning' : 10,
157 'upper_warning' : 15,
158 'upper_critical': 20
Norman James90baede2015-09-02 20:32:49 -0500159 },
160 'org.openbmc.SensorI2c' : {
161 'dev_path' : '/dev/i2c/i2c0',
162 'address' : '0xA0'
Norman Jamesce46e3e2015-08-30 22:25:55 -0500163 }
164 }
165 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500166 ]
167 }
Norman James362a80f2015-09-14 14:04:39 -0500168SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
169 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500170 'start_process' : True,
171 'process_name' : 'button_power.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500172 'heartbeat' : 'no',
173 'instances' : [
174 {
Norman James362a80f2015-09-14 14:04:39 -0500175 'name' : 'PowerButton_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500176 'user_label': 'Main Power Button',
177 }
178 ]
179 }
180SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
Norman James362a80f2015-09-14 14:04:39 -0500181 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500182 'start_process' : True,
183 'process_name' : 'sensor_host_status.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500184 'heartbeat' : "no",
185 'instances' : [
186 {
Norman James362a80f2015-09-14 14:04:39 -0500187 'name' : 'HostStatus_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500188 'user_label': 'Host Status',
Norman James362a80f2015-09-14 14:04:39 -0500189 'properties' : {
190 'org.openbmc.SensorValue': {
191 'ipmi_id' : 43,
192 },
193 }
194
Norman Jamesce46e3e2015-08-30 22:25:55 -0500195 }
196 ]
197 }
198SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
Norman James362a80f2015-09-14 14:04:39 -0500199 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500200 'start_process' : True,
201 'process_name' : 'chassis_identify.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500202 'heartbeat' : 'no',
203 'instances' : [
204 {
Norman James362a80f2015-09-14 14:04:39 -0500205 'name' : 'ChassisIdentify_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500206 'user_label': 'Chassis Identify LED',
207 }
208 ]
209 }
210SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = {
Norman James362a80f2015-09-14 14:04:39 -0500211 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500212 'start_process' : True,
213 '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,
226 'process_name' : 'control_host.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500227 'heartbeat' : 'no',
228 'instances' : [
229 {
Norman James362a80f2015-09-14 14:04:39 -0500230 'name' : 'Host_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500231 'user_label': 'Host Control',
232 }
233 ]
234 }
235SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
Norman James362a80f2015-09-14 14:04:39 -0500236 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500237 'start_process' : True,
238 'process_name' : 'chassis_control.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500239 'heartbeat' : 'no',
240 'rest_name' : 'chassis',
241 'instances' : [
242 {
243 'name' : 'Chassis',
244 'user_label': 'Chassis Control',
245 }
246 ]
247 }
Norman James362a80f2015-09-14 14:04:39 -0500248
249SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
250 'system_state' : 'POWERED_ON',
251 'start_process' : True,
252 'process_name' : 'sensor_occ.exe',
253 'heartbeat' : 'no',
254 'instances' : [
255 {
256 'name' : 'Occ_0',
257 'user_label': 'CPU0',
258 'properties' : {
259 'org.openbmc.Occ' : {
260 'poll_interval' : 3000,
261 }
262 }
263 },
264
265 ]
266 }
267
268SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
269 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500270 'start_process' : True,
271 'process_name' : 'fan.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500272 'heartbeat' : 'no',
Norman James90baede2015-09-02 20:32:49 -0500273 'instances' : [
274 {
Norman James362a80f2015-09-14 14:04:39 -0500275 'name' : 'Fan_0',
276 'user_label': 'FAN 0',
Norman James90baede2015-09-02 20:32:49 -0500277 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500278 {
Norman James362a80f2015-09-14 14:04:39 -0500279 'name' : 'Fan_1',
280 'user_label': 'FAN 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500281 },
282 {
Norman James362a80f2015-09-14 14:04:39 -0500283 'name' : 'Fan_2',
284 'user_label': 'FAN 2',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500285 },
286
287 ]
288 }
289
Norman James362a80f2015-09-14 14:04:39 -0500290NON_CACHABLE_PROPERTIES = {
291 'name' : True,
292 'user_label' : True,
293 'location' : True,
294 'cache' : True
295}
296
297FRUS = {}
298
299## key is IPMI FRU ID
300
301FRUS[32] = {
302 'name' : 'CPU0',
303 'user_label' : "IBM POWER8 CPU",
304 'ftype' : Openbmc.FRU_TYPES['CPU'],
305 'location' : "P0",
306 'manufacturer' : "IBM",
307 'cache' : True,
308 'state' : Openbmc.FRU_STATES['NORMAL'],
309 'sensor_id' : 10,
310 }
311
312FRUS[21] = {
313 'name' : 'IO_PLANAR',
314 'user_label' : "BARRELEYE IO PLANAR",
315 'ftype' : Openbmc.FRU_TYPES['BACKPLANE'],
316 'cache' : False,
317 'state' : Openbmc.FRU_STATES['NORMAL'],
318 'sensor_id' : 11,
319 }
320
321
Norman Jamesce46e3e2015-08-30 22:25:55 -0500322GPIO_CONFIG = {}
Norman James362a80f2015-09-14 14:04:39 -0500323GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 4, 'direction': 'out' }
324GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 5, 'direction': 'out' }
325GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 24, 'direction': 'out' }
326GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 33, 'direction': 'out' }
327GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out' }
328GPIO_CONFIG['PGOOD'] = { 'gpio_num': 23, 'direction': 'in' }
329GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 34, 'direction': 'out' }
330GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500331