summaryrefslogtreecommitdiffstats
path: root/arch/mips/arc
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2000-08-01 04:24:49 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2000-08-01 04:24:49 +0000
commitf7bbf9552e93a3fa9e5aa7c5cfed458b77b37695 (patch)
tree137da613a3a73d0c311fbcc3210f51c6f15c1ae4 /arch/mips/arc
parent7f78cc6fbe77afbbd4c84f2c8fab9c92f58b1976 (diff)
ARC console is not just for IP22.
Timer dead code cleanup.
Diffstat (limited to 'arch/mips/arc')
-rw-r--r--arch/mips/arc/Makefile8
-rw-r--r--arch/mips/arc/arc_con.c69
-rw-r--r--arch/mips/arc/cmdline.c2
-rw-r--r--arch/mips/arc/console.c32
-rw-r--r--arch/mips/arc/printf.c40
5 files changed, 106 insertions, 45 deletions
diff --git a/arch/mips/arc/Makefile b/arch/mips/arc/Makefile
index 7bfefcfba..e37207b33 100644
--- a/arch/mips/arc/Makefile
+++ b/arch/mips/arc/Makefile
@@ -10,7 +10,11 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
L_TARGET = arclib.a
-L_OBJS = console.o init.o printf.o memory.o tree.o env.o cmdline.o misc.o \
- time.o file.o identify.o
+L_OBJS = console.o init.o memory.o tree.o env.o cmdline.o misc.o time.o \
+ file.o identify.o
+
+ifdef CONFIG_ARC_CONSOLE
+L_OBJS += arc_con.o
+endif
include $(TOPDIR)/Rules.make
diff --git a/arch/mips/arc/arc_con.c b/arch/mips/arc/arc_con.c
new file mode 100644
index 000000000..6fe94a6c7
--- /dev/null
+++ b/arch/mips/arc/arc_con.c
@@ -0,0 +1,69 @@
+/*
+ * Wrap-around code for a console using the
+ * ARC io-routines.
+ *
+ * Copyright (c) 1998 Harald Koerfgen
+ */
+
+#include <linux/tty.h>
+#include <linux/major.h>
+#include <linux/ptrace.h>
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/fs.h>
+
+extern char prom_getchar (void);
+extern void prom_printf (char *, ...);
+
+static void prom_console_write(struct console *co, const char *s,
+ unsigned count)
+{
+ unsigned i;
+
+ /*
+ * Now, do each character
+ */
+ for (i = 0; i < count; i++) {
+ if (*s == 10)
+ prom_printf("%c", 13);
+ prom_printf("%c", *s++);
+ }
+}
+
+static int prom_console_wait_key(struct console *co)
+{
+ return prom_getchar();
+}
+
+static int __init prom_console_setup(struct console *co, char *options)
+{
+ return 0;
+}
+
+static kdev_t prom_console_device(struct console *c)
+{
+ return MKDEV(TTY_MAJOR, 64 + c->index);
+}
+
+static struct console arc_cons = {
+ "ttyS",
+ prom_console_write,
+ NULL,
+ prom_console_device,
+ prom_console_wait_key,
+ NULL,
+ prom_console_setup,
+ CON_PRINTBUFFER,
+ -1,
+ 0,
+ NULL
+};
+
+/*
+ * Register console.
+ */
+
+void __init arc_console_init(void)
+{
+ register_console(&arc_cons);
+}
diff --git a/arch/mips/arc/cmdline.c b/arch/mips/arc/cmdline.c
index d60ff2bab..ba356e65d 100644
--- a/arch/mips/arc/cmdline.c
+++ b/arch/mips/arc/cmdline.c
@@ -12,7 +12,7 @@
#include <asm/sgialib.h>
#include <asm/bootinfo.h>
-/* #define DEBUG_CMDLINE */
+#undef DEBUG_CMDLINE
char arcs_cmdline[CL_SIZE];
diff --git a/arch/mips/arc/console.c b/arch/mips/arc/console.c
index 4de5130fb..cf367a3c1 100644
--- a/arch/mips/arc/console.c
+++ b/arch/mips/arc/console.c
@@ -8,6 +8,7 @@
*/
#include <linux/config.h>
#include <linux/init.h>
+#include <linux/kernel.h>
#include <asm/sgialib.h>
#include <asm/bcache.h>
@@ -20,7 +21,7 @@
*/
extern struct bcache_ops *bcops;
-#ifdef CONFIG_SGI_PROM_CONSOLE
+#ifdef CONFIG_ARC_CONSOLE
void prom_putchar(char c)
#else
void __init prom_putchar(char c)
@@ -34,7 +35,7 @@ void __init prom_putchar(char c)
bcops->bc_enable();
}
-#ifdef CONFIG_SGI_PROM_CONSOLE
+#ifdef CONFIG_ARC_CONSOLE
char prom_getchar(void)
#else
char __init prom_getchar(void)
@@ -48,3 +49,30 @@ char __init prom_getchar(void)
bcops->bc_enable();
return c;
}
+
+static char ppbuf[1024];
+
+#ifdef CONFIG_ARC_CONSOLE
+void prom_printf(char *fmt, ...)
+#else
+void __init prom_printf(char *fmt, ...)
+#endif
+{
+ va_list args;
+ char ch, *bptr;
+ int i;
+
+ va_start(args, fmt);
+ i = vsprintf(ppbuf, fmt, args);
+
+ bptr = ppbuf;
+
+ while((ch = *(bptr++)) != 0) {
+ if(ch == '\n')
+ prom_putchar('\r');
+
+ prom_putchar(ch);
+ }
+ va_end(args);
+ return;
+}
diff --git a/arch/mips/arc/printf.c b/arch/mips/arc/printf.c
deleted file mode 100644
index 78b1b5937..000000000
--- a/arch/mips/arc/printf.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * printf.c: Putting things on the screen using SGI arcs
- * PROM facilities.
- *
- * Copyright (C) 1996 David S. Miller (dm@sgi.com)
- *
- * $Id: printf.c,v 1.3 1999/10/09 00:00:57 ralf Exp $
- */
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-
-#include <asm/sgialib.h>
-
-static char ppbuf[1024];
-
-#ifdef CONFIG_SGI_PROM_CONSOLE
-void prom_printf(char *fmt, ...)
-#else
-void __init prom_printf(char *fmt, ...)
-#endif
-{
- va_list args;
- char ch, *bptr;
- int i;
-
- va_start(args, fmt);
- i = vsprintf(ppbuf, fmt, args);
-
- bptr = ppbuf;
-
- while((ch = *(bptr++)) != 0) {
- if(ch == '\n')
- prom_putchar('\r');
-
- prom_putchar(ch);
- }
- va_end(args);
- return;
-}