AnsweredAssumed Answered

DTS tree changes to access GPIO from linux on IMX6SL-EVK Board

Question asked by dee jay on Aug 30, 2015
Latest reply on Aug 31, 2015 by dee jay

Hi all,


My problem exactly matches this discussion which doesn't seem to come to a resolution. Additionally, there are other discussions that get started, but never seems to find a resolution. If I manage to solve the issue, I'll post the solution here as well so that others will a tleast have something to go on.


I'm working on a IMX6SL-EVK board where I want to control a gpio pin from within linux. Currently, as a test platform I'm trying to control the LED that's connection to GPIO3:20 but haven't had much luck.


I'm running the kernel (Linux version 3.10.53) that is shipped with android KK by freescale.


The following is what I tried to perform the IO operation:


1. SYSFS GPIO access is enabled in the kernel

2. Modified iomux section in arch/arm/boot/dts/imx6sl-evk-common.dtsi to include the GPIO line in question as follows (see line 14)

&iomuxc {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&pinctrl_hog>;
        pinctrl-1 = <&pinctrl_hog_sleep>;

        hog {
                pinctrl_hog: hoggrp {
                        fsl,pins = <
                                MX6SL_PAD_KEY_ROW7__GPIO4_IO07    0x17059
                                MX6SL_PAD_KEY_COL7__GPIO4_IO06    0x17059
                                MX6SL_PAD_SD2_DAT7__GPIO5_IO00    0x17059
                                MX6SL_PAD_SD2_DAT6__GPIO4_IO29    0x17059
                                MX6SL_PAD_HSIC_STROBE__GPIO3_IO20 0xc7030
                                MX6SL_PAD_REF_CLK_32K__GPIO3_IO22 0x17059
                                MX6SL_PAD_FEC_TX_CLK__GPIO4_IO21  0x80000000


3. Issued the following commands from within linux to control the GPIOs


echo 84>/sys/class/gpio/export
echo out>/sys/class/gpio/gpio84/direction
echo -n 0x01>/sys/class/gpio/gpio84/value


I know the above command tries to access the GPIO port because, I've added some printk messages and see the results in the kernel log (this is issued from within static void bgpio_write32(void __iomem *reg, unsigned long data) in drivers/gpio/gpio-generic.c)


drivers/gpio/gpio-generic.c:87 a0828000=40f000
drivers/gpio/gpio-generic.c:87 a0828004=100000


However, the GPIO line itself doesn't change state.


I feel, I'm missing something in my dts configuration, but can't figure it out.


Thanks in advance.