PRU prussdrv_open gives Bus error, Custom PREEMPT_RT Linux kernel 3.14

Hi,
I’m currently running a 3.14 PREEMPT_RT build based of Robert C Nelsons repository. I’ve got GPIO and uart up and running. And now my attention has turned to the PRU. The 3.14 build does not have a capemanager so i setup my device trees at build.
I based my PRU work of the old PRU patch: https://github.com/beagleboard/kernel/blob/3.12/patches/pru/0001-These-are-the-patches-necessary-for-enabling-the-PRU.patchh
Now, booting gives me no error messages from uio_pruss. And uio0-7 appears in /dev/. However, when running a test project (which ran perfectly fine under non-modified 3.8 kernel) prussdrv_open() failes: Bus error

This happens every time prussdrv_open tries to read from its memory mapped areas like:


    if (pruss_io[(AM18XX_INTC_PHYS_BASE - AM18XX_DATARAM0_PHYS_BASE) >> 2]
        == AM18XX_PRUSS_INTC_REV)

Now the pruss is defined in am33xx.dtsi:

pruss: pruss@4a300000 {
compatible = “ti,pruss-v2”;
ti,hwmods = “pruss”;
ti,deassert-hard-reset = “pruss”, “pruss”;
reg = <0x4a300000 0x080000>;
ti,pintc-offset = <0x20000>;
interrupt-parent = <&intc>;
status = “okay”;
interrupts = <20 21 22 23 24 25 26 27>;
};

And one of my dtsi include files to the am335x-boneblack.dts enables it:

&pruss {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&pru_gpio_pins>;
};

I then modprobe uio_pruss before running the test application.

I have little clue how to fix this, so any pointers or help would be much appreciated:)

In my case, I solved similar problem with enabling clock and power domain configuration, refer

https://github.com/chunsj/nxctrl/blob/master/NXCTRL.c#L223

I presume that you solved this? What was required? I am struggling with the same situation.

Thanks,

Bob

Hello Henrik,
I found your post about Robert Nelsons 3.14er Kernel and PREEMPT_RT.
I built a a 3.14 Kernel on Ubuntu 14/PC yesterday by Crosscompiling Roberts RobertCNelson/bb-kernel/am33x-v3.14. It runs.

Please can you explain me how you used der PREEMPT_RT patch with Roberts 3.14er Kernel
what I did :
Now I’ struggling, about the right way to patch this Kern by OSADL PREEMPT_RT Patch
From https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/ download patch-3.14.12-rt9.patch.gz
and patched : patch -p < patch-3.14.12-rt9.patch.gz
Then I started Roberts rebuild.sh and found no patch inside the config menue about PREEMPT_RT.

Thank you in advance
Lupus

Hello Henrik,
I’m happy that I found your post about Robert Nelsons Kernel 3.14 from https://github.com/RobertCNelson/bb-kernel/tree/am33x-v3.14
The built was successful. I cross compiled the Kernel on Ubuntu 14.04/PC

Now I try to figure out, how the PREEMPT_RT patch from https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/ can be used
I patched it like this:

#cd bb-kernel
# patch -p1 [< patch-3.14.12-rt9.patch.gz](https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patch-3.14.12-rt9.patch.gz) 
#./rebuild.sh

As it is cross compiled I'm not shure if menuconfig works?
Please allow me the question. How do you patch the Kernel 3.14

thank you in advance 
Lupus 

Hello Henrik,
I’m happy that I found your post about Robert Nelsons Kernel 3.14 from https://github.com/RobertCNelson/bb-kernel/tree/am33x-v3.14
The built was successful. I cross compiled the Kernel on Ubuntu 14.04/PC

Now I try to figure out, how the PREEMPT_RT patch from https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/ can be used
I patched it like this:

#cd bb-kernel
# patch -p1 [< patch-3.14.12-rt9.patch.gz](https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patch-3.14.12-rt9.patch.gz) 
#./rebuild.sh

As it is cross compiled I'm not shure if menuconfig works?
Please allow me the question. How do you patch the Kernel 3.14

thank you in advance 
Lupus 

Hello Henrik,
I’m happy that I found your post about Robert Nelsons Kernel 3.14 from https://github.com/RobertCNelson/bb-kernel/tree/am33x-v3.14
The built was successful. I cross compiled the Kernel on Ubuntu 14.04/PC

Now I try to figure out, how the PREEMPT_RT patch from https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/ can be used
I patched it like this:

#cd bb-kernel
# patch -p1 [< patch-3.14.12-rt9.patch.gz](https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patch-3.14.12-rt9.patch.gz) 
#./rebuild.sh

As it is cross compiled I'm not shure if menuconfig works?
Please allow me the question. How do you patch the Kernel 3.14

thank you in advance 
Lupus