Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 1 | #! /usr/bin/python |
| 2 | |
| 3 | import dbus |
| 4 | import Openbmc |
| 5 | |
| 6 | HOME_PATH = './' |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 7 | CACHE_PATH = HOME_PATH+'cache/' |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 8 | FLASH_DOWNLOAD_PATH = "/tmp" |
| 9 | |
Norman James | 969227c | 2015-10-08 15:10:47 -0500 | [diff] [blame] | 10 | SYSTEM_NAME = "Palmetto" |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 11 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 12 | |
| 13 | ## System states |
| 14 | ## state can change to next state in 2 ways: |
| 15 | ## - a process emits a GotoSystemState signal with state name to goto |
| 16 | ## - objects specified in EXIT_STATE_DEPEND have started |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 17 | SYSTEM_STATES = [ |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 18 | 'BASE_APPS', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 19 | 'BMC_INIT', |
| 20 | 'BMC_STARTING', |
| 21 | 'BMC_READY', |
| 22 | 'HOST_POWERING_ON', |
| 23 | 'HOST_POWERED_ON', |
| 24 | 'HOST_BOOTING', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 25 | 'HOST_BOOTED', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 26 | 'HOST_POWERED_DOWN', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 27 | ] |
| 28 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 29 | EXIT_STATE_DEPEND = { |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 30 | 'BASE_APPS' : { |
| 31 | '/org/openbmc/managers/Property': 0, |
| 32 | }, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 33 | 'BMC_STARTING' : { |
| 34 | '/org/openbmc/control/chassis0': 0, |
| 35 | '/org/openbmc/control/power0' : 0, |
| 36 | '/org/openbmc/control/led/BMC_READY' : 0, |
| 37 | '/org/openbmc/control/Host_0' : 0, |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | ## method will be called when state is entered |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 42 | ENTER_STATE_CALLBACK = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 43 | 'HOST_POWERED_ON' : { |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 44 | 'bus_name' : 'org.openbmc.control.Host', |
| 45 | 'obj_name' : '/org/openbmc/control/Host_0', |
| 46 | 'interface_name' : 'org.openbmc.control.Host', |
| 47 | 'method_name' : 'boot' |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 48 | }, |
| 49 | 'BMC_READY' : { |
| 50 | 'bus_name' : 'org.openbmc.control.led', |
| 51 | 'obj_name' : '/org/openbmc/control/led/BMC_READY', |
| 52 | 'interface_name' : 'org.openbmc.Led', |
| 53 | 'method_name' : 'setOn' |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 54 | } |
| 55 | } |
| 56 | |
| 57 | SYSTEM_CONFIG = {} |
| 58 | |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 59 | SYSTEM_CONFIG['org.openbmc.managers.Property'] = { |
Norman James | b714eb2 | 2015-10-26 17:12:57 -0500 | [diff] [blame] | 60 | 'system_state' : 'BASE_APPS', |
| 61 | 'start_process' : True, |
| 62 | 'monitor_process' : True, |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 63 | 'process_name' : 'property_manager.py', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 64 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
| 65 | } |
| 66 | |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 67 | SYSTEM_CONFIG['org.openbmc.control.Bmc'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 68 | 'system_state' : 'BMC_INIT', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 69 | 'start_process' : True, |
| 70 | 'monitor_process' : True, |
| 71 | 'process_name' : 'control_bmc.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 72 | 'instances' : [ { 'name' : 'Bmc_0' } ] |
| 73 | } |
| 74 | |
| 75 | SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 76 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 77 | 'start_process' : True, |
| 78 | 'monitor_process' : True, |
| 79 | 'process_name' : 'inventory_items.py', |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 80 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 81 | } |
| 82 | SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 83 | 'system_state' : 'HOST_POWERED_ON', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 84 | 'start_process' : True, |
| 85 | 'monitor_process' : False, |
| 86 | 'process_name' : 'pcie_slot_present.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 87 | 'instances' : [ { 'name' : 'Slots_0' } ] |
| 88 | } |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 89 | SYSTEM_CONFIG['org.openbmc.sensor.Power8Virtual'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 90 | 'system_state' : 'BMC_STARTING', |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 91 | 'start_process' : True, |
| 92 | 'monitor_process' : True, |
| 93 | 'process_name' : 'sensors_virtual_p8.py', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 94 | 'instances' : [ { 'name' : 'virtual' } ] |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 95 | } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 96 | |
| 97 | SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 98 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 99 | 'start_process' : True, |
| 100 | 'monitor_process' : True, |
| 101 | 'process_name' : 'sensor_manager.py', |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 102 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 106 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 107 | 'start_process' : True, |
| 108 | 'monitor_process' : True, |
| 109 | 'process_name' : 'host_watchdog.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 110 | 'instances' : [ |
| 111 | { |
| 112 | 'name' : 'HostWatchdog_0', |
| 113 | 'properties' : { |
| 114 | 'org.openbmc.Watchdog' : { |
Norman James | 6ebd39a | 2015-10-22 07:13:23 -0500 | [diff] [blame] | 115 | 'poll_interval': 30000, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 116 | } |
| 117 | } |
| 118 | } |
| 119 | ] |
| 120 | } |
| 121 | |
| 122 | SYSTEM_CONFIG['org.openbmc.control.Power'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 123 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 124 | 'start_process' : True, |
| 125 | 'monitor_process' : True, |
| 126 | 'process_name' : 'power_control.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 127 | 'instances' : [ |
| 128 | { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 129 | 'name' : 'power0', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 130 | 'user_label': 'Power control', |
| 131 | 'properties' : { |
| 132 | 'org.openbmc.Control': { |
| 133 | 'poll_interval' : 3000 |
| 134 | }, |
| 135 | 'org.openbmc.control.Power': { |
| 136 | 'pgood_timeout' : 10 |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | ] |
| 141 | } |
| 142 | |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 143 | SYSTEM_CONFIG['org.openbmc.buttons.Power'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 144 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 145 | 'start_process' : True, |
| 146 | 'monitor_process' : True, |
| 147 | 'process_name' : 'button_power.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 148 | 'instances' : [ { 'name' : 'PowerButton_0' } ] |
| 149 | } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 150 | SYSTEM_CONFIG['org.openbmc.control.led'] = { |
| 151 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 152 | 'start_process' : True, |
| 153 | 'monitor_process' : True, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 154 | 'process_name' : 'led_controller.exe', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 155 | 'instances' : [ { 'name' : 'Dummy' } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 156 | } |
Norman James | 6ebd39a | 2015-10-22 07:13:23 -0500 | [diff] [blame] | 157 | SYSTEM_CONFIG['org.openbmc.control.Flash'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 158 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 159 | 'start_process' : True, |
| 160 | 'monitor_process' : True, |
| 161 | 'process_name' : 'flash_bios.exe', |
Norman James | 6ebd39a | 2015-10-22 07:13:23 -0500 | [diff] [blame] | 162 | 'instances' : [ { 'name' : 'dummy' } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 163 | } |
| 164 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 165 | SYSTEM_CONFIG['org.openbmc.manager.Download'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 166 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 167 | 'start_process' : True, |
| 168 | 'monitor_process' : True, |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 169 | 'process_name' : 'download_manager.py', |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 170 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | SYSTEM_CONFIG['org.openbmc.control.Host'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 174 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 175 | 'start_process' : True, |
| 176 | 'monitor_process' : True, |
| 177 | 'process_name' : 'control_host.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 178 | 'instances' : [ { 'name' : 'Host_0' } ] |
| 179 | } |
| 180 | SYSTEM_CONFIG['org.openbmc.control.Chassis'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 181 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 182 | 'start_process' : True, |
| 183 | 'monitor_process' : True, |
| 184 | 'process_name' : 'chassis_control.py', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 185 | 'instances' : [ { 'name' : 'chassis0' } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | SYSTEM_CONFIG['org.openbmc.vpd'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 189 | 'system_state' : 'HOST_POWERED_ON', |
| 190 | 'start_process' : False, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 191 | 'monitor_process' : False, |
| 192 | 'process_name' : 'board_vpd.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 193 | 'instances' : [ { 'name' : 'MBVPD_0' } ] |
| 194 | } |
| 195 | |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 196 | SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 197 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 198 | 'start_process' : True, |
| 199 | 'monitor_process' : True, |
| 200 | 'process_name' : 'fan.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 201 | 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ] |
| 202 | } |
| 203 | |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 204 | CACHED_INTERFACES = { |
| 205 | "org.openbmc.InventoryItem" : True, |
| 206 | "org.openbmc.control.Chassis" : True, |
| 207 | } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 208 | INVENTORY_ROOT = '/org/openbmc/inventory' |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 209 | |
| 210 | FRU_INSTANCES = { |
| 211 | '<inventory_root>/system' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 212 | { 'fru_type' : 'SYSTEM','is_fru' : True, }, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 213 | |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 214 | '<inventory_root>/system/chassis' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 215 | { 'fru_type' : 'SYSTEM','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 216 | |
| 217 | '<inventory_root>/system/chassis/motherboard' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 218 | { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 219 | |
| 220 | '<inventory_root>/system/chassis/fan0' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 221 | { 'fru_type' : 'FAN','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 222 | '<inventory_root>/system/chassis/fan1' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 223 | { 'fru_type' : 'FAN','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 224 | '<inventory_root>/system/chassis/fan2' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 225 | { 'fru_type' : 'FAN','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 226 | '<inventory_root>/system/chassis/fan3' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 227 | { 'fru_type' : 'FAN','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 228 | '<inventory_root>/system/chassis/fan4' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 229 | { 'fru_type' : 'FAN','is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 230 | |
| 231 | '<inventory_root>/system/chassis/motherboard/bmc' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 232 | { 'fru_type' : 'BMC','is_fru' : False, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 233 | 'manufacturer' : 'ASPEED' }, |
| 234 | '<inventory_root>/system/chassis/motherboard/cpu0' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 235 | { 'fru_type' : 'CPU', 'is_fru' : True, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 236 | |
| 237 | '<inventory_root>/system/chassis/motherboard/cpu0/core0' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 238 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 239 | |
| 240 | '<inventory_root>/system/chassis/motherboard/cpu0/core1' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 241 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 242 | |
| 243 | '<inventory_root>/system/chassis/motherboard/cpu0/core2' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 244 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 245 | |
| 246 | '<inventory_root>/system/chassis/motherboard/cpu0/core3' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 247 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 248 | |
| 249 | '<inventory_root>/system/chassis/motherboard/cpu0/core4' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 250 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 251 | |
| 252 | '<inventory_root>/system/chassis/motherboard/cpu0/core5' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 253 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 254 | |
| 255 | '<inventory_root>/system/chassis/motherboard/cpu0/core6' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 256 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 257 | |
| 258 | '<inventory_root>/system/chassis/motherboard/cpu0/core7' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 259 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 260 | |
| 261 | '<inventory_root>/system/chassis/motherboard/cpu0/core8' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 262 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 263 | |
| 264 | '<inventory_root>/system/chassis/motherboard/cpu0/core9' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 265 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 266 | |
| 267 | '<inventory_root>/system/chassis/motherboard/cpu0/core10' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 268 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 269 | |
| 270 | '<inventory_root>/system/chassis/motherboard/cpu0/core11' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 271 | { 'fru_type' : 'CORE', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 272 | |
| 273 | '<inventory_root>/system/chassis/motherboard/centaur0' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 274 | { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 275 | |
| 276 | '<inventory_root>/system/chassis/motherboard/dimm0' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 277 | { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 278 | |
| 279 | '<inventory_root>/system/chassis/motherboard/dimm1' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 280 | { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 281 | |
| 282 | '<inventory_root>/system/chassis/motherboard/dimm2' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 283 | { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 284 | |
| 285 | '<inventory_root>/system/chassis/motherboard/dimm3' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 286 | { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 287 | |
| 288 | '<inventory_root>/system/chassis/io_board/pcie_slot0' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 289 | { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,}, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 290 | |
| 291 | '<inventory_root>/system/chassis/io_board/pcie_slot1' : |
Norman James | 0706ae0 | 2015-10-19 16:09:47 -0500 | [diff] [blame] | 292 | { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,}, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 293 | |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | ID_LOOKUP = { |
| 297 | 'FRU' : { |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 298 | 0x0d : '<inventory_root>/system/chassis', |
| 299 | 0x34 : '<inventory_root>/system/chassis/motherboard', |
| 300 | 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0', |
| 301 | 0x02 : '<inventory_root>/system/chassis/motherboard/centaur0', |
| 302 | 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 303 | 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 304 | 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 305 | 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | 2656f33 | 2015-10-26 06:42:41 -0500 | [diff] [blame] | 306 | 0x35 : '<inventory_root>/system', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 307 | }, |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 308 | 'FRU_STR' : { |
Norman James | fe635e8 | 2015-10-20 07:47:22 -0500 | [diff] [blame] | 309 | 'PRODUCT_15' : '<inventory_root>/system', |
| 310 | 'CHASSIS_2' : '<inventory_root>/system/chassis', |
| 311 | 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0', |
| 312 | 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/centaur0', |
| 313 | 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 314 | 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 315 | 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 316 | 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 317 | }, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 318 | 'SENSOR' : { |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 319 | 0x2f : '<inventory_root>/system/chassis/motherboard/cpu0', |
| 320 | 0x22 : '<inventory_root>/system/chassis/motherboard/cpu0/core0', |
| 321 | 0x23 : '<inventory_root>/system/chassis/motherboard/cpu0/core1', |
| 322 | 0x24 : '<inventory_root>/system/chassis/motherboard/cpu0/core2', |
| 323 | 0x25 : '<inventory_root>/system/chassis/motherboard/cpu0/core3', |
| 324 | 0x26 : '<inventory_root>/system/chassis/motherboard/cpu0/core4', |
| 325 | 0x27 : '<inventory_root>/system/chassis/motherboard/cpu0/core5', |
| 326 | 0x28 : '<inventory_root>/system/chassis/motherboard/cpu0/core6', |
| 327 | 0x29 : '<inventory_root>/system/chassis/motherboard/cpu0/core7', |
| 328 | 0x2a : '<inventory_root>/system/chassis/motherboard/cpu0/core8', |
| 329 | 0x2b : '<inventory_root>/system/chassis/motherboard/cpu0/core9', |
| 330 | 0x2c : '<inventory_root>/system/chassis/motherboard/cpu0/core10', |
| 331 | 0x2d : '<inventory_root>/system/chassis/motherboard/cpu0/core11', |
| 332 | 0x2e : '<inventory_root>/system/chassis/motherboard/centaur0', |
| 333 | 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 334 | 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 335 | 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 336 | 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 337 | 0x09 : '/org/openbmc/sensor/virtual/BootCount', |
| 338 | 0x05 : '/org/openbmc/sensor/virtual/BootProgress', |
| 339 | 0x04 : '/org/openbmc/sensor/virtual/HostStatus', |
| 340 | 0x08 : '/org/openbmc/sensor/virtual/OccStatus', |
| 341 | 0x32 : '/org/openbmc/sensor/virtual/OperatingSystemStatus', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 342 | }, |
| 343 | 'GPIO_PRESENT' : { |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 344 | 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0', |
| 345 | 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 346 | } |
| 347 | } |
| 348 | |
| 349 | GPIO_CONFIG = {} |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 350 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 484, 'direction': 'out' } |
| 351 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 485, 'direction': 'out' } |
| 352 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 504, 'direction': 'out' } |
| 353 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 449, 'direction': 'out' } |
| 354 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 486, 'direction': 'out' } |
| 355 | GPIO_CONFIG['PGOOD'] = { 'gpio_num': 503, 'direction': 'in' } |
| 356 | GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 357 | GPIO_CONFIG['BMC_READY'] = { 'gpio_num': 365, 'direction': 'out' } |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 358 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 448, 'direction': 'falling' } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 359 | GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 104, 'direction': 'in' } |
| 360 | GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 105, 'direction': 'in' } |
| 361 | GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 106, 'direction': 'in' } |
Norman James | a42446a | 2015-10-19 11:12:45 -0500 | [diff] [blame] | 362 | GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 470, 'direction': 'in' } |
| 363 | GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 471, 'direction': 'in' } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 364 | GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 109, 'direction': 'in' } |
| 365 | GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 112, 'direction': 'in' } |
| 366 | GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 113, 'direction': 'in' } |
| 367 | |
| 368 | |