Lines Matching +full:port +full:- +full:2

1 // SPDX-License-Identifier: GPL-2.0
6 * This is based on the drivers/serial/sunzilog.c code as of 2.6.0-test7 and the
13 * Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org)
54 #define NUM_CHANNELS (NUM_IP22ZILOG * 2)
60 * We wrap our port structure around the generic uart_port.
63 struct uart_port port; member
87 #define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel *)((PORT)->membase)) argument
88 #define UART_ZILOG(PORT) ((struct uart_ip22zilog_port *)(PORT)) argument
89 #define IP22ZILOG_GET_CURR_REG(PORT, REGNUM) \ argument
90 (UART_ZILOG(PORT)->curregs[REGNUM])
91 #define IP22ZILOG_SET_CURR_REG(PORT, REGNUM, REGVAL) \ argument
92 ((UART_ZILOG(PORT)->curregs[REGNUM]) = (REGVAL))
93 #define ZS_IS_CONS(UP) ((UP)->flags & IP22ZILOG_FLAG_IS_CONS)
94 #define ZS_IS_KGDB(UP) ((UP)->flags & IP22ZILOG_FLAG_IS_KGDB)
95 #define ZS_WANTS_MODEM_STATUS(UP) ((UP)->flags & IP22ZILOG_FLAG_MODEM_STATUS)
96 #define ZS_IS_CHANNEL_A(UP) ((UP)->flags & IP22ZILOG_FLAG_IS_CHANNEL_A)
97 #define ZS_REGS_HELD(UP) ((UP)->flags & IP22ZILOG_FLAG_REGS_HELD)
98 #define ZS_TX_STOPPED(UP) ((UP)->flags & IP22ZILOG_FLAG_TX_STOPPED)
99 #define ZS_TX_ACTIVE(UP) ((UP)->flags & IP22ZILOG_FLAG_TX_ACTIVE)
104 * flip-flops which implement the settle time we do in software.
106 * The port lock must be held and local IRQs must be disabled
114 writeb(reg, &channel->control); in read_zsreg()
116 retval = readb(&channel->control); in read_zsreg()
125 writeb(reg, &channel->control); in write_zsreg()
127 writeb(value, &channel->control); in write_zsreg()
138 regval = readb(&channel->control); in ip22zilog_clear_fifo()
144 readb(&channel->data); in ip22zilog_clear_fifo()
148 writeb(ERR_RES, &channel->control); in ip22zilog_clear_fifo()
156 * port lock must be held and local interrupts disabled.
170 writeb(ERR_RES, &channel->control); in __load_zsregs()
231 * The UART port lock must be held and local interrupts disabled.
238 up->flags |= IP22ZILOG_FLAG_REGS_HELD; in ip22zilog_maybe_update_regs()
240 __load_zsregs(channel, up->curregs); in ip22zilog_maybe_update_regs()
253 bool push = up->port.state != NULL; in ip22zilog_receive_chars()
256 ch = readb(&channel->control); in ip22zilog_receive_chars()
263 writeb(ERR_RES, &channel->control); in ip22zilog_receive_chars()
268 ch = readb(&channel->data); in ip22zilog_receive_chars()
271 ch &= up->parity_mask; in ip22zilog_receive_chars()
275 r1 |= up->tty_break; in ip22zilog_receive_chars()
279 up->port.icount.rx++; in ip22zilog_receive_chars()
281 up->tty_break = 0; in ip22zilog_receive_chars()
284 up->port.icount.brk++; in ip22zilog_receive_chars()
290 up->port.icount.parity++; in ip22zilog_receive_chars()
292 up->port.icount.frame++; in ip22zilog_receive_chars()
294 up->port.icount.overrun++; in ip22zilog_receive_chars()
295 r1 &= up->port.read_status_mask; in ip22zilog_receive_chars()
304 if (uart_handle_sysrq_char(&up->port, ch)) in ip22zilog_receive_chars()
308 uart_insert_char(&up->port, r1, Rx_OVR, ch, flag); in ip22zilog_receive_chars()
318 status = readb(&channel->control); in ip22zilog_status_handle()
321 writeb(RES_EXT_INT, &channel->control); in ip22zilog_status_handle()
325 if (up->curregs[R15] & BRKIE) { in ip22zilog_status_handle()
326 if ((status & BRK_ABRT) && !(up->prev_status & BRK_ABRT)) { in ip22zilog_status_handle()
327 if (uart_handle_break(&up->port)) in ip22zilog_status_handle()
328 up->tty_break = Rx_SYS; in ip22zilog_status_handle()
330 up->tty_break = Rx_BRK; in ip22zilog_status_handle()
336 up->port.icount.dsr++; in ip22zilog_status_handle()
342 if ((status ^ up->prev_status) ^ DCD) in ip22zilog_status_handle()
343 uart_handle_dcd_change(&up->port, in ip22zilog_status_handle()
345 if ((status ^ up->prev_status) ^ CTS) in ip22zilog_status_handle()
346 uart_handle_cts_change(&up->port, in ip22zilog_status_handle()
349 wake_up_interruptible(&up->port.state->port.delta_msr_wait); in ip22zilog_status_handle()
352 up->prev_status = status; in ip22zilog_status_handle()
362 unsigned char status = readb(&channel->control); in ip22zilog_transmit_chars()
371 * to poll on enough port->xmit space becoming free. -DaveM in ip22zilog_transmit_chars()
377 up->flags &= ~IP22ZILOG_FLAG_TX_ACTIVE; in ip22zilog_transmit_chars()
380 __load_zsregs(channel, up->curregs); in ip22zilog_transmit_chars()
381 up->flags &= ~IP22ZILOG_FLAG_REGS_HELD; in ip22zilog_transmit_chars()
385 up->flags &= ~IP22ZILOG_FLAG_TX_STOPPED; in ip22zilog_transmit_chars()
389 if (up->port.x_char) { in ip22zilog_transmit_chars()
390 up->flags |= IP22ZILOG_FLAG_TX_ACTIVE; in ip22zilog_transmit_chars()
391 writeb(up->port.x_char, &channel->data); in ip22zilog_transmit_chars()
395 up->port.icount.tx++; in ip22zilog_transmit_chars()
396 up->port.x_char = 0; in ip22zilog_transmit_chars()
400 if (up->port.state == NULL) in ip22zilog_transmit_chars()
402 tport = &up->port.state->port; in ip22zilog_transmit_chars()
403 if (uart_tx_stopped(&up->port)) in ip22zilog_transmit_chars()
405 if (!uart_fifo_get(&up->port, &c)) in ip22zilog_transmit_chars()
408 up->flags |= IP22ZILOG_FLAG_TX_ACTIVE; in ip22zilog_transmit_chars()
409 writeb(c, &channel->data); in ip22zilog_transmit_chars()
413 if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS) in ip22zilog_transmit_chars()
414 uart_write_wakeup(&up->port); in ip22zilog_transmit_chars()
419 writeb(RES_Tx_P, &channel->control); in ip22zilog_transmit_chars()
430 = ZILOG_CHANNEL_FROM_PORT(&up->port); in ip22zilog_interrupt()
434 uart_port_lock(&up->port); in ip22zilog_interrupt()
439 writeb(RES_H_IUS, &channel->control); in ip22zilog_interrupt()
450 uart_port_unlock(&up->port); in ip22zilog_interrupt()
453 tty_flip_buffer_push(&up->port.state->port); in ip22zilog_interrupt()
456 up = up->next; in ip22zilog_interrupt()
457 channel = ZILOG_CHANNEL_FROM_PORT(&up->port); in ip22zilog_interrupt()
460 uart_port_lock(&up->port); in ip22zilog_interrupt()
462 writeb(RES_H_IUS, &channel->control); in ip22zilog_interrupt()
473 uart_port_unlock(&up->port); in ip22zilog_interrupt()
476 tty_flip_buffer_push(&up->port.state->port); in ip22zilog_interrupt()
478 up = up->next; in ip22zilog_interrupt()
485 * port lock, it is acquired here.
487 static __inline__ unsigned char ip22zilog_read_channel_status(struct uart_port *port) in ip22zilog_read_channel_status() argument
492 channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_read_channel_status()
493 status = readb(&channel->control); in ip22zilog_read_channel_status()
499 /* The port lock is not held. */
500 static unsigned int ip22zilog_tx_empty(struct uart_port *port) in ip22zilog_tx_empty() argument
506 uart_port_lock_irqsave(port, &flags); in ip22zilog_tx_empty()
508 status = ip22zilog_read_channel_status(port); in ip22zilog_tx_empty()
510 uart_port_unlock_irqrestore(port, flags); in ip22zilog_tx_empty()
520 /* The port lock is held and interrupts are disabled. */
521 static unsigned int ip22zilog_get_mctrl(struct uart_port *port) in ip22zilog_get_mctrl() argument
526 status = ip22zilog_read_channel_status(port); in ip22zilog_get_mctrl()
539 /* The port lock is held and interrupts are disabled. */
540 static void ip22zilog_set_mctrl(struct uart_port *port, unsigned int mctrl) in ip22zilog_set_mctrl() argument
543 container_of(port, struct uart_ip22zilog_port, port); in ip22zilog_set_mctrl()
544 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_set_mctrl()
559 up->curregs[R5] |= set_bits; in ip22zilog_set_mctrl()
560 up->curregs[R5] &= ~clear_bits; in ip22zilog_set_mctrl()
561 write_zsreg(channel, R5, up->curregs[R5]); in ip22zilog_set_mctrl()
564 /* The port lock is held and interrupts are disabled. */
565 static void ip22zilog_stop_tx(struct uart_port *port) in ip22zilog_stop_tx() argument
568 container_of(port, struct uart_ip22zilog_port, port); in ip22zilog_stop_tx()
570 up->flags |= IP22ZILOG_FLAG_TX_STOPPED; in ip22zilog_stop_tx()
573 /* The port lock is held and interrupts are disabled. */
574 static void ip22zilog_start_tx(struct uart_port *port) in ip22zilog_start_tx() argument
577 container_of(port, struct uart_ip22zilog_port, port); in ip22zilog_start_tx()
578 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_start_tx()
581 up->flags |= IP22ZILOG_FLAG_TX_ACTIVE; in ip22zilog_start_tx()
582 up->flags &= ~IP22ZILOG_FLAG_TX_STOPPED; in ip22zilog_start_tx()
584 status = readb(&channel->control); in ip22zilog_start_tx()
591 /* Send the first character to jump-start the TX done in ip22zilog_start_tx()
594 if (port->x_char) { in ip22zilog_start_tx()
595 writeb(port->x_char, &channel->data); in ip22zilog_start_tx()
599 port->icount.tx++; in ip22zilog_start_tx()
600 port->x_char = 0; in ip22zilog_start_tx()
602 struct tty_port *tport = &port->state->port; in ip22zilog_start_tx()
605 if (!uart_fifo_get(port, &c)) in ip22zilog_start_tx()
607 writeb(c, &channel->data); in ip22zilog_start_tx()
611 if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS) in ip22zilog_start_tx()
612 uart_write_wakeup(&up->port); in ip22zilog_start_tx()
616 /* The port lock is held and interrupts are disabled. */
617 static void ip22zilog_stop_rx(struct uart_port *port) in ip22zilog_stop_rx() argument
619 struct uart_ip22zilog_port *up = UART_ZILOG(port); in ip22zilog_stop_rx()
625 channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_stop_rx()
628 up->curregs[R1] &= ~RxINT_MASK; in ip22zilog_stop_rx()
632 /* The port lock is held. */
633 static void ip22zilog_enable_ms(struct uart_port *port) in ip22zilog_enable_ms() argument
636 container_of(port, struct uart_ip22zilog_port, port); in ip22zilog_enable_ms()
637 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_enable_ms()
640 new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE); in ip22zilog_enable_ms()
641 if (new_reg != up->curregs[R15]) { in ip22zilog_enable_ms()
642 up->curregs[R15] = new_reg; in ip22zilog_enable_ms()
645 write_zsreg(channel, R15, up->curregs[R15]); in ip22zilog_enable_ms()
649 /* The port lock is not held. */
650 static void ip22zilog_break_ctl(struct uart_port *port, int break_state) in ip22zilog_break_ctl() argument
653 container_of(port, struct uart_ip22zilog_port, port); in ip22zilog_break_ctl()
654 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_break_ctl()
665 uart_port_lock_irqsave(port, &flags); in ip22zilog_break_ctl()
667 new_reg = (up->curregs[R5] | set_bits) & ~clear_bits; in ip22zilog_break_ctl()
668 if (new_reg != up->curregs[R5]) { in ip22zilog_break_ctl()
669 up->curregs[R5] = new_reg; in ip22zilog_break_ctl()
672 write_zsreg(channel, R5, up->curregs[R5]); in ip22zilog_break_ctl()
675 uart_port_unlock_irqrestore(port, flags); in ip22zilog_break_ctl()
683 if (up->flags & IP22ZILOG_FLAG_RESET_DONE) in __ip22zilog_reset()
687 channel = ZILOG_CHANNEL_FROM_PORT(&up->port); in __ip22zilog_reset()
697 channel = ZILOG_CHANNEL_FROM_PORT(&up->port); in __ip22zilog_reset()
703 up->flags |= IP22ZILOG_FLAG_RESET_DONE; in __ip22zilog_reset()
704 up->next->flags |= IP22ZILOG_FLAG_RESET_DONE; in __ip22zilog_reset()
711 channel = ZILOG_CHANNEL_FROM_PORT(&up->port); in __ip22zilog_startup()
715 __load_zsregs(channel, up->curregs); in __ip22zilog_startup()
717 write_zsreg(channel, R9, up->curregs[R9]); in __ip22zilog_startup()
718 up->prev_status = readb(&channel->control); in __ip22zilog_startup()
721 up->curregs[R3] |= RxENAB; in __ip22zilog_startup()
722 up->curregs[R5] |= TxENAB; in __ip22zilog_startup()
724 up->curregs[R1] |= EXT_INT_ENAB | INT_ALL_Rx | TxINT_ENAB; in __ip22zilog_startup()
728 static int ip22zilog_startup(struct uart_port *port) in ip22zilog_startup() argument
730 struct uart_ip22zilog_port *up = UART_ZILOG(port); in ip22zilog_startup()
736 uart_port_lock_irqsave(port, &flags); in ip22zilog_startup()
738 uart_port_unlock_irqrestore(port, flags); in ip22zilog_startup()
743 * The test for ZS_IS_CONS is explained by the following e-mail:
748 * On Sun, Dec 08, 2002 at 02:43:36AM -0500, Pete Zaitcev wrote:
760 * 1. initialise the port into a state where it can send characters in the
763 * 2. don't do the actual hardware shutdown in your shutdown() method (but
764 * do the normal software shutdown - ie, free irqs etc)
767 static void ip22zilog_shutdown(struct uart_port *port) in ip22zilog_shutdown() argument
769 struct uart_ip22zilog_port *up = UART_ZILOG(port); in ip22zilog_shutdown()
776 uart_port_lock_irqsave(port, &flags); in ip22zilog_shutdown()
778 channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_shutdown()
781 up->curregs[R3] &= ~RxENAB; in ip22zilog_shutdown()
782 up->curregs[R5] &= ~TxENAB; in ip22zilog_shutdown()
785 up->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK); in ip22zilog_shutdown()
786 up->curregs[R5] &= ~SND_BRK; in ip22zilog_shutdown()
789 uart_port_unlock_irqrestore(port, flags); in ip22zilog_shutdown()
792 /* Shared by TTY driver and serial console setup. The port lock is held
800 up->curregs[R10] = NRZ; in ip22zilog_convert_to_zs()
801 up->curregs[R11] = TCBR | RCBR; in ip22zilog_convert_to_zs()
804 up->curregs[R4] &= ~XCLK_MASK; in ip22zilog_convert_to_zs()
805 up->curregs[R4] |= X16CLK; in ip22zilog_convert_to_zs()
806 up->curregs[R12] = brg & 0xff; in ip22zilog_convert_to_zs()
807 up->curregs[R13] = (brg >> 8) & 0xff; in ip22zilog_convert_to_zs()
808 up->curregs[R14] = BRENAB; in ip22zilog_convert_to_zs()
811 up->curregs[3] &= ~RxN_MASK; in ip22zilog_convert_to_zs()
812 up->curregs[5] &= ~TxN_MASK; in ip22zilog_convert_to_zs()
815 up->curregs[3] |= Rx5; in ip22zilog_convert_to_zs()
816 up->curregs[5] |= Tx5; in ip22zilog_convert_to_zs()
817 up->parity_mask = 0x1f; in ip22zilog_convert_to_zs()
820 up->curregs[3] |= Rx6; in ip22zilog_convert_to_zs()
821 up->curregs[5] |= Tx6; in ip22zilog_convert_to_zs()
822 up->parity_mask = 0x3f; in ip22zilog_convert_to_zs()
825 up->curregs[3] |= Rx7; in ip22zilog_convert_to_zs()
826 up->curregs[5] |= Tx7; in ip22zilog_convert_to_zs()
827 up->parity_mask = 0x7f; in ip22zilog_convert_to_zs()
831 up->curregs[3] |= Rx8; in ip22zilog_convert_to_zs()
832 up->curregs[5] |= Tx8; in ip22zilog_convert_to_zs()
833 up->parity_mask = 0xff; in ip22zilog_convert_to_zs()
836 up->curregs[4] &= ~0x0c; in ip22zilog_convert_to_zs()
838 up->curregs[4] |= SB2; in ip22zilog_convert_to_zs()
840 up->curregs[4] |= SB1; in ip22zilog_convert_to_zs()
842 up->curregs[4] |= PAR_ENAB; in ip22zilog_convert_to_zs()
844 up->curregs[4] &= ~PAR_ENAB; in ip22zilog_convert_to_zs()
846 up->curregs[4] |= PAR_EVEN; in ip22zilog_convert_to_zs()
848 up->curregs[4] &= ~PAR_EVEN; in ip22zilog_convert_to_zs()
850 up->port.read_status_mask = Rx_OVR; in ip22zilog_convert_to_zs()
852 up->port.read_status_mask |= CRC_ERR | PAR_ERR; in ip22zilog_convert_to_zs()
854 up->port.read_status_mask |= BRK_ABRT; in ip22zilog_convert_to_zs()
856 up->port.ignore_status_mask = 0; in ip22zilog_convert_to_zs()
858 up->port.ignore_status_mask |= CRC_ERR | PAR_ERR; in ip22zilog_convert_to_zs()
860 up->port.ignore_status_mask |= BRK_ABRT; in ip22zilog_convert_to_zs()
862 up->port.ignore_status_mask |= Rx_OVR; in ip22zilog_convert_to_zs()
866 up->port.ignore_status_mask = 0xff; in ip22zilog_convert_to_zs()
869 /* The port lock is not held. */
871 ip22zilog_set_termios(struct uart_port *port, struct ktermios *termios, in ip22zilog_set_termios() argument
875 container_of(port, struct uart_ip22zilog_port, port); in ip22zilog_set_termios()
879 baud = uart_get_baud_rate(port, termios, old, 1200, 76800); in ip22zilog_set_termios()
881 uart_port_lock_irqsave(&up->port, &flags); in ip22zilog_set_termios()
885 ip22zilog_convert_to_zs(up, termios->c_cflag, termios->c_iflag, brg); in ip22zilog_set_termios()
887 if (UART_ENABLE_MS(&up->port, termios->c_cflag)) in ip22zilog_set_termios()
888 up->flags |= IP22ZILOG_FLAG_MODEM_STATUS; in ip22zilog_set_termios()
890 up->flags &= ~IP22ZILOG_FLAG_MODEM_STATUS; in ip22zilog_set_termios()
892 ip22zilog_maybe_update_regs(up, ZILOG_CHANNEL_FROM_PORT(port)); in ip22zilog_set_termios()
893 uart_update_timeout(port, termios->c_cflag, baud); in ip22zilog_set_termios()
895 uart_port_unlock_irqrestore(&up->port, flags); in ip22zilog_set_termios()
898 static const char *ip22zilog_type(struct uart_port *port) in ip22zilog_type() argument
900 return "IP22-Zilog"; in ip22zilog_type()
906 static void ip22zilog_release_port(struct uart_port *port) in ip22zilog_release_port() argument
910 static int ip22zilog_request_port(struct uart_port *port) in ip22zilog_request_port() argument
916 static void ip22zilog_config_port(struct uart_port *port, int flags) in ip22zilog_config_port() argument
921 static int ip22zilog_verify_port(struct uart_port *port, struct serial_struct *ser) in ip22zilog_verify_port() argument
923 return -EINVAL; in ip22zilog_verify_port()
949 static int zilog_irq = -1;
964 panic("IP22-Zilog: Cannot allocate IP22-Zilog tables."); in ip22zilog_alloc_tables()
968 /* Get the address of the registers for IP22-Zilog instance CHIP. */
974 panic("IP22-Zilog: Illegal chip number %d in get_zs.", chip); in get_zs()
977 /* Not probe-able, hard code it. */ in get_zs()
978 base = (unsigned long) &sgioc->uart; in get_zs()
981 request_mem_region(base, 8, "IP22-Zilog"); in get_zs()
989 static void ip22zilog_put_char(struct uart_port *port, unsigned char ch) in ip22zilog_put_char() argument
991 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); in ip22zilog_put_char()
995 * udelay with ZSDELAY as that is a NOP on some platforms. -DaveM in ip22zilog_put_char()
998 unsigned char val = readb(&channel->control); in ip22zilog_put_char()
1004 } while (--loops); in ip22zilog_put_char()
1006 writeb(ch, &channel->data); in ip22zilog_put_char()
1014 struct uart_ip22zilog_port *up = &ip22zilog_port_table[con->index]; in ip22zilog_console_write()
1017 uart_port_lock_irqsave(&up->port, &flags); in ip22zilog_console_write()
1018 uart_console_write(&up->port, s, count, ip22zilog_put_char); in ip22zilog_console_write()
1019 udelay(2); in ip22zilog_console_write()
1020 uart_port_unlock_irqrestore(&up->port, flags); in ip22zilog_console_write()
1025 struct uart_ip22zilog_port *up = &ip22zilog_port_table[con->index]; in ip22zilog_console_setup()
1031 up->flags |= IP22ZILOG_FLAG_IS_CONS; in ip22zilog_console_setup()
1033 printk(KERN_INFO "Console: ttyS%d (IP22-Zilog)\n", con->index); in ip22zilog_console_setup()
1035 uart_port_lock_irqsave(&up->port, &flags); in ip22zilog_console_setup()
1037 up->curregs[R15] |= BRKIE; in ip22zilog_console_setup()
1041 uart_port_unlock_irqrestore(&up->port, flags); in ip22zilog_console_setup()
1045 return uart_set_options(&up->port, con, baud, parity, bits, flow); in ip22zilog_console_setup()
1056 .index = -1,
1084 spin_lock_init(&ip22zilog_port_table[channel].port.lock); in ip22zilog_prepare()
1086 ip22zilog_irq_chain = &ip22zilog_port_table[NUM_CHANNELS - 1]; in ip22zilog_prepare()
1088 for (channel = NUM_CHANNELS - 1 ; channel > 0; channel--) in ip22zilog_prepare()
1089 up[channel].next = &up[channel - 1]; in ip22zilog_prepare()
1096 up[(chip * 2) + 0].port.membase = (char *) &rp->channelB; in ip22zilog_prepare()
1097 up[(chip * 2) + 1].port.membase = (char *) &rp->channelA; in ip22zilog_prepare()
1100 up[(chip * 2) + 0].port.mapbase = in ip22zilog_prepare()
1101 (unsigned long) ioremap((unsigned long) &rp->channelB, 8); in ip22zilog_prepare()
1102 up[(chip * 2) + 1].port.mapbase = in ip22zilog_prepare()
1103 (unsigned long) ioremap((unsigned long) &rp->channelA, 8); in ip22zilog_prepare()
1107 up[(chip * 2) + 0].port.iotype = UPIO_MEM; in ip22zilog_prepare()
1108 up[(chip * 2) + 0].port.irq = zilog_irq; in ip22zilog_prepare()
1109 up[(chip * 2) + 0].port.uartclk = ZS_CLOCK; in ip22zilog_prepare()
1110 up[(chip * 2) + 0].port.fifosize = 1; in ip22zilog_prepare()
1111 up[(chip * 2) + 0].port.has_sysrq = sysrq_on; in ip22zilog_prepare()
1112 up[(chip * 2) + 0].port.ops = &ip22zilog_pops; in ip22zilog_prepare()
1113 up[(chip * 2) + 0].port.type = PORT_IP22ZILOG; in ip22zilog_prepare()
1114 up[(chip * 2) + 0].port.flags = 0; in ip22zilog_prepare()
1115 up[(chip * 2) + 0].port.line = (chip * 2) + 0; in ip22zilog_prepare()
1116 up[(chip * 2) + 0].flags = 0; in ip22zilog_prepare()
1119 up[(chip * 2) + 1].port.iotype = UPIO_MEM; in ip22zilog_prepare()
1120 up[(chip * 2) + 1].port.irq = zilog_irq; in ip22zilog_prepare()
1121 up[(chip * 2) + 1].port.uartclk = ZS_CLOCK; in ip22zilog_prepare()
1122 up[(chip * 2) + 1].port.fifosize = 1; in ip22zilog_prepare()
1123 up[(chip * 2) + 1].port.has_sysrq = sysrq_on; in ip22zilog_prepare()
1124 up[(chip * 2) + 1].port.ops = &ip22zilog_pops; in ip22zilog_prepare()
1125 up[(chip * 2) + 1].port.type = PORT_IP22ZILOG; in ip22zilog_prepare()
1126 up[(chip * 2) + 1].port.line = (chip * 2) + 1; in ip22zilog_prepare()
1127 up[(chip * 2) + 1].flags |= IP22ZILOG_FLAG_IS_CHANNEL_A; in ip22zilog_prepare()
1135 up->parity_mask = 0xff; in ip22zilog_prepare()
1136 up->curregs[R1] = EXT_INT_ENAB | INT_ALL_Rx | TxINT_ENAB; in ip22zilog_prepare()
1137 up->curregs[R4] = PAR_EVEN | X16CLK | SB1; in ip22zilog_prepare()
1138 up->curregs[R3] = RxENAB | Rx8; in ip22zilog_prepare()
1139 up->curregs[R5] = TxENAB | Tx8; in ip22zilog_prepare()
1140 up->curregs[R9] = NV | MIE; in ip22zilog_prepare()
1141 up->curregs[R10] = NRZ; in ip22zilog_prepare()
1142 up->curregs[R11] = TCBR | RCBR; in ip22zilog_prepare()
1144 up->curregs[R12] = (brg & 0xff); in ip22zilog_prepare()
1145 up->curregs[R13] = (brg >> 8) & 0xff; in ip22zilog_prepare()
1146 up->curregs[R14] = BRENAB; in ip22zilog_prepare()
1159 "IP22-Zilog", ip22zilog_irq_chain)) { in ip22zilog_ports_init()
1160 panic("IP22-Zilog: Unable to register zs interrupt handler.\n"); in ip22zilog_ports_init()
1170 uart_add_one_port(&ip22zilog_reg, &up->port); in ip22zilog_ports_init()
1194 uart_remove_one_port(&ip22zilog_reg, &up->port); in ip22zilog_exit()
1200 if (up[(i * 2) + 0].port.mapbase) { in ip22zilog_exit()
1201 iounmap((void*)up[(i * 2) + 0].port.mapbase); in ip22zilog_exit()
1202 up[(i * 2) + 0].port.mapbase = 0; in ip22zilog_exit()
1204 if (up[(i * 2) + 1].port.mapbase) { in ip22zilog_exit()
1205 iounmap((void*)up[(i * 2) + 1].port.mapbase); in ip22zilog_exit()
1206 up[(i * 2) + 1].port.mapbase = 0; in ip22zilog_exit()
1217 MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
1218 MODULE_DESCRIPTION("SGI Zilog serial port driver");