Dear NXP
I’m developing with Digi connectCore 8X SBC Pro(NXP i.MX8QuadXPlus).
I’d like to set the mode and direction of GPIO0_IO05, but I failed.
Would you please tell me how to set up GPIO.
The following is how I set up GPIO in device tree.
1) Find the i.MX 8x pad name for GPIO0_IO05
I could find the pad name through the manual web site.
https://www.digi.com/resources/documentation/digidocs/PDFs/90002295.pdf
I found that ESAI0_TX1, the pad name what I found, is related to Ethernet.
Also, I found these macros related to ESAI0_TX1.
SC_P_ENET0_RGMII_RXD3_CONN_ENET0_RGMII_RXD3
SC_P_ESAI0_TX1_CONN_ENET1_RGMII_RXD3
2) Device tree Settings for GPIO pads
I did device tree setting for GPIO pads by referring below website.
https://github.com/FrankBau/meta-marsboard-bsp/wiki/iMX6-Pad-Mux-and-Pad-Control
The following is device tree setting by referring to the website.
/* IOMUX */
&iomuxc {
pinctrl-names = "default", "default";
pinctrl-0 = <&pinctrl_expansion>;
pinctrl-1 = <&pinctrl_hog>;
/* Expansion Connector */
pinctrl_expansion: expansiongrp {
fsl,pins = <
. . .
pinctrl_hog: hoggrp {
fsl,pins = <
/* (1<<3): output drive strength of 150 Ohm at 3.3V */
SC_P_ENET0_RGMII_RXD3_CONN_ENET0_RGMII_RXD3 8
SC_P_ESAI0_TX1_CONN_ENET1_RGMII_RXD3 8
>;
};
};
3) Check the GPIO status on sysfs
The following is an output of GPIO status from sysfs after kernel boot.
But, GPIO0_IO05 which kernel number is 485 was not found in the GPIO status list for sysfs.
The Linux GPIO number of GPIO0_IO05 is 485.
The Linux GPIO number can be calculated through the formular.
https://www.digi.com/resources/documentation/digidocs/embedded/android/pie/cc8x/bsp_r_gpio_8x
N = 480 – (32 * <port_index>) + pin
ccimx8xsbcpro:/ # cat /sys/kernel/debug/gpio
gpiochip9: GPIOs 204-223, parent: platform/mca-cc8x-gpio, mca-gpio, can sleep:
gpio-210 ( |ADC ) in lo
gpio-211 ( |ADC ) in lo
gpiochip8: GPIOs 224-255, parent: platform/58222000.gpio, 58222000.gpio:
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:
gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-352 ( |PCIe reset ) out hi
gpio-353 ( |PCIe CLKREQ ) out lo
gpio-357 ( |3v3_usb_sw ) out hi
gpio-374 ( |cd ) in hi IRQ
gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpio-393 ( |mca-fw-update ) out lo
gpio-394 ( |BT power enable ) out hi
gpio-395 ( |PCIe DIS ) out hi
gpio-396 ( |epdev_on ) out hi
gpio-397 ( |3v3_eth0 ) out lo
gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-493 ( |5v_display ) out lo
gpio-494 ( |3v3_audio ) out lo
gpio-495 ( |3v3_usb_hub ) out hi
gpio-511 ( |vcc ) out hi