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.

TMDX654IDKEVM: GPIOs in Linux

Part Number: TMDX654IDKEVM
Other Parts Discussed in Thread: TDA4VM, SYSCONFIG

Hello,

I am using the TMDX654IDKEVM with the Linux SDK from TI. For an application I need a GPIO from the SoC as an interrupt.

For testing I was looking for a GPIO connected to a LED and trying to toggle the LED with gpioset. I tried the 8 GPIOs below, but the LEDs stayed of. Why?

Here is the command I tried:

gpioset gpiochip3 46=1

If I can't use these GPIOs are there any free left? It would be ok for me to solder them directly on the vias if required.

If the toggeling works, I would like to write a Linux Kernel Module and control the GPIO there. How do I find out the GPIO number needed for gpio_request(), e.g. what is the corresponding gpio number for gpio_request from gpiochip2_0?

Regards,

Johannes

  • Hi Johannes,

    ICSSG ethernet LEDs might need more configuration.

    If the intent is just to test GPIO toggling you can check:

    arch/arm64/boot/dts/ti/k3-am654-base-board.dts

    gpio-keys {
    compatible = "gpio-keys";
    autorepeat;
    pinctrl-names = "default";
    pinctrl-0 = <&push_button_pins_default>;

    sw5 {
    label = "GPIO Key USER1";
    linux,code = <BTN_0>;
    gpios = <&wkup_gpio0 24 GPIO_ACTIVE_LOW>;
    };

    sw6 {
    label = "GPIO Key USER2";
    linux,code = <BTN_1>;
    gpios = <&wkup_gpio0 27 GPIO_ACTIVE_LOW>;
    };
    };

    There are 2 push buttons on the IDK and they can generate interrupts as well.

    Also on the free GPIOs. Try the below from Linux command promt:

    echo 0 > /sys/class/gpio/export
    devmem 0x11c000 32 0x08050007
    echo out > /sys/class/gpio/gpio0/direction
    echo 1 > /sys/class/gpio/gpio0/value

    echo 2 > /sys/class/gpio/export
    devmem 0x11c008 32 0x08050007
    echo out > /sys/class/gpio/gpio2/direction
    echo 1 > /sys/class/gpio/gpio2/value

    echo 5 > /sys/class/gpio/export
    devmem 0x11c014 32 0x08050007
    echo out > /sys/class/gpio/gpio5/direction
    echo 1 > /sys/class/gpio/gpio5/value

    You need to ensure that Pin Mux is also rightly set.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    thanks for your fast and detailed feedback.

    But I have one remaining question: How do I find out to which Pin/Pad of the chip a GPIO is assigned to?

    Here is what I could by executing 'cat /sys/kernel/debug/gpio':

    root@am65xx-evm:~# cat /sys/kernel/debug/gpio
    gpiochip4: GPIOs 246-253, parent: i2c/0-0039, 0-0039, can sleep:
     gpio-250 (                    |fixedregulator-sd   ) out hi
    
    gpiochip3: GPIOs 254-343, parent: platform/601000.gpio, 601000.gpio:
     gpio-301 (                    |standby             ) out lo ACTIVE LOW
     gpio-321 (                    |standby             ) out lo ACTIVE LOW
    
    gpiochip2: GPIOs 344-439, parent: platform/600000.gpio, 600000.gpio:
    
    gpiochip1: GPIOs 440-495, parent: platform/42110000.gpio, 42110000.gpio:
     gpio-464 (                    |GPIO Key USER1      ) in  hi ACTIVE LOW
     gpio-467 (                    |GPIO Key USER2      ) in  hi ACTIVE LOW
    
    gpiochip0: GPIOs 496-511, parent: i2c/2-0021, 2-0021, can sleep:
     gpio-501 (                    |reset               ) out hi
    

    Behind gpiochip2 are the GPIOs of the AM64x which can be controlled over the GPIO IP at physical address 0x000600000 (GPIO0). So, with

    echo 344 > export

    echo out > gpio344/direction

    I am setting up GPIO0_0 up for use. But to what Pad is this GPIO releated too?

    Can you help me out here?

    Best regards,

    Johannes

  • Hi Johannes,

    Yes I have documented an FAQ: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/948888/faq-ccs-tda4vm-tda4-how-do-i-determine-the-gpio-number-within-linux-for-a-pin-within-the-schematic

    The above is for TDA4VM but should exactly apply for AM654x.

    Download the data manual: https://www.ti.com/lit/gpn/am6548

    Follow the instructions given in the above FAQ & you will know the padconfig address. You can either use the sysconfig tool to
    get the PADCONFIG dts node or do it manually yourself.

    If no other questions please click on verify answer.

    - Keerthy