gpio sysfs for imx6ull

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

gpio sysfs for imx6ull

跳至解决方案
1,140 次查看
wu_jin_liang
Contributor I

hi, everybody!

we designed a board base on imx6ull14x14evk, but we only need one ethnet, so we do as below

&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet1>;
phy-mode = "rmii";
phy-handle = <&ethphy0>;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <2>;
micrel,led-mode = <1>;
clocks = <&clks IMX6UL_CLK_ENET_REF>;
clock-names = "rmii-ref";
};
};
};

/*
&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2>;
phy-mode = "rmii";
phy-handle = <&ethphy1>;
/*status = "okay";*/
status = "disabled";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <2>;
micrel,led-mode = <1>;
clocks = <&clks IMX6UL_CLK_ENET_REF>;
clock-names = "rmii-ref";
};

ethphy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
micrel,led-mode = <1>;
clocks = <&clks IMX6UL_CLK_ENET2_REF>;
clock-names = "rmii-ref";
};
};
};
*/

..........


pinctrl_enet1: enet1grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO07__ENET1_MDC 0x1b0b0
MX6UL_PAD_GPIO1_IO06__ENET1_MDIO 0x1b0b0

MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0
MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0
MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031
>;
};

/*
pinctrl_enet2: enet2grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0
/* MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031 */

>;
};
*/

and I alse remove fec2 in uboot.

after  we need to use the pin MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 as MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14

so we  operate it as bellow

echo 46 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio46/direction
echo 1 > /sys/class/gpio/gpio46/value
cat /sys/class/gpio/gpio46/value
i get 1,
 
it seems everything is fine,
but the pin output is always low(I am sure it is not short circuit to GND),
why this happened! could everyone please tell me

 

0 项奖励
回复
1 解答
1,136 次查看
igorpadykov
NXP Employee
NXP Employee

Hi wu_jin_liang

 

one can try to add in dts gpio configs, like in example below :

imx6ul-14x14-evk.dts
pinctrl_hog_1: hoggrp-1 {
fsl,pins = < MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059

https://community.nxp.com/t5/i-MX-Processors/Simple-GPIO-Example-quandry/m-p/458731

 

Best regards
igor

在原帖中查看解决方案

2 回复数
1,137 次查看
igorpadykov
NXP Employee
NXP Employee

Hi wu_jin_liang

 

one can try to add in dts gpio configs, like in example below :

imx6ul-14x14-evk.dts
pinctrl_hog_1: hoggrp-1 {
fsl,pins = < MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059

https://community.nxp.com/t5/i-MX-Processors/Simple-GPIO-Example-quandry/m-p/458731

 

Best regards
igor

1,125 次查看
wu_jin_liang
Contributor I

thank you very much, sir!

0 项奖励
回复