Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 1 | #! /usr/bin/python |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 2 | |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 3 | HOME_PATH = './' |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 4 | CACHE_PATH = HOME_PATH+'cache/' |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 5 | FLASH_DOWNLOAD_PATH = "/tmp" |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 6 | |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 7 | SYSTEM_NAME = "Barreleye" |
| 8 | |
| 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 | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 14 | SYSTEM_STATES = [ |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 15 | 'BASE_APPS', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -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 | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 23 | 'HOST_POWERED_DOWN', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 24 | ] |
| 25 | |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 26 | EXIT_STATE_DEPEND = { |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 27 | 'BASE_APPS' : { |
| 28 | '/org/openbmc/managers/Property': 0, |
| 29 | }, |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -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 | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 39 | ENTER_STATE_CALLBACK = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 40 | 'HOST_POWERED_ON' : { |
Norman James | 362a80f | 2015-09-14 14:04:39 -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 | 3e5c859 | 2015-10-22 14:33:01 -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 | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 51 | } |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 52 | } |
| 53 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 54 | SYSTEM_CONFIG = {} |
| 55 | |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 56 | SYSTEM_CONFIG['org.openbmc.managers.Property'] = { |
| 57 | 'system_state' : 'BASE_APPS', |
| 58 | 'start_process' : True, |
| 59 | 'monitor_process' : True, |
| 60 | 'process_name' : 'property_manager.py', |
| 61 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
| 62 | } |
| 63 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 64 | SYSTEM_CONFIG['org.openbmc.control.Bmc'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 65 | 'system_state' : 'BMC_INIT', |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 66 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 67 | 'monitor_process' : True, |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 68 | 'process_name' : 'control_bmc_barreleye.exe', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 69 | 'instances' : [ { 'name' : 'Bmc_0' } ] |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 70 | } |
| 71 | |
Norman James | 65a295a | 2015-09-26 22:21:10 -0500 | [diff] [blame] | 72 | SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 73 | 'system_state' : 'BMC_STARTING', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 74 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 75 | 'monitor_process' : True, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 76 | 'process_name' : 'inventory_items.py', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 77 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 78 | } |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 79 | SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 80 | 'system_state' : 'HOST_POWERED_ON', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 81 | 'start_process' : True, |
| 82 | 'monitor_process' : False, |
| 83 | 'process_name' : 'pcie_slot_present.exe', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 84 | 'instances' : [ { 'name' : 'Slots_0' } ] |
| 85 | } |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 86 | SYSTEM_CONFIG['org.openbmc.sensor.Power8Virtual'] = { |
| 87 | 'system_state' : 'BMC_STARTING', |
| 88 | 'start_process' : True, |
| 89 | 'monitor_process' : True, |
| 90 | 'process_name' : 'sensors_virtual_p8.py', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 91 | 'instances' : [ { 'name' : 'virtual' } ] |
| 92 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 93 | |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 94 | SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 95 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 96 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 97 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 98 | 'process_name' : 'sensor_manager.py', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 99 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 100 | } |
| 101 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 102 | SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 103 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 104 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 105 | 'monitor_process' : True, |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 106 | 'process_name' : 'host_watchdog.exe', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 107 | 'instances' : [ |
| 108 | { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 109 | 'name' : 'HostWatchdog_0', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 110 | 'properties' : { |
| 111 | 'org.openbmc.Watchdog' : { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 112 | 'poll_interval': 30000, |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 113 | } |
| 114 | } |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 115 | } |
| 116 | ] |
| 117 | } |
| 118 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 119 | SYSTEM_CONFIG['org.openbmc.control.Power'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 120 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 121 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 122 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 123 | 'process_name' : 'power_control.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 124 | 'instances' : [ |
| 125 | { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 126 | 'name' : 'power0', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 127 | 'user_label': 'Power control', |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 128 | 'properties' : { |
| 129 | 'org.openbmc.Control': { |
| 130 | 'poll_interval' : 3000 |
Norman James | 32e74e2 | 2015-09-15 21:28:06 -0500 | [diff] [blame] | 131 | }, |
| 132 | 'org.openbmc.control.Power': { |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 133 | 'pgood_timeout' : 10 |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 134 | } |
| 135 | } |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 136 | } |
| 137 | ] |
| 138 | } |
| 139 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 140 | SYSTEM_CONFIG['org.openbmc.buttons.Power'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 141 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 142 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 143 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 144 | 'process_name' : 'button_power.exe', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 145 | 'instances' : [ { 'name' : 'PowerButton_0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 146 | } |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 147 | SYSTEM_CONFIG['org.openbmc.control.led'] = { |
| 148 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 149 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 150 | 'monitor_process' : True, |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 151 | 'process_name' : 'led_controller.exe', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 152 | 'instances' : [ { 'name' : 'Dummy' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 153 | } |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 154 | SYSTEM_CONFIG['org.openbmc.control.Flash'] = { |
| 155 | 'system_state' : 'BMC_STARTING', |
| 156 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 157 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 158 | 'process_name' : 'flash_bios.exe', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 159 | 'instances' : [ { 'name' : 'dummy' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 160 | } |
Norman James | 8c6d838 | 2015-10-06 07:47:16 -0500 | [diff] [blame] | 161 | |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 162 | SYSTEM_CONFIG['org.openbmc.manager.Download'] = { |
| 163 | 'system_state' : 'BMC_STARTING', |
Norman James | 8c6d838 | 2015-10-06 07:47:16 -0500 | [diff] [blame] | 164 | 'start_process' : True, |
| 165 | 'monitor_process' : True, |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 166 | 'process_name' : 'download_manager.py', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 167 | 'instances' : [ { 'name' : SYSTEM_NAME } ] |
Norman James | 8c6d838 | 2015-10-06 07:47:16 -0500 | [diff] [blame] | 168 | } |
| 169 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 170 | SYSTEM_CONFIG['org.openbmc.control.Host'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 171 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 172 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 173 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 174 | 'process_name' : 'control_host.exe', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 175 | 'instances' : [ { 'name' : 'Host_0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 176 | } |
| 177 | SYSTEM_CONFIG['org.openbmc.control.Chassis'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 178 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 179 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 180 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 181 | 'process_name' : 'chassis_control.py', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 182 | 'instances' : [ { 'name' : 'chassis0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 183 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 184 | |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 185 | SYSTEM_CONFIG['org.openbmc.vpd'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 186 | 'system_state' : 'HOST_POWERED_ON', |
| 187 | 'start_process' : False, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 188 | 'monitor_process' : False, |
| 189 | 'process_name' : 'board_vpd.exe', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 190 | 'instances' : [ { 'name' : 'MBVPD_0' } ] |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 191 | } |
| 192 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 193 | SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 194 | 'system_state' : 'BMC_STARTING', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 195 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 196 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 197 | 'process_name' : 'fan.exe', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 198 | 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 199 | } |
| 200 | |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 201 | CACHED_INTERFACES = { |
| 202 | "org.openbmc.InventoryItem" : True, |
| 203 | "org.openbmc.control.Chassis" : True, |
| 204 | } |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 205 | INVENTORY_ROOT = '/org/openbmc/inventory' |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 206 | |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 207 | FRU_INSTANCES = { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 208 | '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 209 | |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 210 | '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, }, |
| 211 | |
| 212 | '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, }, |
| 213 | '<inventory_root>/system/chassis/io_board' : { 'fru_type' : 'DAUGHTER_CARD','is_fru' : True, }, |
| 214 | |
| 215 | |
| 216 | '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, }, |
| 217 | '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, }, |
| 218 | '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, }, |
| 219 | '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, }, |
| 220 | '<inventory_root>/system/chassis/fan4' : { 'fru_type' : 'FAN','is_fru' : True, }, |
| 221 | |
| 222 | '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' }, |
| 223 | |
| 224 | '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, }, |
| 225 | '<inventory_root>/system/chassis/motherboard/cpu1' : { 'fru_type' : 'CPU', 'is_fru' : True, }, |
| 226 | |
| 227 | '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 228 | '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 229 | '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 230 | '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 231 | '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 232 | '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 233 | '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 234 | '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 235 | '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 236 | '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 237 | '<inventory_root>/system/chassis/motherboard/cpu0/core10': { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 238 | '<inventory_root>/system/chassis/motherboard/cpu0/core11': { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 239 | |
| 240 | '<inventory_root>/system/chassis/motherboard/cpu1/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 241 | '<inventory_root>/system/chassis/motherboard/cpu1/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 242 | '<inventory_root>/system/chassis/motherboard/cpu1/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 243 | '<inventory_root>/system/chassis/motherboard/cpu1/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 244 | '<inventory_root>/system/chassis/motherboard/cpu1/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 245 | '<inventory_root>/system/chassis/motherboard/cpu1/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 246 | '<inventory_root>/system/chassis/motherboard/cpu1/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 247 | '<inventory_root>/system/chassis/motherboard/cpu1/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 248 | '<inventory_root>/system/chassis/motherboard/cpu1/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 249 | '<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 250 | '<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 251 | '<inventory_root>/system/chassis/motherboard/cpu0/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, }, |
| 252 | |
| 253 | '<inventory_root>/system/chassis/motherboard/centaur0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 254 | '<inventory_root>/system/chassis/motherboard/centaur1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 255 | '<inventory_root>/system/chassis/motherboard/centaur2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 256 | '<inventory_root>/system/chassis/motherboard/centaur3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 257 | '<inventory_root>/system/chassis/motherboard/centaur4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 258 | '<inventory_root>/system/chassis/motherboard/centaur5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 259 | '<inventory_root>/system/chassis/motherboard/centaur6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 260 | '<inventory_root>/system/chassis/motherboard/centaur7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, |
| 261 | |
| 262 | '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 263 | '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 264 | '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 265 | '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 266 | '<inventory_root>/system/chassis/motherboard/dimm4' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 267 | '<inventory_root>/system/chassis/motherboard/dimm5' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 268 | '<inventory_root>/system/chassis/motherboard/dimm6' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 269 | '<inventory_root>/system/chassis/motherboard/dimm7' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 270 | '<inventory_root>/system/chassis/motherboard/dimm8' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 271 | '<inventory_root>/system/chassis/motherboard/dimm9' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 272 | '<inventory_root>/system/chassis/motherboard/dimm10' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 273 | '<inventory_root>/system/chassis/motherboard/dimm11' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 274 | '<inventory_root>/system/chassis/motherboard/dimm12' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 275 | '<inventory_root>/system/chassis/motherboard/dimm13' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 276 | '<inventory_root>/system/chassis/motherboard/dimm14' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 277 | '<inventory_root>/system/chassis/motherboard/dimm15' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 278 | '<inventory_root>/system/chassis/motherboard/dimm16' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 279 | '<inventory_root>/system/chassis/motherboard/dimm17' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 280 | '<inventory_root>/system/chassis/motherboard/dimm18' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 281 | '<inventory_root>/system/chassis/motherboard/dimm19' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 282 | '<inventory_root>/system/chassis/motherboard/dimm20' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 283 | '<inventory_root>/system/chassis/motherboard/dimm21' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 284 | '<inventory_root>/system/chassis/motherboard/dimm22' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 285 | '<inventory_root>/system/chassis/motherboard/dimm23' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 286 | '<inventory_root>/system/chassis/motherboard/dimm24' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 287 | '<inventory_root>/system/chassis/motherboard/dimm25' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 288 | '<inventory_root>/system/chassis/motherboard/dimm26' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 289 | '<inventory_root>/system/chassis/motherboard/dimm27' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 290 | '<inventory_root>/system/chassis/motherboard/dimm28' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 291 | '<inventory_root>/system/chassis/motherboard/dimm29' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 292 | '<inventory_root>/system/chassis/motherboard/dimm30' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 293 | '<inventory_root>/system/chassis/motherboard/dimm31' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, |
| 294 | |
| 295 | '<inventory_root>/system/chassis/io_board/pcie_slot0_riser' : { 'fru_type' : 'PCIE_RISER', 'is_fru' : True,}, |
| 296 | '<inventory_root>/system/chassis/io_board/pcie_slot1_riser' : { 'fru_type' : 'PCIE_RISER', 'is_fru' : True,}, |
| 297 | '<inventory_root>/system/chassis/io_board/pcie_slot0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,}, |
| 298 | '<inventory_root>/system/chassis/io_board/pcie_slot1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,}, |
| 299 | '<inventory_root>/system/chassis/io_board/pcie_mezz0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,}, |
| 300 | '<inventory_root>/system/chassis/io_board/pcie_mezz1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,}, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 301 | |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 302 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 303 | |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 304 | |
| 305 | |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 306 | |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 307 | ID_LOOKUP = { |
| 308 | 'FRU' : { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 309 | 0x0d : '<inventory_root>/system/chassis', |
| 310 | 0x34 : '<inventory_root>/system/chassis/motherboard', |
| 311 | 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0', |
| 312 | 0x02 : '<inventory_root>/system/chassis/motherboard/centaur0', |
| 313 | 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 314 | 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 315 | 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 316 | 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 317 | 0x35 : '<inventory_root>/system', |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 318 | }, |
| 319 | 'FRU_STR' : { |
| 320 | 'PRODUCT_15' : '<inventory_root>/system', |
| 321 | 'CHASSIS_2' : '<inventory_root>/system/chassis', |
| 322 | 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0', |
| 323 | 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/centaur0', |
| 324 | 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 325 | 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 326 | 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 327 | 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 328 | }, |
| 329 | 'SENSOR' : { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 330 | 0x2f : '<inventory_root>/system/chassis/motherboard/cpu0', |
| 331 | 0x22 : '<inventory_root>/system/chassis/motherboard/cpu0/core0', |
| 332 | 0x23 : '<inventory_root>/system/chassis/motherboard/cpu0/core1', |
| 333 | 0x24 : '<inventory_root>/system/chassis/motherboard/cpu0/core2', |
| 334 | 0x25 : '<inventory_root>/system/chassis/motherboard/cpu0/core3', |
| 335 | 0x26 : '<inventory_root>/system/chassis/motherboard/cpu0/core4', |
| 336 | 0x27 : '<inventory_root>/system/chassis/motherboard/cpu0/core5', |
| 337 | 0x28 : '<inventory_root>/system/chassis/motherboard/cpu0/core6', |
| 338 | 0x29 : '<inventory_root>/system/chassis/motherboard/cpu0/core7', |
| 339 | 0x2a : '<inventory_root>/system/chassis/motherboard/cpu0/core8', |
| 340 | 0x2b : '<inventory_root>/system/chassis/motherboard/cpu0/core9', |
| 341 | 0x2c : '<inventory_root>/system/chassis/motherboard/cpu0/core10', |
| 342 | 0x2d : '<inventory_root>/system/chassis/motherboard/cpu0/core11', |
| 343 | 0x2e : '<inventory_root>/system/chassis/motherboard/centaur0', |
| 344 | 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0', |
| 345 | 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1', |
| 346 | 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2', |
| 347 | 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3', |
| 348 | 0x09 : '/org/openbmc/sensor/virtual/BootCount', |
| 349 | 0x05 : '/org/openbmc/sensor/virtual/BootProgress', |
| 350 | 0x04 : '/org/openbmc/sensor/virtual/HostStatus', |
| 351 | 0x08 : '/org/openbmc/sensor/virtual/OccStatus', |
| 352 | 0x32 : '/org/openbmc/sensor/virtual/OperatingSystemStatus', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 353 | }, |
| 354 | 'GPIO_PRESENT' : { |
Norman James | 3e5c859 | 2015-10-22 14:33:01 -0500 | [diff] [blame] | 355 | 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0', |
| 356 | 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 357 | } |
| 358 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 359 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 360 | GPIO_CONFIG = {} |
Norman James | a9966b3 | 2015-10-28 06:55:58 -0500 | [diff] [blame] | 361 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 324, 'direction': 'out' } |
| 362 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 325, 'direction': 'out' } |
| 363 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 344, 'direction': 'out' } |
| 364 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 353, 'direction': 'out' } |
| 365 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 326, 'direction': 'out' } |
| 366 | GPIO_CONFIG['PGOOD'] = { 'gpio_num': 343, 'direction': 'in' } |
| 367 | GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 365, 'direction': 'out' } |
| 368 | GPIO_CONFIG['BMC_READY'] = { 'gpio_num': 431, 'direction': 'out' } |
| 369 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 352, 'direction': 'falling' } |
| 370 | GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 424, 'direction': 'in' } |
| 371 | GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 425, 'direction': 'in' } |
| 372 | GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 426, 'direction': 'in' } |
| 373 | GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 427, 'direction': 'in' } |
| 374 | GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 428, 'direction': 'in' } |
| 375 | GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 429, 'direction': 'in' } |
| 376 | GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 432, 'direction': 'in' } |
| 377 | GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 433, 'direction': 'in' } |
| 378 | |
| 379 | def convertGpio(name): |
| 380 | name = name.upper() |
| 381 | c = name[0:1] |
| 382 | offset = int(name[1:]) |
| 383 | a = ord(c)-65 |
| 384 | base = a*8+GPIO_BASE |
| 385 | return base+offset |
| 386 | |
| 387 | |
| 388 | |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 389 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 390 | |