Hello @Embedded-world
I hope you are doing very well.
Linux kernel base the GPIO number based on the index, in this case:
- gpiochip0: GPIOs 512-543, parent: platform/43810000 (real GPIO is GPIO2)
- gpiochip1: GPIOs 544-575, parent: platform/43820000 (real GPIO is GPIO3)
- gpiochip2: GPIOs 576-607, parent: platform/43830000 (real GPIO is GPIO4)
- gpiochip3: GPIOs 608-639, parent: platform/47400000 (real GPIO is GPIO1)
But as I said, Linux kernel take as reference the index, so Real index:
- Real GPIO2 is Index 0
- Real GPIO3 is Index 1
- Real GPIO4 is Index 2
- Real GPIO1 is Index 3
You can use this formula to calculate your desired pin:
GPIO_NUMBER = GPIO_BASE_INDEX + PIN_INDEX
As example, we can take the GPIO2_IO00:
GPIO_NUMBER = (512) + (0) = 512.
Also, you can take a look to the gpiod tool installed by default in our BSP. It is easy to use (gpiodetect, gpioset, gpioget, etc.):

I hope this can helps to you.
Best regards,
Salas.