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 
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