From d6865222c84c9da02cb515329af6a5384638d521 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 5 Jan 2015 13:12:38 -0800 Subject: misc: Drop print_ implementation from non-romcc boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because we had no stack on romcc boards, we had a separate, not as powerful clone of printk: print_*. Back in the day, like more than half a decade ago, we migrated a lot of boards to printk, but we never cleaned up the existing code to be consistent. Instead, we worked around the problem with a very messy console.h (nowadays the mess is hidden in romstage_console.c and early_print.h) This patch cleans up the generic code pieces to use printk() on all non-ROMCC boards. Our two remaining ROMCC boards are fixed up in this commit: bifferos/bifferboard and dmp/vortex86ex. Change-Id: I16676eeabe5c892c8e3c9f3c0cd3bae2e8fd74b6 Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/8115 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Andrew Wu Reviewed-by: Kyösti Mälkki --- src/include/assert.h | 27 -------------------- src/include/console/console.h | 12 ++------- src/include/console/early_print.h | 54 --------------------------------------- src/include/console/streams.h | 7 ----- 4 files changed, 2 insertions(+), 98 deletions(-) (limited to 'src/include') diff --git a/src/include/assert.h b/src/include/assert.h index 9f624a931f..966449b286 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -22,31 +22,6 @@ #include -#if defined(__PRE_RAM__) && !CONFIG_CACHE_AS_RAM - -/* ROMCC versions */ -#define ASSERT(x) { \ - if(!(x)) { \ - print_emerg("ASSERTION FAILED: file '"); \ - print_emerg(__FILE__); \ - print_emerg("', line 0x"); \ - print_debug_hex32(__LINE__); \ - print_emerg("\n"); \ - /* die(""); */ \ - } \ -} - -#define BUG() { \ - print_emerg("BUG ENCOUNTERED: SYSTEM HALTED at file '");\ - print_emerg(__FILE__); \ - print_emerg("', line 0x"); \ - print_debug_hex32(__LINE__); \ - print_emerg("\n"); \ - /* die(""); */ \ -} - -#else - /* GCC and CAR versions */ #define ASSERT(x) { \ if (!(x)) { \ @@ -61,8 +36,6 @@ /* die(""); */ \ } -#endif /* defined(__PRE_RAM__) && !CONFIG_CACHE_AS_RAM */ - #define assert(statement) ASSERT(statement) #endif // __ASSERT_H__ diff --git a/src/include/console/console.h b/src/include/console/console.h index 9e98bfc59c..38e05b3fb1 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -23,6 +23,7 @@ #include #include #include +#include #ifndef __ROMCC__ void post_code(u8 value); @@ -70,15 +71,6 @@ static inline void do_vtxprintf(const char *fmt, va_list args) {}; #endif #endif -/* A lot of code still uses print_debug() et al. while use of printk() - * would be preferred. - */ -#include - -#else /* __ROMCC__ */ - -#include "arch/x86/lib/romcc_console.c" - -#endif /* __ROMCC__ */ +#endif /* !__ROMCC__ */ #endif /* CONSOLE_CONSOLE_H_ */ diff --git a/src/include/console/early_print.h b/src/include/console/early_print.h index 8bc1489dd4..cbc9b4616a 100644 --- a/src/include/console/early_print.h +++ b/src/include/console/early_print.h @@ -92,58 +92,4 @@ #define print_debug_hex32(HEX) __console_tx_hex32(BIOS_DEBUG, HEX) #define print_spew_hex32(HEX) __console_tx_hex32(BIOS_SPEW, HEX) -#else - -#define print_emerg(STR) printk(BIOS_EMERG, "%s", (STR)) -#define print_alert(STR) printk(BIOS_ALERT, "%s", (STR)) -#define print_crit(STR) printk(BIOS_CRIT, "%s", (STR)) -#define print_err(STR) printk(BIOS_ERR, "%s", (STR)) -#define print_warning(STR) printk(BIOS_WARNING,"%s", (STR)) -#define print_notice(STR) printk(BIOS_NOTICE, "%s", (STR)) -#define print_info(STR) printk(BIOS_INFO, "%s", (STR)) -#define print_debug(STR) printk(BIOS_DEBUG, "%s", (STR)) -#define print_spew(STR) printk(BIOS_SPEW, "%s", (STR)) - -#define print_emerg_char(CH) printk(BIOS_EMERG, "%c", (CH)) -#define print_alert_char(CH) printk(BIOS_ALERT, "%c", (CH)) -#define print_crit_char(CH) printk(BIOS_CRIT, "%c", (CH)) -#define print_err_char(CH) printk(BIOS_ERR, "%c", (CH)) -#define print_warning_char(CH) printk(BIOS_WARNING,"%c", (CH)) -#define print_notice_char(CH) printk(BIOS_NOTICE, "%c", (CH)) -#define print_info_char(CH) printk(BIOS_INFO, "%c", (CH)) -#define print_debug_char(CH) printk(BIOS_DEBUG, "%c", (CH)) -#define print_spew_char(CH) printk(BIOS_SPEW, "%c", (CH)) - -#define print_emerg_hex8(HEX) printk(BIOS_EMERG, "%02x", (HEX)) -#define print_alert_hex8(HEX) printk(BIOS_ALERT, "%02x", (HEX)) -#define print_crit_hex8(HEX) printk(BIOS_CRIT, "%02x", (HEX)) -#define print_err_hex8(HEX) printk(BIOS_ERR, "%02x", (HEX)) -#define print_warning_hex8(HEX) printk(BIOS_WARNING,"%02x", (HEX)) -#define print_notice_hex8(HEX) printk(BIOS_NOTICE, "%02x", (HEX)) -#define print_info_hex8(HEX) printk(BIOS_INFO, "%02x", (HEX)) -#define print_debug_hex8(HEX) printk(BIOS_DEBUG, "%02x", (HEX)) -#define print_spew_hex8(HEX) printk(BIOS_SPEW, "%02x", (HEX)) - -#define print_emerg_hex16(HEX) printk(BIOS_EMERG, "%04x", (HEX)) -#define print_alert_hex16(HEX) printk(BIOS_ALERT, "%04x", (HEX)) -#define print_crit_hex16(HEX) printk(BIOS_CRIT, "%04x", (HEX)) -#define print_err_hex16(HEX) printk(BIOS_ERR, "%04x", (HEX)) -#define print_warning_hex16(HEX) printk(BIOS_WARNING,"%04x", (HEX)) -#define print_notice_hex16(HEX) printk(BIOS_NOTICE, "%04x", (HEX)) -#define print_info_hex16(HEX) printk(BIOS_INFO, "%04x", (HEX)) -#define print_debug_hex16(HEX) printk(BIOS_DEBUG, "%04x", (HEX)) -#define print_spew_hex16(HEX) printk(BIOS_SPEW, "%04x", (HEX)) - -#define print_emerg_hex32(HEX) printk(BIOS_EMERG, "%08x", (HEX)) -#define print_alert_hex32(HEX) printk(BIOS_ALERT, "%08x", (HEX)) -#define print_crit_hex32(HEX) printk(BIOS_CRIT, "%08x", (HEX)) -#define print_err_hex32(HEX) printk(BIOS_ERR, "%08x", (HEX)) -#define print_warning_hex32(HEX) printk(BIOS_WARNING,"%08x", (HEX)) -#define print_notice_hex32(HEX) printk(BIOS_NOTICE, "%08x", (HEX)) -#define print_info_hex32(HEX) printk(BIOS_INFO, "%08x", (HEX)) -#define print_debug_hex32(HEX) printk(BIOS_DEBUG, "%08x", (HEX)) -#define print_spew_hex32(HEX) printk(BIOS_SPEW, "%08x", (HEX)) - -#endif - #endif /* __CONSOLE_EARLY_PRINT_H_ */ diff --git a/src/include/console/streams.h b/src/include/console/streams.h index fb168da905..892ae40f1c 100644 --- a/src/include/console/streams.h +++ b/src/include/console/streams.h @@ -28,11 +28,4 @@ void gdb_tx_byte(unsigned char byte); void gdb_tx_flush(void); unsigned char gdb_rx_byte(void); -/* Helpers for ROMCC console. */ -void console_tx_nibble(unsigned nibble); -void console_tx_hex8(unsigned char value); -void console_tx_hex16(unsigned short value); -void console_tx_hex32(unsigned int value); -void console_tx_string(const char *str); - #endif /* _CONSOLE_STREAMS_H_ */ -- cgit v1.2.3