xref: /aosp_15_r20/external/coreboot/src/console/post.c (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <stdint.h>
5 
6 /* Write POST information */
arch_post_code(uint8_t value)7 void __weak arch_post_code(uint8_t value) { }
soc_post_code(uint8_t value)8 void __weak soc_post_code(uint8_t value) { }
9 
10 /* Some mainboards have very nice features beyond just a simple display.
11  * They can override this function.
12  */
mainboard_post(uint8_t value)13 void __weak mainboard_post(uint8_t value) { }
14 
post_code(uint8_t value)15 void post_code(uint8_t value)
16 {
17 	if (!CONFIG(NO_POST)) {
18 		/* Assume this to be the most reliable and simplest type
19 		   for displaying POST so keep it first. */
20 		arch_post_code(value);
21 
22 		soc_post_code(value);
23 
24 		if (CONFIG(CONSOLE_POST))
25 			printk(BIOS_INFO, "POST: 0x%02x\n", value);
26 
27 		mainboard_post(value);
28 	}
29 }
30