This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x UART3 and EDMA

Hi,

I am working on a driver for UART3 which needs to use EDMA module. I have successfully configured UART3 to work in FIFO mode, also in FIFO mode with manually triggered EDMA transfer but I have no luck when I try to enable EDMA event trigger mode.

Steps which I did so far:

1. Setup event crossbar: I edited arch/arm/devices.c file in kernel as explained here: http://processors.wiki.ti.com/index.php/AM335x_EDMA_Driver%27s_Guide#How_to_Program_the_Cross_bar_events

static struct event_to_channel_map am33xx_xbar_event_mapping[] = {
    /* {xbar event no, Channel} */
    {1, 12},    /* SDTXEVT1 -> MMCHS2 */
    {2, 13},    /* SDRXEVT1 -> MMCHS2 */
    {3, -1},
    {4, -1},
    {5, -1},
    {6, -1},
    {7, 10}, /* UTXEVT3  */
    {8, 11}, /* URXEVT3 */
    {9, -1},
    {10, -1},

2. Setup UART3 for DMA mode 1 (TX and RX)

SCR.DMAMODECTL bit is set to enable DMA mode, SCR.DMAMODE2 bitfield is set to 0x01 (DMA mode 1 - TX and RX):

SCR = 0x03

FCR.FIFOEN bit is set to enable FIFO:

FCR = 0x01

TLR= 0xEE

3. Setup the rest of UART3 registers which are not related to DMA mode

4. Request EDMA channels 70 and 71, which remaps to 10 and 11 through crossbar.

tx_chn = edma_alloc_channel(70, callback, arg, EVENTQ_1);

rx_chn = edma_alloc_channel(71, callback, arg, EVENTQ_0);

4. Setup and start EDMA for UART3 TX

edma_set_dest(tx_chn, uart3_phy_addr, FIFO, W8BIT);

edma_set_dest_index(tx_chn, 0, 0);

edma_set_src_index(tx_chn, 1, 0);

edma_read_slot(tx_chn, &params);

params.opt |= TCINTEN;

params.opt |= EDMA_TCC(EDMA_CHAN_SLOT(tx_chn));

edma_write_slot(tx_chn, &params);

edma_set_src(tx_chn, data_src_ptr, INCR, W8BIT);

edma_set_transfer_params(tx_chn, 1, data_size, 1, data_size, ABSYNC);

...

edma_start(tx_chn);

Everything initializes fine (for EDMA I get the channels 10 and 11, respectively)  but no event is registered in EDMA ER or ERH registers so the transmission/reception does not begin. I checked DRAEn registers and I have RW access to EDMACC registers.

What am I missing to enable event triggering from UART3 module?