Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
| 5 | * |
| 6 | * Copyright (C) 2001, 2002 Ralf Baechle |
| 7 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
| 9 | #include <asm/page.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <asm/sn/addrs.h> |
| 11 | #include <asm/sn/sn0/hub.h> |
| 12 | #include <asm/sn/klconfig.h> |
| 13 | #include <asm/sn/ioc3.h> |
| 14 | #include <asm/sn/sn_private.h> |
| 15 | |
| 16 | #include <linux/serial.h> |
| 17 | #include <linux/serial_core.h> |
| 18 | |
| 19 | #define IOC3_CLK (22000000 / 3) |
| 20 | #define IOC3_FLAGS (0) |
| 21 | |
| 22 | static inline struct ioc3_uartregs *console_uart(void) |
| 23 | { |
| 24 | struct ioc3 *ioc3; |
Ralf Baechle | 01d42ab | 2005-06-27 08:34:27 +0000 | [diff] [blame] | 25 | nasid_t nasid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
Ralf Baechle | 01d42ab | 2005-06-27 08:34:27 +0000 | [diff] [blame] | 27 | nasid = (master_nasid == INVALID_NASID) ? get_nasid() : master_nasid; |
| 28 | ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(nasid)->memory_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
| 30 | return &ioc3->sregs.uarta; |
| 31 | } |
| 32 | |
Aaro Koskinen | f7be4e7 | 2013-02-11 20:51:49 +0000 | [diff] [blame] | 33 | void prom_putchar(char c) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | { |
| 35 | struct ioc3_uartregs *uart = console_uart(); |
| 36 | |
| 37 | while ((uart->iu_lsr & 0x20) == 0); |
| 38 | uart->iu_thr = c; |
| 39 | } |