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.

AM62A7-Q1: Enable gpio through dts

Part Number: AM62A7-Q1
Other Parts Discussed in Thread: AM62A74

Hello team,

we are trying to define few pins as gpio as per our pinmuxing requirement but we are not able to toggle/assign values, lets say we have added these lines in our node "main_gpio0_pins_default" , how to toggle any gpio from dts, please suggest required changes for this , and i am currenlty making changes in "k3-am62a7-sk.dts" in both linux and uboot environment, do i need to make changes in any other dtb too?

			AM62AX_IOPAD(0x00dc, PIN_OUTPUT, 7) /* (V18) VOUT0_DATA9.GPIO0_54 */
			AM62AX_IOPAD(0x0d4, PIN_OUTPUT, 7) /* (V21) VOUT0_DATA7 */
			AM62AX_IOPAD(0x0d8, PIN_OUTPUT, 7) /* (V19) VOUT0_DATA8 */
  • Hi Arjun, 

    You do not need to change any other device tree files, however, you may need to make further modifications in your current file. For toggling a gpio within U-Boot and Linux environment, I suggest looking at the following resources: 

    U-Boot: [FAQ] PROCESSOR-SDK-AM62X: How to Toggle GPIOs and LEDs from U-Boot Command Prompt - Processors forum - Processors - TI E2E support forums

    Linux: [FAQ] PROCESSOR-SDK: Getting Started with GPIOs in Linux using the AM62 and AM64 Family Processors - Processors forum - Processors - TI E2E support forums

    I believe both resources will help in understanding how to structure your dts file to enable a gpio pin as well as how to control, set and debug the pins you plan to use. 

    Hope this helps,

    Shriya

  • We have gone through this links that you have provided, our concern is if we want to toggle a gpio do we need to modify the "k3-am62x-sk-common.dtsi" file  or we need to modify the "k3-am62a7-sk.dts" file.we are using am62a sk evm (am62a74 soc) device. the k3-am62x-sk-common file seems to be for am62x because it has the iopad config of "AM62X_IOPAD". 

  • Hi Arjun, 

    Since you just want to toggle a GPIO, you only would have to modify the k3-am62a7-sk.dts.

    Regards,

    Shriya

  • Hello Shriya,

    I tried to reflect my changes on both uboot and linux dtb(k3-am62a7-sk.dts), but i still cant see any change. I have tried both sdk "10_01_00_05" and "ti-processor-sdk-linux-edgeai-am62a-evm-11.01.07.05" to build my custom uboot and kernel, adding to this, i am getting probe error often on random basis "

    [    1.583697] am65-cpsw-nuss 8000000.ethernet: initializing am65 cpsw nuss version 0x6BA01103, cpsw version 0x6BA81103 Ports: 3 quirks:00000006
    [    1.596481] am65-cpsw-nuss 8000000.ethernet: initialized cpsw ale version 1.5
    [    1.603610] am65-cpsw-nuss 8000000.ethernet: ALE Table size 512
    [    1.610000] pps pps0: new PPS source ptp0
    [    1.614287] am65-cpsw-nuss 8000000.ethernet: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:1
    [    1.628200] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [    1.637815] platform 31000000.usb: Fixed dependency cycle(s) with /bus@f0000/i2c@20000000/usb-power-controller@3f/connector
    [    1.651092] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
    [    1.656635] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
    [    1.664404] xhci-hcd xhci-hcd.0.auto: USB3 root hub has no ports
    [    1.670427] xhci-hcd xhci-hcd.0.auto: hcc params 0x0258fe6d hci version 0x110 quirks 0x0000008020000010
    [    1.679861] xhci-hcd xhci-hcd.0.auto: irq 264, io mem 0x31100000
    [    1.686680] hub 1-0:1.0: USB hub found
    [    1.690478] hub 1-0:1.0: 1 port detected
    [    1.695959] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 1200000 KHz, changing to: 1250000 KHz
    [    1.708272] mmc0: CQHCI version 5.10
    [    1.748889] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit
    [    1.808199] vddshv5_sdio: Bringing 1800000uV into 3300000-3300000uV
    [    1.836128] mmc0: Command Queue Engine enabled
    [    1.840594] mmc0: new HS200 MMC card at address 0001
    [    1.846061] mmcblk0: mmc0:0001 G1M15L 29.6 GiB
    [    1.851830]  mmcblk0: p1 p2
    [    1.855155] mmcblk0boot0: mmc0:0001 G1M15L 31.5 MiB
    [    1.860951] mmcblk0boot1: mmc0:0001 G1M15L 31.5 MiB
    [    1.866727] mmcblk0rpmb: mmc0:0001 G1M15L 4.00 MiB, chardev (239:0)
    [    1.999693] tps6594-rtc tps6594-rtc.5.auto: registered as rtc1
    [    2.011022] clk: Disabling unused clocks
    [    2.018912] ALSA device list:
    [    2.021935]   No soundcards found.
    [    2.025792] Waiting for root device PARTUUID=076c4a2a-02...
    [   12.209184] platform fa00000.mmc: deferred probe pending
    [   12.214511] platform regulator-3: deferred probe pending
    [   12.219817] platform 2b300050.target-module: deferred probe pending
    

  • Hi Arjun, 

    I see in your original post you set the pad config macro, but did you also add pinmux and reference node to your device tree? Please look at the following example code which can be found in the FAQ I mentioned above: 

     &main_pmx0 {
    +       maingpio0_pins_default: maingpio0-default-pins {
    +               pinctrl-single,pins = <
    +                       AM62X_IOPAD(0x0038, PIN_INPUT, 7) /* (E24) OSPI0_CSn3.GPIO0_14 */
    +               >;
    +       };
    +
            /* First pad number is ALW package and second is AMC package */
            main_uart0_pins_default: main-uart0-pins-default {
                    pinctrl-single,pins = <
    @@ -221,6 +227,12 @@
            };
     };
     
    +&main_gpio0{
    +       status = "okay";
    +       pinctrl-names = "default";
    +       pinctrl-0 = <&maingpio0_pins_default>;
    +};
    +

    I also found a previous E2E with a similar issue, would you be able to try the suggestions shown in the following link? SK-AM62B-P1: platform 2b300050.target-module: deferred probe pending error - Processors forum - Processors - TI E2E support forums.

    Finally, would you be able to try using a default TI EVM dts and see if the same issue occurs?

    Best Regards,

    Shriya

  • Hello, i am able to toggle GPIO at my end, but i am still getting probe error

    [    2.141898] mmcblk0: mmc0:0001 G1J37E 29.6 GiB
    [    2.147976] mmcblk0boot0: mmc0:0001 G1J37E 31.5 MiB
    [    2.153826] mmcblk0boot1: mmc0:0001 G1J37E 31.5 MiB
    [    2.159599] mmcblk0rpmb: mmc0:0001 G1J37E 4.00 MiB, chardev (239:0)
    [    2.290313] tps6594-rtc tps6594-rtc.5.auto: registered as rtc1
    [    2.296818] pca953x 1-0022: supply vcc not found, using dummy regulator
    [    2.303562] pca953x 1-0022: using AI
    [    2.307306] pca953x 1-0022: failed writing register
    [    2.312281] pca953x: probe of 1-0022 failed with error -121
    [    2.322108] clk: Disabling unused clocks
    [    2.330027] ALSA device list:
    [    2.332991]   No soundcards found.
    [    2.336923] Waiting for root device PARTUUID=076c4a2a-02...
    [   12.534044] platform 2b300050.target-module: deferred probe pending
    [   12.540326] platform fa00000.mmc: deferred probe pending
    [   12.545634] platform regulator-3: deferred probe pendi

    and it is only occurring because of my kernel dtb changes

  • Hi Arjun,


    From my understanding, the boot process is attempting to communicate with the PCA953x I2C expander, that is why you are receiving the following error:

    pca953x: probe of 1-0022 failed with error -121

    If this device is not present on your hardware, its corresponding nodes should be completely removed from the device tree. Please review your dts and remove any peripherals that are not actually present on the board. If the issue continues after updating the device tree, please open a new E2E post since this is no longer a GPIO-related problem but a broader boot issue.

    Thank you,

    Shriya