Regarding the idea BeagleBone/Beagle board PRU DMA

Hello all,

I am Tanu Hari Dixit, senior undergraduate from Indian Institute of Technology, Varanasi, India. I am a GSoC 2017 aspirant and am interested in the idea BeagleBone/Beagle board PRU DMA listed in the ideas page. I have a few questions and I’ll be grateful if the Devs answer them.

  • I read through the chapter “EDMA” in the AM355x_technical_reference_manual so that I get the hang of the DMA controller. Is this the right starting point?
  • I also found an example of edma configuration in am335x_pru_package/pru_sw/old_example/PRU_edmaConfig. This page here (http://processors.wiki.ti.com/index.php/PRU_Linux-based_Example_Code) explains that in this example the PRU0 configures and initializes the EDMA while PRU1 polls for the EDMA interrupt notifying the completion of the EDMA transfer and sets a flag in memory. Why is not the same PRU used to poll and set the controller configuration? Would I be doing a similar thing if I qualify for the project? If not, what would be the catch here?
  • Would I be designing an API sort of thing so that the user can customize on the type of synchronized transfers, the triggers used to shoot transfer events, and how the completion happens (i.e. whether when transfer requests leave the channel controller boundary or when the current transfer is complete) and how the linking is to be done for the PaRAM set and other such decisions?
  • I was trying to execute a sample application given at http://processors.wiki.ti.com/index.php/EDMA_sample_test_application . I have failed while executing this example. The compiler can’t find asm/hardware/edma.h
    make -C /lib/modules/3.8.13-bone79/build/ M=/home/debian/kernel_pro/edma modules make[1]: Entering directory/usr/src/linux-headers-3.8.13-bone79’
    CC [M] /home/debian/kernel_pro/edma/edma_sample.o
    /home/debian/kernel_pro/edma/edma_sample.c:37:25: fatal error: mach/memory.h: No such file or directory
    compilation terminated.
    make[2]: *** [/home/debian/kernel_pro/edma/edma_sample.o] Error 1
    make[1]: *** [module/home/debian/kernel_pro/edma] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-3.8.13-bone79’
    make: *** [all] Error 2

`

When I find /usr | grep edma.h I get the following files:

`
root@beaglebone:/home/debian/kernel_pro/edma# find /usr | grep edma.h
/usr/src/linux-headers-3.8.13-bone79/include/config/ti/priv/edma.h
/usr/src/linux-headers-3.8.13-bone79/include/config/ti/edma.h
/usr/src/linux-headers-3.8.13-bone79/include/linux/platform_data/edma.h
/usr/src/linux-headers-3.8.13-bone79/include/linux/edma.h

`

Why aren’t these include files used? Can we use them?

  • I don’t know if I am looking at the right example. Are there any references that I should be aware of?

  • Are there any pre-requisites that I should get right other than the “Hello World” application that prints name and the date out in an ARM Linux environment as mentioned in the “General Requirements” page section on the ideas page?

Kindly help me through this.

Thank you,

Tanu Hari Dixit,

Senior Undergraduate,

Department of Electronics Engineering,

Indian Institute of Technology (BHU),

Varanasi.

Hello all,

I am Tanu Hari Dixit, senior undergraduate from Indian Institute of
Technology, Varanasi, India. I am a GSoC 2017 aspirant and am interested in
the idea BeagleBone/Beagle board PRU DMA listed in the ideas page. I have a
few questions and I'll be grateful if the Devs answer them.

   - I read through the chapter "EDMA" in the
   AM355x_technical_reference_manual so that I get the hang of the DMA
   controller. Is this the right starting point?

Yep. That is a starting point for most things on the 'bone.

   - I also found an example of edma configuration in
   am335x_pru_package/pru_sw/old_example/PRU_edmaConfig. This page here
   (http://processors.wiki.ti.com/index.php/PRU_Linux-based_Example_Code)
   explains that in this example the PRU0 configures and initializes the
EDMA while PRU1 polls for the EDMA interrupt notifying the completion of
the EDMA transfer and sets a flag in memory. Why is not the same PRU used
to poll and set the controller configuration? Would I be doing a similar
thing if I qualify for the project? If not, what would be the catch here?

I think this is for a different SoC. Might be for the old OMAPL13x stuff. That
SoC has an older generation of the PRUSS. What you would be doing is similar
but more integrated with the kernel.

   - Would I be designing an API sort of thing so that the user can
   customize on the type of synchronized transfers, the triggers used to
shoot transfer events, and how the completion happens (i.e. whether when
transfer requests leave the channel controller boundary or when the current
transfer is complete) and how the linking is to be done for the PaRAM set
and other such decisions?

This needs to work with the kernel EDMA interface. It would not be a userland
API.

   - I was trying to execute a sample application given at
   http://processors.wiki.ti.com/index.php/EDMA_sample_test_application . I
   have failed while executing this example. The compiler can't find
   asm/hardware/edma.h

make -C /lib/modules/3.8.13-bone79/build/ M=/home/debian/kernel_pro/edma
modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.13-bone79'
  CC [M] /home/debian/kernel_pro/edma/edma_sample.o
/home/debian/kernel_pro/edma/edma_sample.c:37:25: fatal error:
mach/memory.h: No such file or directory
compilation terminated.
make[2]: *** [/home/debian/kernel_pro/edma/edma_sample.o] Error 1
make[1]: *** [_module_/home/debian/kernel_pro/edma] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.13-bone79'
make: *** [all] Error 2

When I `find /usr | grep edma.h` I get the following files:

root@beaglebone:/home/debian/kernel_pro/edma# find /usr | grep edma.h
/usr/src/linux-headers-3.8.13-bone79/include/config/ti/priv/edma.h
/usr/src/linux-headers-3.8.13-bone79/include/config/ti/edma.h
/usr/src/linux-headers-3.8.13-bone79/include/linux/platform_data/edma.h
/usr/src/linux-headers-3.8.13-bone79/include/linux/edma.h

Why aren't these include files used? Can we use them?

I suspect that module was written for an older version and/or the TI patched
tree.

   - I don't know if I am looking at the right example. Are there any
   references that I should be aware of?

The stuff you found is a starting point.

   - Are there any pre-requisites that I should get right other than the
   "Hello World" application that prints name and the date out in an ARM
Linux environment as mentioned in the "General Requirements" page section
on the ideas page?

Building your own kernel would be one thing to add.

Hello Hunyue Yau,

Thank you for answering my questions. I wanted to confirm whether the workflow for building my own kernel would involve the steps as documented at http://elinux.org/Building_BBB_Kernel. That is cross compiling kernel on my host and then transferring the image to BBB via tftp and booting via bootm. Please correct me if I am wrong. Also, am I given this task so that I become familiar with compiling drivers and loading them onto the BBB (as exemplified in https://github.com/chanakya-vc/PRU-I2C_SPI_master/wiki/SPI-Master-Controller#steps-to-compile-the-driver-and-firmware-and-load-it-onto-a-beaglebone-black) or is there some other reason?

Thank you,
Tanu Hari Dixit.

Hi,

That is one way of doing it. From my point of view, if you can build a kernel
from source and get it running, that's sufficient. As for how you want to boot,
TFTP is nice but is should be sufficient if you can put it in the the
appropriate place to get it booted and running.

To work on the PRU DMA stuff, you will need to do kernel stuff. Given how short
GSoC is, there really isn't that much time to learn this during the GSoC
period. Hence...