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.

AM625: u-boot CMD_GPIO: run gpio status -a, and value is always 0.

Part Number: AM625
Other Parts Discussed in Thread: SK-AM62

Device: AM625 GP

Installer: ti-processor-sdk-linux-am62xx-evm-09.00.00.03-Linux-x86-Install.bin — 6664936 K

SD card image: tisdk-debian-bookworm-am62xx-evm.wic.xz — 1955030 K

I want to read the value of gpio0_41 input pin in u-boot to determine the lvds-panel dtb to be set for name_overlays.

The default input of gpio0_41 should be high. When pin1 and pin2 touch, gpio0_41 will be grounded to low. And I've checked with an electric meter.

Below are my steps. Please help to confirm if there are any missing steps.

Please refer to \board-support\ti-u-boot\doc\usage\cmd\gpio.rst.

1.add CONFIG_CMD_GPIO=y and CONFIG_CMD_GPIO_READ=y to \board-support\ti-u-boot\configs\am62x_evm_a53_defconfig

2.Enter u-boot command line

U-Boot SPL 2023.04 (Sep 15 2023 - 15:14:17 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
SPL initial stack usage: 13376 bytes
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE:  BL31: Built : 00:42:57, Jan 13 2023

U-Boot SPL 2023.04 (Sep 15 2023 - 15:14:25 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
SPL initial stack usage: 1856 bytes
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted


U-Boot 2023.04 (Sep 15 2023 - 15:14:25 +0800)

SoC:   AM62X SR1.0 GP
Model: Texas Instruments AM625 SK
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
DRAM:  2 GiB
Core:  75 devices, 31 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
Net:   Could not get PHY for ethernet@8000000port@1: addr 0
am65_cpsw_nuss_port ethernet@8000000port@1: phy_connect() failed
No ethernet found.

Hit any key to stop autoboot:  0
=>
=> gpio
gpio - query and control gpio pins

Usage:
gpio <input|set|clear|toggle> <pin>
    - input/set/clear/toggle the specified pin
gpio read <name> <pin>
    - set environment variable 'name' to the specified pin
gpio status [-a] [<bank> | <pin>]  - show [all/claimed] GPIOs
=> gpio status -a
Bank gpio@4201000_:
gpio@4201000_0: input: 0 [ ]
gpio@4201000_1: input: 0 [ ]
gpio@4201000_2: input: 0 [ ]
gpio@4201000_3: input: 0 [ ]
gpio@4201000_4: input: 0 [ ]
gpio@4201000_5: input: 0 [ ]
gpio@4201000_6: input: 0 [ ]
gpio@4201000_7: input: 0 [ ]
gpio@4201000_8: input: 0 [ ]
gpio@4201000_9: input: 1 [ ]
gpio@4201000_10: input: 0 [ ]
gpio@4201000_11: input: 1 [ ]
gpio@4201000_12: input: 0 [ ]
gpio@4201000_13: input: 0 [ ]
gpio@4201000_14: input: 0 [ ]
gpio@4201000_15: input: 0 [ ]
gpio@4201000_16: input: 0 [ ]
gpio@4201000_17: input: 1 [ ]
gpio@4201000_18: input: 1 [ ]
gpio@4201000_19: input: 1 [ ]
gpio@4201000_20: input: 1 [ ]
gpio@4201000_21: input: 0 [ ]
gpio@4201000_22: input: 0 [ ]
gpio@4201000_23: input: 0 [ ]

Bank gpio@22_:
gpio@22_0: input: 0 [ ]
gpio@22_1: input: 1 [ ]
gpio@22_2: input: 0 [ ]
gpio@22_3: output: 1 [ ]
gpio@22_4: input: 0 [ ]
gpio@22_5: input: 0 [ ]
gpio@22_6: input: 0 [ ]
gpio@22_7: input: 0 [ ]
gpio@22_8: input: 1 [ ]
gpio@22_9: input: 1 [ ]
gpio@22_10: input: 0 [ ]
gpio@22_11: input: 0 [ ]
gpio@22_12: input: 1 [ ]
gpio@22_13: input: 0 [ ]
gpio@22_14: input: 0 [ ]
gpio@22_15: input: 0 [ ]
gpio@22_16: input: 1 [ ]
gpio@22_17: input: 0 [ ]
gpio@22_18: input: 0 [ ]
gpio@22_19: input: 0 [ ]
gpio@22_20: input: 0 [ ]
gpio@22_21: input: 0 [ ]
gpio@22_22: input: 0 [ ]
gpio@22_23: input: 0 [ ]

Bank gpio@600000_:
gpio@600000_0: input: 0 [ ]
gpio@600000_1: input: 0 [ ]
gpio@600000_2: input: 0 [ ]
gpio@600000_3: input: 0 [ ]
gpio@600000_4: input: 0 [ ]
gpio@600000_5: input: 0 [ ]
gpio@600000_6: input: 0 [ ]
gpio@600000_7: input: 0 [ ]
gpio@600000_8: input: 0 [ ]
gpio@600000_9: input: 0 [ ]
gpio@600000_10: input: 0 [ ]
gpio@600000_11: input: 0 [ ]
gpio@600000_12: input: 0 [ ]
gpio@600000_13: input: 0 [ ]
gpio@600000_14: input: 0 [ ]
gpio@600000_15: input: 1 [ ]
gpio@600000_16: input: 1 [ ]
gpio@600000_17: input: 0 [ ]
gpio@600000_18: input: 0 [ ]
gpio@600000_19: input: 0 [ ]
gpio@600000_20: input: 0 [ ]
gpio@600000_21: input: 1 [ ]
gpio@600000_22: input: 0 [ ]
gpio@600000_23: input: 0 [ ]
gpio@600000_24: input: 1 [ ]
gpio@600000_25: input: 0 [ ]
gpio@600000_26: input: 0 [ ]
gpio@600000_27: input: 0 [ ]
gpio@600000_28: input: 0 [ ]
gpio@600000_29: input: 0 [ ]
gpio@600000_30: input: 0 [ ]
gpio@600000_31: output: 0 [ ]
gpio@600000_32: input: 0 [ ]
gpio@600000_33: input: 0 [ ]
gpio@600000_34: input: 0 [ ]
gpio@600000_35: input: 0 [ ]
gpio@600000_36: input: 0 [ ]
gpio@600000_37: input: 0 [ ]
gpio@600000_38: input: 0 [ ]
gpio@600000_39: input: 0 [ ]
gpio@600000_40: input: 0 [ ]
gpio@600000_41: input: 0 [ ]
gpio@600000_42: input: 0 [ ]
gpio@600000_43: input: 0 [ ]
gpio@600000_44: input: 0 [ ]
gpio@600000_45: input: 0 [ ]
gpio@600000_46: input: 0 [ ]
gpio@600000_47: input: 0 [ ]
gpio@600000_48: input: 0 [ ]
gpio@600000_49: input: 0 [ ]
gpio@600000_50: input: 0 [ ]
gpio@600000_51: input: 0 [ ]
gpio@600000_52: input: 0 [ ]
gpio@600000_53: input: 0 [ ]
gpio@600000_54: input: 0 [ ]
gpio@600000_55: input: 0 [ ]
gpio@600000_56: input: 0 [ ]
gpio@600000_57: input: 0 [ ]
gpio@600000_58: input: 0 [ ]
gpio@600000_59: input: 0 [ ]
gpio@600000_60: input: 0 [ ]
gpio@600000_61: input: 0 [ ]
gpio@600000_62: input: 0 [ ]
gpio@600000_63: input: 0 [ ]
gpio@600000_64: input: 0 [ ]
gpio@600000_65: input: 0 [ ]
gpio@600000_66: input: 0 [ ]
gpio@600000_67: input: 0 [ ]
gpio@600000_68: input: 0 [ ]
gpio@600000_69: input: 0 [ ]
gpio@600000_70: input: 0 [ ]
gpio@600000_71: input: 0 [ ]
gpio@600000_72: input: 0 [ ]
gpio@600000_73: input: 0 [ ]
gpio@600000_74: input: 0 [ ]
gpio@600000_75: input: 0 [ ]
gpio@600000_76: input: 0 [ ]
gpio@600000_77: input: 0 [ ]
gpio@600000_78: input: 0 [ ]
gpio@600000_79: input: 1 [ ]
gpio@600000_80: input: 0 [ ]
gpio@600000_81: input: 0 [ ]
gpio@600000_82: input: 0 [ ]
gpio@600000_83: input: 1 [ ]
gpio@600000_84: input: 1 [ ]
gpio@600000_85: input: 1 [ ]
gpio@600000_86: input: 0 [ ]
gpio@600000_87: input: 0 [ ]
gpio@600000_88: input: 0 [ ]
gpio@600000_89: input: 0 [ ]
gpio@600000_90: input: 0 [ ]
gpio@600000_91: input: 0 [ ]

Bank gpio@601000_:
gpio@601000_0: input: 0 [ ]
gpio@601000_1: input: 0 [ ]
gpio@601000_2: input: 0 [ ]
gpio@601000_3: input: 0 [ ]
gpio@601000_4: input: 0 [ ]
gpio@601000_5: input: 0 [ ]
gpio@601000_6: input: 0 [ ]
gpio@601000_7: input: 0 [ ]
gpio@601000_8: input: 0 [ ]
gpio@601000_9: input: 0 [ ]
gpio@601000_10: input: 0 [ ]
gpio@601000_11: input: 0 [ ]
gpio@601000_12: input: 0 [ ]
gpio@601000_13: input: 1 [ ]
gpio@601000_14: input: 0 [ ]
gpio@601000_15: input: 0 [ ]
gpio@601000_16: input: 0 [ ]
gpio@601000_17: input: 0 [ ]
gpio@601000_18: input: 0 [ ]
gpio@601000_19: input: 0 [ ]
gpio@601000_20: input: 1 [ ]
gpio@601000_21: input: 0 [ ]
gpio@601000_22: input: 0 [ ]
gpio@601000_23: input: 1 [ ]
gpio@601000_24: input: 0 [ ]
gpio@601000_25: input: 0 [ ]
gpio@601000_26: input: 1 [ ]
gpio@601000_27: input: 1 [ ]
gpio@601000_28: input: 1 [ ]
gpio@601000_29: input: 1 [ ]
gpio@601000_30: input: 0 [ ]
gpio@601000_31: input: 0 [ ]
gpio@601000_32: input: 1 [ ]
gpio@601000_33: input: 1 [ ]
gpio@601000_34: input: 1 [ ]
gpio@601000_35: input: 1 [ ]
gpio@601000_36: input: 1 [ ]
gpio@601000_37: input: 1 [ ]
gpio@601000_38: input: 1 [ ]
gpio@601000_39: input: 1 [ ]
gpio@601000_40: input: 1 [ ]
gpio@601000_41: input: 1 [ ]
gpio@601000_42: input: 1 [ ]
gpio@601000_43: input: 1 [ ]
gpio@601000_44: input: 1 [ ]
gpio@601000_45: input: 1 [ ]
gpio@601000_46: input: 1 [ ]
gpio@601000_47: input: 1 [ ]
gpio@601000_48: input: 0 [ ]
gpio@601000_49: input: 0 [ ]
gpio@601000_50: input: 0 [ ]
gpio@601000_51: input: 0 [ ]
=> setenv myvar 2
=> gpio read myvar 89
gpio: pin 89 (gpio 89) value is 0
=> printenv myvar
myvar=0
=>

The above is the situation when entering u-boot for the first time. The value of gpio0_41 should be 1 but it is displayed as 0.

But if I enter the kernel, run reboot and then enter u-boot again, the value of gpio0_41 will be read correctly.

[  OK  ] Started plymouth-reboot.se…[0m - Show Plymouth Reboot Screen.
[  OK  ] Stopped systemd-user-sessi…ervice - Permit User Sessions.
[  OK  ] Unmounted run-user-1002.mount - /run/user/1002.
[  OK  ] Stopped user-runtime-dir@1… Runtime Directory /run/user/1002.
[  OK  ] Removed slice user-1002.slice - User Slice of UID 1002.
[  OK  ] Stopped target network.target - Network.
[  OK  ] Stopped target remote-fs.target - Remote File Systems.
         Stopping NetworkManager.service - Network Manager...
[  OK  ] Stopped NetworkManager.service - Network Manager.
         Stopping dbus.service - D-Bus System Message Bus...
[  OK  ] Stopped dbus.service - D-Bus System Message Bus.
[  OK  ] Stopped target basic.target - Basic System.
[  OK  ] Stopped systemd-ask-passwo…uests to Plymouth Directory Watch.
[  OK  ] Stopped target paths.target - Path Units.
[  OK  ] Stopped target slices.target - Slice Units.
[  OK  ] Removed slice user.slice - User and Session Slice.
[  OK  ] Stopped target sockets.target - Socket Units.
[  OK  ] Closed avahi-daemon.socket…NS/DNS-SD Stack Activation Socket.
[  OK  ] Closed dbus.socket - D-Bus System Message Bus Socket.
[  OK  ] Closed weston.socket - Weston socket.
[  OK  ] Stopped target sysinit.target - System Initialization.
[  OK  ] Stopped target cryptsetup.…get - Local Encrypted Volumes.
[  OK  ] Stopped systemd-ask-passwo… Requests to Wall Directory Watch.
[  OK  ] Stopped target integrityse…Local Integrity Protected Volumes.
[  OK  ] Stopped target swap.target - Swaps.
[  OK  ] Stopped target veritysetup… - Local Verity Protected Volumes.
         Stopping systemd-backlight…ightness of backlight:backlight...
[  OK  ] Stopped systemd-sysctl.service - Apply Kernel Variables.
[  OK  ] Stopped systemd-modules-lo…service - Load Kernel Modules.
         Stopping systemd-update-ut…rd System Boot/Shutdown in UTMP...
[  OK  ] Unmounted run-credentials-…redentials/systemd-sysctl.service.
[  OK  ] Stopped systemd-backlight@…Brightness of backlight:backlight.
[  OK  ] Removed slice system-syste…- Slice /system/systemd-backlight.
[  OK  ] Stopped systemd-update-utm…cord System Boot/Shutdown in UTMP.
[  OK  ] Stopped systemd-tmpfiles-s…te Volatile Files and Directories.
[  OK  ] Stopped target local-fs.target - Local File Systems.
         Unmounting run-credentials…ntials/systemd-sysusers.service...
         Unmounting run-credentials…/systemd-tmpfiles-setup.service...
         Unmounting run-credentials…temd-tmpfiles-setup-dev.service...
[  OK  ] Unmounted run-credentials-…dentials/systemd-sysusers.service.
[  OK  ] Unmounted run-credentials-…ls/systemd-tmpfiles-setup.service.
[  OK  ] Unmounted run-credentials-…ystemd-tmpfiles-setup-dev.service.
[  OK  ] Stopped target local-fs-pr…reparation for Local File Systems.
[  OK  ] Reached target umount.target - Unmount All Filesystems.
[  OK  ] Stopped systemd-tmpfiles-s…reate Static Device Nodes in /dev.
[  OK  ] Stopped systemd-sysusers.service - Create System Users.
[  OK  ] Stopped systemd-remount-fs…ount Root and Kernel File Systems.
[  OK  ] Reached target shutdown.target - System Shutdown.
[  OK  ] Reached target final.target - Late Shutdown Services.
[  OK  ] Finished systemd-reboot.service - System Reboot.
[  OK [   30.299907] systemd-shutdown[1]: Syncing filesystems and block devices.
 ] Reached target reboot.target - System Reboot.
[   30.816289] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[   30.834742] systemd-journald[168]: Received SIGTERM from PID 1 (systemd-shutdow).
[   30.876935] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[   30.899161] systemd-shutdown[1]: Unmounting file systems.
[   30.908449] (sd-remount)[1870]: Remounting '/' read-only with options ''.
[   30.937955] EXT4-fs (mmcblk1p2): re-mounted. Quota mode: none.
[   30.965337] systemd-shutdown[1]: All filesystems unmounted.
[   30.971044] systemd-shutdown[1]: Deactivating swaps.
[   30.976326] systemd-shutdown[1]: All swaps deactivated.
[   30.981596] systemd-shutdown[1]: Detaching loop devices.
[   30.990259] systemd-shutdown[1]: All loop devices detached.
[   30.995919] systemd-shutdown[1]: Stopping MD devices.
[   31.001430] systemd-shutdown[1]: All MD devices stopped.
[   31.006760] systemd-shutdown[1]: Detaching DM devices.
[   31.012250] systemd-shutdown[1]: All DM devices detached.
[   31.017679] systemd-shutdown[1]: All filesystems, swaps, loop devices, MD devices and DM devices detached.
[   31.036207] systemd-shutdown[1]: Syncing filesystems and block devices.
[   31.043161] systemd-shutdown[1]: Rebooting.
[   31.101890] reboot: Restarting system

U-Boot SPL 2023.04 (Sep 15 2023 - 15:14:17 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
SPL initial stack usage: 13376 bytes
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE:  BL31: Built : 00:42:57, Jan 13 2023

U-Boot SPL 2023.04 (Sep 15 2023 - 15:14:25 +0800)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
SPL initial stack usage: 1856 bytes
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted


U-Boot 2023.04 (Sep 15 2023 - 15:14:25 +0800)

SoC:   AM62X SR1.0 GP
Model: Texas Instruments AM625 SK
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
DRAM:  2 GiB
Core:  75 devices, 31 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
Net:   Could not get PHY for ethernet@8000000port@1: addr 0
am65_cpsw_nuss_port ethernet@8000000port@1: phy_connect() failed
No ethernet found.

Hit any key to stop autoboot:  0
=>
=> gpio
gpio - query and control gpio pins

Usage:
gpio <input|set|clear|toggle> <pin>
    - input/set/clear/toggle the specified pin
gpio read <name> <pin>
    - set environment variable 'name' to the specified pin
gpio status [-a] [<bank> | <pin>]  - show [all/claimed] GPIOs
=> gpio status -a
Bank gpio@4201000_:
gpio@4201000_0: input: 0 [ ]
gpio@4201000_1: input: 0 [ ]
gpio@4201000_2: input: 0 [ ]
gpio@4201000_3: input: 0 [ ]
gpio@4201000_4: input: 0 [ ]
gpio@4201000_5: input: 0 [ ]
gpio@4201000_6: input: 0 [ ]
gpio@4201000_7: input: 0 [ ]
gpio@4201000_8: input: 0 [ ]
gpio@4201000_9: input: 1 [ ]
gpio@4201000_10: input: 0 [ ]
gpio@4201000_11: input: 1 [ ]
gpio@4201000_12: input: 0 [ ]
gpio@4201000_13: input: 0 [ ]
gpio@4201000_14: input: 0 [ ]
gpio@4201000_15: input: 0 [ ]
gpio@4201000_16: input: 0 [ ]
gpio@4201000_17: input: 1 [ ]
gpio@4201000_18: input: 1 [ ]
gpio@4201000_19: input: 1 [ ]
gpio@4201000_20: input: 1 [ ]
gpio@4201000_21: input: 0 [ ]
gpio@4201000_22: input: 0 [ ]
gpio@4201000_23: input: 0 [ ]

Bank gpio@22_:
gpio@22_0: input: 0 [ ]
gpio@22_1: input: 1 [ ]
gpio@22_2: input: 0 [ ]
gpio@22_3: output: 1 [ ]
gpio@22_4: input: 0 [ ]
gpio@22_5: input: 0 [ ]
gpio@22_6: input: 0 [ ]
gpio@22_7: input: 0 [ ]
gpio@22_8: input: 1 [ ]
gpio@22_9: input: 1 [ ]
gpio@22_10: input: 0 [ ]
gpio@22_11: input: 0 [ ]
gpio@22_12: input: 1 [ ]
gpio@22_13: input: 0 [ ]
gpio@22_14: input: 0 [ ]
gpio@22_15: input: 0 [ ]
gpio@22_16: input: 1 [ ]
gpio@22_17: input: 0 [ ]
gpio@22_18: input: 0 [ ]
gpio@22_19: input: 0 [ ]
gpio@22_20: input: 0 [ ]
gpio@22_21: input: 0 [ ]
gpio@22_22: input: 0 [ ]
gpio@22_23: input: 0 [ ]

Bank gpio@600000_:
gpio@600000_0: input: 0 [ ]
gpio@600000_1: input: 0 [ ]
gpio@600000_2: input: 0 [ ]
gpio@600000_3: input: 0 [ ]
gpio@600000_4: input: 0 [ ]
gpio@600000_5: input: 0 [ ]
gpio@600000_6: input: 0 [ ]
gpio@600000_7: input: 0 [ ]
gpio@600000_8: input: 0 [ ]
gpio@600000_9: input: 0 [ ]
gpio@600000_10: input: 0 [ ]
gpio@600000_11: input: 0 [ ]
gpio@600000_12: input: 0 [ ]
gpio@600000_13: input: 0 [ ]
gpio@600000_14: input: 0 [ ]
gpio@600000_15: input: 1 [ ]
gpio@600000_16: input: 1 [ ]
gpio@600000_17: input: 0 [ ]
gpio@600000_18: input: 0 [ ]
gpio@600000_19: input: 0 [ ]
gpio@600000_20: input: 0 [ ]
gpio@600000_21: input: 1 [ ]
gpio@600000_22: input: 0 [ ]
gpio@600000_23: input: 0 [ ]
gpio@600000_24: input: 0 [ ]
gpio@600000_25: input: 0 [ ]
gpio@600000_26: input: 0 [ ]
gpio@600000_27: input: 0 [ ]
gpio@600000_28: input: 0 [ ]
gpio@600000_29: input: 0 [ ]
gpio@600000_30: input: 0 [ ]
gpio@600000_31: output: 0 [ ]
gpio@600000_32: input: 0 [ ]
gpio@600000_33: input: 0 [ ]
gpio@600000_34: input: 0 [ ]
gpio@600000_35: input: 1 [ ]
gpio@600000_36: input: 0 [ ]
gpio@600000_37: input: 1 [ ]
gpio@600000_38: input: 0 [ ]
gpio@600000_39: input: 0 [ ]
gpio@600000_40: input: 0 [ ]
gpio@600000_41: input: 1 [ ]
gpio@600000_42: input: 0 [ ]
gpio@600000_43: input: 1 [ ]
gpio@600000_44: input: 1 [ ]
gpio@600000_45: input: 0 [ ]
gpio@600000_46: input: 0 [ ]
gpio@600000_47: input: 0 [ ]
gpio@600000_48: input: 0 [ ]
gpio@600000_49: input: 0 [ ]
gpio@600000_50: input: 0 [ ]
gpio@600000_51: input: 0 [ ]
gpio@600000_52: input: 0 [ ]
gpio@600000_53: input: 0 [ ]
gpio@600000_54: input: 0 [ ]
gpio@600000_55: input: 0 [ ]
gpio@600000_56: input: 0 [ ]
gpio@600000_57: input: 0 [ ]
gpio@600000_58: input: 0 [ ]
gpio@600000_59: input: 0 [ ]
gpio@600000_60: input: 0 [ ]
gpio@600000_61: input: 0 [ ]
gpio@600000_62: input: 0 [ ]
gpio@600000_63: input: 0 [ ]
gpio@600000_64: input: 0 [ ]
gpio@600000_65: input: 1 [ ]
gpio@600000_66: input: 0 [ ]
gpio@600000_67: input: 0 [ ]
gpio@600000_68: input: 0 [ ]
gpio@600000_69: input: 1 [ ]
gpio@600000_70: input: 0 [ ]
gpio@600000_71: input: 1 [ ]
gpio@600000_72: input: 0 [ ]
gpio@600000_73: input: 0 [ ]
gpio@600000_74: input: 0 [ ]
gpio@600000_75: input: 0 [ ]
gpio@600000_76: input: 0 [ ]
gpio@600000_77: input: 0 [ ]
gpio@600000_78: input: 0 [ ]
gpio@600000_79: input: 1 [ ]
gpio@600000_80: input: 1 [ ]
gpio@600000_81: input: 0 [ ]
gpio@600000_82: input: 0 [ ]
gpio@600000_83: input: 1 [ ]
gpio@600000_84: input: 1 [ ]
gpio@600000_85: input: 1 [ ]
gpio@600000_86: input: 0 [ ]
gpio@600000_87: input: 0 [ ]
gpio@600000_88: input: 0 [ ]
gpio@600000_89: input: 0 [ ]
gpio@600000_90: input: 0 [ ]
gpio@600000_91: input: 0 [ ]

Bank gpio@601000_:
gpio@601000_0: input: 0 [ ]
gpio@601000_1: input: 0 [ ]
gpio@601000_2: input: 0 [ ]
gpio@601000_3: input: 0 [ ]
gpio@601000_4: input: 0 [ ]
gpio@601000_5: input: 0 [ ]
gpio@601000_6: input: 0 [ ]
gpio@601000_7: input: 0 [ ]
gpio@601000_8: input: 0 [ ]
gpio@601000_9: input: 0 [ ]
gpio@601000_10: input: 0 [ ]
gpio@601000_11: input: 0 [ ]
gpio@601000_12: input: 0 [ ]
gpio@601000_13: input: 1 [ ]
gpio@601000_14: input: 0 [ ]
gpio@601000_15: input: 0 [ ]
gpio@601000_16: input: 0 [ ]
gpio@601000_17: input: 0 [ ]
gpio@601000_18: input: 0 [ ]
gpio@601000_19: input: 0 [ ]
gpio@601000_20: input: 1 [ ]
gpio@601000_21: input: 0 [ ]
gpio@601000_22: input: 0 [ ]
gpio@601000_23: input: 1 [ ]
gpio@601000_24: input: 0 [ ]
gpio@601000_25: input: 0 [ ]
gpio@601000_26: input: 1 [ ]
gpio@601000_27: input: 1 [ ]
gpio@601000_28: input: 1 [ ]
gpio@601000_29: input: 1 [ ]
gpio@601000_30: input: 0 [ ]
gpio@601000_31: input: 0 [ ]
gpio@601000_32: input: 1 [ ]
gpio@601000_33: input: 1 [ ]
gpio@601000_34: input: 1 [ ]
gpio@601000_35: input: 1 [ ]
gpio@601000_36: input: 1 [ ]
gpio@601000_37: input: 1 [ ]
gpio@601000_38: input: 1 [ ]
gpio@601000_39: input: 1 [ ]
gpio@601000_40: input: 1 [ ]
gpio@601000_41: input: 1 [ ]
gpio@601000_42: input: 1 [ ]
gpio@601000_43: input: 1 [ ]
gpio@601000_44: input: 1 [ ]
gpio@601000_45: input: 1 [ ]
gpio@601000_46: input: 1 [ ]
gpio@601000_47: input: 1 [ ]
gpio@601000_48: input: 0 [ ]
gpio@601000_49: input: 0 [ ]
gpio@601000_50: input: 0 [ ]
gpio@601000_51: input: 0 [ ]
=> setenv myvar 3
=> gpio read myvar 89
gpio: pin 89 (gpio 89) value is 1
=> printenv myvar
myvar=1
=> gpio read myvar 89
gpio: pin 89 (gpio 89) value is 0
=> printenv myvar
myvar=0
=>

Please help me to complete the task.

Thanks,

Andrew

  • Hello Andrew,

    I noticed that pins other than GPIO0_41 have changed value from the logs you provided. These pins in GPIO0 (0x600000) have all changed from logic 0 to logic 1: 35,37,41,43,44,65,69,71, and 80.

    Can you share the changes you made to the device tree?
    Are you using custom hardware or TI EVM?

    Some of the GPIO pins share the same AWL ball number with other peripherals. Make sure that there is no conflicting pin mux settings in the device tree. Here is the link to the AM62x datasheet so it can be verified: https://www.ti.com/lit/ds/symlink/am625.pdf

    Best Regards,

    Anshu

  • Hi Anshu,

    Thanks for your reply.

    A similar situation occurred using "SK-AM62 EVM E3" and default code sd card.

    Please test it.

    1.use J3 pin37(EXP_GPIO0_41), J9 pin1(3.3V), J3 pin9(DGND).

    2.enter u-boot cmd line, run "gpio input 89", and see gpio value.

    Below are my test results:

      1.in first boot and enter u-boot cmd line:

        a.connect 3.3v show low.

        b.connect DGND show low.

        c. not connected show low.

      2.run reboot and enter u-boot cmd line:

        a.connect 3.3v show high.

        b.connect DGND show low.

        c. not connected show high, but measured with an electric meter is 0.2V.

    Thanks,

    Andrew

  • Hi Andrew,

    I am currently trying to replicate your results.

    Can you explain why you are using 'gpio input'? Input does not seem the change the value according to the U-Boot Docs. Here is the link GPIO U-Boot docs: u-boot.readthedocs.io/.../gpio.html

    For the GPIO0_41 pin, has the device tree been modified so the kernel can recognize the pin? Since you said its using the default SD card, the default device tree doesn't not have those GPIO pins. I've noticed that without the device tree changes, there is a disconnect on the actual value where the software and hardware hold different values.


    The 3.3V could be getting setup which could explain why 3.3V is low on first boot and power has not been supplied to the pin yet.
    Try checking 3.3V after the boot and then check again after some time without a second reboot.

    Best Regards,

    Anshu

  • Hi Anshu,

    My task is to use the green jump in the picture to select the dts node corresponding to the lvds panel to be used by the kernel during the u-boot stage. Only one sd card image is used, but the optional screen can be selected before booting.

    I plan to get the value of GPIO0_41 pin in uEnv.txt to set name_overlays=target_lvds_panel.dtb.

    So I will add the following command to uEnv.txt.

    uenvcmd=setenv gpio0_41_value 1;gpio read gpio0_41_value 89;if test "$gpio0_41_value"="1"; then name_overlays=lvds_panel_a.dtb;else name_overlays=lvds_panel_b.dtb;fi

    Please tell me how to achieve it, or if there are other methods.

    Thanks,

    Andrew

  • Hi Andrew,

    I will forward this query to the U-Boot Expert. Please allow them some time to respond.

    Best Regards,

    Anshu