Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Linux/AM3356: unable to control gpio of am335x custom board using sysfs interface

$
0
0

Part Number:AM3356

Tool/software: Linux

One of our applications required gpmc_be1n to be used as gpio pin, initially the pinmux details reflected that the pin mode is set as 0x00000008 which means its not configured as gpio(MUX Mode 0x7). Hence, I modified the dts file to enable the pin as gpio in the pin mux. Having done this, pinmux details reflect our change i.e mode changed to 0x00000037. (cat pins (sys/kernel/debug/pinctrl/44e10878.pinmux))

I did the following:(using sysfs)

echo 60 > export

echo "out " > gpio60/direction

echo 0 > gpio60/value

but when probed the pin it was always in the high state. I could control other pins using the sysfs interface after the dts changes (gpio3_13, gpio3_20 etc whose default pinmux was set to 0x00000020 and with the modified dts it was 0x00000037 )

I was able to control the pin from Uboot using gpio commands as well. (here pinmux i modified using mw 0x44e10878 w 0x00000037)

And from the linux , I tried to use devmem2 to write the gpio register

devmem2  0x4804c134 w 0xEFFDFFFF

devmem2  0x4804c13C w 0x00000000

This made the pin to change the state to low on probing.

So can any one help me in finding out the issue with the sysfs interfaces on the pin? below is the dts modification i have made

am33xx_pinmux: pinmux@44e10800 {
        pinctrl-names = "default";

...

gpio1_pins: pinmux_gpio1_pins {
            pinctrl-single,pins = <
                0x78 (0x37)  /* gpio1_28,conf_gpmc_ben1*/
            >;
        };

gpio3_pins: pinmux_gpio3_pins { /*Added by SVR*/
                        pinctrl-single,pins = <
                                  0x1A8 (0x37)  /* gpio3_20,conf_mcasp0 */
                                0x234 (0x37) /* gpio3_13,conf_usb1_drvvbu */
                        >;
                };
...   

};

...

&gpio1 {
    pinctrl-names = "default";
    pinctrl-0 = <&gpio1_pins>;
    status = "okay";
};

&gpio3 {
        pinctrl-names = "default";
        pinctrl-0 = <&gpio3_pins>;
        status = "okay";
};


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>