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