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/' |
| 8 | FRU_PATH = CACHE_PATH+'frus/' |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 9 | FLASH_DOWNLOAD_PATH = "/tmp" |
| 10 | |
Norman James | 969227c | 2015-10-08 15:10:47 -0500 | [diff] [blame] | 11 | SYSTEM_NAME = "Palmetto" |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 12 | |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 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 James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 18 | SYSTEM_STATES = [ |
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 | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 25 | 'HOST_UP', |
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 = { |
| 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 James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 39 | ENTER_STATE_CALLBACK = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 40 | 'HOST_POWERED_ON' : { |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 41 | '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 James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 45 | }, |
| 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 James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 51 | } |
| 52 | } |
| 53 | |
| 54 | SYSTEM_CONFIG = {} |
| 55 | |
| 56 | SYSTEM_CONFIG['org.openbmc.control.Bmc'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 57 | 'system_state' : 'BMC_INIT', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 58 | 'start_process' : True, |
| 59 | 'monitor_process' : True, |
| 60 | 'process_name' : 'control_bmc.exe', |
| 61 | 'heartbeat' : 'no', |
| 62 | 'instances' : [ { 'name' : 'Bmc_0' } ] |
| 63 | } |
| 64 | |
| 65 | SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 66 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 67 | 'start_process' : True, |
| 68 | 'monitor_process' : True, |
| 69 | 'process_name' : 'inventory_items.py', |
| 70 | 'heartbeat' : 'no', |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 71 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 72 | } |
| 73 | SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 74 | 'system_state' : 'HOST_POWERED_ON', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 75 | 'start_process' : True, |
| 76 | 'monitor_process' : False, |
| 77 | 'process_name' : 'pcie_slot_present.exe', |
| 78 | 'heartbeat' : 'no', |
| 79 | 'instances' : [ { 'name' : 'Slots_0' } ] |
| 80 | } |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 81 | SYSTEM_CONFIG['org.openbmc.sensor.Power8Virtual'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 82 | 'system_state' : 'BMC_STARTING', |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 83 | 'start_process' : True, |
| 84 | 'monitor_process' : True, |
| 85 | 'process_name' : 'sensors_virtual_p8.py', |
| 86 | 'heartbeat' : 'no', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 87 | 'instances' : [ { 'name' : 'virtual' } ] |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 88 | } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 89 | |
| 90 | SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 91 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 92 | 'start_process' : True, |
| 93 | 'monitor_process' : True, |
| 94 | 'process_name' : 'sensor_manager.py', |
| 95 | 'heartbeat' : 'no', |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 96 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 100 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 101 | 'start_process' : True, |
| 102 | 'monitor_process' : True, |
| 103 | 'process_name' : 'host_watchdog.exe', |
| 104 | 'heartbeat' : 'no', |
| 105 | 'instances' : [ |
| 106 | { |
| 107 | 'name' : 'HostWatchdog_0', |
| 108 | 'properties' : { |
| 109 | 'org.openbmc.Watchdog' : { |
| 110 | 'poll_interval': 3000, |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | ] |
| 115 | } |
| 116 | |
| 117 | SYSTEM_CONFIG['org.openbmc.control.Power'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 118 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 119 | 'start_process' : True, |
| 120 | 'monitor_process' : True, |
| 121 | 'process_name' : 'power_control.exe', |
Norman James | 4fa99d4 | 2015-10-08 09:21:17 -0500 | [diff] [blame] | 122 | 'heartbeat' : 'no', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 123 | 'instances' : [ |
| 124 | { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 125 | 'name' : 'power0', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 126 | 'user_label': 'Power control', |
| 127 | 'properties' : { |
| 128 | 'org.openbmc.Control': { |
| 129 | 'poll_interval' : 3000 |
| 130 | }, |
| 131 | 'org.openbmc.control.Power': { |
| 132 | 'pgood_timeout' : 10 |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | ] |
| 137 | } |
| 138 | |
| 139 | SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 140 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 141 | 'start_process' : True, |
| 142 | 'monitor_process' : True, |
| 143 | 'process_name' : 'sensor_ambient.exe', |
Norman James | 4fa99d4 | 2015-10-08 09:21:17 -0500 | [diff] [blame] | 144 | 'heartbeat' : 'no', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 145 | 'instances' : [ |
| 146 | { |
| 147 | 'name' : 'FrontChassis', |
| 148 | 'user_label': 'Ambient Temperature 1', |
| 149 | 'properties' : { |
| 150 | 'org.openbmc.SensorValue': { |
| 151 | 'poll_interval' : 5000, |
| 152 | }, |
| 153 | 'org.openbmc.SensorThreshold' : { |
| 154 | 'lower_critical': 5, |
| 155 | 'lower_warning' : 10, |
| 156 | 'upper_warning' : 15, |
| 157 | 'upper_critical': 20 |
| 158 | }, |
| 159 | 'org.openbmc.SensorI2c' : { |
| 160 | 'dev_path' : '/dev/i2c/i2c0', |
| 161 | 'address' : '0xA0' |
| 162 | } |
| 163 | } |
| 164 | }, |
| 165 | ] |
| 166 | } |
| 167 | SYSTEM_CONFIG['org.openbmc.buttons.Power'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 168 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 169 | 'start_process' : True, |
| 170 | 'monitor_process' : True, |
| 171 | 'process_name' : 'button_power.exe', |
| 172 | 'heartbeat' : 'no', |
| 173 | 'instances' : [ { 'name' : 'PowerButton_0' } ] |
| 174 | } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 175 | SYSTEM_CONFIG['org.openbmc.control.led'] = { |
| 176 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 177 | 'start_process' : True, |
| 178 | 'monitor_process' : True, |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 179 | 'process_name' : 'led_controller.exe', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 180 | 'heartbeat' : 'no', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 181 | 'instances' : [ { 'name' : 'Dummy' } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 182 | } |
| 183 | SYSTEM_CONFIG['org.openbmc.flash.Bios'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 184 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 185 | 'start_process' : True, |
| 186 | 'monitor_process' : True, |
| 187 | 'process_name' : 'flash_bios.exe', |
| 188 | 'heartbeat' : 'no', |
| 189 | 'instances' : [ { 'name' : 'Bios_0' } ] |
| 190 | } |
| 191 | |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 192 | SYSTEM_CONFIG['org.openbmc.manager.Download'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 193 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 194 | 'start_process' : True, |
| 195 | 'monitor_process' : True, |
Norman James | f066e87 | 2015-10-07 15:29:51 -0500 | [diff] [blame] | 196 | 'process_name' : 'download_manager.py', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 197 | 'heartbeat' : 'no', |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 198 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | SYSTEM_CONFIG['org.openbmc.control.Host'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 202 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 203 | 'start_process' : True, |
| 204 | 'monitor_process' : True, |
| 205 | 'process_name' : 'control_host.exe', |
| 206 | 'heartbeat' : 'no', |
| 207 | 'instances' : [ { 'name' : 'Host_0' } ] |
| 208 | } |
| 209 | SYSTEM_CONFIG['org.openbmc.control.Chassis'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 210 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 211 | 'start_process' : True, |
| 212 | 'monitor_process' : True, |
| 213 | 'process_name' : 'chassis_control.py', |
| 214 | 'heartbeat' : 'no', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 215 | 'instances' : [ { 'name' : 'chassis0' } ] |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | SYSTEM_CONFIG['org.openbmc.vpd'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 219 | 'system_state' : 'HOST_POWERED_ON', |
| 220 | 'start_process' : False, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 221 | 'monitor_process' : False, |
| 222 | 'process_name' : 'board_vpd.exe', |
| 223 | 'heartbeat' : 'no', |
| 224 | 'instances' : [ { 'name' : 'MBVPD_0' } ] |
| 225 | } |
| 226 | |
| 227 | SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 228 | 'system_state' : 'BMC_STARTING', |
| 229 | 'start_process' : False, |
| 230 | 'monitor_process' : False, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 231 | 'process_name' : 'sensor_occ.exe', |
| 232 | 'heartbeat' : 'no', |
| 233 | 'instances' : [ |
| 234 | { |
| 235 | 'name' : 'Occ_0', |
| 236 | 'properties' : { |
| 237 | 'org.openbmc.Occ' : { |
| 238 | 'poll_interval' : 3000, |
| 239 | } |
| 240 | } |
| 241 | }, |
| 242 | |
| 243 | ] |
| 244 | } |
| 245 | |
| 246 | SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 247 | 'system_state' : 'BMC_STARTING', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 248 | 'start_process' : True, |
| 249 | 'monitor_process' : True, |
| 250 | 'process_name' : 'fan.exe', |
| 251 | 'heartbeat' : 'no', |
| 252 | 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ] |
| 253 | } |
| 254 | |
| 255 | NON_CACHABLE_PROPERTIES = { |
| 256 | 'name' : True, |
| 257 | 'user_label' : True, |
| 258 | 'location' : True, |
| 259 | 'state' : True, |
| 260 | 'cache' : True |
| 261 | } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 262 | INVENTORY_ROOT = '/org/openbmc/inventory' |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 263 | |
| 264 | FRU_INSTANCES = { |
| 265 | '<inventory_root>/system' : |
| 266 | { |
| 267 | 'fru_type' : Openbmc.FRU_TYPES['SYSTEM'], |
| 268 | 'is_fru' : True, |
| 269 | }, |
| 270 | '<inventory_root>/system/io_board' : |
| 271 | { |
| 272 | 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'], |
| 273 | 'manufacturer' : 'FOXCONN', |
| 274 | 'is_fru' : True, |
| 275 | 'location' : 'C1', |
| 276 | }, |
| 277 | |
| 278 | '<inventory_root>/system/motherboard' : |
| 279 | { |
| 280 | 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'], |
| 281 | 'manufacturer' : 'FOXCONN', |
| 282 | 'is_fru' : True, |
| 283 | 'location' : 'C0', |
| 284 | }, |
| 285 | '<inventory_root>/system/fan0' : |
| 286 | { |
| 287 | 'fru_type' : Openbmc.FRU_TYPES['FAN'], |
| 288 | 'manufacturer' : 'DELTA', |
| 289 | 'is_fru' : True, |
| 290 | 'location' : 'F0', |
| 291 | }, |
| 292 | '<inventory_root>/system/fan1' : |
| 293 | { |
| 294 | 'fru_type' : Openbmc.FRU_TYPES['FAN'], |
| 295 | 'manufacturer' : 'DELTA', |
| 296 | 'is_fru' : True, |
| 297 | 'location' : 'F1', |
| 298 | }, |
| 299 | '<inventory_root>/system/io_board/bmc' : |
| 300 | { |
| 301 | 'fru_type' : Openbmc.FRU_TYPES['BMC'], |
| 302 | 'manufacturer' : 'ASPEED', |
| 303 | 'is_fru' : False, |
| 304 | }, |
| 305 | '<inventory_root>/system/motherboard/cpu0' : |
| 306 | { |
| 307 | 'fru_type' : Openbmc.FRU_TYPES['CPU'], |
| 308 | 'manufacturer' : 'IBM', |
| 309 | 'is_fru' : True, |
| 310 | 'location' : 'P0', |
| 311 | }, |
| 312 | '<inventory_root>/system/motherboard/cpu0/core0' : |
| 313 | { |
| 314 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 315 | 'is_fru' : False, |
| 316 | }, |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 317 | '<inventory_root>/system/motherboard/cpu0/core1' : { |
| 318 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 319 | 'is_fru' : False, |
| 320 | }, |
| 321 | '<inventory_root>/system/motherboard/cpu0/core2' : { |
| 322 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 323 | 'is_fru' : False, |
| 324 | }, |
| 325 | '<inventory_root>/system/motherboard/cpu0/core3' : { |
| 326 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 327 | 'is_fru' : False, |
| 328 | }, |
| 329 | '<inventory_root>/system/motherboard/cpu0/core4' : { |
| 330 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 331 | 'is_fru' : False, |
| 332 | }, |
| 333 | '<inventory_root>/system/motherboard/cpu0/core5' : { |
| 334 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 335 | 'is_fru' : False, |
| 336 | }, |
| 337 | '<inventory_root>/system/motherboard/cpu0/core6' : { |
| 338 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 339 | 'is_fru' : False, |
| 340 | }, |
| 341 | '<inventory_root>/system/motherboard/cpu0/core7' : { |
| 342 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 343 | 'is_fru' : False, |
| 344 | }, |
| 345 | '<inventory_root>/system/motherboard/cpu0/core8' : { |
| 346 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 347 | 'is_fru' : False, |
| 348 | }, |
| 349 | '<inventory_root>/system/motherboard/cpu0/core9' : { |
| 350 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 351 | 'is_fru' : False, |
| 352 | }, |
| 353 | '<inventory_root>/system/motherboard/cpu0/core10' : { |
| 354 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 355 | 'is_fru' : False, |
| 356 | }, |
| 357 | '<inventory_root>/system/motherboard/cpu0/core11' : { |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 358 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 359 | 'is_fru' : False, |
| 360 | }, |
Norman James | a53e6cf | 2015-10-15 10:22:47 -0500 | [diff] [blame] | 361 | '<inventory_root>/system/motherboard/centaur0' : |
| 362 | { |
| 363 | 'fru_type' : 0, |
| 364 | 'is_fru' : False, |
| 365 | }, |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 366 | '<inventory_root>/system/motherboard/dimm0' : |
| 367 | { |
| 368 | 'fru_type' : Openbmc.FRU_TYPES['DIMM'], |
| 369 | 'is_fru' : True, |
| 370 | }, |
| 371 | '<inventory_root>/system/motherboard/dimm1' : |
| 372 | { |
| 373 | 'fru_type' : Openbmc.FRU_TYPES['DIMM'], |
| 374 | 'is_fru' : True, |
| 375 | }, |
| 376 | '<inventory_root>/system/motherboard/dimm2' : |
| 377 | { |
| 378 | 'fru_type' : Openbmc.FRU_TYPES['DIMM'], |
| 379 | 'is_fru' : True, |
| 380 | }, |
| 381 | '<inventory_root>/system/motherboard/dimm3' : |
| 382 | { |
| 383 | 'fru_type' : Openbmc.FRU_TYPES['DIMM'], |
| 384 | 'is_fru' : True, |
| 385 | }, |
| 386 | '<inventory_root>/system/io_board/pcie_slot0' : |
| 387 | { |
| 388 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 389 | 'user_label' : 'PCIe card 0', |
| 390 | 'is_fru' : True, |
| 391 | }, |
| 392 | '<inventory_root>/system/io_board/pcie_slot1' : |
| 393 | { |
| 394 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 395 | 'user_label' : 'PCIe card 1', |
| 396 | 'is_fru' : True, |
| 397 | }, |
| 398 | } |
| 399 | |
| 400 | ID_LOOKUP = { |
| 401 | 'FRU' : { |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 402 | 0x0d : '<inventory_root>/system', |
Norman James | b32a0fe | 2015-10-18 16:11:02 -0500 | [diff] [blame] | 403 | 0x34 : '<inventory_root>/system/motherboard', |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 404 | 0x01 : '<inventory_root>/system/motherboard/cpu0', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 405 | 0x02 : '<inventory_root>/system/motherboard/centaur0', |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 406 | 0x03 : '<inventory_root>/system/motherboard/dimm0', |
| 407 | 0x04 : '<inventory_root>/system/motherboard/dimm1', |
| 408 | 0x05 : '<inventory_root>/system/motherboard/dimm2', |
| 409 | 0x06 : '<inventory_root>/system/motherboard/dimm3', |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 410 | 0xff : '<inventory_root>/system', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 411 | }, |
| 412 | 'SENSOR' : { |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 413 | 0x2f : '<inventory_root>/system/motherboard/cpu0', |
| 414 | 0x22 : '<inventory_root>/system/motherboard/cpu0/core0', |
| 415 | 0x23 : '<inventory_root>/system/motherboard/cpu0/core1', |
| 416 | 0x24 : '<inventory_root>/system/motherboard/cpu0/core2', |
| 417 | 0x25 : '<inventory_root>/system/motherboard/cpu0/core3', |
| 418 | 0x26 : '<inventory_root>/system/motherboard/cpu0/core4', |
| 419 | 0x27 : '<inventory_root>/system/motherboard/cpu0/core5', |
| 420 | 0x28 : '<inventory_root>/system/motherboard/cpu0/core6', |
| 421 | 0x29 : '<inventory_root>/system/motherboard/cpu0/core7', |
| 422 | 0x2a : '<inventory_root>/system/motherboard/cpu0/core8', |
| 423 | 0x2b : '<inventory_root>/system/motherboard/cpu0/core9', |
| 424 | 0x2c : '<inventory_root>/system/motherboard/cpu0/core10', |
| 425 | 0x2d : '<inventory_root>/system/motherboard/cpu0/core11', |
Norman James | a53e6cf | 2015-10-15 10:22:47 -0500 | [diff] [blame] | 426 | 0x2e : '<inventory_root>/system/motherboard/centaur0', |
Norman James | 0ee6192 | 2015-10-14 09:39:11 -0500 | [diff] [blame] | 427 | 0x1e : '<inventory_root>/system/motherboard/dimm0', |
| 428 | 0x1f : '<inventory_root>/system/motherboard/dimm1', |
| 429 | 0x20 : '<inventory_root>/system/motherboard/dimm2', |
| 430 | 0x21 : '<inventory_root>/system/motherboard/dimm3', |
| 431 | 0x09 : '/org/openbmc/sensor/virtual/BootCount', |
| 432 | 0x05 : '/org/openbmc/sensor/virtual/BootProgress', |
| 433 | 0x04 : '/org/openbmc/sensor/virtual/HostStatus', |
| 434 | 0x08 : '/org/openbmc/sensor/virtual/OccStatus', |
| 435 | 0x32 : '/org/openbmc/sensor/virtual/OperatingSystemStatus', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 436 | }, |
| 437 | 'GPIO_PRESENT' : { |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 438 | 'SLOT0_PRESENT' : '<inventory_root>/system/io_board/pcie_slot0', |
| 439 | 'SLOT1_PRESENT' : '<inventory_root>/system/io_board/pcie_slot1', |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 440 | } |
| 441 | } |
| 442 | |
| 443 | GPIO_CONFIG = {} |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 444 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 484, 'direction': 'out' } |
| 445 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 485, 'direction': 'out' } |
| 446 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 504, 'direction': 'out' } |
| 447 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 449, 'direction': 'out' } |
| 448 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 486, 'direction': 'out' } |
| 449 | GPIO_CONFIG['PGOOD'] = { 'gpio_num': 503, 'direction': 'in' } |
| 450 | GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' } |
Norman James | a3e47c4 | 2015-10-18 14:43:10 -0500 | [diff] [blame] | 451 | GPIO_CONFIG['BMC_READY'] = { 'gpio_num': 365, 'direction': 'out' } |
Norman James | 25d80dd | 2015-10-08 07:02:25 -0500 | [diff] [blame] | 452 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 448, 'direction': 'falling' } |
Norman James | c9239a3 | 2015-10-06 16:54:31 -0500 | [diff] [blame] | 453 | GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 104, 'direction': 'in' } |
| 454 | GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 105, 'direction': 'in' } |
| 455 | GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 106, 'direction': 'in' } |
| 456 | GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 107, 'direction': 'in' } |
| 457 | GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 108, 'direction': 'in' } |
| 458 | GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 109, 'direction': 'in' } |
| 459 | GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 112, 'direction': 'in' } |
| 460 | GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 113, 'direction': 'in' } |
| 461 | |
| 462 | |