2010-09-27 20:49:46 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Eric Biederman
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
Remove address from GPLv2 headers
As per discussion with lawyers[tm], it's not a good idea to
shorten the license header too much - not for legal reasons
but because there are tools that look for them, and giving
them a standard pattern simplifies things.
However, we got confirmation that we don't have to update
every file ever added to coreboot whenever the FSF gets a
new lease, but can drop the address instead.
util/kconfig is excluded because that's imported code that
we may want to synchronize every now and then.
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} +
$ find * -type f
-a \! -name \*.patch \
-a \! -name \*_shipped \
-a \! -name LICENSE_GPL \
-a \! -name LGPL.txt \
-a \! -name COPYING \
-a \! -name DISCLAIMER \
-exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} +
Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9233
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2015-03-26 15:17:45 +01:00
|
|
|
* Foundation, Inc.
|
2010-09-27 20:49:46 +02:00
|
|
|
*/
|
|
|
|
|
2003-04-22 21:02:15 +02:00
|
|
|
#ifndef CONSOLE_CONSOLE_H_
|
|
|
|
#define CONSOLE_CONSOLE_H_
|
|
|
|
|
2010-09-27 22:51:33 +02:00
|
|
|
#include <stdint.h>
|
2014-02-26 14:19:04 +01:00
|
|
|
#include <rules.h>
|
2011-04-11 22:17:22 +02:00
|
|
|
#include <console/post_codes.h>
|
2015-01-05 22:12:38 +01:00
|
|
|
#include <console/loglevel.h>
|
2011-05-10 19:46:41 +02:00
|
|
|
|
2010-03-31 16:34:40 +02:00
|
|
|
#ifndef __ROMCC__
|
2014-04-23 22:11:40 +02:00
|
|
|
struct console_driver {
|
|
|
|
void (*init)(int);
|
|
|
|
void (*tx_byte)(int, unsigned char byte);
|
|
|
|
void (*tx_flush)(int);
|
|
|
|
unsigned char (*rx_byte)(int);
|
|
|
|
int (*tst_byte)(void);
|
|
|
|
};
|
|
|
|
|
2010-04-03 00:11:20 +02:00
|
|
|
void post_code(u8 value);
|
2013-06-10 19:21:41 +02:00
|
|
|
#if CONFIG_CMOS_POST_EXTRA
|
|
|
|
void post_log_extra(u32 value);
|
2013-06-10 19:34:20 +02:00
|
|
|
struct device;
|
|
|
|
void post_log_path(struct device *dev);
|
|
|
|
void post_log_clear(void);
|
2013-06-10 19:21:41 +02:00
|
|
|
#else
|
|
|
|
#define post_log_extra(x) do {} while (0)
|
2013-06-10 19:34:20 +02:00
|
|
|
#define post_log_path(x) do {} while (0)
|
|
|
|
#define post_log_clear() do {} while (0)
|
2013-06-10 19:21:41 +02:00
|
|
|
#endif
|
2012-08-03 20:20:57 +02:00
|
|
|
/* this function is weak and can be overridden by a mainboard function. */
|
|
|
|
void mainboard_post(u8 value);
|
2010-04-03 00:11:20 +02:00
|
|
|
void __attribute__ ((noreturn)) die(const char *msg);
|
2003-04-22 21:02:15 +02:00
|
|
|
|
2014-02-26 14:19:04 +01:00
|
|
|
#define __CONSOLE_ENABLE__ \
|
|
|
|
((ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE) || \
|
2015-05-13 20:37:43 +02:00
|
|
|
ENV_SECMON || ENV_VERSTAGE || \
|
2014-04-15 17:19:48 +02:00
|
|
|
ENV_ROMSTAGE || ENV_RAMSTAGE || (ENV_SMM && CONFIG_DEBUG_SMI))
|
2014-02-04 18:03:57 +01:00
|
|
|
|
2014-02-26 14:19:04 +01:00
|
|
|
#if __CONSOLE_ENABLE__
|
2014-02-27 18:30:18 +01:00
|
|
|
void console_init(void);
|
2014-02-26 14:19:04 +01:00
|
|
|
int console_log_level(int msg_level);
|
2014-02-04 18:03:57 +01:00
|
|
|
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
|
|
|
void do_putchar(unsigned char byte);
|
2013-02-06 14:51:15 +01:00
|
|
|
|
2014-02-26 14:19:04 +01:00
|
|
|
#define printk(LEVEL, fmt, args...) \
|
|
|
|
do { do_printk(LEVEL, fmt, ##args); } while(0)
|
2010-03-23 14:23:40 +01:00
|
|
|
|
2014-02-26 14:19:04 +01:00
|
|
|
#else
|
|
|
|
static inline void console_init(void) {}
|
|
|
|
static inline int console_log_level(int msg_level) { return 0; }
|
|
|
|
static inline void printk(int LEVEL, const char *fmt, ...) {}
|
|
|
|
static inline void do_putchar(unsigned char byte) {}
|
2014-02-04 18:03:57 +01:00
|
|
|
#endif
|
2013-02-06 14:51:15 +01:00
|
|
|
|
2014-03-06 15:55:05 +01:00
|
|
|
#if CONFIG_CHROMEOS
|
|
|
|
/* FIXME: Collision of varargs with AMD headers without guard. */
|
|
|
|
#include <console/vtxprintf.h>
|
2014-02-26 14:19:04 +01:00
|
|
|
#if __CONSOLE_ENABLE__
|
2015-05-01 23:48:54 +02:00
|
|
|
void do_printk_va_list(int msg_level, const char *fmt, va_list args);
|
2014-03-06 15:55:05 +01:00
|
|
|
#else
|
2015-05-01 23:48:54 +02:00
|
|
|
static inline void do_printk_va_list(int l, const char *fmt, va_list args) {}
|
2014-03-06 15:55:05 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2015-01-05 22:12:38 +01:00
|
|
|
#endif /* !__ROMCC__ */
|
2010-05-08 11:14:51 +02:00
|
|
|
|
2003-04-22 21:02:15 +02:00
|
|
|
#endif /* CONSOLE_CONSOLE_H_ */
|