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: 
Adventurer
Adventurer
15,701 Views
Registered: ‎02-12-2015

UIO: Device Tree confusion, no UIO created

Jump to solution

Hello,

 

I am trying to create a UIO solution for data transfer with the PL. I am using petalinux SDK 2016.2

 

My initial design is a simple PL (a custom axi_perpiheral) that I can write to and read from via the PS (this works in bare metal).

 

I managed to get a working app in petalinux using mmp /dev/mem, just hardcoding the peripheral's base address and then writing to the desired register. As my goal is for dma transfer from the PL, I want to try and perform the simple read / write via UIO. So, 

 

I have enabled Userspace IO  platform driver with generic IRQ handling in the kernel config, and ran petalinux-config --get-hw-description targetted at my hdf file.

 

When I look at the device tree files however, pl.dtsi is empty. Is this right?? Do I need to change this? 

 

I have changed the system-conf.dtsi so the bootargs line reads:

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

 

My system-top.dts contains:

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
          uio_axi_ps_ready@43C00000 {
              compatible = "generic-uio";
              reg = < 0x43C00000 0x1000 >;
              interrupts = < 0 57 0 >;
              interrupt-parent = <&intc>;
          };
};

 

Where 0x43C00000 is the base address of my axi peripheral.

 

I then build the kernel and package the boot image, but when I boot on my device (zynq) I do not see any UIO listed with modprobe -l

 

Any help I'd be very grateful

 

- Marc

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
23,048 Views
Registered: ‎09-12-2007

Re: UIO: Device Tree confusion, no UIO created

Jump to solution
As the commenter stated earlier. The user space io drivers are set as modules. So, this is why you aren't seeing this.

Go to petalinux-config -c kernel
Device drivers
User space io drivers
<*> userspace io platform driver ..


View solution in original post

8 Replies
Explorer
Explorer
15,685 Views
Registered: ‎11-22-2015

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

Did you change the UIO driver to be a module?  In other releases it was built in.

 

Jeff

0 Kudos
Adventurer
Adventurer
15,679 Views
Registered: ‎02-12-2015

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

To be honest, I don't really know what I've created...! At least not how to describe it...

 

Doing some more digging, I do find my (device?) if I run:

 

cat /sys/class/uio/uio0/name

 

 Anyway, I have an app which basically opens /dev/uio0, then mmap and then I write and read reg values using the pointer. It seems to work ok now (after a couple of issues with MAP_SIZE)

 

Now onto dma...!

0 Kudos
Explorer
Explorer
15,670 Views
Registered: ‎11-22-2015

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

As long as your device tree is correct you can read in the size instead of needed IMG to know it.  I open this path and read in the value

sprintf(uio_size_path, "/sys/class/uio/uio%d/maps/map0/size", uio_num);

 

Jeff 

0 Kudos
Mentor watari
Mentor
15,608 Views
Registered: ‎06-16-2013

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

Hi marc.pearson

 

Could you execute the following command on your linux ?

 

% ls /proc/device-tree/amba_pl

 

Thank you.

Best regards,

 

0 Kudos
13,688 Views
Registered: ‎09-28-2016

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

I am having the same problem. No uio device is available in /dev

Using bootargs = "earlycon=cdns,mmio,0xFF000000,115200n8,uio_pdrv_genirq.of_id=generic-uio";

 

ls /proc/device-tree/amba_pl outputs the following:
#address-cells     dma@000400000000   gpio@000400020000  name
#size-cells        dma@000400030000   gpio@000400040000  ranges
compatible         gpio@000400010000  gpio@000400050000

 

My pl.dtsi:

/ {
    amba_pl: amba_pl {
        #address-cells = <2>;
        #size-cells = <2>;
        compatible = "simple-bus";
        ranges ;
        axi_dma_receive: dma@000400000000 {
            #dma-cells = <1>;
            compatible = "xlnx,axi-dma-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = <0 92 4>;
            reg = <0x00000004 0x00000000 0x0 0x10000>;
            dma-channel@400000030 {
                compatible = "xlnx,axi-dma-s2mm-channel";
                dma-channels = <0x1>;
                interrupts = <0 92 4>;
                xlnx,datawidth = <0x20>;
                xlnx,device-id = <0x0>;
            };
        };
        axi_dma_transmit: dma@000400030000 {
            #dma-cells = <1>;
            compatible = "xlnx,axi-dma-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = <0 91 4>;
            reg = <0x00000004 0x00030000 0x0 0x10000>;
            dma-channel@000400030000 {
                compatible = "xlnx,axi-dma-mm2s-channel";
                dma-channels = <0x1>;
                interrupts = <0 91 4>;
                xlnx,datawidth = <0x20>;
                xlnx,device-id = <0x1>;
            };
        };
        axi_gpio_int: gpio@000400020000 {
            #gpio-cells = <2>;
            #interrupt-cells = <2>;
            compatible = "generic-uio";
            gpio-controller ;
            interrupt-controller ;
            interrupt-parent = <&gic>;
            interrupts = <0 89 4>;
            reg = <0x00000004 0x00020000 0x0 0x10000>;
            xlnx,all-inputs = <0x1>;
            xlnx,all-inputs-2 = <0x0>;
            xlnx,all-outputs = <0x0>;
            xlnx,all-outputs-2 = <0x0>;
            xlnx,dout-default = <0x00000000>;
            xlnx,dout-default-2 = <0x00000000>;
            xlnx,gpio-width = <0x1>;
            xlnx,gpio2-width = <0x20>;
            xlnx,interrupt-present = <0x1>;
            xlnx,is-dual = <0x0>;
            xlnx,tri-default = <0xFFFFFFFF>;
            xlnx,tri-default-2 = <0xFFFFFFFF>;
        };
        axi_gpio_rst_clr: gpio@000400010000 {
            #gpio-cells = <2>;
            compatible = "generic-uio";
            gpio-controller ;
            reg = <0x00000004 0x00010000 0x0 0x10000>;
            xlnx,all-inputs = <0x0>;
            xlnx,all-inputs-2 = <0x0>;
            xlnx,all-outputs = <0x1>;
            xlnx,all-outputs-2 = <0x0>;
            xlnx,dout-default = <0x00000000>;
            xlnx,dout-default-2 = <0x00000000>;
            xlnx,gpio-width = <0x2>;
            xlnx,gpio2-width = <0x20>;
            xlnx,interrupt-present = <0x0>;
            xlnx,is-dual = <0x0>;
            xlnx,tri-default = <0xFFFFFFFF>;
            xlnx,tri-default-2 = <0xFFFFFFFF>;
        };
        axi_gpio_rx_tx_data_count: gpio@000400040000 {
            #gpio-cells = <2>;
            compatible = "generic-uio";
            gpio-controller ;
            reg = <0x00000004 0x00040000 0x0 0x10000>;
            xlnx,all-inputs = <0x1>;
            xlnx,all-inputs-2 = <0x1>;
            xlnx,all-outputs = <0x0>;
            xlnx,all-outputs-2 = <0x0>;
            xlnx,dout-default = <0x00000000>;
            xlnx,dout-default-2 = <0x00000000>;
            xlnx,gpio-width = <0x20>;
            xlnx,gpio2-width = <0x20>;
            xlnx,interrupt-present = <0x0>;
            xlnx,is-dual = <0x1>;
            xlnx,tri-default = <0xFFFFFFFF>;
            xlnx,tri-default-2 = <0xFFFFFFFF>;
        };
        watchdog_gpio_irq: gpio@000400050000 {
            #gpio-cells = <2>;
            #interrupt-cells = <2>;
            compatible = "generic-uio";
            gpio-controller ;
            interrupt-controller ;
            interrupt-parent = <&gic>;
            interrupts = <0 90 4>;
            reg = <0x00000004 0x00050000 0x0 0x10000>;
            xlnx,all-inputs = <0x1>;
            xlnx,all-inputs-2 = <0x0>;
            xlnx,all-outputs = <0x0>;
            xlnx,all-outputs-2 = <0x0>;
            xlnx,dout-default = <0x00000000>;
            xlnx,dout-default-2 = <0x00000000>;
            xlnx,gpio-width = <0x2>;
            xlnx,gpio2-width = <0x20>;
            xlnx,interrupt-present = <0x1>;
            xlnx,is-dual = <0x0>;
            xlnx,tri-default = <0xFFFFFFFF>;
            xlnx,tri-default-2 = <0xFFFFFFFF>;
        };
    };
};

 

uio driver support is also activated in the petalinux config

0 Kudos
Moderator
Moderator
23,049 Views
Registered: ‎09-12-2007

Re: UIO: Device Tree confusion, no UIO created

Jump to solution
As the commenter stated earlier. The user space io drivers are set as modules. So, this is why you aren't seeing this.

Go to petalinux-config -c kernel
Device drivers
User space io drivers
<*> userspace io platform driver ..


View solution in original post

Adventurer
Adventurer
10,654 Views
Registered: ‎07-08-2016

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

@stephenm do you happen to know if there is a way to do this when using the standard yocto build flow, rather than with petalinux? I'd like to enable UIO in my design, but don't have the liberty of using the menuconfig gui.

0 Kudos
Moderator
Moderator
5,589 Views
Registered: ‎09-12-2007

Re: UIO: Device Tree confusion, no UIO created

Jump to solution

you can create a recipe (recipes-kernel\linux\linux-xlnx)

Then a bsp.cfg file here, and add the config here

 

Then in recipes-kernel\linux\linux-xlnx_%.bbappend

 

SRC_URI += "file://bsp.cfg"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

0 Kudos