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