Merge tag 'v3.9-rc1_cns3xxx_fixes' of git://git.infradead.org/users/cbou/linux-cns3xx...
[linux-2.6/libata-dev.git] / arch / mips / sgi-ip27 / ip27-console.c
blobb952d5b1af862afed1d9fc8006d3f1e9a7ed59d6
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 */
8 #include <linux/init.h>
10 #include <asm/page.h>
11 #include <asm/sn/addrs.h>
12 #include <asm/sn/sn0/hub.h>
13 #include <asm/sn/klconfig.h>
14 #include <asm/sn/ioc3.h>
15 #include <asm/sn/sn_private.h>
17 #include <linux/serial.h>
18 #include <linux/serial_core.h>
20 #define IOC3_CLK (22000000 / 3)
21 #define IOC3_FLAGS (0)
23 static inline struct ioc3_uartregs *console_uart(void)
25 struct ioc3 *ioc3;
26 nasid_t nasid;
28 nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
29 ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
31 return &ioc3->sregs.uarta;
34 void prom_putchar(char c)
36 struct ioc3_uartregs *uart = console_uart();
38 while ((uart->iu_lsr & 0x20) == 0);
39 uart->iu_thr = c;