console: Add SimNow console logging

The AMD SimNow tool supports fast logging through an IO port.  Add a new
console to support SimNow logging through port 80.

TEST=observe significant speed improvements on SimNow console log

Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com>
Change-Id: I42a431f48ea14ba4adacbd4a32e15abe7c5e4951
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72751
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Fred Reitberger
2023-02-01 16:00:54 -05:00
committed by Felix Held
parent d7b7460d6e
commit a02176debb
6 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
## SPDX-License-Identifier: GPL-2.0-only
ifeq ($(CONFIG_CONSOLE_AMD_SIMNOW),y)
all-y += simnow_console.c
smm-$(CONFIG_DEBUG_SMI) += simnow_console.c
endif

View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/io.h>
#include <console/console.h>
#include <console/simnow.h>
#define AMD_SIMNOW_PORT 0x80
#define AMD_SIMNOW_PORT_DATA_BEGIN 0x5f535452ul
#define AMD_SIMNOW_PORT_DATA_END 0x5f454e44ul
void simnow_console_init(void)
{
outl(AMD_SIMNOW_PORT_DATA_BEGIN, AMD_SIMNOW_PORT);
}
void simnow_console_tx_byte(unsigned char data)
{
outb(data, AMD_SIMNOW_PORT);
if (data == '\n') {
outl(AMD_SIMNOW_PORT_DATA_END, AMD_SIMNOW_PORT);
outl(AMD_SIMNOW_PORT_DATA_BEGIN, AMD_SIMNOW_PORT);
}
}