Lines Matching +full:up +full:- +full:to
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
10 * to David S. Miller, Eddie C. Dost, Pete Zaitcev, Ted Ts'o and Alex Buell
13 * Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org)
46 * On IP22 we need to delay after register accesses but we do not need to
87 #define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel *)((PORT)->membase))
90 (UART_ZILOG(PORT)->curregs[REGNUM])
92 ((UART_ZILOG(PORT)->curregs[REGNUM]) = (REGVAL))
93 #define ZS_IS_CONS(UP) ((UP)->flags & IP22ZILOG_FLAG_IS_CONS) argument
94 #define ZS_IS_KGDB(UP) ((UP)->flags & IP22ZILOG_FLAG_IS_KGDB) argument
95 #define ZS_WANTS_MODEM_STATUS(UP) ((UP)->flags & IP22ZILOG_FLAG_MODEM_STATUS) argument
96 #define ZS_IS_CHANNEL_A(UP) ((UP)->flags & IP22ZILOG_FLAG_IS_CHANNEL_A) argument
97 #define ZS_REGS_HELD(UP) ((UP)->flags & IP22ZILOG_FLAG_REGS_HELD) argument
98 #define ZS_TX_STOPPED(UP) ((UP)->flags & IP22ZILOG_FLAG_TX_STOPPED) argument
99 #define ZS_TX_ACTIVE(UP) ((UP)->flags & IP22ZILOG_FLAG_TX_ACTIVE) argument
101 /* Reading and writing Zilog8530 registers. The delays are to make this
104 * flip-flops which implement the settle time we do in software.
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()
170 writeb(ERR_RES, &channel->control); in __load_zsregs()
233 static void ip22zilog_maybe_update_regs(struct uart_ip22zilog_port *up, in ip22zilog_maybe_update_regs() argument
236 if (!ZS_REGS_HELD(up)) { in ip22zilog_maybe_update_regs()
237 if (ZS_TX_ACTIVE(up)) { in ip22zilog_maybe_update_regs()
238 up->flags |= IP22ZILOG_FLAG_REGS_HELD; in ip22zilog_maybe_update_regs()
240 __load_zsregs(channel, up->curregs); in ip22zilog_maybe_update_regs()
248 static bool ip22zilog_receive_chars(struct uart_ip22zilog_port *up, in ip22zilog_receive_chars() argument
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()
313 static void ip22zilog_status_handle(struct uart_ip22zilog_port *up, in ip22zilog_status_handle() argument
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()
334 if (ZS_WANTS_MODEM_STATUS(up)) { in ip22zilog_status_handle()
336 up->port.icount.dsr++; in ip22zilog_status_handle()
339 * But it does not tell us which bit has changed, we have to keep 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()
355 static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up, in ip22zilog_transmit_chars() argument
361 if (ZS_IS_CONS(up)) { in ip22zilog_transmit_chars()
362 unsigned char status = readb(&channel->control); in ip22zilog_transmit_chars()
368 * be nice to transmit console writes just like we normally would for 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()
379 if (ZS_REGS_HELD(up)) { 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()
384 if (ZS_TX_STOPPED(up)) { 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()
426 struct uart_ip22zilog_port *up = dev_id; in ip22zilog_interrupt() local
428 while (up) { in ip22zilog_interrupt()
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()
444 push = ip22zilog_receive_chars(up, channel); in ip22zilog_interrupt()
446 ip22zilog_status_handle(up, channel); in ip22zilog_interrupt()
448 ip22zilog_transmit_chars(up, channel); 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()
467 push = ip22zilog_receive_chars(up, channel); in ip22zilog_interrupt()
469 ip22zilog_status_handle(up, channel); in ip22zilog_interrupt()
471 ip22zilog_transmit_chars(up, channel); 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()
484 /* A convenient way to quickly get R0 status. The caller must _not_ hold the
493 status = readb(&channel->control); in ip22zilog_read_channel_status()
542 struct uart_ip22zilog_port *up = in ip22zilog_set_mctrl() local
558 /* NOTE: Not subject to 'transmitter active' rule. */ 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()
567 struct uart_ip22zilog_port *up = in ip22zilog_stop_tx() local
570 up->flags |= IP22ZILOG_FLAG_TX_STOPPED; in ip22zilog_stop_tx()
576 struct uart_ip22zilog_port *up = in ip22zilog_start_tx() local
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()
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()
619 struct uart_ip22zilog_port *up = UART_ZILOG(port); in ip22zilog_stop_rx() local
622 if (ZS_IS_CONS(up)) in ip22zilog_stop_rx()
628 up->curregs[R1] &= ~RxINT_MASK; in ip22zilog_stop_rx()
629 ip22zilog_maybe_update_regs(up, channel); in ip22zilog_stop_rx()
635 struct uart_ip22zilog_port *up = in ip22zilog_enable_ms() local
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()
644 /* NOTE: Not subject to 'transmitter active' rule. */ in ip22zilog_enable_ms()
645 write_zsreg(channel, R15, up->curregs[R15]); in ip22zilog_enable_ms()
652 struct uart_ip22zilog_port *up = in ip22zilog_break_ctl() local
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()
671 /* NOTE: Not subject to 'transmitter active' rule. */ in ip22zilog_break_ctl()
672 write_zsreg(channel, R5, up->curregs[R5]); in ip22zilog_break_ctl()
678 static void __ip22zilog_reset(struct uart_ip22zilog_port *up) in __ip22zilog_reset() argument
683 if (up->flags & IP22ZILOG_FLAG_RESET_DONE) in __ip22zilog_reset()
687 channel = ZILOG_CHANNEL_FROM_PORT(&up->port); in __ip22zilog_reset()
695 if (!ZS_IS_CHANNEL_A(up)) { in __ip22zilog_reset()
696 up++; 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()
707 static void __ip22zilog_startup(struct uart_ip22zilog_port *up) in __ip22zilog_startup() argument
711 channel = ZILOG_CHANNEL_FROM_PORT(&up->port); in __ip22zilog_startup()
713 __ip22zilog_reset(up); 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()
725 ip22zilog_maybe_update_regs(up, channel); in __ip22zilog_startup()
730 struct uart_ip22zilog_port *up = UART_ZILOG(port); in ip22zilog_startup() local
733 if (ZS_IS_CONS(up)) in ip22zilog_startup()
737 __ip22zilog_startup(up); 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:
755 * That is correct. We are unable to call uart_startup when the serial
756 * console is initialised because it may need to allocate memory (as
764 * do the normal software shutdown - ie, free irqs etc)
769 struct uart_ip22zilog_port *up = UART_ZILOG(port); in ip22zilog_shutdown() local
773 if (ZS_IS_CONS(up)) 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()
787 ip22zilog_maybe_update_regs(up, channel); in ip22zilog_shutdown()
796 ip22zilog_convert_to_zs(struct uart_ip22zilog_port *up, unsigned int cflag, in ip22zilog_convert_to_zs() argument
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()
874 struct uart_ip22zilog_port *up = in ip22zilog_set_termios() local
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()
900 return "IP22-Zilog"; in ip22zilog_type()
915 /* These do not need to do anything interesting either. */
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()
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() local
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()
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() local
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()
1039 __ip22zilog_startup(up); 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,
1076 struct uart_ip22zilog_port *up; in ip22zilog_prepare() local
1086 ip22zilog_irq_chain = &ip22zilog_port_table[NUM_CHANNELS - 1]; in ip22zilog_prepare()
1087 up = &ip22zilog_port_table[0]; 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()
1090 up[channel].next = NULL; 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()
1131 struct uart_ip22zilog_port *up = &ip22zilog_port_table[channel]; in ip22zilog_prepare() local
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()
1168 struct uart_ip22zilog_port *up = &ip22zilog_port_table[i]; in ip22zilog_ports_init() local
1170 uart_add_one_port(&ip22zilog_reg, &up->port); in ip22zilog_ports_init()
1179 /* IP22 Zilog setup is hard coded, no probing to do. */ in ip22zilog_init()
1189 struct uart_ip22zilog_port *up; in ip22zilog_exit() local
1192 up = &ip22zilog_port_table[i]; in ip22zilog_exit()
1194 uart_remove_one_port(&ip22zilog_reg, &up->port); in ip22zilog_exit()
1198 up = &ip22zilog_port_table[0]; 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()
1216 /* David wrote it but I'm to blame for the bugs ... */
1217 MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");