Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / mips / sgi-ip27 / ip27-console.c
blob7737a88c65693f42054a7b40f5323cba422154e7
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2001, 2002 Ralf Baechle
7 */
9 #include <asm/page.h>
10 #include <asm/setup.h>
11 #include <asm/sn/addrs.h>
12 #include <asm/sn/agent.h>
13 #include <asm/sn/klconfig.h>
14 #include <asm/sn/ioc3.h>
16 #include <linux/serial.h>
17 #include <linux/serial_core.h>
19 #include "ip27-common.h"
21 #define IOC3_CLK (22000000 / 3)
22 #define IOC3_FLAGS (0)
24 static inline struct ioc3_uartregs *console_uart(void)
26 struct ioc3 *ioc3;
27 nasid_t nasid;
29 nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
30 ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
32 return &ioc3->sregs.uarta;
35 void prom_putchar(char c)
37 struct ioc3_uartregs *uart = console_uart();
39 while ((readb(&uart->iu_lsr) & 0x20) == 0)
41 writeb(c, &uart->iu_thr);