coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
post_codes.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /**
4  * @file post_codes.h
5  */
6 
7 /*
8  * This aims to be a central point for POST codes used throughout coreboot.
9  * All POST codes should be declared here as macros, and post_code() should
10  * be used with the macros instead of hardcoded values. This allows us to
11  * quickly reference POST codes when nothing is working
12  *
13  * The format for a POST code macro is
14  * #define POST_WHAT_WE_COMMUNICATE_IS_HAPPENING_WHEN_THIS_CODE_IS_POSTED
15  * Lets's keep it at POST_* instead of POST_CODE_*
16  *
17  * This file is also included by early assembly files. Only use #define s;
18  * no function prototypes allowed here
19  *
20  * DOCUMENTATION:
21  * Please document any and all post codes using Doxygen style comments. We
22  * want to be able to generate a verbose enough documentation that is useful
23  * during debugging. Failure to do so will result in your patch being rejected
24  * without any explanation or effort on part of the maintainers.
25  *
26  */
27 
28 #ifndef POST_CODES_H
29 #define POST_CODES_H
30 
31 /**
32  * \brief Entry into 'crt0.s'. reset code jumps to here
33  *
34  * First instruction that gets executed after the reset vector jumps.
35  * This indicates that the reset vector points to the correct code segment.
36  */
37 #define POST_RESET_VECTOR_CORRECT 0x01
38 
39 /**
40  * \brief Entry into protected mode
41  *
42  * Preparing to enter protected mode. This is POSTed right before changing to
43  * protected mode.
44  */
45 #define POST_ENTER_PROTECTED_MODE 0x10
46 
47 /**
48  * \brief Start copying coreboot to RAM with decompression if compressed
49  *
50  * POSTed before ramstage is about to be loaded into memory
51  */
52 #define POST_PREPARE_RAMSTAGE 0x11
53 
54 /**
55  * \brief Copy/decompression finished; jumping to RAM
56  *
57  * This is called after ramstage is loaded in memory, and before
58  * the code jumps there. This represents the end of romstage.
59  */
60 #define POST_RAMSTAGE_IS_PREPARED 0x12
61 
62 /**
63  * \brief Entry into c_start
64  *
65  * c_start.S is the first code executing in ramstage.
66  */
67 #define POST_ENTRY_C_START 0x13
68 
69 /**
70  * \brief Pre-memory init preparation start
71  *
72  * Post code emitted in romstage before making callbacks to allow SoC/mainboard
73  * to prepare params for FSP memory init.
74  */
75 #define POST_MEM_PREINIT_PREP_START 0x34
76 
77 /**
78  * \brief Pre-memory init preparation end
79  *
80  * Post code emitted in romstage after returning from SoC/mainboard callbacks
81  * to prepare params for FSP memory init.
82  */
83 #define POST_MEM_PREINIT_PREP_END 0x36
84 
85 /**
86  * \brief Console is initialized
87  *
88  * The console is initialized and is ready for usage
89  */
90 #define POST_CONSOLE_READY 0x39
91 
92 /**
93  * \brief Console boot message succeeded
94  *
95  * First console message has been successfully sent through the console backend
96  * driver.
97  */
98 #define POST_CONSOLE_BOOT_MSG 0x40
99 
100 /**
101  * \brief Before enabling the cache
102  *
103  * Going to enable the cache
104  */
105 #define POST_ENABLING_CACHE 0x60
106 
107 /**
108  * \brief Pre call to RAM stage main()
109  *
110  * POSTed right before RAM stage main() is called from c_start.S
111  */
112 #define POST_PRE_HARDWAREMAIN 0x6e
113 
114 /**
115  * \brief Entry into coreboot in RAM stage main()
116  *
117  * This is the first call in hardwaremain.c. If this code is POSTed, then
118  * ramstage has successfully loaded and started executing.
119  */
120 #define POST_ENTRY_HARDWAREMAIN 0x6f
121 
122 /**
123  * \brief Before Device Probe
124  *
125  * Boot State Machine: bs_pre_device()
126  */
127 #define POST_BS_PRE_DEVICE 0x70
128 
129 /**
130  * \brief Initializing Chips
131  *
132  * Boot State Machine: bs_dev_init_chips()
133  */
134 #define POST_BS_DEV_INIT_CHIPS 0x71
135 
136 /**
137  * \brief Starting Device Enumeration
138  *
139  * Boot State Machine: bs_dev_enumerate()
140  */
141 #define POST_BS_DEV_ENUMERATE 0x72
142 
143 /**
144  * \brief Device Resource Allocation
145  *
146  * Boot State Machine: bs_dev_resources()
147  */
148 #define POST_BS_DEV_RESOURCES 0x73
149 
150 /**
151  * \brief Device Enable
152  *
153  * Boot State Machine: bs_dev_enable()
154  */
155 #define POST_BS_DEV_ENABLE 0x74
156 
157 /**
158  * \brief Device Initialization
159  *
160  * Boot State Machine: bs_dev_init()
161  */
162 #define POST_BS_DEV_INIT 0x75
163 
164 /**
165  * \brief After Device Probe
166  *
167  * Boot State Machine: bs_post_device()
168  */
169 #define POST_BS_POST_DEVICE 0x76
170 
171 /**
172  * \brief OS Resume Check
173  *
174  * Boot State Machine: bs_os_resume_check()
175  */
176 #define POST_BS_OS_RESUME_CHECK 0x77
177 
178 /**
179  * \brief OS Resume
180  *
181  * Boot State Machine: bs_os_resume()
182  */
183 #define POST_BS_OS_RESUME 0x78
184 
185 /**
186  * \brief Write Tables
187  *
188  * Boot State Machine: bs_write_tables()
189  */
190 #define POST_BS_WRITE_TABLES 0x79
191 
192 /**
193  * \brief Load Payload
194  *
195  * Boot State Machine: bs_payload_load()
196  */
197 #define POST_BS_PAYLOAD_LOAD 0x7a
198 
199 /**
200  * \brief Boot Payload
201  *
202  * Boot State Machine: bs_payload_boot()
203  */
204 #define POST_BS_PAYLOAD_BOOT 0x7b
205 
206 /**
207  * \brief Before calling FSP Notify (end of firmware)
208  *
209  * Going to call into FSP binary for Notify phase (end of firmware)
210  */
211 #define POST_FSP_NOTIFY_BEFORE_END_OF_FIRMWARE 0x88
212 
213 /**
214  * \brief After calling FSP Notify (end of firmware)
215  *
216  * Going to call into FSP binary for Notify phase (end of firmware)
217  */
218 #define POST_FSP_NOTIFY_AFTER_END_OF_FIRMWARE 0x89
219 
220 /**
221  * \brief Before calling FSP TempRamInit
222  *
223  * Going to call into FSP binary for TempRamInit phase
224  */
225 #define POST_FSP_TEMP_RAM_INIT 0x90
226 
227 /**
228  * \brief Before calling FSP TempRamExit
229  *
230  * Going to call into FSP binary for TempRamExit phase
231  */
232 #define POST_FSP_TEMP_RAM_EXIT 0x91
233 
234 /**
235  * \brief Before calling FSP MemoryInit
236  *
237  * Going to call into FSP binary for MemoryInit phase
238  */
239 #define POST_FSP_MEMORY_INIT 0x92
240 
241 /**
242  * \brief Before calling FSP SiliconInit
243  *
244  * Going to call into FSP binary for SiliconInit phase
245  */
246 #define POST_FSP_SILICON_INIT 0x93
247 
248 /**
249  * \brief Before calling FSP Notify (after PCI enumeration)
250  *
251  * Going to call into FSP binary for Notify phase (after PCI enumeration)
252  */
253 #define POST_FSP_NOTIFY_BEFORE_ENUMERATE 0x94
254 
255 /**
256  * \brief Before calling FSP Notify (ready to boot)
257  *
258  * Going to call into FSP binary for Notify phase (ready to boot)
259  */
260 #define POST_FSP_NOTIFY_BEFORE_FINALIZE 0x95
261 
262 /**
263  * \brief Indicate OS _PTS entry
264  *
265  * Called from _PTS asl method
266  */
267 #define POST_OS_ENTER_PTS 0x96
268 
269 /**
270  * \brief Indicate OS _WAK entry
271  *
272  * Called from within _WAK method
273  */
274 #define POST_OS_ENTER_WAKE 0x97
275 
276 /**
277  * \brief After calling FSP MemoryInit
278  *
279  * FSP binary returned from MemoryInit phase
280  */
281 #define POST_FSP_MEMORY_EXIT 0x98
282 
283 /**
284  * \brief After calling FSP SiliconInit
285  *
286  * FSP binary returned from SiliconInit phase
287  */
288 #define POST_FSP_SILICON_EXIT 0x99
289 
290 /**
291  * \brief Before calling FSP Multiphase SiliconInit
292  *
293  * Going to call into FSP binary for Multiple phase SI Init
294  */
295 #define POST_FSP_MULTI_PHASE_SI_INIT_ENTRY 0xa0
296 
297 /**
298  * \brief After calling FSP Multiphase SiliconInit
299  *
300  * FSP binary returned from Multiple phase SI Init
301  */
302 #define POST_FSP_MULTI_PHASE_SI_INIT_EXIT 0xa1
303 
304 /**
305  * \brief After calling FSP Notify (after PCI enumeration)
306  *
307  * Going to call into FSP binary for Notify phase (after PCI enumeration)
308  */
309 #define POST_FSP_NOTIFY_AFTER_ENUMERATE 0xa2
310 
311 /**
312  * \brief After calling FSP Notify (ready to boot)
313  *
314  * Going to call into FSP binary for Notify phase (ready to boot)
315  */
316 #define POST_FSP_NOTIFY_AFTER_FINALIZE 0xa3
317 
318 /**
319  * \brief Invalid or corrupt ROM
320  *
321  * Set if firmware failed to find or validate a resource that is stored in ROM.
322  */
323 #define POST_INVALID_ROM 0xe0
324 
325 /**
326  * \brief Invalid or corrupt CBFS
327  *
328  * Set if firmware failed to find or validate a resource that is stored in CBFS.
329  */
330 #define POST_INVALID_CBFS 0xe1
331 
332 /**
333  * \brief Vendor binary error
334  *
335  * Set if firmware failed to find or validate a vendor binary, or the binary
336  * generated a fatal error.
337  */
338 #define POST_INVALID_VENDOR_BINARY 0xe2
339 
340 /**
341  * \brief RAM failure
342  *
343  * Set if RAM could not be initialized. This includes RAM is missing,
344  * unsupported RAM configuration, or RAM failure.
345  */
346 #define POST_RAM_FAILURE 0xe3
347 
348 /**
349  * \brief Hardware initialization failure
350  *
351  * Set when a required hardware component was not found or is unsupported.
352  */
353 #define POST_HW_INIT_FAILURE 0xe4
354 
355 /**
356  * \brief Video failure
357  *
358  * Video subsystem failed to initialize.
359  */
360 #define POST_VIDEO_FAILURE 0xe5
361 
362 /**
363  * \brief TPM failure
364  *
365  * An error with the TPM, either unexpected state or communications failure.
366  */
367 #define POST_TPM_FAILURE 0xed
368 
369 /**
370  * \brief Not supposed to get here
371  *
372  * A function that should not have returned, returned
373  *
374  * Check the console output for details.
375  */
376 #define POST_DEAD_CODE 0xee
377 
378 /**
379  * \brief Resume from suspend failed
380  *
381  * This post code is sent when the firmware is expected to resume it is
382  * unable to do so.
383  */
384 #define POST_RESUME_FAILURE 0xef
385 
386 /**
387  * \brief Jumping to payload
388  *
389  * Called right before jumping to a payload. If the boot sequence stops with
390  * this code, chances are the payload freezes.
391  */
392 #define POST_JUMPING_TO_PAYLOAD 0xf3
393 
394 /**
395  * \brief Entry into elf boot
396  *
397  * This POST code is called right before invoking jmp_to_elf_entry()
398  * jmp_to_elf_entry() invokes the payload, and should never return
399  */
400 #define POST_ENTER_ELF_BOOT 0xf8
401 
402 /**
403  * \brief Final code before OS resumes
404  *
405  * Called right before jumping to the OS resume vector.
406  */
407 #define POST_OS_RESUME 0xfd
408 
409 /**
410  * \brief Final code before OS boots
411  *
412  * This may not be called depending on the payload used.
413  */
414 #define POST_OS_BOOT 0xfe
415 
416 /**
417  * \brief Elfload fail or die() called
418  *
419  * coreboot was not able to load the payload, no payload was detected
420  * or die() was called.
421  * \n
422  * If this code appears before entering ramstage, then most likely
423  * ramstage is corrupted, and reflashing of the ROM chip is needed.
424  * \n
425  * If this code appears after ramstage, there is a problem with the payload
426  * If the payload was built out-of-tree, check that it was compiled as
427  * a coreboot payload
428  * \n
429  * Check the console output to see exactly where the failure occurred.
430  */
431 #define POST_DIE 0xff
432 
433 #endif /* POST_CODES_H */