summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorUlf Carlsson <md1ulfc@mdstud.chalmers.se>1999-05-07 18:00:16 +0000
committerUlf Carlsson <md1ulfc@mdstud.chalmers.se>1999-05-07 18:00:16 +0000
commita8a87b14ea722a84b8035b0f686fa506c9005f4f (patch)
tree80666180e3076f67422fc463425142b4cca4718c /arch
parent9258cfc6e1c91e593152120a59983c9e9f761855 (diff)
A prom console for the Indigo II which yet doesn't work perfectly.
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/sgi/kernel/Makefile7
-rw-r--r--arch/mips/sgi/kernel/promcon.c73
-rw-r--r--arch/mips/sgi/kernel/setup.c5
3 files changed, 82 insertions, 3 deletions
diff --git a/arch/mips/sgi/kernel/Makefile b/arch/mips/sgi/kernel/Makefile
index aca1cb036..588ec64ea 100644
--- a/arch/mips/sgi/kernel/Makefile
+++ b/arch/mips/sgi/kernel/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 1999/01/27 04:50:27 adevries Exp $
+# $Id: Makefile,v 1.6 1999/02/07 21:56:33 ulfc Exp $
# Makefile for the SGI specific kernel interface routines
# under Linux.
#
@@ -14,7 +14,10 @@
$(CC) $(CFLAGS) -c $< -o $*.o
OBJS = indy_mc.o indy_sc.o indy_hpc.o indy_int.o indy_rtc.o \
- system.o indy_timer.o indyIRQ.o reset.o setup.o time.o
+ system.o indy_timer.o indyIRQ.o reset.o setup.o time.o
+ifdef CONFIG_SGI_PROM_CONSOLE
+OBJS += promcon.o
+endif
all: sgikern.a
diff --git a/arch/mips/sgi/kernel/promcon.c b/arch/mips/sgi/kernel/promcon.c
new file mode 100644
index 000000000..3870b71e8
--- /dev/null
+++ b/arch/mips/sgi/kernel/promcon.c
@@ -0,0 +1,73 @@
+/*
+ * Wrap-around code for a console using the
+ * SGI PROM io-routines.
+ *
+ * Copyright (c) 1999 Ulf Carlsson
+ *
+ * Derived from DECstation promcon.c
+ * 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>
+
+#include <asm/sgialib.h>
+
+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();
+}
+
+__initfunc(static int 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 sercons =
+{
+ "ttyS",
+ prom_console_write,
+ NULL,
+ prom_console_device,
+ prom_console_wait_key,
+ NULL,
+ prom_console_setup,
+ CON_PRINTBUFFER,
+ -1,
+ 0,
+ NULL
+};
+
+/*
+ * Register console.
+ */
+
+__initfunc(long sgi_prom_console_init(long kmem_start, long kmem_end))
+{
+ register_console(&sercons);
+ return kmem_start;
+}
diff --git a/arch/mips/sgi/kernel/setup.c b/arch/mips/sgi/kernel/setup.c
index 7dbbc1c80..4ee8c01f7 100644
--- a/arch/mips/sgi/kernel/setup.c
+++ b/arch/mips/sgi/kernel/setup.c
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.21 1999/04/05 01:41:18 ulfc Exp $
+/* $Id: setup.c,v 1.22 1999/04/10 12:21:30 ulfc Exp $
*
* setup.c: SGI specific setup, including init of the feature struct.
*
@@ -144,6 +144,9 @@ __initfunc(void sgi_setup(void))
console_setup ("ttyS0");
}
#endif
+#ifdef CONFIG_SGI_PROM_CONSOLE
+ console_setup("ttyS0");
+#endif
sgi_volume_set(simple_strtoul(prom_getenv("volume"), NULL, 10));