diff options
author | Dave Liu <daveliu@freescale.com> | 2009-06-08 10:24:36 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-06-15 22:45:31 -0400 |
commit | b45cc9eff72e0871ffb83ae32c3dbca382909706 (patch) | |
tree | 37e070b812470b5dcff069eba73c0cb39afb15f7 /drivers/serial/ucc_uart.c | |
parent | f1f8b4948d19ae84fe37e36601ae064102dfa5ab (diff) |
serial: Make ucc_uart work in HW UART mode
In HW UART mode the TxBD[READY] is not cleared by H/W (RISC engine) when
the user send characters to Tx buffer of QE UART. So, these characters
stay on the QE forever, never go to UART line.
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/serial/ucc_uart.c')
-rw-r--r-- | drivers/serial/ucc_uart.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c index 7de66c06b05d..e945e780b5c9 100644 --- a/drivers/serial/ucc_uart.c +++ b/drivers/serial/ucc_uart.c | |||
@@ -681,22 +681,27 @@ static void qe_uart_init_ucc(struct uart_qe_port *qe_port) | |||
681 | out_be16(&uccup->rccm, 0xc0ff); | 681 | out_be16(&uccup->rccm, 0xc0ff); |
682 | 682 | ||
683 | /* Configure the GUMR registers for UART */ | 683 | /* Configure the GUMR registers for UART */ |
684 | if (soft_uart) | 684 | if (soft_uart) { |
685 | /* Soft-UART requires a 1X multiplier for TX */ | 685 | /* Soft-UART requires a 1X multiplier for TX */ |
686 | clrsetbits_be32(&uccp->gumr_l, | 686 | clrsetbits_be32(&uccp->gumr_l, |
687 | UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK | | 687 | UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK | |
688 | UCC_SLOW_GUMR_L_RDCR_MASK, | 688 | UCC_SLOW_GUMR_L_RDCR_MASK, |
689 | UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_1 | | 689 | UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_1 | |
690 | UCC_SLOW_GUMR_L_RDCR_16); | 690 | UCC_SLOW_GUMR_L_RDCR_16); |
691 | else | 691 | |
692 | clrsetbits_be32(&uccp->gumr_h, UCC_SLOW_GUMR_H_RFW, | ||
693 | UCC_SLOW_GUMR_H_TRX | UCC_SLOW_GUMR_H_TTX); | ||
694 | } else { | ||
692 | clrsetbits_be32(&uccp->gumr_l, | 695 | clrsetbits_be32(&uccp->gumr_l, |
693 | UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK | | 696 | UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK | |
694 | UCC_SLOW_GUMR_L_RDCR_MASK, | 697 | UCC_SLOW_GUMR_L_RDCR_MASK, |
695 | UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_16 | | 698 | UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_16 | |
696 | UCC_SLOW_GUMR_L_RDCR_16); | 699 | UCC_SLOW_GUMR_L_RDCR_16); |
697 | 700 | ||
698 | clrsetbits_be32(&uccp->gumr_h, UCC_SLOW_GUMR_H_RFW, | 701 | clrsetbits_be32(&uccp->gumr_h, |
699 | UCC_SLOW_GUMR_H_TRX | UCC_SLOW_GUMR_H_TTX); | 702 | UCC_SLOW_GUMR_H_TRX | UCC_SLOW_GUMR_H_TTX, |
703 | UCC_SLOW_GUMR_H_RFW); | ||
704 | } | ||
700 | 705 | ||
701 | #ifdef LOOPBACK | 706 | #ifdef LOOPBACK |
702 | clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK, | 707 | clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK, |
@@ -706,7 +711,7 @@ static void qe_uart_init_ucc(struct uart_qe_port *qe_port) | |||
706 | UCC_SLOW_GUMR_H_CDS); | 711 | UCC_SLOW_GUMR_H_CDS); |
707 | #endif | 712 | #endif |
708 | 713 | ||
709 | /* Enable rx interrupts and clear all pending events. */ | 714 | /* Disable rx interrupts and clear all pending events. */ |
710 | out_be16(&uccp->uccm, 0); | 715 | out_be16(&uccp->uccm, 0); |
711 | out_be16(&uccp->ucce, 0xffff); | 716 | out_be16(&uccp->ucce, 0xffff); |
712 | out_be16(&uccp->udsr, 0x7e7e); | 717 | out_be16(&uccp->udsr, 0x7e7e); |
@@ -765,6 +770,10 @@ static void qe_uart_init_ucc(struct uart_qe_port *qe_port) | |||
765 | cecr_subblock = ucc_slow_get_qe_cr_subblock(qe_port->ucc_num); | 770 | cecr_subblock = ucc_slow_get_qe_cr_subblock(qe_port->ucc_num); |
766 | qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock, | 771 | qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock, |
767 | QE_CR_PROTOCOL_UNSPECIFIED, 0); | 772 | QE_CR_PROTOCOL_UNSPECIFIED, 0); |
773 | } else { | ||
774 | cecr_subblock = ucc_slow_get_qe_cr_subblock(qe_port->ucc_num); | ||
775 | qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock, | ||
776 | QE_CR_PROTOCOL_UART, 0); | ||
768 | } | 777 | } |
769 | } | 778 | } |
770 | 779 | ||