setting up uio_pruss on BBB image using image-builder scripts

What is necessary to set up a Beaglebone Black image with uio_pruss enabled rather than remoteproc?

If I wanted to build an image using this config file, for example: https://github.com/beagleboard/image-builder/blob/master/configs/bb.org-debian-buster-console-v4.19.conf

What steps would I have to take?

When you run "setup_sdcard.sh" to generate your target *.img or
microsd, just don't pass any "--enable-uboot-pru*" options..

https://github.com/beagleboard/image-builder/blob/master/tools/setup_sdcard.sh#L2070-L2084

as the default is:

uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo

https://github.com/beagleboard/image-builder/blob/master/tools/setup_sdcard.sh#L1303-L1348

Regards,

Great, and so if I had used one of those --enable-uboot-pru* options and I wanted to manually change an image to using uio_pruss, is it just a matter of changing /boot/uEnv.txt to use that overlay?

Correct, 4.14.x-ti & 4.19.x-ti kernels support changing the pru driver
from /boot/uEnv.txt.. Just un-comment the version you want..

Regards,

How about the rt kernel? I’m using 4.19.94-ti-rt-r57 and don’t seem to have the /dev/uio* devices. Is there something else I need to activate those devices or does the rt kernel not support uio_pruss?

sudo /opt/scripts/tools/version.sh

Regards,

I tried a different kernel, one that I know works with uio_pruss because I’m using it on a different image (4.19.59-bone-rt-r36). In my custom image, though, the /dev/uio* devices aren’t showing up. Here’s version.sh output on it:

git:/opt/scripts/:[481db95174653ba485cca3797d4bbbe03c0cded0]
eeprom:[A335BNLT000C1626BBBG0552]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[Pocket NC Debian Buster Image 2021-02-01]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-00002-gc9b3922522 (Aug 24 2020 - 16:42:18 -0500)]:[location: dd MBR]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-00002-gbb4af0f50f (Jul 08 2019 - 11:44:39 -0500)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-gbb4af0f50f]:[location: dd MBR]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
kernel:[4.19.59-bone-rt-r36]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210225.0-0~buster+20210225]
pkg:[bb-customizations]:[1.20201105.0-0~buster+20201110]
pkg:[bb-usb-gadgets]:[1.20200504.0-0~buster+20200504]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 1.242393] remoteproc remoteproc0: wkup_m3 is available
[ 1.515377] remoteproc remoteproc0: powering up wkup_m3
[ 1.515394] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 1.517496] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[ 0.868764] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.879941] gpio-of-helper ocp:cape-universal: ready
END

probably fixed, between r36 and r61...

http://gfnd.rcn-ee.org:81/farm/uptime/pwr08-ser16-bbg-4.19.180-bone-rt-r61.log

kernel:[4.19.180-bone-rt-r61]

ls /dev/uio* -la
crw-rw---- 1 root users 240, 0 Mar 16 15:10 /dev/uio0
crw-rw---- 1 root users 240, 1 Mar 16 15:10 /dev/uio1
crw-rw---- 1 root users 240, 2 Mar 16 15:10 /dev/uio2
crw-rw---- 1 root users 240, 3 Mar 16 15:10 /dev/uio3
crw-rw---- 1 root users 240, 4 Mar 16 15:10 /dev/uio4
crw-rw---- 1 root users 240, 5 Mar 16 15:10 /dev/uio5
crw-rw---- 1 root users 240, 6 Mar 16 15:10 /dev/uio6
crw-rw---- 1 root users 240, 7 Mar 16 15:10 /dev/uio7

( we need to change that to root:gpio...)

Regards,

The kernel doesn’t seem to be the problem. Even when I change to that version my /dev/uio* devices aren’t showing up. Am I missing a simple step somewhere?

$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[481db95174653ba485cca3797d4bbbe03c0cded0]
eeprom:[A335BNLT000C1626BBBG0552]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[Pocket NC Debian Buster Image 2021-02-01]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-00002-gc9b3922522 (Aug 24 2020 - 16:42:18 -0500)]:[location: dd MBR]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-00002-gbb4af0f50f (Jul 08 2019 - 11:44:39 -0500)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-gbb4af0f50f]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
kernel:[4.19.180-bone-rt-r61]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210225.0-0~buster+20210225]
pkg:[bb-customizations]:[1.20201105.0-0~buster+20201110]
pkg:[bb-usb-gadgets]:[1.20200504.0-0~buster+20200504]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 1.160381] remoteproc remoteproc0: wkup_m3 is available
[ 1.423096] remoteproc remoteproc0: powering up wkup_m3
[ 1.423115] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 1.425226] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[ 0.785028] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.796784] gpio-of-helper ocp:cape-universal: ready
END

$ lsmod
Module Size Used by
uio_pruss 16384 0
evdev 20480 1
8021q 24576 0
garp 16384 1 8021q
stp 16384 1 garp
mrp 16384 1 8021q
llc 16384 2 garp,stp
usb_f_acm 16384 2
u_serial 20480 3 usb_f_acm
usb_f_ncm 20480 2
usb_f_rndis 20480 4
u_ether 20480 2 usb_f_ncm,usb_f_rndis
libcomposite 40960 16 usb_f_acm,usb_f_ncm,usb_f_rndis
uio_pdrv_genirq 16384 0
uio 16384 2 uio_pruss,uio_pdrv_genirq
iptable_nat 16384 0
nf_nat_ipv4 16384 1 iptable_nat
nf_nat 40960 1 nf_nat_ipv4
nf_conntrack 118784 2 nf_nat_ipv4,nf_nat
nf_defrag_ipv6 16384 1 nf_conntrack
nf_defrag_ipv4 16384 1 nf_conntrack
iptable_mangle 16384 0
iptable_filter 16384 0
ip_tables 20480 3 iptable_mangle,iptable_filter,iptable_nat
x_tables 20480 3 iptable_mangle,ip_tables,iptable_filter
spidev 16384 0

$ ls /dev/uio* -la
ls: cannot access ‘/dev/uio*’: No such file or directory

I switched to that kernel after the fact using:
sudo /opt/scripts/tools/update_kernel.sh --bone-rt-kernel --lts-4_19

Would it matter if I built the image originally with that kernel?

Eh, I see the problem..

"uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo" was a recent change..
While you have U-boot: 2019.04, it's either: Jul 08 2019 or Aug 24
2020, so let's fix that..

sudo apt update
sudo apt install bb-u-boot-am335x-evm

Then:

cd /opt/u-boot/bb-u-boot-am335x-evm/
sudo ./install.sh

sudo reboot

Then you should see the uio node here:

UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-UIO-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]

Regards,

I changed this back on:

https://github.com/beagleboard/image-builder/commit/442ff4a16ba2814328fa389083e1755a1bd4c9ad#diff-a085e70f4f47ad31ded59514c63774946eeda74fd30875e5abfc36073e574559

When adding u-boot overlays for am57xx devices, and adding "kernel"
specific overlays, vs generic u-boot overlays..

Kernel overlays get applied first vs..

debian@bbg-pwr08-ser16:~$ ls /boot/dtbs/4.19.180-bone-rt-r61/overlays/
BBORG_FAN-A000.dtbo

Generic overlays

/lib/firmware/*.dtbo

Regards,

That did it! Thanks Robert!