cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shahid
Participant
Participant
13,084 Views
Registered: ‎03-25-2016

petalinux not creating uio

Jump to solution

Hello,

 

I want to use UIO for PL. For that i have make

compatible = "generic-uio";

 

in kernel configuration i have

<M> Userspace I/O drivers  ---> 

<M>   Userspace I/O platform driver with generic IRQ handling

<M>   Userspace platform driver with generic irq and dynamic memory

 

but when is built the petalinux it does not creates /dev/uio0.

 

I have tried petalinux 2015.4 and petalinux 2015.2.

 

An other problem is that when i used petalinux 2014.4 it does not shows interrupt in device tree but it creats /dev/uio0.

 

Please help me.

 

Thanks

 

 

 

 

 

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
shahid
Participant
Participant
21,716 Views
Registered: ‎03-25-2016

Hi zhangdefu,

 

What you have said is right. You have to edit system-conf.dtsi you will see following line there

chosen {
bootargs = "console=ttyPS0,115200 earlyprintk ";
};

so you just replace it by 

 

chosen {
bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
};

 

It will definitely work.

 

If you need more help let me know.

 

Regards

 

View solution in original post

0 Kudos
10 Replies
jeffdaq
Explorer
Explorer
13,033 Views
Registered: ‎11-22-2015

Hello,

 

The uio driver does not support that compat string.  You either need to modify the uio driver to add that string or I've also seen it suggested that you can modify the kernel cmdline to enable the uio(sorry, I didn't do this so don't know the exact string)

 

jeff

0 Kudos
shahid
Participant
Participant
13,011 Views
Registered: ‎03-25-2016

 Hello  jeffdaq,

 

Thanks for your reply.

 

you mean to say Petalinux 2015.4 uses different compat string for generating uio?

 

when i have used petalinux 2014.4 it genertes node for device using compatible ="generic-uio".

 

But petalinux 2015.2 and 2015.4 both i have tried but they are not making nodes for device. I have enabled kernel cmdline for uio.

 

Waiting for your reply.

 

Thanks

 

 

0 Kudos
shahid
Participant
Participant
13,310 Views
Registered: ‎03-25-2016

Hi,

 

Found the solution. 

compatible ="generic-uio"

 

1. petalinux-config -c kernel
boot options--> kernel commandline type ---> "extend bootloader kernel arguments"

select this option.

2. In system-top.dts

chosen {
bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
};

 

verify with cat /proc/cmdline.

 

Regards

 

0 Kudos
zhangdefu
Newbie
Newbie
12,199 Views
Registered: ‎05-25-2016

Soory. I am new here. You said:

In system-top.dts

chosen {
bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
};

 

Do you mean edit system-top.dts and add these lines at the end of the system-top.dts file? I did it and got syntactic error. How to do "chosen" exactly? Thanks.

 

From u-bbot, I did

setenv bootargs console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio

and checked after system boot

cat /proc/cmdline

But, it still does not work.

0 Kudos
shahid
Participant
Participant
21,717 Views
Registered: ‎03-25-2016

Hi zhangdefu,

 

What you have said is right. You have to edit system-conf.dtsi you will see following line there

chosen {
bootargs = "console=ttyPS0,115200 earlyprintk ";
};

so you just replace it by 

 

chosen {
bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
};

 

It will definitely work.

 

If you need more help let me know.

 

Regards

 

View solution in original post

0 Kudos
zhangdefu
Newbie
Newbie
12,137 Views
Registered: ‎05-25-2016

shahid:

 

It works ! I got the UIOx generated and works in polling mode.

 

Do you know where can I find UIO interrupt sample C code and kernel/device-tree configuration guide ?

 

Thanks a lot.

0 Kudos
yerby
Visitor
Visitor
7,473 Views
Registered: ‎09-12-2016

Sorry but this solution is not working for vivado/petalinux 2016.4 on ubuntu16.04. 

 

The linux kernel is 4.6.0. Running petalinux-config -c kernel, but resuts that under "Boot options" there is no "kernel commandline type" option.

 

I do have edited system-conf.dtsi to modify 

bootargs = "console=ttyPS0,115200 earlyprintk ";

with

bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";

but still does not work. No /dev/uioX devices are created (and I should have 3, a custom core and two gpios). 

 

Please, any hints?

 

Best regards

0 Kudos
yerby
Visitor
Visitor
7,455 Views
Registered: ‎09-12-2016

Hi again,

 

Just to clarify that the problem seems to be specific to the UIO devices, because I have checked that the hw has been inferred correctly and it is working:

# ls /proc/device-tree/amba_pl
total 0
-r--r--r--    1 root     root             4 Mar  2 08:53 #address-cells
-r--r--r--    1 root     root             4 Mar  2 08:53 #size-cells
drwxr-xr-x    5 root     root             0 Mar  2 08:53 .
drwxr-xr-x   10 root     root             0 Jan  1  1970 ..
-r--r--r--    1 root     root            11 Mar  2 08:53 compatible
drwxr-xr-x    2 root     root             0 Mar  2 08:53 gpio@41200000
drwxr-xr-x    2 root     root             0 Mar  2 08:53 gpio@41210000
drwxr-xr-x    2 root     root             0 Mar  2 08:53 mysum@43c00000
-r--r--r--    1 root     root             8 Mar  2 08:53 name
-r--r--r--    1 root     root             0 Mar  2 08:53 ranges

And I can control leds with:

# devmem 0x41200000 32 0x000000ff
# devmem 0x41200000 32 0x00000000

and read switches with:

# devmem 0x41210000

Thanks in advance for your advise.

 

Regards.

 

0 Kudos
marcoventurini
Adventurer
Adventurer
6,034 Views
Registered: ‎10-02-2014

You have to edit the system-top.dts file in the meta-user/recipes-dt/device-tree/files/ folder.

 

/dts-v1/;
/include/ "system-conf.dtsi"
/ {

  chosen {
		bootargs = "console=ttyPS0,115200 earlyprintk  uio_pdrv_genirq.of_id=generic-uio";
		stdout-path = "serial0:115200ns";
	};


};

The system-conf.dtsi file is in the generated layer so it will be overwritten by the toolchain.

 

Marco

0 Kudos
madhuba
Xilinx Employee
Xilinx Employee
2,983 Views
Registered: ‎07-29-2011

hi

Edit the file

 

meta-user/recipes-dt/device-tree/files/system-user.dtsi

and add the  bootargs

 

{

  chosen {
bootargs = "console=ttyPS0,115200 earlyprintk  uio_pdrv_genirq.of_id=generic-uio";
stdout-path = "serial0:115200ns";
};


};

 

it works for 2017.3 Petalinux builds

 

Regards

Madhubala

 

 

 

 

0 Kudos