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 | 65a295a | 2015-09-26 22:21:10 -0500 | [diff] [blame] | 7 | BIN_PATH = HOME_PATH+'bin/' |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 8 | CACHE_PATH = HOME_PATH+'cache/' |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 9 | FRU_PATH = CACHE_PATH+'frus/' |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 10 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 11 | SYSTEM_STATES = [ |
| 12 | 'INIT', |
| 13 | 'STANDBY', |
| 14 | 'POWERING_ON', |
| 15 | 'POWERED_ON', |
| 16 | 'BOOTING', |
| 17 | 'HOST_UP', |
| 18 | 'SHUTTING_DOWN', |
| 19 | 'POWERING_DOWN' |
| 20 | ] |
| 21 | |
| 22 | ENTER_STATE_CALLBACK = { |
| 23 | 'POWERED_ON' : { |
| 24 | 'bus_name' : 'org.openbmc.control.Host', |
| 25 | 'obj_name' : '/org/openbmc/control/Host_0', |
| 26 | 'interface_name' : 'org.openbmc.control.Host', |
| 27 | 'method_name' : 'boot' |
| 28 | } |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 29 | } |
| 30 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 31 | SYSTEM_CONFIG = {} |
| 32 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 33 | SYSTEM_CONFIG['org.openbmc.control.Bmc'] = { |
| 34 | 'system_state' : 'INIT', |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 35 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 36 | 'monitor_process' : True, |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 37 | 'process_name' : 'control_bmc.exe', |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 38 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 39 | 'instances' : [ { 'name' : 'Bmc_0' } ] |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 40 | } |
| 41 | |
Norman James | 65a295a | 2015-09-26 22:21:10 -0500 | [diff] [blame] | 42 | SYSTEM_CONFIG['org.openbmc.managers.Inventory'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 43 | 'system_state' : 'STANDBY', |
| 44 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 45 | 'monitor_process' : True, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 46 | 'process_name' : 'inventory_items.py', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 47 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 48 | 'instances' : [ { 'name' : 'Barreleye' } ] |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 49 | } |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 50 | SYSTEM_CONFIG['org.openbmc.control.PciePresent'] = { |
| 51 | 'system_state' : 'POWERING_ON', |
| 52 | 'start_process' : True, |
| 53 | 'monitor_process' : False, |
| 54 | 'process_name' : 'pcie_slot_present.exe', |
| 55 | 'heartbeat' : 'no', |
| 56 | 'instances' : [ { 'name' : 'Slots_0' } ] |
| 57 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 58 | |
| 59 | |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 60 | SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 61 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 62 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 63 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 64 | 'process_name' : 'sensor_manager.py', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 65 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 66 | 'instances' : [ { 'name' : 'Barreleye' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 67 | } |
| 68 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 69 | SYSTEM_CONFIG['org.openbmc.watchdog.Host'] = { |
| 70 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 71 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 72 | 'monitor_process' : True, |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 73 | 'process_name' : 'host_watchdog.exe', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 74 | 'heartbeat' : 'no', |
| 75 | 'instances' : [ |
| 76 | { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 77 | 'name' : 'HostWatchdog_0', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 78 | 'properties' : { |
| 79 | 'org.openbmc.Watchdog' : { |
| 80 | 'poll_interval': 3000, |
| 81 | } |
| 82 | } |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 83 | } |
| 84 | ] |
| 85 | } |
| 86 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 87 | SYSTEM_CONFIG['org.openbmc.control.Power'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 88 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 89 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 90 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 91 | 'process_name' : 'power_control.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 92 | 'heartbeat' : 'yes', |
| 93 | 'instances' : [ |
| 94 | { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 95 | 'name' : 'SystemPower_0', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 96 | 'user_label': 'Power control', |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 97 | 'properties' : { |
| 98 | 'org.openbmc.Control': { |
| 99 | 'poll_interval' : 3000 |
Norman James | 32e74e2 | 2015-09-15 21:28:06 -0500 | [diff] [blame] | 100 | }, |
| 101 | 'org.openbmc.control.Power': { |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 102 | 'pgood_timeout' : 10 |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 103 | } |
| 104 | } |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 105 | } |
| 106 | ] |
| 107 | } |
| 108 | |
| 109 | SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 110 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 111 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 112 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 113 | 'process_name' : 'sensor_ambient.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 114 | 'heartbeat' : 'yes', |
| 115 | 'instances' : [ |
| 116 | { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 117 | 'name' : 'FrontChassis', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 118 | 'user_label': 'Ambient Temperature 1', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 119 | 'properties' : { |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 120 | 'org.openbmc.SensorValue': { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 121 | 'poll_interval' : 5000, |
Norman James | 9e6acf9 | 2015-09-08 07:00:04 -0500 | [diff] [blame] | 122 | }, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 123 | 'org.openbmc.SensorThreshold' : { |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 124 | 'lower_critical': 5, |
| 125 | 'lower_warning' : 10, |
| 126 | 'upper_warning' : 15, |
| 127 | 'upper_critical': 20 |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 128 | }, |
| 129 | 'org.openbmc.SensorI2c' : { |
| 130 | 'dev_path' : '/dev/i2c/i2c0', |
| 131 | 'address' : '0xA0' |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 132 | } |
| 133 | } |
| 134 | }, |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 135 | ] |
| 136 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 137 | SYSTEM_CONFIG['org.openbmc.buttons.Power'] = { |
| 138 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 139 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 140 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 141 | 'process_name' : 'button_power.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 142 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 143 | 'instances' : [ { 'name' : 'PowerButton_0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 144 | } |
| 145 | SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 146 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 147 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 148 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 149 | 'process_name' : 'sensor_host_status.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 150 | 'heartbeat' : "no", |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 151 | 'instances' : [ { 'name' : 'HostStatus_0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 152 | } |
| 153 | SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 154 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 155 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 156 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 157 | 'process_name' : 'chassis_identify.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 158 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 159 | 'instances' : [ { 'name' : 'ChassisIdentify_0' } ] |
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 | SYSTEM_CONFIG['org.openbmc.flash.Bios'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 162 | 'system_state' : 'STANDBY', |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 163 | 'start_process' : False, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 164 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 165 | 'process_name' : 'flash_bios.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 166 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 167 | 'instances' : [ { 'name' : 'BIOS_0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 168 | } |
Norman James | 8c6d838 | 2015-10-06 07:47:16 -0500 | [diff] [blame] | 169 | |
| 170 | SYSTEM_CONFIG['org.openbmc.manager.Flash'] = { |
| 171 | 'system_state' : 'STANDBY', |
| 172 | 'start_process' : True, |
| 173 | 'monitor_process' : True, |
| 174 | 'process_name' : 'flash_manager.py', |
| 175 | 'heartbeat' : 'no', |
| 176 | 'instances' : [ { 'name' : 'FlashManager_0' } ] |
| 177 | } |
| 178 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 179 | SYSTEM_CONFIG['org.openbmc.control.Host'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 180 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 181 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 182 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 183 | 'process_name' : 'control_host.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 184 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 185 | 'instances' : [ { 'name' : 'Host_0' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 186 | } |
| 187 | SYSTEM_CONFIG['org.openbmc.control.Chassis'] = { |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 188 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 189 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 190 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 191 | 'process_name' : 'chassis_control.py', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 192 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 193 | 'instances' : [ { 'name' : 'Chassis' } ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 194 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 195 | |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 196 | SYSTEM_CONFIG['org.openbmc.vpd'] = { |
Norman James | 1a93d08 | 2015-10-06 11:24:34 -0500 | [diff] [blame] | 197 | 'system_state' : 'POWERING_ON', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 198 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 199 | 'monitor_process' : False, |
| 200 | 'process_name' : 'board_vpd.exe', |
| 201 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 202 | 'instances' : [ { 'name' : 'MBVPD_0' } ] |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | SYSTEM_CONFIG['org.openbmc.sensors.Occ'] = { |
Norman James | 2d1ee89 | 2015-09-16 23:13:45 -0500 | [diff] [blame] | 206 | 'system_state' : 'BOOTED', |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 207 | 'start_process' : True, |
| 208 | 'monitor_process' : True, |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 209 | 'process_name' : 'sensor_occ.exe', |
| 210 | 'heartbeat' : 'no', |
| 211 | 'instances' : [ |
| 212 | { |
| 213 | 'name' : 'Occ_0', |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 214 | 'properties' : { |
| 215 | 'org.openbmc.Occ' : { |
| 216 | 'poll_interval' : 3000, |
| 217 | } |
| 218 | } |
| 219 | }, |
| 220 | |
| 221 | ] |
| 222 | } |
| 223 | |
| 224 | SYSTEM_CONFIG['org.openbmc.sensors.Fan'] = { |
| 225 | 'system_state' : 'STANDBY', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 226 | 'start_process' : True, |
Norman James | 6f8d042 | 2015-09-14 18:48:00 -0500 | [diff] [blame] | 227 | 'monitor_process' : True, |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame] | 228 | 'process_name' : 'fan.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 229 | 'heartbeat' : 'no', |
Norman James | dfdaca9 | 2015-09-27 22:11:15 -0500 | [diff] [blame] | 230 | 'instances' : [ {'name' : 'Fan_0' }, {'name' : 'Fan_1'}, {'name' : 'Fan_2'} ] |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 231 | } |
| 232 | |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 233 | NON_CACHABLE_PROPERTIES = { |
| 234 | 'name' : True, |
| 235 | 'user_label' : True, |
| 236 | 'location' : True, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 237 | 'state' : True, |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 238 | 'cache' : True |
| 239 | } |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 240 | INVENTORY_ROOT = '/org/openbmc/inventory/items' |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 241 | |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 242 | FRU_INSTANCES = { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 243 | '<inventory_root>/system' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 244 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 245 | 'fru_type' : Openbmc.FRU_TYPES['SYSTEM'], |
| 246 | 'is_fru' : True, |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 247 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 248 | '<inventory_root>/system/io_board' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 249 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 250 | 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'], |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 251 | 'manufacturer' : 'FOXCONN', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 252 | 'is_fru' : True, |
| 253 | 'location' : 'C1', |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 254 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 255 | |
| 256 | '<inventory_root>/system/motherboard' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 257 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 258 | 'fru_type' : Openbmc.FRU_TYPES['MAIN_PLANAR'], |
| 259 | 'manufacturer' : 'FOXCONN', |
| 260 | 'is_fru' : True, |
| 261 | 'location' : 'C0', |
| 262 | }, |
| 263 | '<inventory_root>/system/fan0' : |
| 264 | { |
| 265 | 'fru_type' : Openbmc.FRU_TYPES['FAN'], |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 266 | 'manufacturer' : 'DELTA', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 267 | 'is_fru' : True, |
| 268 | 'location' : 'F0', |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 269 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 270 | '<inventory_root>/system/fan1' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 271 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 272 | 'fru_type' : Openbmc.FRU_TYPES['FAN'], |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 273 | 'manufacturer' : 'DELTA', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 274 | 'is_fru' : True, |
| 275 | 'location' : 'F1', |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 276 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 277 | '<inventory_root>/system/io_board/bmc' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 278 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 279 | 'fru_type' : Openbmc.FRU_TYPES['BMC'], |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 280 | 'manufacturer' : 'ASPEED', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 281 | 'is_fru' : False, |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 282 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 283 | '<inventory_root>/system/motherboard/cpu0' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 284 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 285 | 'fru_type' : Openbmc.FRU_TYPES['CPU'], |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 286 | 'manufacturer' : 'IBM', |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 287 | 'is_fru' : True, |
| 288 | 'location' : 'P0', |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 289 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 290 | '<inventory_root>/system/motherboard/cpu0/core0' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 291 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 292 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 293 | 'is_fru' : False, |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 294 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 295 | '<inventory_root>/system/motherboard/cpu0/core1' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 296 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 297 | 'fru_type' : Openbmc.FRU_TYPES['CORE'], |
| 298 | 'is_fru' : False, |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 299 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 300 | '<inventory_root>/system/motherboard/dimm0' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 301 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 302 | 'fru_type' : Openbmc.FRU_TYPES['DIMM'], |
| 303 | 'is_fru' : True, |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 304 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 305 | '<inventory_root>/system/motherboard/dimm1' : |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 306 | { |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 307 | 'fru_type' : Openbmc.FRU_TYPES['DIMM'], |
| 308 | 'is_fru' : True, |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 309 | }, |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 310 | '<inventory_root>/system/io_board/pcie_left_slot_riser' : |
| 311 | { |
| 312 | 'fru_type' : Openbmc.FRU_TYPES['RISER_CARD'], |
| 313 | 'user_label' : 'Left Slot Riser', |
| 314 | 'is_fru' : True, |
| 315 | }, |
| 316 | '<inventory_root>/system/io_board/pcie_right_slot_riser' : |
| 317 | { |
| 318 | 'fru_type' : Openbmc.FRU_TYPES['RISER_CARD'], |
| 319 | 'user_label' : 'Right Slot Riser', |
| 320 | 'is_fru' : True, |
| 321 | }, |
| 322 | '<inventory_root>/system/io_board/pcie_x16_slot_riser' : |
| 323 | { |
| 324 | 'fru_type' : Openbmc.FRU_TYPES['RISER_CARD'], |
| 325 | 'user_label' : 'PCIE x16 Slot Riser', |
| 326 | 'is_fru' : True, |
| 327 | }, |
| 328 | '<inventory_root>/system/io_board/pcie_slot0' : |
| 329 | { |
| 330 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 331 | 'user_label' : 'OCP Mezz card 0', |
| 332 | 'is_fru' : True, |
| 333 | }, |
| 334 | '<inventory_root>/system/io_board/pcie_slot1' : |
| 335 | { |
| 336 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 337 | 'user_label' : 'OCP Mezz card 1', |
| 338 | 'is_fru' : True, |
| 339 | }, |
| 340 | '<inventory_root>/system/io_board/pcie_slot2' : |
| 341 | { |
| 342 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 343 | 'user_label' : 'OCP Mezz card 2', |
| 344 | 'is_fru' : True, |
| 345 | }, |
| 346 | '<inventory_root>/system/io_board/pcie_mezz0' : |
| 347 | { |
| 348 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 349 | 'user_label' : 'OCP Mezz card 0', |
| 350 | 'is_fru' : True, |
| 351 | }, |
| 352 | '<inventory_root>/system/io_board/pcie_mezz1' : |
| 353 | { |
| 354 | 'fru_type' : Openbmc.FRU_TYPES['PCIE_CARD'], |
| 355 | 'user_label' : 'OCP Mezz card 1', |
| 356 | 'is_fru' : True, |
| 357 | }, |
| 358 | |
Norman James | 8887267 | 2015-09-21 16:51:35 -0500 | [diff] [blame] | 359 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 360 | |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 361 | ID_LOOKUP = { |
| 362 | 'FRU' : { |
| 363 | '14' : '<inventory_root>/system/motherboard/dimm0', |
| 364 | }, |
| 365 | 'SENSOR' : { |
| 366 | '21' : '<inventory_root>/system/motherboard/dimm0', |
| 367 | '14' : '/org/openbmc/sensors/HostStatus_0', |
| 368 | }, |
| 369 | 'GPIO_PRESENT' : { |
| 370 | 'SLOT0_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_left_slot_riser', |
| 371 | 'SLOT1_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_right_slot_riser', |
| 372 | 'SLOT2_RISER_PRESENT' : '<inventory_root>/system/io_board/pcie_x16_slot_riser', |
| 373 | 'SLOT0_PRESENT' : '<inventory_root>/system/io_board/pcie_slot0', |
| 374 | 'SLOT1_PRESENT' : '<inventory_root>/system/io_board/pcie_slot1', |
| 375 | 'SLOT2_PRESENT' : '<inventory_root>/system/io_board/pcie_slot2', |
| 376 | 'MEZZ0_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz0', |
| 377 | 'MEZZ1_PRESENT' : '<inventory_root>/system/io_board/pcie_mezz1', |
| 378 | } |
| 379 | } |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 380 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 381 | GPIO_CONFIG = {} |
Norman James | 362a80f | 2015-09-14 14:04:39 -0500 | [diff] [blame] | 382 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 4, 'direction': 'out' } |
| 383 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 5, 'direction': 'out' } |
| 384 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 24, 'direction': 'out' } |
| 385 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 33, 'direction': 'out' } |
| 386 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 6, 'direction': 'out' } |
| 387 | GPIO_CONFIG['PGOOD'] = { 'gpio_num': 23, 'direction': 'in' } |
| 388 | GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 34, 'direction': 'out' } |
Norman James | 19e4591 | 2015-10-04 20:19:41 -0500 | [diff] [blame] | 389 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 32, 'direction': 'in' } |
| 390 | GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_num': 104, 'direction': 'in' } |
| 391 | GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_num': 105, 'direction': 'in' } |
| 392 | GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_num': 106, 'direction': 'in' } |
| 393 | GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_num': 107, 'direction': 'in' } |
| 394 | GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_num': 108, 'direction': 'in' } |
| 395 | GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_num': 109, 'direction': 'in' } |
| 396 | GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_num': 112, 'direction': 'in' } |
| 397 | GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_num': 113, 'direction': 'in' } |
| 398 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 399 | |