blob: 5ce94ae7f2852f577e2597aaf69481edaf961ecb [file] [log] [blame]
Norman Jamesa3e47c42015-10-18 14:43:10 -05001## System states
2## state can change to next state in 2 ways:
3## - a process emits a GotoSystemState signal with state name to goto
4## - objects specified in EXIT_STATE_DEPEND have started
Norman Jamesc9239a32015-10-06 16:54:31 -05005SYSTEM_STATES = [
Norman Jamesb714eb22015-10-26 17:12:57 -05006 'BASE_APPS',
Norman Jamesa3e47c42015-10-18 14:43:10 -05007 'BMC_STARTING',
8 'BMC_READY',
9 'HOST_POWERING_ON',
10 'HOST_POWERED_ON',
11 'HOST_BOOTING',
Norman James2656f332015-10-26 06:42:41 -050012 'HOST_BOOTED',
Adriana Kobylakc5a16052016-03-01 14:29:47 -060013 'HOST_POWERED_OFF',
Norman Jamesc9239a32015-10-06 16:54:31 -050014]
15
Norman Jamesa3e47c42015-10-18 14:43:10 -050016EXIT_STATE_DEPEND = {
Norman Jamesb714eb22015-10-26 17:12:57 -050017 'BASE_APPS' : {
Norman James76abea32015-10-29 06:17:54 -050018 '/org/openbmc/sensors': 0,
Norman Jamesb714eb22015-10-26 17:12:57 -050019 },
Norman Jamesa3e47c42015-10-18 14:43:10 -050020 'BMC_STARTING' : {
21 '/org/openbmc/control/chassis0': 0,
22 '/org/openbmc/control/power0' : 0,
Adriana Kobylak9c751042016-02-09 13:44:32 -060023 '/org/openbmc/control/led/identify' : 0,
Norman Jamesb38ea5a2015-10-28 12:44:56 -050024 '/org/openbmc/control/host0' : 0,
Norman James2943cc62015-10-28 18:59:53 -050025 '/org/openbmc/control/flash/bios' : 0,
Norman Jamesa3e47c42015-10-18 14:43:10 -050026 }
27}
28
Norman Jamesc9239a32015-10-06 16:54:31 -050029ID_LOOKUP = {
30 'FRU' : {
Norman Jamesa42446a2015-10-19 11:12:45 -050031 0x0d : '<inventory_root>/system/chassis',
32 0x34 : '<inventory_root>/system/chassis/motherboard',
Matt Spinlercad44d62016-09-21 09:52:52 -050033 0x01 : '<inventory_root>/system/chassis/motherboard/cpu',
34 0x02 : '<inventory_root>/system/chassis/motherboard/membuf',
Norman Jamesa42446a2015-10-19 11:12:45 -050035 0x03 : '<inventory_root>/system/chassis/motherboard/dimm0',
36 0x04 : '<inventory_root>/system/chassis/motherboard/dimm1',
37 0x05 : '<inventory_root>/system/chassis/motherboard/dimm2',
38 0x06 : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman James2656f332015-10-26 06:42:41 -050039 0x35 : '<inventory_root>/system',
Norman Jamesc9239a32015-10-06 16:54:31 -050040 },
Norman Jamesa42446a2015-10-19 11:12:45 -050041 'FRU_STR' : {
Norman Jamesfe635e82015-10-20 07:47:22 -050042 'PRODUCT_15' : '<inventory_root>/system',
43 'CHASSIS_2' : '<inventory_root>/system/chassis',
Matt Spinlercad44d62016-09-21 09:52:52 -050044 'BOARD_1' : '<inventory_root>/system/chassis/motherboard/cpu',
45 'BOARD_2' : '<inventory_root>/system/chassis/motherboard/membuf',
Chris Austen4c9ea5d2015-12-09 23:26:08 -060046 'BOARD_14' : '<inventory_root>/system/chassis/motherboard',
Norman Jamesfe635e82015-10-20 07:47:22 -050047 'PRODUCT_3' : '<inventory_root>/system/chassis/motherboard/dimm0',
48 'PRODUCT_4' : '<inventory_root>/system/chassis/motherboard/dimm1',
49 'PRODUCT_5' : '<inventory_root>/system/chassis/motherboard/dimm2',
50 'PRODUCT_6' : '<inventory_root>/system/chassis/motherboard/dimm3',
Norman Jamesa42446a2015-10-19 11:12:45 -050051 },
Norman Jamesc9239a32015-10-06 16:54:31 -050052 'SENSOR' : {
Chris Austen4c9ea5d2015-12-09 23:26:08 -060053 0x34 : '<inventory_root>/system/chassis/motherboard',
Chris Austen4c9ea5d2015-12-09 23:26:08 -060054 0x37 : '<inventory_root>/system/chassis/motherboard/refclock',
55 0x38 : '<inventory_root>/system/chassis/motherboard/pcieclock',
56 0x39 : '<inventory_root>/system/chassis/motherboard/todclock',
Matt Spinlercad44d62016-09-21 09:52:52 -050057 0x3A : '<inventory_root>/system/chassis/apss',
58 0x2f : '<inventory_root>/system/chassis/motherboard/cpu',
59 0x22 : '<inventory_root>/system/chassis/motherboard/cpu/core1',
60 0x23 : '<inventory_root>/system/chassis/motherboard/cpu/core2',
61 0x24 : '<inventory_root>/system/chassis/motherboard/cpu/core3',
62 0x25 : '<inventory_root>/system/chassis/motherboard/cpu/core4',
63 0x26 : '<inventory_root>/system/chassis/motherboard/cpu/core5',
64 0x27 : '<inventory_root>/system/chassis/motherboard/cpu/core6',
65 0x28 : '<inventory_root>/system/chassis/motherboard/cpu/core9',
66 0x29 : '<inventory_root>/system/chassis/motherboard/cpu/core10',
67 0x2a : '<inventory_root>/system/chassis/motherboard/cpu/core11',
68 0x2b : '<inventory_root>/system/chassis/motherboard/cpu/core12',
69 0x2c : '<inventory_root>/system/chassis/motherboard/cpu/core13',
70 0x2d : '<inventory_root>/system/chassis/motherboard/cpu/core14',
71 0x2e : '<inventory_root>/system/chassis/motherboard/membuf',
Norman Jamesa42446a2015-10-19 11:12:45 -050072 0x1e : '<inventory_root>/system/chassis/motherboard/dimm0',
73 0x1f : '<inventory_root>/system/chassis/motherboard/dimm1',
74 0x20 : '<inventory_root>/system/chassis/motherboard/dimm2',
75 0x21 : '<inventory_root>/system/chassis/motherboard/dimm3',
Chris Austen4c9ea5d2015-12-09 23:26:08 -060076 0x09 : '/org/openbmc/sensors/host/BootCount',
77 0x05 : '/org/openbmc/sensors/host/BootProgress',
Norman James86f2a072016-01-30 22:48:54 -060078 0x08 : '/org/openbmc/sensors/host/cpu0/OccStatus',
Chris Austen4c9ea5d2015-12-09 23:26:08 -060079 0x32 : '/org/openbmc/sensors/host/OperatingSystemStatus',
80 0x33 : '/org/openbmc/sensors/host/PowerCap',
Norman Jamesc9239a32015-10-06 16:54:31 -050081 },
82 'GPIO_PRESENT' : {
Matt Spinlercad44d62016-09-21 09:52:52 -050083 'SLOT0_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x16',
84 'SLOT1_PRESENT' : '<inventory_root>/system/chassis/motherboard/pciecard_x8',
Norman Jamesc9239a32015-10-06 16:54:31 -050085 }
86}
87
88GPIO_CONFIG = {}
Norman Jamesb38ea5a2015-10-28 12:44:56 -050089GPIO_CONFIG['FSI_CLK'] = { 'gpio_pin': 'A4', 'direction': 'out' }
90GPIO_CONFIG['FSI_DATA'] = { 'gpio_pin': 'A5', 'direction': 'out' }
91GPIO_CONFIG['FSI_ENABLE'] = { 'gpio_pin': 'D0', 'direction': 'out' }
92GPIO_CONFIG['POWER_PIN'] = { 'gpio_pin': 'E1', 'direction': 'out' }
93GPIO_CONFIG['CRONUS_SEL'] = { 'gpio_pin': 'A6', 'direction': 'out' }
94GPIO_CONFIG['PGOOD'] = { 'gpio_pin': 'C7', 'direction': 'in' }
Norman James7b8811e2016-01-12 12:51:29 -060095GPIO_CONFIG['BMC_THROTTLE'] = { 'gpio_pin': 'J3', 'direction': 'out' }
Chris Austencd6a5602016-05-24 13:33:51 -050096GPIO_CONFIG['IDBTN'] = { 'gpio_pin': 'Q7', 'direction': 'out' }
Norman James2943cc62015-10-28 18:59:53 -050097GPIO_CONFIG['POWER_BUTTON'] = { 'gpio_pin': 'E0', 'direction': 'both' }
Norman Jamese62f4452015-10-31 17:33:10 -050098GPIO_CONFIG['PCIE_RESET'] = { 'gpio_pin': 'B5', 'direction': 'out' }
99GPIO_CONFIG['USB_RESET'] = { 'gpio_pin': 'B6', 'direction': 'out' }
Norman Jamesb38ea5a2015-10-28 12:44:56 -0500100GPIO_CONFIG['SLOT0_RISER_PRESENT'] = { 'gpio_pin': 'N0', 'direction': 'in' }
101GPIO_CONFIG['SLOT1_RISER_PRESENT'] = { 'gpio_pin': 'N1', 'direction': 'in' }
102GPIO_CONFIG['SLOT2_RISER_PRESENT'] = { 'gpio_pin': 'N2', 'direction': 'in' }
103GPIO_CONFIG['SLOT0_PRESENT'] = { 'gpio_pin': 'N3', 'direction': 'in' }
104GPIO_CONFIG['SLOT1_PRESENT'] = { 'gpio_pin': 'N4', 'direction': 'in' }
105GPIO_CONFIG['SLOT2_PRESENT'] = { 'gpio_pin': 'N5', 'direction': 'in' }
106GPIO_CONFIG['MEZZ0_PRESENT'] = { 'gpio_pin': 'O0', 'direction': 'in' }
107GPIO_CONFIG['MEZZ1_PRESENT'] = { 'gpio_pin': 'O1', 'direction': 'in' }
Adriana Kobylak341c8c22016-06-16 09:20:55 -0500108GPIO_CONFIG['CHECKSTOP'] = { 'gpio_pin': 'P5', 'direction': 'falling' }
Norman Jamesc9239a32015-10-06 16:54:31 -0500109
Norman James7b8811e2016-01-12 12:51:29 -0600110HWMON_CONFIG = {
Lei YU25a22432016-10-14 11:45:05 +0800111 '0-0068' : {
112 'names' : {
113 'temp1_input' : { 'object_path' : 'temperature/rtc','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
114 }
115 },
Norman James7b8811e2016-01-12 12:51:29 -0600116 '2-004c' : {
117 'names' : {
Edward A. Jamesc14f6fe2016-08-11 11:02:15 -0500118 'temp1_input' : { 'object_path' : 'temperature/ambient','poll_interval' : 5000,'scale' : -3,'units' : 'C' },
Norman James7b8811e2016-01-12 12:51:29 -0600119 }
Yi Li155f93f2016-01-30 15:30:14 +0800120 },
121 '3-0050' : {
122 'names' : {
123 'caps_curr_powercap' : { 'object_path' : 'powercap/curr_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
124 'caps_curr_powerreading' : { 'object_path' : 'powercap/system_power','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
125 'caps_max_powercap' : { 'object_path' : 'powercap/max_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
126 'caps_min_powercap' : { 'object_path' : 'powercap/min_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
127 'caps_norm_powercap' : { 'object_path' : 'powercap/n_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
128 'caps_user_powerlimit' : { 'object_path' : 'powercap/user_cap','poll_interval' : 10000,'scale' : 1,'units' : 'W' },
129 }
Norman James7b8811e2016-01-12 12:51:29 -0600130 }
131}
Yi Li54decc82016-05-05 17:42:56 +0800132
Lei YU75a18a22016-11-22 01:47:47 +0800133GPIO_CONFIGS = {
134 'power_config' : {
135 'power_good_in' : 'PGOOD',
136 'power_up_outs' : [
137 ('POWER_PIN', False),
138 ],
139 'reset_outs' : [
140 ('USB_RESET', False),
141 ],
142 'pci_reset_outs': [
143 # net name, polarity, reset hold
144 ('PCIE_RESET', False, False),
145 ],
146 },
147 'hostctl_config' : {
148 'fsi_data' : 'FSI_DATA',
149 'fsi_clk' : 'FSI_CLK',
150 'fsi_enable' : 'FSI_ENABLE',
151 'cronus_sel' : 'CRONUS_SEL',
152 'optionals' : [
153 ('BMC_THROTTLE', True),
154 ('IDBTN', False),
155 ],
156 },
Xo Wang4088ec32016-09-22 13:00:58 -0700157}
158
Yi Li54decc82016-05-05 17:42:56 +0800159# Miscellaneous non-poll sensor with system specific properties.
160# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
161MISC_SENSORS = {
162 0x09 : { 'class' : 'BootCountSensor' },
163 0x05 : { 'class' : 'BootProgressSensor' },
164 0x08 : { 'class' : 'OccStatusSensor',
165 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' },
166 0x32 : { 'class' : 'OperatingSystemStatusSensor' },
167 0x33 : { 'class' : 'PowerCap',
168 'os_path' : '/sys/class/hwmon/hwmon1/user_powercap' },
169}
Brad Bishop53066752016-09-21 08:48:04 -0400170
171# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4