blob: 1d99a2e9dd3675077bb14ebfc16e8bca284e73fd [file] [log] [blame]
Angel Ponsb706ab32020-04-02 23:48:09 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauerabc0c852010-11-22 08:09:50 +00002
Kyösti Mälkki3ee8b752019-03-03 00:35:15 +02003#include <stdint.h>
Stefan Reinauerabc0c852010-11-22 08:09:50 +00004#include <console/console.h>
5
6/* Write POST information */
Kyösti Mälkki10bc8062020-01-04 11:58:50 +02007void __weak arch_post_code(uint8_t value) { }
Stefan Reinauerabc0c852010-11-22 08:09:50 +00008
Alexandru Gagniucf88204e2012-08-03 13:20:57 -05009/* Some mainboards have very nice features beyond just a simple display.
10 * They can override this function.
11 */
Kyösti Mälkki0e557ab2020-01-03 12:23:52 +020012void __weak mainboard_post(uint8_t value) { }
Duncan Laurieb6e97b12012-09-09 19:09:56 -070013
Stefan Reinauerabc0c852010-11-22 08:09:50 +000014void post_code(uint8_t value)
15{
Kyösti Mälkki10bc8062020-01-04 11:58:50 +020016 if (!CONFIG(NO_POST)) {
17 /* Assume this to be the most reliable and simplest type
18 for displaying POST so keep it first. */
19 arch_post_code(value);
20
21 if (CONFIG(CONSOLE_POST))
Julius Werner5a835162022-02-07 16:35:42 -080022 printk(BIOS_INFO, "POST: 0x%02x\n", value);
Patrick Georgib4cac8f2020-01-14 19:07:48 +010023
24 mainboard_post(value);
Kyösti Mälkki10bc8062020-01-04 11:58:50 +020025 }
Stefan Reinauerabc0c852010-11-22 08:09:50 +000026}