4.7.6. hb_gpioinfo
hb_gpioinfo is a tool used to display GPIO pin information. It supports the following features:
Display basic information of GPIO pins (e.g., pin name, offset, direction, bias, drive mode, etc.).
Display the current state of pins (e.g., input/output, active-low, edge detection, etc.).
Display additional functional information of pins for specific platforms (e.g., pin function, pin number, etc.).
4.7.6.1. Syntax Description
Below is the command format for executing hb_gpioinfo:
hb_gpioinfo [OPTIONS] [line]...
4.7.6.2. Parameter Options Description
Below are the options supported by chip_log and their descriptions:
-c, --chip <chip>: Restrict scope to a specific GPIO chip.-h, --help: Display help information and exit.-s, --strict: Check all lines—do not assume pin names are unique.-v, --version: Display version information and exit.
4.7.6.3. Command Options and Their Function Descriptions
Display Help Information
Command:
hb_gpioinfo --help
Function:
Display usage help information for this command.
Usage: hb_gpioinfo [OPTIONS] [line]...
Print information about GPIO lines.
Lines are specified by name, or optionally by offset if the chip option is provided.
If no lines are specified then all lines are displayed.
Options:
-c, --chip <chip> restrict scope to a particular chip
-h, --help display this help and exit
-s, --strict check all lines - don't assume line names are unique
--unquoted don't quote line or consumer names
-v, --version output version information and exit
Display All GPIO Pin Information
Command:
root@buildroot:~# hb_gpioinfo
Function:
Display detailed information for all GPIO pins in the system.
Output:
root@buildroot:~# hb_gpioinfo
gpiochip0 - 8 lines: @31000000.gpio: @498-505
[Number] [Mode] [Status] [GpioName] [PinName] [PinNum] [PinFunc]
line 0: unnamed input AON_GPIO_PIN0 498 aon_gpio_0
line 1: unnamed input AON_GPIO_PIN1 499 Default
line 2: unnamed input active-low GPIO Key Power AON_GPIO_PIN2 500 aon_gpio_2
line 3: unnamed input AON_GPIO_PIN3 501 Default
line 4: unnamed input AON_GPIO_PIN4 502 aon_gpio_4
line 5: unnamed input id AON_ENV_VDD 503 aon_gpio_5
line 6: unnamed input id AON_ENV_CNN0 504 aon_gpio_6
line 7: unnamed input AON_ENV_CNN1 505 aon_gpio_7
gpiochip1 - 31 lines: @35060000.gpio: @466-496
[Number] [Mode] [Status] [GpioName] [PinName] [PinNum] [PinFunc]
line 0: unnamed input HSIO_ENET_MDC 466 enetgrp
line 1: unnamed input HSIO_ENET_MDIO 467 enetgrp
line 2: unnamed input HSIO_ENET_TXD_0 468 enetgrp
line 3: unnamed input HSIO_ENET_TXD_1 469 enetgrp
line 4: unnamed input HSIO_ENET_TXD_2 470 enetgrp
line 5: unnamed input HSIO_ENET_TXD_3 471 enetgrp
line 6: unnamed input HSIO_ENET_TXEN 472 enetgrp
line 7: unnamed input HSIO_ENET_TX_CLK 473 enetgrp
line 8: unnamed input HSIO_ENET_RX_CLK 474 enetgrp
line 9: unnamed input HSIO_ENET_RXD_0 475 enetgrp
line 10: unnamed input HSIO_ENET_RXD_1 476 enetgrp
line 11: unnamed input HSIO_ENET_RXD_2 477 enetgrp
line 12: unnamed input HSIO_ENET_RXD_3 478 enetgrp
line 13: unnamed input HSIO_ENET_RXDV 479 enetgrp
line 14: unnamed input HSIO_ENET_PHY_CLK 480 enetgrp
line 15: unnamed input HSIO_SD_WP 481 sdgrp
line 16: unnamed input HSIO_SD_XLK 482 sdgrp
line 17: unnamed input HSIO_SD_CMD 483 sdgrp
line 18: unnamed input HSIO_SD_CDN 484 sdgrp
line 19: unnamed input HSIO_SD_DATA0 485 sdgrp
line 20: unnamed input HSIO_SD_DATA1 486 sdgrp
line 21: unnamed input HSIO_SD_DATA2 487 sdgrp
line 22: unnamed input HSIO_SD_DATA3 488 sdgrp
line 23: unnamed input HSIO_SDIO_WP 489 sdiogrp
line 24: unnamed input HSIO_SDIO_XLK 490 sdiogrp
line 25: unnamed input HSIO_SDIO_CMD 491 sdiogrp
line 26: unnamed output power HSIO_SDIO_CDN 492 hsio_gpio0_26
line 27: unnamed input HSIO_SDIO_DATA0 493 sdiogrp
line 28: unnamed input HSIO_SDIO_DATA1 494 sdiogrp
line 29: unnamed input HSIO_SDIO_DATA2 495 sdiogrp
line 30: unnamed input HSIO_SDIO_DATA3 496 sdiogrp
...
Result Explanation:
Detailed information for each pin is displayed in the following format:
line <N>: <GpioName> <Mode> <Status> <PinName> <PinNum> <PinFunc>
line <N>: The pin number.<GpioName>: The name of the GPIO pin (displayed as “unnamed” if not named).<Mode>: The pin mode (e.g., input or output).<Status>: The pin status (e.g., active-low, bias=pull-up, drive=open-drain, etc.).<PinName>: The name of the pin.<PinNum>: The pin number.<PinFunc>: The multiplexing function of the pin.
Display Information for a Specific GPIO Chip
Command:
root@buildroot:~# hb_gpioinfo -c gpiochip4
Function:
Display pin information only for GPIO chip gpiochip4.
Output:
root@buildroot:~# hb_gpioinfo -c gpiochip4
gpiochip4 - 32 lines: @34120000.gpio: @379-410
[Number] [Mode] [Status] [GpioName] [PinName] [PinNum] [PinFunc]
line 0: unnamed input LSIO_UART7_RX 379 lsio_gpio0_0
line 1: unnamed input LSIO_UART7_TX 380 lsio_gpio0_1
line 2: unnamed input LSIO_UART7_CTS 381 lsio_gpio0_2
line 3: unnamed input LSIO_UART7_RTS 382 lsio_gpio0_3
line 4: unnamed input LSIO_UART1_RX 383 lsio_gpio0_4
line 5: unnamed input LSIO_UART1_TX 384 lsio_gpio0_5
line 6: unnamed input LSIO_UART1_CTS 385 lsio_gpio0_6
line 7: unnamed input LSIO_UART1_RTS 386 lsio_gpio0_7
line 8: unnamed input LSIO_UART2_RX 387 uart2grp
line 9: unnamed input LSIO_UART2_TX 388 uart2grp
line 10: unnamed input scl LSIO_UART3_RX 389 i2c5grp
line 11: unnamed input sda LSIO_UART3_TX 390 i2c5grp
line 12: unnamed input LSIO_UART4_RX 391 lsio_gpio0_12
line 13: unnamed input LSIO_UART4_TX 392 lsio_gpio0_13
line 14: unnamed input LSIO_SPI0_SCLK 393 Default
line 15: unnamed input LSIO_SPI1_SSN_1 394 Default
line 16: unnamed input LSIO_SPI1_SCLK 395 Default
line 17: unnamed input LSIO_SPI1_SSN 396 Default
line 18: unnamed input LSIO_SPI1_MISO 397 Default
line 19: unnamed input LSIO_SPI1_MOSI 398 Default
line 20: unnamed input LSIO_SPI2_SCLK 399 spi2grp
line 21: unnamed input LSIO_SPI2_SSN 400 spi2grp
line 22: unnamed input LSIO_SPI2_MISO 401 spi2grp
line 23: unnamed input LSIO_SPI2_MOSI 402 spi2grp
line 24: unnamed input LSIO_SPI3_SCLK 403 lsio_gpio0_24
line 25: unnamed input LSIO_SPI3_SSN 404 pinctrl_lpwm1_1
line 26: unnamed input LSIO_SPI3_MISO 405 lsio_gpio0_26
line 27: unnamed input LSIO_SPI3_MOSI 406 lsio_gpio0_27
line 28: unnamed input LSIO_SPI4_SCLK 407 uart5grp
line 29: unnamed input LSIO_SPI4_SSN 408 uart5grp
line 30: unnamed input LSIO_SPI4_MISO 409 lsio_gpio0_30
line 31: unnamed output phyreset LSIO_SPI4_MOSI 410 lsio_gpio0_31