aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/cobalt/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/cobalt/console.c')
-rw-r--r--arch/mips/cobalt/console.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index 46c23b66bc17..0485d51f7216 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -1,47 +1,16 @@
1/* 1/*
2 * (C) P. Horton 2006 2 * (C) P. Horton 2006
3 */ 3 */
4
5#include <linux/init.h>
6#include <linux/kernel.h>
7#include <linux/console.h>
8#include <linux/serial_reg.h> 4#include <linux/serial_reg.h>
5
9#include <asm/addrspace.h> 6#include <asm/addrspace.h>
10#include <asm/mach-cobalt/cobalt.h>
11 7
12static void putchar(int c) 8#include <cobalt.h>
13{
14 if(c == '\n')
15 putchar('\r');
16 9
10void prom_putchar(char c)
11{
17 while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE)) 12 while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE))
18 ; 13 ;
19 14
20 COBALT_UART[UART_TX] = c; 15 COBALT_UART[UART_TX] = c;
21} 16}
22
23static void cons_write(struct console *c, const char *s, unsigned n)
24{
25 while(n-- && *s)
26 putchar(*s++);
27}
28
29static struct console cons_info =
30{
31 .name = "uart",
32 .write = cons_write,
33 .flags = CON_PRINTBUFFER | CON_BOOT,
34 .index = -1,
35};
36
37void __init cobalt_early_console(void)
38{
39 register_console(&cons_info);
40
41 printk("Cobalt: early console registered\n");
42}
43
44void __init disable_early_printk(void)
45{
46 unregister_console(&cons_info);
47}