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