patch-2.1.124 linux/drivers/sbus/char/sunserial.c

Next file: linux/drivers/sbus/char/vfc_dev.c
Previous file: linux/drivers/sbus/char/sunmouse.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.123/linux/drivers/sbus/char/sunserial.c linux/drivers/sbus/char/sunserial.c
@@ -1,4 +1,4 @@
-/* $Id: sunserial.c,v 1.61 1998/07/28 13:59:52 jj Exp $
+/* $Id: sunserial.c,v 1.66 1998/09/21 05:48:48 jj Exp $
  * serial.c: Serial port driver infrastructure for the Sparc.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -69,8 +69,9 @@
 	rs_ops.rs_kgdb_hook(channel);
 }
 
-__initfunc(void serial_console_init(void))
+__initfunc(long serial_console_init(long kmem_start, long kmem_end))
 {
+	return kmem_start;
 }
 
 void rs_change_mouse_baud(int baud)
@@ -169,7 +170,6 @@
 	return kbd_ops.getkeycode(scancode);
 }
 
-
 void
 sunserial_setinitfunc(unsigned long *memory_start, int (*init) (void))
 {
@@ -343,29 +343,41 @@
 }
 #endif
 
+extern int su_probe(unsigned long *);
 extern int zs_probe(unsigned long *);
 #ifdef CONFIG_SAB82532
 extern int sab82532_probe(unsigned long *);
 #endif
 #ifdef CONFIG_PCI
 extern int ps2kbd_probe(unsigned long *);
-extern int su_probe(unsigned long *);
 #endif
 
 __initfunc(unsigned long
 sun_serial_setup(unsigned long memory_start))
 {
-	int ret = -ENODEV;
-
-	/* Probe for controllers. */
-	ret = zs_probe(&memory_start);
-	if (!ret)
+	int ret = 1;
+	
+#if defined(CONFIG_PCI) && !defined(__sparc_v9__)
+	/*
+	 * Probing sequence on sparc differs from sparc64.
+	 * Keyboard is probed ahead of su because we want su function
+	 * when keyboard is active. su is probed ahead of zs in order to
+	 * get console on MrCoffee with fine but disconnected zs.
+	 */
+	if (!serial_console)
+		ps2kbd_probe(&memory_start);
+	if (su_probe(&memory_start) == 0)
 		return memory_start;
+#endif
 
+	if (zs_probe(&memory_start) == 0)
+		return memory_start;
+		
 #ifdef CONFIG_SAB82532
 	ret = sab82532_probe(&memory_start);
 #endif
-#ifdef CONFIG_PCI
+
+#if defined(CONFIG_PCI) && defined(__sparc_v9__)
 	/*
 	 * Keyboard serial devices.
 	 *
@@ -384,6 +396,7 @@
 			return memory_start;
 	}
 #endif
+
 	if (!ret)
 		return memory_start;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov