cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
2,498 Views
Registered: ‎05-01-2017

petalinux 2016.2 gpio confusion

Jump to solution

Hi Xilinx,

 

Recently I migrated to Vivado / petalinux 2016.2. One simple test on GPIO is very confusing me. Below is vivado block diagram, just a GPIO with 2 outputs, while GPIO port 1 has one bit output, and GPIO port 2 auto-connecting to LED[7:0].

 

        axi_gpio_0: gpio@41200000 {
            #gpio-cells = <2>;
            compatible = "xlnx,xps-gpio-1.00.a";
            gpio-controller ;
            reg = <0x41200000 0x10000>;
            xlnx,all-inputs = <0x0>;
            xlnx,all-inputs-2 = <0x0>;
            xlnx,all-outputs = <0x1>;
            xlnx,all-outputs-2 = <0x1>;
            xlnx,dout-default = <0x00000000>;
            xlnx,dout-default-2 = <0x00000000>;
            xlnx,gpio-width = <0x1>;
            xlnx,gpio2-width = <0x8>;
            xlnx,interrupt-present = <0x0>;
            xlnx,is-dual = <0x1>;
            xlnx,tri-default = <0xFFFFFFFF>;
            xlnx,tri-default-2 = <0xFFFFFFFF>;
        };

 

# ls /sys/class/gpio/
    export gpiochip897 gpiochip906 unexport

# gpio-demo -g 897 -o  2 / 4 / 8 / 16 / 32 / 64 / 128 /256

    which lights each individual LED. However I expect input should be  1 / 2 / 4 / 8 / 16 / 32 / 64 / 128.

 

Please advise. Thanks in advance.

 

1.png

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Voyager
Voyager
4,351 Views
Registered: ‎06-24-2013

Re: petalinux 2016.2 gpio confusion

Jump to solution

Hey @exds75

 

I haven't found the source for gpio-demo but I presume that it will simply map the numbers to the respective GPIOs starting with the GPIO base.

 

Now the devicetree gpio declaration shows two ports with 1 and 8 bit (GPIOs) so a total of nine GPIOs, which is likely to map the first port to the first GPIO and the second port to the remaining eight GPIOs. So /1/ would end up on the gpio_pin instead of one of the LEDs.

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!

View solution in original post

0 Kudos
6 Replies
Highlighted
Explorer
Explorer
2,482 Views
Registered: ‎05-01-2017

Re: petalinux 2016.2 gpio confusion

Jump to solution

on zedboard with vivado / petalinux 2016.2

0 Kudos
Highlighted
Voyager
Voyager
4,352 Views
Registered: ‎06-24-2013

Re: petalinux 2016.2 gpio confusion

Jump to solution

Hey @exds75

 

I haven't found the source for gpio-demo but I presume that it will simply map the numbers to the respective GPIOs starting with the GPIO base.

 

Now the devicetree gpio declaration shows two ports with 1 and 8 bit (GPIOs) so a total of nine GPIOs, which is likely to map the first port to the first GPIO and the second port to the remaining eight GPIOs. So /1/ would end up on the gpio_pin instead of one of the LEDs.

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
2,417 Views
Registered: ‎05-01-2017

Re: petalinux 2016.2 gpio confusion

Jump to solution

I added another GPIO, and both GPIOs are setup as single port. Hope not wasting too much PL resource.

0 Kudos
Highlighted
Voyager
Voyager
2,409 Views
Registered: ‎06-24-2013

Re: petalinux 2016.2 gpio confusion

Jump to solution

Hey @exds75

 

Hope not wasting too much PL resource.

 

The largest part in your design is the AXI interface, so if you really want to reduce PL resource usage, you are better off connecting the LEDs directly to EMIO pins.

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Highlighted
Explorer
Explorer
2,389 Views
Registered: ‎05-01-2017

Re: petalinux 2016.2 gpio confusion

Jump to solution

Thanks for the suggestion. This is just a simple test. I will use multiple GPIOs as control signaling in a large project.

0 Kudos
Highlighted
Voyager
Voyager
2,345 Views
Registered: ‎06-24-2013

Re: petalinux 2016.2 gpio confusion

Jump to solution

You're welcome!

 

All the best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos