linux/debian/patches/bugfix/mips/dec-serial.patch

198 lines
4.8 KiB
Diff

# Upstream status: won't go into Linus' tree like this but is in the
# linux-mips tree. The drivers/char serial drivers need to be converted to
# real serial drivers in drivers/serial
# Author: Martin Michlmayr <tbm@cyrius.com>, mostly taken from the
# linux-mips tree, with some updates by Maciej W. Rozycki.
--- b/drivers/char/Kconfig~ 2006-05-25 12:51:58.000000000 +0200
+++ b/drivers/char/Kconfig 2006-05-25 12:53:03.000000000 +0200
@@ -362,6 +362,41 @@
bool "Console on BCM1xxx DUART"
depends on SIBYTE_SB1250_DUART
+config SERIAL_DEC
+ bool "DECstation serial support"
+ depends on MACH_DECSTATION
+ default y
+ help
+ This selects whether you want to be asked about drivers for
+ DECstation serial ports.
+
+ Note that the answer to this question won't directly affect the
+ kernel: saying N will just cause the configurator to skip all
+ the questions about DECstation serial ports.
+
+ If unsure, say Y.
+
+config SERIAL_DEC_CONSOLE
+ bool "Support for console on a DECstation serial port"
+ depends on SERIAL_DEC
+ default y
+ help
+ If you say Y here, it will be possible to use a serial port as the
+ system console (the system console is the device which receives all
+ kernel messages and warnings and which allows logins in single user
+ mode). Note that the firmware uses ttyS0 as the serial console on
+ the Maxine and ttyS2 on the others.
+
+ If unsure, say Y.
+
+config ZS
+ bool "Z85C30 Serial Support"
+ depends on SERIAL_DEC
+ default y
+ help
+ Documentation on the Zilog 85C350 serial communications controller
+ is downloadable at <http://www.zilog.com/pdfs/serial/z85c30.pdf>.
+
config QTRONIX_KEYBOARD
bool "Enable Qtronix 990P Keyboard Support"
depends on IT8712
--- b/drivers/char/Makefile~ 2006-05-25 12:51:52.000000000 +0200
+++ b/drivers/char/Makefile 2006-05-25 12:52:27.000000000 +0200
@@ -50,6 +50,7 @@
obj-$(CONFIG_VIOTAPE) += viotape.o
obj-$(CONFIG_HVCS) += hvcs.o
obj-$(CONFIG_SGI_MBCS) += mbcs.o
+obj-$(CONFIG_SERIAL_DEC) += decserial.o
obj-$(CONFIG_PRINTER) += lp.o
obj-$(CONFIG_TIPAR) += tipar.o
--- a/drivers/char/decserial.c
+++ b/drivers/char/decserial.c
@@ -14,86 +14,84 @@
* device. Added support for PROM console in drivers/char/tty_io.c
* instead. Although it may work to enable more than one
* console device I strongly recommend to use only one.
+ *
+ * Copyright (C) 2004 Maciej W. Rozycki
*/
+#include <linux/errno.h>
#include <linux/init.h>
-#include <asm/dec/machtype.h>
-
-#ifdef CONFIG_ZS
-extern int zs_init(void);
-#endif
-#ifdef CONFIG_DZ
-extern int dz_init(void);
-#endif
+#include <asm/dec/machtype.h>
+#include <asm/dec/serial.h>
-#ifdef CONFIG_SERIAL_CONSOLE
+extern int register_zs_hook(unsigned int channel,
+ struct dec_serial_hook *hook);
+extern int unregister_zs_hook(unsigned int channel);
+int register_dec_serial_hook(unsigned int channel,
+ struct dec_serial_hook *hook)
+{
#ifdef CONFIG_ZS
-extern void zs_serial_console_init(void);
-#endif
-
-#ifdef CONFIG_DZ
-extern void dz_serial_console_init(void);
+ if (IOASIC)
+ return register_zs_hook(channel, hook);
#endif
+ return 0;
+}
+int unregister_dec_serial_hook(unsigned int channel)
+{
+#ifdef CONFIG_ZS
+ if (IOASIC)
+ return unregister_zs_hook(channel);
#endif
+ return 0;
+}
-/* rs_init - starts up the serial interface -
- handle normal case of starting up the serial interface */
-#ifdef CONFIG_SERIAL
+extern int zs_init(void);
+extern int dz_init(void);
+/*
+ * rs_init - starts up the serial interface -
+ * handle normal case of starting up the serial interface
+ */
int __init rs_init(void)
{
-
-#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
- if (IOASIC)
- return zs_init();
- else
- return dz_init();
-#else
-
#ifdef CONFIG_ZS
- return zs_init();
+ if (IOASIC)
+ return zs_init();
#endif
-
#ifdef CONFIG_DZ
- return dz_init();
-#endif
-
+ if (!IOASIC)
+ return dz_init();
#endif
+ return -ENXIO;
}
__initcall(rs_init);
-#endif
-#ifdef CONFIG_SERIAL_CONSOLE
+#ifdef CONFIG_SERIAL_DEC_CONSOLE
-/* serial_console_init handles the special case of starting
- * up the console on the serial port
+extern void zs_serial_console_init(void);
+extern void dz_serial_console_init(void);
+
+/*
+ * dec_serial_console_init handles the special case of starting
+ * up the console on the serial port
*/
-static int __init decserial_console_init(void)
+static int __init dec_serial_console_init(void)
{
-#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
- if (IOASIC)
- zs_serial_console_init();
- else
- dz_serial_console_init();
-#else
-
#ifdef CONFIG_ZS
- zs_serial_console_init();
+ if (IOASIC)
+ zs_serial_console_init();
#endif
-
#ifdef CONFIG_DZ
- dz_serial_console_init();
-#endif
-
+ if (!IOASIC)
+ dz_serial_console_init();
#endif
return 0;
}
-console_initcall(decserial_console_init);
+console_initcall(dec_serial_console_init);
#endif