Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 2001, 2002 Ralf Baechle
0007  */
0008 
0009 #include <asm/page.h>
0010 #include <asm/setup.h>
0011 #include <asm/sn/addrs.h>
0012 #include <asm/sn/agent.h>
0013 #include <asm/sn/klconfig.h>
0014 #include <asm/sn/ioc3.h>
0015 
0016 #include <linux/serial.h>
0017 #include <linux/serial_core.h>
0018 
0019 #include "ip27-common.h"
0020 
0021 #define IOC3_CLK    (22000000 / 3)
0022 #define IOC3_FLAGS  (0)
0023 
0024 static inline struct ioc3_uartregs *console_uart(void)
0025 {
0026     struct ioc3 *ioc3;
0027     nasid_t nasid;
0028 
0029     nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
0030     ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
0031 
0032     return &ioc3->sregs.uarta;
0033 }
0034 
0035 void prom_putchar(char c)
0036 {
0037     struct ioc3_uartregs *uart = console_uart();
0038 
0039     while ((readb(&uart->iu_lsr) & 0x20) == 0)
0040         ;
0041     writeb(c, &uart->iu_thr);
0042 }