xref: /openbmc/skeleton/configs/Palmetto.py (revision f47f5faa)
1HOME_PATH = './'
2GPIO_BASE = 320
3SYSTEM_NAME = "Palmetto"
4
5
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
10SYSTEM_STATES = [
11	'BASE_APPS',
12	'BMC_STARTING',
13	'BMC_READY',
14	'HOST_POWERING_ON',
15	'HOST_POWERED_ON',
16	'HOST_BOOTING',
17	'HOST_BOOTED',
18	'HOST_POWERED_OFF',
19]
20
21EXIT_STATE_DEPEND = {
22	'BASE_APPS' : {
23		'/org/openbmc/sensors': 0,
24	},
25	'BMC_STARTING' : {
26		'/org/openbmc/control/chassis0': 0,
27		'/org/openbmc/control/power0' : 0,
28		'/org/openbmc/control/led/identify' : 0,
29		'/org/openbmc/control/host0' : 0,
30		'/org/openbmc/control/flash/bios' : 0,
31	}
32}
33
34CACHED_INTERFACES = {
35		"org.openbmc.InventoryItem" : True,
36		"org.openbmc.control.Chassis" : True,
37	}
38INVENTORY_ROOT = '/org/openbmc/inventory'
39
40FRU_INSTANCES = {
41	'<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, },
44
45	'<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, },
50
51	'<inventory_root>/system/chassis/motherboard/bmc' : { 'fru_type' : 'BMC','is_fru' : False,
52			'manufacturer' : 'ASPEED' },
53	'<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, },
66
67
68	'<inventory_root>/system/chassis/motherboard/membuf0' : { 'fru_type' : 'MEMORY_BUFFER', 'is_fru' : False, },
69
70	'<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,},
74
75	'<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,},
77
78	'<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, },
83}
84
85ID_LOOKUP = {
86	'FRU' : {
87		0x0d : '<inventory_root>/system/chassis',
88		0x34 : '<inventory_root>/system/chassis/motherboard',
89		0x01 : '<inventory_root>/system/chassis/motherboard/cpu0',
90		0x02 : '<inventory_root>/system/chassis/motherboard/membuf0',
91		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',
95		0x35 : '<inventory_root>/system',
96	},
97	'FRU_STR' : {
98		'PRODUCT_15' : '<inventory_root>/system',
99		'CHASSIS_2' : '<inventory_root>/system/chassis',
100		'BOARD_1'   : '<inventory_root>/system/chassis/motherboard/cpu0',
101		'BOARD_2'   : '<inventory_root>/system/chassis/motherboard/membuf0',
102		'BOARD_14'   : '<inventory_root>/system/chassis/motherboard',
103		'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',
107	},
108	'SENSOR' : {
109		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',
115		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',
128		0x2e : '<inventory_root>/system/chassis/motherboard/membuf0',
129		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',
133		0x09 : '/org/openbmc/sensors/host/BootCount',
134		0x05 : '/org/openbmc/sensors/host/BootProgress',
135		0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus',
136		0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus',
137		0x33 : '/org/openbmc/sensors/host/PowerCap',
138	},
139	'GPIO_PRESENT' : {
140		'SLOT0_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot0',
141		'SLOT1_PRESENT' : '<inventory_root>/system/chassis/io_board/pcie_slot1',
142	}
143}
144
145GPIO_CONFIG = {}
146GPIO_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'  }
152GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' }
153GPIO_CONFIG['IDBTN']       = { 'gpio_pin': 'Q7', 'direction': 'out' }
154GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' }
155GPIO_CONFIG['PCIE_RESET']   = { 'gpio_pin': 'B5', 'direction': 'out' }
156GPIO_CONFIG['USB_RESET']    = { 'gpio_pin': 'B6', 'direction': 'out' }
157GPIO_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' }
165GPIO_CONFIG['CHECKSTOP']      =   { 'gpio_pin': 'P5', 'direction': 'falling' }
166
167def convertGpio(name):
168	name = name.upper()
169	c = name[0:1]
170	offset = int(name[1:])
171	a = ord(c)-65
172	base = a*8+GPIO_BASE
173	return base+offset
174
175HWMON_CONFIG = {
176	'2-004c' :  {
177		'names' : {
178			'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
179		}
180	},
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		}
190	}
191}
192
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}
204