1 // SPDX-License-Identifier: GPL-2.0
3 * dz.c: Serial port driver for DECstations equipped
6 * Copyright (C) 1998 Olivier A. D. Lebaillif
8 * Email: olivier.lebaillif@ifrsys.com
10 * Copyright (C) 2004, 2006, 2007 Maciej W. Rozycki
13 * Changed IRQ to use Harald's dec internals interrupts.h
14 * removed base_addr code - moving address assignment to setup.c
15 * Changed name of dz_init to rs_init to be consistent with tc code
16 * [13-NOV-98] triemer fixed code to receive characters
17 * after patches by harald to irq code.
18 * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout
19 * field from "current" - somewhere between 2.1.121 and 2.1.131
20 Qua Jun 27 15:02:26 BRT 2001
21 * [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups
23 * Parts (C) 1999 David Airlie, airlied@linux.ie
24 * [07-SEP-99] Bugfixes
26 * [06-Jan-2002] Russell King <rmk@arm.linux.org.uk>
27 * Converted to new serial core
32 #include <linux/bitops.h>
33 #include <linux/compiler.h>
34 #include <linux/console.h>
35 #include <linux/delay.h>
36 #include <linux/errno.h>
37 #include <linux/init.h>
38 #include <linux/interrupt.h>
39 #include <linux/ioport.h>
40 #include <linux/kernel.h>
41 #include <linux/major.h>
42 #include <linux/module.h>
43 #include <linux/serial.h>
44 #include <linux/serial_core.h>
45 #include <linux/sysrq.h>
46 #include <linux/tty.h>
47 #include <linux/tty_flip.h>
49 #include <linux/atomic.h>
50 #include <asm/bootinfo.h>
53 #include <asm/dec/interrupts.h>
54 #include <asm/dec/kn01.h>
55 #include <asm/dec/kn02.h>
56 #include <asm/dec/machtype.h>
57 #include <asm/dec/prom.h>
58 #include <asm/dec/system.h>
63 MODULE_DESCRIPTION("DECstation DZ serial driver");
64 MODULE_LICENSE("GPL");
67 static char dz_name
[] __initdata
= "DECstation DZ serial driver version ";
68 static char dz_version
[] __initdata
= "1.04";
72 struct uart_port port
;
77 struct dz_port dport
[DZ_NB_PORT
];
83 static struct dz_mux dz_mux
;
85 static inline struct dz_port
*to_dport(struct uart_port
*uport
)
87 return container_of(uport
, struct dz_port
, port
);
91 * ------------------------------------------------------------
92 * dz_in () and dz_out ()
94 * These routines are used to access the registers of the DZ
95 * chip, hiding relocation differences between implementation.
96 * ------------------------------------------------------------
99 static u16
dz_in(struct dz_port
*dport
, unsigned offset
)
101 void __iomem
*addr
= dport
->port
.membase
+ offset
;
106 static void dz_out(struct dz_port
*dport
, unsigned offset
, u16 value
)
108 void __iomem
*addr
= dport
->port
.membase
+ offset
;
114 * ------------------------------------------------------------
115 * rs_stop () and rs_start ()
117 * These routines are called before setting or resetting
118 * tty->stopped. They enable or disable transmitter interrupts,
120 * ------------------------------------------------------------
123 static void dz_stop_tx(struct uart_port
*uport
)
125 struct dz_port
*dport
= to_dport(uport
);
126 u16 tmp
, mask
= 1 << dport
->port
.line
;
128 tmp
= dz_in(dport
, DZ_TCR
); /* read the TX flag */
129 tmp
&= ~mask
; /* clear the TX flag */
130 dz_out(dport
, DZ_TCR
, tmp
);
133 static void dz_start_tx(struct uart_port
*uport
)
135 struct dz_port
*dport
= to_dport(uport
);
136 u16 tmp
, mask
= 1 << dport
->port
.line
;
138 tmp
= dz_in(dport
, DZ_TCR
); /* read the TX flag */
139 tmp
|= mask
; /* set the TX flag */
140 dz_out(dport
, DZ_TCR
, tmp
);
143 static void dz_stop_rx(struct uart_port
*uport
)
145 struct dz_port
*dport
= to_dport(uport
);
147 dport
->cflag
&= ~DZ_RXENAB
;
148 dz_out(dport
, DZ_LPR
, dport
->cflag
);
152 * ------------------------------------------------------------
154 * Here start the interrupt handling routines. All of the following
155 * subroutines are declared as inline and are folded into
156 * dz_interrupt. They were separated out for readability's sake.
158 * Note: dz_interrupt() is a "fast" interrupt, which means that it
159 * runs with interrupts turned off. People who may want to modify
160 * dz_interrupt() should try to keep the interrupt handler as fast as
161 * possible. After you are done making modifications, it is not a bad
164 * make drivers/serial/dz.s
166 * and look at the resulting assemble code in dz.s.
168 * ------------------------------------------------------------
172 * ------------------------------------------------------------
175 * This routine deals with inputs from any lines.
176 * ------------------------------------------------------------
178 static inline void dz_receive_chars(struct dz_mux
*mux
)
180 struct uart_port
*uport
;
181 struct dz_port
*dport
= &mux
->dport
[0];
182 struct uart_icount
*icount
;
183 int lines_rx
[DZ_NB_PORT
] = { [0 ... DZ_NB_PORT
- 1] = 0 };
184 unsigned char ch
, flag
;
188 while ((status
= dz_in(dport
, DZ_RBUF
)) & DZ_DVAL
) {
189 dport
= &mux
->dport
[LINE(status
)];
190 uport
= &dport
->port
;
192 ch
= UCHAR(status
); /* grab the char */
195 icount
= &uport
->icount
;
198 if (unlikely(status
& (DZ_OERR
| DZ_FERR
| DZ_PERR
))) {
201 * There is no separate BREAK status bit, so treat
202 * null characters with framing errors as BREAKs;
203 * normally, otherwise. For this move the Framing
204 * Error bit to a simulated BREAK bit.
207 status
|= (status
& DZ_FERR
) >>
208 (ffs(DZ_FERR
) - ffs(DZ_BREAK
));
212 /* Handle SysRq/SAK & keep track of the statistics. */
213 if (status
& DZ_BREAK
) {
215 if (uart_handle_break(uport
))
217 } else if (status
& DZ_FERR
)
219 else if (status
& DZ_PERR
)
221 if (status
& DZ_OERR
)
224 status
&= uport
->read_status_mask
;
225 if (status
& DZ_BREAK
)
227 else if (status
& DZ_FERR
)
229 else if (status
& DZ_PERR
)
234 if (uart_handle_sysrq_char(uport
, ch
))
237 uart_insert_char(uport
, status
, DZ_OERR
, ch
, flag
);
238 lines_rx
[LINE(status
)] = 1;
240 for (i
= 0; i
< DZ_NB_PORT
; i
++)
242 tty_flip_buffer_push(&mux
->dport
[i
].port
.state
->port
);
246 * ------------------------------------------------------------
249 * This routine deals with outputs to any lines.
250 * ------------------------------------------------------------
252 static inline void dz_transmit_chars(struct dz_mux
*mux
)
254 struct dz_port
*dport
= &mux
->dport
[0];
255 struct circ_buf
*xmit
;
259 status
= dz_in(dport
, DZ_CSR
);
260 dport
= &mux
->dport
[LINE(status
)];
261 xmit
= &dport
->port
.state
->xmit
;
263 if (dport
->port
.x_char
) { /* XON/XOFF chars */
264 dz_out(dport
, DZ_TDR
, dport
->port
.x_char
);
265 dport
->port
.icount
.tx
++;
266 dport
->port
.x_char
= 0;
269 /* If nothing to do or stopped or hardware stopped. */
270 if (uart_circ_empty(xmit
) || uart_tx_stopped(&dport
->port
)) {
271 spin_lock(&dport
->port
.lock
);
272 dz_stop_tx(&dport
->port
);
273 spin_unlock(&dport
->port
.lock
);
278 * If something to do... (remember the dz has no output fifo,
279 * so we go one char at a time) :-<
281 tmp
= xmit
->buf
[xmit
->tail
];
282 xmit
->tail
= (xmit
->tail
+ 1) & (DZ_XMIT_SIZE
- 1);
283 dz_out(dport
, DZ_TDR
, tmp
);
284 dport
->port
.icount
.tx
++;
286 if (uart_circ_chars_pending(xmit
) < DZ_WAKEUP_CHARS
)
287 uart_write_wakeup(&dport
->port
);
289 /* Are we are done. */
290 if (uart_circ_empty(xmit
)) {
291 spin_lock(&dport
->port
.lock
);
292 dz_stop_tx(&dport
->port
);
293 spin_unlock(&dport
->port
.lock
);
298 * ------------------------------------------------------------
299 * check_modem_status()
301 * DS 3100 & 5100: Only valid for the MODEM line, duh!
302 * DS 5000/200: Valid for the MODEM and PRINTER line.
303 * ------------------------------------------------------------
305 static inline void check_modem_status(struct dz_port
*dport
)
309 * 1. No status change interrupt; use a timer.
310 * 2. Handle the 3100/5000 as appropriate. --macro
314 /* If not the modem line just return. */
315 if (dport
->port
.line
!= DZ_MODEM
)
318 status
= dz_in(dport
, DZ_MSR
);
320 /* it's easy, since DSR2 is the only bit in the register */
322 dport
->port
.icount
.dsr
++;
326 * ------------------------------------------------------------
329 * this is the main interrupt routine for the DZ chip.
330 * It deals with the multiple ports.
331 * ------------------------------------------------------------
333 static irqreturn_t
dz_interrupt(int irq
, void *dev_id
)
335 struct dz_mux
*mux
= dev_id
;
336 struct dz_port
*dport
= &mux
->dport
[0];
339 /* get the reason why we just got an irq */
340 status
= dz_in(dport
, DZ_CSR
);
342 if ((status
& (DZ_RDONE
| DZ_RIE
)) == (DZ_RDONE
| DZ_RIE
))
343 dz_receive_chars(mux
);
345 if ((status
& (DZ_TRDY
| DZ_TIE
)) == (DZ_TRDY
| DZ_TIE
))
346 dz_transmit_chars(mux
);
352 * -------------------------------------------------------------------
353 * Here ends the DZ interrupt routines.
354 * -------------------------------------------------------------------
357 static unsigned int dz_get_mctrl(struct uart_port
*uport
)
360 * FIXME: Handle the 3100/5000 as appropriate. --macro
362 struct dz_port
*dport
= to_dport(uport
);
363 unsigned int mctrl
= TIOCM_CAR
| TIOCM_DSR
| TIOCM_CTS
;
365 if (dport
->port
.line
== DZ_MODEM
) {
366 if (dz_in(dport
, DZ_MSR
) & DZ_MODEM_DSR
)
373 static void dz_set_mctrl(struct uart_port
*uport
, unsigned int mctrl
)
376 * FIXME: Handle the 3100/5000 as appropriate. --macro
378 struct dz_port
*dport
= to_dport(uport
);
381 if (dport
->port
.line
== DZ_MODEM
) {
382 tmp
= dz_in(dport
, DZ_TCR
);
383 if (mctrl
& TIOCM_DTR
)
384 tmp
&= ~DZ_MODEM_DTR
;
387 dz_out(dport
, DZ_TCR
, tmp
);
392 * -------------------------------------------------------------------
395 * various initialization tasks
396 * -------------------------------------------------------------------
398 static int dz_startup(struct uart_port
*uport
)
400 struct dz_port
*dport
= to_dport(uport
);
401 struct dz_mux
*mux
= dport
->mux
;
407 irq_guard
= atomic_add_return(1, &mux
->irq_guard
);
411 ret
= request_irq(dport
->port
.irq
, dz_interrupt
,
412 IRQF_SHARED
, "dz", mux
);
414 atomic_add(-1, &mux
->irq_guard
);
415 printk(KERN_ERR
"dz: Cannot get IRQ %d!\n", dport
->port
.irq
);
419 spin_lock_irqsave(&dport
->port
.lock
, flags
);
421 /* Enable interrupts. */
422 tmp
= dz_in(dport
, DZ_CSR
);
423 tmp
|= DZ_RIE
| DZ_TIE
;
424 dz_out(dport
, DZ_CSR
, tmp
);
426 spin_unlock_irqrestore(&dport
->port
.lock
, flags
);
432 * -------------------------------------------------------------------
435 * This routine will shutdown a serial port; interrupts are disabled, and
436 * DTR is dropped if the hangup on close termio flag is on.
437 * -------------------------------------------------------------------
439 static void dz_shutdown(struct uart_port
*uport
)
441 struct dz_port
*dport
= to_dport(uport
);
442 struct dz_mux
*mux
= dport
->mux
;
447 spin_lock_irqsave(&dport
->port
.lock
, flags
);
448 dz_stop_tx(&dport
->port
);
449 spin_unlock_irqrestore(&dport
->port
.lock
, flags
);
451 irq_guard
= atomic_add_return(-1, &mux
->irq_guard
);
453 /* Disable interrupts. */
454 tmp
= dz_in(dport
, DZ_CSR
);
455 tmp
&= ~(DZ_RIE
| DZ_TIE
);
456 dz_out(dport
, DZ_CSR
, tmp
);
458 free_irq(dport
->port
.irq
, mux
);
463 * -------------------------------------------------------------------
464 * dz_tx_empty() -- get the transmitter empty status
466 * Purpose: Let user call ioctl() to get info when the UART physically
467 * is emptied. On bus types like RS485, the transmitter must
468 * release the bus after transmitting. This must be done when
469 * the transmit shift register is empty, not be done when the
470 * transmit holding register is empty. This functionality
471 * allows an RS485 driver to be written in user space.
472 * -------------------------------------------------------------------
474 static unsigned int dz_tx_empty(struct uart_port
*uport
)
476 struct dz_port
*dport
= to_dport(uport
);
477 unsigned short tmp
, mask
= 1 << dport
->port
.line
;
479 tmp
= dz_in(dport
, DZ_TCR
);
482 return tmp
? 0 : TIOCSER_TEMT
;
485 static void dz_break_ctl(struct uart_port
*uport
, int break_state
)
488 * FIXME: Can't access BREAK bits in TDR easily;
489 * reuse the code for polled TX. --macro
491 struct dz_port
*dport
= to_dport(uport
);
493 unsigned short tmp
, mask
= 1 << dport
->port
.line
;
495 spin_lock_irqsave(&uport
->lock
, flags
);
496 tmp
= dz_in(dport
, DZ_TCR
);
501 dz_out(dport
, DZ_TCR
, tmp
);
502 spin_unlock_irqrestore(&uport
->lock
, flags
);
505 static int dz_encode_baud_rate(unsigned int baud
)
544 static void dz_reset(struct dz_port
*dport
)
546 struct dz_mux
*mux
= dport
->mux
;
548 if (mux
->initialised
)
551 dz_out(dport
, DZ_CSR
, DZ_CLR
);
552 while (dz_in(dport
, DZ_CSR
) & DZ_CLR
);
555 /* Enable scanning. */
556 dz_out(dport
, DZ_CSR
, DZ_MSE
);
558 mux
->initialised
= 1;
561 static void dz_set_termios(struct uart_port
*uport
, struct ktermios
*termios
,
562 struct ktermios
*old_termios
)
564 struct dz_port
*dport
= to_dport(uport
);
566 unsigned int cflag
, baud
;
569 cflag
= dport
->port
.line
;
571 switch (termios
->c_cflag
& CSIZE
) {
586 if (termios
->c_cflag
& CSTOPB
)
588 if (termios
->c_cflag
& PARENB
)
590 if (termios
->c_cflag
& PARODD
)
593 baud
= uart_get_baud_rate(uport
, termios
, old_termios
, 50, 9600);
594 bflag
= dz_encode_baud_rate(baud
);
595 if (bflag
< 0) { /* Try to keep unchanged. */
596 baud
= uart_get_baud_rate(uport
, old_termios
, NULL
, 50, 9600);
597 bflag
= dz_encode_baud_rate(baud
);
598 if (bflag
< 0) { /* Resort to 9600. */
602 tty_termios_encode_baud_rate(termios
, baud
, baud
);
606 if (termios
->c_cflag
& CREAD
)
609 spin_lock_irqsave(&dport
->port
.lock
, flags
);
611 uart_update_timeout(uport
, termios
->c_cflag
, baud
);
613 dz_out(dport
, DZ_LPR
, cflag
);
614 dport
->cflag
= cflag
;
616 /* setup accept flag */
617 dport
->port
.read_status_mask
= DZ_OERR
;
618 if (termios
->c_iflag
& INPCK
)
619 dport
->port
.read_status_mask
|= DZ_FERR
| DZ_PERR
;
620 if (termios
->c_iflag
& (IGNBRK
| BRKINT
| PARMRK
))
621 dport
->port
.read_status_mask
|= DZ_BREAK
;
623 /* characters to ignore */
624 uport
->ignore_status_mask
= 0;
625 if ((termios
->c_iflag
& (IGNPAR
| IGNBRK
)) == (IGNPAR
| IGNBRK
))
626 dport
->port
.ignore_status_mask
|= DZ_OERR
;
627 if (termios
->c_iflag
& IGNPAR
)
628 dport
->port
.ignore_status_mask
|= DZ_FERR
| DZ_PERR
;
629 if (termios
->c_iflag
& IGNBRK
)
630 dport
->port
.ignore_status_mask
|= DZ_BREAK
;
632 spin_unlock_irqrestore(&dport
->port
.lock
, flags
);
637 * Required solely so that the initial PROM-based console
638 * works undisturbed in parallel with this one.
640 static void dz_pm(struct uart_port
*uport
, unsigned int state
,
641 unsigned int oldstate
)
643 struct dz_port
*dport
= to_dport(uport
);
646 spin_lock_irqsave(&dport
->port
.lock
, flags
);
648 dz_start_tx(&dport
->port
);
650 dz_stop_tx(&dport
->port
);
651 spin_unlock_irqrestore(&dport
->port
.lock
, flags
);
655 static const char *dz_type(struct uart_port
*uport
)
660 static void dz_release_port(struct uart_port
*uport
)
662 struct dz_mux
*mux
= to_dport(uport
)->mux
;
665 iounmap(uport
->membase
);
666 uport
->membase
= NULL
;
668 map_guard
= atomic_add_return(-1, &mux
->map_guard
);
670 release_mem_region(uport
->mapbase
, dec_kn_slot_size
);
673 static int dz_map_port(struct uart_port
*uport
)
676 uport
->membase
= ioremap(uport
->mapbase
,
678 if (!uport
->membase
) {
679 printk(KERN_ERR
"dz: Cannot map MMIO\n");
685 static int dz_request_port(struct uart_port
*uport
)
687 struct dz_mux
*mux
= to_dport(uport
)->mux
;
691 map_guard
= atomic_add_return(1, &mux
->map_guard
);
692 if (map_guard
== 1) {
693 if (!request_mem_region(uport
->mapbase
, dec_kn_slot_size
,
695 atomic_add(-1, &mux
->map_guard
);
697 "dz: Unable to reserve MMIO resource\n");
701 ret
= dz_map_port(uport
);
703 map_guard
= atomic_add_return(-1, &mux
->map_guard
);
705 release_mem_region(uport
->mapbase
, dec_kn_slot_size
);
711 static void dz_config_port(struct uart_port
*uport
, int flags
)
713 struct dz_port
*dport
= to_dport(uport
);
715 if (flags
& UART_CONFIG_TYPE
) {
716 if (dz_request_port(uport
))
719 uport
->type
= PORT_DZ
;
726 * Verify the new serial_struct (for TIOCSSERIAL).
728 static int dz_verify_port(struct uart_port
*uport
, struct serial_struct
*ser
)
732 if (ser
->type
!= PORT_UNKNOWN
&& ser
->type
!= PORT_DZ
)
734 if (ser
->irq
!= uport
->irq
)
739 static const struct uart_ops dz_ops
= {
740 .tx_empty
= dz_tx_empty
,
741 .get_mctrl
= dz_get_mctrl
,
742 .set_mctrl
= dz_set_mctrl
,
743 .stop_tx
= dz_stop_tx
,
744 .start_tx
= dz_start_tx
,
745 .stop_rx
= dz_stop_rx
,
746 .break_ctl
= dz_break_ctl
,
747 .startup
= dz_startup
,
748 .shutdown
= dz_shutdown
,
749 .set_termios
= dz_set_termios
,
752 .release_port
= dz_release_port
,
753 .request_port
= dz_request_port
,
754 .config_port
= dz_config_port
,
755 .verify_port
= dz_verify_port
,
758 static void __init
dz_init_ports(void)
760 static int first
= 1;
768 if (mips_machtype
== MACH_DS23100
|| mips_machtype
== MACH_DS5100
)
769 base
= dec_kn_slot_base
+ KN01_DZ11
;
771 base
= dec_kn_slot_base
+ KN02_DZ11
;
773 for (line
= 0; line
< DZ_NB_PORT
; line
++) {
774 struct dz_port
*dport
= &dz_mux
.dport
[line
];
775 struct uart_port
*uport
= &dport
->port
;
777 dport
->mux
= &dz_mux
;
779 uport
->irq
= dec_interrupt
[DEC_IRQ_DZ11
];
781 uport
->iotype
= UPIO_MEM
;
782 uport
->flags
= UPF_BOOT_AUTOCONF
;
783 uport
->ops
= &dz_ops
;
785 uport
->mapbase
= base
;
786 uport
->has_sysrq
= IS_ENABLED(CONFIG_SERIAL_DZ_CONSOLE
);
790 #ifdef CONFIG_SERIAL_DZ_CONSOLE
792 * -------------------------------------------------------------------
793 * dz_console_putchar() -- transmit a character
795 * Polled transmission. This is tricky. We need to mask transmit
796 * interrupts so that they do not interfere, enable the transmitter
797 * for the line requested and then wait till the transmit scanner
798 * requests data for this line. But it may request data for another
799 * line first, in which case we have to disable its transmitter and
800 * repeat waiting till our line pops up. Only then the character may
801 * be transmitted. Finally, the state of the transmitter mask is
802 * restored. Welcome to the world of PDP-11!
803 * -------------------------------------------------------------------
805 static void dz_console_putchar(struct uart_port
*uport
, int ch
)
807 struct dz_port
*dport
= to_dport(uport
);
809 unsigned short csr
, tcr
, trdy
, mask
;
812 spin_lock_irqsave(&dport
->port
.lock
, flags
);
813 csr
= dz_in(dport
, DZ_CSR
);
814 dz_out(dport
, DZ_CSR
, csr
& ~DZ_TIE
);
815 tcr
= dz_in(dport
, DZ_TCR
);
816 tcr
|= 1 << dport
->port
.line
;
818 dz_out(dport
, DZ_TCR
, mask
);
820 spin_unlock_irqrestore(&dport
->port
.lock
, flags
);
823 trdy
= dz_in(dport
, DZ_CSR
);
824 if (!(trdy
& DZ_TRDY
))
826 trdy
= (trdy
& DZ_TLINE
) >> 8;
827 if (trdy
== dport
->port
.line
)
829 mask
&= ~(1 << trdy
);
830 dz_out(dport
, DZ_TCR
, mask
);
835 if (loops
) /* Cannot send otherwise. */
836 dz_out(dport
, DZ_TDR
, ch
);
838 dz_out(dport
, DZ_TCR
, tcr
);
839 dz_out(dport
, DZ_CSR
, csr
);
843 * -------------------------------------------------------------------
844 * dz_console_print ()
846 * dz_console_print is registered for printk.
847 * The console must be locked when we get here.
848 * -------------------------------------------------------------------
850 static void dz_console_print(struct console
*co
,
854 struct dz_port
*dport
= &dz_mux
.dport
[co
->index
];
856 prom_printf((char *) str
);
858 uart_console_write(&dport
->port
, str
, count
, dz_console_putchar
);
861 static int __init
dz_console_setup(struct console
*co
, char *options
)
863 struct dz_port
*dport
= &dz_mux
.dport
[co
->index
];
864 struct uart_port
*uport
= &dport
->port
;
871 ret
= dz_map_port(uport
);
875 spin_lock_init(&dport
->port
.lock
); /* For dz_pm(). */
881 uart_parse_options(options
, &baud
, &parity
, &bits
, &flow
);
883 return uart_set_options(&dport
->port
, co
, baud
, parity
, bits
, flow
);
886 static struct uart_driver dz_reg
;
887 static struct console dz_console
= {
889 .write
= dz_console_print
,
890 .device
= uart_console_device
,
891 .setup
= dz_console_setup
,
892 .flags
= CON_PRINTBUFFER
,
897 static int __init
dz_serial_console_init(void)
901 register_console(&dz_console
);
907 console_initcall(dz_serial_console_init
);
909 #define SERIAL_DZ_CONSOLE &dz_console
911 #define SERIAL_DZ_CONSOLE NULL
912 #endif /* CONFIG_SERIAL_DZ_CONSOLE */
914 static struct uart_driver dz_reg
= {
915 .owner
= THIS_MODULE
,
916 .driver_name
= "serial",
921 .cons
= SERIAL_DZ_CONSOLE
,
924 static int __init
dz_init(void)
931 printk("%s%s\n", dz_name
, dz_version
);
935 ret
= uart_register_driver(&dz_reg
);
939 for (i
= 0; i
< DZ_NB_PORT
; i
++)
940 uart_add_one_port(&dz_reg
, &dz_mux
.dport
[i
].port
);
945 module_init(dz_init
);