blob: 35eae216a1f68469e99b289e43d1f3c9f6a7e2b7 [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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010017 * Foundation, Inc.
Vadim Bendebury32da8be2011-09-29 17:27:15 -070018 */
19#ifndef _CONSOLE_CBMEM_CONSOLE_H_
20#define _CONSOLE_CBMEM_CONSOLE_H_
21
Kyösti Mälkkif3390862014-02-26 15:19:04 +020022#include <rules.h>
23#include <stdint.h>
24
Vadim Bendebury32da8be2011-09-29 17:27:15 -070025void cbmemc_init(void);
Vadim Bendebury32da8be2011-09-29 17:27:15 -070026void cbmemc_tx_byte(unsigned char data);
Kyösti Mälkkif3390862014-02-26 15:19:04 +020027
Kyösti Mälkkif3390862014-02-26 15:19:04 +020028#define __CBMEM_CONSOLE_ENABLE__ CONFIG_CONSOLE_CBMEM && \
Aaron Durbin079fb3f2015-10-07 15:41:45 -050029 (ENV_RAMSTAGE || ENV_VERSTAGE || \
30 (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && \
31 (ENV_ROMSTAGE || (ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE)))\
32 )
Kyösti Mälkkif3390862014-02-26 15:19:04 +020033
34#if __CBMEM_CONSOLE_ENABLE__
35static inline void __cbmemc_init(void) { cbmemc_init(); }
36static inline void __cbmemc_tx_byte(u8 data) { cbmemc_tx_byte(data); }
37#else
38static inline void __cbmemc_init(void) {}
39static inline void __cbmemc_tx_byte(u8 data) {}
Kyösti Mälkkia2f6af32013-09-10 13:50:32 +030040#endif
Vadim Bendebury32da8be2011-09-29 17:27:15 -070041
Vadim Bendebury6e20e2f2015-04-10 18:04:04 -070042void cbmem_dump_console(void);
Vadim Bendebury32da8be2011-09-29 17:27:15 -070043#endif