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.

DM8148 mcspi xbar event configuration

hi, I meet the same problem!

  • Hello Jensen,

    Is this a Segmentation problem or an SPI problem?  We will split this off to a new thread, please provide details as to the problem your design is encountering.

    Regards,

    ~Leonard 

  • Thanks LeonardEllis for your reply.
    It is right by PIO mode which using Documentation/spi/spidev_test.c

    #define USE_DMA 0
    if (USE_DMA || (m->is_dma_mapped || t->len >= DMA_MIN_BYTES))
    count = omap2_mcspi_txrx_dma(spi, t);
    else
    {
    /* RX_ONLY mode needs dummy data in TX reg */
    if (t->tx_buf == NULL)
    __raw_writel(0, cs->base + OMAP2_MCSPI_TX0);
    count = omap2_mcspi_txrx_pio(spi, t);
    }

    ,but the program(spidev_test) is blocked when I use DMA mode in SPI.
    #define USE_DMA 1
    ...
    --------------------------------------------------------------------
    if (rx != NULL) {
    edma_start(mcspi_dma->dma_rx_channel);
    omap2_mcspi_set_dma_req(spi, 1, 1);
    }
    if (tx != NULL || rx != NULL) {
    wait_for_completion(&mcspi_dma->dma_tx_completion); // !!! blocked !!!!
    dma_unmap_single(NULL, xfer->tx_dma, temp_count, DMA_TO_DEVICE);
    /* for TX_ONLY mode, be sure all words have shifted out */
    if (rx == NULL) {
    if (mcspi_wait_for_reg_bit(chstat_reg,
    OMAP2_MCSPI_CHSTAT_TXS) < 0)
    dev_err(&spi->dev, "TXS timed out\n");
    else if (mcspi_wait_for_reg_bit(chstat_reg,
    OMAP2_MCSPI_CHSTAT_EOT) < 0)
    dev_err(&spi->dev, "EOT timed out\n");
    }
    }


    -----------------------------------
    1. I use ipnc rdk 3.8 (DM8127)
    2. I test SPI3.0 , spi driver is valid and find /dev/spi3.0
    3. the follow is my option codes

    static struct resource omap2_mcspi3_resources[] = {
    {
    .start = OMAP2_MCSPI3_BASE,
    .end = OMAP2_MCSPI3_BASE + 0xff,
    .flags = IORESOURCE_MEM,
    },
    { //SPI2XEVT0: SPI2 Transmit 0
    .start = 16,
    .end = 16,
    .flags = IORESOURCE_DMA,
    },
    { //SPI2REVT0: SPI2 Receive 0
    .start = 17,
    .end = 17,
    .flags = IORESOURCE_DMA,
    },
    { //SPI2XEVT1: SPI2 Transmit 1
    .start = 18,
    .end = 18,
    .flags = IORESOURCE_DMA,
    },
    { //SPI2REVT1: SPI2 Receive 1
    .start = 19,
    .end = 19,
    .flags = IORESOURCE_DMA,
    },
    };
    static struct event_to_channel_map ti814x_xbar_event_mapping[] = {
    /* {xbar event no, Channel} */
    ...
    {11, -1},
    {12, -1},
    {13, -1},
    {14, -1},
    {15, -1},
    {16, 52}, // SPI3.0 transfer
    {17, 53}, // SPI3.0 receiver
    {18, -1},
    {19, -1},
    ...
    {-1, -1}
    };
  • Hi Jensen,

    Please check the below e2e thread:

    e2e.ti.com/.../482934

    Regards,
    Pavel