Hi,
In our application is desired to have GPIO1 and GPIO2 [from Ixora POV] configured as inputs with pull-downs.
So my steps were:
- Find out which pins are are the ones that need configuration on apalis and ixora datasheet and git.
device-trees/imx8-apalis-v1.1.dtsi at toradex_5.4-2.1.x-imx · toradex/device-trees · GitHub
GPIO1 - GPIO_MXM3_1 - pin 1 - 0.8 - gpio488 - IMX8QM_M40_GPIO0_00_LSIO_GPIO0_IO08
GPIO2 - GPIO_MXM3_3 - pin 3 - 0.9 - gpio489 - IMX8QM_M40_GPIO0_01_LSIO_GPIO0_IO09
/* Apalis GPIO1 */
pinctrl_gpio1: gpio1grp {
fsl,pins = <
IMX8QM_M40_GPIO0_00_LSIO_GPIO0_IO08 0x06000021
>;
};
/* Apalis GPIO2 */
pinctrl_gpio2: gpio2grp {
fsl,pins = <
IMX8QM_M40_GPIO0_01_LSIO_GPIO0_IO09 0x06000021
>;
};
-
Usage of following link in confrontation with apalis and ixora datasheet to find out which pins do I need to modify and in which mode I want them to operate.
pads-imx8qxp.h - include/dt-bindings/pinctrl/pads-imx8qxp.h - Linux source code (v6.0.9) - Bootlin -
In order to figure out what pinCONFIG hex value I need to use in Device Tree I downloaded tool from NXP Config Tools for i.MX v9
-
So resulting Device Tree looked like this.
gpio1grp { fsl,pins = <0x09 0x03 0x6000041>; phandle = <0x17f>; }; gpio2grp { fsl,pins = <0x0a 0x03 0x6000041>; phandle = <0x180>; };
/* Here are pins for IXORA GPIO1-0x09 a GPIO2-0x0a /
/ Format: fsl,pins = ; /
/ Configured as pull-up in/out low-drive 0x06000021 /
/ Possible: pull-down in/out low-drive 0x06000041 */ -
This was also verified from linux after boot-up /proc/device-tree/scu/pinctrl/apalis-imx8qm/gpio1grp/
Values matched expected.
But for some reason gpios 0 8 (gpio1) and 0 9 (gpio2) still act like if there is pull-up configured… using gpiod or sysfs approach showed same results while configured as input. Both have high state. Also in U-boot is visible that gpio line is configured as input but its state is 1 (high).
Using external pull-downs (3k9) helped but why is this not possible from SW?