xref: /openbmc/skeleton/configs/Palmetto.py (revision cad44d68)
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/cpu',
90		0x02 : '<inventory_root>/system/chassis/motherboard/membuf',
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/cpu',
101		'BOARD_2'   : '<inventory_root>/system/chassis/motherboard/membuf',
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		0x37 : '<inventory_root>/system/chassis/motherboard/refclock',
111		0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock',
112		0x39 : '<inventory_root>/system/chassis/motherboard/todclock',
113		0x3A : '<inventory_root>/system/chassis/apss',
114		0x2f : '<inventory_root>/system/chassis/motherboard/cpu',
115		0x22 : '<inventory_root>/system/chassis/motherboard/cpu/core1',
116		0x23 : '<inventory_root>/system/chassis/motherboard/cpu/core2',
117		0x24 : '<inventory_root>/system/chassis/motherboard/cpu/core3',
118		0x25 : '<inventory_root>/system/chassis/motherboard/cpu/core4',
119		0x26 : '<inventory_root>/system/chassis/motherboard/cpu/core5',
120		0x27 : '<inventory_root>/system/chassis/motherboard/cpu/core6',
121		0x28 : '<inventory_root>/system/chassis/motherboard/cpu/core9',
122		0x29 : '<inventory_root>/system/chassis/motherboard/cpu/core10',
123		0x2a : '<inventory_root>/system/chassis/motherboard/cpu/core11',
124		0x2b : '<inventory_root>/system/chassis/motherboard/cpu/core12',
125		0x2c : '<inventory_root>/system/chassis/motherboard/cpu/core13',
126		0x2d : '<inventory_root>/system/chassis/motherboard/cpu/core14',
127		0x2e : '<inventory_root>/system/chassis/motherboard/membuf',
128		0x1e : '<inventory_root>/system/chassis/motherboard/dimm0',
129		0x1f : '<inventory_root>/system/chassis/motherboard/dimm1',
130		0x20 : '<inventory_root>/system/chassis/motherboard/dimm2',
131		0x21 : '<inventory_root>/system/chassis/motherboard/dimm3',
132		0x09 : '/org/openbmc/sensors/host/BootCount',
133		0x05 : '/org/openbmc/sensors/host/BootProgress',
134		0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus',
135		0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus',
136		0x33 : '/org/openbmc/sensors/host/PowerCap',
137	},
138	'GPIO_PRESENT' : {
139		'SLOT0_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x16',
140		'SLOT1_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x8',
141	}
142}
143
144GPIO_CONFIG = {}
145GPIO_CONFIG['FSI_CLK']    =   { 'gpio_pin': 'A4', 'direction': 'out' }
146GPIO_CONFIG['FSI_DATA']   =   { 'gpio_pin': 'A5', 'direction': 'out' }
147GPIO_CONFIG['FSI_ENABLE'] =   { 'gpio_pin': 'D0', 'direction': 'out' }
148GPIO_CONFIG['POWER_PIN']  =   { 'gpio_pin': 'E1', 'direction': 'out'  }
149GPIO_CONFIG['CRONUS_SEL'] =   { 'gpio_pin': 'A6', 'direction': 'out'  }
150GPIO_CONFIG['PGOOD']      =   { 'gpio_pin': 'C7', 'direction': 'in'  }
151GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' }
152GPIO_CONFIG['IDBTN']       = { 'gpio_pin': 'Q7', 'direction': 'out' }
153GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' }
154GPIO_CONFIG['PCIE_RESET']   = { 'gpio_pin': 'B5', 'direction': 'out' }
155GPIO_CONFIG['USB_RESET']    = { 'gpio_pin': 'B6', 'direction': 'out' }
156GPIO_CONFIG['SLOT0_RISER_PRESENT'] =   { 'gpio_pin': 'N0', 'direction': 'in' }
157GPIO_CONFIG['SLOT1_RISER_PRESENT'] =   { 'gpio_pin': 'N1', 'direction': 'in' }
158GPIO_CONFIG['SLOT2_RISER_PRESENT'] =   { 'gpio_pin': 'N2', 'direction': 'in' }
159GPIO_CONFIG['SLOT0_PRESENT'] =         { 'gpio_pin': 'N3', 'direction': 'in' }
160GPIO_CONFIG['SLOT1_PRESENT'] =         { 'gpio_pin': 'N4', 'direction': 'in' }
161GPIO_CONFIG['SLOT2_PRESENT'] =         { 'gpio_pin': 'N5', 'direction': 'in' }
162GPIO_CONFIG['MEZZ0_PRESENT'] =         { 'gpio_pin': 'O0', 'direction': 'in' }
163GPIO_CONFIG['MEZZ1_PRESENT'] =         { 'gpio_pin': 'O1', 'direction': 'in' }
164GPIO_CONFIG['CHECKSTOP']      =   { 'gpio_pin': 'P5', 'direction': 'falling' }
165
166def convertGpio(name):
167	name = name.upper()
168	c = name[0:1]
169	offset = int(name[1:])
170	a = ord(c)-65
171	base = a*8+GPIO_BASE
172	return base+offset
173
174HWMON_CONFIG = {
175	'2-004c' :  {
176		'names' : {
177			'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
178		}
179	},
180	'3-0050' : {
181		'names' : {
182			'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
183			'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
184			'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
185			'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
186			'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
187			'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
188		}
189	}
190}
191
192# Miscellaneous non-poll sensor with system specific properties.
193# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
194MISC_SENSORS = {
195	0x09 : { 'class' : 'BootCountSensor' },
196	0x05 : { 'class' : 'BootProgressSensor' },
197	0x08 : { 'class' : 'OccStatusSensor',
198		'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' },
199	0x32 : { 'class' : 'OperatingSystemStatusSensor' },
200	0x33 : { 'class' : 'PowerCap',
201		'os_path' : '/sys/class/hwmon/hwmon1/user_powercap' },
202}
203