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