Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PRU driver #366

Open
YuryMalyshev opened this issue Feb 20, 2025 · 2 comments
Open

Update PRU driver #366

YuryMalyshev opened this issue Feb 20, 2025 · 2 comments

Comments

@YuryMalyshev
Copy link

As stated in the provisioning.conf, uboot_overlay_pru is currently broken due to changes in the kernel.

However, it works fine in BeagleBoard's latest distro, AM335x 11.7 2023-09-02 4GB microSD IoT, which also uses kernel 5.10.
Here's my uEnv.txt:

uname_r=5.10.168-ti-r71
enable_uboot_overlays=1
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
enable_uboot_cape_universal=1
console=ttyS0,115200n8
cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

The system starts up and it's possible to load a new firmware onto the PRU.

A similar config in Nerves breaks the system:

cmd("fw_setenv enable_uboot_overlays 1")
cmd("fw_setenv uboot_overlay_pru /lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo")
cmd("fw_setenv enable_uboot_cape_universal 1")

Perhaps, it's necessary to use a different version of AM335X-PRU-RPROC-4-19-TI-00A0.dtbo?

Unfortunately, I'm not familiar with the topic enough to contribute anything else.

@fhunleth
Copy link
Member

I'm currently not using the PRUs and haven't for years. They definitely did work with nerves_system_bbb at one time, but I think Linux or BeagleBoard changed how they wanted things to work and I got it wrong.

My memory is that there were two ways of interacting with the PRU. One is via UIO and the other is via RPROC. You found the RPROC way. The UIO way is to use AM335X-PRU-UIO-00A0.dtbo. Based on your report, I think that I got confused and thought that they were changing to UIO back when two ways were introduced. This was quite a long time ago.

I don't know if UIO is even viable for the PRUs these days, but if it is, I think it will work. I think that there are Linux device drivers that need to be enabled to support the AM335X-PRU-RPROC-4-19-TI-00A0.dtbo overlay. It's probably enabling one or two kernel options. I don't have access to a Linux machine this evening to poke around and take a guess. A good hint would be for you to run lsmod on the Beagleboard distro. I would expect kernel modules that have pru or rproc in their name to show up. Sorry about not having a better answer now. I'll should have access to a Linux machine next week.

@YuryMalyshev
Copy link
Author

Thank you for the response!
As it stands, both AM335X-PRU-UIO-00A0.dtbo and AM335X-PRU-RPROC-4-19-TI-00A0.dtbo crash the Nerves system.

Here's the output of lsmod for 4 different configurations:
(Module order is listed as it was outputted. Dashes were used for clarity)

Default RPROC UIO Working UIO
pru_rproc pru_rproc - -
irq_pruss_intc irq_pruss_intc - -
pm33xx pm33xx pm33xx pm33xx
pruss pruss - -
- - - uio_pruss
- pvrsrvkm pvrsrvkm pvrsrvkm
- - uio_pruss -
ti_eqep ti_eqep ti_eqep ti_eqep
counter counter counter counter
c_can_platform c_can_platform c_can_platform c_can_platform
c_can c_can c_can c_can
can_dev can_dev can_dev can_dev
evdev evdev evdev evdev
wkup_m3_ipc wkup_m3_ipc wkup_m3_ipc wkup_m3_ipc
uio_pdrv_genirq uio_pdrv_genirq uio_pdrv_genirq uio_pdrv_genirq
uio uio uio uio
cpufreq_dt cpufreq_dt cpufreq_dt cpufreq_dt
spidev spidev spidev spidev

The default configuration doesn't have uboot_overlay_pru at all.
"UIO" configuration doesn't seem to work - there are no uio devices under /dev/
The difference between "UIO" and "Working UIO" is the way uboot_overlay_pru is assigned:

UIO: uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
Working UIO: uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
RPROC is enabled via: uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants