Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
Stefan Reinauer | 5ff7c13 | 2011-10-31 12:56:45 -0700 | [diff] [blame] | 3 | * |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License as |
| 6 | * published by the Free Software Foundation; version 2 of |
| 7 | * the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 13 | */ |
| 14 | |
Kyösti Mälkki | 3ee8b75 | 2019-03-03 00:35:15 +0200 | [diff] [blame] | 15 | #include <stdint.h> |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 16 | #include <console/console.h> |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 17 | #if CONFIG(POST_IO) |
Kyösti Mälkki | 3ee8b75 | 2019-03-03 00:35:15 +0200 | [diff] [blame] | 18 | #include <arch/io.h> |
| 19 | #endif |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 20 | |
| 21 | /* Write POST information */ |
| 22 | |
Alexandru Gagniuc | f88204e | 2012-08-03 13:20:57 -0500 | [diff] [blame] | 23 | /* Some mainboards have very nice features beyond just a simple display. |
| 24 | * They can override this function. |
| 25 | */ |
Kyösti Mälkki | 0e557ab | 2020-01-03 12:23:52 +0200 | [diff] [blame] | 26 | void __weak mainboard_post(uint8_t value) { } |
Duncan Laurie | b6e97b1 | 2012-09-09 19:09:56 -0700 | [diff] [blame] | 27 | |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 28 | void post_code(uint8_t value) |
| 29 | { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 30 | #if !CONFIG(NO_POST) |
| 31 | #if CONFIG(CONSOLE_POST) |
Stefan Reinauer | d686522 | 2015-01-05 13:12:38 -0800 | [diff] [blame] | 32 | printk(BIOS_EMERG, "POST: 0x%02x\n", value); |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 33 | #endif |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 34 | #if CONFIG(CMOS_POST) |
Duncan Laurie | b6e97b1 | 2012-09-09 19:09:56 -0700 | [diff] [blame] | 35 | cmos_post_code(value); |
| 36 | #endif |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 37 | #if CONFIG(POST_IO) |
Idwer Vollering | 5809a73 | 2014-03-11 15:36:21 +0000 | [diff] [blame] | 38 | outb(value, CONFIG_POST_IO_PORT); |
David Hendricks | 6b908d0 | 2012-11-05 12:34:09 -0800 | [diff] [blame] | 39 | #endif |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 40 | #endif |
Alexandru Gagniuc | f88204e | 2012-08-03 13:20:57 -0500 | [diff] [blame] | 41 | mainboard_post(value); |
Stefan Reinauer | abc0c85 | 2010-11-22 08:09:50 +0000 | [diff] [blame] | 42 | } |