Using a LPSR GPIO Pad as a GPIO

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

Using a LPSR GPIO Pad as a GPIO

跳至解决方案
1,601 次查看
jamesburnworth
Contributor II

Hi,

I'm trying to configure the imx7 pad GPIO1_IO01 as a GPIO.  We have a custom base board for the iMX7D and have other, non-lpsr, GPIO working ( I can toggle them and read their values from /sys/class/gpio).  Here's a snippet from my device tree where I try to configure GPIO1_IO01 as a GPIO input with no pull and normal drive strength, no hysteresis, and fast slew. 

&iomuxc_lpsr {
      pinctrl-names = "default";
      pinctrl-0 = <&pinctrl_gpio_lpsr>;

      epilog-cs-overboard {

            pinctrl_gpio_lpsr: gpiogrp-lpsr {
                  fsl,pins = <
                        MX7D_PAD_GPIO1_IO01__GPIO1_IO1       0x00
                  >;
            };
      };
};

When I read the value in /sys/class/gpio/gpio1 I always read 0 whether I pull it to ground or +3.3 V.  Do I need to do anything different for a LPSR pad in the device tree? 

Also, in other device trees I've seen lines like this for lpsr pads:

MX7D_PAD_GPIO1_IO07__I2C2_SDA 0x4000000f

What does the 0x4000000f do?  I thought the last value was only for pad control and could thus at most be 0x7f.

Thank you for the time.

James

标签 (3)
0 项奖励
1 解答
1,172 次查看
igorpadykov
NXP Employee
NXP Employee

Hi James

0x40000000 is SION bit described in linux/Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt

also one can check imx7d-pinctrl.txt:

linux-imx.git - i.MX Linux Kernel 
http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/Documentation/devicetree/bindings/pinct...

in imx7d-sdb.dts that pad used as : MX7D_PAD_GPIO1_IO01__PWM1_OUT
http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/arch/arm/boot/dts/imx7d-sdb.dts?h=imx_4...

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
2 回复数
1,173 次查看
igorpadykov
NXP Employee
NXP Employee

Hi James

0x40000000 is SION bit described in linux/Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt

also one can check imx7d-pinctrl.txt:

linux-imx.git - i.MX Linux Kernel 
http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/Documentation/devicetree/bindings/pinct...

in imx7d-sdb.dts that pad used as : MX7D_PAD_GPIO1_IO01__PWM1_OUT
http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/arch/arm/boot/dts/imx7d-sdb.dts?h=imx_4...

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
1,172 次查看
jamesburnworth
Contributor II

Hello Igor,

Thank you for pointing me to some documentation.  That was helpful to see that for last integer, CONFIG:

  • NO_PAD_CTL(1 << 31): indicate this pin does not need config
  • SION(1 << 30): Software Input On FieldSION(1 << 30): Software Input On Field

So it looks like my configuration is correct and now I know more about configuring iomux pads.  Looking more at the documentation for our SoM I also learned that that pad isn't available with our current configuration.  Thanks for the help.

Best,

James

0 项奖励