summaryrefslogtreecommitdiffstats
path: root/arch/mips/sgi-ip30/ip30-console.c
blob: a5f10097b985920f746fe986dfc69bb400d08dd7 (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
25
// SPDX-License-Identifier: GPL-2.0

#include <linux/io.h>
#include <linux/processor.h>

#include <asm/sn/ioc3.h>
#include <asm/setup.h>

static inline struct ioc3_uartregs *console_uart(void)
{
	struct ioc3 *ioc3;

	ioc3 = (struct ioc3 *)((void *)(0x900000001f600000));
	return &ioc3->sregs.uarta;
}

void prom_putchar(char c)
{
	struct ioc3_uartregs *uart = console_uart();

	while ((readb(&uart->iu_lsr) & 0x20) == 0)
		cpu_relax();

	writeb(c, &uart->iu_thr);
}