BUS ERROR modprobe uio_pruss extram_pool_sz=0x800000

Hi,

I am running 4.1.21-bone-rt-r20, Debian GNU/Linux 8.6 (jessie).
I run a PRU program with default DRAM size of 256KB , this works fines but when I tried to increase the external memory to 8MB I got a buss error

`

#modprobe -r uio_pruss
#modprobe uio_pruss extram_pool_sz=0x800000

#dmesg | tail
[ 550.971014] pruss_uio 4a300000.pruss: Unbalanced pm_runtime_enable!
[ 550.971111] pruss_uio 4a300000.pruss: pins are not configured from the driver
[ 555.823781] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6d43000
[ 555.831519] pgd = dc258000
[ 555.834249] [b6d43000] *pgd=9db2e831, *pte=4a304303, *ppte=4a304a33
[ 749.642962] pruss_uio 4a300000.pruss: Unbalanced pm_runtime_enable!
[ 749.643073] pruss_uio 4a300000.pruss: pins are not configured from the driver
[ 763.164615] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6e33000
[ 763.172351] pgd = ddde8000
[ 763.175081] [b6e33000] *pgd=9c27e831, *pte=4a304303, *ppte=4a304a33

`

When I read the pruio driver doc, it said that we can use 8MB max of the DDR.

Anybody know how can I get rid of this bus error?

Hi malkowki!

Sorry, I cannot really help. Just some info: The same commands work well for me on several kernel versions (3.8, 4.1 and 4.4, but no rt). I use them often and I always get the first two messages

[ 749.642962] pruss_uio 4a300000.pruss: Unbalanced pm_runtime_enable!
``
[ 749.643073] pruss_uio 4a300000.pruss: pins are not configured from the driver`

`

But I never got the fault message

[ 763.164615] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6e33000 [ 763.172351] pgd = ddde8000 [ 763.175081] [b6e33000] *pgd=9c27e831, *pte=4a304303, *ppte=4a304a33`

`

I wonder why the fault comes with some delay (> 5 s).

Regards

I suspect that you need to make these changes in the overlay file you use to initially configure the PRU’s.

Hello William,

I don’t see where I can make some changes in my original DTS file in order to extemd the Extram to 8 MB.

See below my dts, can you help on this?

Thanks,

`
/dts-v1/;
/plugin/;

/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;

/* identification */
part-number = “BB-PRU-CONFIG”;
version = “00A0”;

/* state the resources this cape uses /
exclusive-use =
/
the pin header P8 uses */

“P8.27”, /* PRU 1 r3*_8 default IN /
“P8.28”, /
PRU 1 r3*_10 default IN /
“P8.29”, /
PRU 1 r3*_9 default IN */

“P8.39”, /* PRU 1 r3*_6 default OUT /
“P8.40”, /
PRU 1 r3*_7 default OUT /
“P8.41”, /
PRU 1 r3*_4 default OUT /
“P8.42”, /
PRU 1 r3*_5 default OUT /
“P8.43”, /
PRU 1 r3*_2 default OUT /
“P8.44”, /
PRU 1 r3*_3 default OUT /
“P8.45”, /
PRU 1 r3*_0 default OUT /
“P8.46”, /
PRU 1 r3*_1 default OUT */

/* the pin header P9 uses */

“P9.27”, /* PRU 0 r3*_5 default IN */

“P9.28”, /* PRU 0 r3*_3 default IN */

“P9.29”, /* PRU 0 r3*_1 default OUT /
“P9.30”, /
PRU 0 r3*_2 default OUT /
“P9.31”, /
PRU 0 r3*_0 default OUT */

“P9.41”, /(mode B) PRU 0 r3_6 default IN /
“P9.42”; /
(mode B) PRU 0 r3*_4 default IN */

fragment@0 {
target = <&am33xx_pinmux>;
overlay {

config_pins: pinmux_config_pins{
pinctrl-single,pins = <
/* The pin header P8 uses and PRU 1 part */

/* Input part */
0x0e0 0x26 // P8_27 pr1_pru1_pru_r31_8, MODE6 | INPUT | PRU 00100110=0x26
0x0e8 0x26 // P8_28 pr1_pru1_pru_r31_10,MODE6 | INPUT | PRU 00100110=0x26
0x0e4 0x26 // P8_29 pr1_pru1_pru_r31_9, MODE6 | INPUT | PRU 00100110=0x26

/* Output part */
0x0b8 0x05 // P8_39 pr1_pru1_pru_r30_6, MODE5 | OUTPUT | PRU 00000101=0x05
0x0bc 0x05 // P8_40 pr1_pru1_pru_r30_7, MODE5 | OUTPUT | PRU 00000101=0x05
0x0b0 0x05 // P8_41 pr1_pru1_pru_r30_4, MODE5 | OUTPUT | PRU 00000101=0x05
0x0b4 0x05 // P8_42 pr1_pru1_pru_r30_5, MODE5 | OUTPUT | PRU 00000101=0x05
0x0a8 0x05 // P8_43 pr1_pru1_pru_r30_2, MODE5 | OUTPUT | PRU 00000101=0x05

0x0ac 0x05 // P8_44 pr1_pru1_pru_r30_3, MODE5 | OUTPUT | PRU 00000101=0x05
0x0a0 0x05 // P8_45 pr1_pru1_pru_r30_0, MODE5 | OUTPUT | PRU 00000101=0x05
0x0a4 0x05 // P8_46 pr1_pru1_pru_r30_1, MODE5 | OUTPUT | PRU 00000101=0x05

/* The pin header P9 uses and PRU 0 part */

/* Input part */
0x1a4 0x26 // P9_27 pr1_pru0_pru_r31_5, MODE6 | INPUT | PRU 00100110=0x26

0x19C 0x26 // P9_28 pr1_pru0_pru_r31_3, MODE6 | INPUT | PRU 00100110=0x26
0x1a8 0x26 // P9_41B pr1_pru0_pru_r31_6, MODE6 | INPUT | PRU 00100110=0x26
0x164 0x27 // gpio0[7] MODE7 | INPUT | PRU 00100111=0x27
0x1a0 0x26 // P9_42B pr1_pru0_pru_r31_4, MODE6 | INPUT | PRU 00100110=0x26

/* Output part */
0x194 0x05 // P9_29 pr1_pru0_pru_r30_1, MODE5 | OUTPUT | PRU 00001101=0x05
0x198 0x05 // P9_30 pr1_pru0_pru_r30_2, MODE5 | OUTPUT | PRU 00001101=0x05
0x190 0x05 // P9_31 pr1_pru0_pru_r30_0, MODE5 | OUTPUT | PRU 00001101=0x05

;
};

};
};

//Allowed us to have the differents uio
fragment@1{
target = <&pruss>;
overlay{
status = “okay”;
pinctrl-names = “default”;
};
};

//Make the uio working
fragment@2 {
target = <&ocp>;
overlay {
#address-cells = <1>;
#size-cells = <1>;

gpio_keys {
compatible = “gpio-keys”;
pinctrl-names = “default”;
pinctrl-0 = <&config_pins>;
#address-cells = <1>;
#size-cells = <0>;
};

};
};

};

`

It’ll probably be in one of the board, or board related overlay files. That is, the overlay that is loaded at boot to bring up various bits of hardware. For instance . . .

william@beaglebone:~/dev$ cat /boot/uEnv.txt |grep dtb
#dtb=
##BeagleBone Black/Green dtb’s for v4.1.x (BeagleBone White just works…)
dtb=am335x-boneblack-emmc-overlay.dtb
#dtb=am335x-boneblack-hdmi-overlay.dtb
#dtb=am335x-boneblack-nhdmi-overlay.dtb
#dtb=am335x-boneblack-overlay.dtb
#dtb=am335x-boneblack-wl1835mod.dtb
#dtb=am335x-bonegreen-overlay.dtb

Hello William,

I have the same overlay in my board :

`
cat /boot/uEnv.txt |grep dtb
#dtb=am335x-boneblack-overlay.dtb #activate BOTH
dtb=am335x-boneblack-emmc-overlay.dtb #activate EMMC but disable HDMI

`

I don’t see the link with the uio_pruss extram, any idea how to fix this?

I had the same issue with 4.4.30-ti-r64 trying to set the extram_pool_sz to 1MB. I noticed that after I got the bus error, even if I reloaded uio_pruss with the default extram_pool_sz (which worked fine before the first reload to 1MB), I would still get the bus error. What worked for me was to set the extram_pool_sz at boot by specifying the value in cmdline in /boot/uEnv.txt:

cmdline=… uio_pruss.extram_pool_sz=0x100000

After rebooting, uio_pruss starts with a 1MB pool size and I do not get the bus error. Perhaps the bus error is related to reloading the module, not necessarily the pool size?