summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block/simnow/simnow_console.c
blob: 478674ad1f0822212b689da92a35be2dcba974e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
	}
}