Vadim Bendebury | 32da8be | 2011-09-29 17:27:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Vadim Bendebury | 32da8be | 2011-09-29 17:27:15 -0700 | [diff] [blame] | 14 | */ |
| 15 | #ifndef _CONSOLE_CBMEM_CONSOLE_H_ |
| 16 | #define _CONSOLE_CBMEM_CONSOLE_H_ |
| 17 | |
Kyösti Mälkki | f339086 | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 18 | #include <rules.h> |
| 19 | #include <stdint.h> |
| 20 | |
Vadim Bendebury | 32da8be | 2011-09-29 17:27:15 -0700 | [diff] [blame] | 21 | void cbmemc_init(void); |
Vadim Bendebury | 32da8be | 2011-09-29 17:27:15 -0700 | [diff] [blame] | 22 | void cbmemc_tx_byte(unsigned char data); |
Kyösti Mälkki | f339086 | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 23 | |
Kyösti Mälkki | f339086 | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 24 | #define __CBMEM_CONSOLE_ENABLE__ CONFIG_CONSOLE_CBMEM && \ |
Aaron Durbin | 079fb3f | 2015-10-07 15:41:45 -0500 | [diff] [blame] | 25 | (ENV_RAMSTAGE || ENV_VERSTAGE || \ |
| 26 | (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && \ |
| 27 | (ENV_ROMSTAGE || (ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE)))\ |
| 28 | ) |
Kyösti Mälkki | f339086 | 2014-02-26 15:19:04 +0200 | [diff] [blame] | 29 | |
| 30 | #if __CBMEM_CONSOLE_ENABLE__ |
| 31 | static inline void __cbmemc_init(void) { cbmemc_init(); } |
| 32 | static inline void __cbmemc_tx_byte(u8 data) { cbmemc_tx_byte(data); } |
| 33 | #else |
| 34 | static inline void __cbmemc_init(void) {} |
| 35 | static inline void __cbmemc_tx_byte(u8 data) {} |
Kyösti Mälkki | a2f6af3 | 2013-09-10 13:50:32 +0300 | [diff] [blame] | 36 | #endif |
Vadim Bendebury | 32da8be | 2011-09-29 17:27:15 -0700 | [diff] [blame] | 37 | |
Vadim Bendebury | 6e20e2f | 2015-04-10 18:04:04 -0700 | [diff] [blame] | 38 | void cbmem_dump_console(void); |
Vadim Bendebury | 32da8be | 2011-09-29 17:27:15 -0700 | [diff] [blame] | 39 | #endif |