Thomas Bogendoerfer | 7505576 | 2019-10-24 12:18:29 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | |||||
3 | #include <linux/io.h> | ||||
4 | |||||
5 | #include <asm/sn/ioc3.h> | ||||
6 | |||||
7 | static inline struct ioc3_uartregs *console_uart(void) | ||||
8 | { | ||||
9 | struct ioc3 *ioc3; | ||||
10 | |||||
11 | ioc3 = (struct ioc3 *)((void *)(0x900000001f600000)); | ||||
12 | return &ioc3->sregs.uarta; | ||||
13 | } | ||||
14 | |||||
15 | void prom_putchar(char c) | ||||
16 | { | ||||
17 | struct ioc3_uartregs *uart = console_uart(); | ||||
18 | |||||
19 | while ((readb(&uart->iu_lsr) & 0x20) == 0) | ||||
20 | cpu_relax(); | ||||
21 | |||||
22 | writeb(c, &uart->iu_thr); | ||||
23 | } |