blob: f8b398221eca22b22cfd6fca6b8c303bdeb29ac1 [file] [log] [blame]
Vadim Bendebury32da8be2011-09-29 17:27:15 -07001/*
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 Bendebury32da8be2011-09-29 17:27:15 -070014 */
15#ifndef _CONSOLE_CBMEM_CONSOLE_H_
16#define _CONSOLE_CBMEM_CONSOLE_H_
17
Kyösti Mälkkif3390862014-02-26 15:19:04 +020018#include <rules.h>
19#include <stdint.h>
20
Vadim Bendebury32da8be2011-09-29 17:27:15 -070021void cbmemc_init(void);
Vadim Bendebury32da8be2011-09-29 17:27:15 -070022void cbmemc_tx_byte(unsigned char data);
Kyösti Mälkkif3390862014-02-26 15:19:04 +020023
Lee Leahyf00e4462017-03-07 13:17:49 -080024#define __CBMEM_CONSOLE_ENABLE__ (CONFIG_CONSOLE_CBMEM && \
Aaron Durbin1e9a9142016-09-16 16:23:21 -050025 (ENV_RAMSTAGE || ENV_VERSTAGE || ENV_POSTCAR || \
Aaron Durbin079fb3f2015-10-07 15:41:45 -050026 (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && \
27 (ENV_ROMSTAGE || (ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE)))\
Lee Leahyf00e4462017-03-07 13:17:49 -080028 ))
Kyösti Mälkkif3390862014-02-26 15:19:04 +020029
30#if __CBMEM_CONSOLE_ENABLE__
31static inline void __cbmemc_init(void) { cbmemc_init(); }
32static inline void __cbmemc_tx_byte(u8 data) { cbmemc_tx_byte(data); }
33#else
34static inline void __cbmemc_init(void) {}
35static inline void __cbmemc_tx_byte(u8 data) {}
Kyösti Mälkkia2f6af32013-09-10 13:50:32 +030036#endif
Vadim Bendebury32da8be2011-09-29 17:27:15 -070037
Vadim Bendebury6e20e2f2015-04-10 18:04:04 -070038void cbmem_dump_console(void);
Vadim Bendebury32da8be2011-09-29 17:27:15 -070039#endif