Dear Alan Zhang,
here is the modified mxc_uart.c file..
static void mxcuart_start_tx(struct uart_port *port)
{
uart_mxc_port *umxc = (uart_mxc_port *) port;
struct circ_buf *xmit = &umxc->port.state->xmit;
volatile unsigned int cr1;
mxc_dma_requestbuf_t writechnl_request;
int tx_num;
printk("transmitting\n");
cr1 = readl(port->membase + MXC_UARTUCR1);
/* Enable Transmitter rdy interrupt */
if (umxc->dma_enabled == 1) {
/*
* If the channel is in use then return immediately and use
* the mxcuart_dma_tx to transfer queued data when current DMA
* transfer is complete
*/
if (dma_list[umxc->port.line].dma_txchnl_inuse == 1) {
return;
printk("channel is in use\n");
}
tx_num = uart_circ_chars_pending(xmit);
if (tx_num > 0) {
dma_list[umxc->port.line].dma_txchnl_inuse = 1;
if (xmit->tail > xmit->head) {
memcpy(umxc->tx_buf, xmit->buf + xmit->tail,
UART_XMIT_SIZE - xmit->tail);
memcpy(umxc->tx_buf +
(UART_XMIT_SIZE - xmit->tail), xmit->buf,
xmit->head);
} else {
memcpy(umxc->tx_buf, xmit->buf + xmit->tail,
tx_num);
}
umxc->tx_handle =
dma_map_single(umxc->port.dev, umxc->tx_buf,
TXDMA_BUFF_SIZE, DMA_TO_DEVICE);
printk("transmitt- wintu\n");
writechnl_request.dst_addr =
umxc->port.mapbase + MXC_UARTUTXD;
writechnl_request.src_addr = umxc->tx_handle;
writechnl_request.num_of_bytes = tx_num;
if ((mxc_dma_config
(dma_list[umxc->port.line].wr_channel,
&writechnl_request, 1,
MXC_DMA_MODE_WRITE)) == 0) {
mxc_dma_enable(dma_list[umxc->port.line].
wr_channel);
}
cr1 |= MXC_UARTUCR1_TXDMAEN;
}
} else {
cr1 |= MXC_UARTUCR1_TRDYEN;
}
writel(cr1, port->membase + MXC_UARTUCR1);
}
Now when i use ttymxc2 (UART3) /UART1 /UART0 im getting
"transmitting"
"transmit -wintu" strings displayed... which means no problem.
but when i use UART4/UART5 i.e. ttymxc4 and ttymxc3 im getting only
"transmitting"
which means its not coming in the if (umxc->dma_enabled == 1) loop at all..
which means umxc->dma_enabled is not going 1..
whats the problem ?
Regards,
Winston