blob: 70320d6b137d4479180964ca71266fefcbc0c8f1 [file] [log] [blame]
Norman Jamesc9239a32015-10-06 16:54:31 -05001HOME_PATH = './'
Norman Jamesa9966b32015-10-28 06:55:58 -05002GPIO_BASE = 320
Norman James969227c2015-10-08 15:10:47 -05003SYSTEM_NAME = "Palmetto"
Norman Jamesc9239a32015-10-06 16:54:31 -05004
Norman Jamesa3e47c42015-10-18 14:43:10 -05005
6## System states
7## state can change to next state in 2 ways:
8## - a process emits a GotoSystemState signal with state name to goto
9## - objects specified in EXIT_STATE_DEPEND have started
Norman Jamesc9239a32015-10-06 16:54:31 -050010SYSTEM_STATES = [
Norman Jamesb714eb22015-10-26 17:12:57 -050011 'BASE_APPS',
Norman Jamesa3e47c42015-10-18 14:43:10 -050012 'BMC_STARTING',
13 'BMC_READY',
14 'HOST_POWERING_ON',
15 'HOST_POWERED_ON',
16 'HOST_BOOTING',
Norman James2656f332015-10-26 06:42:41 -050017 'HOST_BOOTED',
Adriana Kobylakc5a16052016-03-01 14:29:47 -060018 'HOST_POWERED_OFF',
Norman Jamesc9239a32015-10-06 16:54:31 -050019]
20
Norman Jamesa3e47c42015-10-18 14:43:10 -050021EXIT_STATE_DEPEND = {
Norman Jamesb714eb22015-10-26 17:12:57 -050022 'BASE_APPS' : {
Norman James76abea32015-10-29 06:17:54 -050023 '/org/openbmc/sensors': 0,
Norman Jamesb714eb22015-10-26 17:12:57 -050024 },
Norman Jamesa3e47c42015-10-18 14:43:10 -050025 'BMC_STARTING' : {
26 '/org/openbmc/control/chassis0': 0,
27 '/org/openbmc/control/power0' : 0,
Adriana Kobylak9c751042016-02-09 13:44:32 -060028 '/org/openbmc/control/led/identify' : 0,
Norman Jamesb38ea5a2015-10-28 12:44:56 -050029 '/org/openbmc/control/host0' : 0,
Norman James2943cc62015-10-28 18:59:53 -050030 '/org/openbmc/control/flash/bios' : 0,
Norman Jamesa3e47c42015-10-18 14:43:10 -050031 }
32}
33
Norman James2656f332015-10-26 06:42:41 -050034CACHED_INTERFACES = {
35 "org.openbmc.InventoryItem" : True,
36 "org.openbmc.control.Chassis" : True,
37 }
Norman Jamesa3e47c42015-10-18 14:43:10 -050038INVENTORY_ROOT = '/org/openbmc/inventory'
Norman Jamesc9239a32015-10-06 16:54:31 -050039
40FRU_INSTANCES = {
Norman Jamesb38ea5a2015-10-28 12:44:56 -050041 '<inventory_root>/system' : { 'fru_type' : 'SYSTEM','is_fru' : True, },
42 '<inventory_root>/system/chassis' : { 'fru_type' : 'SYSTEM','is_fru' : True, },
43 '<inventory_root>/system/chassis/motherboard' : { 'fru_type' : 'MAIN_PLANAR','is_fru' : True, },
Norman Jamesc9239a32015-10-06 16:54:31 -050044
Norman Jamesb38ea5a2015-10-28 12:44:56 -050045 '<inventory_root>/system/chassis/fan0' : { 'fru_type' : 'FAN','is_fru' : True, },
46 '<inventory_root>/system/chassis/fan1' : { 'fru_type' : 'FAN','is_fru' : True, },
47 '<inventory_root>/system/chassis/fan2' : { 'fru_type' : 'FAN','is_fru' : True, },
48 '<inventory_root>/system/chassis/fan3' : { 'fru_type' : 'FAN','is_fru' : True, },
49 '<inventory_root>/system/chassis/fan4' : { 'fru_type' : 'FAN','is_fru' : True, },
Norman Jamesa42446a2015-10-19 11:12:45 -050050
Norman Jamesb38ea5a2015-10-28 12:44:56 -050051 '<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False,
Norman Jamesa42446a2015-10-19 11:12:45 -050052 'manufacturer' : 'ASPEED' },
Norman Jamesb38ea5a2015-10-28 12:44:56 -050053 '<inventory_root>/system/chassis/motherboard/cpu0' : { 'fru_type' : 'CPU', 'is_fru' : True, },
54 '<inventory_root>/system/chassis/motherboard/cpu0/core0' : { 'fru_type' : 'CORE', 'is_fru' : False, },
55 '<inventory_root>/system/chassis/motherboard/cpu0/core1' : { 'fru_type' : 'CORE', 'is_fru' : False, },
56 '<inventory_root>/system/chassis/motherboard/cpu0/core2' : { 'fru_type' : 'CORE', 'is_fru' : False, },
57 '<inventory_root>/system/chassis/motherboard/cpu0/core3' : { 'fru_type' : 'CORE', 'is_fru' : False, },
58 '<inventory_root>/system/chassis/motherboard/cpu0/core4' : { 'fru_type' : 'CORE', 'is_fru' : False, },
59 '<inventory_root>/system/chassis/motherboard/cpu0/core5' : { 'fru_type' : 'CORE', 'is_fru' : False, },
60 '<inventory_root>/system/chassis/motherboard/cpu0/core6' : { 'fru_type' : 'CORE', 'is_fru' : False, },
61 '<inventory_root>/system/chassis/motherboard/cpu0/core7' : { 'fru_type' : 'CORE', 'is_fru' : False, },
62 '<inventory_root>/system/chassis/motherboard/cpu0/core8' : { 'fru_type' : 'CORE', 'is_fru' : False, },
63 '<inventory_root>/system/chassis/motherboard/cpu0/core9' : { 'fru_type' : 'CORE', 'is_fru' : False, },
64 '<inventory_root>/system/chassis/motherboard/cpu0/core10' : { 'fru_type' : 'CORE', 'is_fru' : False, },
65 '<inventory_root>/system/chassis/motherboard/cpu0/core11' : { 'fru_type' : 'CORE', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -050066
Norman Jamesa42446a2015-10-19 11:12:45 -050067
Chris Austen46136de2016-05-12 00:27:37 -050068 '<inventory_root>/system/chassis/motherboard/membuf0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
Norman Jamesa42446a2015-10-19 11:12:45 -050069
Norman Jamesb38ea5a2015-10-28 12:44:56 -050070 '<inventory_root>/system/chassis/motherboard/dimm0' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
71 '<inventory_root>/system/chassis/motherboard/dimm1' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
72 '<inventory_root>/system/chassis/motherboard/dimm2' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
73 '<inventory_root>/system/chassis/motherboard/dimm3' : { 'fru_type' : 'DIMM', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -050074
Norman Jamesb38ea5a2015-10-28 12:44:56 -050075 '<inventory_root>/system/chassis/io_board/pcie_slot0' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
76 '<inventory_root>/system/chassis/io_board/pcie_slot1' : { 'fru_type' : 'PCIE_CARD', 'is_fru' : True,},
Norman Jamesa42446a2015-10-19 11:12:45 -050077
Chris Austen4c9ea5d2015-12-09 23:26:08 -060078 '<inventory_root>/system/systemevent' : { 'fru_type' : 'SYSTEM_EVENT', 'is_fru' : False, },
79 '<inventory_root>/system/chassis/motherboard/refclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
80 '<inventory_root>/system/chassis/motherboard/pcieclock': { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
81 '<inventory_root>/system/chassis/motherboard/todclock' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
82 '<inventory_root>/system/chassis/motherboard/apss' : { 'fru_type' : 'MAIN_PLANAR', 'is_fru' : False, },
Norman Jamesc9239a32015-10-06 16:54:31 -050083}
84
85ID_LOOKUP = {
86 'FRU' : {
Norman Jamesa42446a2015-10-19 11:12:45 -050087 0x0d : '<inventory_root>/system/chassis',
88 0x34 : '<inventory_root>/system/chassis/motherboard',
89 0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
Chris Austen46136de2016-05-12 00:27:37 -050090 0x02 : '<inventory_root>/system/chassis/motherboard/membuf0',
Norman Jamesa42446a2015-10-19 11:12:45 -050091 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0',
92 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1',
93 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2',
94 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman James2656f332015-10-26 06:42:41 -050095 0x35 : '<inventory_root>/system',
Norman Jamesc9239a32015-10-06 16:54:31 -050096 },
Norman Jamesa42446a2015-10-19 11:12:45 -050097 'FRU_STR' : {
Norman Jamesfe635e82015-10-20 07:47:22 -050098 'PRODUCT_15' : '<inventory_root>/system',
99 'CHASSIS_2' : '<inventory_root>/system/chassis',
100 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu0',
Chris Austen46136de2016-05-12 00:27:37 -0500101 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/membuf0',
Chris Austen4c9ea5d2015-12-09 23:26:08 -0600102 'BOARD_14' : '<inventory_root>/system/chassis/motherboard',
Norman Jamesfe635e82015-10-20 07:47:22 -0500103 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0',
104 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1',
105 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2',
106 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman Jamesa42446a2015-10-19 11:12:45 -0500107 },
Norman Jamesc9239a32015-10-06 16:54:31 -0500108 'SENSOR' : {
Chris Austen4c9ea5d2015-12-09 23:26:08 -0600109 0x34 : '<inventory_root>/system/chassis/motherboard',
110 0x35 : '<inventory_root>/system/systemevent',
111 0x37 : '<inventory_root>/system/chassis/motherboard/refclock',
112 0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock',
113 0x39 : '<inventory_root>/system/chassis/motherboard/todclock',
114 0x3A : '<inventory_root>/system/chassis/motherboard/apss',
Norman Jamesa42446a2015-10-19 11:12:45 -0500115 0x2f : '<inventory_root>/system/chassis/motherboard/cpu0',
116 0x22 : '<inventory_root>/system/chassis/motherboard/cpu0/core0',
117 0x23 : '<inventory_root>/system/chassis/motherboard/cpu0/core1',
118 0x24 : '<inventory_root>/system/chassis/motherboard/cpu0/core2',
119 0x25 : '<inventory_root>/system/chassis/motherboard/cpu0/core3',
120 0x26 : '<inventory_root>/system/chassis/motherboard/cpu0/core4',
121 0x27 : '<inventory_root>/system/chassis/motherboard/cpu0/core5',
122 0x28 : '<inventory_root>/system/chassis/motherboard/cpu0/core6',
123 0x29 : '<inventory_root>/system/chassis/motherboard/cpu0/core7',
124 0x2a : '<inventory_root>/system/chassis/motherboard/cpu0/core8',
125 0x2b : '<inventory_root>/system/chassis/motherboard/cpu0/core9',
126 0x2c : '<inventory_root>/system/chassis/motherboard/cpu0/core10',
127 0x2d : '<inventory_root>/system/chassis/motherboard/cpu0/core11',
Chris Austen46136de2016-05-12 00:27:37 -0500128 0x2e : '<inventory_root>/system/chassis/motherboard/membuf0',
Norman Jamesa42446a2015-10-19 11:12:45 -0500129 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0',
130 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1',
131 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2',
132 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3',
Chris Austen4c9ea5d2015-12-09 23:26:08 -0600133 0x09 : '/org/openbmc/sensors/host/BootCount',
134 0x05 : '/org/openbmc/sensors/host/BootProgress',
Norman James86f2a072016-01-30 22:48:54 -0600135 0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus',
Chris Austen4c9ea5d2015-12-09 23:26:08 -0600136 0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus',
137 0x33 : '/org/openbmc/sensors/host/PowerCap',
Norman Jamesc9239a32015-10-06 16:54:31 -0500138 },
139 'GPIO_PRESENT' : {
Chris Austen4c9ea5d2015-12-09 23:26:08 -0600140 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0',
141 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1',
Norman Jamesc9239a32015-10-06 16:54:31 -0500142 }
143}
144
145GPIO_CONFIG = {}
Norman Jamesb38ea5a2015-10-28 12:44:56 -0500146GPIO_CONFIG['FSI_CLK'] = { 'gpio_pin': 'A4', 'direction': 'out' }
147GPIO_CONFIG['FSI_DATA'] = { 'gpio_pin': 'A5', 'direction': 'out' }
148GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_pin': 'D0', 'direction': 'out' }
149GPIO_CONFIG['POWER_PIN'] = { 'gpio_pin': 'E1', 'direction': 'out' }
150GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_pin': 'A6', 'direction': 'out' }
151GPIO_CONFIG['PGOOD'] = { 'gpio_pin': 'C7', 'direction': 'in' }
Norman James7b8811e2016-01-12 12:51:29 -0600152GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' }
Chris Austencd6a5602016-05-24 13:33:51 -0500153GPIO_CONFIG['IDBTN'] = { 'gpio_pin': 'Q7', 'direction': 'out' }
Norman James2943cc62015-10-28 18:59:53 -0500154GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' }
Norman Jamese62f4452015-10-31 17:33:10 -0500155GPIO_CONFIG['PCIE_RESET'] = { 'gpio_pin': 'B5', 'direction': 'out' }
156GPIO_CONFIG['USB_RESET'] = { 'gpio_pin': 'B6', 'direction': 'out' }
Norman Jamesb38ea5a2015-10-28 12:44:56 -0500157GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_pin': 'N0', 'direction': 'in' }
158GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_pin': 'N1', 'direction': 'in' }
159GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_pin': 'N2', 'direction': 'in' }
160GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_pin': 'N3', 'direction': 'in' }
161GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_pin': 'N4', 'direction': 'in' }
162GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_pin': 'N5', 'direction': 'in' }
163GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_pin': 'O0', 'direction': 'in' }
164GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_pin': 'O1', 'direction': 'in' }
Adriana Kobylak341c8c22016-06-16 09:20:55 -0500165GPIO_CONFIG['CHECKSTOP'] = { 'gpio_pin': 'P5', 'direction': 'falling' }
Norman Jamesc9239a32015-10-06 16:54:31 -0500166
Norman James6bbe0b52015-10-27 09:18:05 -0500167def convertGpio(name):
168 name = name.upper()
169 c = name[0:1]
Norman Jamesa9966b32015-10-28 06:55:58 -0500170 offset = int(name[1:])
Norman James6bbe0b52015-10-27 09:18:05 -0500171 a = ord(c)-65
Norman Jamesa9966b32015-10-28 06:55:58 -0500172 base = a*8+GPIO_BASE
Norman James7b8811e2016-01-12 12:51:29 -0600173 return base+offset
174
175HWMON_CONFIG = {
176 '2-004c' : {
177 'names' : {
Edward A. Jamesc14f6fe2016-08-11 11:02:15 -0500178 'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
Norman James7b8811e2016-01-12 12:51:29 -0600179 }
Yi Li155f93f2016-01-30 15:30:14 +0800180 },
181 '3-0050' : {
182 'names' : {
183 'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
184 'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
185 'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
186 'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
187 'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
188 'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
189 }
Norman James7b8811e2016-01-12 12:51:29 -0600190 }
191}
Yi Li54decc82016-05-05 17:42:56 +0800192
193# Miscellaneous non-poll sensor with system specific properties.
194# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
195MISC_SENSORS = {
196 0x09 : { 'class' : 'BootCountSensor' },
197 0x05 : { 'class' : 'BootProgressSensor' },
198 0x08 : { 'class' : 'OccStatusSensor',
199 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' },
200 0x32 : { 'class' : 'OperatingSystemStatusSensor' },
201 0x33 : { 'class' : 'PowerCap',
202 'os_path' : '/sys/class/hwmon/hwmon1/user_powercap' },
203}