blob: ae48df0773e94da3da86e82bdcf20aafe7e9f229 [file] [log] [blame]
Norman Jamesce46e3e2015-08-30 22:25:55 -05001#! /usr/bin/python
Norman James9e6acf92015-09-08 07:00:04 -05002
Norman Jamesce46e3e2015-08-30 22:25:55 -05003import dbus
4import Openbmc
5
Norman James88872672015-09-21 16:51:35 -05006HOME_PATH = './'
Norman James65a295a2015-09-26 22:21:10 -05007BIN_PATH = HOME_PATH+'bin/'
Norman James5d78b4d2015-09-05 13:34:34 -05008CACHE_PATH = HOME_PATH+'cache/'
Norman James362a80f2015-09-14 14:04:39 -05009FRU_PATH = CACHE_PATH+'frus/'
Norman James5d78b4d2015-09-05 13:34:34 -050010
Norman James362a80f2015-09-14 14:04:39 -050011SYSTEM_STATES = [
12 'INIT',
13 'STANDBY',
14 'POWERING_ON',
15 'POWERED_ON',
16 'BOOTING',
17 'HOST_UP',
18 'SHUTTING_DOWN',
19 'POWERING_DOWN'
20]
21
22ENTER_STATE_CALLBACK = {
23 'POWERED_ON' : {
24 'bus_name' : 'org.openbmc.control.Host',
25 'obj_name' : '/org/openbmc/control/Host_0',
26 'interface_name' : 'org.openbmc.control.Host',
27 'method_name' : 'boot'
28 }
Norman James90baede2015-09-02 20:32:49 -050029}
30
Norman Jamesce46e3e2015-08-30 22:25:55 -050031SYSTEM_CONFIG = {}
32
Norman James362a80f2015-09-14 14:04:39 -050033SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
34 'system_state' : 'INIT',
Norman James9e6acf92015-09-08 07:00:04 -050035 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050036 'monitor_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 Jamesdfdaca92015-09-27 22:11:15 -050039 'instances' : [ { 'name' : 'Bmc_0' } ]
Norman James9e6acf92015-09-08 07:00:04 -050040 }
41
Norman James65a295a2015-09-26 22:21:10 -050042SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
Norman James362a80f2015-09-14 14:04:39 -050043 'system_state' : 'STANDBY',
44 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050045 'monitor_process' : True,
Norman James65a295a2015-09-26 22:21:10 -050046 'process_name' : 'inventory_manager.py',
Norman James362a80f2015-09-14 14:04:39 -050047 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -050048 'instances' : [ { 'name' : 'Barreleye' } ]
Norman James362a80f2015-09-14 14:04:39 -050049 }
50
51
Norman James90baede2015-09-02 20:32:49 -050052SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman James362a80f2015-09-14 14:04:39 -050053 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050054 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050055 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -050056 'process_name' : 'sensor_manager.py',
Norman James90baede2015-09-02 20:32:49 -050057 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -050058 'instances' : [ { 'name' : 'Barreleye' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -050059 }
60
Norman James362a80f2015-09-14 14:04:39 -050061SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
62 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -050063 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050064 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -050065 'process_name' : 'host_watchdog.exe',
Norman James90baede2015-09-02 20:32:49 -050066 'heartbeat' : 'no',
67 'instances' : [
68 {
Norman James362a80f2015-09-14 14:04:39 -050069 'name' : 'HostWatchdog_0',
Norman James362a80f2015-09-14 14:04:39 -050070 'properties' : {
71 'org.openbmc.Watchdog' : {
72 'poll_interval': 3000,
73 }
74 }
Norman James90baede2015-09-02 20:32:49 -050075 }
76 ]
77 }
78
Norman Jamesce46e3e2015-08-30 22:25:55 -050079SYSTEM_CONFIG['org.openbmc.control.Power'] = {
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' : 'power_control.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -050084 'heartbeat' : 'yes',
85 'instances' : [
86 {
Norman James362a80f2015-09-14 14:04:39 -050087 'name' : 'SystemPower_0',
Norman Jamesce46e3e2015-08-30 22:25:55 -050088 'user_label': 'Power control',
Norman James9e6acf92015-09-08 07:00:04 -050089 'properties' : {
90 'org.openbmc.Control': {
91 'poll_interval' : 3000
Norman James32e74e22015-09-15 21:28:06 -050092 },
93 'org.openbmc.control.Power': {
Norman James88872672015-09-21 16:51:35 -050094 'pgood_timeout' : 10
Norman James9e6acf92015-09-08 07:00:04 -050095 }
96 }
Norman Jamesce46e3e2015-08-30 22:25:55 -050097 }
98 ]
99 }
100
101SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
Norman James362a80f2015-09-14 14:04:39 -0500102 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500103 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500104 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500105 'process_name' : 'sensor_ambient.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500106 'heartbeat' : 'yes',
107 'instances' : [
108 {
Norman James362a80f2015-09-14 14:04:39 -0500109 'name' : 'FrontChassis',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500110 'user_label': 'Ambient Temperature 1',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500111 'properties' : {
Norman James9e6acf92015-09-08 07:00:04 -0500112 'org.openbmc.SensorValue': {
Norman James362a80f2015-09-14 14:04:39 -0500113 'poll_interval' : 5000,
Norman James9e6acf92015-09-08 07:00:04 -0500114 },
Norman James5d78b4d2015-09-05 13:34:34 -0500115 'org.openbmc.SensorThreshold' : {
Norman Jamesce46e3e2015-08-30 22:25:55 -0500116 'lower_critical': 5,
117 'lower_warning' : 10,
118 'upper_warning' : 15,
119 'upper_critical': 20
Norman James90baede2015-09-02 20:32:49 -0500120 },
121 'org.openbmc.SensorI2c' : {
122 'dev_path' : '/dev/i2c/i2c0',
123 'address' : '0xA0'
Norman Jamesce46e3e2015-08-30 22:25:55 -0500124 }
125 }
126 },
Norman Jamesce46e3e2015-08-30 22:25:55 -0500127 ]
128 }
Norman James362a80f2015-09-14 14:04:39 -0500129SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
130 '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' : 'button_power.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500134 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500135 'instances' : [ { 'name' : 'PowerButton_0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500136 }
137SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
Norman James362a80f2015-09-14 14:04:39 -0500138 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500139 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500140 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500141 'process_name' : 'sensor_host_status.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500142 'heartbeat' : "no",
Norman Jamesdfdaca92015-09-27 22:11:15 -0500143 'instances' : [ { 'name' : 'HostStatus_0',
Norman James362a80f2015-09-14 14:04:39 -0500144 'properties' : {
Norman Jamesdfdaca92015-09-27 22:11:15 -0500145 'org.openbmc.SensorIpmi': {
146 'sensor_id' : 43,
Norman James362a80f2015-09-14 14:04:39 -0500147 },
148 }
149
Norman Jamesce46e3e2015-08-30 22:25:55 -0500150 }
151 ]
152 }
153SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
Norman James362a80f2015-09-14 14:04:39 -0500154 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500155 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500156 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500157 'process_name' : 'chassis_identify.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500158 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500159 'instances' : [ { 'name' : 'ChassisIdentify_0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500160 }
161SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = {
Norman James362a80f2015-09-14 14:04:39 -0500162 'system_state' : 'STANDBY',
Norman James88872672015-09-21 16:51:35 -0500163 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -0500164 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500165 'process_name' : 'flash_bios.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500166 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500167 'instances' : [ { 'name' : 'BIOS_0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500168 }
169SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman James362a80f2015-09-14 14:04:39 -0500170 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500171 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500172 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500173 'process_name' : 'control_host.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500174 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500175 'instances' : [ { 'name' : 'Host_0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500176 }
177SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
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' : 'chassis_control.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500182 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500183 'instances' : [ { 'name' : 'Chassis' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500184 }
Norman James362a80f2015-09-14 14:04:39 -0500185
Norman James6f8d0422015-09-14 18:48:00 -0500186SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman James362a80f2015-09-14 14:04:39 -0500187 'system_state' : 'POWERED_ON',
188 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500189 'monitor_process' : False,
190 'process_name' : 'board_vpd.exe',
191 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500192 'instances' : [ { 'name' : 'MBVPD_0' } ]
Norman James6f8d0422015-09-14 18:48:00 -0500193 }
194
195SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
Norman James2d1ee892015-09-16 23:13:45 -0500196 'system_state' : 'BOOTED',
Norman James6f8d0422015-09-14 18:48:00 -0500197 'start_process' : True,
198 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500199 'process_name' : 'sensor_occ.exe',
200 'heartbeat' : 'no',
201 'instances' : [
202 {
203 'name' : 'Occ_0',
Norman James362a80f2015-09-14 14:04:39 -0500204 'properties' : {
205 'org.openbmc.Occ' : {
206 'poll_interval' : 3000,
207 }
208 }
209 },
210
211 ]
212 }
213
214SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
215 'system_state' : 'STANDBY',
Norman James5d78b4d2015-09-05 13:34:34 -0500216 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500217 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500218 'process_name' : 'fan.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500219 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500220 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500221 }
222
Norman James362a80f2015-09-14 14:04:39 -0500223NON_CACHABLE_PROPERTIES = {
224 'name' : True,
225 'user_label' : True,
226 'location' : True,
Norman James7caa10e2015-09-27 22:39:52 -0500227 'state' : True,
Norman James362a80f2015-09-14 14:04:39 -0500228 'cache' : True
229}
230
Norman James88872672015-09-21 16:51:35 -0500231FRU_INSTANCES = {
232 '/system' :
233 {
234 'ftype' : Openbmc.FRU_TYPES['SYSTEM'],
235 'fru' : True,
236 },
237 '/system/motherboard' :
238 {
239 'ftype' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
240 'manufacturer' : 'FOXCONN',
241 'fru' : True,
242 'fru_id' : 31,
243 'location' : 'C0',
244 },
245 '/system/fan0' :
246 {
247 'ftype' : Openbmc.FRU_TYPES['FAN'],
248 'manufacturer' : 'DELTA',
249 'fru' : True,
250 'location' : 'F0',
Norman James88872672015-09-21 16:51:35 -0500251 },
252 '/system/fan1' :
253 {
254 'ftype' : Openbmc.FRU_TYPES['FAN'],
255 'manufacturer' : 'DELTA',
256 'fru' : True,
257 'location' : 'F1',
Norman James88872672015-09-21 16:51:35 -0500258 },
259 '/system/motherboard/bmc' :
260 {
261 'ftype' : Openbmc.FRU_TYPES['BMC'],
262 'manufacturer' : 'ASPEED',
263 'fru' : True,
264 },
265 '/system/motherboard/cpu0' :
266 {
267 'ftype' : Openbmc.FRU_TYPES['CPU'],
268 'manufacturer' : 'IBM',
269 'fru' : True,
270 'location' : 'P0',
271 'fru_id' : 10,
272 },
273 '/system/motherboard/cpu0/core0' :
274 {
275 'ftype' : Openbmc.FRU_TYPES['CORE'],
276 'fru' : False,
Norman James65a295a2015-09-26 22:21:10 -0500277 'sensor_id' : 1,
Norman James88872672015-09-21 16:51:35 -0500278 },
279 '/system/motherboard/cpu0/core1' :
280 {
281 'ftype' : Openbmc.FRU_TYPES['CORE'],
282 'fru' : False,
Norman James65a295a2015-09-26 22:21:10 -0500283 'sensor_id' : 2,
Norman James88872672015-09-21 16:51:35 -0500284 },
285 '/system/motherboard/dimm0' :
286 {
287 'ftype' : Openbmc.FRU_TYPES['DIMM'],
288 'fru' : True,
289 'fru_id' : 12,
Norman James65a295a2015-09-26 22:21:10 -0500290 'sensor_id' : 20,
Norman James88872672015-09-21 16:51:35 -0500291 },
292 '/system/motherboard/dimm1' :
293 {
294 'ftype' : Openbmc.FRU_TYPES['DIMM'],
295 'fru' : True,
296 'fru_id' : 13,
Norman James65a295a2015-09-26 22:21:10 -0500297 'sensor_id' : 21,
Norman James88872672015-09-21 16:51:35 -0500298 },
299}
Norman James362a80f2015-09-14 14:04:39 -0500300
301
Norman Jamesce46e3e2015-08-30 22:25:55 -0500302GPIO_CONFIG = {}
Norman James362a80f2015-09-14 14:04:39 -0500303GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 4, 'direction': 'out' }
304GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 5, 'direction': 'out' }
305GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 24, 'direction': 'out' }
306GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 33, 'direction': 'out' }
307GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out' }
308GPIO_CONFIG['PGOOD'] = { 'gpio_num': 23, 'direction': 'in' }
309GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 34, 'direction': 'out' }
310GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500311