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
Visitor ram32xtr
Visitor
5,734 Views
Registered: ‎06-05-2013

No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

Hello all,

 

First off, some info about my setup:

- Ubuntu 16.04

- Petalinux 2016.4

- Vivado 2016.4

- Zynq ZC706

 

I'm looking to use UIO to communicate with my custom core, the latter connected to the ARM via an AXI interconnect. When Petalinux is running on the Zynq, it seems that the UIO module is loaded, which I can tell because:

- uio is listed when I run cat /proc/devices

- I can see a /sys/class/uio dir

 

On the other hand, it looks like UIO is not detecting my custom core, because:

- There is no UIO entry under /dev

- The /sys/class/uio dir is empty (e.g. no /sys/class/uio/uio0).

 

Should I be doing something for uio_pdev_irqgen other than enabling it in the kernel config (though it's enabled by default)? 

 

Side note: I'm able to communicate with my custom core using a self-developed device driver. I am now interested in making use of the UIO module instead.

 

 

Here are the steps I am performing w.r.t. the Petalinux project

Step 1: create a Petalinux project

 

petalinux-create -t project -n my_peta_project -s dir_to_bsps/latest_706_bsp_from_xilinx_web.bsp

 

 

(then cd to the project)

 

Step 2: config and point to the exported hw from vivado

 

petalinux-config --get-hw-description=/dir/to/my_vivado_project/my_vivado_project.sdk/design_1_wrapper_hw_platform_0

 

 

Step 3: Modify the device tree to include my custom core

I am appending the following to <plnx_proj_root>/project-spec/meta-user/recipes-dt/device-tree/files/system-top.dts

 

&amba_pl {
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    compatible = "simple-bus";
    ranges;
    simple_customcore@43c00000 {
        compatible = "generic-uio";
        reg = <0x43c00000 0x10000>;
        xlnx,s-axi-ctrl-bus-addr-width = <0x6>;
        xlnx,s-axi-ctrl-bus-data-width = <0x20>;
    };  
};

Note the compatible field set to "generic-uio". Note that I am learning about the generic UIO through https://www.xilinx.com/member/zynq_videos/Linux-User-Space-Device-Drivers.pdf

 

 

 

Step 4: Build peta-linux

 

petalinux-build

 

 

Step 5: Package my bitstream

 

petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga /dir/to/my_vivado_project/my_vivado_project.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit --uboot --force

 

 

Step 6: Copy the contents of images/linux/* to the SD card, and boot linux on the Zynq.

 

As mentioned above, once running in the Zynq, I see the UIO module is loaded, however, it looks like UIO is not detecting my custom core.

 

Am I missing any steps?

 

Here is a screenshot of the kernel configuration w.r.t. uio_pdev_irqgen

kconfig_generic_uio.png

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Visitor ram32xtr
Visitor
9,991 Views
Registered: ‎06-05-2013

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

Finally got it to work, based on @debrajr 's suggestion, but with a minor caveat: my ip cores are now at the top level of the system-top.dts (i.e. not within the amba_pl node).

 

I'll mark this solution as accepted since it summarizes the required steps. That said, what is listed here is mostly based on @debrajr 's suggestions.

 

Here's a full summary of the solution (combining other responses)

- (thanks @debrajr) Include the Userspace I/O driver (device drivers) in kernel settings (petalinux-config -c kernel) and not as Module i.e. set it as <*> not <M>

 

- (also thanks @debrajr

open : project-spec/meta-user/conf/layer.conf

make below change from 4 to 7

BBFILE_PRIORITY_meta-user = "7"

 

- I am appending the following to <plnx_proj_root>/project-spec/meta-user/recipes-dt/device-tree/files/system-top.dts

&axi_gpio_0 {
   compatible = "generic-uio";
};

&myadder_0 {
   compatible = "generic-uio";
};

Again, note how my 2 cores are no longer defined inside &amba_pl.. In fact, the above file no longer has &amba_pl (not sure if there's any downside to that though ..)

0 Kudos
6 Replies
Scholar rfs613
Scholar
5,700 Views
Registered: ‎05-28-2013

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

This issue comes up fairly often on this forum. The problem is the "compatible" property. In older versions of the Xilinx Linux kernel, using "generic-uio" worked fine. But later they synched up with the upstream kernel, which no longer has a "compatible" property in the driver. So regardless what you put in the device tree, it will not match -- resulting in no /dev/uio -- exactly the behaviour you are describing.

 

There are two possible ways to fix it: the "official" answer is that you should pass a "compatible" string to the driver when it is loaded via modprobe. For this to work, the driver must include MODULE_PARAM to allow setting a compatible name. Unfortunately this was absent in the Xilinx linux kernel last time I checked. It can of course be added quite easily by modifying the uio driver source.

 

Of course, that brings us to the other method: in the uio driver source, just put back the "generic-uio" compatible string. This is a simple one-line change, if you need more details on it, I posted a link to the relevant git commit just few weeks ago on this forum.

 

In any case, the actual "compatible" string value can be anything you want. It is just a matter of making the driver match up with what is in the device tree.

Moderator
Moderator
5,514 Views
Registered: ‎04-17-2011

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

Try by including the Userspace I/O driver (device drivers) in kernel settings (petalinux-config -c kernel) and not as Module i.e. set it as <*> not <M>. If you do that ensure that you use another settings to avoid it getting over-written (this is a known issue and would get fixed in next release)

 

open : project-spec/meta-user/conf/layer.conf

make below change from 4 to 7

BBFILE_PRIORITY_meta-user = "7"

Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
Visitor ram32xtr
Visitor
5,455 Views
Registered: ‎06-05-2013

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

First off, @rfs613 , thanks for your input. I didn't try to verify your solution, which is why i didn't accept it - though it could certainly be a plausible solution.

 

That said, it looks like @debrajr 's approach is easier to achieve.

 

To that end, @debrajr, I am still unable to replicate locally with my own design.

 

I should note that I am now using a ZCU102 board, and that I now have 2 cores connected to the ARM:

- An AXI GPIO connected to dip switches and LEDs.

- A simple adder which mostly follows from the generated template.

 

Here's a screenshot of the block diagram (note that I tested the design in standalone).

block diagram

 

 

 

Screenshot of petalinux-config -c kernel

kernel config

 

 

I did modify layer.conf as you recommend.

Finally, here's an excerpt of the dts:

&amba_pl {
	#address-cells = <0x2>;
	#size-cells = <0x2>;
	compatible = "simple-bus";
	ranges;

	gpio@80000000 {
		#gpio-cells = <0x2>;
		compatible = "generic-uio";
		gpio-controller;
		reg = <0x0 0x80000000 0x0 0x10000>;
		xlnx,all-inputs = <0x0>;
		xlnx,all-inputs-2 = <0x1>;
		xlnx,all-outputs = <0x1>;
		xlnx,all-outputs-2 = <0x0>;
		xlnx,dout-default = <0x0>;
		xlnx,dout-default-2 = <0x0>;
		xlnx,gpio-width = <0x8>;
		xlnx,gpio2-width = <0x8>;
		xlnx,interrupt-present = <0x0>;
		xlnx,is-dual = <0x1>;
		xlnx,tri-default = <0xffffffff>;
		xlnx,tri-default-2 = <0xffffffff>;
	};

	myadder@80010000 {
		compatible = "xlnx,myadder-1.0";
		reg = <0x0 0x80010000 0x0 0x10000>;
		xlnx,s00-axi-addr-width = <0x4>;
		xlnx,s00-axi-data-width = <0x20>;
	};
};

 

 

Please advise.

 

0 Kudos
Visitor ram32xtr
Visitor
9,992 Views
Registered: ‎06-05-2013

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

Finally got it to work, based on @debrajr 's suggestion, but with a minor caveat: my ip cores are now at the top level of the system-top.dts (i.e. not within the amba_pl node).

 

I'll mark this solution as accepted since it summarizes the required steps. That said, what is listed here is mostly based on @debrajr 's suggestions.

 

Here's a full summary of the solution (combining other responses)

- (thanks @debrajr) Include the Userspace I/O driver (device drivers) in kernel settings (petalinux-config -c kernel) and not as Module i.e. set it as <*> not <M>

 

- (also thanks @debrajr

open : project-spec/meta-user/conf/layer.conf

make below change from 4 to 7

BBFILE_PRIORITY_meta-user = "7"

 

- I am appending the following to <plnx_proj_root>/project-spec/meta-user/recipes-dt/device-tree/files/system-top.dts

&axi_gpio_0 {
   compatible = "generic-uio";
};

&myadder_0 {
   compatible = "generic-uio";
};

Again, note how my 2 cores are no longer defined inside &amba_pl.. In fact, the above file no longer has &amba_pl (not sure if there's any downside to that though ..)

0 Kudos
Observer ece_moh
Observer
5,210 Views
Registered: ‎09-08-2016

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

Hi all,

I want to use uio in Petalinux 2016.4 and I have followed this post but still uio directory empty.

 

Please could u upload any example!

 

Regard

Mohammed

0 Kudos
Observer ece_moh
Observer
5,178 Views
Registered: ‎09-08-2016

Re: No UIO file(s) created for my custom pl core (Petalinux 2016.4)

Jump to solution

Hi all 

I figure out my problem, just added to system-top.dts these line

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

 

0 Kudos