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