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.

External DMA trigger (GPMC to SDRAM)

Hi,

I'm trying to trigger a DMA transfer (GPMC to SDRAM) from an external pin (pinmux'ed as dmareq2), i.e. hardware synchronized transfer.

Configuring the pin as GPIO I receive interrupts as expected, and I can start the DMA from the interrupt handler.

What I've gathered so far:

  • In addition to the pinmuxing, I have to specify the trigger, sync mode, and src/dst sync in the call to  omap_set_dma_transfer_params.
  • I need to set flank/level trigging for dmareq2 in CONTROL_DEVCONF1.

Question:

  • Do I need to omap_request_dma(OMAP24XX_DMA_EXT_DMAREQ2) and start the channel?

I'm having a hard time wrapping my head around the idea of a pin magically becoming a DMA channel that acts as a trigger of another DMA channel.

Looking at a couple of other drivers (mmc/host/omap.c and tusb6010_omap.c), they request the DMA channel corresponding to the "sync_dev". tusb6010_omap.c also uses the OMAP24XX_DMA_EXT_DMAREQ channels.  In the 3730 TRM,  11.2.2 External SDMA Requests Typical Application, the figure quite clearly shows the connection between the pin and a corresponding DMA channel.

 

This is on OMAP 3730, 2.6.32 kernel.

Thanks,

Orjan

  • Is there any way I can narrow this down?  I haven't found any forums or mailing lists where external DMA trigging has been discussed, just the drivers mentioned above.

    Compared to the gpio interrupt solution, I've made the following changes:

    • OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), //dmareq2 (MODE4 for gpio 56)
    • Removed all setup relating to the gpio interrupt (gpio_request, request_irq)
    • Written SENSDMAREQ2 edge senitive in OMAP343X_CONTROL_DEVCONF1 (not that it shouldn't work as level sensitive, the low pulse is 1.6 us long)
    • Specified OMAP24XX_DMA_EXT_DMAREQ2 (corresponding SDMA 6) as DMA trigger in the call to omap_set_dma_transfer_params.
    • Set source sync in the call to omap_set_dma_transfer_params.

    We're using the CUS package.

    Thanks for any help,

    Orjan

     

  • Or is the DMA transfer simply synchronized, and not started on dmareq2?

    (Starting the DMA channel manually and restarting it in the callback function, this does not seem to be the case.  I'm getting DMA callbacks at a faster rate than 100 Hz.)