1#! /usr/bin/python 2 3HOME_PATH = './' 4GPIO_BASE = 320 5SYSTEM_NAME = "Witherspoon" 6 7 8## System states 9## state can change to next state in 2 ways: 10## - a process emits a GotoSystemState signal with state name to goto 11## - objects specified in EXIT_STATE_DEPEND have started 12SYSTEM_STATES = [ 13 'BASE_APPS', 14 'BMC_STARTING', 15 'BMC_READY', 16 'HOST_POWERING_ON', 17 'HOST_POWERED_ON', 18 'HOST_BOOTING', 19 'HOST_BOOTED', 20 'HOST_POWERED_OFF', 21] 22 23EXIT_STATE_DEPEND = { 24 'BASE_APPS' : { 25 '/org/openbmc/sensors': 0, 26 }, 27 'BMC_STARTING' : { 28 '/org/openbmc/control/chassis0': 0, 29 '/org/openbmc/control/power0' : 0, 30 '/org/openbmc/control/host0' : 0, 31 '/org/openbmc/control/flash/bios' : 0, 32 }, 33} 34 35CACHED_INTERFACES = { 36 "org.openbmc.InventoryItem" : True, 37 "org.openbmc.control.Chassis" : True, 38} 39 40INVENTORY_ROOT = '/org/openbmc/inventory' 41 42FRU_INSTANCES = { 43 '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" }, 44 '<inventory_root>/system/bios' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" }, 45 '<inventory_root>/system/misc' : { 'fru_type' : 'SYSTEM','is_fru' : False, }, 46 47 '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" }, 48 49 '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, }, 50 51 '<inventory_root>/system/systemevent' : { 'fru_type' : 'SYSTEM_EVENT', 'is_fru' : False, }, 52 '<inventory_root>/system/chassis/motherboard/refclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 53 '<inventory_root>/system/chassis/motherboard/pcieclock': { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 54 '<inventory_root>/system/chassis/motherboard/todclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 55 '<inventory_root>/system/chassis/motherboard/apss' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 56 57 '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, }, 58 '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, }, 59 '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, }, 60 '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, }, 61 62 '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' }, 63 64 '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, }, 65 '<inventory_root>/system/chassis/motherboard/cpu1' : { 'fru_type' : 'CPU', 'is_fru' : True, }, 66 67 '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 68 '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 69 '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 70 '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 71 '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 72 '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 73 '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 74 '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 75 '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 76 '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 77 '<inventory_root>/system/chassis/motherboard/cpu0/core10': { 'fru_type' : 'CORE', 'is_fru' : False, }, 78 '<inventory_root>/system/chassis/motherboard/cpu0/core11': { 'fru_type' : 'CORE', 'is_fru' : False, }, 79 80 '<inventory_root>/system/chassis/motherboard/cpu1/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 81 '<inventory_root>/system/chassis/motherboard/cpu1/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 82 '<inventory_root>/system/chassis/motherboard/cpu1/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 83 '<inventory_root>/system/chassis/motherboard/cpu1/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 84 '<inventory_root>/system/chassis/motherboard/cpu1/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 85 '<inventory_root>/system/chassis/motherboard/cpu1/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 86 '<inventory_root>/system/chassis/motherboard/cpu1/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 87 '<inventory_root>/system/chassis/motherboard/cpu1/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 88 '<inventory_root>/system/chassis/motherboard/cpu1/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 89 '<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 90 '<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 91 '<inventory_root>/system/chassis/motherboard/cpu1/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 92 93 '<inventory_root>/system/chassis/motherboard/membuf0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 94 '<inventory_root>/system/chassis/motherboard/membuf1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 95 '<inventory_root>/system/chassis/motherboard/membuf2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 96 '<inventory_root>/system/chassis/motherboard/membuf3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 97 '<inventory_root>/system/chassis/motherboard/membuf4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 98 '<inventory_root>/system/chassis/motherboard/membuf5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 99 '<inventory_root>/system/chassis/motherboard/membuf6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 100 '<inventory_root>/system/chassis/motherboard/membuf7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 101 102 '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 103 '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 104 '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 105 '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 106 '<inventory_root>/system/chassis/motherboard/dimm4' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 107 '<inventory_root>/system/chassis/motherboard/dimm5' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 108 '<inventory_root>/system/chassis/motherboard/dimm6' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 109 '<inventory_root>/system/chassis/motherboard/dimm7' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 110 '<inventory_root>/system/chassis/motherboard/dimm8' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 111 '<inventory_root>/system/chassis/motherboard/dimm9' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 112 '<inventory_root>/system/chassis/motherboard/dimm10' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 113 '<inventory_root>/system/chassis/motherboard/dimm11' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 114 '<inventory_root>/system/chassis/motherboard/dimm12' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 115 '<inventory_root>/system/chassis/motherboard/dimm13' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 116 '<inventory_root>/system/chassis/motherboard/dimm14' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 117 '<inventory_root>/system/chassis/motherboard/dimm15' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 118 '<inventory_root>/system/chassis/motherboard/dimm16' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 119 '<inventory_root>/system/chassis/motherboard/dimm17' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 120 '<inventory_root>/system/chassis/motherboard/dimm18' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 121 '<inventory_root>/system/chassis/motherboard/dimm19' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 122 '<inventory_root>/system/chassis/motherboard/dimm20' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 123 '<inventory_root>/system/chassis/motherboard/dimm21' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 124 '<inventory_root>/system/chassis/motherboard/dimm22' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 125 '<inventory_root>/system/chassis/motherboard/dimm23' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 126 '<inventory_root>/system/chassis/motherboard/dimm24' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 127 '<inventory_root>/system/chassis/motherboard/dimm25' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 128 '<inventory_root>/system/chassis/motherboard/dimm26' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 129 '<inventory_root>/system/chassis/motherboard/dimm27' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 130 '<inventory_root>/system/chassis/motherboard/dimm28' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 131 '<inventory_root>/system/chassis/motherboard/dimm29' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 132 '<inventory_root>/system/chassis/motherboard/dimm30' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 133 '<inventory_root>/system/chassis/motherboard/dimm31' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 134} 135 136ID_LOOKUP = { 137 'FRU' : { 138 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0', 139 0x02 : '<inventory_root>/system/chassis/motherboard/cpu1', 140 0x03 : '<inventory_root>/system/chassis/motherboard', 141 0x04 : '<inventory_root>/system/chassis/motherboard/membuf0', 142 0x05 : '<inventory_root>/system/chassis/motherboard/membuf1', 143 0x06 : '<inventory_root>/system/chassis/motherboard/membuf2', 144 0x07 : '<inventory_root>/system/chassis/motherboard/membuf3', 145 0x08 : '<inventory_root>/system/chassis/motherboard/membuf4', 146 0x09 : '<inventory_root>/system/chassis/motherboard/membuf5', 147 0x0c : '<inventory_root>/system/chassis/motherboard/dimm0', 148 0x0d : '<inventory_root>/system/chassis/motherboard/dimm1', 149 0x0e : '<inventory_root>/system/chassis/motherboard/dimm2', 150 0x0f : '<inventory_root>/system/chassis/motherboard/dimm3', 151 0x10 : '<inventory_root>/system/chassis/motherboard/dimm4', 152 0x11 : '<inventory_root>/system/chassis/motherboard/dimm5', 153 0x12 : '<inventory_root>/system/chassis/motherboard/dimm6', 154 0x13 : '<inventory_root>/system/chassis/motherboard/dimm7', 155 0x14 : '<inventory_root>/system/chassis/motherboard/dimm8', 156 0x15 : '<inventory_root>/system/chassis/motherboard/dimm9', 157 0x16 : '<inventory_root>/system/chassis/motherboard/dimm10', 158 0x17 : '<inventory_root>/system/chassis/motherboard/dimm11', 159 0x18 : '<inventory_root>/system/chassis/motherboard/dimm12', 160 0x19 : '<inventory_root>/system/chassis/motherboard/dimm13', 161 0x1a : '<inventory_root>/system/chassis/motherboard/dimm14', 162 0x1b : '<inventory_root>/system/chassis/motherboard/dimm15', 163 0x1c : '<inventory_root>/system/chassis/motherboard/dimm16', 164 0x1d : '<inventory_root>/system/chassis/motherboard/dimm17', 165 0x1e : '<inventory_root>/system/chassis/motherboard/dimm18', 166 0x1f : '<inventory_root>/system/chassis/motherboard/dimm19', 167 0x20 : '<inventory_root>/system/chassis/motherboard/dimm20', 168 0x21 : '<inventory_root>/system/chassis/motherboard/dimm21', 169 0x22 : '<inventory_root>/system/chassis/motherboard/dimm22', 170 0x23 : '<inventory_root>/system/chassis/motherboard/dimm23', 171 0x24 : '<inventory_root>/system/chassis/motherboard/dimm24', 172 0x25 : '<inventory_root>/system/chassis/motherboard/dimm25', 173 0x26 : '<inventory_root>/system/chassis/motherboard/dimm26', 174 0x27 : '<inventory_root>/system/chassis/motherboard/dimm27', 175 0x28 : '<inventory_root>/system/chassis/motherboard/dimm28', 176 0x29 : '<inventory_root>/system/chassis/motherboard/dimm29', 177 0x2a : '<inventory_root>/system/chassis/motherboard/dimm30', 178 0x2b : '<inventory_root>/system/chassis/motherboard/dimm31', 179 }, 180 'FRU_STR' : { 181 'PRODUCT_0' : '<inventory_root>/system/bios', 182 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0', 183 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/cpu1', 184 'CHASSIS_3' : '<inventory_root>/system/chassis/motherboard', 185 'BOARD_3' : '<inventory_root>/system/misc', 186 'BOARD_4' : '<inventory_root>/system/chassis/motherboard/membuf0', 187 'BOARD_5' : '<inventory_root>/system/chassis/motherboard/membuf1', 188 'BOARD_6' : '<inventory_root>/system/chassis/motherboard/membuf2', 189 'BOARD_7' : '<inventory_root>/system/chassis/motherboard/membuf3', 190 'BOARD_8' : '<inventory_root>/system/chassis/motherboard/membuf4', 191 'BOARD_9' : '<inventory_root>/system/chassis/motherboard/membuf5', 192 'BOARD_10' : '<inventory_root>/system/chassis/motherboard/membuf6', 193 'BOARD_11' : '<inventory_root>/system/chassis/motherboard/membuf7', 194 'PRODUCT_12' : '<inventory_root>/system/chassis/motherboard/dimm0', 195 'PRODUCT_13' : '<inventory_root>/system/chassis/motherboard/dimm1', 196 'PRODUCT_14' : '<inventory_root>/system/chassis/motherboard/dimm2', 197 'PRODUCT_15' : '<inventory_root>/system/chassis/motherboard/dimm3', 198 'PRODUCT_16' : '<inventory_root>/system/chassis/motherboard/dimm4', 199 'PRODUCT_17' : '<inventory_root>/system/chassis/motherboard/dimm5', 200 'PRODUCT_18' : '<inventory_root>/system/chassis/motherboard/dimm6', 201 'PRODUCT_19' : '<inventory_root>/system/chassis/motherboard/dimm7', 202 'PRODUCT_20' : '<inventory_root>/system/chassis/motherboard/dimm8', 203 'PRODUCT_21' : '<inventory_root>/system/chassis/motherboard/dimm9', 204 'PRODUCT_22' : '<inventory_root>/system/chassis/motherboard/dimm10', 205 'PRODUCT_23' : '<inventory_root>/system/chassis/motherboard/dimm11', 206 'PRODUCT_24' : '<inventory_root>/system/chassis/motherboard/dimm12', 207 'PRODUCT_25' : '<inventory_root>/system/chassis/motherboard/dimm13', 208 'PRODUCT_26' : '<inventory_root>/system/chassis/motherboard/dimm14', 209 'PRODUCT_27' : '<inventory_root>/system/chassis/motherboard/dimm15', 210 'PRODUCT_28' : '<inventory_root>/system/chassis/motherboard/dimm16', 211 'PRODUCT_29' : '<inventory_root>/system/chassis/motherboard/dimm17', 212 'PRODUCT_30' : '<inventory_root>/system/chassis/motherboard/dimm18', 213 'PRODUCT_31' : '<inventory_root>/system/chassis/motherboard/dimm19', 214 'PRODUCT_32' : '<inventory_root>/system/chassis/motherboard/dimm20', 215 'PRODUCT_33' : '<inventory_root>/system/chassis/motherboard/dimm21', 216 'PRODUCT_34' : '<inventory_root>/system/chassis/motherboard/dimm22', 217 'PRODUCT_35' : '<inventory_root>/system/chassis/motherboard/dimm23', 218 'PRODUCT_36' : '<inventory_root>/system/chassis/motherboard/dimm24', 219 'PRODUCT_37' : '<inventory_root>/system/chassis/motherboard/dimm25', 220 'PRODUCT_38' : '<inventory_root>/system/chassis/motherboard/dimm26', 221 'PRODUCT_39' : '<inventory_root>/system/chassis/motherboard/dimm27', 222 'PRODUCT_40' : '<inventory_root>/system/chassis/motherboard/dimm28', 223 'PRODUCT_41' : '<inventory_root>/system/chassis/motherboard/dimm29', 224 'PRODUCT_42' : '<inventory_root>/system/chassis/motherboard/dimm30', 225 'PRODUCT_43' : '<inventory_root>/system/chassis/motherboard/dimm31', 226 'PRODUCT_47' : '<inventory_root>/system/misc', 227 }, 228 'SENSOR' : { 229 0x04 : '/org/openbmc/sensors/host/HostStatus', 230 0x05 : '/org/openbmc/sensors/host/BootProgress', 231 0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus', 232 0x09 : '/org/openbmc/sensors/host/cpu1/OccStatus', 233 0x0c : '<inventory_root>/system/chassis/motherboard/cpu0', 234 0x0e : '<inventory_root>/system/chassis/motherboard/cpu1', 235 0x1e : '<inventory_root>/system/chassis/motherboard/dimm3', 236 0x1f : '<inventory_root>/system/chassis/motherboard/dimm2', 237 0x20 : '<inventory_root>/system/chassis/motherboard/dimm1', 238 0x21 : '<inventory_root>/system/chassis/motherboard/dimm0', 239 0x22 : '<inventory_root>/system/chassis/motherboard/dimm7', 240 0x23 : '<inventory_root>/system/chassis/motherboard/dimm6', 241 0x24 : '<inventory_root>/system/chassis/motherboard/dimm5', 242 0x25 : '<inventory_root>/system/chassis/motherboard/dimm4', 243 0x26 : '<inventory_root>/system/chassis/motherboard/dimm11', 244 0x27 : '<inventory_root>/system/chassis/motherboard/dimm10', 245 0x28 : '<inventory_root>/system/chassis/motherboard/dimm9', 246 0x29 : '<inventory_root>/system/chassis/motherboard/dimm8', 247 0x2a : '<inventory_root>/system/chassis/motherboard/dimm15', 248 0x2b : '<inventory_root>/system/chassis/motherboard/dimm14', 249 0x2c : '<inventory_root>/system/chassis/motherboard/dimm13', 250 0x2d : '<inventory_root>/system/chassis/motherboard/dimm12', 251 0x2e : '<inventory_root>/system/chassis/motherboard/dimm19', 252 0x2f : '<inventory_root>/system/chassis/motherboard/dimm18', 253 0x30 : '<inventory_root>/system/chassis/motherboard/dimm17', 254 0x31 : '<inventory_root>/system/chassis/motherboard/dimm16', 255 0x32 : '<inventory_root>/system/chassis/motherboard/dimm23', 256 0x33 : '<inventory_root>/system/chassis/motherboard/dimm22', 257 0x34 : '<inventory_root>/system/chassis/motherboard/dimm21', 258 0x35 : '<inventory_root>/system/chassis/motherboard/dimm20', 259 0x36 : '<inventory_root>/system/chassis/motherboard/dimm27', 260 0x37 : '<inventory_root>/system/chassis/motherboard/dimm26', 261 0x38 : '<inventory_root>/system/chassis/motherboard/dimm25', 262 0x39 : '<inventory_root>/system/chassis/motherboard/dimm24', 263 0x3a : '<inventory_root>/system/chassis/motherboard/dimm31', 264 0x3b : '<inventory_root>/system/chassis/motherboard/dimm30', 265 0x3c : '<inventory_root>/system/chassis/motherboard/dimm29', 266 0x3d : '<inventory_root>/system/chassis/motherboard/dimm28', 267 0x3e : '<inventory_root>/system/chassis/motherboard/cpu0/core0', 268 0x3f : '<inventory_root>/system/chassis/motherboard/cpu0/core1', 269 0x40 : '<inventory_root>/system/chassis/motherboard/cpu0/core2', 270 0x41 : '<inventory_root>/system/chassis/motherboard/cpu0/core3', 271 0x42 : '<inventory_root>/system/chassis/motherboard/cpu0/core4', 272 0x43 : '<inventory_root>/system/chassis/motherboard/cpu0/core5', 273 0x44 : '<inventory_root>/system/chassis/motherboard/cpu0/core6', 274 0x45 : '<inventory_root>/system/chassis/motherboard/cpu0/core7', 275 0x46 : '<inventory_root>/system/chassis/motherboard/cpu0/core8', 276 0x47 : '<inventory_root>/system/chassis/motherboard/cpu0/core9', 277 0x48 : '<inventory_root>/system/chassis/motherboard/cpu0/core10', 278 0x49 : '<inventory_root>/system/chassis/motherboard/cpu0/core11', 279 0x4a : '<inventory_root>/system/chassis/motherboard/cpu1/core0', 280 0x4b : '<inventory_root>/system/chassis/motherboard/cpu1/core1', 281 0x4c : '<inventory_root>/system/chassis/motherboard/cpu1/core2', 282 0x4d : '<inventory_root>/system/chassis/motherboard/cpu1/core3', 283 0x4e : '<inventory_root>/system/chassis/motherboard/cpu1/core4', 284 0x4f : '<inventory_root>/system/chassis/motherboard/cpu1/core5', 285 0x50 : '<inventory_root>/system/chassis/motherboard/cpu1/core6', 286 0x51 : '<inventory_root>/system/chassis/motherboard/cpu1/core7', 287 0x52 : '<inventory_root>/system/chassis/motherboard/cpu1/core8', 288 0x53 : '<inventory_root>/system/chassis/motherboard/cpu1/core9', 289 0x54 : '<inventory_root>/system/chassis/motherboard/cpu1/core10', 290 0x55 : '<inventory_root>/system/chassis/motherboard/cpu1/core11', 291 0x56 : '<inventory_root>/system/chassis/motherboard/membuf0', 292 0x57 : '<inventory_root>/system/chassis/motherboard/membuf1', 293 0x58 : '<inventory_root>/system/chassis/motherboard/membuf2', 294 0x59 : '<inventory_root>/system/chassis/motherboard/membuf3', 295 0x5a : '<inventory_root>/system/chassis/motherboard/membuf4', 296 0x5b : '<inventory_root>/system/chassis/motherboard/membuf5', 297 0x5c : '<inventory_root>/system/chassis/motherboard/membuf6', 298 0x5d : '<inventory_root>/system/chassis/motherboard/membuf7', 299 0x5f : '/org/openbmc/sensors/host/BootCount', 300 0x60 : '<inventory_root>/system/chassis/motherboard', 301 0x61 : '<inventory_root>/system/systemevent', 302 0x62 : '<inventory_root>/system/powerlimit', 303 0x63 : '<inventory_root>/system/chassis/motherboard/refclock', 304 0x64 : '<inventory_root>/system/chassis/motherboard/pcieclock', 305 0xb1 : '<inventory_root>/system/chassis/motherboard/todclock', 306 0xb2 : '<inventory_root>/system/chassis/motherboard/apss', 307 0xb3 : '/org/openbmc/sensors/host/powercap', 308 0xb5 : '/org/openbmc/sensors/host/OperatingSystemStatus', 309 0xb6 : '<inventory_root>/system/chassis/motherboard/pcielink', 310 }, 311 'GPIO_PRESENT' : {} 312} 313 314GPIO_CONFIG = {} 315GPIO_CONFIG['BMC_POWER_UP'] = \ 316 {'gpio_pin': 'D1', 'direction': 'out'} 317GPIO_CONFIG['SYS_PWROK_BUFF'] = \ 318 {'gpio_pin': 'D2', 'direction': 'in'} 319GPIO_CONFIG['BMC_WD_CLEAR_PULSE_N'] = \ 320 {'gpio_pin': 'N5', 'direction': 'out'} 321GPIO_CONFIG['CHECKSTOP'] = \ 322 {'gpio_pin': 'J2', 'direction': 'falling'} 323 324# witherspoon: not connect 325#GPIO_CONFIG['CM1_OE_R_N'] = \ 326# {'gpio_pin': 'A2', 'direction': 'out'} 327 328GPIO_CONFIG['BMC_CP0_RESET_N'] = \ 329 {'gpio_pin': 'A1', 'direction': 'out'} 330 331# witherspoon: No centaur 332#GPIO_CONFIG['BMC_CFAM_RESET_N_R'] = \ 333# {'gpio_pin': 'J2', 'direction': 'out'} 334 335 336# FIXME: reset pcie switch, looks like BMC_VS1_PERST_N , see workbook fig.46 337#GPIO_CONFIG['PEX8718_DEVICES_RESET_N'] = \ 338# {'gpio_pin': 'B7', 'direction': 'out'} 339GPIO_CONFIG['BMC_VS1_PERST_N'] = \ 340 {'gpio_pin': 'B7', 'direction': 'out'} 341 342# FIXME: reset pcie slots, looks like BMC_CP0_PERST_ENABLE_R, see workbook fig.46 343# firestone: gpiog1, gpiog2 344#GPIO_CONFIG['CP0_DEVICES_RESET_N'] = \ 345# {'gpio_pin': 'B1', 'direction': 'out'} 346# FIXME: G2 for Firestone.. Witherspoon: no 347#GPIO_CONFIG['CP1_DEVICES_RESET_N'] = \ 348# {'gpio_pin': 'A1', 'direction': 'out'} 349GPIO_CONFIG['BMC_CP0_PERST_ENABLE_R'] = \ 350 {'gpio_pin': 'A3', 'direction': 'out'} 351 352#FIXME: witherspoon: SOFT_FSI_CLK: AA0, SOFT_FSI_DAT: E0, see workbook fig.44 353GPIO_CONFIG['FSI_DATA'] = \ 354 {'gpio_pin': 'E0', 'direction': 'out'} 355GPIO_CONFIG['FSI_CLK'] = \ 356 {'gpio_pin': 'AA0', 'direction': 'out'} 357GPIO_CONFIG['FSI_ENABLE'] = \ 358 {'gpio_pin': 'D0', 'direction': 'out'} 359 360# FIXME: both witherspoon and garrison, gpioa6 is FSI_JMFG0_PRSNT_N 361GPIO_CONFIG['CRONUS_SEL'] = \ 362 {'gpio_pin': 'A6', 'direction': 'out'} 363 364# FIXME: ?? firestone gpioj3 is NC 365#GPIO_CONFIG['BMC_THROTTLE'] = \ 366# {'gpio_pin': 'J3', 'direction': 'out'} 367 368#FIXME: ?? witherspoon: FP_ID_BTN_N_R, firestone: PD_BMC_IDBTN_IN_OUT_N - it is not connected 369GPIO_CONFIG['IDBTN'] = \ 370 { 'gpio_pin': 'Q7', 'direction': 'out' } 371 372#FIXME: witherspoon: FP_PWR_BTN_N, firstone: NC_BMC_PWBTN_IN_N gpioe0 - not connected 373GPIO_CONFIG['POWER_BUTTON'] = \ 374 {'gpio_pin': 'I3', 'direction': 'both'} 375# witherspoon: BMC_NMIBTN_IN_N, firestone: BMC_NMIBTN_IN_N 376GPIO_CONFIG['RESET_BUTTON'] = \ 377 {'gpio_pin': 'J1', 'direction': 'both'} 378 379GPIO_CONFIG['PS0_PRES_N'] = \ 380 {'gpio_pin': 'P7', 'direction': 'in'} 381GPIO_CONFIG['PS1_PRES_N'] = \ 382 {'gpio_pin': 'N0', 'direction': 'in'} 383# witherspoon: CARD_PRES_N 384GPIO_CONFIG['CARD_PRES_N'] = \ 385 {'gpio_pin': 'I0', 'direction': 'in'} 386 387def convertGpio(name): 388 name = name.upper() 389 c = name[0:1] 390 offset = int(name[1:]) 391 a = ord(c)-65 392 base = a*8+GPIO_BASE 393 return base+offset 394 395 396HWMON_CONFIG = { 397 '4-0050' : { 398 'names' : { 399 'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 400 'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 401 'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 402 'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 403 'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 404 'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 405 }, 406 'labels' : { 407 '176' : { 'object_path' : 'temperature/cpu0/core0','poll_interval' : 5000,'scale' : -3,'units' : 'C', 408 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 409 '177' : { 'object_path' : 'temperature/cpu0/core1','poll_interval' : 5000,'scale' : -3,'units' : 'C', 410 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 411 '178' : { 'object_path' : 'temperature/cpu0/core2','poll_interval' : 5000,'scale' : -3,'units' : 'C', 412 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 413 '179' : { 'object_path' : 'temperature/cpu0/core3','poll_interval' : 5000,'scale' : -3,'units' : 'C', 414 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 415 '180' : { 'object_path' : 'temperature/cpu0/core4','poll_interval' : 5000,'scale' : -3,'units' : 'C', 416 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 417 '181' : { 'object_path' : 'temperature/cpu0/core5','poll_interval' : 5000,'scale' : -3,'units' : 'C', 418 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 419 '182' : { 'object_path' : 'temperature/cpu0/core6','poll_interval' : 5000,'scale' : -3,'units' : 'C', 420 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 421 '183' : { 'object_path' : 'temperature/cpu0/core7','poll_interval' : 5000,'scale' : -3,'units' : 'C', 422 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 423 '184' : { 'object_path' : 'temperature/cpu0/core8','poll_interval' : 5000,'scale' : -3,'units' : 'C', 424 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 425 '185' : { 'object_path' : 'temperature/cpu0/core9','poll_interval' : 5000,'scale' : -3,'units' : 'C', 426 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 427 '186' : { 'object_path' : 'temperature/cpu0/core10','poll_interval' : 5000,'scale' : -3,'units' : 'C', 428 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 429 '187' : { 'object_path' : 'temperature/cpu0/core11','poll_interval' : 5000,'scale' : -3,'units' : 'C', 430 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 431 '102' : { 'object_path' : 'temperature/dimm0','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 432 '103' : { 'object_path' : 'temperature/dimm1','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 433 '104' : { 'object_path' : 'temperature/dimm2','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 434 '105' : { 'object_path' : 'temperature/dimm3','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 435 '106' : { 'object_path' : 'temperature/dimm4','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 436 '107' : { 'object_path' : 'temperature/dimm5','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 437 '108' : { 'object_path' : 'temperature/dimm6','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 438 '109' : { 'object_path' : 'temperature/dimm7','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 439 '110' : { 'object_path' : 'temperature/dimm8','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 440 '111' : { 'object_path' : 'temperature/dimm9','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 441 '112' : { 'object_path' : 'temperature/dimm10','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 442 '113' : { 'object_path' : 'temperature/dimm11','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 443 '114' : { 'object_path' : 'temperature/dimm12','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 444 '115' : { 'object_path' : 'temperature/dimm13','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 445 '116' : { 'object_path' : 'temperature/dimm14','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 446 '117' : { 'object_path' : 'temperature/dimm15','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 447 '94' : { 'object_path' : 'temperature/membuf0','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 448 '95' : { 'object_path' : 'temperature/membuf1','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 449 '96' : { 'object_path' : 'temperature/membuf2','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 450 '97' : { 'object_path' : 'temperature/membuf3','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 451 } 452 }, 453 '5-0050' : { 454 'labels' : { 455 '188' : { 'object_path' : 'temperature/cpu1/core0','poll_interval' : 5000,'scale' : -3,'units' : 'C', 456 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 457 '189' : { 'object_path' : 'temperature/cpu1/core1','poll_interval' : 5000,'scale' : -3,'units' : 'C', 458 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 459 '190' : { 'object_path' : 'temperature/cpu1/core2','poll_interval' : 5000,'scale' : -3,'units' : 'C', 460 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 461 '191' : { 'object_path' : 'temperature/cpu1/core3','poll_interval' : 5000,'scale' : -3,'units' : 'C', 462 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 463 '192' : { 'object_path' : 'temperature/cpu1/core4','poll_interval' : 5000,'scale' : -3,'units' : 'C', 464 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 465 '193' : { 'object_path' : 'temperature/cpu1/core5','poll_interval' : 5000,'scale' : -3,'units' : 'C', 466 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 467 '194' : { 'object_path' : 'temperature/cpu1/core6','poll_interval' : 5000,'scale' : -3,'units' : 'C', 468 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 469 '195' : { 'object_path' : 'temperature/cpu1/core7','poll_interval' : 5000,'scale' : -3,'units' : 'C', 470 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 471 '196' : { 'object_path' : 'temperature/cpu1/core8','poll_interval' : 5000,'scale' : -3,'units' : 'C', 472 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 473 '197' : { 'object_path' : 'temperature/cpu1/core9','poll_interval' : 5000,'scale' : -3,'units' : 'C', 474 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 475 '198' : { 'object_path' : 'temperature/cpu1/core10','poll_interval' : 5000,'scale' : -3,'units' : 'C', 476 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 477 '199' : { 'object_path' : 'temperature/cpu1/core11','poll_interval' : 5000,'scale' : -3,'units' : 'C', 478 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 479 '118' : { 'object_path' : 'temperature/dimm16','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 480 '119' : { 'object_path' : 'temperature/dimm17','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 481 '120' : { 'object_path' : 'temperature/dimm18','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 482 '121' : { 'object_path' : 'temperature/dimm19','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 483 '122' : { 'object_path' : 'temperature/dimm20','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 484 '123' : { 'object_path' : 'temperature/dimm21','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 485 '124' : { 'object_path' : 'temperature/dimm22','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 486 '125' : { 'object_path' : 'temperature/dimm23','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 487 '126' : { 'object_path' : 'temperature/dimm24','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 488 '127' : { 'object_path' : 'temperature/dimm25','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 489 '128' : { 'object_path' : 'temperature/dimm26','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 490 '129' : { 'object_path' : 'temperature/dimm27','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 491 '130' : { 'object_path' : 'temperature/dimm28','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 492 '131' : { 'object_path' : 'temperature/dimm29','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 493 '132' : { 'object_path' : 'temperature/dimm30','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 494 '133' : { 'object_path' : 'temperature/dimm31','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 495 '98' : { 'object_path' : 'temperature/membuf4','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 496 '99' : { 'object_path' : 'temperature/membuf5','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 497 '100' : { 'object_path' : 'temperature/membuf6','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 498 '101' : { 'object_path' : 'temperature/membuf7','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 499 } 500 }, 501} 502 503# Miscellaneous non-poll sensor with system specific properties. 504# The sensor id is the same as those defined in ID_LOOKUP['SENSOR']. 505MISC_SENSORS = { 506 0x5f : { 'class' : 'BootCountSensor' }, 507 0x05 : { 'class' : 'BootProgressSensor' }, 508 0x08 : { 'class' : 'OccStatusSensor', 509 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' }, 510 0x09 : { 'class' : 'OccStatusSensor', 511 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0051/online' }, 512 0xb5 : { 'class' : 'OperatingSystemStatusSensor' }, 513 0xb3 : { 'class' : 'PowerCap', 514 'os_path' : '/sys/class/hwmon/hwmon3/user_powercap' }, 515} 516