This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3352: Error using GPIO0_2, GPIO0_3, GPIO0_4 and GPIO0_5 (previously used as SPI0)

Part Number: AM3352

Tool/software: Linux

Hello everyone,

I have a custom board using AM3352 processor and I´m facing a problem while trying to use GPIO0_2, GPIO0_3, GPIO0_4 and GPIO0_5 as regular GPIO pins. GPI0_6 and GPIO0_7 from GPIO0 bank are perfectly working!

Previously I´ve used these and other pins as SPI port to connect my board to a SPI TFT Display. So, my "hardware connection" is tested (at least I believe so).

I´m using TI SDK 03.03.00.04, with Linux 4.4.31. My device tree is based on am335x-evm.dts (with a few modifications). I´ve already tried to disable SPI on Kernel and Device Tree (thinking that these ports are allocated to SPI), with no success. I can´t change pin state from GPIO-3 and GPIO-5 (programmed as output) or read something different from ZERO on GPIO-2 and GPIO-4. I still believe that these ports are being used by Linux to other pourpose, but I don´t how to check or change it.

Here a few debug information:

~ # cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/44e07000.gpio, gpio:
 gpio-2   (                    |sysfs               ) in  lo
 gpio-3   (                    |sysfs               ) out lo
 gpio-4   (                    |sysfs               ) in  lo
 gpio-5   (                    |sysfs               ) out lo
 gpio-6   (                    |sysfs               ) out hi
 gpio-7   (                    |sysfs               ) out lo
~ #  cat /lib/modules/$(uname -r)/modules.builtin | grep spi
~ #

*****************************************************************************************************************************
Some information from my DEVICE TREE:

        gpio_0_pins: gpio_0_pins {
                pinctrl-single,pins = <
                        0x150 ( PIN_INPUT  | MUX_MODE7 ) /* (A17) spi0_sclk.gpio0[2] */
                        0x154 ( PIN_OUTPUT | MUX_MODE7 ) /* (B17) spi0_d0.gpio0[3] */
                        0x158 ( PIN_INPUT  | MUX_MODE7 ) /* (B16) spi0_d1.gpio0[4] */
                        0x15c ( PIN_OUTPUT | MUX_MODE7 ) /* (A16) spi0_cs0.gpio0[5] */
                        0x160 ( PIN_INPUT  | MUX_MODE7 ) /* (C15) spi0_cs1.gpio0[6] */
                        0x164 ( PIN_INPUT  | MUX_MODE7 ) /* (C18) eCAP0_in_PWM0_out.gpio0[7] */
                        /*0x1b0 ( PIN_INPUT | MUX_MODE7 )*/ /* (A15) xdma_event_intr0.gpio0[19] */
                        /*0x1b4 ( PIN_INPUT | MUX_MODE7 )*/ /* (D14) xdma_event_intr1.gpio0[20] */
                >;
        };

&spi0 {
status = "disabled";
};

Does anyone have any ideia? I´m stucked on this issue over a week...

Thanks!

Fernando Pina