Large Arrays in DDR via PRU. Does prussdrv_map_extmem() always give contiguous physical addresses?

Hi William, one note on CCS. I haven’t used it at all. The compiler/assembler (clpru) and associated includes and libraries are present in the Beaglebone testing image (Debian 8, version 4 kernel).
I had to tweak add a symbolic link for the clpru, but that’s it. After that, the Makefiles included in the labs worked perfectly. All done at the command line. No CCS IDE required.
I wasn’t excited about CCS either, but then I discovered the clpru stuff and no problems.

Here is what Robert Nelson said on Dec 17, 2015: "If you want “uio_pruss” use “4.1.x-bone”, while this “4.1.x-ti” branch is developing “pruss_remoteproc” which will be replacing uio_pruss…”

If you look at the development off uio_pruss, it was developed in 2011 and has a few update/fixes since then, but no new development.

With RemoteProc/VirtualIO, it is possible to implement custom hardware interfaces on the PRU such as Profibus, Ethernet, UART, i2C, SPI, ADC, DAC, etc and make those look like a device to the Linux kernel.

Regards,
John

Hi William, one note on CCS. I haven’t used it at all. The compiler/assembler (clpru) and associated includes and libraries are present in the Beaglebone testing image (Debian 8, version 4 kernel).
I had to tweak add a symbolic link for the clpru, but that’s it. After that, the Makefiles included in the labs worked perfectly. All done at the command line. No CCS IDE required.
I wasn’t excited about CCS either, but then I discovered the clpru stuff and no problems.

Hi Soapy,

Yeah there was what ? 3 different ways one could go. Well technicaly 4-5 I guess including following the gcc path. I messed with attempting to get the standalone TI C compiler, on a cross(Lubuntu 14.04 x64 ) system. No joy after I guess about a day and a half. Normally, I probably would have gotten it to work, but after playing around with that, and several other things all related to the PRU’s I decided to toss in the towel.

In relation though I was able to work with a custom am335x_pru_package git, that included example code for using the USR LEDs, and a dmx light controller. The USR LED example I got working straight off, no problem, and I’d assume the dmx controller would also have worked, but I had no hardware to test.

Plus the am335x_pru_package driver uses UIO, which I find really interesting, and indeed really easy to write a custom driver for when the need arises. Or, more likely just modify the existing one, but it’s really easy to read through and understand . . .

The uio_pruss kernel driver is part of the BeagleBone specific
patches, here's one place to find it in raw form if you don't have a
BBB specific kernel tree handy:

https://github.com/beagleboard/linux/blob/3.8/drivers/uio/uio_pruss.c#L267-L268

...as for DMA memory handling, that's complicated. It is more complex
than generic memory handling in Linux (ie: kmalloc and friends), and
there isn't a whole lot of places it's properly talked about. My day
job involves creating hardware that streams data across the PCI/PCIe
bus via bus-mastering DMA, so I'm familiar with all the details
involved, but to truly understand what's happening you need low-level
knowledge of the system architecture, memory model & access semantics,
physical bus transaction protocols, *PLUS* a bunch of Linux specific
details about how DMA is supposed to work.

I don't mean to be trying to discourage you, but there are *LOTS* of
low-level details that have to be done *JUST RIGHT* or you get weird
subtle bugs that only crop up every blue moon (see for example the
transition of Linux from single-core to SMP, or the poor state of
early ARM drivers that didn't properly handle ARMs relaxed memory
model vs. the x86).

Anyway, if you want to start to understand DMA on Linux, the best
single reference I know of is probably still "Memory Mapping and DMA",
or chapter 15 in LDD3:

https://lwn.net/Kernel/LDD3/

...at least until LDD4 comes out (I'm still waiting for my copy).

LDD3 is pretty dated (2005!), but the concepts are still pretty much
the same. The interesting bits related to the uio_pruss driver usage
start with "DMA mappings" on page 445, with a discussion of coherent
buffers beginning on the next page.

Good luck!