xref: /linux/arch/mips/sgi-ip30/ip30-console.c (revision c8faf11cd192214e231626c3ee973a35d8fc33f2)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/io.h>
4 #include <linux/processor.h>
5 
6 #include <asm/sn/ioc3.h>
7 #include <asm/setup.h>
8 
9 static inline struct ioc3_uartregs *console_uart(void)
10 {
11 	struct ioc3 *ioc3;
12 
13 	ioc3 = (struct ioc3 *)((void *)(0x900000001f600000));
14 	return &ioc3->sregs.uarta;
15 }
16 
17 void prom_putchar(char c)
18 {
19 	struct ioc3_uartregs *uart = console_uart();
20 
21 	while ((readb(&uart->iu_lsr) & 0x20) == 0)
22 		cpu_relax();
23 
24 	writeb(c, &uart->iu_thr);
25 }
26