patch-2.4.25 linux-2.4.25/arch/mips/sgi-ip22/ip22-setup.c

Next file: linux-2.4.25/arch/mips/sgi-ip22/ip22-time.c
Previous file: linux-2.4.25/arch/mips/sgi-ip22/ip22-mc.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.24/arch/mips/sgi-ip22/ip22-setup.c linux-2.4.25/arch/mips/sgi-ip22/ip22-setup.c
@@ -22,6 +22,7 @@
 #include <asm/irq.h>
 #include <asm/reboot.h>
 #include <asm/ds1286.h>
+#include <asm/floppy.h>
 #include <asm/time.h>
 #include <asm/gdb-stub.h>
 #include <asm/io.h>
@@ -37,6 +38,9 @@
 static int remote_debug = 0;
 #endif
 
+#ifdef CONFIG_EISA
+extern struct fd_ops std_fd_ops;
+#endif
 extern struct rtc_ops ip22_rtc_ops;
 
 unsigned long sgi_gfxaddr;
@@ -110,11 +114,10 @@
 extern void ip22_be_init(void) __init;
 extern void ip22_time_init(void) __init;
 
-extern int console_setup(char *) __init;
-
 void __init ip22_setup(void)
 {
-	char *ctype;
+	struct console_cmdline *c;
+	char *con;
 #ifdef CONFIG_KGDB
 	char *kgdb_ttyd;
 #endif
@@ -136,23 +139,29 @@
 	indy_sc_init();
 #endif
 
-	/* Set the IO space to some sane value */
-	set_io_port_base (KSEG1ADDR (0x00080000));
+	/* Set EISA IO port base for Indigo2 */
+	set_io_port_base(KSEG1ADDR(0x00080000));
 
+	/* Nothing registered console before us, so simply use first entry */
+	c = &console_cmdline[0];
 	/* ARCS console environment variable is set to "g?" for
 	 * graphics console, it is set to "d" for the first serial
 	 * line and "d2" for the second serial line.
 	 */
-	ctype = ArcGetEnvironmentVariable("console");
-	if (ctype && *ctype == 'd') {
-		if (*(ctype + 1) == '2')
-			console_setup("ttyS1");
-		else
-			console_setup("ttyS0");
-	} else if (!ctype || *ctype != 'g') {
+	con = ArcGetEnvironmentVariable("console");
+	if (con && *con == 'd') {
+		static char options[8];
+		char *baud = ArcGetEnvironmentVariable("dbaud");
+		strcpy(c->name, "ttyS");
+		c->index = *(con + 1) == '2' ? 1 : 0;
+		if (baud) {
+			strcpy(options, baud);
+			c->options = options;
+		}
+	} else if (!con || *con != 'g') {
 		/* Use ARC if we don't want serial ('d') or Newport ('g'). */
 		prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
-		console_setup("arc");
+		strcpy(c->name, "arc");
 	}
 
 #ifdef CONFIG_KGDB
@@ -179,12 +188,12 @@
 #ifdef CONFIG_VT
 	conswitchp = &dummy_con;
 #ifdef CONFIG_SGI_NEWPORT_CONSOLE
-	if (ctype && *ctype == 'g'){
-		unsigned long *gfxinfo;
-		long (*__vec)(void) =
-			(void *) *(long *)((PROMBLOCK)->pvector + 0x20);
+	if (con && *con == 'g'){
+		ULONG *gfxinfo;
+		ULONG * (*__vec)(void) = (void *) (long)
+			*((_PULONG *)(long)((PROMBLOCK)->pvector + 0x20));
 
-		gfxinfo = (unsigned long *)__vec();
+		gfxinfo = __vec();
 		sgi_gfxaddr = ((gfxinfo[1] >= 0xa0000000
 			       && gfxinfo[1] <= 0xc0000000)
 			       ? gfxinfo[1] - 0xa0000000 : 0);
@@ -208,6 +217,14 @@
 	}
 #endif
 #endif
+
+/*
+ * Warning: this is broken, means it has to be known at kernel compile time
+ * if a floppy module might ever be loaded
+ */
+#if defined(CONFIG_EISA) && defined(CONFIG_BLK_DEV_FD)
+	fd_ops = &std_fd_ops;
+#endif
 	rtc_ops = &ip22_rtc_ops;
 	kbd_ops = &ip22_kbd_ops;
 #ifdef CONFIG_PSMOUSE

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)