Accessing GPIO in imx6

Moderators: Oren.R, Eran.M

touchdown
Posts: 2
Joined: Sun Apr 30, 2017 6:18 am

Accessing GPIO in imx6

Postby touchdown » Thu May 11, 2017 1:49 pm

I want to change value of GPIO1_25 (phy_reset)

but following error comes

root@var-som-mx6:~# echo 25 > /sys/class/gpio/export
-sh: echo: write error: Device or resource busy

What should i do to change the value of phy reset pin



Following is current status

root@var-som-mx6:~# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/209c000.gpio, 209c000.gpio:
gpio-6 (cd ) in lo
gpio-25 (phy-reset ) out lo
gpio-28 (usb_h1_vbus ) out lo

GPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio:

GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio:

GPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio:
gpio-101 (tlv320aic3x reset ) out lo
gpio-111 (usb_otg_vbus ) out lo
gpio-121 (Menu ) in hi
gpio-122 (Back ) in hi

GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio:
gpio-139 (Home ) in hi

GPIOs 160-191, platform/20b0000.gpio, 20b0000.gpio:
gpio-178 (sysfs ) out lo

GPIOs 192-223, platform/20b4000.gpio, 20b4000.gpio:
gpio-200 (wlan-en-regulator ) out lo





Thanks and Regards

Eran.M
Posts: 140
Joined: Tue Jan 26, 2016 10:49 am

Re: Accessing GPIO in imx6

Postby Eran.M » Thu May 11, 2017 2:38 pm

Hi.
This gpio is taken by the fec driver, so you can't export it.
What are you trying to do exactly?

If for some reason you want to control it manually instead of letting the driver do it, you should change the fec's phy-reset-gpios value in your device tree (imx6qdl-var-dart.dtsi, if you are using the dart-mx6).

Regards,
Eran

touchdown
Posts: 2
Joined: Sun Apr 30, 2017 6:18 am

Re: Accessing GPIO in imx6

Postby touchdown » Fri May 12, 2017 4:56 am

I want to give a active low pulse,we are using vitesse vsc8502 phy ,but i think system is using generic fec phy,
1>What should i change in imx6qdl-var-dart.dtsi file to have a active low pulse
following piece of code i found from the file for GPIO1[ 25 ] in imx6qdl-var-dart.dtsi file
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet_4>;
phy-mode = "rgmii";
phy-reset-gpios = <&gpio1 25 0>;
fsl,magic-packet;
status = "okay";
};
2> Or how to use vitesse phy instead of fec generic driver

I have changed 0 to 1 in the line and build the kernel
phy-reset-gpios = <&gpio1 25 1>

but still if i run command it shows low
cat /sys/kernel/debug/gpio

gpio-25 (phy-reset ) out lo
Regards
Sameer


Return to “Yocto”

Who is online

Users browsing this forum: No registered users and 1 guest

cron