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.

AM6442: Understanding GPIO mapping

Part Number: AM6442

Tool/software:

Hello TI,

We want to understand GPIO mapping on AM6442, Let me put with small situation,

Now we want to use the pin U20 as GPIO from userspace, From user space we see there 4 groups as given below,

root@am64xx-evm:~# gpiodetect
gpiochip0 [0-0038] (8 lines)
gpiochip1 [1-0022] (24 lines)
gpiochip2 [600000.gpio] (87 lines)
gpiochip3 [601000.gpio] (88 lines)
root@am64xx-evm:~#

root@am64xx-evm:~# cat /sys/class/gpio/gpiochip512/base
512
root@am64xx-evm:~# cat /sys/class/gpio/gpiochip520/base
520
root@am64xx-evm:~# cat /sys/class/gpio/gpiochip544/base
544
root@am64xx-evm:~# cat /sys/class/gpio/gpiochip631/base
631
root@am64xx-evm:~#

Example: we want to understand, U20 will come under which group? if we have to use sysfs node then we need to add base address, so we are not sure which gpiochip will have U20 pin and what will be the number for this.

Is there any UserGuide or GPIO spread sheet to understand more on this?

Thank you,

Prtahibha

  • Hello TI,

    In addition to previous point, we tried to toggle U20 on AM64x EVM, but we are not able to toggle, logs given below for reference,

    root@am64xx-evm:/sys/class/gpio/gpio562# echo out > direction
    root@am64xx-evm:/sys/class/gpio/gpio562# cat value
    0
    root@am64xx-evm:/sys/class/gpio/gpio562# echo 1 > value
    root@am64xx-evm:/sys/class/gpio/gpio562# cat value
    0
    root@am64xx-evm:/sys/class/gpio/gpio562#

    Note: we are unable to toggle many other pins from gpiochip2 and gpiochip3 even though in datasheet is tells those pins supports Input/Output.

    Thank you,

    Prathibha

  • Hi Prathibha,

    What Linux SDK version are you using?

    Pin U20 is normally used for bootmode switches or GPMC module. Can you confirm that you are not using any of these other signals besides the GPIO?

    If you are using U20 on a TI EVM, this is connected to bootmode switch signal 3 which is required to boot up the device.

    The Main Domain has two GPIO modules where each module has a different address. GPIO0 is assigned to 0x600000 and GPIO1 is assigned to 0x601000.

    This information is stated in the AM64x TRM 2.1 MAIN Domain Memory Map: https://www.ti.com/lit/pdf/spruim2

    To use a peripheral like GPIOs, the Linux device tree needs to be configured so Linux can enumerate and initialize the GPIOs when booting. Can you share what device tree changes made?

    When interacting with a GPIO in userspace, you can use either SYSFS or libgpiod commands but not both at the same time.

    Best Regards,

    Anshu

  • Hello TI,

    1. We are using SYSFS or libgpiod, not both method at the same time

    2. We tried to use U20 pin as PWM signal initially and it worked as PWM signal, now we are removing the PWM configurations from dts and configuring as GPIO but it is not working as expected

    3. dts configuration as below, and also this pin is configured as GPIO only at present, no other functionalities 

    k3-am642-evm.dts

    ===============

    emwm0_pins: emwm0_pins {
    pinctrl-single,pins = <
    /*AM64X_IOPAD(0x0048, PIN_OUTPUT, 3)*/ /*U20 - As PWM signal*/
    AM64X_IOPAD(0x0048, PIN_OUTPUT, 7) /*U20 - As GPIO signal*/
    >;
    };

    &epwm0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&emwm0_pins>;
    gpio = <&main_gpio0 18 GPIO_ACTIVE_HIGH>;
    };

    4. We are also trying to toggle other pins part of GPIO0 and GPIO1, we are noticing the same issue

    Issue:

    root@am64xx-evm:/sys/class/gpio/gpio562# echo out > direction
    root@am64xx-evm:/sys/class/gpio/gpio562# cat value
    0
    root@am64xx-evm:/sys/class/gpio/gpio562# echo 1 > value
    root@am64xx-evm:/sys/class/gpio/gpio562# cat value
    0
    root@am64xx-evm:/sys/class/gpio/gpio562#

    Can you please let us know what can be the issue here

    Thank you,

    Prathibha

  • Hi Prathibha,

    How is 562 calculated? What is the base number of GPIO0?

    Is this being tested on a TI EVM or custom hardware? If its a TI EVM, which TI EVM is being used?

    Thanks,

    Anshu

  • Hello TI,

    Base numbers we got from sysfs node i-e /sys/class/gpio/, 

    And we could figure out the dts modifications for GPIOs, now we are able to see the pin U20 toggling from userspace,

    Thank you,

    Prathibha