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