Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5142
-gerrit
commit e8ab25454c4cbf94b0ce729e83ebf1db2e6adf76 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Sun Jan 26 11:32:51 2014 +0200
SMM: Only have console with DEBUG_SMI
Existing code compiled serial communication and printk() for SMM even when DEBUG_SMI was not selected.
Change-Id: Ic5e25cd7453cb2243f7ac592b093fba752a299f7 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/console/Makefile.inc | 3 +-- src/cpu/x86/smm/smiutil.c | 8 ++------ src/drivers/uart/Makefile.inc | 6 +++--- src/include/console/console.h | 1 + 4 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc index 62be1d2..54d59cd 100644 --- a/src/console/Makefile.inc +++ b/src/console/Makefile.inc @@ -5,8 +5,7 @@ ramstage-y += vsprintf.c ramstage-y += post.c ramstage-y += die.c
-smm-y += printk.c -smm-y += vtxprintf.c +smm-$(CONFIG_DEBUG_SMI) += vtxprintf.c printk.c smm-$(CONFIG_SMM_TSEG) += die.c
romstage-$(CONFIG_EARLY_CONSOLE) += vtxprintf.c diff --git a/src/cpu/x86/smm/smiutil.c b/src/cpu/x86/smm/smiutil.c index 43731bc..3325c32 100644 --- a/src/cpu/x86/smm/smiutil.c +++ b/src/cpu/x86/smm/smiutil.c @@ -19,13 +19,10 @@ * MA 02110-1301 USA */
-#include <arch/io.h> -#include <cpu/x86/cache.h> -#include <cpu/x86/smm.h> #include <console/console.h> #include <console/uart.h> -#include <console/vtxprintf.h>
+#if CONFIG_DEBUG_SMI void console_tx_flush(void) { } @@ -42,6 +39,7 @@ void console_tx_byte(unsigned char byte) uart_tx_byte(byte); #endif } +#endif
void console_init(void) { @@ -53,8 +51,6 @@ void console_init(void) #if CONFIG_CONSOLE_SERIAL8250MEM uart_init(); #endif -#else - console_loglevel = 1; #endif }
diff --git a/src/drivers/uart/Makefile.inc b/src/drivers/uart/Makefile.inc index 3a9ca3d..415c5bb 100644 --- a/src/drivers/uart/Makefile.inc +++ b/src/drivers/uart/Makefile.inc @@ -2,19 +2,19 @@ ifeq ($(CONFIG_CONSOLE_SERIAL),y) romstage-y += util.c ramstage-y += util.c bootblock-y += util.c -smm-y += util.c +smm-$(CONFIG_DEBUG_SMI) += util.c endif
ifeq ($(CONFIG_CONSOLE_SERIAL8250),y) romstage-y += uart8250io.c ramstage-y += uart8250io.c -smm-y += uart8250io.c +smm-$(CONFIG_DEBUG_SMI) += uart8250io.c endif
ifeq ($(CONFIG_CONSOLE_SERIAL8250MEM),y) romstage-y += uart8250mem.c ramstage-y += uart8250mem.c -smm-y += uart8250mem.c +smm-$(CONFIG_DEBUG_SMI) += uart8250mem.c endif
ifeq ($(CONFIG_CONSOLE_SERIAL_UART),y) diff --git a/src/include/console/console.h b/src/include/console/console.h index dfeedda..a089729 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -72,6 +72,7 @@ void __attribute__ ((noreturn)) die(const char *msg); int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
#if defined(__BOOT_BLOCK__) && !CONFIG_BOOTBLOCK_CONSOLE || \ + defined(__SMM__) && !CONFIG_DEBUG_SMI || \ (defined(__PRE_RAM__) && !defined(__BOOT_BLOCK__)) && !CONFIG_EARLY_CONSOLE
static inline void printk(int LEVEL, const char *fmt, ...);