Norman James | ce46e3e | 2015-08-30 22:25:55 -0500 | [diff] [blame] | 1 | #! /usr/bin/python |
| 2 | import dbus |
| 3 | import Openbmc |
| 4 | |
| 5 | SYSTEM_CONFIG = {} |
| 6 | |
| 7 | SYSTEM_CONFIG['org.openbmc.loggers.EventLogger'] = { |
| 8 | 'exe_name' : 'bin/eventlogger.py', |
| 9 | 'heartbeat' : 'no', |
| 10 | 'rest_name' : 'events', |
| 11 | 'instances' : [ |
| 12 | { |
| 13 | 'name' : 'Chassis', |
| 14 | 'user_label': 'Chassis Control', |
| 15 | } |
| 16 | ] |
| 17 | } |
| 18 | |
| 19 | SYSTEM_CONFIG['org.openbmc.control.Power'] = { |
| 20 | 'exe_name' : 'bin/power_control.exe', |
| 21 | 'heartbeat' : 'yes', |
| 22 | 'instances' : [ |
| 23 | { |
| 24 | 'name' : 'PowerControl1', |
| 25 | 'user_label': 'Power control', |
| 26 | } |
| 27 | ] |
| 28 | } |
| 29 | |
| 30 | SYSTEM_CONFIG['org.openbmc.sensors.Temperature.Ambient'] = { |
| 31 | 'exe_name' : 'bin/sensor_ambient.exe', |
| 32 | 'heartbeat' : 'yes', |
| 33 | 'instances' : [ |
| 34 | { |
| 35 | 'name' : 'AmbientTemperature1', |
| 36 | 'user_label': 'Ambient Temperature 1', |
| 37 | 'parameters': ['/dev/i2c0','0xA0'], |
| 38 | 'poll_interval': 5000, |
| 39 | 'properties' : { |
| 40 | 'org.openbmc.SensorIntegerThreshold' : { |
| 41 | 'lower_critical': 5, |
| 42 | 'lower_warning' : 10, |
| 43 | 'upper_warning' : 15, |
| 44 | 'upper_critical': 20 |
| 45 | } |
| 46 | } |
| 47 | }, |
| 48 | { |
| 49 | 'name' : 'AmbientTemperature2', |
| 50 | 'user_label': 'Ambient Temperature 2', |
| 51 | 'parameters': ['/dev/i2c0','0xA2'], |
| 52 | 'poll_interval': 5000, |
| 53 | 'properties' : { |
| 54 | 'org.openbmc.SensorIntegerThreshold' : { |
| 55 | 'lower_critical': 5, |
| 56 | 'lower_warning' : 10, |
| 57 | 'upper_warning' : 15, |
| 58 | 'upper_critical': 20 |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | } |
| 63 | ] |
| 64 | } |
| 65 | SYSTEM_CONFIG['org.openbmc.buttons.ButtonPower'] = { |
| 66 | 'exe_name' : 'bin/button_power.exe', |
| 67 | 'heartbeat' : 'no', |
| 68 | 'instances' : [ |
| 69 | { |
| 70 | 'name' : 'PowerButton1', |
| 71 | 'user_label': 'Main Power Button', |
| 72 | } |
| 73 | ] |
| 74 | } |
| 75 | SYSTEM_CONFIG['org.openbmc.sensors.HostStatus'] = { |
| 76 | 'exe_name' : 'bin/sensor_host_status.exe', |
| 77 | 'heartbeat' : "no", |
| 78 | 'instances' : [ |
| 79 | { |
| 80 | 'name' : 'HostStatus1', |
| 81 | 'user_label': 'Host Status', |
| 82 | } |
| 83 | ] |
| 84 | } |
| 85 | SYSTEM_CONFIG['org.openbmc.leds.ChassisIdentify'] = { |
| 86 | 'exe_name' : 'bin/chassis_identify.exe', |
| 87 | 'heartbeat' : 'no', |
| 88 | 'instances' : [ |
| 89 | { |
| 90 | 'name' : 'ChassisIdentify1', |
| 91 | 'user_label': 'Chassis Identify LED', |
| 92 | } |
| 93 | ] |
| 94 | } |
| 95 | SYSTEM_CONFIG['org.openbmc.flash.BIOS'] = { |
| 96 | 'exe_name' : 'bin/flash_bios.exe', |
| 97 | 'heartbeat' : 'no', |
| 98 | 'rest_name' : 'flash', |
| 99 | 'instances' : [ |
| 100 | { |
| 101 | 'name' : 'BIOS1', |
| 102 | 'user_label': 'BIOS SPI Flash', |
| 103 | } |
| 104 | ] |
| 105 | } |
| 106 | SYSTEM_CONFIG['org.openbmc.control.Host'] = { |
| 107 | 'exe_name' : 'bin/control_host.exe', |
| 108 | 'heartbeat' : 'no', |
| 109 | 'instances' : [ |
| 110 | { |
| 111 | 'name' : 'HostControl1', |
| 112 | 'user_label': 'Host Control', |
| 113 | } |
| 114 | ] |
| 115 | } |
| 116 | SYSTEM_CONFIG['org.openbmc.control.Chassis'] = { |
| 117 | 'exe_name' : 'bin/chassis_control.py', |
| 118 | 'heartbeat' : 'no', |
| 119 | 'rest_name' : 'chassis', |
| 120 | 'instances' : [ |
| 121 | { |
| 122 | 'name' : 'Chassis', |
| 123 | 'user_label': 'Chassis Control', |
| 124 | } |
| 125 | ] |
| 126 | } |
| 127 | SYSTEM_CONFIG['org.openbmc.frus.Fan'] = { |
| 128 | 'exe_name' : 'bin/fan.exe', |
| 129 | 'heartbeat' : 'no', |
| 130 | 'instances' : [ |
| 131 | { |
| 132 | 'name' : 'Fan0', |
| 133 | 'user_label': 'Fan 0', |
| 134 | 'properties' : { |
| 135 | 'org.openbmc.Fru' : { |
| 136 | 'label' : 'FAN0', |
| 137 | 'location' : 'F0', |
| 138 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | }, |
| 143 | { |
| 144 | 'name' : 'Fan1', |
| 145 | 'user_label': 'Fan 1', |
| 146 | 'properties' : { |
| 147 | 'org.openbmc.Fru' : { |
| 148 | 'label' : 'FAN1', |
| 149 | 'location' : 'F1', |
| 150 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | }, |
| 155 | { |
| 156 | 'name' : 'Fan2', |
| 157 | 'user_label': 'Fan 2', |
| 158 | 'properties' : { |
| 159 | 'org.openbmc.Fru' : { |
| 160 | 'label' : 'FAN2', |
| 161 | 'location' : 'F2', |
| 162 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | }, |
| 167 | { |
| 168 | 'name' : 'Fan3', |
| 169 | 'user_label': 'Fan 3', |
| 170 | 'properties' : { |
| 171 | 'org.openbmc.Fru' : { |
| 172 | 'label' : 'FAN3', |
| 173 | 'location' : 'F3', |
| 174 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | }, |
| 179 | { |
| 180 | 'name' : 'Fan4', |
| 181 | 'user_label': 'Fan 4', |
| 182 | 'properties' : { |
| 183 | 'org.openbmc.Fru' : { |
| 184 | 'label' : 'FAN4', |
| 185 | 'location' : 'F4', |
| 186 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | }, |
| 191 | { |
| 192 | 'name' : 'Fan5', |
| 193 | 'user_label': 'Fan 5', |
| 194 | 'properties' : { |
| 195 | 'org.openbmc.Fru' : { |
| 196 | 'label' : 'FAN5', |
| 197 | 'location' : 'F5', |
| 198 | 'type' : Openbmc.FRU_TYPES['FAN'], |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | } |
| 203 | |
| 204 | ] |
| 205 | } |
| 206 | |
| 207 | SYSTEM_CONFIG['org.openbmc.frus.Fru'] = { |
| 208 | 'exe_name' : 'bin/fru_generic.exe', |
| 209 | 'heartbeat' : 'no', |
| 210 | 'instances' : [ |
| 211 | { |
| 212 | 'name' : 'DIMM0', |
| 213 | 'user_label': 'DIMM A0 Slot 0', |
| 214 | 'properties' : { |
| 215 | 'org.openbmc.Fru' : { |
| 216 | 'label' : 'DIMM0', |
| 217 | 'location' : 'A0', |
| 218 | 'type' : Openbmc.FRU_TYPES['DIMM'], |
| 219 | } |
| 220 | } |
| 221 | }, |
| 222 | { |
| 223 | 'name' : 'DIMM1', |
| 224 | 'user_label': 'DIMM A1 Slot 0', |
| 225 | 'properties' : { |
| 226 | 'org.openbmc.Fru' : { |
| 227 | 'label' : 'DIMM1', |
| 228 | 'location' : 'A1', |
| 229 | 'type' : Openbmc.FRU_TYPES['DIMM'], |
| 230 | } |
| 231 | } |
| 232 | }, |
| 233 | { |
| 234 | 'name' : 'CPU0', |
| 235 | 'user_label': 'CPU0', |
| 236 | 'properties' : { |
| 237 | 'org.openbmc.Fru' : { |
| 238 | 'label' : 'CPU0', |
| 239 | 'location' : 'CPU0', |
| 240 | 'type' : Openbmc.FRU_TYPES['CPU'], |
| 241 | } |
| 242 | } |
| 243 | }, |
| 244 | |
| 245 | ] |
| 246 | } |
| 247 | |
| 248 | GPIO_CONFIG = {} |
| 249 | GPIO_CONFIG['FSI_CLK'] = { 'gpio_num': 23, 'direction': 'out' } |
| 250 | GPIO_CONFIG['FSI_DATA'] = { 'gpio_num': 24, 'direction': 'out' } |
| 251 | GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_num': 25, 'direction': 'out' } |
| 252 | GPIO_CONFIG['POWER_PIN'] = { 'gpio_num': 26, 'direction': 'out' } |
| 253 | GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_num': 27, 'direction': 'out' } |
| 254 | GPIO_CONFIG['PGOOD'] = { 'gpio_num': 28, 'direction': 'in' } |
| 255 | GPIO_CONFIG['IDENTIFY'] = { 'gpio_num': 30, 'direction': 'out' } |
| 256 | GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_num': 31, 'direction': 'in' } |
| 257 | |