Using a LPSR GPIO Pad as a GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using a LPSR GPIO Pad as a GPIO

Jump to solution
1,883 Views
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

Labels (3)
0 Kudos
Reply
1 Solution
1,454 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
2 Replies
1,455 Views
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 Kudos
Reply
1,454 Views
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 Kudos
Reply