04-15-2019 01:12 AM
Hi all !
Did anyone try to use PL as UIO device under Ubuntu Desktop on ZCU102? I tried to add my device as mentioned here with:
compatible = "generic-uio";
but it still doesn't work.
Sometimes the DisplayPort driver crashes and I can mount the display module, therefore the kernel should be compiled again.
Is there some inconsistency between adding a PL device to device tree and using Ubuntu Desktop?
Thank you !
04-21-2019 03:16 PM
Do you have UIO included in you Linux kernel?
Do you have this in your bootargs in the device tree? “uio_pdrv_genirq.of_id=generic-uio"
04-23-2019 10:03 AM
Thanks for your reply.
If I use Petalinux alone, I am able to see my device in /dev/ as well as in /proc/interrupts.
However, if I would like to use Ubuntu Desktop I have to disable initramfs/initrd, otherwise only basic Linux will boot and not Ubuntu.
Whenever I disable it from Petalinux kernel config as follows:
[ ] Initial RAM file system and RAM disk (initramfs/initrd) support
I don't see my device in /dev/ nor an interrupt for it.
This is what I observed so far. Any suggestions or clarifications please?
04-23-2019 05:04 PM
How are you running Ubuntu on the target?
Are you compiling it with PetaLinux?
The UIO devices are mounted at particular memory locations (eg. AXI hosted) in accordance with the Device Tree. The Linux kernel (Ubuntu or otherwise) has to be compiled against that Device Tree.
04-24-2019 02:33 AM
That's an important point.
I am not compiling Ubuntu at all, I just load its file system after booting the Petalinux-generated Linux (is my understanding corect?)
according to this guide:
I use Petalinux to compile the kernel and tell Linux to load the file system from SD Card, specifically from mmcblk0p2 which has the root file system for Ubuntu.
So now what I don't understand is whether a Petalinux Kernel loads another Ubuntu Kernel, or the same kernel is used for Ubuntu.
Normally the kernel is included in the FIT Image (image.ub) which is generated by Petalinux. I don't know and I don't think that the Ubuntu kernel is to be recompiled.
Any thoughts about this issue?
04-24-2019 05:32 AM
When you run uname -r does it match the kernel version you build with petalinux?
What happens when you install UIO drivers as modules do they appear in /lib/modules?
04-24-2019 05:55 AM - edited 04-24-2019 05:56 AM
In both cases (Ubuntu and petalinux-built) the kernel version is :
In case of Petalinux-generated version, I can find uio_pdrv_genirq.ko module in :
This module can be easily inserted and removed using insmod and rmmod respectively. It is already inserted when the Linux boots.
However, in Ubuntu I can see both uio_pdrv_genirq.ko and uio_dmem_genirq.ko in the same path.
when I insert uio_pdrv_genirq.ko I get segmentation fault. If I try again nothing happens !
04-25-2019 02:00 AM - edited 04-25-2019 02:00 AM
I tried to do:
udevadm info -e
on both Petalinux and Ubuntu.
I can see one clear difference regarding my device in both cases:
P: /devices/platform/amba_pl@0/a0000000.hand_network E: DEVPATH=/devices/platform/amba_pl@0/a0000000.hand_network E: DRIVER=uio_pdrv_genirq E: MODALIAS=of:Nhand_networkT<NULL>Cgeneric-uio E: OF_COMPATIBLE_0=generic-uio E: OF_COMPATIBLE_N=1 E: OF_FULLNAME=/amba_pl@0/hand_network@a0000000 E: OF_NAME=hand_network E: SUBSYSTEM=platform
The third line (i.e. E: DRIVER=uio_pdrv_genirq) exists in Petalinux but NOT in Ubuntu.
Furthermore, the whole following block exists only in Petalinux but not in Ubuntu:
P: /devices/platform/amba_pl@0/a0000000.hand_network/uio/uio1 N: uio1 E: DEVNAME=/dev/uio1 E: DEVPATH=/devices/platform/amba_pl@0/a0000000.hand_network/uio/uio1 E: MAJOR=245 E: MINOR=1 E: SUBSYSTEM=uio
uio0 is reserved for axi performance monitoring in both cases.
Does this observation give a hint ?