Hi,
I'm working on the Digi ConnectCore6 SBC and trying to set some GPIOs to the different state from the default setting defined in Digi Embedded Yocto (DEY). ConnectCore6 has i.mx6 quad and DEY's version is yocto2.2/linux4.1. As I booted up the SBC and confirmed the state of GPIO198 on the /sys/kernel/debug with serial console, it showed below,
root@ccimx6sbc:/sys/kernel/debug# cat gpio
GPIOs 0-31, platform/209c000.gpio, 209c000.gpio:
gpio-2 (can_stby ) out lo
gpio-5 (can_stby ) out lo
gpio-25 (phy-reset ) out lo
GPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio:
gpio-34 (sysfs ) in lo
gpio-35 (sysfs ) in hi
gpio-36 (sysfs ) in hi
gpio-57 (aud_pwr_en ) out lo
gpio-58 (uart-pwr-en-gpio ) out lo
gpio-62 (spi_imx ) out lo
GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio:
GPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio:
gpio-106 (spi_imx ) in lo
GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio:
GPIOs 160-191, platform/20b0000.gpio, 20b0000.gpio:
gpio-171 (? ) out lo
GPIOs 192-223, platform/20b4000.gpio, 20b4000.gpio:
gpio-198 (sysfs ) out lo
GPIOs 240-255, da9063-gpio, can sleep:
gpio-247 (gpio-ext-reg ) out hi
And when I measured the voltage of the corresponding pin (connected to open header), it was 3.3V. So the setting is guessed as "out high". I'd like to set the GPIO198 to "input" durning the booting sequence of Yocto OS (like the initializing sequence of MCU). What kind of source flies should I modify and how should I modify it with the above settings before OS build?
I've already researched and tested about how to change the pinmux by modifying the .dtsi file before OS build, and how to manipulate the GPIOs with /sys/class/gpio APIs after OS boot. But I've not found the solution to modify the GPIO setting in the OS sources.
Any help is appreciated.
Best reards,
Hi mocfur13
pins default state are described in Table 96 i.MX6DQ Datasheet
http://www.nxp.com/docs/en/data-sheet/IMX6DQCEC.pdf
gpio can be set in uboot:
u-boot/ccimx6.c at v2015.04/maint · digi-embedded/u-boot · GitHub
or linux
linux/mach-imx6q.c at v4.9/dey-2.4/maint · digi-embedded/linux · GitHub
gpio direction can not be set in dts file.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------