Linux drive uio_pruss

I am trying to use the PRU-ICSS with beaglebone, at this point I am just trying to run some examples from https://github.com/beagleboard/am335x_pru_package. The drive is loading with no error but I can’t find the device uio0.

I am running the kernel 3.8.13. Checking the modules I have:

lsmod

Module Size Used by Not tainted
uio_pruss 3702 0
uio 6540 1 uio_pruss
unix 23436 12

Under /sys I have :

find /sys -name uio

/sys/class/uio ← this is empty
/sys/module/uio

ls -la /sys/module/uio

total 0
drwxr-xr-x 5 root root 0 Jan 1 00:25 .
drwxr-xr-x 46 root root 0 Jan 1 00:00 …
-r–r--r-- 1 root root 4096 Jan 1 00:42 coresize
drwxr-xr-x 2 root root 0 Jan 1 00:42 holders
-r–r--r-- 1 root root 4096 Jan 1 00:42 initsize
-r–r--r-- 1 root root 4096 Jan 1 00:42 initstate
drwxr-xr-x 2 root root 0 Jan 1 00:42 notes
-r–r--r-- 1 root root 4096 Jan 1 00:42 refcnt
drwxr-xr-x 2 root root 0 Jan 1 00:42 sections
-r–r--r-- 1 root root 4096 Jan 1 00:42 srcversion
-r–r--r-- 1 root root 4096 Jan 1 00:42 taint
–w------- 1 root root 4096 Jan 1 00:25 uevent

Somebody has experience with PRUSS to give me a help?

Before running any applications, you need to enable PRU module in
device tree. This can be easily done by loading a DT overlay. There is
an overlay in Angstrom which enables PRUSS, but if I remember
correctly, it conflicts with HDMI.
Try the following:
1. Download the overlay from
https://github.com/piranha32/IOoo/blob/master/dts/tlc5946-00A0.dts
2. Compile it: dtc -O dtb -o tlc5946-00A0.dtbo -b 0 -@ tlc5946-00A0.dts
3. Copy the .dtbo file to /lib/firmware on beaglebone
4. Load the overlay: echo tlc5946 > /sys/devices/bone_capemgr.*/slots

At this point you should have working PRUSS

j.

I am trying to use the PRU-ICSS with beaglebone, at this point I am just
trying to run some examples from
GitHub - beagleboard/am335x_pru_package. The drive is loading
with no error but I can't find the device uio0.

<snip>

Somebody has experience with PRUSS to give me a help?

You need to load a device tree overlay that enables the PRU.

Try (as root):

echo BB-BONE-PRU-01 > /sys/devices/bone_capemgr.*/slots

I am having problem to make the kernel use the overlay. I will continue with this tomorrow.

Thank you so far.

This is the point that I stuck last night.
I don’t have /sys/devices/bone_capemgr.*/slots; this is what I have:

ls -la /sys/devices/

total 0
drwxr-xr-x 14 root root 0 Jan 1 00:00 .
dr-xr-xr-x 12 root root 0 Jan 1 00:00 …
drwxr-xr-x 3 root root 0 Jan 1 00:00 44e10800.pinmux
drwxr-xr-x 3 root root 0 Jan 1 00:00 ARMv7 Cortex-A8
drwxr-xr-x 3 root root 0 Jan 1 00:00 bone_capemgr.7
drwxr-xr-x 3 root root 0 Jan 1 00:00 breakpoint
drwxr-xr-x 4 root root 0 Jan 1 00:00 fixedregulator.8
drwxr-xr-x 28 root root 0 Jan 1 00:00 ocp.2
drwxr-xr-x 13 root root 0 Jan 1 00:00 platform
drwxr-xr-x 4 root root 0 Jan 1 00:00 soc.0
drwxr-xr-x 3 root root 0 Jan 1 00:00 software
drwxr-xr-x 4 root root 0 Jan 1 00:00 system
drwxr-xr-x 3 root root 0 Jan 1 00:00 tracepoint
drwxr-xr-x 15 root root 0 Jan 1 00:00 virtual

And under bone_capemgr.7

ls -la /sys/devices/bone_capemgr.7/

total 0
drwxr-xr-x 3 root root 0 Jan 1 00:00 .
drwxr-xr-x 14 root root 0 Jan 1 00:00 …
-r–r--r-- 1 root root 4096 Jan 1 00:01 modalias
drwxr-xr-x 2 root root 0 Jan 1 00:01 power
lrwxrwxrwx 1 root root 0 Jan 1 00:00 subsystem → …/…/bus/platform
-rw-r–r-- 1 root root 4096 Jan 1 00:00 uevent

Maybe something is missing at kernel. Below is the .config file.

Which distro do you use? PRUSS works ootb with Angstrom.

j.

I am using the https://github.com/beagleboard/kernel 3.8 from RobertCNelson with buildroot.

I think you may be missing this:
CONFIG_CAPE_BEAGLEBONE =y

j.

I think that you catch one problem and now I have this message that I don’t remember have seen in the past.

I am going to dig on it.

Again, thank you so far.

[ 1.759324] brd: module loaded
[ 1.788054] loop: module loaded
[ 1.792984] bone-capemgr bone_capemgr.7: Failed to get baseboard memory access
[ 1.801164] bone-capemgr: probe of bone_capemgr.7 failed with error -524
[ 1.815053] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.823596] OneNAND driver initializing

I have never seen this one either. Does the board boot?

j.

Yes, everything is working.

I am going to recompile the kernel after clean, I have been doing changes over changes.

What beaglebone kernel version do we know for sure that PRU is working ?
I got the version 3.8 based on instruction from beagleborad.org but maybe I should be using another one.

There is another thing that confuse me; there is a kernel version from TI at http://downloads.ti.com/sitara_linux/esd/AM335xSDK/latest/index_FDS.html

and another from https://github.com/beagleboard/kernel. What is the difference?

This is the point in the capemgr.c that I am having the problem.

/* grab the memory accessor of the eeprom */
bbrd->macc = i2c_eeprom_get_memory_accessor(bbrd->client);
if (IS_ERR_OR_NULL(bbrd->macc)) {
dev_err(&pdev->dev, "Failed to get "
“baseboard memory accessor\n”);
ret = bbrd->macc == NULL ? -ENODEV :
PTR_ERR(bbrd->macc);
bbrd->macc = NULL;
goto err_exit;
}

I found some messages that may have relation with part of the code above (this is a guess).

[ 0.531788] omap_i2c 44e0b000.i2c: unable to select pin group
[ 0.533755] omap_i2c 4819c000.i2c: bus 1 rev0.11 at 100 kHz
[ 0.539204] omap_i2c 4819c000.i2c: unable to select pin group

That's what my board is running:
Linux beaglebone 3.8.13 #1 SMP Tue Jun 25 08:17:15 EDT 2013 armv7l GNU/Linux

j.

Do you mind to send me your .config ???

I am using omap2plus_defconfig and later I include the uio and uio_pru but maybe I need something else that I can’t see.

went to your mailbox.

j.

Considering that I was using buildroot these are the steps that someone should follow:

  1. ~$ git clone git://github.com/beagleboard/kernel.git && cd kernel ~/kernel$ git checkout 3.8

  2. ~/kernel$ ./patch.sh

  3. ~/kernel$ cp configs/beaglebone kernel/arch/arm/configs/beaglebone_defconfig

  4. ~/kernel$ wget http://arago-project.org/git/projects/?p=am33x-cm3.git;a=blob_plain;f=bin/am335x-pm-firmware.bin;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin

  5. ~/kernel$ tar --exclude=‘.git’ -cvjf linux-am335x-3.8.13.tar.bz2 kernel

  6. Copy the linux tarball to /dl/

  7. Configure the kernel at buildroot:

7.1 Kernel version: am335x-3.8.13

7.2 Kernel configuration: Using defconfig

7.3 Defconfig name: beaglebone

7.4 Kernel binary format: uImage

7.5 Load address: 0x80008000 (that is what I am using but doesn’t need to be this one)

7.6 Set “Device tree support”

7.6.1 Device tree source: Use a device tree present in the kernel.
7.6.2 Device Tree Source file names: am335x-bone

  1. Configure “Bootloaders”

8.1 Set “U-Boot”

8.2 U-Boot board name: am335x_evm

8.3 Set “U-Boot SPL support”

8.3.1 U-Boot SPL target name: MLO

Next are the instructions to enable the PRU

  1. Download the overlay from https://github.com/piranha32/IOoo/blob/master/dts/tlc5946-00A0.dts
  2. Compile it: dtc -O dtb -o tlc5946-00A0.dtbo -b 0 -@ tlc5946-00A0.dts
  3. Copy the .dtbo file to /lib/firmware on beaglebone
  4. Load the overlay: echo tlc5946 > /sys/devices/bone_capemgr.*/slots

At this point you should have working PRUSS

I think that this summarize the most important steps to make PRU-ICSS work using buidlroot on beaglebone.