blob: 396d931ad0f63999b3ad679caa26e0bb6f1189ea [file] [log] [blame]
Norman Jamesc9239a32015-10-06 16:54:31 -05001#! /usr/bin/python
2
3import dbus
4import Openbmc
5
6HOME_PATH = './'
Norman Jamesc9239a32015-10-06 16:54:31 -05007CACHE_PATH = HOME_PATH+'cache/'
8FRU_PATH = CACHE_PATH+'frus/'
Norman James25d80dd2015-10-08 07:02:25 -05009FLASH_DOWNLOAD_PATH = "/tmp"
10
Norman James969227c2015-10-08 15:10:47 -050011SYSTEM_NAME = "Palmetto"
Norman Jamesc9239a32015-10-06 16:54:31 -050012
13SYSTEM_STATES = [
14 'INIT',
15 'STANDBY',
16 'POWERING_ON',
17 'POWERED_ON',
18 'BOOTING',
19 'HOST_UP',
20 'SHUTTING_DOWN',
21 'POWERING_DOWN'
22]
23
24ENTER_STATE_CALLBACK = {
25 'POWERED_ON' : {
26 'bus_name' : 'org.openbmc.control.Host',
27 'obj_name' : '/org/openbmc/control/Host_0',
28 'interface_name' : 'org.openbmc.control.Host',
29 'method_name' : 'boot'
30 }
31}
32
33SYSTEM_CONFIG = {}
34
35SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
36 'system_state' : 'INIT',
37 'start_process' : True,
38 'monitor_process' : True,
39 'process_name' : 'control_bmc.exe',
40 'heartbeat' : 'no',
41 'instances' : [ { 'name' : 'Bmc_0' } ]
42 }
43
44SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
45 'system_state' : 'STANDBY',
46 'start_process' : True,
47 'monitor_process' : True,
48 'process_name' : 'inventory_items.py',
49 'heartbeat' : 'no',
Norman James25d80dd2015-10-08 07:02:25 -050050 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -050051 }
52SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = {
Norman James25d80dd2015-10-08 07:02:25 -050053 'system_state' : 'POWERED_ON',
Norman Jamesc9239a32015-10-06 16:54:31 -050054 'start_process' : True,
55 'monitor_process' : False,
56 'process_name' : 'pcie_slot_present.exe',
57 'heartbeat' : 'no',
58 'instances' : [ { 'name' : 'Slots_0' } ]
59 }
60
61
62SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
63 'system_state' : 'STANDBY',
64 'start_process' : True,
65 'monitor_process' : True,
66 'process_name' : 'sensor_manager.py',
67 'heartbeat' : 'no',
Norman James25d80dd2015-10-08 07:02:25 -050068 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -050069 }
70
71SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
72 'system_state' : 'STANDBY',
73 'start_process' : True,
74 'monitor_process' : True,
75 'process_name' : 'host_watchdog.exe',
76 'heartbeat' : 'no',
77 'instances' : [
78 {
79 'name' : 'HostWatchdog_0',
80 'properties' : {
81 'org.openbmc.Watchdog' : {
82 'poll_interval': 3000,
83 }
84 }
85 }
86 ]
87 }
88
89SYSTEM_CONFIG['org.openbmc.control.Power'] = {
90 'system_state' : 'STANDBY',
91 'start_process' : True,
92 'monitor_process' : True,
93 'process_name' : 'power_control.exe',
Norman James4fa99d42015-10-08 09:21:17 -050094 'heartbeat' : 'no',
Norman Jamesc9239a32015-10-06 16:54:31 -050095 'instances' : [
96 {
97 'name' : 'SystemPower_0',
98 'user_label': 'Power control',
99 'properties' : {
100 'org.openbmc.Control': {
101 'poll_interval' : 3000
102 },
103 'org.openbmc.control.Power': {
104 'pgood_timeout' : 10
105 }
106 }
107 }
108 ]
109 }
110
111SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = {
112 'system_state' : 'STANDBY',
113 'start_process' : True,
114 'monitor_process' : True,
115 'process_name' : 'sensor_ambient.exe',
Norman James4fa99d42015-10-08 09:21:17 -0500116 'heartbeat' : 'no',
Norman Jamesc9239a32015-10-06 16:54:31 -0500117 'instances' : [
118 {
119 'name' : 'FrontChassis',
120 'user_label': 'Ambient Temperature 1',
121 'properties' : {
122 'org.openbmc.SensorValue': {
123 'poll_interval' : 5000,
124 },
125 'org.openbmc.SensorThreshold' : {
126 'lower_critical': 5,
127 'lower_warning' : 10,
128 'upper_warning' : 15,
129 'upper_critical': 20
130 },
131 'org.openbmc.SensorI2c' : {
132 'dev_path' : '/dev/i2c/i2c0',
133 'address' : '0xA0'
134 }
135 }
136 },
137 ]
138 }
139SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
140 'system_state' : 'STANDBY',
141 'start_process' : True,
142 'monitor_process' : True,
143 'process_name' : 'button_power.exe',
144 'heartbeat' : 'no',
145 'instances' : [ { 'name' : 'PowerButton_0' } ]
146 }
147SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = {
148 'system_state' : 'STANDBY',
149 'start_process' : True,
150 'monitor_process' : True,
151 'process_name' : 'sensor_host_status.exe',
152 'heartbeat' : "no",
153 'instances' : [ { 'name' : 'HostStatus_0' } ]
154 }
155SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = {
156 'system_state' : 'STANDBY',
157 'start_process' : True,
158 'monitor_process' : True,
159 'process_name' : 'chassis_identify.exe',
160 'heartbeat' : 'no',
161 'instances' : [ { 'name' : 'ChassisIdentify_0' } ]
162 }
163SYSTEM_CONFIG['org.openbmc.flash.Bios'] = {
164 'system_state' : 'STANDBY',
165 'start_process' : True,
166 'monitor_process' : True,
167 'process_name' : 'flash_bios.exe',
168 'heartbeat' : 'no',
169 'instances' : [ { 'name' : 'Bios_0' } ]
170 }
171
Norman Jamesf066e872015-10-07 15:29:51 -0500172SYSTEM_CONFIG['org.openbmc.manager.Download'] = {
Norman Jamesc9239a32015-10-06 16:54:31 -0500173 'system_state' : 'STANDBY',
174 'start_process' : True,
175 'monitor_process' : True,
Norman Jamesf066e872015-10-07 15:29:51 -0500176 'process_name' : 'download_manager.py',
Norman Jamesc9239a32015-10-06 16:54:31 -0500177 'heartbeat' : 'no',
Norman James25d80dd2015-10-08 07:02:25 -0500178 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500179 }
180
181SYSTEM_CONFIG['org.openbmc.control.Host'] = {
182 'system_state' : 'STANDBY',
183 'start_process' : True,
184 'monitor_process' : True,
185 'process_name' : 'control_host.exe',
186 'heartbeat' : 'no',
187 'instances' : [ { 'name' : 'Host_0' } ]
188 }
189SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
190 'system_state' : 'STANDBY',
191 'start_process' : True,
192 'monitor_process' : True,
193 'process_name' : 'chassis_control.py',
194 'heartbeat' : 'no',
195 'instances' : [ { 'name' : 'Chassis' } ]
196 }
197
198SYSTEM_CONFIG['org.openbmc.vpd'] = {
199 'system_state' : 'POWERING_ON',
200 'start_process' : True,
201 'monitor_process' : False,
202 'process_name' : 'board_vpd.exe',
203 'heartbeat' : 'no',
204 'instances' : [ { 'name' : 'MBVPD_0' } ]
205 }
206
207SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = {
208 'system_state' : 'BOOTED',
209 'start_process' : True,
210 'monitor_process' : True,
211 'process_name' : 'sensor_occ.exe',
212 'heartbeat' : 'no',
213 'instances' : [
214 {
215 'name' : 'Occ_0',
216 'properties' : {
217 'org.openbmc.Occ' : {
218 'poll_interval' : 3000,
219 }
220 }
221 },
222
223 ]
224 }
225
226SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
227 'system_state' : 'STANDBY',
228 'start_process' : True,
229 'monitor_process' : True,
230 'process_name' : 'fan.exe',
231 'heartbeat' : 'no',
232 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ]
233 }
234
235NON_CACHABLE_PROPERTIES = {
236 'name' : True,
237 'user_label' : True,
238 'location' : True,
239 'state' : True,
240 'cache' : True
241}
242INVENTORY_ROOT = '/org/openbmc/inventory/items'
243
244FRU_INSTANCES = {
245 '<inventory_root>/system' :
246 {
247 'fru_type' : Openbmc.FRU_TYPES['SYSTEM'],
248 'is_fru' : True,
249 },
250 '<inventory_root>/system/io_board' :
251 {
252 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
253 'manufacturer' : 'FOXCONN',
254 'is_fru' : True,
255 'location' : 'C1',
256 },
257
258 '<inventory_root>/system/motherboard' :
259 {
260 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'],
261 'manufacturer' : 'FOXCONN',
262 'is_fru' : True,
263 'location' : 'C0',
264 },
265 '<inventory_root>/system/fan0' :
266 {
267 'fru_type' : Openbmc.FRU_TYPES['FAN'],
268 'manufacturer' : 'DELTA',
269 'is_fru' : True,
270 'location' : 'F0',
271 },
272 '<inventory_root>/system/fan1' :
273 {
274 'fru_type' : Openbmc.FRU_TYPES['FAN'],
275 'manufacturer' : 'DELTA',
276 'is_fru' : True,
277 'location' : 'F1',
278 },
279 '<inventory_root>/system/io_board/bmc' :
280 {
281 'fru_type' : Openbmc.FRU_TYPES['BMC'],
282 'manufacturer' : 'ASPEED',
283 'is_fru' : False,
284 },
285 '<inventory_root>/system/motherboard/cpu0' :
286 {
287 'fru_type' : Openbmc.FRU_TYPES['CPU'],
288 'manufacturer' : 'IBM',
289 'is_fru' : True,
290 'location' : 'P0',
291 },
292 '<inventory_root>/system/motherboard/cpu0/core0' :
293 {
294 'fru_type' : Openbmc.FRU_TYPES['CORE'],
295 'is_fru' : False,
296 },
297 '<inventory_root>/system/motherboard/cpu0/core1' :
298 {
299 'fru_type' : Openbmc.FRU_TYPES['CORE'],
300 'is_fru' : False,
301 },
302 '<inventory_root>/system/motherboard/dimm0' :
303 {
304 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
305 'is_fru' : True,
306 },
307 '<inventory_root>/system/motherboard/dimm1' :
308 {
309 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
310 'is_fru' : True,
311 },
312 '<inventory_root>/system/motherboard/dimm2' :
313 {
314 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
315 'is_fru' : True,
316 },
317 '<inventory_root>/system/motherboard/dimm3' :
318 {
319 'fru_type' : Openbmc.FRU_TYPES['DIMM'],
320 'is_fru' : True,
321 },
322 '<inventory_root>/system/io_board/pcie_slot0' :
323 {
324 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'],
325 'user_label' : 'PCIe card 0',
326 'is_fru' : True,
327 },
328 '<inventory_root>/system/io_board/pcie_slot1' :
329 {
330 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'],
331 'user_label' : 'PCIe card 1',
332 'is_fru' : True,
333 },
334}
335
336ID_LOOKUP = {
337 'FRU' : {
338 '14' : '<inventory_root>/system/motherboard/dimm0',
339 },
340 'SENSOR' : {
341 '21' : '<inventory_root>/system/motherboard/dimm0',
342 '14' : '/org/openbmc/sensors/HostStatus_0',
343 },
344 'GPIO_PRESENT' : {
345 'SLOT0_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_left_slot_riser',
346 'SLOT1_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_right_slot_riser',
347 'SLOT2_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_x16_slot_riser',
348 'SLOT0_PRESENT' : '<inventory_root>/system/io_board/pcie_slot0',
349 'SLOT1_PRESENT' : '<inventory_root>/system/io_board/pcie_slot1',
350 'SLOT2_PRESENT' : '<inventory_root>/system/io_board/pcie_slot2',
351 'MEZZ0_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz0',
352 'MEZZ1_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz1',
353 }
354}
355
356GPIO_CONFIG = {}
Norman James25d80dd2015-10-08 07:02:25 -0500357GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 484, 'direction': 'out' }
358GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 485, 'direction': 'out' }
359GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 504, 'direction': 'out' }
360GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 449, 'direction': 'out' }
361GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 486, 'direction': 'out' }
362GPIO_CONFIG['PGOOD'] = { 'gpio_num': 503, 'direction': 'in' }
363GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' }
364GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 448, 'direction': 'falling' }
Norman Jamesc9239a32015-10-06 16:54:31 -0500365GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 104, 'direction': 'in' }
366GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 105, 'direction': 'in' }
367GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 106, 'direction': 'in' }
368GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 107, 'direction': 'in' }
369GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 108, 'direction': 'in' }
370GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 109, 'direction': 'in' }
371GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 112, 'direction': 'in' }
372GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 113, 'direction': 'in' }
373
374