UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
227 Views
Registered: ‎05-30-2018

Ubuntu Desktop and Generic UIO

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 !

Best ..

0 Kudos
10 Replies
Adventurer
Adventurer
194 Views
Registered: ‎05-30-2018

Re: Ubuntu Desktop and Generic UIO

Any ideas please ?

0 Kudos
168 Views
Registered: ‎05-16-2013

Re: Ubuntu Desktop and Generic UIO

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"

0 Kudos
Adventurer
Adventurer
147 Views
Registered: ‎05-30-2018

Re: Ubuntu Desktop and Generic UIO

Hi bfrantz@alionscience.com 

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?

Thanks !

0 Kudos
Participant rwillis
Participant
135 Views
Registered: ‎08-23-2018

Re: Ubuntu Desktop and Generic UIO

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.

 

0 Kudos
Adventurer
Adventurer
113 Views
Registered: ‎05-30-2018

Re: Ubuntu Desktop and Generic UIO

Hi @rwillis 

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:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841937/Zynq+UltraScale+MPSoC+Ubuntu+part+2+-+Building+and+Running+the+Ubuntu+Desktop+From+Sources

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?

Thanks !

0 Kudos
105 Views
Registered: ‎05-16-2013

Re: Ubuntu Desktop and Generic UIO

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?

0 Kudos
Adventurer
Adventurer
99 Views
Registered: ‎05-30-2018

Re: Ubuntu Desktop and Generic UIO

In both cases (Ubuntu and petalinux-built) the kernel version is :

4.14.0-xilinx-v2018.3

 In case of Petalinux-generated version, I can find uio_pdrv_genirq.ko module in :

/lib/modules/4.14.0-xilinx-v2018.3/kernel/drivers/uio

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 !

 

0 Kudos
78 Views
Registered: ‎05-16-2013

Re: Ubuntu Desktop and Generic UIO

Maybe udev doesn’t have rules for those modules?

0 Kudos
Adventurer
Adventurer
63 Views
Registered: ‎05-30-2018

Re: Ubuntu Desktop and Generic UIO

Would you please clarify a bit?

0 Kudos
Adventurer
Adventurer
53 Views
Registered: ‎05-30-2018

Re: Ubuntu Desktop and Generic UIO

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 ?

 

0 Kudos