Commit 9399575d authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Linus Torvalds

[PATCH] dz: Fixes to make it work

This a set of fixes mostly to make the driver actually work:

1. Actually select the line for setting parameters and receiver
   disable/enable.
2. Select the line for receive and transmit interrupt handling correctly.
3. Report the transmitter empty state correctly.
4. Set the I/O type of ports correctly.
5. Perform polled transmission correctly.
6. Don't fix the console line at ttyS3.
7. Magic SysRq support.
8. Various small bits here and there.

Tested with a DECstation 2100 (thanks Flo for making this possible).

[akpm@osdl.org: fix typo]
Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f7dff2b1
...@@ -23,20 +23,12 @@ ...@@ -23,20 +23,12 @@
extern int zs_init(void); extern int zs_init(void);
#endif #endif
#ifdef CONFIG_DZ
extern int dz_init(void);
#endif
#ifdef CONFIG_SERIAL_CONSOLE #ifdef CONFIG_SERIAL_CONSOLE
#ifdef CONFIG_ZS #ifdef CONFIG_ZS
extern void zs_serial_console_init(void); extern void zs_serial_console_init(void);
#endif #endif
#ifdef CONFIG_DZ
extern void dz_serial_console_init(void);
#endif
#endif #endif
/* rs_init - starts up the serial interface - /* rs_init - starts up the serial interface -
...@@ -46,23 +38,11 @@ extern void dz_serial_console_init(void); ...@@ -46,23 +38,11 @@ extern void dz_serial_console_init(void);
int __init rs_init(void) int __init rs_init(void)
{ {
#ifdef CONFIG_ZS
#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
if (IOASIC) if (IOASIC)
return zs_init(); return zs_init();
else
return dz_init();
#else
#ifdef CONFIG_ZS
return zs_init();
#endif
#ifdef CONFIG_DZ
return dz_init();
#endif
#endif #endif
return -ENXIO;
} }
__initcall(rs_init); __initcall(rs_init);
...@@ -76,21 +56,9 @@ __initcall(rs_init); ...@@ -76,21 +56,9 @@ __initcall(rs_init);
*/ */
static int __init decserial_console_init(void) static int __init decserial_console_init(void)
{ {
#if defined(CONFIG_ZS) && defined(CONFIG_DZ) #ifdef CONFIG_ZS
if (IOASIC) if (IOASIC)
zs_serial_console_init(); zs_serial_console_init();
else
dz_serial_console_init();
#else
#ifdef CONFIG_ZS
zs_serial_console_init();
#endif
#ifdef CONFIG_DZ
dz_serial_console_init();
#endif
#endif #endif
return 0; return 0;
} }
......
This diff is collapsed.
/* /*
* dz.h: Serial port driver for DECStations equiped * dz.h: Serial port driver for DECstations equipped
* with the DZ chipset. * with the DZ chipset.
* *
* Copyright (C) 1998 Olivier A. D. Lebaillif * Copyright (C) 1998 Olivier A. D. Lebaillif
* *
* Email: olivier.lebaillif@ifrsys.com * Email: olivier.lebaillif@ifrsys.com
* *
* Copyright (C) 2004, 2006 Maciej W. Rozycki
*/ */
#ifndef DZ_SERIAL_H #ifndef DZ_SERIAL_H
#define DZ_SERIAL_H #define DZ_SERIAL_H
/* /*
* Definitions for the Control and Status Received. * Definitions for the Control and Status Register.
*/ */
#define DZ_TRDY 0x8000 /* Transmitter empty */ #define DZ_TRDY 0x8000 /* Transmitter empty */
#define DZ_TIE 0x4000 /* Transmitter Interrupt Enable */ #define DZ_TIE 0x4000 /* Transmitter Interrupt Enbl */
#define DZ_TLINE 0x0300 /* Transmitter Line Number */
#define DZ_RDONE 0x0080 /* Receiver data ready */ #define DZ_RDONE 0x0080 /* Receiver data ready */
#define DZ_RIE 0x0040 /* Receive Interrupt Enable */ #define DZ_RIE 0x0040 /* Receive Interrupt Enable */
#define DZ_MSE 0x0020 /* Master Scan Enable */ #define DZ_MSE 0x0020 /* Master Scan Enable */
...@@ -22,32 +24,44 @@ ...@@ -22,32 +24,44 @@
#define DZ_MAINT 0x0008 /* Loop Back Mode */ #define DZ_MAINT 0x0008 /* Loop Back Mode */
/* /*
* Definitions for the Received buffer. * Definitions for the Receiver Buffer Register.
*/ */
#define DZ_RBUF_MASK 0x00FF /* Data Mask in the Receive Buffer */ #define DZ_RBUF_MASK 0x00FF /* Data Mask */
#define DZ_LINE_MASK 0x0300 /* Line Mask in the Receive Buffer */ #define DZ_LINE_MASK 0x0300 /* Line Mask */
#define DZ_DVAL 0x8000 /* Valid Data indicator */ #define DZ_DVAL 0x8000 /* Valid Data indicator */
#define DZ_OERR 0x4000 /* Overrun error indicator */ #define DZ_OERR 0x4000 /* Overrun error indicator */
#define DZ_FERR 0x2000 /* Frame error indicator */ #define DZ_FERR 0x2000 /* Frame error indicator */
#define DZ_PERR 0x1000 /* Parity error indicator */ #define DZ_PERR 0x1000 /* Parity error indicator */
#define LINE(x) (x & DZ_LINE_MASK) >> 8 /* Get the line number from the input buffer */ #define LINE(x) ((x & DZ_LINE_MASK) >> 8) /* Get the line number
#define UCHAR(x) (unsigned char)(x & DZ_RBUF_MASK) from the input buffer */
#define UCHAR(x) ((unsigned char)(x & DZ_RBUF_MASK))
/* /*
* Definitions for the Transmit Register. * Definitions for the Transmit Control Register.
*/ */
#define DZ_LINE_KEYBOARD 0x0001 #define DZ_LINE_KEYBOARD 0x0001
#define DZ_LINE_MOUSE 0x0002 #define DZ_LINE_MOUSE 0x0002
#define DZ_LINE_MODEM 0x0004 #define DZ_LINE_MODEM 0x0004
#define DZ_LINE_PRINTER 0x0008 #define DZ_LINE_PRINTER 0x0008
#define DZ_MODEM_RTS 0x0800 /* RTS for the modem line (2) */
#define DZ_MODEM_DTR 0x0400 /* DTR for the modem line (2) */ #define DZ_MODEM_DTR 0x0400 /* DTR for the modem line (2) */
#define DZ_PRINT_RTS 0x0200 /* RTS for the prntr line (3) */
#define DZ_PRINT_DTR 0x0100 /* DTR for the prntr line (3) */
#define DZ_LNENB 0x000f /* Transmitter Line Enable */
/* /*
* Definitions for the Modem Status Register. * Definitions for the Modem Status Register.
*/ */
#define DZ_MODEM_RI 0x0800 /* RI for the modem line (2) */
#define DZ_MODEM_CD 0x0400 /* CD for the modem line (2) */
#define DZ_MODEM_DSR 0x0200 /* DSR for the modem line (2) */ #define DZ_MODEM_DSR 0x0200 /* DSR for the modem line (2) */
#define DZ_MODEM_CTS 0x0100 /* CTS for the modem line (2) */
#define DZ_PRINT_RI 0x0008 /* RI for the printer line (3) */
#define DZ_PRINT_CD 0x0004 /* CD for the printer line (3) */
#define DZ_PRINT_DSR 0x0002 /* DSR for the prntr line (3) */
#define DZ_PRINT_CTS 0x0001 /* CTS for the prntr line (3) */
/* /*
* Definitions for the Transmit Data Register. * Definitions for the Transmit Data Register.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment