Lines Matching +full:dma +full:- +full:info

1 // SPDX-License-Identifier: GPL-2.0
5 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
21 * BJD, 04-Nov-2004
25 #include <linux/dma-mapping.h>
94 const struct s3c24xx_uart_info info; member
143 const struct s3c24xx_uart_info *info; member
152 struct s3c24xx_uart_dma *dma; member
163 #define portaddr(port, reg) ((port)->membase + (reg))
165 ((unsigned long *)(unsigned long)((port)->membase + (reg)))
169 switch (port->iotype) { in rd_reg()
184 switch (port->iotype) { in wr_reg()
196 /* Byte-order aware bit setting/clearing functions. */
233 return to_platform_device(port->dev)->name; in s3c24xx_serial_portname()
250 while (--count && !s3c24xx_serial_txempty_nofifo(port)) in s3c24xx_serial_rx_enable()
261 ourport->rx_enabled = 1; in s3c24xx_serial_rx_enable()
277 ourport->rx_enabled = 0; in s3c24xx_serial_rx_disable()
284 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_serial_stop_tx() local
288 if (!ourport->tx_enabled) in s3c24xx_serial_stop_tx()
291 switch (ourport->info->type) { in s3c24xx_serial_stop_tx()
299 disable_irq_nosync(ourport->tx_irq); in s3c24xx_serial_stop_tx()
303 if (dma && dma->tx_chan && ourport->tx_in_progress == S3C24XX_TX_DMA) { in s3c24xx_serial_stop_tx()
304 dmaengine_pause(dma->tx_chan); in s3c24xx_serial_stop_tx()
305 dmaengine_tx_status(dma->tx_chan, dma->tx_cookie, &state); in s3c24xx_serial_stop_tx()
306 dmaengine_terminate_all(dma->tx_chan); in s3c24xx_serial_stop_tx()
307 dma_sync_single_for_cpu(dma->tx_chan->device->dev, in s3c24xx_serial_stop_tx()
308 dma->tx_transfer_addr, dma->tx_size, in s3c24xx_serial_stop_tx()
310 async_tx_ack(dma->tx_desc); in s3c24xx_serial_stop_tx()
311 count = dma->tx_bytes_requested - state.residue; in s3c24xx_serial_stop_tx()
315 ourport->tx_enabled = 0; in s3c24xx_serial_stop_tx()
316 ourport->tx_in_progress = 0; in s3c24xx_serial_stop_tx()
318 if (port->flags & UPF_CONS_FLOW) in s3c24xx_serial_stop_tx()
321 ourport->tx_mode = 0; in s3c24xx_serial_stop_tx()
329 struct uart_port *port = &ourport->port; in s3c24xx_serial_tx_dma_complete()
330 struct circ_buf *xmit = &port->state->xmit; in s3c24xx_serial_tx_dma_complete()
331 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_serial_tx_dma_complete() local
336 dmaengine_tx_status(dma->tx_chan, dma->tx_cookie, &state); in s3c24xx_serial_tx_dma_complete()
337 count = dma->tx_bytes_requested - state.residue; in s3c24xx_serial_tx_dma_complete()
338 async_tx_ack(dma->tx_desc); in s3c24xx_serial_tx_dma_complete()
340 dma_sync_single_for_cpu(dma->tx_chan->device->dev, in s3c24xx_serial_tx_dma_complete()
341 dma->tx_transfer_addr, dma->tx_size, in s3c24xx_serial_tx_dma_complete()
347 ourport->tx_in_progress = 0; in s3c24xx_serial_tx_dma_complete()
358 const struct uart_port *port = &ourport->port; in enable_tx_dma()
362 switch (ourport->info->type) { in enable_tx_dma()
367 WARN_ON(1); // No DMA in enable_tx_dma()
370 disable_irq_nosync(ourport->tx_irq); in enable_tx_dma()
374 /* Enable tx dma mode */ in enable_tx_dma()
381 ourport->tx_mode = S3C24XX_TX_DMA; in enable_tx_dma()
386 const struct uart_port *port = &ourport->port; in enable_tx_pio()
390 ourport->tx_in_progress = S3C24XX_TX_PIO; in enable_tx_pio()
401 switch (ourport->info->type) { in enable_tx_pio()
411 enable_irq(ourport->tx_irq); in enable_tx_pio()
415 ourport->tx_mode = S3C24XX_TX_PIO; in enable_tx_pio()
421 if (ourport->info->type == TYPE_APPLE_S5L) in enable_tx_pio()
427 if (ourport->tx_mode != S3C24XX_TX_PIO) in s3c24xx_serial_start_tx_pio()
434 struct uart_port *port = &ourport->port; in s3c24xx_serial_start_tx_dma()
435 struct circ_buf *xmit = &port->state->xmit; in s3c24xx_serial_start_tx_dma()
436 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_serial_start_tx_dma() local
438 if (ourport->tx_mode != S3C24XX_TX_DMA) in s3c24xx_serial_start_tx_dma()
441 dma->tx_size = count & ~(dma_get_cache_alignment() - 1); in s3c24xx_serial_start_tx_dma()
442 dma->tx_transfer_addr = dma->tx_addr + xmit->tail; in s3c24xx_serial_start_tx_dma()
444 dma_sync_single_for_device(dma->tx_chan->device->dev, in s3c24xx_serial_start_tx_dma()
445 dma->tx_transfer_addr, dma->tx_size, in s3c24xx_serial_start_tx_dma()
448 dma->tx_desc = dmaengine_prep_slave_single(dma->tx_chan, in s3c24xx_serial_start_tx_dma()
449 dma->tx_transfer_addr, dma->tx_size, in s3c24xx_serial_start_tx_dma()
451 if (!dma->tx_desc) { in s3c24xx_serial_start_tx_dma()
452 dev_err(ourport->port.dev, "Unable to get desc for Tx\n"); in s3c24xx_serial_start_tx_dma()
453 return -EIO; in s3c24xx_serial_start_tx_dma()
456 dma->tx_desc->callback = s3c24xx_serial_tx_dma_complete; in s3c24xx_serial_start_tx_dma()
457 dma->tx_desc->callback_param = ourport; in s3c24xx_serial_start_tx_dma()
458 dma->tx_bytes_requested = dma->tx_size; in s3c24xx_serial_start_tx_dma()
460 ourport->tx_in_progress = S3C24XX_TX_DMA; in s3c24xx_serial_start_tx_dma()
461 dma->tx_cookie = dmaengine_submit(dma->tx_desc); in s3c24xx_serial_start_tx_dma()
462 dma_async_issue_pending(dma->tx_chan); in s3c24xx_serial_start_tx_dma()
468 struct uart_port *port = &ourport->port; in s3c24xx_serial_start_next_tx()
469 struct circ_buf *xmit = &port->state->xmit; in s3c24xx_serial_start_next_tx()
473 count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); in s3c24xx_serial_start_next_tx()
480 if (!ourport->dma || !ourport->dma->tx_chan || in s3c24xx_serial_start_next_tx()
481 count < ourport->min_dma_size || in s3c24xx_serial_start_next_tx()
482 xmit->tail & (dma_get_cache_alignment() - 1)) in s3c24xx_serial_start_next_tx()
491 struct circ_buf *xmit = &port->state->xmit; in s3c24xx_serial_start_tx()
493 if (!ourport->tx_enabled) { in s3c24xx_serial_start_tx()
494 if (port->flags & UPF_CONS_FLOW) in s3c24xx_serial_start_tx()
497 ourport->tx_enabled = 1; in s3c24xx_serial_start_tx()
498 if (!ourport->dma || !ourport->dma->tx_chan) in s3c24xx_serial_start_tx()
502 if (ourport->dma && ourport->dma->tx_chan) { in s3c24xx_serial_start_tx()
503 if (!uart_circ_empty(xmit) && !ourport->tx_in_progress) in s3c24xx_serial_start_tx()
511 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_uart_copy_rx_to_tty() local
517 dma_sync_single_for_cpu(dma->rx_chan->device->dev, dma->rx_addr, in s3c24xx_uart_copy_rx_to_tty()
518 dma->rx_size, DMA_FROM_DEVICE); in s3c24xx_uart_copy_rx_to_tty()
520 ourport->port.icount.rx += count; in s3c24xx_uart_copy_rx_to_tty()
522 dev_err(ourport->port.dev, "No tty port\n"); in s3c24xx_uart_copy_rx_to_tty()
526 ((unsigned char *)(ourport->dma->rx_buf)), count); in s3c24xx_uart_copy_rx_to_tty()
529 dev_err(ourport->port.dev, "RxData copy to tty layer failed\n"); in s3c24xx_uart_copy_rx_to_tty()
536 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_serial_stop_rx() local
537 struct tty_port *t = &port->state->port; in s3c24xx_serial_stop_rx()
542 if (ourport->rx_enabled) { in s3c24xx_serial_stop_rx()
543 dev_dbg(port->dev, "stopping rx\n"); in s3c24xx_serial_stop_rx()
544 switch (ourport->info->type) { in s3c24xx_serial_stop_rx()
554 disable_irq_nosync(ourport->rx_irq); in s3c24xx_serial_stop_rx()
557 ourport->rx_enabled = 0; in s3c24xx_serial_stop_rx()
559 if (dma && dma->rx_chan) { in s3c24xx_serial_stop_rx()
560 dmaengine_pause(dma->tx_chan); in s3c24xx_serial_stop_rx()
561 dma_status = dmaengine_tx_status(dma->rx_chan, in s3c24xx_serial_stop_rx()
562 dma->rx_cookie, &state); in s3c24xx_serial_stop_rx()
565 received = dma->rx_bytes_requested - state.residue; in s3c24xx_serial_stop_rx()
566 dmaengine_terminate_all(dma->rx_chan); in s3c24xx_serial_stop_rx()
575 return to_ourport(port)->info; in s3c24xx_port_to_info()
583 if (port->dev == NULL) in s3c24xx_port_to_cfg()
587 return ourport->cfg; in s3c24xx_port_to_cfg()
593 const struct s3c24xx_uart_info *info = ourport->info; in s3c24xx_serial_rx_fifocnt() local
595 if (ufstat & info->rx_fifofull) in s3c24xx_serial_rx_fifocnt()
596 return ourport->port.fifosize; in s3c24xx_serial_rx_fifocnt()
598 return (ufstat & info->rx_fifomask) >> info->rx_fifoshift; in s3c24xx_serial_rx_fifocnt()
605 struct uart_port *port = &ourport->port; in s3c24xx_serial_rx_dma_complete()
607 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_serial_rx_dma_complete() local
608 struct tty_port *t = &port->state->port; in s3c24xx_serial_rx_dma_complete()
609 struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port); in s3c24xx_serial_rx_dma_complete()
615 dmaengine_tx_status(dma->rx_chan, dma->rx_cookie, &state); in s3c24xx_serial_rx_dma_complete()
616 received = dma->rx_bytes_requested - state.residue; in s3c24xx_serial_rx_dma_complete()
617 async_tx_ack(dma->rx_desc); in s3c24xx_serial_rx_dma_complete()
636 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c64xx_start_rx_dma() local
638 dma_sync_single_for_device(dma->rx_chan->device->dev, dma->rx_addr, in s3c64xx_start_rx_dma()
639 dma->rx_size, DMA_FROM_DEVICE); in s3c64xx_start_rx_dma()
641 dma->rx_desc = dmaengine_prep_slave_single(dma->rx_chan, in s3c64xx_start_rx_dma()
642 dma->rx_addr, dma->rx_size, DMA_DEV_TO_MEM, in s3c64xx_start_rx_dma()
644 if (!dma->rx_desc) { in s3c64xx_start_rx_dma()
645 dev_err(ourport->port.dev, "Unable to get desc for Rx\n"); in s3c64xx_start_rx_dma()
649 dma->rx_desc->callback = s3c24xx_serial_rx_dma_complete; in s3c64xx_start_rx_dma()
650 dma->rx_desc->callback_param = ourport; in s3c64xx_start_rx_dma()
651 dma->rx_bytes_requested = dma->rx_size; in s3c64xx_start_rx_dma()
653 dma->rx_cookie = dmaengine_submit(dma->rx_desc); in s3c64xx_start_rx_dma()
654 dma_async_issue_pending(dma->rx_chan); in s3c64xx_start_rx_dma()
657 /* ? - where has parity gone?? */
662 struct uart_port *port = &ourport->port; in enable_rx_dma()
665 /* set Rx mode to DMA mode */ in enable_rx_dma()
680 ourport->rx_mode = S3C24XX_RX_DMA; in enable_rx_dma()
685 struct uart_port *port = &ourport->port; in enable_rx_pio()
688 /* set Rx mode to DMA mode */ in enable_rx_pio()
694 if (ourport->info->type != TYPE_APPLE_S5L) { in enable_rx_pio()
704 ourport->rx_mode = S3C24XX_RX_PIO; in enable_rx_pio()
713 struct uart_port *port = &ourport->port; in s3c24xx_serial_rx_chars_dma()
714 struct s3c24xx_uart_dma *dma = ourport->dma; in s3c24xx_serial_rx_chars_dma() local
715 struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port); in s3c24xx_serial_rx_chars_dma()
716 struct tty_port *t = &port->state->port; in s3c24xx_serial_rx_chars_dma()
726 if (ourport->rx_mode == S3C24XX_RX_PIO) in s3c24xx_serial_rx_chars_dma()
731 if (ourport->rx_mode == S3C24XX_RX_DMA) { in s3c24xx_serial_rx_chars_dma()
732 dmaengine_pause(dma->rx_chan); in s3c24xx_serial_rx_chars_dma()
733 dmaengine_tx_status(dma->rx_chan, dma->rx_cookie, &state); in s3c24xx_serial_rx_chars_dma()
734 dmaengine_terminate_all(dma->rx_chan); in s3c24xx_serial_rx_chars_dma()
735 received = dma->rx_bytes_requested - state.residue; in s3c24xx_serial_rx_chars_dma()
758 struct uart_port *port = &ourport->port; in s3c24xx_serial_rx_drain_fifo()
761 int max_count = port->fifosize; in s3c24xx_serial_rx_drain_fifo()
764 while (max_count-- > 0) { in s3c24xx_serial_rx_drain_fifo()
775 fifocnt--; in s3c24xx_serial_rx_drain_fifo()
780 if (port->flags & UPF_CONS_FLOW) { in s3c24xx_serial_rx_drain_fifo()
783 if (ourport->rx_enabled) { in s3c24xx_serial_rx_drain_fifo()
785 ourport->rx_enabled = 0; in s3c24xx_serial_rx_drain_fifo()
793 ourport->rx_enabled = 1; in s3c24xx_serial_rx_drain_fifo()
803 port->icount.rx++; in s3c24xx_serial_rx_drain_fifo()
806 dev_dbg(port->dev, in s3c24xx_serial_rx_drain_fifo()
812 dev_dbg(port->dev, "break!\n"); in s3c24xx_serial_rx_drain_fifo()
813 port->icount.brk++; in s3c24xx_serial_rx_drain_fifo()
819 port->icount.frame++; in s3c24xx_serial_rx_drain_fifo()
821 port->icount.overrun++; in s3c24xx_serial_rx_drain_fifo()
823 uerstat &= port->read_status_mask; in s3c24xx_serial_rx_drain_fifo()
841 tty_flip_buffer_push(&port->state->port); in s3c24xx_serial_rx_drain_fifo()
847 struct uart_port *port = &ourport->port; in s3c24xx_serial_rx_chars_pio()
860 if (ourport->dma && ourport->dma->rx_chan) in s3c24xx_serial_rx_irq()
867 struct uart_port *port = &ourport->port; in s3c24xx_serial_tx_chars()
868 struct circ_buf *xmit = &port->state->xmit; in s3c24xx_serial_tx_chars()
871 count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); in s3c24xx_serial_tx_chars()
873 if (ourport->dma && ourport->dma->tx_chan && in s3c24xx_serial_tx_chars()
874 count >= ourport->min_dma_size) { in s3c24xx_serial_tx_chars()
875 int align = dma_get_cache_alignment() - in s3c24xx_serial_tx_chars()
876 (xmit->tail & (dma_get_cache_alignment() - 1)); in s3c24xx_serial_tx_chars()
877 if (count - align >= ourport->min_dma_size) { in s3c24xx_serial_tx_chars()
878 dma_count = count - align; in s3c24xx_serial_tx_chars()
883 if (port->x_char) { in s3c24xx_serial_tx_chars()
884 wr_reg(port, S3C2410_UTXH, port->x_char); in s3c24xx_serial_tx_chars()
885 port->icount.tx++; in s3c24xx_serial_tx_chars()
886 port->x_char = 0; in s3c24xx_serial_tx_chars()
901 if (count > port->fifosize) { in s3c24xx_serial_tx_chars()
902 count = port->fifosize; in s3c24xx_serial_tx_chars()
907 if (rd_regl(port, S3C2410_UFSTAT) & ourport->info->tx_fifofull) in s3c24xx_serial_tx_chars()
910 wr_reg(port, S3C2410_UTXH, xmit->buf[xmit->tail]); in s3c24xx_serial_tx_chars()
912 count--; in s3c24xx_serial_tx_chars()
930 struct uart_port *port = &ourport->port; in s3c24xx_serial_tx_irq()
944 const struct uart_port *port = &ourport->port; in s3c64xx_serial_handle_irq()
963 const struct uart_port *port = &ourport->port; in apple_serial_handle_irq()
982 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_tx_empty() local
987 if ((ufstat & info->tx_fifomask) != 0 || in s3c24xx_serial_tx_empty()
988 (ufstat & info->tx_fifofull)) in s3c24xx_serial_tx_empty()
1049 struct s3c24xx_uart_dma *dma = p->dma; in s3c24xx_serial_request_dma() local
1055 dma->rx_conf.direction = DMA_DEV_TO_MEM; in s3c24xx_serial_request_dma()
1056 dma->rx_conf.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; in s3c24xx_serial_request_dma()
1057 dma->rx_conf.src_addr = p->port.mapbase + S3C2410_URXH; in s3c24xx_serial_request_dma()
1058 dma->rx_conf.src_maxburst = 1; in s3c24xx_serial_request_dma()
1060 dma->tx_conf.direction = DMA_MEM_TO_DEV; in s3c24xx_serial_request_dma()
1061 dma->tx_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; in s3c24xx_serial_request_dma()
1062 dma->tx_conf.dst_addr = p->port.mapbase + S3C2410_UTXH; in s3c24xx_serial_request_dma()
1063 dma->tx_conf.dst_maxburst = 1; in s3c24xx_serial_request_dma()
1065 dma->rx_chan = dma_request_chan(p->port.dev, "rx"); in s3c24xx_serial_request_dma()
1067 if (IS_ERR(dma->rx_chan)) { in s3c24xx_serial_request_dma()
1068 reason = "DMA RX channel request failed"; in s3c24xx_serial_request_dma()
1069 ret = PTR_ERR(dma->rx_chan); in s3c24xx_serial_request_dma()
1073 ret = dma_get_slave_caps(dma->rx_chan, &dma_caps); in s3c24xx_serial_request_dma()
1076 reason = "insufficient DMA RX engine capabilities"; in s3c24xx_serial_request_dma()
1077 ret = -EOPNOTSUPP; in s3c24xx_serial_request_dma()
1081 dmaengine_slave_config(dma->rx_chan, &dma->rx_conf); in s3c24xx_serial_request_dma()
1083 dma->tx_chan = dma_request_chan(p->port.dev, "tx"); in s3c24xx_serial_request_dma()
1084 if (IS_ERR(dma->tx_chan)) { in s3c24xx_serial_request_dma()
1085 reason = "DMA TX channel request failed"; in s3c24xx_serial_request_dma()
1086 ret = PTR_ERR(dma->tx_chan); in s3c24xx_serial_request_dma()
1090 ret = dma_get_slave_caps(dma->tx_chan, &dma_caps); in s3c24xx_serial_request_dma()
1093 reason = "insufficient DMA TX engine capabilities"; in s3c24xx_serial_request_dma()
1094 ret = -EOPNOTSUPP; in s3c24xx_serial_request_dma()
1098 dmaengine_slave_config(dma->tx_chan, &dma->tx_conf); in s3c24xx_serial_request_dma()
1101 dma->rx_size = PAGE_SIZE; in s3c24xx_serial_request_dma()
1103 dma->rx_buf = kmalloc(dma->rx_size, GFP_KERNEL); in s3c24xx_serial_request_dma()
1104 if (!dma->rx_buf) { in s3c24xx_serial_request_dma()
1105 ret = -ENOMEM; in s3c24xx_serial_request_dma()
1109 dma->rx_addr = dma_map_single(dma->rx_chan->device->dev, dma->rx_buf, in s3c24xx_serial_request_dma()
1110 dma->rx_size, DMA_FROM_DEVICE); in s3c24xx_serial_request_dma()
1111 if (dma_mapping_error(dma->rx_chan->device->dev, dma->rx_addr)) { in s3c24xx_serial_request_dma()
1112 reason = "DMA mapping error for RX buffer"; in s3c24xx_serial_request_dma()
1113 ret = -EIO; in s3c24xx_serial_request_dma()
1118 dma->tx_addr = dma_map_single(dma->tx_chan->device->dev, in s3c24xx_serial_request_dma()
1119 p->port.state->xmit.buf, UART_XMIT_SIZE, in s3c24xx_serial_request_dma()
1121 if (dma_mapping_error(dma->tx_chan->device->dev, dma->tx_addr)) { in s3c24xx_serial_request_dma()
1122 reason = "DMA mapping error for TX buffer"; in s3c24xx_serial_request_dma()
1123 ret = -EIO; in s3c24xx_serial_request_dma()
1130 dma_unmap_single(dma->rx_chan->device->dev, dma->rx_addr, in s3c24xx_serial_request_dma()
1131 dma->rx_size, DMA_FROM_DEVICE); in s3c24xx_serial_request_dma()
1133 kfree(dma->rx_buf); in s3c24xx_serial_request_dma()
1135 dma_release_channel(dma->tx_chan); in s3c24xx_serial_request_dma()
1137 dma_release_channel(dma->rx_chan); in s3c24xx_serial_request_dma()
1140 dev_warn(p->port.dev, "%s, DMA will not be used\n", reason); in s3c24xx_serial_request_dma()
1146 struct s3c24xx_uart_dma *dma = p->dma; in s3c24xx_serial_release_dma() local
1148 if (dma->rx_chan) { in s3c24xx_serial_release_dma()
1149 dmaengine_terminate_all(dma->rx_chan); in s3c24xx_serial_release_dma()
1150 dma_unmap_single(dma->rx_chan->device->dev, dma->rx_addr, in s3c24xx_serial_release_dma()
1151 dma->rx_size, DMA_FROM_DEVICE); in s3c24xx_serial_release_dma()
1152 kfree(dma->rx_buf); in s3c24xx_serial_release_dma()
1153 dma_release_channel(dma->rx_chan); in s3c24xx_serial_release_dma()
1154 dma->rx_chan = NULL; in s3c24xx_serial_release_dma()
1157 if (dma->tx_chan) { in s3c24xx_serial_release_dma()
1158 dmaengine_terminate_all(dma->tx_chan); in s3c24xx_serial_release_dma()
1159 dma_unmap_single(dma->tx_chan->device->dev, dma->tx_addr, in s3c24xx_serial_release_dma()
1161 dma_release_channel(dma->tx_chan); in s3c24xx_serial_release_dma()
1162 dma->tx_chan = NULL; in s3c24xx_serial_release_dma()
1170 ourport->tx_enabled = 0; in s3c64xx_serial_shutdown()
1171 ourport->tx_mode = 0; in s3c64xx_serial_shutdown()
1172 ourport->rx_enabled = 0; in s3c64xx_serial_shutdown()
1174 free_irq(port->irq, ourport); in s3c64xx_serial_shutdown()
1179 if (ourport->dma) in s3c64xx_serial_shutdown()
1182 ourport->tx_in_progress = 0; in s3c64xx_serial_shutdown()
1199 free_irq(port->irq, ourport); in apple_s5l_serial_shutdown()
1201 ourport->tx_enabled = 0; in apple_s5l_serial_shutdown()
1202 ourport->tx_mode = 0; in apple_s5l_serial_shutdown()
1203 ourport->rx_enabled = 0; in apple_s5l_serial_shutdown()
1205 if (ourport->dma) in apple_s5l_serial_shutdown()
1208 ourport->tx_in_progress = 0; in apple_s5l_serial_shutdown()
1219 if (ourport->dma) { in s3c64xx_serial_startup()
1222 devm_kfree(port->dev, ourport->dma); in s3c64xx_serial_startup()
1223 ourport->dma = NULL; in s3c64xx_serial_startup()
1227 ret = request_irq(port->irq, s3c64xx_serial_handle_irq, IRQF_SHARED, in s3c64xx_serial_startup()
1230 dev_err(port->dev, "cannot get irq %d\n", port->irq); in s3c64xx_serial_startup()
1235 ourport->rx_enabled = 1; in s3c64xx_serial_startup()
1236 ourport->tx_enabled = 0; in s3c64xx_serial_startup()
1265 ret = request_irq(port->irq, apple_serial_handle_irq, 0, in apple_s5l_serial_startup()
1268 dev_err(port->dev, "cannot get irq %d\n", port->irq); in apple_s5l_serial_startup()
1273 ourport->rx_enabled = 1; in apple_s5l_serial_startup()
1274 ourport->tx_enabled = 0; in apple_s5l_serial_startup()
1303 ourport->pm_level = level; in s3c24xx_serial_pm()
1307 while (--timeout && !s3c24xx_serial_txempty_nofifo(port)) in s3c24xx_serial_pm()
1310 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_pm()
1311 clk_disable_unprepare(ourport->baudclk); in s3c24xx_serial_pm()
1313 clk_disable_unprepare(ourport->clk); in s3c24xx_serial_pm()
1317 clk_prepare_enable(ourport->clk); in s3c24xx_serial_pm()
1319 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_pm()
1320 clk_prepare_enable(ourport->baudclk); in s3c24xx_serial_pm()
1323 dev_err(port->dev, "s3c24xx_serial: unknown pm %d\n", level); in s3c24xx_serial_pm()
1344 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_getsource() local
1347 if (info->num_clks == 1) in s3c24xx_serial_getsource()
1351 ucon &= info->clksel_mask; in s3c24xx_serial_getsource()
1352 return ucon >> info->clksel_shift; in s3c24xx_serial_getsource()
1358 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_setsource() local
1361 if (info->num_clks == 1) in s3c24xx_serial_setsource()
1365 if ((ucon & info->clksel_mask) >> info->clksel_shift == clk_sel) in s3c24xx_serial_setsource()
1368 ucon &= ~info->clksel_mask; in s3c24xx_serial_setsource()
1369 ucon |= clk_sel << info->clksel_shift; in s3c24xx_serial_setsource()
1377 const struct s3c24xx_uart_info *info = ourport->info; in s3c24xx_serial_getclk() local
1382 int calc_deviation, deviation = (1 << 30) - 1; in s3c24xx_serial_getclk()
1384 for (cnt = 0; cnt < info->num_clks; cnt++) { in s3c24xx_serial_getclk()
1386 if (ourport->cfg->clk_sel && in s3c24xx_serial_getclk()
1387 !(ourport->cfg->clk_sel & (1 << cnt))) in s3c24xx_serial_getclk()
1391 clk = clk_get(ourport->port.dev, clkname); in s3c24xx_serial_getclk()
1397 dev_err(ourport->port.dev, in s3c24xx_serial_getclk()
1403 if (ourport->info->has_divslot) { in s3c24xx_serial_getclk()
1420 quot--; in s3c24xx_serial_getclk()
1422 calc_deviation = abs(req_baud - baud); in s3c24xx_serial_getclk()
1473 struct clk *clk = ERR_PTR(-EINVAL); in s3c24xx_serial_set_termios()
1483 termios->c_cflag &= ~(HUPCL | CMSPAR); in s3c24xx_serial_set_termios()
1484 termios->c_cflag |= CLOCAL; in s3c24xx_serial_set_termios()
1492 if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) in s3c24xx_serial_set_termios()
1493 quot = port->custom_divisor; in s3c24xx_serial_set_termios()
1499 if (ourport->baudclk != clk) { in s3c24xx_serial_set_termios()
1504 if (!IS_ERR(ourport->baudclk)) { in s3c24xx_serial_set_termios()
1505 clk_disable_unprepare(ourport->baudclk); in s3c24xx_serial_set_termios()
1506 ourport->baudclk = ERR_PTR(-EINVAL); in s3c24xx_serial_set_termios()
1509 ourport->baudclk = clk; in s3c24xx_serial_set_termios()
1510 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0; in s3c24xx_serial_set_termios()
1513 if (ourport->info->has_divslot) { in s3c24xx_serial_set_termios()
1514 unsigned int div = ourport->baudclk_rate / baud; in s3c24xx_serial_set_termios()
1516 if (cfg->has_fracval) { in s3c24xx_serial_set_termios()
1518 dev_dbg(port->dev, "fracval = %04x\n", udivslot); in s3c24xx_serial_set_termios()
1521 dev_dbg(port->dev, "udivslot = %04x (div %d)\n", in s3c24xx_serial_set_termios()
1526 switch (termios->c_cflag & CSIZE) { in s3c24xx_serial_set_termios()
1528 dev_dbg(port->dev, "config: 5bits/char\n"); in s3c24xx_serial_set_termios()
1532 dev_dbg(port->dev, "config: 6bits/char\n"); in s3c24xx_serial_set_termios()
1536 dev_dbg(port->dev, "config: 7bits/char\n"); in s3c24xx_serial_set_termios()
1541 dev_dbg(port->dev, "config: 8bits/char\n"); in s3c24xx_serial_set_termios()
1547 ulcon |= (cfg->ulcon & S3C2410_LCON_IRM); in s3c24xx_serial_set_termios()
1549 if (termios->c_cflag & CSTOPB) in s3c24xx_serial_set_termios()
1552 if (termios->c_cflag & PARENB) { in s3c24xx_serial_set_termios()
1553 if (termios->c_cflag & PARODD) in s3c24xx_serial_set_termios()
1563 dev_dbg(port->dev, in s3c24xx_serial_set_termios()
1570 port->status &= ~UPSTAT_AUTOCTS; in s3c24xx_serial_set_termios()
1573 if (termios->c_cflag & CRTSCTS) { in s3c24xx_serial_set_termios()
1577 port->status = UPSTAT_AUTOCTS; in s3c24xx_serial_set_termios()
1583 if (ourport->info->has_divslot) in s3c24xx_serial_set_termios()
1586 dev_dbg(port->dev, in s3c24xx_serial_set_termios()
1593 * Update the per-port timeout. in s3c24xx_serial_set_termios()
1595 uart_update_timeout(port, termios->c_cflag, baud); in s3c24xx_serial_set_termios()
1600 port->read_status_mask = S3C2410_UERSTAT_OVERRUN; in s3c24xx_serial_set_termios()
1601 if (termios->c_iflag & INPCK) in s3c24xx_serial_set_termios()
1602 port->read_status_mask |= S3C2410_UERSTAT_FRAME | in s3c24xx_serial_set_termios()
1607 port->ignore_status_mask = 0; in s3c24xx_serial_set_termios()
1608 if (termios->c_iflag & IGNPAR) in s3c24xx_serial_set_termios()
1609 port->ignore_status_mask |= S3C2410_UERSTAT_OVERRUN; in s3c24xx_serial_set_termios()
1610 if (termios->c_iflag & IGNBRK && termios->c_iflag & IGNPAR) in s3c24xx_serial_set_termios()
1611 port->ignore_status_mask |= S3C2410_UERSTAT_FRAME; in s3c24xx_serial_set_termios()
1616 if ((termios->c_cflag & CREAD) == 0) in s3c24xx_serial_set_termios()
1617 port->ignore_status_mask |= RXSTAT_DUMMY_READ; in s3c24xx_serial_set_termios()
1626 switch (ourport->info->type) { in s3c24xx_serial_type()
1638 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_config_port() local
1641 port->type = info->port_type; in s3c24xx_serial_config_port()
1650 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_verify_port() local
1652 if (ser->type != PORT_UNKNOWN && ser->type != info->port_type) in s3c24xx_serial_verify_port()
1653 return -EINVAL; in s3c24xx_serial_verify_port()
1743 spin_lock_init(&port->lock); in s3c24xx_serial_init_port_default()
1745 port->iotype = UPIO_MEM; in s3c24xx_serial_init_port_default()
1746 port->uartclk = 0; in s3c24xx_serial_init_port_default()
1747 port->fifosize = 16; in s3c24xx_serial_init_port_default()
1748 port->flags = UPF_BOOT_AUTOCONF; in s3c24xx_serial_init_port_default()
1749 port->line = index; in s3c24xx_serial_init_port_default()
1760 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_resetport() local
1763 ucon &= (info->clksel_mask | info->ucon_mask); in s3c24xx_serial_resetport()
1764 wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); in s3c24xx_serial_resetport()
1767 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); in s3c24xx_serial_resetport()
1768 wr_regl(port, S3C2410_UFCON, cfg->ufcon); in s3c24xx_serial_resetport()
1776 struct device *dev = ourport->port.dev; in s3c24xx_serial_enable_baudclk()
1777 const struct s3c24xx_uart_info *info = ourport->info; in s3c24xx_serial_enable_baudclk() local
1784 clk_sel = ourport->cfg->clk_sel ? : info->def_clk_sel; in s3c24xx_serial_enable_baudclk()
1785 for (clk_num = 0; clk_num < info->num_clks; clk_num++) { in s3c24xx_serial_enable_baudclk()
1800 ourport->baudclk = clk; in s3c24xx_serial_enable_baudclk()
1801 ourport->baudclk_rate = clk_get_rate(clk); in s3c24xx_serial_enable_baudclk()
1802 s3c24xx_serial_setsource(&ourport->port, clk_num); in s3c24xx_serial_enable_baudclk()
1807 return -EINVAL; in s3c24xx_serial_enable_baudclk()
1818 struct uart_port *port = &ourport->port; in s3c24xx_serial_init_port()
1819 const struct s3c2410_uartcfg *cfg = ourport->cfg; in s3c24xx_serial_init_port()
1824 return -ENODEV; in s3c24xx_serial_init_port()
1826 if (port->mapbase != 0) in s3c24xx_serial_init_port()
1827 return -EINVAL; in s3c24xx_serial_init_port()
1829 /* setup info for port */ in s3c24xx_serial_init_port()
1830 port->dev = &platdev->dev; in s3c24xx_serial_init_port()
1832 port->uartclk = 1; in s3c24xx_serial_init_port()
1834 if (cfg->uart_flags & UPF_CONS_FLOW) { in s3c24xx_serial_init_port()
1835 dev_dbg(port->dev, "enabling flow control\n"); in s3c24xx_serial_init_port()
1836 port->flags |= UPF_CONS_FLOW; in s3c24xx_serial_init_port()
1843 dev_err(port->dev, "failed to find memory resource for uart\n"); in s3c24xx_serial_init_port()
1844 return -EINVAL; in s3c24xx_serial_init_port()
1847 dev_dbg(port->dev, "resource %pR)\n", res); in s3c24xx_serial_init_port()
1849 port->membase = devm_ioremap_resource(port->dev, res); in s3c24xx_serial_init_port()
1850 if (IS_ERR(port->membase)) { in s3c24xx_serial_init_port()
1851 dev_err(port->dev, "failed to remap controller address\n"); in s3c24xx_serial_init_port()
1852 return -EBUSY; in s3c24xx_serial_init_port()
1855 port->mapbase = res->start; in s3c24xx_serial_init_port()
1858 port->irq = 0; in s3c24xx_serial_init_port()
1860 port->irq = ret; in s3c24xx_serial_init_port()
1861 ourport->rx_irq = ret; in s3c24xx_serial_init_port()
1862 ourport->tx_irq = ret + 1; in s3c24xx_serial_init_port()
1866 * DMA is currently supported only on DT platforms, if DMA properties in s3c24xx_serial_init_port()
1869 if (platdev->dev.of_node && of_find_property(platdev->dev.of_node, in s3c24xx_serial_init_port()
1871 ourport->dma = devm_kzalloc(port->dev, in s3c24xx_serial_init_port()
1872 sizeof(*ourport->dma), in s3c24xx_serial_init_port()
1874 if (!ourport->dma) { in s3c24xx_serial_init_port()
1875 ret = -ENOMEM; in s3c24xx_serial_init_port()
1880 ourport->clk = clk_get(&platdev->dev, "uart"); in s3c24xx_serial_init_port()
1881 if (IS_ERR(ourport->clk)) { in s3c24xx_serial_init_port()
1883 dev_name(&platdev->dev)); in s3c24xx_serial_init_port()
1884 ret = PTR_ERR(ourport->clk); in s3c24xx_serial_init_port()
1888 ret = clk_prepare_enable(ourport->clk); in s3c24xx_serial_init_port()
1891 clk_put(ourport->clk); in s3c24xx_serial_init_port()
1900 switch (ourport->info->type) { in s3c24xx_serial_init_port()
1922 dev_dbg(port->dev, "port: map=%pa, mem=%p, irq=%d (%d,%d), clock=%u\n", in s3c24xx_serial_init_port()
1923 &port->mapbase, port->membase, port->irq, in s3c24xx_serial_init_port()
1924 ourport->rx_irq, ourport->tx_irq, port->uartclk); in s3c24xx_serial_init_port()
1932 port->mapbase = 0; in s3c24xx_serial_init_port()
1943 if (dev_of_node(&pdev->dev)) in s3c24xx_get_driver_data()
1944 return of_device_get_match_data(&pdev->dev); in s3c24xx_get_driver_data()
1947 platform_get_device_id(pdev)->driver_data; in s3c24xx_get_driver_data()
1952 struct device_node *np = pdev->dev.of_node; in s3c24xx_serial_probe()
1964 dev_err(&pdev->dev, "serial%d out of range\n", index); in s3c24xx_serial_probe()
1965 return -EINVAL; in s3c24xx_serial_probe()
1971 ourport->drv_data = s3c24xx_get_driver_data(pdev); in s3c24xx_serial_probe()
1972 if (!ourport->drv_data) { in s3c24xx_serial_probe()
1973 dev_err(&pdev->dev, "could not find driver data\n"); in s3c24xx_serial_probe()
1974 return -ENODEV; in s3c24xx_serial_probe()
1977 ourport->baudclk = ERR_PTR(-EINVAL); in s3c24xx_serial_probe()
1978 ourport->info = &ourport->drv_data->info; in s3c24xx_serial_probe()
1979 ourport->cfg = (dev_get_platdata(&pdev->dev)) ? in s3c24xx_serial_probe()
1980 dev_get_platdata(&pdev->dev) : in s3c24xx_serial_probe()
1981 &ourport->drv_data->def_cfg; in s3c24xx_serial_probe()
1983 switch (ourport->info->type) { in s3c24xx_serial_probe()
1985 ourport->port.ops = &s3c64xx_serial_ops; in s3c24xx_serial_probe()
1988 ourport->port.ops = &apple_s5l_serial_ops; in s3c24xx_serial_probe()
1994 "samsung,uart-fifosize", &ourport->port.fifosize); in s3c24xx_serial_probe()
1996 if (of_property_read_u32(np, "reg-io-width", &prop) == 0) { in s3c24xx_serial_probe()
1999 ourport->port.iotype = UPIO_MEM; in s3c24xx_serial_probe()
2002 ourport->port.iotype = UPIO_MEM32; in s3c24xx_serial_probe()
2005 dev_warn(&pdev->dev, "unsupported reg-io-width (%d)\n", in s3c24xx_serial_probe()
2007 return -EINVAL; in s3c24xx_serial_probe()
2012 if (ourport->drv_data->fifosize[index]) in s3c24xx_serial_probe()
2013 ourport->port.fifosize = ourport->drv_data->fifosize[index]; in s3c24xx_serial_probe()
2014 else if (ourport->info->fifosize) in s3c24xx_serial_probe()
2015 ourport->port.fifosize = ourport->info->fifosize; in s3c24xx_serial_probe()
2016 ourport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SAMSUNG_CONSOLE); in s3c24xx_serial_probe()
2019 * DMA transfers must be aligned at least to cache line size, in s3c24xx_serial_probe()
2020 * so find minimal transfer size suitable for DMA mode in s3c24xx_serial_probe()
2022 ourport->min_dma_size = max_t(int, ourport->port.fifosize, in s3c24xx_serial_probe()
2025 dev_dbg(&pdev->dev, "%s: initialising port %p...\n", __func__, ourport); in s3c24xx_serial_probe()
2039 dev_dbg(&pdev->dev, "%s: adding port\n", __func__); in s3c24xx_serial_probe()
2040 uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); in s3c24xx_serial_probe()
2041 platform_set_drvdata(pdev, &ourport->port); in s3c24xx_serial_probe()
2045 * so that a potential re-enablement through the pm-callback overlaps in s3c24xx_serial_probe()
2048 clk_disable_unprepare(ourport->clk); in s3c24xx_serial_probe()
2049 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_probe()
2050 clk_disable_unprepare(ourport->baudclk); in s3c24xx_serial_probe()
2059 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); in s3c24xx_serial_remove()
2086 clk_prepare_enable(ourport->clk); in s3c24xx_serial_resume()
2087 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_resume()
2088 clk_prepare_enable(ourport->baudclk); in s3c24xx_serial_resume()
2090 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_resume()
2091 clk_disable_unprepare(ourport->baudclk); in s3c24xx_serial_resume()
2092 clk_disable_unprepare(ourport->clk); in s3c24xx_serial_resume()
2107 switch (ourport->info->type) { in s3c24xx_serial_resume_noirq()
2111 if (ourport->tx_enabled) in s3c24xx_serial_resume_noirq()
2113 if (ourport->rx_enabled) in s3c24xx_serial_resume_noirq()
2115 clk_prepare_enable(ourport->clk); in s3c24xx_serial_resume_noirq()
2116 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_resume_noirq()
2117 clk_prepare_enable(ourport->baudclk); in s3c24xx_serial_resume_noirq()
2119 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_resume_noirq()
2120 clk_disable_unprepare(ourport->baudclk); in s3c24xx_serial_resume_noirq()
2121 clk_disable_unprepare(ourport->clk); in s3c24xx_serial_resume_noirq()
2128 ret = clk_prepare_enable(ourport->clk); in s3c24xx_serial_resume_noirq()
2133 if (!IS_ERR(ourport->baudclk)) { in s3c24xx_serial_resume_noirq()
2134 ret = clk_prepare_enable(ourport->baudclk); in s3c24xx_serial_resume_noirq()
2137 clk_disable_unprepare(ourport->clk); in s3c24xx_serial_resume_noirq()
2148 if (ourport->tx_enabled) in s3c24xx_serial_resume_noirq()
2150 if (ourport->rx_enabled) in s3c24xx_serial_resume_noirq()
2156 if (!IS_ERR(ourport->baudclk)) in s3c24xx_serial_resume_noirq()
2157 clk_disable_unprepare(ourport->baudclk); in s3c24xx_serial_resume_noirq()
2158 clk_disable_unprepare(ourport->clk); in s3c24xx_serial_resume_noirq()
2189 const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); in s3c24xx_serial_console_txrdy() local
2193 /* fifo mode - check amount of data in fifo registers... */ in s3c24xx_serial_console_txrdy()
2196 return (ufstat & info->tx_fifofull) ? 0 : 1; in s3c24xx_serial_console_txrdy()
2199 /* in non-fifo mode, we go and use the tx buffer empty */ in s3c24xx_serial_console_txrdy()
2269 if (cons_uart->sysrq) in s3c24xx_serial_console_write()
2335 clk = clk_get(port->dev, clk_name); in s3c24xx_serial_get_options()
2342 dev_dbg(port->dev, "calculated baud %d\n", *baud); in s3c24xx_serial_get_options()
2358 if (co->index == -1 || co->index >= UART_NR) in s3c24xx_serial_console_setup()
2359 co->index = 0; in s3c24xx_serial_console_setup()
2361 port = &s3c24xx_serial_ports[co->index].port; in s3c24xx_serial_console_setup()
2365 if (port->mapbase == 0x0) in s3c24xx_serial_console_setup()
2366 return -ENODEV; in s3c24xx_serial_console_setup()
2380 dev_dbg(port->dev, "baud %d\n", baud); in s3c24xx_serial_console_setup()
2389 .index = -1,
2398 .info = {
2427 .info = {
2456 .info = { \
2494 * Common drv_data struct for platforms that specify samsung,uart-fifosize in
2516 .info = {
2545 .info = {
2546 .name = "Axis ARTPEC-8 UART",
2575 .name = "s3c6400-uart",
2578 .name = "s5pv210-uart",
2581 .name = "exynos4210-uart",
2584 .name = "exynos5433-uart",
2587 .name = "s5l-uart",
2590 .name = "exynos850-uart",
2593 .name = "artpec8-uart",
2596 .name = "gs101-uart",
2605 { .compatible = "samsung,s3c6400-uart",
2607 { .compatible = "samsung,s5pv210-uart",
2609 { .compatible = "samsung,exynos4210-uart",
2611 { .compatible = "samsung,exynos5433-uart",
2613 { .compatible = "apple,s5l-uart",
2615 { .compatible = "samsung,exynos850-uart",
2617 { .compatible = "axis,artpec8-uart",
2619 { .compatible = "google,gs101-uart",
2631 .name = "samsung-uart",
2668 switch (port->iotype) { in wr_reg_barrier()
2685 while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE)) in samsung_early_busyuart()
2691 const struct samsung_early_console_data *data = port->private_data; in samsung_early_busyuart_fifo()
2693 while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask) in samsung_early_busyuart_fifo()
2699 if (readl(port->membase + S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) in samsung_early_putc()
2710 struct earlycon_device *dev = con->data; in samsung_early_write()
2712 uart_console_write(&dev->port, s, n, samsung_early_putc); in samsung_early_write()
2717 struct earlycon_device *dev = con->data; in samsung_early_read()
2718 const struct samsung_early_console_data *data = dev->port.private_data; in samsung_early_read()
2722 ufstat = rd_regl(&dev->port, S3C2410_UFSTAT); in samsung_early_read()
2723 if (!(ufstat & data->rxfifo_mask)) in samsung_early_read()
2725 ch = rd_reg(&dev->port, S3C2410_URXH); in samsung_early_read()
2738 if (!device->port.membase) in samsung_early_console_setup()
2739 return -ENODEV; in samsung_early_console_setup()
2741 device->con->write = samsung_early_write; in samsung_early_console_setup()
2742 device->con->read = samsung_early_read; in samsung_early_console_setup()
2761 device->port.private_data = &s3c2440_early_console_data; in s3c2440_early_console_setup()
2765 OF_EARLYCON_DECLARE(s3c6400, "samsung,s3c6400-uart",
2777 device->port.private_data = &s5pv210_early_console_data; in s5pv210_early_console_setup()
2781 OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
2783 OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
2785 OF_EARLYCON_DECLARE(artpec8, "axis,artpec8-uart",
2793 device->port.private_data = &s3c2410_early_console_data; in apple_s5l_early_console_setup()
2797 __set_fixmap(FIX_EARLYCON_MEM_BASE, device->port.mapbase, in apple_s5l_early_console_setup()
2803 OF_EARLYCON_DECLARE(s5l, "apple,s5l-uart", apple_s5l_early_console_setup);
2806 MODULE_ALIAS("platform:samsung-uart");