Blame view

arch/mips/sgi-ip27/ip27-console.c 929 Bytes
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
  /*
   * This file is subject to the terms and conditions of the GNU General Public
   * License.  See the file "COPYING" in the main directory of this archive
   * for more details.
   *
   * Copyright (C) 2001, 2002 Ralf Baechle
   */
  #include <linux/init.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
10
  
  #include <asm/page.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  #include <asm/sn/addrs.h>
  #include <asm/sn/sn0/hub.h>
  #include <asm/sn/klconfig.h>
  #include <asm/sn/ioc3.h>
  #include <asm/sn/sn_private.h>
  
  #include <linux/serial.h>
  #include <linux/serial_core.h>
  
  #define IOC3_CLK	(22000000 / 3)
  #define IOC3_FLAGS	(0)
  
  static inline struct ioc3_uartregs *console_uart(void)
  {
  	struct ioc3 *ioc3;
01d42abdf   Ralf Baechle   Using get_nasid()...
26
  	nasid_t nasid;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27

01d42abdf   Ralf Baechle   Using get_nasid()...
28
29
  	nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid;
  	ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
31
32
  
  	return &ioc3->sregs.uarta;
  }
36a885306   Ralf Baechle   [MIPS] Fix and cl...
33
  void __init prom_putchar(char c)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
34
35
36
37
38
39
  {
  	struct ioc3_uartregs *uart = console_uart();
  
  	while ((uart->iu_lsr & 0x20) == 0);
  	uart->iu_thr = c;
  }