blob: e77a438dfd0fb03a6b6d4dd7cacbf116edb64ab7 [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 James5d78b4d2015-09-05 13:34:34 -05007CACHE_PATH = HOME_PATH+'cache/'
Norman James362a80f2015-09-14 14:04:39 -05008FRU_PATH = CACHE_PATH+'frus/'
Norman James3e5c8592015-10-22 14:33:01 -05009FLASH_DOWNLOAD_PATH = "/tmp"
Norman James5d78b4d2015-09-05 13:34:34 -050010
Norman James3e5c8592015-10-22 14:33:01 -050011SYSTEM_NAME = "Barreleye"
12
13
14## System states
15## state can change to next state in 2 ways:
16## - a process emits a GotoSystemState signal with state name to goto
17## - objects specified in EXIT_STATE_DEPEND have started
Norman James362a80f2015-09-14 14:04:39 -050018SYSTEM_STATES = [
Norman James3e5c8592015-10-22 14:33:01 -050019 'BMC_INIT',
20 'BMC_STARTING',
21 'BMC_READY',
22 'HOST_POWERING_ON',
23 'HOST_POWERED_ON',
24 'HOST_BOOTING',
Norman James2656f332015-10-26 06:42:41 -050025 'HOST_BOOTED',
Norman James3e5c8592015-10-22 14:33:01 -050026 'HOST_POWERED_DOWN',
Norman James362a80f2015-09-14 14:04:39 -050027]
28
Norman James3e5c8592015-10-22 14:33:01 -050029EXIT_STATE_DEPEND = {
30 '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 James362a80f2015-09-14 14:04:39 -050056SYSTEM_CONFIG['org.openbmc.control.Bmc'] = {
Norman James3e5c8592015-10-22 14:33:01 -050057 'system_state' : 'BMC_INIT',
Norman James9e6acf92015-09-08 07:00:04 -050058 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050059 'monitor_process' : True,
Norman James3e5c8592015-10-22 14:33:01 -050060 'process_name' : 'control_bmc_barreleye.exe',
Norman James9e6acf92015-09-08 07:00:04 -050061 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -050062 'instances' : [ { 'name' : 'Bmc_0' } ]
Norman James9e6acf92015-09-08 07:00:04 -050063 }
64
Norman James65a295a2015-09-26 22:21:10 -050065SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = {
Norman James3e5c8592015-10-22 14:33:01 -050066 'system_state' : 'BMC_STARTING',
Norman James362a80f2015-09-14 14:04:39 -050067 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050068 'monitor_process' : True,
Norman James19e45912015-10-04 20:19:41 -050069 'process_name' : 'inventory_items.py',
Norman James362a80f2015-09-14 14:04:39 -050070 'heartbeat' : 'no',
Norman James3e5c8592015-10-22 14:33:01 -050071 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman James362a80f2015-09-14 14:04:39 -050072 }
Norman James19e45912015-10-04 20:19:41 -050073SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = {
Norman James3e5c8592015-10-22 14:33:01 -050074 'system_state' : 'HOST_POWERED_ON',
Norman James19e45912015-10-04 20:19:41 -050075 'start_process' : True,
76 'monitor_process' : False,
77 'process_name' : 'pcie_slot_present.exe',
78 'heartbeat' : 'no',
79 'instances' : [ { 'name' : 'Slots_0' } ]
80 }
Norman James3e5c8592015-10-22 14:33:01 -050081SYSTEM_CONFIG['org.openbmc.sensor.Power8Virtual'] = {
82 'system_state' : 'BMC_STARTING',
83 'start_process' : True,
84 'monitor_process' : True,
85 'process_name' : 'sensors_virtual_p8.py',
86 'heartbeat' : 'no',
87 'instances' : [ { 'name' : 'virtual' } ]
88 }
Norman James362a80f2015-09-14 14:04:39 -050089
Norman James90baede2015-09-02 20:32:49 -050090SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = {
Norman James3e5c8592015-10-22 14:33:01 -050091 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -050092 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -050093 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -050094 'process_name' : 'sensor_manager.py',
Norman James90baede2015-09-02 20:32:49 -050095 'heartbeat' : 'no',
Norman James3e5c8592015-10-22 14:33:01 -050096 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -050097 }
98
Norman James362a80f2015-09-14 14:04:39 -050099SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500100 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500101 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500102 'monitor_process' : True,
Norman James362a80f2015-09-14 14:04:39 -0500103 'process_name' : 'host_watchdog.exe',
Norman James90baede2015-09-02 20:32:49 -0500104 'heartbeat' : 'no',
105 'instances' : [
106 {
Norman James362a80f2015-09-14 14:04:39 -0500107 'name' : 'HostWatchdog_0',
Norman James362a80f2015-09-14 14:04:39 -0500108 'properties' : {
109 'org.openbmc.Watchdog' : {
Norman James3e5c8592015-10-22 14:33:01 -0500110 'poll_interval': 30000,
Norman James362a80f2015-09-14 14:04:39 -0500111 }
112 }
Norman James90baede2015-09-02 20:32:49 -0500113 }
114 ]
115 }
116
Norman Jamesce46e3e2015-08-30 22:25:55 -0500117SYSTEM_CONFIG['org.openbmc.control.Power'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500118 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500119 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500120 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500121 'process_name' : 'power_control.exe',
Norman James3e5c8592015-10-22 14:33:01 -0500122 'heartbeat' : 'no',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500123 'instances' : [
124 {
Norman James3e5c8592015-10-22 14:33:01 -0500125 'name' : 'power0',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500126 'user_label': 'Power control',
Norman James9e6acf92015-09-08 07:00:04 -0500127 'properties' : {
128 'org.openbmc.Control': {
129 'poll_interval' : 3000
Norman James32e74e22015-09-15 21:28:06 -0500130 },
131 'org.openbmc.control.Power': {
Norman James88872672015-09-21 16:51:35 -0500132 'pgood_timeout' : 10
Norman James9e6acf92015-09-08 07:00:04 -0500133 }
134 }
Norman Jamesce46e3e2015-08-30 22:25:55 -0500135 }
136 ]
137 }
138
Norman James362a80f2015-09-14 14:04:39 -0500139SYSTEM_CONFIG['org.openbmc.buttons.Power'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500140 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500141 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500142 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500143 'process_name' : 'button_power.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500144 'heartbeat' : 'no',
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 Jamesce46e3e2015-08-30 22:25:55 -0500152 'heartbeat' : 'no',
Norman James3e5c8592015-10-22 14:33:01 -0500153 'instances' : [ { 'name' : 'Dummy' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500154 }
Norman James3e5c8592015-10-22 14:33:01 -0500155SYSTEM_CONFIG['org.openbmc.control.Flash'] = {
156 'system_state' : 'BMC_STARTING',
157 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500158 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500159 'process_name' : 'flash_bios.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500160 'heartbeat' : 'no',
Norman James3e5c8592015-10-22 14:33:01 -0500161 'instances' : [ { 'name' : 'dummy' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500162 }
Norman James8c6d8382015-10-06 07:47:16 -0500163
Norman James3e5c8592015-10-22 14:33:01 -0500164SYSTEM_CONFIG['org.openbmc.manager.Download'] = {
165 'system_state' : 'BMC_STARTING',
Norman James8c6d8382015-10-06 07:47:16 -0500166 'start_process' : True,
167 'monitor_process' : True,
Norman James3e5c8592015-10-22 14:33:01 -0500168 'process_name' : 'download_manager.py',
Norman James8c6d8382015-10-06 07:47:16 -0500169 'heartbeat' : 'no',
Norman James3e5c8592015-10-22 14:33:01 -0500170 'instances' : [ { 'name' : SYSTEM_NAME } ]
Norman James8c6d8382015-10-06 07:47:16 -0500171 }
172
Norman Jamesce46e3e2015-08-30 22:25:55 -0500173SYSTEM_CONFIG['org.openbmc.control.Host'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500174 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500175 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500176 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500177 'process_name' : 'control_host.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500178 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500179 'instances' : [ { 'name' : 'Host_0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500180 }
181SYSTEM_CONFIG['org.openbmc.control.Chassis'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500182 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500183 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500184 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500185 'process_name' : 'chassis_control.py',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500186 'heartbeat' : 'no',
Norman James3e5c8592015-10-22 14:33:01 -0500187 'instances' : [ { 'name' : 'chassis0' } ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500188 }
Norman James362a80f2015-09-14 14:04:39 -0500189
Norman James6f8d0422015-09-14 18:48:00 -0500190SYSTEM_CONFIG['org.openbmc.vpd'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500191 'system_state' : 'HOST_POWERED_ON',
192 'start_process' : False,
Norman James6f8d0422015-09-14 18:48:00 -0500193 'monitor_process' : False,
194 'process_name' : 'board_vpd.exe',
195 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500196 'instances' : [ { 'name' : 'MBVPD_0' } ]
Norman James6f8d0422015-09-14 18:48:00 -0500197 }
198
Norman James362a80f2015-09-14 14:04:39 -0500199SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = {
Norman James3e5c8592015-10-22 14:33:01 -0500200 'system_state' : 'BMC_STARTING',
Norman James5d78b4d2015-09-05 13:34:34 -0500201 'start_process' : True,
Norman James6f8d0422015-09-14 18:48:00 -0500202 'monitor_process' : True,
Norman James5d78b4d2015-09-05 13:34:34 -0500203 'process_name' : 'fan.exe',
Norman Jamesce46e3e2015-08-30 22:25:55 -0500204 'heartbeat' : 'no',
Norman Jamesdfdaca92015-09-27 22:11:15 -0500205 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ]
Norman Jamesce46e3e2015-08-30 22:25:55 -0500206 }
207
Norman James362a80f2015-09-14 14:04:39 -0500208NON_CACHABLE_PROPERTIES = {
209 'name' : True,
210 'user_label' : True,
211 'location' : True,
Norman James19e45912015-10-04 20:19:41 -0500212 'state' : True,
Norman James362a80f2015-09-14 14:04:39 -0500213 'cache' : True
214}
Norman James3e5c8592015-10-22 14:33:01 -0500215INVENTORY_ROOT = '/org/openbmc/inventory'
Norman James362a80f2015-09-14 14:04:39 -0500216
Norman James88872672015-09-21 16:51:35 -0500217FRU_INSTANCES = {
Norman James3e5c8592015-10-22 14:33:01 -0500218 '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, },
Norman James19e45912015-10-04 20:19:41 -0500219
Norman James3e5c8592015-10-22 14:33:01 -0500220 '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, },
221
222 '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, },
223 '<inventory_root>/system/chassis/io_board' : { 'fru_type' : 'DAUGHTER_CARD','is_fru' : True, },
224
225
226 '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, },
227 '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, },
228 '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, },
229 '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, },
230 '<inventory_root>/system/chassis/fan4' : { 'fru_type' : 'FAN','is_fru' : True, },
231
232 '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' },
233
234 '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, },
235 '<inventory_root>/system/chassis/motherboard/cpu1' : { 'fru_type' : 'CPU', 'is_fru' : True, },
236
237 '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
238 '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
239 '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
240 '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
241 '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
242 '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
243 '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
244 '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
245 '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
246 '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
247 '<inventory_root>/system/chassis/motherboard/cpu0/core10': { 'fru_type' : 'CORE', 'is_fru' : False, },
248 '<inventory_root>/system/chassis/motherboard/cpu0/core11': { 'fru_type' : 'CORE', 'is_fru' : False, },
249
250 '<inventory_root>/system/chassis/motherboard/cpu1/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
251 '<inventory_root>/system/chassis/motherboard/cpu1/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
252 '<inventory_root>/system/chassis/motherboard/cpu1/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
253 '<inventory_root>/system/chassis/motherboard/cpu1/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
254 '<inventory_root>/system/chassis/motherboard/cpu1/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
255 '<inventory_root>/system/chassis/motherboard/cpu1/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
256 '<inventory_root>/system/chassis/motherboard/cpu1/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
257 '<inventory_root>/system/chassis/motherboard/cpu1/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
258 '<inventory_root>/system/chassis/motherboard/cpu1/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
259 '<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
260 '<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, },
261 '<inventory_root>/system/chassis/motherboard/cpu0/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, },
262
263 '<inventory_root>/system/chassis/motherboard/centaur0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
264 '<inventory_root>/system/chassis/motherboard/centaur1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
265 '<inventory_root>/system/chassis/motherboard/centaur2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
266 '<inventory_root>/system/chassis/motherboard/centaur3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
267 '<inventory_root>/system/chassis/motherboard/centaur4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
268 '<inventory_root>/system/chassis/motherboard/centaur5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
269 '<inventory_root>/system/chassis/motherboard/centaur6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
270 '<inventory_root>/system/chassis/motherboard/centaur7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
271
272 '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
273 '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
274 '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
275 '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
276 '<inventory_root>/system/chassis/motherboard/dimm4' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
277 '<inventory_root>/system/chassis/motherboard/dimm5' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
278 '<inventory_root>/system/chassis/motherboard/dimm6' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
279 '<inventory_root>/system/chassis/motherboard/dimm7' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
280 '<inventory_root>/system/chassis/motherboard/dimm8' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
281 '<inventory_root>/system/chassis/motherboard/dimm9' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
282 '<inventory_root>/system/chassis/motherboard/dimm10' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
283 '<inventory_root>/system/chassis/motherboard/dimm11' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
284 '<inventory_root>/system/chassis/motherboard/dimm12' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
285 '<inventory_root>/system/chassis/motherboard/dimm13' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
286 '<inventory_root>/system/chassis/motherboard/dimm14' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
287 '<inventory_root>/system/chassis/motherboard/dimm15' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
288 '<inventory_root>/system/chassis/motherboard/dimm16' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
289 '<inventory_root>/system/chassis/motherboard/dimm17' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
290 '<inventory_root>/system/chassis/motherboard/dimm18' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
291 '<inventory_root>/system/chassis/motherboard/dimm19' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
292 '<inventory_root>/system/chassis/motherboard/dimm20' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
293 '<inventory_root>/system/chassis/motherboard/dimm21' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
294 '<inventory_root>/system/chassis/motherboard/dimm22' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
295 '<inventory_root>/system/chassis/motherboard/dimm23' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
296 '<inventory_root>/system/chassis/motherboard/dimm24' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
297 '<inventory_root>/system/chassis/motherboard/dimm25' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
298 '<inventory_root>/system/chassis/motherboard/dimm26' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
299 '<inventory_root>/system/chassis/motherboard/dimm27' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
300 '<inventory_root>/system/chassis/motherboard/dimm28' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
301 '<inventory_root>/system/chassis/motherboard/dimm29' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
302 '<inventory_root>/system/chassis/motherboard/dimm30' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
303 '<inventory_root>/system/chassis/motherboard/dimm31' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
304
305 '<inventory_root>/system/chassis/io_board/pcie_slot0_riser' : { 'fru_type' : 'PCIE_RISER', 'is_fru' : True,},
306 '<inventory_root>/system/chassis/io_board/pcie_slot1_riser' : { 'fru_type' : 'PCIE_RISER', 'is_fru' : True,},
307 '<inventory_root>/system/chassis/io_board/pcie_slot0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
308 '<inventory_root>/system/chassis/io_board/pcie_slot1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
309 '<inventory_root>/system/chassis/io_board/pcie_mezz0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
310 '<inventory_root>/system/chassis/io_board/pcie_mezz1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
Norman James19e45912015-10-04 20:19:41 -0500311
Norman James88872672015-09-21 16:51:35 -0500312}
Norman James362a80f2015-09-14 14:04:39 -0500313
Norman James3e5c8592015-10-22 14:33:01 -0500314
315
Norman James19e45912015-10-04 20:19:41 -0500316ID_LOOKUP = {
317 'FRU' : {
Norman James3e5c8592015-10-22 14:33:01 -0500318 0x0d : '<inventory_root>/system/chassis',
319 0x34 : '<inventory_root>/system/chassis/motherboard',
320 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
321 0x02 : '<inventory_root>/system/chassis/motherboard/centaur0',
322 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0',
323 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1',
324 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2',
325 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3',
326 0xff : '<inventory_root>/system',
327 },
328 'FRU_STR' : {
329 'PRODUCT_15' : '<inventory_root>/system',
330 'CHASSIS_2' : '<inventory_root>/system/chassis',
331 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0',
332 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/centaur0',
333 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0',
334 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1',
335 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2',
336 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman James19e45912015-10-04 20:19:41 -0500337 },
338 'SENSOR' : {
Norman James3e5c8592015-10-22 14:33:01 -0500339 0x2f : '<inventory_root>/system/chassis/motherboard/cpu0',
340 0x22 : '<inventory_root>/system/chassis/motherboard/cpu0/core0',
341 0x23 : '<inventory_root>/system/chassis/motherboard/cpu0/core1',
342 0x24 : '<inventory_root>/system/chassis/motherboard/cpu0/core2',
343 0x25 : '<inventory_root>/system/chassis/motherboard/cpu0/core3',
344 0x26 : '<inventory_root>/system/chassis/motherboard/cpu0/core4',
345 0x27 : '<inventory_root>/system/chassis/motherboard/cpu0/core5',
346 0x28 : '<inventory_root>/system/chassis/motherboard/cpu0/core6',
347 0x29 : '<inventory_root>/system/chassis/motherboard/cpu0/core7',
348 0x2a : '<inventory_root>/system/chassis/motherboard/cpu0/core8',
349 0x2b : '<inventory_root>/system/chassis/motherboard/cpu0/core9',
350 0x2c : '<inventory_root>/system/chassis/motherboard/cpu0/core10',
351 0x2d : '<inventory_root>/system/chassis/motherboard/cpu0/core11',
352 0x2e : '<inventory_root>/system/chassis/motherboard/centaur0',
353 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0',
354 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1',
355 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2',
356 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3',
357 0x09 : '/org/openbmc/sensor/virtual/BootCount',
358 0x05 : '/org/openbmc/sensor/virtual/BootProgress',
359 0x04 : '/org/openbmc/sensor/virtual/HostStatus',
360 0x08 : '/org/openbmc/sensor/virtual/OccStatus',
361 0x32 : '/org/openbmc/sensor/virtual/OperatingSystemStatus',
Norman James19e45912015-10-04 20:19:41 -0500362 },
363 'GPIO_PRESENT' : {
Norman James3e5c8592015-10-22 14:33:01 -0500364 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0',
365 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1',
Norman James19e45912015-10-04 20:19:41 -0500366 }
367}
Norman James362a80f2015-09-14 14:04:39 -0500368
Norman Jamesce46e3e2015-08-30 22:25:55 -0500369GPIO_CONFIG = {}
Norman James3e5c8592015-10-22 14:33:01 -0500370GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 484, 'direction': 'out' }
371GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 485, 'direction': 'out' }
372GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 504, 'direction': 'out' }
373GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 449, 'direction': 'out' }
374GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 486, 'direction': 'out' }
375GPIO_CONFIG['PGOOD'] = { 'gpio_num': 503, 'direction': 'in' }
376GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 474, 'direction': 'out' }
377GPIO_CONFIG['BMC_READY'] = { 'gpio_num': 474, 'direction': 'out' }
378GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 448, 'direction': 'falling' }
379GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 392, 'direction': 'in' }
380GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 393, 'direction': 'in' }
381GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 394, 'direction': 'in' }
382GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 395, 'direction': 'in' }
383GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 396, 'direction': 'in' }
384GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 397, 'direction': 'in' }
385GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 400, 'direction': 'in' }
386GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 401, 'direction': 'in' }
Norman James19e45912015-10-04 20:19:41 -0500387
Norman Jamesce46e3e2015-08-30 22:25:55 -0500388