summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-17 04:35:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-17 04:35:00 +0000
commitd60b0354c6cc4d90a04a6434ebac6c68b6a34d5b (patch)
treee0a1bc9a1b11d2260b31dfbab59a265fb4625aa0
parent8269dd0a57ed4456d0a2fdf0e338cf56f3829e04 (diff)
Ok, I got better things to do than hacking kernels for machines which
I don't even have at hand right now, but we got too many bug reports of the ``IP22 crashes during early startup'' type. This patch makes printk usable on IP22 from the very early startup on. It's not perfect and I think it might result in printk's information getting duplicated for systems with serial console but let's tackle that later.
-rw-r--r--arch/mips/arc/console.c35
-rw-r--r--arch/mips/arc/init.c8
-rw-r--r--arch/mips/sgi/kernel/setup.c4
3 files changed, 39 insertions, 8 deletions
diff --git a/arch/mips/arc/console.c b/arch/mips/arc/console.c
index 6ae4d030e..8138dbd00 100644
--- a/arch/mips/arc/console.c
+++ b/arch/mips/arc/console.c
@@ -1,16 +1,19 @@
/*
- * console.c: SGI arcs console code.
+ * 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) 1996 David S. Miller (dm@sgi.com)
* Compability with board caches, Ulf Carlsson
- *
- * $Id: console.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>
#include <asm/bcache.h>
+#include <linux/console.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
#ifdef CONFIG_ARC_CONSOLE
#define __init
@@ -44,6 +47,7 @@ char __init prom_getchar(void)
bc_disable();
romvec->read(0, &c, 1, &cnt);
bc_enable();
+
return c;
}
@@ -68,3 +72,28 @@ void __init prom_printf(char *fmt, ...)
}
va_end(args);
}
+
+static void
+arc_console_write(struct console *con, const char *s, unsigned n)
+{
+ prom_printf("%s", s);
+}
+
+static kdev_t
+arc_console_dev(struct console *c)
+{
+ return MKDEV(TTY_MAJOR, 64 + c->index);
+}
+
+static struct console arc_prom_console = {
+ name: "prom",
+ write: arc_console_write,
+ device: arc_console_dev,
+ flags: CON_PRINTBUFFER,
+ index: -1,
+};
+
+__init void arc_setup_console(void)
+{
+ register_console(&arc_prom_console);
+}
diff --git a/arch/mips/arc/init.c b/arch/mips/arc/init.c
index 76b5ade80..873128c4c 100644
--- a/arch/mips/arc/init.c
+++ b/arch/mips/arc/init.c
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.5 2000/03/07 15:45:27 ralf Exp $
+/*
* 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.
@@ -23,6 +23,8 @@ unsigned short prom_vers, prom_rev;
extern void prom_testtree(void);
+extern void arc_setup_console(void);
+
void __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
{
struct linux_promblock *pb;
@@ -33,7 +35,9 @@ void __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
prom_argv = argv;
prom_envp = envp;
- if(pb->magic != 0x53435241) {
+ arc_setup_console();
+
+ if (pb->magic != 0x53435241) {
prom_printf("Aieee, bad prom vector magic %08lx\n", pb->magic);
while(1)
;
diff --git a/arch/mips/sgi/kernel/setup.c b/arch/mips/sgi/kernel/setup.c
index 13ed88c45..1de0660b2 100644
--- a/arch/mips/sgi/kernel/setup.c
+++ b/arch/mips/sgi/kernel/setup.c
@@ -232,7 +232,6 @@ void __init sgi_setup(void)
char *kgdb_ttyd;
#endif
-
irq_setup = sgi_irq_setup;
board_time_init = sgi_time_init;
@@ -275,7 +274,7 @@ void __init sgi_setup(void)
line ? 1 : 2);
rs_kgdb_hook(line);
- prom_printf("KGDB: Using serial line /dev/ttyd%d for session, "
+ printk("KGDB: Using serial line /dev/ttyd%d for session, "
"please connect your debugger\n", line ? 1 : 2);
remote_debug = 1;
@@ -317,5 +316,4 @@ void __init sgi_setup(void)
#ifdef CONFIG_VIDEO_VINO
init_vino();
#endif
-
}