1*40a360c2SBrad Bishop#! /usr/bin/python 2*40a360c2SBrad Bishop 3*40a360c2SBrad BishopHOME_PATH = './' 4*40a360c2SBrad BishopCACHE_PATH = '/var/cache/obmc/' 5*40a360c2SBrad BishopFLASH_DOWNLOAD_PATH = "/tmp" 6*40a360c2SBrad BishopGPIO_BASE = 320 7*40a360c2SBrad BishopSYSTEM_NAME = "Garrison" 8*40a360c2SBrad Bishop 9*40a360c2SBrad Bishop 10*40a360c2SBrad Bishop## System states 11*40a360c2SBrad Bishop## state can change to next state in 2 ways: 12*40a360c2SBrad Bishop## - a process emits a GotoSystemState signal with state name to goto 13*40a360c2SBrad Bishop## - objects specified in EXIT_STATE_DEPEND have started 14*40a360c2SBrad BishopSYSTEM_STATES = [ 15*40a360c2SBrad Bishop 'BASE_APPS', 16*40a360c2SBrad Bishop 'BMC_STARTING', 17*40a360c2SBrad Bishop 'BMC_READY', 18*40a360c2SBrad Bishop 'HOST_POWERING_ON', 19*40a360c2SBrad Bishop 'HOST_POWERED_ON', 20*40a360c2SBrad Bishop 'HOST_BOOTING', 21*40a360c2SBrad Bishop 'HOST_BOOTED', 22*40a360c2SBrad Bishop 'HOST_POWERED_OFF', 23*40a360c2SBrad Bishop] 24*40a360c2SBrad Bishop 25*40a360c2SBrad BishopEXIT_STATE_DEPEND = { 26*40a360c2SBrad Bishop 'BASE_APPS' : { 27*40a360c2SBrad Bishop '/org/openbmc/sensors': 0, 28*40a360c2SBrad Bishop }, 29*40a360c2SBrad Bishop 'BMC_STARTING' : { 30*40a360c2SBrad Bishop '/org/openbmc/control/chassis0': 0, 31*40a360c2SBrad Bishop '/org/openbmc/control/power0' : 0, 32*40a360c2SBrad Bishop '/org/openbmc/control/host0' : 0, 33*40a360c2SBrad Bishop '/org/openbmc/control/flash/bios' : 0, 34*40a360c2SBrad Bishop }, 35*40a360c2SBrad Bishop} 36*40a360c2SBrad Bishop 37*40a360c2SBrad Bishop## method will be called when state is entered 38*40a360c2SBrad BishopENTER_STATE_CALLBACK = { 39*40a360c2SBrad Bishop 'HOST_POWERED_ON' : { 40*40a360c2SBrad Bishop 'boot' : { 41*40a360c2SBrad Bishop 'bus_name' : 'org.openbmc.control.Host', 42*40a360c2SBrad Bishop 'obj_name' : '/org/openbmc/control/host0', 43*40a360c2SBrad Bishop 'interface_name' : 'org.openbmc.control.Host', 44*40a360c2SBrad Bishop }, 45*40a360c2SBrad Bishop }, 46*40a360c2SBrad Bishop 'HOST_POWERED_OFF' : { 47*40a360c2SBrad Bishop 'setOff' : { 48*40a360c2SBrad Bishop 'bus_name' : 'org.openbmc.control.led', 49*40a360c2SBrad Bishop 'obj_name' : '/org/openbmc/control/led/identify', 50*40a360c2SBrad Bishop 'interface_name' : 'org.openbmc.Led', 51*40a360c2SBrad Bishop } 52*40a360c2SBrad Bishop }, 53*40a360c2SBrad Bishop 'BMC_READY' : { 54*40a360c2SBrad Bishop 'setOn' : { 55*40a360c2SBrad Bishop 'bus_name' : 'org.openbmc.control.led', 56*40a360c2SBrad Bishop 'obj_name' : '/org/openbmc/control/led/beep', 57*40a360c2SBrad Bishop 'interface_name' : 'org.openbmc.Led', 58*40a360c2SBrad Bishop }, 59*40a360c2SBrad Bishop 'init' : { 60*40a360c2SBrad Bishop 'bus_name' : 'org.openbmc.control.Flash', 61*40a360c2SBrad Bishop 'obj_name' : '/org/openbmc/control/flash/bios', 62*40a360c2SBrad Bishop 'interface_name' : 'org.openbmc.Flash', 63*40a360c2SBrad Bishop } 64*40a360c2SBrad Bishop } 65*40a360c2SBrad Bishop} 66*40a360c2SBrad Bishop 67*40a360c2SBrad BishopAPPS = { 68*40a360c2SBrad Bishop 'startup_hacks' : { 69*40a360c2SBrad Bishop 'system_state' : 'BASE_APPS', 70*40a360c2SBrad Bishop 'start_process' : True, 71*40a360c2SBrad Bishop 'monitor_process' : False, 72*40a360c2SBrad Bishop 'process_name' : 'startup_hacks.sh', 73*40a360c2SBrad Bishop }, 74*40a360c2SBrad Bishop 'inventory' : { 75*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 76*40a360c2SBrad Bishop 'start_process' : True, 77*40a360c2SBrad Bishop 'monitor_process' : True, 78*40a360c2SBrad Bishop 'process_name' : 'inventory_items.py', 79*40a360c2SBrad Bishop 'args' : [ SYSTEM_NAME ] 80*40a360c2SBrad Bishop }, 81*40a360c2SBrad Bishop 'hwmon' : { 82*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 83*40a360c2SBrad Bishop 'start_process' : True, 84*40a360c2SBrad Bishop 'monitor_process' : True, 85*40a360c2SBrad Bishop 'process_name' : 'hwmon.py', 86*40a360c2SBrad Bishop 'args' : [ SYSTEM_NAME ] 87*40a360c2SBrad Bishop }, 88*40a360c2SBrad Bishop 'sensor_manager' : { 89*40a360c2SBrad Bishop 'system_state' : 'BASE_APPS', 90*40a360c2SBrad Bishop 'start_process' : True, 91*40a360c2SBrad Bishop 'monitor_process' : True, 92*40a360c2SBrad Bishop 'process_name' : 'sensor_manager2.py', 93*40a360c2SBrad Bishop 'args' : [ SYSTEM_NAME ] 94*40a360c2SBrad Bishop }, 95*40a360c2SBrad Bishop 'host_watchdog' : { 96*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 97*40a360c2SBrad Bishop 'start_process' : True, 98*40a360c2SBrad Bishop 'monitor_process' : True, 99*40a360c2SBrad Bishop 'process_name' : 'host_watchdog.exe', 100*40a360c2SBrad Bishop }, 101*40a360c2SBrad Bishop 'power_control' : { 102*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 103*40a360c2SBrad Bishop 'start_process' : True, 104*40a360c2SBrad Bishop 'monitor_process' : True, 105*40a360c2SBrad Bishop 'process_name' : 'power_control.exe', 106*40a360c2SBrad Bishop 'args' : [ '3000', '10' ] 107*40a360c2SBrad Bishop }, 108*40a360c2SBrad Bishop 'power_button' : { 109*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 110*40a360c2SBrad Bishop 'start_process' : True, 111*40a360c2SBrad Bishop 'monitor_process' : True, 112*40a360c2SBrad Bishop 'process_name' : 'button_power.exe', 113*40a360c2SBrad Bishop }, 114*40a360c2SBrad Bishop 'reset_button' : { 115*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 116*40a360c2SBrad Bishop 'start_process' : True, 117*40a360c2SBrad Bishop 'monitor_process' : True, 118*40a360c2SBrad Bishop 'process_name' : 'button_reset.exe', 119*40a360c2SBrad Bishop }, 120*40a360c2SBrad Bishop 'led_control' : { 121*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 122*40a360c2SBrad Bishop 'start_process' : True, 123*40a360c2SBrad Bishop 'monitor_process' : True, 124*40a360c2SBrad Bishop 'process_name' : 'led_controller.exe', 125*40a360c2SBrad Bishop }, 126*40a360c2SBrad Bishop 'flash_control' : { 127*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 128*40a360c2SBrad Bishop 'start_process' : True, 129*40a360c2SBrad Bishop 'monitor_process' : True, 130*40a360c2SBrad Bishop 'process_name' : 'flash_bios.exe', 131*40a360c2SBrad Bishop }, 132*40a360c2SBrad Bishop 'bmc_flash_control' : { 133*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 134*40a360c2SBrad Bishop 'start_process' : True, 135*40a360c2SBrad Bishop 'monitor_process' : True, 136*40a360c2SBrad Bishop 'process_name' : 'bmc_update.py', 137*40a360c2SBrad Bishop }, 138*40a360c2SBrad Bishop 'download_manager' : { 139*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 140*40a360c2SBrad Bishop 'start_process' : True, 141*40a360c2SBrad Bishop 'monitor_process' : True, 142*40a360c2SBrad Bishop 'process_name' : 'download_manager.py', 143*40a360c2SBrad Bishop 'args' : [ SYSTEM_NAME ] 144*40a360c2SBrad Bishop }, 145*40a360c2SBrad Bishop 'host_control' : { 146*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 147*40a360c2SBrad Bishop 'start_process' : True, 148*40a360c2SBrad Bishop 'monitor_process' : True, 149*40a360c2SBrad Bishop 'process_name' : 'control_host.exe', 150*40a360c2SBrad Bishop }, 151*40a360c2SBrad Bishop 'chassis_control' : { 152*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 153*40a360c2SBrad Bishop 'start_process' : True, 154*40a360c2SBrad Bishop 'monitor_process' : True, 155*40a360c2SBrad Bishop 'process_name' : 'chassis_control.py', 156*40a360c2SBrad Bishop }, 157*40a360c2SBrad Bishop 'restore' : { 158*40a360c2SBrad Bishop 'system_state' : 'BMC_READY', 159*40a360c2SBrad Bishop 'start_process' : True, 160*40a360c2SBrad Bishop 'monitor_process' : False, 161*40a360c2SBrad Bishop 'process_name' : 'discover_system_state.py', 162*40a360c2SBrad Bishop }, 163*40a360c2SBrad Bishop 'bmc_control' : { 164*40a360c2SBrad Bishop 'system_state' : 'BMC_STARTING', 165*40a360c2SBrad Bishop 'start_process' : True, 166*40a360c2SBrad Bishop 'monitor_process' : True, 167*40a360c2SBrad Bishop 'process_name' : 'control_bmc.exe', 168*40a360c2SBrad Bishop }, 169*40a360c2SBrad Bishop} 170*40a360c2SBrad Bishop 171*40a360c2SBrad BishopCACHED_INTERFACES = { 172*40a360c2SBrad Bishop "org.openbmc.InventoryItem" : True, 173*40a360c2SBrad Bishop "org.openbmc.control.Chassis" : True, 174*40a360c2SBrad Bishop} 175*40a360c2SBrad Bishop 176*40a360c2SBrad BishopINVENTORY_ROOT = '/org/openbmc/inventory' 177*40a360c2SBrad Bishop 178*40a360c2SBrad BishopFRU_INSTANCES = { 179*40a360c2SBrad Bishop '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" }, 180*40a360c2SBrad Bishop '<inventory_root>/system/bios' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" }, 181*40a360c2SBrad Bishop '<inventory_root>/system/misc' : { 'fru_type' : 'SYSTEM','is_fru' : False, }, 182*40a360c2SBrad Bishop 183*40a360c2SBrad Bishop '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, 'present' : "True" }, 184*40a360c2SBrad Bishop 185*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, }, 186*40a360c2SBrad Bishop 187*40a360c2SBrad Bishop '<inventory_root>/system/systemevent' : { 'fru_type' : 'SYSTEM_EVENT', 'is_fru' : False, }, 188*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/refclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 189*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/pcieclock': { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 190*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/todclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 191*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/apss' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, }, 192*40a360c2SBrad Bishop 193*40a360c2SBrad Bishop '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, }, 194*40a360c2SBrad Bishop '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, }, 195*40a360c2SBrad Bishop '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, }, 196*40a360c2SBrad Bishop '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, }, 197*40a360c2SBrad Bishop 198*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False, 'manufacturer' : 'ASPEED' }, 199*40a360c2SBrad Bishop 200*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, }, 201*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1' : { 'fru_type' : 'CPU', 'is_fru' : True, }, 202*40a360c2SBrad Bishop 203*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 204*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 205*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 206*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 207*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 208*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 209*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 210*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 211*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 212*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 213*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core10': { 'fru_type' : 'CORE', 'is_fru' : False, }, 214*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu0/core11': { 'fru_type' : 'CORE', 'is_fru' : False, }, 215*40a360c2SBrad Bishop 216*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 217*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 218*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 219*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 220*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 221*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 222*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 223*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 224*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 225*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 226*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 227*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/cpu1/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, }, 228*40a360c2SBrad Bishop 229*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 230*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf1' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 231*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf2' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 232*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf3' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 233*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf4' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 234*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf5' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 235*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf6' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 236*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/membuf7' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, }, 237*40a360c2SBrad Bishop 238*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 239*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 240*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 241*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 242*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm4' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 243*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm5' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 244*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm6' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 245*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm7' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 246*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm8' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 247*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm9' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 248*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm10' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 249*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm11' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 250*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm12' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 251*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm13' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 252*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm14' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 253*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm15' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 254*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm16' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 255*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm17' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 256*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm18' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 257*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm19' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 258*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm20' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 259*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm21' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 260*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm22' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 261*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm23' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 262*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm24' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 263*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm25' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 264*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm26' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 265*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm27' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 266*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm28' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 267*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm29' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 268*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm30' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 269*40a360c2SBrad Bishop '<inventory_root>/system/chassis/motherboard/dimm31' : { 'fru_type' : 'DIMM', 'is_fru' : True,}, 270*40a360c2SBrad Bishop} 271*40a360c2SBrad Bishop 272*40a360c2SBrad BishopID_LOOKUP = { 273*40a360c2SBrad Bishop 'FRU' : { 274*40a360c2SBrad Bishop 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0', 275*40a360c2SBrad Bishop 0x02 : '<inventory_root>/system/chassis/motherboard/cpu1', 276*40a360c2SBrad Bishop 0x03 : '<inventory_root>/system/chassis/motherboard', 277*40a360c2SBrad Bishop 0x04 : '<inventory_root>/system/chassis/motherboard/membuf0', 278*40a360c2SBrad Bishop 0x05 : '<inventory_root>/system/chassis/motherboard/membuf1', 279*40a360c2SBrad Bishop 0x06 : '<inventory_root>/system/chassis/motherboard/membuf2', 280*40a360c2SBrad Bishop 0x07 : '<inventory_root>/system/chassis/motherboard/membuf3', 281*40a360c2SBrad Bishop 0x08 : '<inventory_root>/system/chassis/motherboard/membuf4', 282*40a360c2SBrad Bishop 0x09 : '<inventory_root>/system/chassis/motherboard/membuf5', 283*40a360c2SBrad Bishop 0x0c : '<inventory_root>/system/chassis/motherboard/dimm0', 284*40a360c2SBrad Bishop 0x0d : '<inventory_root>/system/chassis/motherboard/dimm1', 285*40a360c2SBrad Bishop 0x0e : '<inventory_root>/system/chassis/motherboard/dimm2', 286*40a360c2SBrad Bishop 0x0f : '<inventory_root>/system/chassis/motherboard/dimm3', 287*40a360c2SBrad Bishop 0x10 : '<inventory_root>/system/chassis/motherboard/dimm4', 288*40a360c2SBrad Bishop 0x11 : '<inventory_root>/system/chassis/motherboard/dimm5', 289*40a360c2SBrad Bishop 0x12 : '<inventory_root>/system/chassis/motherboard/dimm6', 290*40a360c2SBrad Bishop 0x13 : '<inventory_root>/system/chassis/motherboard/dimm7', 291*40a360c2SBrad Bishop 0x14 : '<inventory_root>/system/chassis/motherboard/dimm8', 292*40a360c2SBrad Bishop 0x15 : '<inventory_root>/system/chassis/motherboard/dimm9', 293*40a360c2SBrad Bishop 0x16 : '<inventory_root>/system/chassis/motherboard/dimm10', 294*40a360c2SBrad Bishop 0x17 : '<inventory_root>/system/chassis/motherboard/dimm11', 295*40a360c2SBrad Bishop 0x18 : '<inventory_root>/system/chassis/motherboard/dimm12', 296*40a360c2SBrad Bishop 0x19 : '<inventory_root>/system/chassis/motherboard/dimm13', 297*40a360c2SBrad Bishop 0x1a : '<inventory_root>/system/chassis/motherboard/dimm14', 298*40a360c2SBrad Bishop 0x1b : '<inventory_root>/system/chassis/motherboard/dimm15', 299*40a360c2SBrad Bishop 0x1c : '<inventory_root>/system/chassis/motherboard/dimm16', 300*40a360c2SBrad Bishop 0x1d : '<inventory_root>/system/chassis/motherboard/dimm17', 301*40a360c2SBrad Bishop 0x1e : '<inventory_root>/system/chassis/motherboard/dimm18', 302*40a360c2SBrad Bishop 0x1f : '<inventory_root>/system/chassis/motherboard/dimm19', 303*40a360c2SBrad Bishop 0x20 : '<inventory_root>/system/chassis/motherboard/dimm20', 304*40a360c2SBrad Bishop 0x21 : '<inventory_root>/system/chassis/motherboard/dimm21', 305*40a360c2SBrad Bishop 0x22 : '<inventory_root>/system/chassis/motherboard/dimm22', 306*40a360c2SBrad Bishop 0x23 : '<inventory_root>/system/chassis/motherboard/dimm23', 307*40a360c2SBrad Bishop 0x24 : '<inventory_root>/system/chassis/motherboard/dimm24', 308*40a360c2SBrad Bishop 0x25 : '<inventory_root>/system/chassis/motherboard/dimm25', 309*40a360c2SBrad Bishop 0x26 : '<inventory_root>/system/chassis/motherboard/dimm26', 310*40a360c2SBrad Bishop 0x27 : '<inventory_root>/system/chassis/motherboard/dimm27', 311*40a360c2SBrad Bishop 0x28 : '<inventory_root>/system/chassis/motherboard/dimm28', 312*40a360c2SBrad Bishop 0x29 : '<inventory_root>/system/chassis/motherboard/dimm29', 313*40a360c2SBrad Bishop 0x2a : '<inventory_root>/system/chassis/motherboard/dimm30', 314*40a360c2SBrad Bishop 0x2b : '<inventory_root>/system/chassis/motherboard/dimm31', 315*40a360c2SBrad Bishop }, 316*40a360c2SBrad Bishop 'FRU_STR' : { 317*40a360c2SBrad Bishop 'PRODUCT_0' : '<inventory_root>/system/bios', 318*40a360c2SBrad Bishop 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0', 319*40a360c2SBrad Bishop 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/cpu1', 320*40a360c2SBrad Bishop 'CHASSIS_3' : '<inventory_root>/system/chassis/motherboard', 321*40a360c2SBrad Bishop 'BOARD_3' : '<inventory_root>/system/misc', 322*40a360c2SBrad Bishop 'BOARD_4' : '<inventory_root>/system/chassis/motherboard/membuf0', 323*40a360c2SBrad Bishop 'BOARD_5' : '<inventory_root>/system/chassis/motherboard/membuf1', 324*40a360c2SBrad Bishop 'BOARD_6' : '<inventory_root>/system/chassis/motherboard/membuf2', 325*40a360c2SBrad Bishop 'BOARD_7' : '<inventory_root>/system/chassis/motherboard/membuf3', 326*40a360c2SBrad Bishop 'BOARD_8' : '<inventory_root>/system/chassis/motherboard/membuf4', 327*40a360c2SBrad Bishop 'BOARD_9' : '<inventory_root>/system/chassis/motherboard/membuf5', 328*40a360c2SBrad Bishop 'BOARD_10' : '<inventory_root>/system/chassis/motherboard/membuf6', 329*40a360c2SBrad Bishop 'BOARD_11' : '<inventory_root>/system/chassis/motherboard/membuf7', 330*40a360c2SBrad Bishop 'PRODUCT_12' : '<inventory_root>/system/chassis/motherboard/dimm0', 331*40a360c2SBrad Bishop 'PRODUCT_13' : '<inventory_root>/system/chassis/motherboard/dimm1', 332*40a360c2SBrad Bishop 'PRODUCT_14' : '<inventory_root>/system/chassis/motherboard/dimm2', 333*40a360c2SBrad Bishop 'PRODUCT_15' : '<inventory_root>/system/chassis/motherboard/dimm3', 334*40a360c2SBrad Bishop 'PRODUCT_16' : '<inventory_root>/system/chassis/motherboard/dimm4', 335*40a360c2SBrad Bishop 'PRODUCT_17' : '<inventory_root>/system/chassis/motherboard/dimm5', 336*40a360c2SBrad Bishop 'PRODUCT_18' : '<inventory_root>/system/chassis/motherboard/dimm6', 337*40a360c2SBrad Bishop 'PRODUCT_19' : '<inventory_root>/system/chassis/motherboard/dimm7', 338*40a360c2SBrad Bishop 'PRODUCT_20' : '<inventory_root>/system/chassis/motherboard/dimm8', 339*40a360c2SBrad Bishop 'PRODUCT_21' : '<inventory_root>/system/chassis/motherboard/dimm9', 340*40a360c2SBrad Bishop 'PRODUCT_22' : '<inventory_root>/system/chassis/motherboard/dimm10', 341*40a360c2SBrad Bishop 'PRODUCT_23' : '<inventory_root>/system/chassis/motherboard/dimm11', 342*40a360c2SBrad Bishop 'PRODUCT_24' : '<inventory_root>/system/chassis/motherboard/dimm12', 343*40a360c2SBrad Bishop 'PRODUCT_25' : '<inventory_root>/system/chassis/motherboard/dimm13', 344*40a360c2SBrad Bishop 'PRODUCT_26' : '<inventory_root>/system/chassis/motherboard/dimm14', 345*40a360c2SBrad Bishop 'PRODUCT_27' : '<inventory_root>/system/chassis/motherboard/dimm15', 346*40a360c2SBrad Bishop 'PRODUCT_28' : '<inventory_root>/system/chassis/motherboard/dimm16', 347*40a360c2SBrad Bishop 'PRODUCT_29' : '<inventory_root>/system/chassis/motherboard/dimm17', 348*40a360c2SBrad Bishop 'PRODUCT_30' : '<inventory_root>/system/chassis/motherboard/dimm18', 349*40a360c2SBrad Bishop 'PRODUCT_31' : '<inventory_root>/system/chassis/motherboard/dimm19', 350*40a360c2SBrad Bishop 'PRODUCT_32' : '<inventory_root>/system/chassis/motherboard/dimm20', 351*40a360c2SBrad Bishop 'PRODUCT_33' : '<inventory_root>/system/chassis/motherboard/dimm21', 352*40a360c2SBrad Bishop 'PRODUCT_34' : '<inventory_root>/system/chassis/motherboard/dimm22', 353*40a360c2SBrad Bishop 'PRODUCT_35' : '<inventory_root>/system/chassis/motherboard/dimm23', 354*40a360c2SBrad Bishop 'PRODUCT_36' : '<inventory_root>/system/chassis/motherboard/dimm24', 355*40a360c2SBrad Bishop 'PRODUCT_37' : '<inventory_root>/system/chassis/motherboard/dimm25', 356*40a360c2SBrad Bishop 'PRODUCT_38' : '<inventory_root>/system/chassis/motherboard/dimm26', 357*40a360c2SBrad Bishop 'PRODUCT_39' : '<inventory_root>/system/chassis/motherboard/dimm27', 358*40a360c2SBrad Bishop 'PRODUCT_40' : '<inventory_root>/system/chassis/motherboard/dimm28', 359*40a360c2SBrad Bishop 'PRODUCT_41' : '<inventory_root>/system/chassis/motherboard/dimm29', 360*40a360c2SBrad Bishop 'PRODUCT_42' : '<inventory_root>/system/chassis/motherboard/dimm30', 361*40a360c2SBrad Bishop 'PRODUCT_43' : '<inventory_root>/system/chassis/motherboard/dimm31', 362*40a360c2SBrad Bishop 'PRODUCT_47' : '<inventory_root>/system/misc', 363*40a360c2SBrad Bishop }, 364*40a360c2SBrad Bishop 'SENSOR' : { 365*40a360c2SBrad Bishop 0x04 : '/org/openbmc/sensors/host/HostStatus', 366*40a360c2SBrad Bishop 0x05 : '/org/openbmc/sensors/host/BootProgress', 367*40a360c2SBrad Bishop 0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus', 368*40a360c2SBrad Bishop 0x09 : '/org/openbmc/sensors/host/cpu1/OccStatus', 369*40a360c2SBrad Bishop 0x0c : '<inventory_root>/system/chassis/motherboard/cpu0', 370*40a360c2SBrad Bishop 0x0e : '<inventory_root>/system/chassis/motherboard/cpu1', 371*40a360c2SBrad Bishop 0x1e : '<inventory_root>/system/chassis/motherboard/dimm3', 372*40a360c2SBrad Bishop 0x1f : '<inventory_root>/system/chassis/motherboard/dimm2', 373*40a360c2SBrad Bishop 0x20 : '<inventory_root>/system/chassis/motherboard/dimm1', 374*40a360c2SBrad Bishop 0x21 : '<inventory_root>/system/chassis/motherboard/dimm0', 375*40a360c2SBrad Bishop 0x22 : '<inventory_root>/system/chassis/motherboard/dimm7', 376*40a360c2SBrad Bishop 0x23 : '<inventory_root>/system/chassis/motherboard/dimm6', 377*40a360c2SBrad Bishop 0x24 : '<inventory_root>/system/chassis/motherboard/dimm5', 378*40a360c2SBrad Bishop 0x25 : '<inventory_root>/system/chassis/motherboard/dimm4', 379*40a360c2SBrad Bishop 0x26 : '<inventory_root>/system/chassis/motherboard/dimm11', 380*40a360c2SBrad Bishop 0x27 : '<inventory_root>/system/chassis/motherboard/dimm10', 381*40a360c2SBrad Bishop 0x28 : '<inventory_root>/system/chassis/motherboard/dimm9', 382*40a360c2SBrad Bishop 0x29 : '<inventory_root>/system/chassis/motherboard/dimm8', 383*40a360c2SBrad Bishop 0x2a : '<inventory_root>/system/chassis/motherboard/dimm15', 384*40a360c2SBrad Bishop 0x2b : '<inventory_root>/system/chassis/motherboard/dimm14', 385*40a360c2SBrad Bishop 0x2c : '<inventory_root>/system/chassis/motherboard/dimm13', 386*40a360c2SBrad Bishop 0x2d : '<inventory_root>/system/chassis/motherboard/dimm12', 387*40a360c2SBrad Bishop 0x2e : '<inventory_root>/system/chassis/motherboard/dimm19', 388*40a360c2SBrad Bishop 0x2f : '<inventory_root>/system/chassis/motherboard/dimm18', 389*40a360c2SBrad Bishop 0x30 : '<inventory_root>/system/chassis/motherboard/dimm17', 390*40a360c2SBrad Bishop 0x31 : '<inventory_root>/system/chassis/motherboard/dimm16', 391*40a360c2SBrad Bishop 0x32 : '<inventory_root>/system/chassis/motherboard/dimm23', 392*40a360c2SBrad Bishop 0x33 : '<inventory_root>/system/chassis/motherboard/dimm22', 393*40a360c2SBrad Bishop 0x34 : '<inventory_root>/system/chassis/motherboard/dimm21', 394*40a360c2SBrad Bishop 0x35 : '<inventory_root>/system/chassis/motherboard/dimm20', 395*40a360c2SBrad Bishop 0x36 : '<inventory_root>/system/chassis/motherboard/dimm27', 396*40a360c2SBrad Bishop 0x37 : '<inventory_root>/system/chassis/motherboard/dimm26', 397*40a360c2SBrad Bishop 0x38 : '<inventory_root>/system/chassis/motherboard/dimm25', 398*40a360c2SBrad Bishop 0x39 : '<inventory_root>/system/chassis/motherboard/dimm24', 399*40a360c2SBrad Bishop 0x3a : '<inventory_root>/system/chassis/motherboard/dimm31', 400*40a360c2SBrad Bishop 0x3b : '<inventory_root>/system/chassis/motherboard/dimm30', 401*40a360c2SBrad Bishop 0x3c : '<inventory_root>/system/chassis/motherboard/dimm29', 402*40a360c2SBrad Bishop 0x3d : '<inventory_root>/system/chassis/motherboard/dimm28', 403*40a360c2SBrad Bishop 0x3e : '<inventory_root>/system/chassis/motherboard/cpu0/core0', 404*40a360c2SBrad Bishop 0x3f : '<inventory_root>/system/chassis/motherboard/cpu0/core1', 405*40a360c2SBrad Bishop 0x40 : '<inventory_root>/system/chassis/motherboard/cpu0/core2', 406*40a360c2SBrad Bishop 0x41 : '<inventory_root>/system/chassis/motherboard/cpu0/core3', 407*40a360c2SBrad Bishop 0x42 : '<inventory_root>/system/chassis/motherboard/cpu0/core4', 408*40a360c2SBrad Bishop 0x43 : '<inventory_root>/system/chassis/motherboard/cpu0/core5', 409*40a360c2SBrad Bishop 0x44 : '<inventory_root>/system/chassis/motherboard/cpu0/core6', 410*40a360c2SBrad Bishop 0x45 : '<inventory_root>/system/chassis/motherboard/cpu0/core7', 411*40a360c2SBrad Bishop 0x46 : '<inventory_root>/system/chassis/motherboard/cpu0/core8', 412*40a360c2SBrad Bishop 0x47 : '<inventory_root>/system/chassis/motherboard/cpu0/core9', 413*40a360c2SBrad Bishop 0x48 : '<inventory_root>/system/chassis/motherboard/cpu0/core10', 414*40a360c2SBrad Bishop 0x49 : '<inventory_root>/system/chassis/motherboard/cpu0/core11', 415*40a360c2SBrad Bishop 0x4a : '<inventory_root>/system/chassis/motherboard/cpu1/core0', 416*40a360c2SBrad Bishop 0x4b : '<inventory_root>/system/chassis/motherboard/cpu1/core1', 417*40a360c2SBrad Bishop 0x4c : '<inventory_root>/system/chassis/motherboard/cpu1/core2', 418*40a360c2SBrad Bishop 0x4d : '<inventory_root>/system/chassis/motherboard/cpu1/core3', 419*40a360c2SBrad Bishop 0x4e : '<inventory_root>/system/chassis/motherboard/cpu1/core4', 420*40a360c2SBrad Bishop 0x4f : '<inventory_root>/system/chassis/motherboard/cpu1/core5', 421*40a360c2SBrad Bishop 0x50 : '<inventory_root>/system/chassis/motherboard/cpu1/core6', 422*40a360c2SBrad Bishop 0x51 : '<inventory_root>/system/chassis/motherboard/cpu1/core7', 423*40a360c2SBrad Bishop 0x52 : '<inventory_root>/system/chassis/motherboard/cpu1/core8', 424*40a360c2SBrad Bishop 0x53 : '<inventory_root>/system/chassis/motherboard/cpu1/core9', 425*40a360c2SBrad Bishop 0x54 : '<inventory_root>/system/chassis/motherboard/cpu1/core10', 426*40a360c2SBrad Bishop 0x55 : '<inventory_root>/system/chassis/motherboard/cpu1/core11', 427*40a360c2SBrad Bishop 0x56 : '<inventory_root>/system/chassis/motherboard/membuf0', 428*40a360c2SBrad Bishop 0x57 : '<inventory_root>/system/chassis/motherboard/membuf1', 429*40a360c2SBrad Bishop 0x58 : '<inventory_root>/system/chassis/motherboard/membuf2', 430*40a360c2SBrad Bishop 0x59 : '<inventory_root>/system/chassis/motherboard/membuf3', 431*40a360c2SBrad Bishop 0x5a : '<inventory_root>/system/chassis/motherboard/membuf4', 432*40a360c2SBrad Bishop 0x5b : '<inventory_root>/system/chassis/motherboard/membuf5', 433*40a360c2SBrad Bishop 0x5c : '<inventory_root>/system/chassis/motherboard/membuf6', 434*40a360c2SBrad Bishop 0x5d : '<inventory_root>/system/chassis/motherboard/membuf7', 435*40a360c2SBrad Bishop 0x5f : '/org/openbmc/sensors/host/BootCount', 436*40a360c2SBrad Bishop 0x60 : '<inventory_root>/system/chassis/motherboard', 437*40a360c2SBrad Bishop 0x61 : '<inventory_root>/system/systemevent', 438*40a360c2SBrad Bishop 0x62 : '<inventory_root>/system/powerlimit', 439*40a360c2SBrad Bishop 0x63 : '<inventory_root>/system/chassis/motherboard/refclock', 440*40a360c2SBrad Bishop 0x64 : '<inventory_root>/system/chassis/motherboard/pcieclock', 441*40a360c2SBrad Bishop 0xb1 : '<inventory_root>/system/chassis/motherboard/todclock', 442*40a360c2SBrad Bishop 0xb2 : '<inventory_root>/system/chassis/motherboard/apss', 443*40a360c2SBrad Bishop 0xb3 : '/org/openbmc/sensors/host/powercap', 444*40a360c2SBrad Bishop 0xb5 : '/org/openbmc/sensors/host/OperatingSystemStatus', 445*40a360c2SBrad Bishop 0xb6 : '<inventory_root>/system/chassis/motherboard/pcielink', 446*40a360c2SBrad Bishop }, 447*40a360c2SBrad Bishop 'GPIO_PRESENT' : {} 448*40a360c2SBrad Bishop} 449*40a360c2SBrad Bishop 450*40a360c2SBrad BishopGPIO_CONFIG = {} 451*40a360c2SBrad BishopGPIO_CONFIG['BMC_POWER_UP'] = \ 452*40a360c2SBrad Bishop {'gpio_pin': 'D1', 'direction': 'out'} 453*40a360c2SBrad BishopGPIO_CONFIG['SYS_PWROK_BUFF'] = \ 454*40a360c2SBrad Bishop {'gpio_pin': 'D2', 'direction': 'in'} 455*40a360c2SBrad BishopGPIO_CONFIG['BMC_WD_CLEAR_PULSE_N'] = \ 456*40a360c2SBrad Bishop {'gpio_pin': 'N4', 'direction': 'out'} 457*40a360c2SBrad BishopGPIO_CONFIG['CM1_OE_R_N'] = \ 458*40a360c2SBrad Bishop {'gpio_pin': 'Q6', 'direction': 'out'} 459*40a360c2SBrad BishopGPIO_CONFIG['BMC_CP0_RESET_N'] = \ 460*40a360c2SBrad Bishop {'gpio_pin': 'O2', 'direction': 'out'} 461*40a360c2SBrad BishopGPIO_CONFIG['BMC_CFAM_RESET_N_R'] = \ 462*40a360c2SBrad Bishop {'gpio_pin': 'J2', 'direction': 'out'} 463*40a360c2SBrad BishopGPIO_CONFIG['PEX8718_DEVICES_RESET_N'] = \ 464*40a360c2SBrad Bishop {'gpio_pin': 'B6', 'direction': 'out'} 465*40a360c2SBrad BishopGPIO_CONFIG['CP0_DEVICES_RESET_N'] = \ 466*40a360c2SBrad Bishop {'gpio_pin': 'N3', 'direction': 'out'} 467*40a360c2SBrad BishopGPIO_CONFIG['CP1_DEVICES_RESET_N'] = \ 468*40a360c2SBrad Bishop {'gpio_pin': 'N5', 'direction': 'out'} 469*40a360c2SBrad Bishop 470*40a360c2SBrad BishopGPIO_CONFIG['FSI_DATA'] = \ 471*40a360c2SBrad Bishop {'gpio_pin': 'A5', 'direction': 'out'} 472*40a360c2SBrad BishopGPIO_CONFIG['FSI_CLK'] = \ 473*40a360c2SBrad Bishop {'gpio_pin': 'A4', 'direction': 'out'} 474*40a360c2SBrad BishopGPIO_CONFIG['FSI_ENABLE'] = \ 475*40a360c2SBrad Bishop {'gpio_pin': 'D0', 'direction': 'out'} 476*40a360c2SBrad BishopGPIO_CONFIG['CRONUS_SEL'] = \ 477*40a360c2SBrad Bishop {'gpio_pin': 'A6', 'direction': 'out'} 478*40a360c2SBrad BishopGPIO_CONFIG['BMC_THROTTLE'] = \ 479*40a360c2SBrad Bishop {'gpio_pin': 'J3', 'direction': 'out'} 480*40a360c2SBrad Bishop 481*40a360c2SBrad BishopGPIO_CONFIG['IDBTN'] = \ 482*40a360c2SBrad Bishop { 'gpio_pin': 'Q7', 'direction': 'out' } 483*40a360c2SBrad BishopGPIO_CONFIG['POWER_BUTTON'] = \ 484*40a360c2SBrad Bishop {'gpio_pin': 'E0', 'direction': 'both'} 485*40a360c2SBrad BishopGPIO_CONFIG['RESET_BUTTON'] = \ 486*40a360c2SBrad Bishop {'gpio_pin': 'E4', 'direction': 'both'} 487*40a360c2SBrad Bishop 488*40a360c2SBrad BishopGPIO_CONFIG['PS0_PRES_N'] = \ 489*40a360c2SBrad Bishop {'gpio_pin': 'P7', 'direction': 'in'} 490*40a360c2SBrad BishopGPIO_CONFIG['PS1_PRES_N'] = \ 491*40a360c2SBrad Bishop {'gpio_pin': 'N0', 'direction': 'in'} 492*40a360c2SBrad BishopGPIO_CONFIG['CARD_PRES_N'] = \ 493*40a360c2SBrad Bishop {'gpio_pin': 'J0', 'direction': 'in'} 494*40a360c2SBrad Bishop 495*40a360c2SBrad Bishop 496*40a360c2SBrad Bishop 497*40a360c2SBrad Bishop 498*40a360c2SBrad Bishopdef convertGpio(name): 499*40a360c2SBrad Bishop name = name.upper() 500*40a360c2SBrad Bishop c = name[0:1] 501*40a360c2SBrad Bishop offset = int(name[1:]) 502*40a360c2SBrad Bishop a = ord(c)-65 503*40a360c2SBrad Bishop base = a*8+GPIO_BASE 504*40a360c2SBrad Bishop return base+offset 505*40a360c2SBrad Bishop 506*40a360c2SBrad Bishop 507*40a360c2SBrad BishopHWMON_CONFIG = { 508*40a360c2SBrad Bishop '4-0050' : { 509*40a360c2SBrad Bishop 'names' : { 510*40a360c2SBrad Bishop 'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 511*40a360c2SBrad Bishop 'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 512*40a360c2SBrad Bishop 'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 513*40a360c2SBrad Bishop 'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 514*40a360c2SBrad Bishop 'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 515*40a360c2SBrad Bishop 'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 516*40a360c2SBrad Bishop }, 517*40a360c2SBrad Bishop 'labels' : { 518*40a360c2SBrad Bishop '176' : { 'object_path' : 'temperature/cpu0/core0','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 519*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 520*40a360c2SBrad Bishop '177' : { 'object_path' : 'temperature/cpu0/core1','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 521*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 522*40a360c2SBrad Bishop '178' : { 'object_path' : 'temperature/cpu0/core2','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 523*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 524*40a360c2SBrad Bishop '179' : { 'object_path' : 'temperature/cpu0/core3','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 525*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 526*40a360c2SBrad Bishop '180' : { 'object_path' : 'temperature/cpu0/core4','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 527*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 528*40a360c2SBrad Bishop '181' : { 'object_path' : 'temperature/cpu0/core5','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 529*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 530*40a360c2SBrad Bishop '182' : { 'object_path' : 'temperature/cpu0/core6','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 531*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 532*40a360c2SBrad Bishop '183' : { 'object_path' : 'temperature/cpu0/core7','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 533*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 534*40a360c2SBrad Bishop '184' : { 'object_path' : 'temperature/cpu0/core8','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 535*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 536*40a360c2SBrad Bishop '185' : { 'object_path' : 'temperature/cpu0/core9','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 537*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 538*40a360c2SBrad Bishop '186' : { 'object_path' : 'temperature/cpu0/core10','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 539*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 540*40a360c2SBrad Bishop '187' : { 'object_path' : 'temperature/cpu0/core11','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 541*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 542*40a360c2SBrad Bishop '102' : { 'object_path' : 'temperature/dimm0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 543*40a360c2SBrad Bishop '103' : { 'object_path' : 'temperature/dimm1','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 544*40a360c2SBrad Bishop '104' : { 'object_path' : 'temperature/dimm2','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 545*40a360c2SBrad Bishop '105' : { 'object_path' : 'temperature/dimm3','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 546*40a360c2SBrad Bishop '106' : { 'object_path' : 'temperature/dimm4','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 547*40a360c2SBrad Bishop '107' : { 'object_path' : 'temperature/dimm5','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 548*40a360c2SBrad Bishop '108' : { 'object_path' : 'temperature/dimm6','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 549*40a360c2SBrad Bishop '109' : { 'object_path' : 'temperature/dimm7','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 550*40a360c2SBrad Bishop '110' : { 'object_path' : 'temperature/dimm8','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 551*40a360c2SBrad Bishop '111' : { 'object_path' : 'temperature/dimm9','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 552*40a360c2SBrad Bishop '112' : { 'object_path' : 'temperature/dimm10','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 553*40a360c2SBrad Bishop '113' : { 'object_path' : 'temperature/dimm11','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 554*40a360c2SBrad Bishop '114' : { 'object_path' : 'temperature/dimm12','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 555*40a360c2SBrad Bishop '115' : { 'object_path' : 'temperature/dimm13','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 556*40a360c2SBrad Bishop '116' : { 'object_path' : 'temperature/dimm14','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 557*40a360c2SBrad Bishop '117' : { 'object_path' : 'temperature/dimm15','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 558*40a360c2SBrad Bishop '94' : { 'object_path' : 'temperature/membuf0','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 559*40a360c2SBrad Bishop '95' : { 'object_path' : 'temperature/membuf1','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 560*40a360c2SBrad Bishop '96' : { 'object_path' : 'temperature/membuf2','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 561*40a360c2SBrad Bishop '97' : { 'object_path' : 'temperature/membuf3','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 562*40a360c2SBrad Bishop } 563*40a360c2SBrad Bishop }, 564*40a360c2SBrad Bishop '5-0050' : { 565*40a360c2SBrad Bishop 'labels' : { 566*40a360c2SBrad Bishop '188' : { 'object_path' : 'temperature/cpu1/core0','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 567*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 568*40a360c2SBrad Bishop '189' : { 'object_path' : 'temperature/cpu1/core1','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 569*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 570*40a360c2SBrad Bishop '190' : { 'object_path' : 'temperature/cpu1/core2','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 571*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 572*40a360c2SBrad Bishop '191' : { 'object_path' : 'temperature/cpu1/core3','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 573*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 574*40a360c2SBrad Bishop '192' : { 'object_path' : 'temperature/cpu1/core4','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 575*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 576*40a360c2SBrad Bishop '193' : { 'object_path' : 'temperature/cpu1/core5','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 577*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 578*40a360c2SBrad Bishop '194' : { 'object_path' : 'temperature/cpu1/core6','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 579*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 580*40a360c2SBrad Bishop '195' : { 'object_path' : 'temperature/cpu1/core7','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 581*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 582*40a360c2SBrad Bishop '196' : { 'object_path' : 'temperature/cpu1/core8','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 583*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 584*40a360c2SBrad Bishop '197' : { 'object_path' : 'temperature/cpu1/core9','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 585*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 586*40a360c2SBrad Bishop '198' : { 'object_path' : 'temperature/cpu1/core10','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 587*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 588*40a360c2SBrad Bishop '199' : { 'object_path' : 'temperature/cpu1/core11','poll_interval' : 5000,'scale' : 1000,'units' : 'C', 589*40a360c2SBrad Bishop 'critical_upper' : 100, 'critical_lower' : -100, 'warning_upper' : 90, 'warning_lower' : -99, 'emergency_enabled' : True }, 590*40a360c2SBrad Bishop '118' : { 'object_path' : 'temperature/dimm16','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 591*40a360c2SBrad Bishop '119' : { 'object_path' : 'temperature/dimm17','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 592*40a360c2SBrad Bishop '120' : { 'object_path' : 'temperature/dimm18','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 593*40a360c2SBrad Bishop '121' : { 'object_path' : 'temperature/dimm19','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 594*40a360c2SBrad Bishop '122' : { 'object_path' : 'temperature/dimm20','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 595*40a360c2SBrad Bishop '123' : { 'object_path' : 'temperature/dimm21','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 596*40a360c2SBrad Bishop '124' : { 'object_path' : 'temperature/dimm22','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 597*40a360c2SBrad Bishop '125' : { 'object_path' : 'temperature/dimm23','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 598*40a360c2SBrad Bishop '126' : { 'object_path' : 'temperature/dimm24','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 599*40a360c2SBrad Bishop '127' : { 'object_path' : 'temperature/dimm25','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 600*40a360c2SBrad Bishop '128' : { 'object_path' : 'temperature/dimm26','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 601*40a360c2SBrad Bishop '129' : { 'object_path' : 'temperature/dimm27','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 602*40a360c2SBrad Bishop '130' : { 'object_path' : 'temperature/dimm28','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 603*40a360c2SBrad Bishop '131' : { 'object_path' : 'temperature/dimm29','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 604*40a360c2SBrad Bishop '132' : { 'object_path' : 'temperature/dimm30','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 605*40a360c2SBrad Bishop '133' : { 'object_path' : 'temperature/dimm31','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 606*40a360c2SBrad Bishop '98' : { 'object_path' : 'temperature/membuf4','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 607*40a360c2SBrad Bishop '99' : { 'object_path' : 'temperature/membuf5','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 608*40a360c2SBrad Bishop '100' : { 'object_path' : 'temperature/membuf6','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 609*40a360c2SBrad Bishop '101' : { 'object_path' : 'temperature/membuf7','poll_interval' : 5000,'scale' : 1000,'units' : 'C' }, 610*40a360c2SBrad Bishop } 611*40a360c2SBrad Bishop }, 612*40a360c2SBrad Bishop} 613*40a360c2SBrad Bishop 614*40a360c2SBrad Bishop# Miscellaneous non-poll sensor with system specific properties. 615*40a360c2SBrad Bishop# The sensor id is the same as those defined in ID_LOOKUP['SENSOR']. 616*40a360c2SBrad BishopMISC_SENSORS = { 617*40a360c2SBrad Bishop 0x5f : { 'class' : 'BootCountSensor' }, 618*40a360c2SBrad Bishop 0x05 : { 'class' : 'BootProgressSensor' }, 619*40a360c2SBrad Bishop 0x08 : { 'class' : 'OccStatusSensor', 620*40a360c2SBrad Bishop 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' }, 621*40a360c2SBrad Bishop 0x09 : { 'class' : 'OccStatusSensor', 622*40a360c2SBrad Bishop 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0051/online' }, 623*40a360c2SBrad Bishop 0xb5 : { 'class' : 'OperatingSystemStatusSensor' }, 624*40a360c2SBrad Bishop 0xb3 : { 'class' : 'PowerCap', 625*40a360c2SBrad Bishop 'os_path' : '/sys/class/hwmon/hwmon3/user_powercap' }, 626*40a360c2SBrad Bishop} 627