blob: 13d3308995f3294550abacb20d05275eb5c113b1 [file] [log] [blame]
Joel Stanleyda7aad02016-10-24 17:23:15 +10301# Romulus.py
2#
Joel Stanleyda7aad02016-10-24 17:23:15 +10303
4SYSTEM_STATES = [
Patrick Williams75fe8cc2022-07-22 16:12:12 -05005 "BASE_APPS",
6 "BMC_STARTING",
7 "BMC_READY",
8 "HOST_POWERING_ON",
9 "HOST_POWERED_ON",
10 "HOST_BOOTING",
11 "HOST_BOOTED",
12 "HOST_POWERED_OFF",
Joel Stanleyda7aad02016-10-24 17:23:15 +103013]
14
15EXIT_STATE_DEPEND = {
Patrick Williams75fe8cc2022-07-22 16:12:12 -050016 "BASE_APPS": {
17 "/org/openbmc/sensors": 0,
Joel Stanleyda7aad02016-10-24 17:23:15 +103018 },
Patrick Williams75fe8cc2022-07-22 16:12:12 -050019 "BMC_STARTING": {
20 "/org/openbmc/control/chassis0": 0,
21 "/org/openbmc/control/power0": 0,
22 "/org/openbmc/control/flash/bios": 0,
Joel Stanleyda7aad02016-10-24 17:23:15 +103023 },
24}
25
26FRU_INSTANCES = {
Patrick Williams75fe8cc2022-07-22 16:12:12 -050027 "<inventory_root>/system": {
28 "fru_type": "SYSTEM",
29 "is_fru": True,
30 "present": "True",
31 },
32 "<inventory_root>/system/bios": {
33 "fru_type": "SYSTEM",
34 "is_fru": True,
35 "present": "True",
36 },
37 "<inventory_root>/system/misc": {
38 "fru_type": "SYSTEM",
39 "is_fru": False,
40 },
41 "<inventory_root>/system/chassis": {
42 "fru_type": "SYSTEM",
43 "is_fru": True,
44 "present": "True",
45 },
46 "<inventory_root>/system/chassis/motherboard": {
47 "fru_type": "MAIN_PLANAR",
48 "is_fru": True,
49 },
50 "<inventory_root>/system/systemevent": {
51 "fru_type": "SYSTEM_EVENT",
52 "is_fru": False,
53 },
54 "<inventory_root>/system/chassis/motherboard/refclock": {
55 "fru_type": "MAIN_PLANAR",
56 "is_fru": False,
57 },
58 "<inventory_root>/system/chassis/motherboard/pcieclock": {
59 "fru_type": "MAIN_PLANAR",
60 "is_fru": False,
61 },
62 "<inventory_root>/system/chassis/motherboard/todclock": {
63 "fru_type": "MAIN_PLANAR",
64 "is_fru": False,
65 },
66 "<inventory_root>/system/chassis/motherboard/apss": {
67 "fru_type": "MAIN_PLANAR",
68 "is_fru": False,
69 },
70 "<inventory_root>/system/chassis/fan0": {
71 "fru_type": "FAN",
72 "is_fru": True,
73 },
74 "<inventory_root>/system/chassis/fan1": {
75 "fru_type": "FAN",
76 "is_fru": True,
77 },
78 "<inventory_root>/system/chassis/fan2": {
79 "fru_type": "FAN",
80 "is_fru": True,
81 },
82 "<inventory_root>/system/chassis/fan3": {
83 "fru_type": "FAN",
84 "is_fru": True,
85 },
86 "<inventory_root>/system/chassis/motherboard/bmc": {
87 "fru_type": "BMC",
88 "is_fru": False,
89 "manufacturer": "ASPEED",
90 },
91 "<inventory_root>/system/chassis/motherboard/cpu0": {
92 "fru_type": "CPU",
93 "is_fru": True,
94 },
95 "<inventory_root>/system/chassis/motherboard/cpu1": {
96 "fru_type": "CPU",
97 "is_fru": True,
98 },
99 "<inventory_root>/system/chassis/motherboard/cpu0/core0": {
100 "fru_type": "CORE",
101 "is_fru": False,
102 },
103 "<inventory_root>/system/chassis/motherboard/cpu0/core1": {
104 "fru_type": "CORE",
105 "is_fru": False,
106 },
107 "<inventory_root>/system/chassis/motherboard/cpu0/core2": {
108 "fru_type": "CORE",
109 "is_fru": False,
110 },
111 "<inventory_root>/system/chassis/motherboard/cpu0/core3": {
112 "fru_type": "CORE",
113 "is_fru": False,
114 },
115 "<inventory_root>/system/chassis/motherboard/cpu0/core4": {
116 "fru_type": "CORE",
117 "is_fru": False,
118 },
119 "<inventory_root>/system/chassis/motherboard/cpu0/core5": {
120 "fru_type": "CORE",
121 "is_fru": False,
122 },
123 "<inventory_root>/system/chassis/motherboard/cpu0/core6": {
124 "fru_type": "CORE",
125 "is_fru": False,
126 },
127 "<inventory_root>/system/chassis/motherboard/cpu0/core7": {
128 "fru_type": "CORE",
129 "is_fru": False,
130 },
131 "<inventory_root>/system/chassis/motherboard/cpu0/core8": {
132 "fru_type": "CORE",
133 "is_fru": False,
134 },
135 "<inventory_root>/system/chassis/motherboard/cpu0/core9": {
136 "fru_type": "CORE",
137 "is_fru": False,
138 },
139 "<inventory_root>/system/chassis/motherboard/cpu0/core10": {
140 "fru_type": "CORE",
141 "is_fru": False,
142 },
143 "<inventory_root>/system/chassis/motherboard/cpu0/core11": {
144 "fru_type": "CORE",
145 "is_fru": False,
146 },
147 "<inventory_root>/system/chassis/motherboard/cpu0/core12": {
148 "fru_type": "CORE",
149 "is_fru": False,
150 },
151 "<inventory_root>/system/chassis/motherboard/cpu0/core13": {
152 "fru_type": "CORE",
153 "is_fru": False,
154 },
155 "<inventory_root>/system/chassis/motherboard/cpu0/core14": {
156 "fru_type": "CORE",
157 "is_fru": False,
158 },
159 "<inventory_root>/system/chassis/motherboard/cpu0/core15": {
160 "fru_type": "CORE",
161 "is_fru": False,
162 },
163 "<inventory_root>/system/chassis/motherboard/cpu0/core16": {
164 "fru_type": "CORE",
165 "is_fru": False,
166 },
167 "<inventory_root>/system/chassis/motherboard/cpu0/core17": {
168 "fru_type": "CORE",
169 "is_fru": False,
170 },
171 "<inventory_root>/system/chassis/motherboard/cpu0/core18": {
172 "fru_type": "CORE",
173 "is_fru": False,
174 },
175 "<inventory_root>/system/chassis/motherboard/cpu0/core19": {
176 "fru_type": "CORE",
177 "is_fru": False,
178 },
179 "<inventory_root>/system/chassis/motherboard/cpu0/core20": {
180 "fru_type": "CORE",
181 "is_fru": False,
182 },
183 "<inventory_root>/system/chassis/motherboard/cpu0/core21": {
184 "fru_type": "CORE",
185 "is_fru": False,
186 },
187 "<inventory_root>/system/chassis/motherboard/cpu0/core22": {
188 "fru_type": "CORE",
189 "is_fru": False,
190 },
191 "<inventory_root>/system/chassis/motherboard/cpu0/core23": {
192 "fru_type": "CORE",
193 "is_fru": False,
194 },
195 "<inventory_root>/system/chassis/motherboard/cpu1/core0": {
196 "fru_type": "CORE",
197 "is_fru": False,
198 },
199 "<inventory_root>/system/chassis/motherboard/cpu1/core1": {
200 "fru_type": "CORE",
201 "is_fru": False,
202 },
203 "<inventory_root>/system/chassis/motherboard/cpu1/core2": {
204 "fru_type": "CORE",
205 "is_fru": False,
206 },
207 "<inventory_root>/system/chassis/motherboard/cpu1/core3": {
208 "fru_type": "CORE",
209 "is_fru": False,
210 },
211 "<inventory_root>/system/chassis/motherboard/cpu1/core4": {
212 "fru_type": "CORE",
213 "is_fru": False,
214 },
215 "<inventory_root>/system/chassis/motherboard/cpu1/core5": {
216 "fru_type": "CORE",
217 "is_fru": False,
218 },
219 "<inventory_root>/system/chassis/motherboard/cpu1/core6": {
220 "fru_type": "CORE",
221 "is_fru": False,
222 },
223 "<inventory_root>/system/chassis/motherboard/cpu1/core7": {
224 "fru_type": "CORE",
225 "is_fru": False,
226 },
227 "<inventory_root>/system/chassis/motherboard/cpu1/core8": {
228 "fru_type": "CORE",
229 "is_fru": False,
230 },
231 "<inventory_root>/system/chassis/motherboard/cpu1/core9": {
232 "fru_type": "CORE",
233 "is_fru": False,
234 },
235 "<inventory_root>/system/chassis/motherboard/cpu1/core10": {
236 "fru_type": "CORE",
237 "is_fru": False,
238 },
239 "<inventory_root>/system/chassis/motherboard/cpu1/core11": {
240 "fru_type": "CORE",
241 "is_fru": False,
242 },
243 "<inventory_root>/system/chassis/motherboard/cpu1/core12": {
244 "fru_type": "CORE",
245 "is_fru": False,
246 },
247 "<inventory_root>/system/chassis/motherboard/cpu1/core13": {
248 "fru_type": "CORE",
249 "is_fru": False,
250 },
251 "<inventory_root>/system/chassis/motherboard/cpu1/core14": {
252 "fru_type": "CORE",
253 "is_fru": False,
254 },
255 "<inventory_root>/system/chassis/motherboard/cpu1/core15": {
256 "fru_type": "CORE",
257 "is_fru": False,
258 },
259 "<inventory_root>/system/chassis/motherboard/cpu1/core16": {
260 "fru_type": "CORE",
261 "is_fru": False,
262 },
263 "<inventory_root>/system/chassis/motherboard/cpu1/core17": {
264 "fru_type": "CORE",
265 "is_fru": False,
266 },
267 "<inventory_root>/system/chassis/motherboard/cpu1/core18": {
268 "fru_type": "CORE",
269 "is_fru": False,
270 },
271 "<inventory_root>/system/chassis/motherboard/cpu1/core19": {
272 "fru_type": "CORE",
273 "is_fru": False,
274 },
275 "<inventory_root>/system/chassis/motherboard/cpu1/core20": {
276 "fru_type": "CORE",
277 "is_fru": False,
278 },
279 "<inventory_root>/system/chassis/motherboard/cpu1/core21": {
280 "fru_type": "CORE",
281 "is_fru": False,
282 },
283 "<inventory_root>/system/chassis/motherboard/cpu1/core22": {
284 "fru_type": "CORE",
285 "is_fru": False,
286 },
287 "<inventory_root>/system/chassis/motherboard/cpu1/core23": {
288 "fru_type": "CORE",
289 "is_fru": False,
290 },
291 "<inventory_root>/system/chassis/motherboard/dimm0": {
292 "fru_type": "DIMM",
293 "is_fru": True,
294 },
295 "<inventory_root>/system/chassis/motherboard/dimm1": {
296 "fru_type": "DIMM",
297 "is_fru": True,
298 },
299 "<inventory_root>/system/chassis/motherboard/dimm2": {
300 "fru_type": "DIMM",
301 "is_fru": True,
302 },
303 "<inventory_root>/system/chassis/motherboard/dimm3": {
304 "fru_type": "DIMM",
305 "is_fru": True,
306 },
307 "<inventory_root>/system/chassis/motherboard/dimm4": {
308 "fru_type": "DIMM",
309 "is_fru": True,
310 },
311 "<inventory_root>/system/chassis/motherboard/dimm5": {
312 "fru_type": "DIMM",
313 "is_fru": True,
314 },
315 "<inventory_root>/system/chassis/motherboard/dimm6": {
316 "fru_type": "DIMM",
317 "is_fru": True,
318 },
319 "<inventory_root>/system/chassis/motherboard/dimm7": {
320 "fru_type": "DIMM",
321 "is_fru": True,
322 },
323 "<inventory_root>/system/chassis/motherboard/dimm8": {
324 "fru_type": "DIMM",
325 "is_fru": True,
326 },
327 "<inventory_root>/system/chassis/motherboard/dimm9": {
328 "fru_type": "DIMM",
329 "is_fru": True,
330 },
331 "<inventory_root>/system/chassis/motherboard/dimm10": {
332 "fru_type": "DIMM",
333 "is_fru": True,
334 },
335 "<inventory_root>/system/chassis/motherboard/dimm11": {
336 "fru_type": "DIMM",
337 "is_fru": True,
338 },
339 "<inventory_root>/system/chassis/motherboard/dimm12": {
340 "fru_type": "DIMM",
341 "is_fru": True,
342 },
343 "<inventory_root>/system/chassis/motherboard/dimm13": {
344 "fru_type": "DIMM",
345 "is_fru": True,
346 },
347 "<inventory_root>/system/chassis/motherboard/dimm14": {
348 "fru_type": "DIMM",
349 "is_fru": True,
350 },
351 "<inventory_root>/system/chassis/motherboard/dimm15": {
352 "fru_type": "DIMM",
353 "is_fru": True,
354 },
Joel Stanleyda7aad02016-10-24 17:23:15 +1030355}
356
357ID_LOOKUP = {
Patrick Williams75fe8cc2022-07-22 16:12:12 -0500358 "FRU": {
359 0x01: "<inventory_root>/system/chassis/motherboard/cpu0",
360 0x02: "<inventory_root>/system/chassis/motherboard/cpu1",
361 0x03: "<inventory_root>/system/chassis/motherboard",
362 0x04: "<inventory_root>/system/chassis/motherboard/dimm0",
363 0x05: "<inventory_root>/system/chassis/motherboard/dimm1",
364 0x06: "<inventory_root>/system/chassis/motherboard/dimm2",
365 0x07: "<inventory_root>/system/chassis/motherboard/dimm3",
366 0x08: "<inventory_root>/system/chassis/motherboard/dimm4",
367 0x09: "<inventory_root>/system/chassis/motherboard/dimm5",
368 0x0A: "<inventory_root>/system/chassis/motherboard/dimm6",
369 0x0B: "<inventory_root>/system/chassis/motherboard/dimm7",
370 0x0C: "<inventory_root>/system/chassis/motherboard/dimm8",
371 0x0D: "<inventory_root>/system/chassis/motherboard/dimm9",
372 0x0E: "<inventory_root>/system/chassis/motherboard/dimm10",
373 0x0F: "<inventory_root>/system/chassis/motherboard/dimm11",
374 0x10: "<inventory_root>/system/chassis/motherboard/dimm12",
375 0x11: "<inventory_root>/system/chassis/motherboard/dimm13",
376 0x12: "<inventory_root>/system/chassis/motherboard/dimm14",
377 0x13: "<inventory_root>/system/chassis/motherboard/dimm15",
Joel Stanleyda7aad02016-10-24 17:23:15 +1030378 },
Patrick Williams75fe8cc2022-07-22 16:12:12 -0500379 "FRU_STR": {
380 "PRODUCT_0": "<inventory_root>/system/bios",
381 "BOARD_1": "<inventory_root>/system/chassis/motherboard/cpu0",
382 "BOARD_2": "<inventory_root>/system/chassis/motherboard/cpu1",
383 "CHASSIS_3": "<inventory_root>/system/chassis/motherboard",
384 "BOARD_3": "<inventory_root>/system/misc",
385 "PRODUCT_12": "<inventory_root>/system/chassis/motherboard/dimm0",
386 "PRODUCT_13": "<inventory_root>/system/chassis/motherboard/dimm1",
387 "PRODUCT_14": "<inventory_root>/system/chassis/motherboard/dimm2",
388 "PRODUCT_15": "<inventory_root>/system/chassis/motherboard/dimm3",
389 "PRODUCT_16": "<inventory_root>/system/chassis/motherboard/dimm4",
390 "PRODUCT_17": "<inventory_root>/system/chassis/motherboard/dimm5",
391 "PRODUCT_18": "<inventory_root>/system/chassis/motherboard/dimm6",
392 "PRODUCT_19": "<inventory_root>/system/chassis/motherboard/dimm7",
393 "PRODUCT_20": "<inventory_root>/system/chassis/motherboard/dimm8",
394 "PRODUCT_21": "<inventory_root>/system/chassis/motherboard/dimm9",
395 "PRODUCT_22": "<inventory_root>/system/chassis/motherboard/dimm10",
396 "PRODUCT_23": "<inventory_root>/system/chassis/motherboard/dimm11",
397 "PRODUCT_24": "<inventory_root>/system/chassis/motherboard/dimm12",
398 "PRODUCT_25": "<inventory_root>/system/chassis/motherboard/dimm13",
399 "PRODUCT_26": "<inventory_root>/system/chassis/motherboard/dimm14",
400 "PRODUCT_27": "<inventory_root>/system/chassis/motherboard/dimm15",
401 "PRODUCT_47": "<inventory_root>/system/misc",
Joel Stanleyda7aad02016-10-24 17:23:15 +1030402 },
Patrick Williams75fe8cc2022-07-22 16:12:12 -0500403 "SENSOR": {
404 0x01: "/org/openbmc/sensors/host/HostStatus",
405 0x02: "/org/openbmc/sensors/host/BootProgress",
406 0x08: "<inventory_root>/system/chassis/motherboard/cpu0",
407 0x09: "<inventory_root>/system/chassis/motherboard/cpu1",
408 0x0B: "<inventory_root>/system/chassis/motherboard/dimm0",
409 0x0C: "<inventory_root>/system/chassis/motherboard/dimm1",
410 0x0D: "<inventory_root>/system/chassis/motherboard/dimm2",
411 0x0E: "<inventory_root>/system/chassis/motherboard/dimm3",
412 0x0F: "<inventory_root>/system/chassis/motherboard/dimm4",
413 0x10: "<inventory_root>/system/chassis/motherboard/dimm5",
414 0x11: "<inventory_root>/system/chassis/motherboard/dimm6",
415 0x12: "<inventory_root>/system/chassis/motherboard/dimm7",
416 0x13: "<inventory_root>/system/chassis/motherboard/dimm8",
417 0x14: "<inventory_root>/system/chassis/motherboard/dimm9",
418 0x15: "<inventory_root>/system/chassis/motherboard/dimm10",
419 0x16: "<inventory_root>/system/chassis/motherboard/dimm11",
420 0x17: "<inventory_root>/system/chassis/motherboard/dimm12",
421 0x18: "<inventory_root>/system/chassis/motherboard/dimm13",
422 0x19: "<inventory_root>/system/chassis/motherboard/dimm14",
423 0x1A: "<inventory_root>/system/chassis/motherboard/dimm15",
424 0x2B: "<inventory_root>/system/chassis/motherboard/cpu0/core0",
425 0x2C: "<inventory_root>/system/chassis/motherboard/cpu0/core1",
426 0x2D: "<inventory_root>/system/chassis/motherboard/cpu0/core2",
427 0x2E: "<inventory_root>/system/chassis/motherboard/cpu0/core3",
428 0x2F: "<inventory_root>/system/chassis/motherboard/cpu0/core4",
429 0x30: "<inventory_root>/system/chassis/motherboard/cpu0/core5",
430 0x31: "<inventory_root>/system/chassis/motherboard/cpu0/core6",
431 0x32: "<inventory_root>/system/chassis/motherboard/cpu0/core7",
432 0x33: "<inventory_root>/system/chassis/motherboard/cpu0/core8",
433 0x34: "<inventory_root>/system/chassis/motherboard/cpu0/core9",
434 0x35: "<inventory_root>/system/chassis/motherboard/cpu0/core10",
435 0x36: "<inventory_root>/system/chassis/motherboard/cpu0/core11",
436 0x37: "<inventory_root>/system/chassis/motherboard/cpu0/core12",
437 0x38: "<inventory_root>/system/chassis/motherboard/cpu0/core13",
438 0x39: "<inventory_root>/system/chassis/motherboard/cpu0/core14",
439 0x3A: "<inventory_root>/system/chassis/motherboard/cpu0/core15",
440 0x3B: "<inventory_root>/system/chassis/motherboard/cpu0/core16",
441 0x3C: "<inventory_root>/system/chassis/motherboard/cpu0/core17",
442 0x3D: "<inventory_root>/system/chassis/motherboard/cpu0/core18",
443 0x3E: "<inventory_root>/system/chassis/motherboard/cpu0/core19",
444 0x3F: "<inventory_root>/system/chassis/motherboard/cpu0/core20",
445 0x40: "<inventory_root>/system/chassis/motherboard/cpu0/core21",
446 0x41: "<inventory_root>/system/chassis/motherboard/cpu0/core22",
447 0x42: "<inventory_root>/system/chassis/motherboard/cpu0/core23",
448 0x43: "<inventory_root>/system/chassis/motherboard/cpu1/core0",
449 0x44: "<inventory_root>/system/chassis/motherboard/cpu1/core1",
450 0x45: "<inventory_root>/system/chassis/motherboard/cpu1/core2",
451 0x46: "<inventory_root>/system/chassis/motherboard/cpu1/core3",
452 0x47: "<inventory_root>/system/chassis/motherboard/cpu1/core4",
453 0x48: "<inventory_root>/system/chassis/motherboard/cpu1/core5",
454 0x49: "<inventory_root>/system/chassis/motherboard/cpu1/core6",
455 0x4A: "<inventory_root>/system/chassis/motherboard/cpu1/core7",
456 0x4B: "<inventory_root>/system/chassis/motherboard/cpu1/core8",
457 0x4C: "<inventory_root>/system/chassis/motherboard/cpu1/core9",
458 0x4D: "<inventory_root>/system/chassis/motherboard/cpu1/core10",
459 0x4E: "<inventory_root>/system/chassis/motherboard/cpu1/core11",
460 0x4F: "<inventory_root>/system/chassis/motherboard/cpu1/core12",
461 0x50: "<inventory_root>/system/chassis/motherboard/cpu1/core13",
462 0x51: "<inventory_root>/system/chassis/motherboard/cpu1/core14",
463 0x52: "<inventory_root>/system/chassis/motherboard/cpu1/core15",
464 0x53: "<inventory_root>/system/chassis/motherboard/cpu1/core16",
465 0x54: "<inventory_root>/system/chassis/motherboard/cpu1/core17",
466 0x55: "<inventory_root>/system/chassis/motherboard/cpu1/core18",
467 0x56: "<inventory_root>/system/chassis/motherboard/cpu1/core19",
468 0x57: "<inventory_root>/system/chassis/motherboard/cpu1/core20",
469 0x58: "<inventory_root>/system/chassis/motherboard/cpu1/core21",
470 0x59: "<inventory_root>/system/chassis/motherboard/cpu1/core22",
471 0x5A: "<inventory_root>/system/chassis/motherboard/cpu1/core23",
472 0x8B: "/org/openbmc/sensors/host/BootCount",
473 0x8C: "<inventory_root>/system/chassis/motherboard",
474 0x8D: "<inventory_root>/system/chassis/motherboard/refclock",
475 0x8E: "<inventory_root>/system/chassis/motherboard/pcieclock",
476 0x8F: "<inventory_root>/system/chassis/motherboard/todclock",
477 0x90: "<inventory_root>/system/systemevent",
478 0x91: "/org/openbmc/sensors/host/OperatingSystemStatus",
479 0x92: "<inventory_root>/system/chassis/motherboard/pcielink",
480 # 0x08 : '<inventory_root>/system/powerlimit',
481 # 0x10 : '<inventory_root>/system/chassis/motherboard/apss',
Joel Stanleyda7aad02016-10-24 17:23:15 +1030482 },
Patrick Williams75fe8cc2022-07-22 16:12:12 -0500483 "GPIO_PRESENT": {},
Joel Stanleyda7aad02016-10-24 17:23:15 +1030484}
485
Joel Stanleyda7aad02016-10-24 17:23:15 +1030486# Miscellaneous non-poll sensor with system specific properties.
487# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
Patrick Williams75fe8cc2022-07-22 16:12:12 -0500488MISC_SENSORS = {}
Joel Stanleyda7aad02016-10-24 17:23:15 +1030489
490# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4