Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 1 | #! /usr/bin/python |
| 2 | import dbus |
| 3 | import Openbmc |
| 4 | |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 5 | HOME_PATH = '/media/sf_vbox/openbmc/' |
| 6 | BIN_PATH = HOME_PATH+'bin/' |
| 7 | CACHE_PATH = HOME_PATH+'cache/' |
| 8 | |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 9 | CACHED_INTERFACES = { |
| 10 | 'org.openbmc.Fru' : True |
| 11 | } |
| 12 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 13 | SYSTEM_CONFIG = {} |
| 14 | |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 15 | SYSTEM_CONFIG['org.openbmc.managers.Sensors'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 16 | 'start_process' : True, |
| 17 | 'process_name' : 'sensor_manager.py', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 18 | 'heartbeat' : 'no', |
| 19 | 'rest_name' : 'sensors', |
| 20 | 'instances' : [ |
| 21 | { |
| 22 | 'name' : 'Barreleye', |
| 23 | 'user_label': 'Sensor Manager', |
| 24 | } |
| 25 | ] |
| 26 | } |
| 27 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 28 | SYSTEM_CONFIG['org.openbmc.loggers.EventLogger'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 29 | 'start_process' : True, |
| 30 | 'process_name' : 'eventlogger.py', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 31 | 'heartbeat' : 'no', |
| 32 | 'rest_name' : 'events', |
| 33 | 'instances' : [ |
| 34 | { |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 35 | 'name' : 'Barreleye', |
| 36 | 'user_label': 'Event Logger', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 37 | } |
| 38 | ] |
| 39 | } |
| 40 | |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 41 | SYSTEM_CONFIG['org.openbmc.managers.IpmiTranslator'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 42 | 'start_process' : True, |
| 43 | 'process_name' : 'ipmi_translator.py', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 44 | 'heartbeat' : 'no', |
| 45 | 'instances' : [ |
| 46 | { |
| 47 | 'name' : 'Barreleye', |
| 48 | 'user_label': 'IPMI Translator', |
| 49 | } |
| 50 | ] |
| 51 | } |
| 52 | |
| 53 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 54 | SYSTEM_CONFIG['org.openbmc.control.Power'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 55 | 'start_process' : True, |
| 56 | 'process_name' : 'power_control.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 57 | 'heartbeat' : 'yes', |
| 58 | 'instances' : [ |
| 59 | { |
| 60 | 'name' : 'PowerControl1', |
| 61 | 'user_label': 'Power control', |
| 62 | } |
| 63 | ] |
| 64 | } |
| 65 | |
| 66 | SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 67 | 'start_process' : True, |
| 68 | 'process_name' : 'sensor_ambient.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 69 | 'heartbeat' : 'yes', |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 70 | 'init_methods' : ['org.openbmc.SensorValue'], |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 71 | 'poll_interval': 5000, |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 72 | 'instances' : [ |
| 73 | { |
| 74 | 'name' : 'AmbientTemperature1', |
| 75 | 'user_label': 'Ambient Temperature 1', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 76 | 'sensor_id' : 41, |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 77 | 'properties' : { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 78 | 'org.openbmc.SensorThreshold' : { |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 79 | 'lower_critical': 5, |
| 80 | 'lower_warning' : 10, |
| 81 | 'upper_warning' : 15, |
| 82 | 'upper_critical': 20 |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 83 | }, |
| 84 | 'org.openbmc.SensorI2c' : { |
| 85 | 'dev_path' : '/dev/i2c/i2c0', |
| 86 | 'address' : '0xA0' |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 87 | } |
| 88 | } |
| 89 | }, |
| 90 | { |
| 91 | 'name' : 'AmbientTemperature2', |
| 92 | 'user_label': 'Ambient Temperature 2', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 93 | 'properties' : { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 94 | 'org.openbmc.SensorThreshold' : { |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 95 | 'lower_critical': 5, |
| 96 | 'lower_warning' : 10, |
| 97 | 'upper_warning' : 15, |
| 98 | 'upper_critical': 20 |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 99 | }, |
| 100 | 'org.openbmc.SensorI2c' : { |
| 101 | 'dev_path' : '/dev/i2c/i2c0', |
| 102 | 'address' : '0xA2' |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 103 | } |
| 104 | } |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 105 | } |
| 106 | ] |
| 107 | } |
| 108 | SYSTEM_CONFIG['org.openbmc.buttons.ButtonPower'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 109 | 'start_process' : True, |
| 110 | 'process_name' : 'button_power.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 111 | 'heartbeat' : 'no', |
| 112 | 'instances' : [ |
| 113 | { |
| 114 | 'name' : 'PowerButton1', |
| 115 | 'user_label': 'Main Power Button', |
| 116 | } |
| 117 | ] |
| 118 | } |
| 119 | SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 120 | 'start_process' : True, |
| 121 | 'process_name' : 'sensor_host_status.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 122 | 'heartbeat' : "no", |
| 123 | 'instances' : [ |
| 124 | { |
| 125 | 'name' : 'HostStatus1', |
| 126 | 'user_label': 'Host Status', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 127 | 'sensor_id' : 43, |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 128 | } |
| 129 | ] |
| 130 | } |
| 131 | SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 132 | 'start_process' : True, |
| 133 | 'process_name' : 'chassis_identify.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 134 | 'heartbeat' : 'no', |
| 135 | 'instances' : [ |
| 136 | { |
| 137 | 'name' : 'ChassisIdentify1', |
| 138 | 'user_label': 'Chassis Identify LED', |
| 139 | } |
| 140 | ] |
| 141 | } |
| 142 | SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 143 | 'start_process' : True, |
| 144 | 'process_name' : 'flash_bios.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 145 | 'heartbeat' : 'no', |
| 146 | 'rest_name' : 'flash', |
| 147 | 'instances' : [ |
| 148 | { |
| 149 | 'name' : 'BIOS1', |
| 150 | 'user_label': 'BIOS SPI Flash', |
| 151 | } |
| 152 | ] |
| 153 | } |
| 154 | SYSTEM_CONFIG['org.openbmc.control.Host'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 155 | 'start_process' : True, |
| 156 | 'process_name' : 'control_host.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 157 | 'heartbeat' : 'no', |
| 158 | 'instances' : [ |
| 159 | { |
| 160 | 'name' : 'HostControl1', |
| 161 | 'user_label': 'Host Control', |
| 162 | } |
| 163 | ] |
| 164 | } |
| 165 | SYSTEM_CONFIG['org.openbmc.control.Chassis'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 166 | 'start_process' : True, |
| 167 | 'process_name' : 'chassis_control.py', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 168 | 'heartbeat' : 'no', |
| 169 | 'rest_name' : 'chassis', |
| 170 | 'instances' : [ |
| 171 | { |
| 172 | 'name' : 'Chassis', |
| 173 | 'user_label': 'Chassis Control', |
| 174 | } |
| 175 | ] |
| 176 | } |
| 177 | SYSTEM_CONFIG['org.openbmc.frus.Fan'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 178 | 'start_process' : True, |
| 179 | 'process_name' : 'fan.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 180 | 'heartbeat' : 'no', |
| 181 | 'instances' : [ |
| 182 | { |
| 183 | 'name' : 'Fan0', |
| 184 | 'user_label': 'Fan 0', |
| 185 | 'properties' : { |
| 186 | 'org.openbmc.Fru' : { |
| 187 | 'label' : 'FAN0', |
| 188 | 'location' : 'F0', |
| 189 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | }, |
| 194 | { |
| 195 | 'name' : 'Fan1', |
| 196 | 'user_label': 'Fan 1', |
| 197 | 'properties' : { |
| 198 | 'org.openbmc.Fru' : { |
| 199 | 'label' : 'FAN1', |
| 200 | 'location' : 'F1', |
| 201 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | }, |
| 206 | { |
| 207 | 'name' : 'Fan2', |
| 208 | 'user_label': 'Fan 2', |
| 209 | 'properties' : { |
| 210 | 'org.openbmc.Fru' : { |
| 211 | 'label' : 'FAN2', |
| 212 | 'location' : 'F2', |
| 213 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | }, |
| 218 | { |
| 219 | 'name' : 'Fan3', |
| 220 | 'user_label': 'Fan 3', |
| 221 | 'properties' : { |
| 222 | 'org.openbmc.Fru' : { |
| 223 | 'label' : 'FAN3', |
| 224 | 'location' : 'F3', |
| 225 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | }, |
| 230 | { |
| 231 | 'name' : 'Fan4', |
| 232 | 'user_label': 'Fan 4', |
| 233 | 'properties' : { |
| 234 | 'org.openbmc.Fru' : { |
| 235 | 'label' : 'FAN4', |
| 236 | 'location' : 'F4', |
| 237 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | }, |
| 242 | { |
| 243 | 'name' : 'Fan5', |
| 244 | 'user_label': 'Fan 5', |
| 245 | 'properties' : { |
| 246 | 'org.openbmc.Fru' : { |
| 247 | 'label' : 'FAN5', |
| 248 | 'location' : 'F5', |
| 249 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | } |
| 254 | |
| 255 | ] |
| 256 | } |
| 257 | |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 258 | SYSTEM_CONFIG['org.openbmc.frus.Board'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 259 | 'start_process' : True, |
| 260 | 'process_name' : 'fru_board.exe', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 261 | 'init_methods' : ['org.openbmc.Fru'], |
| 262 | 'heartbeat' : 'no', |
| 263 | 'instances' : [ |
| 264 | { |
| 265 | 'name' : 'IO_Planer', |
| 266 | 'user_label': 'IO Planar', |
| 267 | 'fru_id' : 61, |
| 268 | 'properties' : { |
| 269 | 'org.openbmc.Fru' : { |
| 270 | 'label' : 'IO Planar', |
| 271 | 'location' : 'IO_PLANAR', |
| 272 | 'type' : Openbmc.FRU_TYPES['BACKPLANE'] |
| 273 | }, |
| 274 | 'org.openbmc.Fru.Eeprom' : { |
| 275 | 'i2c_address' : '0xA8', |
| 276 | 'i2c_dev_path' : '/dev/i2c/i2c5' |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | ] |
| 281 | } |
| 282 | |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 283 | SYSTEM_CONFIG['org.openbmc.frus.Fru'] = { |
Norman James | 5d78b4d | 2015-09-05 13:34:34 -0500 | [diff] [blame^] | 284 | 'start_process' : True, |
| 285 | 'process_name' : 'fru_generic.exe', |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 286 | 'heartbeat' : 'no', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 287 | 'instances' : [ |
| 288 | { |
| 289 | 'name' : 'Backplane', |
| 290 | 'user_label': '2S Motherboard', |
| 291 | 'fru_id' : 60, |
| 292 | 'properties' : { |
| 293 | 'org.openbmc.Fru' : { |
| 294 | 'label' : 'MAIN_PLANAR', |
| 295 | 'location' : 'C0', |
| 296 | 'type' : Openbmc.FRU_TYPES['BACKPLANE'], |
| 297 | } |
| 298 | } |
| 299 | }, |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 300 | { |
| 301 | 'name' : 'DIMM0', |
| 302 | 'user_label': 'DIMM A0 Slot 0', |
Norman James | 90baede | 2015-09-02 20:32:49 -0500 | [diff] [blame] | 303 | 'fru_id' : 12, |
Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 304 | 'properties' : { |
| 305 | 'org.openbmc.Fru' : { |
| 306 | 'label' : 'DIMM0', |
| 307 | 'location' : 'A0', |
| 308 | 'type' : Openbmc.FRU_TYPES['DIMM'], |
| 309 | } |
| 310 | } |
| 311 | }, |
| 312 | { |
| 313 | 'name' : 'DIMM1', |
| 314 | 'user_label': 'DIMM A1 Slot 0', |
| 315 | 'properties' : { |
| 316 | 'org.openbmc.Fru' : { |
| 317 | 'label' : 'DIMM1', |
| 318 | 'location' : 'A1', |
| 319 | 'type' : Openbmc.FRU_TYPES['DIMM'], |
| 320 | } |
| 321 | } |
| 322 | }, |
| 323 | { |
| 324 | 'name' : 'CPU0', |
| 325 | 'user_label': 'CPU0', |
| 326 | 'properties' : { |
| 327 | 'org.openbmc.Fru' : { |
| 328 | 'label' : 'CPU0', |
| 329 | 'location' : 'CPU0', |
| 330 | 'type' : Openbmc.FRU_TYPES['CPU'], |
| 331 | } |
| 332 | } |
| 333 | }, |
| 334 | |
| 335 | ] |
| 336 | } |
| 337 | |
| 338 | GPIO_CONFIG = {} |
| 339 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 23, 'direction': 'out' } |
| 340 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 24, 'direction': 'out' } |
| 341 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 25, 'direction': 'out' } |
| 342 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 26, 'direction': 'out' } |
| 343 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 27, 'direction': 'out' } |
| 344 | GPIO_CONFIG['PGOOD'] = { 'gpio_num': 28, 'direction': 'in' } |
| 345 | GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 30, 'direction': 'out' } |
| 346 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 31, 'direction': 'in' } |
| 347 | |