diff options
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/common/block/simnow/Makefile.inc | 7 | ||||
-rw-r--r-- | src/soc/amd/common/block/simnow/simnow_console.c | 24 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/simnow/Makefile.inc b/src/soc/amd/common/block/simnow/Makefile.inc new file mode 100644 index 0000000000..2cd79c899f --- /dev/null +++ b/src/soc/amd/common/block/simnow/Makefile.inc @@ -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 diff --git a/src/soc/amd/common/block/simnow/simnow_console.c b/src/soc/amd/common/block/simnow/simnow_console.c new file mode 100644 index 0000000000..478674ad1f --- /dev/null +++ b/src/soc/amd/common/block/simnow/simnow_console.c @@ -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); + } +} |