1GPIO_BASE = 320 2 3 4## System states 5## state can change to next state in 2 ways: 6## - a process emits a GotoSystemState signal with state name to goto 7## - objects specified in EXIT_STATE_DEPEND have started 8SYSTEM_STATES = [ 9 'BASE_APPS', 10 'BMC_STARTING', 11 'BMC_READY', 12 'HOST_POWERING_ON', 13 'HOST_POWERED_ON', 14 'HOST_BOOTING', 15 'HOST_BOOTED', 16 'HOST_POWERED_OFF', 17] 18 19EXIT_STATE_DEPEND = { 20 'BASE_APPS' : { 21 '/org/openbmc/sensors': 0, 22 }, 23 'BMC_STARTING' : { 24 '/org/openbmc/control/chassis0': 0, 25 '/org/openbmc/control/power0' : 0, 26 '/org/openbmc/control/led/identify' : 0, 27 '/org/openbmc/control/host0' : 0, 28 '/org/openbmc/control/flash/bios' : 0, 29 } 30} 31 32ID_LOOKUP = { 33 'FRU' : { 34 0x0d : '<inventory_root>/system/chassis', 35 0x34 : '<inventory_root>/system/chassis/motherboard', 36 0x01 : '<inventory_root>/system/chassis/motherboard/cpu', 37 0x02 : '<inventory_root>/system/chassis/motherboard/membuf', 38 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0', 39 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1', 40 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2', 41 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3', 42 0x35 : '<inventory_root>/system', 43 }, 44 'FRU_STR' : { 45 'PRODUCT_15' : '<inventory_root>/system', 46 'CHASSIS_2' : '<inventory_root>/system/chassis', 47 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu', 48 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/membuf', 49 'BOARD_14' : '<inventory_root>/system/chassis/motherboard', 50 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0', 51 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1', 52 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2', 53 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3', 54 }, 55 'SENSOR' : { 56 0x34 : '<inventory_root>/system/chassis/motherboard', 57 0x37 : '<inventory_root>/system/chassis/motherboard/refclock', 58 0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock', 59 0x39 : '<inventory_root>/system/chassis/motherboard/todclock', 60 0x3A : '<inventory_root>/system/chassis/apss', 61 0x2f : '<inventory_root>/system/chassis/motherboard/cpu', 62 0x22 : '<inventory_root>/system/chassis/motherboard/cpu/core1', 63 0x23 : '<inventory_root>/system/chassis/motherboard/cpu/core2', 64 0x24 : '<inventory_root>/system/chassis/motherboard/cpu/core3', 65 0x25 : '<inventory_root>/system/chassis/motherboard/cpu/core4', 66 0x26 : '<inventory_root>/system/chassis/motherboard/cpu/core5', 67 0x27 : '<inventory_root>/system/chassis/motherboard/cpu/core6', 68 0x28 : '<inventory_root>/system/chassis/motherboard/cpu/core9', 69 0x29 : '<inventory_root>/system/chassis/motherboard/cpu/core10', 70 0x2a : '<inventory_root>/system/chassis/motherboard/cpu/core11', 71 0x2b : '<inventory_root>/system/chassis/motherboard/cpu/core12', 72 0x2c : '<inventory_root>/system/chassis/motherboard/cpu/core13', 73 0x2d : '<inventory_root>/system/chassis/motherboard/cpu/core14', 74 0x2e : '<inventory_root>/system/chassis/motherboard/membuf', 75 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0', 76 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1', 77 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2', 78 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3', 79 0x09 : '/org/openbmc/sensors/host/BootCount', 80 0x05 : '/org/openbmc/sensors/host/BootProgress', 81 0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus', 82 0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus', 83 0x33 : '/org/openbmc/sensors/host/PowerCap', 84 }, 85 'GPIO_PRESENT' : { 86 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x16', 87 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x8', 88 } 89} 90 91GPIO_CONFIG = {} 92GPIO_CONFIG['FSI_CLK'] = { 'gpio_pin': 'A4', 'direction': 'out' } 93GPIO_CONFIG['FSI_DATA'] = { 'gpio_pin': 'A5', 'direction': 'out' } 94GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_pin': 'D0', 'direction': 'out' } 95GPIO_CONFIG['POWER_PIN'] = { 'gpio_pin': 'E1', 'direction': 'out' } 96GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_pin': 'A6', 'direction': 'out' } 97GPIO_CONFIG['PGOOD'] = { 'gpio_pin': 'C7', 'direction': 'in' } 98GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' } 99GPIO_CONFIG['IDBTN'] = { 'gpio_pin': 'Q7', 'direction': 'out' } 100GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' } 101GPIO_CONFIG['PCIE_RESET'] = { 'gpio_pin': 'B5', 'direction': 'out' } 102GPIO_CONFIG['USB_RESET'] = { 'gpio_pin': 'B6', 'direction': 'out' } 103GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_pin': 'N0', 'direction': 'in' } 104GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_pin': 'N1', 'direction': 'in' } 105GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_pin': 'N2', 'direction': 'in' } 106GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_pin': 'N3', 'direction': 'in' } 107GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_pin': 'N4', 'direction': 'in' } 108GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_pin': 'N5', 'direction': 'in' } 109GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_pin': 'O0', 'direction': 'in' } 110GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_pin': 'O1', 'direction': 'in' } 111GPIO_CONFIG['CHECKSTOP'] = { 'gpio_pin': 'P5', 'direction': 'falling' } 112 113def convertGpio(name): 114 name = name.upper() 115 c = name[0:1] 116 offset = int(name[1:]) 117 a = ord(c)-65 118 base = a*8+GPIO_BASE 119 return base+offset 120 121HWMON_CONFIG = { 122 '2-004c' : { 123 'names' : { 124 'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : -3,'units' : 'C' }, 125 } 126 }, 127 '3-0050' : { 128 'names' : { 129 'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 130 'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 131 'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 132 'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 133 'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 134 'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' }, 135 } 136 } 137} 138 139# Miscellaneous non-poll sensor with system specific properties. 140# The sensor id is the same as those defined in ID_LOOKUP['SENSOR']. 141MISC_SENSORS = { 142 0x09 : { 'class' : 'BootCountSensor' }, 143 0x05 : { 'class' : 'BootProgressSensor' }, 144 0x08 : { 'class' : 'OccStatusSensor', 145 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' }, 146 0x32 : { 'class' : 'OperatingSystemStatusSensor' }, 147 0x33 : { 'class' : 'PowerCap', 148 'os_path' : '/sys/class/hwmon/hwmon1/user_powercap' }, 149} 150 151# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 152