blob: 371036f30c16a07915c27bbbd4a326d8e115b661 [file] [log] [blame]
Norman Jamesc9239a32015-10-06 16:54:31 -05001#! /usr/bin/python
2
Norman Jamesc9239a32015-10-06 16:54:31 -05003HOME_PATH = './'
Norman Jamesc9239a32015-10-06 16:54:31 -05004CACHE_PATH = HOME_PATH+'cache/'
Norman James25d80dd2015-10-08 07:02:25 -05005FLASH_DOWNLOAD_PATH = "/tmp"
6
Norman James969227c2015-10-08 15:10:47 -05007SYSTEM_NAME = "Palmetto"
Norman Jamesc9239a32015-10-06 16:54:31 -05008
Norman Jamesa3e47c42015-10-18 14:43:10 -05009
10## System states
11## state can change to next state in 2 ways:
12## - a process emits a GotoSystemState signal with state name to goto
13## - objects specified in EXIT_STATE_DEPEND have started
Norman Jamesc9239a32015-10-06 16:54:31 -050014SYSTEM_STATES = [
Norman Jamesb714eb22015-10-26 17:12:57 -050015 'BASE_APPS',
Norman Jamesa3e47c42015-10-18 14:43:10 -050016 'BMC_INIT',
17 'BMC_STARTING',
18 'BMC_READY',
19 'HOST_POWERING_ON',
20 'HOST_POWERED_ON',
21 'HOST_BOOTING',
Norman James2656f332015-10-26 06:42:41 -050022 'HOST_BOOTED',
Norman Jamesa3e47c42015-10-18 14:43:10 -050023 'HOST_POWERED_DOWN',
Norman Jamesc9239a32015-10-06 16:54:31 -050024]
25
Norman Jamesa3e47c42015-10-18 14:43:10 -050026EXIT_STATE_DEPEND = {
Norman Jamesb714eb22015-10-26 17:12:57 -050027 'BASE_APPS' : {
28 '/org/openbmc/managers/Property': 0,
29 },
Norman Jamesa3e47c42015-10-18 14:43:10 -050030 'BMC_STARTING' : {
31 '/org/openbmc/control/chassis0': 0,
32 '/org/openbmc/control/power0' : 0,
33 '/org/openbmc/control/led/BMC_READY' : 0,
34 '/org/openbmc/control/Host_0' : 0,
35 }
36}
37
38## method will be called when state is entered
Norman Jamesc9239a32015-10-06 16:54:31 -050039ENTER_STATE_CALLBACK = {
Norman Jamesa3e47c42015-10-18 14:43:10 -050040 'HOST_POWERED_ON' : {
Norman Jamesc9239a32015-10-06 16:54:31 -050041 'bus_name' : 'org.openbmc.control.Host',
42 'obj_name' : '/org/openbmc/control/Host_0',
43 'interface_name' : 'org.openbmc.control.Host',
44 'method_name' : 'boot'
Norman Jamesa3e47c42015-10-18 14:43:10 -050045 },
46 'BMC_READY' : {
47 'bus_name' : 'org.openbmc.control.led',
48 'obj_name' : '/org/openbmc/control/led/BMC_READY',
49 'interface_name' : 'org.openbmc.Led',
50 'method_name' : 'setOn'
Norman Jamesc9239a32015-10-06 16:54:31 -050051 }
52}
53
54SYSTEM_CONFIG = {}
55
Norman James2656f332015-10-26 06:42:41 -050056SYSTEM_CONFIG['org.openbmc.managers.Property'] = {
Norman Jamesb714eb22015-10-26 17:12:57 -050057 'system_state' : 'BASE_APPS',
58 'start_process' : True,
59 'monitor_process' : True,
Norman James2656f332015-10-26 06:42:41 -050060 'process_name' : 'property_manager.py',
Norman James2656f332015-10-26 06:42:41 -050061 'instances' : [ { 'name' : SYSTEM_NAME } ]
62 }
63
Norman Jamesc9239a32015-10-06 16:54:31 -050064SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -050065 'system_state' : 'BMC_INIT',
Norman Jamesc9239a32015-10-06 16:54:31 -050066 'start_process' : True,
67 'monitor_process' : True,
68 'process_name' : 'control_bmc.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -050069 'instances' : [ { 'name' : 'Bmc_0' } ]
70 }
71
72SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -050073 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -050074 'start_process' : True,
75 'monitor_process' : True,
76 'process_name' : 'inventory_items.py',
Norman James25d80dd2015-10-08 07:02:25 -050077 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -050078 }
79SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -050080 'system_state' : 'HOST_POWERED_ON',
Norman Jamesc9239a32015-10-06 16:54:31 -050081 'start_process' : True,
82 'monitor_process' : False,
83 'process_name' : 'pcie_slot_present.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -050084 'instances' : [ { 'name' : 'Slots_0' } ]
85 }
Norman James0ee61922015-10-14 09:39:11 -050086SYSTEM_CONFIG['org.openbmc.sensor.Power8Virtual'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -050087 'system_state' : 'BMC_STARTING',
Norman James0ee61922015-10-14 09:39:11 -050088 'start_process' : True,
89 'monitor_process' : True,
90 'process_name' : 'sensors_virtual_p8.py',
Norman Jamesa3e47c42015-10-18 14:43:10 -050091 'instances' : [ { 'name' : 'virtual' } ]
Norman James0ee61922015-10-14 09:39:11 -050092 }
Norman Jamesc9239a32015-10-06 16:54:31 -050093
94SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -050095 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -050096 'start_process' : True,
97 'monitor_process' : True,
98 'process_name' : 'sensor_manager.py',
Norman James25d80dd2015-10-08 07:02:25 -050099 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500100 }
101
102SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500103 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500104 'start_process' : True,
105 'monitor_process' : True,
106 'process_name' : 'host_watchdog.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -0500107 'instances' : [
108 {
109 'name' : 'HostWatchdog_0',
110 'properties' : {
111 'org.openbmc.Watchdog' : {
Norman James6ebd39a2015-10-22 07:13:23 -0500112 'poll_interval': 30000,
Norman Jamesc9239a32015-10-06 16:54:31 -0500113 }
114 }
115 }
116 ]
117 }
118
119SYSTEM_CONFIG['org.openbmc.control.Power'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500120 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500121 'start_process' : True,
122 'monitor_process' : True,
123 'process_name' : 'power_control.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -0500124 'instances' : [
125 {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500126 'name' : 'power0',
Norman Jamesc9239a32015-10-06 16:54:31 -0500127 'user_label': 'Power control',
128 'properties' : {
129 'org.openbmc.Control': {
130 'poll_interval' : 3000
131 },
132 'org.openbmc.control.Power': {
133 'pgood_timeout' : 10
134 }
135 }
136 }
137 ]
138 }
139
Norman Jamesc9239a32015-10-06 16:54:31 -0500140SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500141 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500142 'start_process' : True,
143 'monitor_process' : True,
144 'process_name' : 'button_power.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -0500145 'instances' : [ { 'name' : 'PowerButton_0' } ]
146 }
Norman Jamesa3e47c42015-10-18 14:43:10 -0500147SYSTEM_CONFIG['org.openbmc.control.led'] = {
148 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500149 'start_process' : True,
150 'monitor_process' : True,
Norman Jamesa3e47c42015-10-18 14:43:10 -0500151 'process_name' : 'led_controller.exe',
Norman Jamesa3e47c42015-10-18 14:43:10 -0500152 'instances' : [ { 'name' : 'Dummy' } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500153 }
Norman James6ebd39a2015-10-22 07:13:23 -0500154SYSTEM_CONFIG['org.openbmc.control.Flash'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500155 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500156 'start_process' : True,
157 'monitor_process' : True,
158 'process_name' : 'flash_bios.exe',
Norman James6ebd39a2015-10-22 07:13:23 -0500159 'instances' : [ { 'name' : 'dummy' } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500160 }
161
Norman Jamesf066e872015-10-07 15:29:51 -0500162SYSTEM_CONFIG['org.openbmc.manager.Download'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500163 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500164 'start_process' : True,
165 'monitor_process' : True,
Norman Jamesf066e872015-10-07 15:29:51 -0500166 'process_name' : 'download_manager.py',
Norman James25d80dd2015-10-08 07:02:25 -0500167 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500168 }
169
170SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500171 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500172 'start_process' : True,
173 'monitor_process' : True,
174 'process_name' : 'control_host.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -0500175 'instances' : [ { 'name' : 'Host_0' } ]
176 }
177SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500178 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500179 'start_process' : True,
180 'monitor_process' : True,
181 'process_name' : 'chassis_control.py',
Norman Jamesa3e47c42015-10-18 14:43:10 -0500182 'instances' : [ { 'name' : 'chassis0' } ]
Norman Jamesc9239a32015-10-06 16:54:31 -0500183 }
184
185SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500186 'system_state' : 'HOST_POWERED_ON',
187 'start_process' : False,
Norman Jamesc9239a32015-10-06 16:54:31 -0500188 'monitor_process' : False,
189 'process_name' : 'board_vpd.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -0500190 'instances' : [ { 'name' : 'MBVPD_0' } ]
191 }
192
Norman Jamesc9239a32015-10-06 16:54:31 -0500193SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
Norman Jamesa3e47c42015-10-18 14:43:10 -0500194 'system_state' : 'BMC_STARTING',
Norman Jamesc9239a32015-10-06 16:54:31 -0500195 'start_process' : True,
196 'monitor_process' : True,
197 'process_name' : 'fan.exe',
Norman Jamesc9239a32015-10-06 16:54:31 -0500198 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ]
199 }
200
Norman James2656f332015-10-26 06:42:41 -0500201CACHED_INTERFACES = {
202 "org.openbmc.InventoryItem" : True,
203 "org.openbmc.control.Chassis" : True,
204 }
Norman Jamesa3e47c42015-10-18 14:43:10 -0500205INVENTORY_ROOT = '/org/openbmc/inventory'
Norman Jamesc9239a32015-10-06 16:54:31 -0500206
207FRU_INSTANCES = {
208 '<inventory_root>/system' :
Norman James0706ae02015-10-19 16:09:47 -0500209 { 'fru_type' : 'SYSTEM','is_fru' : True, },
Norman Jamesc9239a32015-10-06 16:54:31 -0500210
Norman Jamesa42446a2015-10-19 11:12:45 -0500211 '<inventory_root>/system/chassis' :
Norman James0706ae02015-10-19 16:09:47 -0500212 { 'fru_type' : 'SYSTEM','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500213
214 '<inventory_root>/system/chassis/motherboard' :
Norman James0706ae02015-10-19 16:09:47 -0500215 { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500216
217 '<inventory_root>/system/chassis/fan0' :
Norman James0706ae02015-10-19 16:09:47 -0500218 { 'fru_type' : 'FAN','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500219 '<inventory_root>/system/chassis/fan1' :
Norman James0706ae02015-10-19 16:09:47 -0500220 { 'fru_type' : 'FAN','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500221 '<inventory_root>/system/chassis/fan2' :
Norman James0706ae02015-10-19 16:09:47 -0500222 { 'fru_type' : 'FAN','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500223 '<inventory_root>/system/chassis/fan3' :
Norman James0706ae02015-10-19 16:09:47 -0500224 { 'fru_type' : 'FAN','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500225 '<inventory_root>/system/chassis/fan4' :
Norman James0706ae02015-10-19 16:09:47 -0500226 { 'fru_type' : 'FAN','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500227
228 '<inventory_root>/system/chassis/motherboard/bmc' :
Norman James0706ae02015-10-19 16:09:47 -0500229 { 'fru_type' : 'BMC','is_fru' : False,
Norman Jamesa42446a2015-10-19 11:12:45 -0500230 'manufacturer' : 'ASPEED' },
231 '<inventory_root>/system/chassis/motherboard/cpu0' :
Norman James0706ae02015-10-19 16:09:47 -0500232 { 'fru_type' : 'CPU', 'is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500233
234 '<inventory_root>/system/chassis/motherboard/cpu0/core0' :
Norman James0706ae02015-10-19 16:09:47 -0500235 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500236
237 '<inventory_root>/system/chassis/motherboard/cpu0/core1' :
Norman James0706ae02015-10-19 16:09:47 -0500238 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500239
240 '<inventory_root>/system/chassis/motherboard/cpu0/core2' :
Norman James0706ae02015-10-19 16:09:47 -0500241 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500242
243 '<inventory_root>/system/chassis/motherboard/cpu0/core3' :
Norman James0706ae02015-10-19 16:09:47 -0500244 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500245
246 '<inventory_root>/system/chassis/motherboard/cpu0/core4' :
Norman James0706ae02015-10-19 16:09:47 -0500247 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500248
249 '<inventory_root>/system/chassis/motherboard/cpu0/core5' :
Norman James0706ae02015-10-19 16:09:47 -0500250 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500251
252 '<inventory_root>/system/chassis/motherboard/cpu0/core6' :
Norman James0706ae02015-10-19 16:09:47 -0500253 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500254
255 '<inventory_root>/system/chassis/motherboard/cpu0/core7' :
Norman James0706ae02015-10-19 16:09:47 -0500256 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500257
258 '<inventory_root>/system/chassis/motherboard/cpu0/core8' :
Norman James0706ae02015-10-19 16:09:47 -0500259 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500260
261 '<inventory_root>/system/chassis/motherboard/cpu0/core9' :
Norman James0706ae02015-10-19 16:09:47 -0500262 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500263
264 '<inventory_root>/system/chassis/motherboard/cpu0/core10' :
Norman James0706ae02015-10-19 16:09:47 -0500265 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500266
267 '<inventory_root>/system/chassis/motherboard/cpu0/core11' :
Norman James0706ae02015-10-19 16:09:47 -0500268 { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500269
270 '<inventory_root>/system/chassis/motherboard/centaur0' :
Norman James0706ae02015-10-19 16:09:47 -0500271 { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -0500272
273 '<inventory_root>/system/chassis/motherboard/dimm0' :
Norman James0706ae02015-10-19 16:09:47 -0500274 { 'fru_type' : 'DIMM', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -0500275
276 '<inventory_root>/system/chassis/motherboard/dimm1' :
Norman James0706ae02015-10-19 16:09:47 -0500277 { 'fru_type' : 'DIMM', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -0500278
279 '<inventory_root>/system/chassis/motherboard/dimm2' :
Norman James0706ae02015-10-19 16:09:47 -0500280 { 'fru_type' : 'DIMM', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -0500281
282 '<inventory_root>/system/chassis/motherboard/dimm3' :
Norman James0706ae02015-10-19 16:09:47 -0500283 { 'fru_type' : 'DIMM', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -0500284
285 '<inventory_root>/system/chassis/io_board/pcie_slot0' :
Norman James0706ae02015-10-19 16:09:47 -0500286 { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -0500287
288 '<inventory_root>/system/chassis/io_board/pcie_slot1' :
Norman James0706ae02015-10-19 16:09:47 -0500289 { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -0500290
Norman Jamesc9239a32015-10-06 16:54:31 -0500291}
292
293ID_LOOKUP = {
294 'FRU' : {
Norman Jamesa42446a2015-10-19 11:12:45 -0500295 0x0d : '<inventory_root>/system/chassis',
296 0x34 : '<inventory_root>/system/chassis/motherboard',
297 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
298 0x02 : '<inventory_root>/system/chassis/motherboard/centaur0',
299 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0',
300 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1',
301 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2',
302 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman James2656f332015-10-26 06:42:41 -0500303 0x35 : '<inventory_root>/system',
Norman Jamesc9239a32015-10-06 16:54:31 -0500304 },
Norman Jamesa42446a2015-10-19 11:12:45 -0500305 'FRU_STR' : {
Norman Jamesfe635e82015-10-20 07:47:22 -0500306 'PRODUCT_15' : '<inventory_root>/system',
307 'CHASSIS_2' : '<inventory_root>/system/chassis',
308 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0',
309 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/centaur0',
310 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0',
311 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1',
312 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2',
313 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman Jamesa42446a2015-10-19 11:12:45 -0500314 },
Norman Jamesc9239a32015-10-06 16:54:31 -0500315 'SENSOR' : {
Norman Jamesa42446a2015-10-19 11:12:45 -0500316 0x2f : '<inventory_root>/system/chassis/motherboard/cpu0',
317 0x22 : '<inventory_root>/system/chassis/motherboard/cpu0/core0',
318 0x23 : '<inventory_root>/system/chassis/motherboard/cpu0/core1',
319 0x24 : '<inventory_root>/system/chassis/motherboard/cpu0/core2',
320 0x25 : '<inventory_root>/system/chassis/motherboard/cpu0/core3',
321 0x26 : '<inventory_root>/system/chassis/motherboard/cpu0/core4',
322 0x27 : '<inventory_root>/system/chassis/motherboard/cpu0/core5',
323 0x28 : '<inventory_root>/system/chassis/motherboard/cpu0/core6',
324 0x29 : '<inventory_root>/system/chassis/motherboard/cpu0/core7',
325 0x2a : '<inventory_root>/system/chassis/motherboard/cpu0/core8',
326 0x2b : '<inventory_root>/system/chassis/motherboard/cpu0/core9',
327 0x2c : '<inventory_root>/system/chassis/motherboard/cpu0/core10',
328 0x2d : '<inventory_root>/system/chassis/motherboard/cpu0/core11',
329 0x2e : '<inventory_root>/system/chassis/motherboard/centaur0',
330 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0',
331 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1',
332 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2',
333 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman James0ee61922015-10-14 09:39:11 -0500334 0x09 : '/org/openbmc/sensor/virtual/BootCount',
335 0x05 : '/org/openbmc/sensor/virtual/BootProgress',
336 0x04 : '/org/openbmc/sensor/virtual/HostStatus',
337 0x08 : '/org/openbmc/sensor/virtual/OccStatus',
338 0x32 : '/org/openbmc/sensor/virtual/OperatingSystemStatus',
Norman Jamesc9239a32015-10-06 16:54:31 -0500339 },
340 'GPIO_PRESENT' : {
Norman Jamesa42446a2015-10-19 11:12:45 -0500341 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0',
342 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1',
Norman Jamesc9239a32015-10-06 16:54:31 -0500343 }
344}
345
346GPIO_CONFIG = {}
Norman James25d80dd2015-10-08 07:02:25 -0500347GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 484, 'direction': 'out' }
348GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 485, 'direction': 'out' }
349GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 504, 'direction': 'out' }
350GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 449, 'direction': 'out' }
351GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 486, 'direction': 'out' }
352GPIO_CONFIG['PGOOD'] = { 'gpio_num': 503, 'direction': 'in' }
353GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' }
Norman Jamesa3e47c42015-10-18 14:43:10 -0500354GPIO_CONFIG['BMC_READY'] = { 'gpio_num': 365, 'direction': 'out' }
Norman James25d80dd2015-10-08 07:02:25 -0500355GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 448, 'direction': 'falling' }
Norman Jamesc9239a32015-10-06 16:54:31 -0500356GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 104, 'direction': 'in' }
357GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 105, 'direction': 'in' }
358GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 106, 'direction': 'in' }
Norman Jamesa42446a2015-10-19 11:12:45 -0500359GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 470, 'direction': 'in' }
360GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 471, 'direction': 'in' }
Norman Jamesc9239a32015-10-06 16:54:31 -0500361GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 109, 'direction': 'in' }
362GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 112, 'direction': 'in' }
363GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 113, 'direction': 'in' }
364
Norman James6bbe0b52015-10-27 09:18:05 -0500365def convertGpio(name):
366 name = name.upper()
367 c = name[0:1]
368 num = name[1:]
369 a = ord(c)-65
370 base = 480 - (int(a/4) * 32)
371 offset = a%4*8 + int(num)
372 return base+offset
373
374
Norman Jamesc9239a32015-10-06 16:54:31 -0500375