blob: 3ba830651c58f93d317212a04b784b00d6a17155 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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.
5 *
6 * Copyright (C) 2001, 2002 Ralf Baechle
7 */
8#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10#include <asm/page.h>
11#include <asm/semaphore.h>
12#include <asm/sn/addrs.h>
13#include <asm/sn/sn0/hub.h>
14#include <asm/sn/klconfig.h>
15#include <asm/sn/ioc3.h>
16#include <asm/sn/sn_private.h>
17
18#include <linux/serial.h>
19#include <linux/serial_core.h>
20
21#define IOC3_CLK (22000000 / 3)
22#define IOC3_FLAGS (0)
23
24static inline struct ioc3_uartregs *console_uart(void)
25{
26 struct ioc3 *ioc3;
Ralf Baechle01d42ab2005-06-27 08:34:27 +000027 nasid_t nasid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Ralf Baechle01d42ab2005-06-27 08:34:27 +000029 nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
30 ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32 return &ioc3->sregs.uarta;
33}
34
Ralf Baechle36a88532007-03-01 11:56:43 +000035void __init prom_putchar(char c)
Linus Torvalds1da177e2005-04-16 15:20:36 -070036{
37 struct ioc3_uartregs *uart = console_uart();
38
39 while ((uart->iu_lsr & 0x20) == 0);
40 uart->iu_thr = c;
41}