cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
911 Views
Registered: ‎12-28-2014

UIO not detected in device tree - 2019.1

Hello,

I had previously reviewed all of the Embedded Linux posts for UIO and had my UIO driver working properly on 2018.2.  I've since migrated to Petalinux 2019.1 and have troubles with UIO.  As with other posts regarding this for earlier versions (post .compatible removal) here are my bootargs and uio entry in the devicetree:

 

bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait";
uio_flag@0 {
		compatible = "generic-uio";
		status = "okay";
		interrupt-parent = <blah>;
		interrupts = <0x0 blah 0x1>;
	};

dmesg only greps the bootargs.  I am using Linaro Debian, but I see that uio_pdrv_genriq does not appear to be built in.

One particular point I noticed was that when configuring the kernel, the defaults are:

Deivice Drivers -> Userspace I/O drivers -> <M> Userspace I/O platform driver with generic IRQ handling

Deivice Drivers -> Userspace I/O drivers -> <*> Userspace platform driver with generic irq and dynamic memory

changing the first to built-in did not work (in neither case was the driver built) but if I changed Userspace I/O drivers to <M> the driver was built.  Doing an insmod uio_pdrv_genriq.ko did nothing, though.  Nor did building the module source as a user module.  No dmesg info, no /sys/class/uio, no /dev/uio...

Another odd fact, if I change to built-in, and come back, it has always reverted to a module again.  Distclean and friends have no effect on this.  I tried a new project and defining these kernel args in the beginning but still the same behavior.

Again, this worked on 2018.2 but I've not seen any posts regarding an issue moving to 2019.1.  If no one else has experienced this I will likely move to debug messages in the kernel source (building as custom module).

It seems maybe two issues?

(1) not getting built in the kernel config menu (def. is listed in a user_<date>.cfg)

CONFIG_UIO_PDRV_GENIRQ=y
CONFIG_UIO_DMEM_GENIRQ=y

(2) insmod does load the driver, but nothing happens.  I am redefining bootargs from system_user.dtsi - has not been an issue in the past, perhaps this means is broken and it should be from petalinux-config?

Thanks in advance!

 

Tags (3)
0 Kudos
5 Replies
Highlighted
Moderator
Moderator
852 Views
Registered: ‎09-12-2007

I have seen this crop up a few times now. However, the flow that you are using works for me.

if you do a ls /dev  Do you see the UIO here? Have you tried to ping the IP using devmem to make sure it is assesible?

Reference:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842490/Testing+UIO+with+Interrupt+on+Zynq+Ultrascale

0 Kudos
Highlighted
Participant
Participant
850 Views
Registered: ‎12-28-2014

thanks for your reply.  To answer your questions:

if you do a ls /dev Do you see the UIO here?  No dev entry

Have you tried to ping the IP using devmem to make sure it is assesible?  My IP is good and working - the UIO interrupt handler is just for detecting FIFO overflows; for now I just ensure that the data rates are low enough so it is not a problem.

Exact same configurations worked under 2018.2 Vivado & petalinux versions.

 

 

0 Kudos
Highlighted
Visitor
Visitor
568 Views
Registered: ‎03-21-2020

I'm having the same issue with 2019.2... After poking around for a bit, I saw the following in components/plnx_workspace/sources/linux-xlnx/.kernel-meta/cfg/merge_config_build.log :

[...]
Merging .kernel-meta/configs//cfg/openamp.cfg
Value of CONFIG_UIO_PDRV_GENIRQ is redefined by fragment .kernel-meta/configs//cfg/openamp.cfg:
Previous value: CONFIG_UIO_PDRV_GENIRQ=y
New value: CONFIG_UIO_PDRV_GENIRQ=m
[...]

so it seems, that openamp.cfg just overwrites my meta-user setting...

even after creating my own "openamp.cfg" in meta-user/recipes-kernel/linux/linux-xlnx results in

[...]
Merging .kernel-meta/configs//./openamp.cfg
Merging .kernel-meta/configs//cfg/openamp.cfg
Value of CONFIG_UIO_PDRV_GENIRQ is redefined by fragment .kernel-meta/configs//cfg/openamp.cfg:
Previous value: CONFIG_UIO_PDRV_GENIRQ=y
New value: CONFIG_UIO_PDRV_GENIRQ=m
[...]

despite of a higher priority in my layer.conf.

Is there any way to override or disable the supplied openamp.cfg?

0 Kudos
Highlighted
Moderator
Moderator
504 Views
Registered: ‎04-24-2017

Hi @flop , @mowerj 

Yes openamp is using a kernel_feature settings those will be applied last. The only way to override that value is to also apply your bsp.cfg values as kernel_features, and ensure that they are appended to the variable after openamp is processed. Controlling that variable manipulation order is the same as any bitbake variable, kernel_features is no different.

Yocto:

$ cat meta-petalinux/recipes-kernel/linux/files/bsp.cfg
CONFIG_UIO_PDRV_GENIRQ=y
CONFIG_UIO_DMEM_GENIRQ=y
$ cat meta-petalinux/recipes-kernel/linux/linux-xlnx_%.bbappend
SRC_URI += "file://bsp.cfg"
KERNEL_FEATURES_append = " bsp.cfg"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"


PetaLinux: 

$ cat project-spec/meta-user/recipes-kernel/linux/linux-xlnx/bsp.cfg
CONFIG_UIO_PDRV_GENIRQ=y
CONFIG_UIO_DMEM_GENIRQ=y
$ cat project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
SRC_URI += "file://bsp.cfg"
KERNEL_FEATURES_append = " bsp.cfg"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Visitor
Visitor
478 Views
Registered: ‎03-21-2020

Thanks a lot, this finally did the trick!
0 Kudos