blob: f3a146318fd9584140bf3096bdbbfe8f2438d6ad [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
Stefan Reinauerabc0c852010-11-22 08:09:50 +00003#include <console/console.h>
Elyes Haouas1bb4f842022-10-07 10:04:00 +02004#include <stdint.h>
Stefan Reinauerabc0c852010-11-22 08:09:50 +00005
6/* Write POST information */
Kyösti Mälkki10bc8062020-01-04 11:58:50 +02007void __weak arch_post_code(uint8_t value) { }
Martin Roth771806d2022-10-17 13:52:19 -06008void __weak soc_post_code(uint8_t value) { }
Stefan Reinauerabc0c852010-11-22 08:09:50 +00009
Alexandru Gagniucf88204e2012-08-03 13:20:57 -050010/* Some mainboards have very nice features beyond just a simple display.
11 * They can override this function.
12 */
Kyösti Mälkki0e557ab2020-01-03 12:23:52 +020013void __weak mainboard_post(uint8_t value) { }
Duncan Laurieb6e97b12012-09-09 19:09:56 -070014
Stefan Reinauerabc0c852010-11-22 08:09:50 +000015void post_code(uint8_t value)
16{
Kyösti Mälkki10bc8062020-01-04 11:58:50 +020017 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
Martin Roth771806d2022-10-17 13:52:19 -060022 soc_post_code(value);
23
Kyösti Mälkki10bc8062020-01-04 11:58:50 +020024 if (CONFIG(CONSOLE_POST))
Julius Werner5a835162022-02-07 16:35:42 -080025 printk(BIOS_INFO, "POST: 0x%02x\n", value);
Patrick Georgib4cac8f2020-01-14 19:07:48 +010026
27 mainboard_post(value);
Kyösti Mälkki10bc8062020-01-04 11:58:50 +020028 }
Stefan Reinauerabc0c852010-11-22 08:09:50 +000029}