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 | |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 3 | #include <console/console.h> |
Elyes Haouas | 1bb4f84 | 2022-10-07 10:04:00 +0200 | [diff] [blame] | 4 | #include <stdint.h> |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 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) { } |
Martin Roth | 771806d | 2022-10-17 13:52:19 -0600 | [diff] [blame] | 8 | void __weak soc_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 | |
Martin Roth | 771806d | 2022-10-17 13:52:19 -0600 | [diff] [blame] | 22 | soc_post_code(value); |
| 23 | |
Kyösti Mälkki | 10bc806 | 2020-01-04 11:58:50 +0200 | [diff] [blame] | 24 | if (CONFIG(CONSOLE_POST)) |
Julius Werner | 5a83516 | 2022-02-07 16:35:42 -0800 | [diff] [blame] | 25 | printk(BIOS_INFO, "POST: 0x%02x\n", value); |
Patrick Georgi | b4cac8f | 2020-01-14 19:07:48 +0100 | [diff] [blame] | 26 | |
| 27 | mainboard_post(value); |
Kyösti Mälkki | 10bc806 | 2020-01-04 11:58:50 +0200 | [diff] [blame] | 28 | } |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 29 | } |