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.

SK-AM62: How to enable GPIO command in U-Boot?

Part Number: SK-AM62

Hi,

I downloaded the SDK from https://www.ti.com/tool/PROCESSOR-SDK-AM62X, which I can see the gpio.c command file in /board-support/u-boot/cmd. In order to enable the command in U-boot console, I set 'CONFIG_CMD_GPIO=y' in the config file I am using to build my uboot.img which is am62x_evm_a53_defconfig. Once I did that, I can see that gpio.c is compiled in my build but here's the error I found:

In this case, I believe I got the above errors because I am missing the driver gpio.c in this build. So I went to drivers/gpio to see that there are a lot of different gpio drivers in the folder which I have no idea which one is the exact gpio driver I should use. Can anyone please give some advice? 

Thanks,

Koon Kee

  • Hello,
    I think GPIO command at u-boot is not fully enabled/tested on K3 SoC (including AM62x).
    Let me check internally, and keep you posted...
    Best,
    -Hong

  • Hello,
    I'm attaching a log file on "gpio" cmd @u-boot I captured on AM62x-SK
    - The u-boot is based off SDK 8.6 release (www.ti.com/.../08.06.00.42)
    - a simple u-boot patch to enable "gpio" cmd
    Hopefully it is helpful for your user case.
    Best,
    -Hong

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/7043.am62x_5F00_gpio.patch

    U-Boot SPL 2021.01-00001-g45cb7e4-dirty (Mar 14 2023 - 22:58:17 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    SPL initial stack usage: 13424 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
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment
    
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE:  BL31: Built : 05:06:58, Feb 24 2023
    
    U-Boot SPL 2021.01-00001-g45cb7e4-dirty (Mar 14 2023 - 22:57:08 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    Trying to boot from MMC2
    
    
    U-Boot 2021.01-00001-g45cb7e4-dirty (Mar 14 2023 - 22:57:08 -0500)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E2
    DRAM:  2 GiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0
    => dm tree
     Class     Index  Probed  Driver                Name
    -----------------------------------------------------------
     root          0  [ + ]   root_driver           root_driver
     simple_bus    0  [ + ]   simple_bus            |-- bus@f0000
     simple_bus    1  [ + ]   simple_bus            |   |-- bus@4000000
     pinctrl       0  [ + ]   single-pinctrl        |   |   |-- pinctrl@4084000
     remoteproc    0  [   ]   k3_m4                 |   |   `-- m4fss@5000000
     simple_bus    2  [ + ]   simple_bus            |   |-- bus@2b000000
     syscon        0  [ + ]   syscon                |   |   `-- syscon@43000000
     soc           0  [ + ]   soc_ti_k3             |   |       `-- chipid@14
     syscon        1  [   ]   syscon                |   |-- syscon@100000
     simple_bus    3  [ + ]   simple_bus            |   |-- bus@48000000
     mailbox       0  [ + ]   k3-secure-proxy       |   |   |-- mailbox@4d000000
     dma           0  [   ]   ti-udma               |   |   |-- dma-controller@485c0100
     dma           1  [   ]   ti-udma               |   |   `-- dma-controller@485c0000
     firmware      0  [ + ]   ti_sci                |   |-- system-controller@44043000
     power_doma    0  [ + ]   ti-sci-pm-domains     |   |   |-- power-controller
     clk           0  [ + ]   ti-sci-clk            |   |   |-- clock-controller
     reset         0  [   ]   ti-sci-reset          |   |   |-- reset-controller
     sysreset      0  [   ]   ti-sci-sysreset       |   |   `-- sysreset-controller
     pinctrl       1  [ + ]   single-pinctrl        |   |-- pinctrl@f4000
     pinconfig     0  [ + ]   pinconfig             |   |   |-- main-uart0-pins-default
     pinconfig     1  [   ]   pinconfig             |   |   |-- main-i2c0-pins-default
     pinconfig     2  [   ]   pinconfig             |   |   |-- main-i2c1-pins-default
     pinconfig     3  [   ]   pinconfig             |   |   |-- main-i2c2-pins-default
     pinconfig     4  [ + ]   pinconfig             |   |   |-- main-mmc0-pins-default
     pinconfig     5  [ + ]   pinconfig             |   |   |-- main-mmc1-pins-default
     pinconfig     6  [   ]   pinconfig             |   |   |-- usr-led-pins-default
     pinconfig     7  [ + ]   pinconfig             |   |   |-- main-mdio1-pins-default
     pinconfig     8  [ + ]   pinconfig             |   |   |-- main-rgmii1-pins-default
     pinconfig     9  [ + ]   pinconfig             |   |   |-- main-rgmii2-pins-default
     pinconfig    10  [   ]   pinconfig             |   |   |-- vdd-sd-dv-pins-default
     pinconfig    11  [   ]   pinconfig             |   |   |-- extcon-usb0-gpio-id-pins-default
     pinconfig    12  [   ]   pinconfig             |   |   |-- main-usb1-pins-default
     pinconfig    13  [   ]   pinconfig             |   |   `-- ospi0-pins-default
     serial        0  [ + ]   omap_serial           |   |-- serial@2800000
     i2c           0  [   ]   i2c_omap              |   |-- i2c@20000000
     i2c           1  [   ]   i2c_omap              |   |-- i2c@20010000
     gpio          0  [   ]   pca953x               |   |   `-- gpio@22
     gpio          1  [   ]   ti_dm6441_gpio        |   |-- gpio@600000
     gpio          2  [   ]   ti_dm6441_gpio        |   |-- gpio@601000
     mmc           0  [ + ]   am654_sdhci           |   |-- mmc@fa10000
     blk           0  [ + ]   mmc_blk               |   |   `-- mmc@fa10000.blk
     mmc           1  [ + ]   am654_sdhci           |   |-- mmc@fa00000
     blk           1  [   ]   mmc_blk               |   |   `-- mmc@fa00000.blk
     mmc           2  [ + ]   am654_sdhci           |   |-- mmc@fa20000
     blk           2  [   ]   mmc_blk               |   |   `-- mmc@fa20000.blk
     nop           0  [   ]   dwc3-ti               |   |-- dwc3-usb@f900000
     usb           0  [   ]   dwc3-generic-periphe  |   |   `-- usb@31000000
     nop           1  [   ]   dwc3-ti               |   |-- dwc3-usb@f910000
     usb           0  [   ]   dwc3-generic-host     |   |   `-- usb@31100000
     simple_bus    4  [   ]   simple_bus            |   |-- bus@fc00000
     spi           0  [   ]   cadence_spi           |   |   `-- spi@fc40000
     spi_flash     0  [   ]   jedec_spi_nor         |   |       `-- flash@0
     misc          0  [ + ]   am65_cpsw_nuss        |   `-- ethernet@8000000
     eth           0  [ + ]   am65_cpsw_nuss_port   |       `-- ethernet@8000000port@1
     regulator     0  [   ]   regulator_fixed       |-- regulator-0
     regulator     1  [   ]   regulator_fixed       |-- regulator-1
     regulator     2  [   ]   regulator_fixed       |-- regulator-2
     regulator     3  [   ]   regulator_fixed       |-- fixed-regulator-sd
     regulator     4  [   ]   gpio regulator        |-- gpio-regulator-TLV71033
     firmware      1  [   ]   psci                  `-- psci
    => gpio
    gpio - query and control gpio pins
    
    Usage:
    gpio <input|set|clear|toggle> <pin>
        - input/set/clear/toggle the specified pin
    gpio status [-a] [<bank> | <pin>]  - show [all/claimed] GPIOs
    => gpio status -a
    Bank gpio@22_:
    gpio@22_0: input: 1 [ ]
    gpio@22_1: input: 1 [ ]
    gpio@22_2: input: 1 [ ]
    gpio@22_3: output: 1 [ ]
    gpio@22_4: input: 0 [ ]
    gpio@22_5: input: 0 [ ]
    gpio@22_6: input: 0 [ ]
    gpio@22_7: input: 1 [ ]
    gpio@22_8: input: 1 [ ]
    gpio@22_9: input: 1 [ ]
    gpio@22_10: input: 1 [ ]
    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: 1 [ ]
    gpio@22_18: input: 0 [ ]
    gpio@22_19: input: 0 [ ]
    gpio@22_20: input: 1 [ ]
    gpio@22_21: input: 1 [ ]
    gpio@22_22: input: 1 [ ]
    gpio@22_23: input: 0 [ ]
    0: input: 0 [ ]
    1: input: 0 [ ]
    2: input: 0 [ ]
    3: input: 0 [ ]
    4: input: 0 [ ]
    5: input: 0 [ ]
    6: input: 0 [ ]
    7: input: 0 [ ]
    8: input: 0 [ ]
    9: input: 0 [ ]
    10: input: 0 [ ]
    11: input: 0 [ ]
    12: input: 0 [ ]
    13: input: 0 [ ]
    14: input: 0 [ ]
    15: input: 1 [ ]
    16: input: 1 [ ]
    17: input: 1 [ ]
    18: input: 1 [ ]
    19: input: 1 [ ]
    20: input: 1 [ ]
    21: input: 1 [ ]
    22: input: 1 [ ]
    23: input: 0 [ ]
    24: input: 0 [ ]
    25: input: 0 [ ]
    26: input: 0 [ ]
    27: input: 0 [ ]
    28: input: 0 [ ]
    29: input: 0 [ ]
    30: input: 0 [ ]
    31: output: 0 [ ]
    32: input: 0 [ ]
    33: input: 0 [ ]
    34: input: 0 [ ]
    35: input: 0 [ ]
    36: input: 0 [ ]
    37: input: 0 [ ]
    38: input: 0 [ ]
    39: input: 0 [ ]
    40: input: 0 [ ]
    41: input: 0 [ ]
    42: input: 0 [ ]
    43: input: 0 [ ]
    44: input: 0 [ ]
    45: input: 0 [ ]
    46: input: 0 [ ]
    47: input: 0 [ ]
    48: input: 0 [ ]
    49: input: 0 [ ]
    50: input: 0 [ ]
    51: input: 0 [ ]
    52: input: 0 [ ]
    53: input: 0 [ ]
    54: input: 0 [ ]
    55: input: 0 [ ]
    56: input: 0 [ ]
    57: input: 0 [ ]
    58: input: 0 [ ]
    59: input: 0 [ ]
    60: input: 0 [ ]
    61: input: 0 [ ]
    62: input: 0 [ ]
    63: input: 0 [ ]
    64: input: 0 [ ]
    65: input: 0 [ ]
    66: input: 0 [ ]
    67: input: 0 [ ]
    68: input: 0 [ ]
    69: input: 0 [ ]
    70: input: 0 [ ]
    71: input: 0 [ ]
    72: input: 0 [ ]
    73: input: 0 [ ]
    74: input: 0 [ ]
    75: input: 0 [ ]
    76: input: 0 [ ]
    77: input: 0 [ ]
    78: input: 0 [ ]
    79: input: 0 [ ]
    80: input: 0 [ ]
    81: input: 0 [ ]
    82: input: 0 [ ]
    83: input: 0 [ ]
    84: input: 0 [ ]
    85: input: 1 [ ]
    86: input: 0 [ ]
    0: input: 0 [ ]
    1: input: 0 [ ]
    2: input: 1 [ ]
    3: input: 0 [ ]
    4: input: 0 [ ]
    5: input: 0 [ ]
    6: input: 0 [ ]
    7: input: 1 [ ]
    8: input: 0 [ ]
    9: input: 0 [ ]
    10: input: 0 [ ]
    11: input: 0 [ ]
    12: input: 0 [ ]
    13: input: 1 [ ]
    14: input: 0 [ ]
    15: input: 0 [ ]
    16: input: 0 [ ]
    17: input: 0 [ ]
    18: input: 0 [ ]
    19: input: 0 [ ]
    20: input: 1 [ ]
    21: input: 0 [ ]
    22: input: 0 [ ]
    23: input: 0 [ ]
    24: input: 0 [ ]
    25: input: 0 [ ]
    26: input: 1 [ ]
    27: input: 1 [ ]
    28: input: 1 [ ]
    29: input: 1 [ ]
    30: input: 0 [ ]
    31: input: 0 [ ]
    32: input: 1 [ ]
    33: input: 1 [ ]
    34: input: 1 [ ]
    35: input: 1 [ ]
    36: input: 1 [ ]
    37: input: 1 [ ]
    38: input: 1 [ ]
    39: input: 1 [ ]
    40: input: 0 [ ]
    41: input: 1 [ ]
    42: input: 1 [ ]
    43: input: 1 [ ]
    44: input: 1 [ ]
    45: input: 1 [ ]
    46: input: 0 [ ]
    47: input: 1 [ ]
    48: input: 0 [ ]
    49: input: 0 [ ]
    50: input: 0 [ ]
    51: input: 0 [ ]
    52: input: 0 [ ]
    53: input: 0 [ ]
    54: input: 0 [ ]
    55: input: 0 [ ]
    56: input: 0 [ ]
    57: input: 0 [ ]
    58: input: 0 [ ]
    59: input: 0 [ ]
    60: input: 0 [ ]
    61: input: 0 [ ]
    62: input: 0 [ ]
    63: input: 0 [ ]
    64: input: 0 [ ]
    65: input: 0 [ ]
    66: input: 0 [ ]
    67: input: 0 [ ]
    68: input: 0 [ ]
    69: input: 0 [ ]
    70: input: 0 [ ]
    71: input: 0 [ ]
    72: input: 0 [ ]
    73: input: 0 [ ]
    74: input: 0 [ ]
    75: input: 0 [ ]
    76: input: 0 [ ]
    77: input: 0 [ ]
    78: input: 0 [ ]
    79: input: 0 [ ]
    80: input: 0 [ ]
    81: input: 0 [ ]
    82: input: 0 [ ]
    83: input: 0 [ ]
    84: input: 0 [ ]
    85: input: 0 [ ]
    86: input: 0 [ ]
    87: input: 0 [ ]
    =>