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
4,317 Views
Registered: ‎05-01-2012

Zynq: Accessing MIO pins from ethernet driver in Linux

Jump to solution

In our design, I need to toggle MIO pin 34 in order to enable power to the ethernet PHY, but I don't know how to access this pin in the ethernet driver.  I can't assume that it will be set from userspace prior to loading the driver, it has to be part of the driver.  Anyone know how to do this?

 

In addition, I need to access a soft-core GPIO driver to toggle a GPIO pin to bring the PHY out of reset.  The GPIO driver is loaded earlier in the boot process, but how do I access it from another kernel driver?

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
5,597 Views
Registered: ‎03-13-2012

Re: Zynq: Accessing MIO pins from ethernet driver in Linux

Jump to solution

In general that should work. IIRC, the PS GPIOs start at 0. Other GPIO controllers start after those. E.g. the I2C GPIO expanders on zc702 follow after the PS ones starting at 118 if I'm not mistaken.

The same should apply for all other GPIO controllers. Finding the correct mapping between number and actual pin though turns usually out to be a little tricky.  I often ended up going through all available ones looking for the one that toggles it's value when I pull it high/low.

View solution in original post

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
4,314 Views
Registered: ‎03-13-2012

Re: Zynq: Accessing MIO pins from ethernet driver in Linux

Jump to solution
0 Kudos
Adventurer
Adventurer
4,312 Views
Registered: ‎05-01-2012

Re: Zynq: Accessing MIO pins from ethernet driver in Linux

Jump to solution
So you're saying that MIO pin 34 can be treated as GPIO pin 34? I can just call gpio_request(34) and then use it directly?

What about the additional soft-core GPIO controllers? Do those get added in to the pinctrl handling? We have 4 soft-core controllers. Do we have to specify something in the device tree to assign them to GPIO pin numbers?
0 Kudos
Xilinx Employee
Xilinx Employee
5,598 Views
Registered: ‎03-13-2012

Re: Zynq: Accessing MIO pins from ethernet driver in Linux

Jump to solution

In general that should work. IIRC, the PS GPIOs start at 0. Other GPIO controllers start after those. E.g. the I2C GPIO expanders on zc702 follow after the PS ones starting at 118 if I'm not mistaken.

The same should apply for all other GPIO controllers. Finding the correct mapping between number and actual pin though turns usually out to be a little tricky.  I often ended up going through all available ones looking for the one that toggles it's value when I pull it high/low.

View solution in original post

0 Kudos