Angel Pons | b706ab3 | 2020-04-02 23:48:09 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 2 | |
Kyösti Mälkki | 3ee8b75 | 2019-03-03 00:35:15 +0200 | [diff] [blame] | 3 | #include <stdint.h> |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 4 | #include <console/console.h> |
| 5 | |
| 6 | /* Write POST information */ |
Kyösti Mälkki | 10bc806 | 2020-01-04 11:58:50 +0200 | [diff] [blame] | 7 | void __weak arch_post_code(uint8_t value) { } |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 8 | |
Alexandru Gagniuc | f88204e | 2012-08-03 13:20:57 -0500 | [diff] [blame] | 9 | /* Some mainboards have very nice features beyond just a simple display. |
| 10 | * They can override this function. |
| 11 | */ |
Kyösti Mälkki | 0e557ab | 2020-01-03 12:23:52 +0200 | [diff] [blame] | 12 | void __weak mainboard_post(uint8_t value) { } |
Duncan Laurie | b6e97b1 | 2012-09-09 19:09:56 -0700 | [diff] [blame] | 13 | |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 14 | void post_code(uint8_t value) |
| 15 | { |
Kyösti Mälkki | 10bc806 | 2020-01-04 11:58:50 +0200 | [diff] [blame] | 16 | 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 Werner | 5a83516 | 2022-02-07 16:35:42 -0800 | [diff] [blame] | 22 | printk(BIOS_INFO, "POST: 0x%02x\n", value); |
Patrick Georgi | b4cac8f | 2020-01-14 19:07:48 +0100 | [diff] [blame] | 23 | |
| 24 | mainboard_post(value); |
Kyösti Mälkki | 10bc806 | 2020-01-04 11:58:50 +0200 | [diff] [blame] | 25 | } |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 26 | } |