blob: 80042c531b6df4e5e00a9b96952725218115fdc4 [file] [log] [blame]
Norman Jamesce46e3e2015-08-30 22:25:55 -05001#! /usr/bin/python
Norman James9e6acf92015-09-08 07:00:04 -05002
Norman James88872672015-09-21 16:51:35 -05003HOME_PATH = './'
Norman James5d78b4d2015-09-05 13:34:34 -05004CACHE_PATH = HOME_PATH+'cache/'
Norman James3e5c8592015-10-22 14:33:01 -05005FLASH_DOWNLOAD_PATH = "/tmp"
Norman James5d78b4d2015-09-05 13:34:34 -05006
Norman James3e5c8592015-10-22 14:33:01 -05007SYSTEM_NAME = "Barreleye"
8
9
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 James362a80f2015-09-14 14:04:39 -050014SYSTEM_STATES = [
Norman Jamesa9966b32015-10-28 06:55:58 -050015 'BASE_APPS',
Norman James3e5c8592015-10-22 14:33:01 -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 James3e5c8592015-10-22 14:33:01 -050023 'HOST_POWERED_DOWN',
Norman James362a80f2015-09-14 14:04:39 -050024]
25
Norman James3e5c8592015-10-22 14:33:01 -050026EXIT_STATE_DEPEND = {
Norman Jamesa9966b32015-10-28 06:55:58 -050027 'BASE_APPS' : {
28 '/org/openbmc/managers/Property': 0,
29 },
Norman James3e5c8592015-10-22 14:33:01 -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 James362a80f2015-09-14 14:04:39 -050039ENTER_STATE_CALLBACK = {
Norman James3e5c8592015-10-22 14:33:01 -050040 'HOST_POWERED_ON' : {
Norman James362a80f2015-09-14 14:04:39 -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 James3e5c8592015-10-22 14:33:01 -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 James362a80f2015-09-14 14:04:39 -050051 }
Norman James90baede2015-09-02 20:32:49 -050052}
53
Norman Jamesce46e3e2015-08-30 22:25:55 -050054SYSTEM_CONFIG = {}
55
Norman Jamesa9966b32015-10-28 06:55:58 -050056SYSTEM_CONFIG['org.openbmc.managers.Property'] = {
57 'system_state' : 'BASE_APPS',
58 'start_process' : True,
59 'monitor_process' : True,
60 'process_name' : 'property_manager.py',
61 'instances' : [ { 'name' : SYSTEM_NAME } ]
62 }
63
Norman James362a80f2015-09-14 14:04:39 -050064SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
Norman James3e5c8592015-10-22 14:33:01 -050065 'system_state' : 'BMC_INIT',
Norman James9e6acf92015-09-08 07:00:04 -050066 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050067 'monitor_process' : True,
Norman James3e5c8592015-10-22 14:33:01 -050068 'process_name' : 'control_bmc_barreleye.exe',
Norman Jamesdfdaca92015-09-27 22:11:15 -050069 'instances' : [ { 'name' : 'Bmc_0' } ]
Norman James9e6acf92015-09-08 07:00:04 -050070 }
71
Norman James65a295a2015-09-26 22:21:10 -050072SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
Norman James3e5c8592015-10-22 14:33:01 -050073 'system_state' : 'BMC_STARTING',
Norman James362a80f2015-09-14 14:04:39 -050074 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050075 'monitor_process' : True,
Norman James19e45912015-10-04 20:19:41 -050076 'process_name' : 'inventory_items.py',
Norman James3e5c8592015-10-22 14:33:01 -050077 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman James362a80f2015-09-14 14:04:39 -050078 }
Norman James19e45912015-10-04 20:19:41 -050079SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = {
Norman James3e5c8592015-10-22 14:33:01 -050080 'system_state' : 'HOST_POWERED_ON',
Norman James19e45912015-10-04 20:19:41 -050081 'start_process' : True,
82 'monitor_process' : False,
83 'process_name' : 'pcie_slot_present.exe',
Norman James19e45912015-10-04 20:19:41 -050084 'instances' : [ { 'name' : 'Slots_0' } ]
85 }
Norman James3e5c8592015-10-22 14:33:01 -050086SYSTEM_CONFIG['org.openbmc.sensor.Power8Virtual'] = {
87 'system_state' : 'BMC_STARTING',
88 'start_process' : True,
89 'monitor_process' : True,
90 'process_name' : 'sensors_virtual_p8.py',
Norman James3e5c8592015-10-22 14:33:01 -050091 'instances' : [ { 'name' : 'virtual' } ]
92 }
Norman James362a80f2015-09-14 14:04:39 -050093
Norman James90baede2015-09-02 20:32:49 -050094SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman James3e5c8592015-10-22 14:33:01 -050095 'system_state' : 'BMC_STARTING',
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' : 'sensor_manager.py',
Norman James3e5c8592015-10-22 14:33:01 -050099 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500100 }
101
Norman James362a80f2015-09-14 14:04:39 -0500102SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500103 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500104 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500105 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500106 'process_name' : 'host_watchdog.exe',
Norman James90baede2015-09-02 20:32:49 -0500107 'instances' : [
108 {
Norman James362a80f2015-09-14 14:04:39 -0500109 'name' : 'HostWatchdog_0',
Norman James362a80f2015-09-14 14:04:39 -0500110 'properties' : {
111 'org.openbmc.Watchdog' : {
Norman James3e5c8592015-10-22 14:33:01 -0500112 'poll_interval': 30000,
Norman James362a80f2015-09-14 14:04:39 -0500113 }
114 }
Norman James90baede2015-09-02 20:32:49 -0500115 }
116 ]
117 }
118
Norman Jamesce46e3e2015-08-30 22:25:55 -0500119SYSTEM_CONFIG['org.openbmc.control.Power'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500120 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500121 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500122 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500123 'process_name' : 'power_control.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500124 'instances' : [
125 {
Norman James3e5c8592015-10-22 14:33:01 -0500126 'name' : 'power0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500127 'user_label': 'Power control',
Norman James9e6acf92015-09-08 07:00:04 -0500128 'properties' : {
129 'org.openbmc.Control': {
130 'poll_interval' : 3000
Norman James32e74e22015-09-15 21:28:06 -0500131 },
132 'org.openbmc.control.Power': {
Norman James88872672015-09-21 16:51:35 -0500133 'pgood_timeout' : 10
Norman James9e6acf92015-09-08 07:00:04 -0500134 }
135 }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500136 }
137 ]
138 }
139
Norman James362a80f2015-09-14 14:04:39 -0500140SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500141 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500142 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500143 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500144 'process_name' : 'button_power.exe',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500145 'instances' : [ { 'name' : 'PowerButton_0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500146 }
Norman James3e5c8592015-10-22 14:33:01 -0500147SYSTEM_CONFIG['org.openbmc.control.led'] = {
148 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500149 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500150 'monitor_process' : True,
Norman James3e5c8592015-10-22 14:33:01 -0500151 'process_name' : 'led_controller.exe',
Norman James3e5c8592015-10-22 14:33:01 -0500152 'instances' : [ { 'name' : 'Dummy' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500153 }
Norman James3e5c8592015-10-22 14:33:01 -0500154SYSTEM_CONFIG['org.openbmc.control.Flash'] = {
155 'system_state' : 'BMC_STARTING',
156 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500157 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500158 'process_name' : 'flash_bios.exe',
Norman James3e5c8592015-10-22 14:33:01 -0500159 'instances' : [ { 'name' : 'dummy' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500160 }
Norman James8c6d8382015-10-06 07:47:16 -0500161
Norman James3e5c8592015-10-22 14:33:01 -0500162SYSTEM_CONFIG['org.openbmc.manager.Download'] = {
163 'system_state' : 'BMC_STARTING',
Norman James8c6d8382015-10-06 07:47:16 -0500164 'start_process' : True,
165 'monitor_process' : True,
Norman James3e5c8592015-10-22 14:33:01 -0500166 'process_name' : 'download_manager.py',
Norman James3e5c8592015-10-22 14:33:01 -0500167 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman James8c6d8382015-10-06 07:47:16 -0500168 }
169
Norman Jamesce46e3e2015-08-30 22:25:55 -0500170SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500171 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500172 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500173 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500174 'process_name' : 'control_host.exe',
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 James3e5c8592015-10-22 14:33:01 -0500178 'system_state' : 'BMC_STARTING',
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 James3e5c8592015-10-22 14:33:01 -0500182 'instances' : [ { 'name' : 'chassis0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500183 }
Norman James362a80f2015-09-14 14:04:39 -0500184
Norman James6f8d0422015-09-14 18:48:00 -0500185SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500186 'system_state' : 'HOST_POWERED_ON',
187 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -0500188 'monitor_process' : False,
189 'process_name' : 'board_vpd.exe',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500190 'instances' : [ { 'name' : 'MBVPD_0' } ]
Norman James6f8d0422015-09-14 18:48:00 -0500191 }
192
Norman James362a80f2015-09-14 14:04:39 -0500193SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500194 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500195 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500196 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500197 'process_name' : 'fan.exe',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500198 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500199 }
200
Norman Jamesa9966b32015-10-28 06:55:58 -0500201CACHED_INTERFACES = {
202 "org.openbmc.InventoryItem" : True,
203 "org.openbmc.control.Chassis" : True,
204 }
Norman James3e5c8592015-10-22 14:33:01 -0500205INVENTORY_ROOT = '/org/openbmc/inventory'
Norman James362a80f2015-09-14 14:04:39 -0500206
Norman James88872672015-09-21 16:51:35 -0500207FRU_INSTANCES = {
Norman James3e5c8592015-10-22 14:33:01 -0500208 '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, },
Norman James19e45912015-10-04 20:19:41 -0500209
Norman James3e5c8592015-10-22 14:33:01 -0500210 '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, },
211
212 '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, },
213 '<inventory_root>/system/chassis/io_board' : { 'fru_type' : 'DAUGHTER_CARD','is_fru' : True, },
214
215
216 '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, },
217 '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, },
218 '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, },
219 '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, },
220 '<inventory_root>/system/chassis/fan4' : { 'fru_type' : 'FAN','is_fru' : True, },
221
222 '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' },
223
224 '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, },
225 '<inventory_root>/system/chassis/motherboard/cpu1' : { 'fru_type' : 'CPU', 'is_fru' : True, },
226
227 '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
228 '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
229 '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
230 '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
231 '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
232 '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
233 '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
234 '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
235 '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
236 '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
237 '<inventory_root>/system/chassis/motherboard/cpu0/core10': { 'fru_type' : 'CORE', 'is_fru' : False, },
238 '<inventory_root>/system/chassis/motherboard/cpu0/core11': { 'fru_type' : 'CORE', 'is_fru' : False, },
239
240 '<inventory_root>/system/chassis/motherboard/cpu1/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
241 '<inventory_root>/system/chassis/motherboard/cpu1/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
242 '<inventory_root>/system/chassis/motherboard/cpu1/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
243 '<inventory_root>/system/chassis/motherboard/cpu1/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
244 '<inventory_root>/system/chassis/motherboard/cpu1/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
245 '<inventory_root>/system/chassis/motherboard/cpu1/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
246 '<inventory_root>/system/chassis/motherboard/cpu1/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
247 '<inventory_root>/system/chassis/motherboard/cpu1/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
248 '<inventory_root>/system/chassis/motherboard/cpu1/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
249 '<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
250 '<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, },
251 '<inventory_root>/system/chassis/motherboard/cpu0/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, },
252
253 '<inventory_root>/system/chassis/motherboard/centaur0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
254 '<inventory_root>/system/chassis/motherboard/centaur1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
255 '<inventory_root>/system/chassis/motherboard/centaur2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
256 '<inventory_root>/system/chassis/motherboard/centaur3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
257 '<inventory_root>/system/chassis/motherboard/centaur4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
258 '<inventory_root>/system/chassis/motherboard/centaur5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
259 '<inventory_root>/system/chassis/motherboard/centaur6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
260 '<inventory_root>/system/chassis/motherboard/centaur7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
261
262 '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
263 '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
264 '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
265 '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
266 '<inventory_root>/system/chassis/motherboard/dimm4' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
267 '<inventory_root>/system/chassis/motherboard/dimm5' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
268 '<inventory_root>/system/chassis/motherboard/dimm6' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
269 '<inventory_root>/system/chassis/motherboard/dimm7' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
270 '<inventory_root>/system/chassis/motherboard/dimm8' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
271 '<inventory_root>/system/chassis/motherboard/dimm9' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
272 '<inventory_root>/system/chassis/motherboard/dimm10' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
273 '<inventory_root>/system/chassis/motherboard/dimm11' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
274 '<inventory_root>/system/chassis/motherboard/dimm12' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
275 '<inventory_root>/system/chassis/motherboard/dimm13' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
276 '<inventory_root>/system/chassis/motherboard/dimm14' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
277 '<inventory_root>/system/chassis/motherboard/dimm15' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
278 '<inventory_root>/system/chassis/motherboard/dimm16' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
279 '<inventory_root>/system/chassis/motherboard/dimm17' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
280 '<inventory_root>/system/chassis/motherboard/dimm18' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
281 '<inventory_root>/system/chassis/motherboard/dimm19' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
282 '<inventory_root>/system/chassis/motherboard/dimm20' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
283 '<inventory_root>/system/chassis/motherboard/dimm21' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
284 '<inventory_root>/system/chassis/motherboard/dimm22' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
285 '<inventory_root>/system/chassis/motherboard/dimm23' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
286 '<inventory_root>/system/chassis/motherboard/dimm24' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
287 '<inventory_root>/system/chassis/motherboard/dimm25' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
288 '<inventory_root>/system/chassis/motherboard/dimm26' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
289 '<inventory_root>/system/chassis/motherboard/dimm27' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
290 '<inventory_root>/system/chassis/motherboard/dimm28' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
291 '<inventory_root>/system/chassis/motherboard/dimm29' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
292 '<inventory_root>/system/chassis/motherboard/dimm30' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
293 '<inventory_root>/system/chassis/motherboard/dimm31' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
294
295 '<inventory_root>/system/chassis/io_board/pcie_slot0_riser' : { 'fru_type' : 'PCIE_RISER', 'is_fru' : True,},
296 '<inventory_root>/system/chassis/io_board/pcie_slot1_riser' : { 'fru_type' : 'PCIE_RISER', 'is_fru' : True,},
297 '<inventory_root>/system/chassis/io_board/pcie_slot0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
298 '<inventory_root>/system/chassis/io_board/pcie_slot1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
299 '<inventory_root>/system/chassis/io_board/pcie_mezz0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
300 '<inventory_root>/system/chassis/io_board/pcie_mezz1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
Norman James19e45912015-10-04 20:19:41 -0500301
Norman James88872672015-09-21 16:51:35 -0500302}
Norman James362a80f2015-09-14 14:04:39 -0500303
Norman James3e5c8592015-10-22 14:33:01 -0500304
305
Norman Jamesa9966b32015-10-28 06:55:58 -0500306
Norman James19e45912015-10-04 20:19:41 -0500307ID_LOOKUP = {
308 'FRU' : {
Norman James3e5c8592015-10-22 14:33:01 -0500309 0x0d : '<inventory_root>/system/chassis',
310 0x34 : '<inventory_root>/system/chassis/motherboard',
311 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
312 0x02 : '<inventory_root>/system/chassis/motherboard/centaur0',
313 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0',
314 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1',
315 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2',
316 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman Jamesa9966b32015-10-28 06:55:58 -0500317 0x35 : '<inventory_root>/system',
Norman James3e5c8592015-10-22 14:33:01 -0500318 },
319 'FRU_STR' : {
320 'PRODUCT_15' : '<inventory_root>/system',
321 'CHASSIS_2' : '<inventory_root>/system/chassis',
322 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0',
323 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/centaur0',
324 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0',
325 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1',
326 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2',
327 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman James19e45912015-10-04 20:19:41 -0500328 },
329 'SENSOR' : {
Norman James3e5c8592015-10-22 14:33:01 -0500330 0x2f : '<inventory_root>/system/chassis/motherboard/cpu0',
331 0x22 : '<inventory_root>/system/chassis/motherboard/cpu0/core0',
332 0x23 : '<inventory_root>/system/chassis/motherboard/cpu0/core1',
333 0x24 : '<inventory_root>/system/chassis/motherboard/cpu0/core2',
334 0x25 : '<inventory_root>/system/chassis/motherboard/cpu0/core3',
335 0x26 : '<inventory_root>/system/chassis/motherboard/cpu0/core4',
336 0x27 : '<inventory_root>/system/chassis/motherboard/cpu0/core5',
337 0x28 : '<inventory_root>/system/chassis/motherboard/cpu0/core6',
338 0x29 : '<inventory_root>/system/chassis/motherboard/cpu0/core7',
339 0x2a : '<inventory_root>/system/chassis/motherboard/cpu0/core8',
340 0x2b : '<inventory_root>/system/chassis/motherboard/cpu0/core9',
341 0x2c : '<inventory_root>/system/chassis/motherboard/cpu0/core10',
342 0x2d : '<inventory_root>/system/chassis/motherboard/cpu0/core11',
343 0x2e : '<inventory_root>/system/chassis/motherboard/centaur0',
344 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0',
345 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1',
346 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2',
347 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3',
348 0x09 : '/org/openbmc/sensor/virtual/BootCount',
349 0x05 : '/org/openbmc/sensor/virtual/BootProgress',
350 0x04 : '/org/openbmc/sensor/virtual/HostStatus',
351 0x08 : '/org/openbmc/sensor/virtual/OccStatus',
352 0x32 : '/org/openbmc/sensor/virtual/OperatingSystemStatus',
Norman James19e45912015-10-04 20:19:41 -0500353 },
354 'GPIO_PRESENT' : {
Norman James3e5c8592015-10-22 14:33:01 -0500355 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0',
356 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1',
Norman James19e45912015-10-04 20:19:41 -0500357 }
358}
Norman James362a80f2015-09-14 14:04:39 -0500359
Norman Jamesce46e3e2015-08-30 22:25:55 -0500360GPIO_CONFIG = {}
Norman Jamesa9966b32015-10-28 06:55:58 -0500361GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 324, 'direction': 'out' }
362GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 325, 'direction': 'out' }
363GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 344, 'direction': 'out' }
364GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 353, 'direction': 'out' }
365GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 326, 'direction': 'out' }
366GPIO_CONFIG['PGOOD'] = { 'gpio_num': 343, 'direction': 'in' }
367GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' }
368GPIO_CONFIG['BMC_READY'] = { 'gpio_num': 431, 'direction': 'out' }
369GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 352, 'direction': 'falling' }
370GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 424, 'direction': 'in' }
371GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 425, 'direction': 'in' }
372GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 426, 'direction': 'in' }
373GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 427, 'direction': 'in' }
374GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 428, 'direction': 'in' }
375GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 429, 'direction': 'in' }
376GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 432, 'direction': 'in' }
377GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 433, 'direction': 'in' }
378
379def convertGpio(name):
380 name = name.upper()
381 c = name[0:1]
382 offset = int(name[1:])
383 a = ord(c)-65
384 base = a*8+GPIO_BASE
385 return base+offset
386
387
388
Norman James19e45912015-10-04 20:19:41 -0500389
Norman Jamesce46e3e2015-08-30 22:25:55 -0500390