I was using OpenWrt 19 as my system base, and now I am updating my system to use OpenWrt 22 (RC6). It uses GPIOs and UARTs of a MT7688 or MT7628 (Widora).
Listing the GPIOs on OpenWrt 19 (cat /sys/kernel/debug/gpio
):
gpiochip0: GPIOs 0-31, parent: platform/10000600.gpio, 10000600.gpio:
gpio-11 ( |BTN_0 ) in hi
gpio-17 ( |sysfs ) out hi
gpiochip1: GPIOs 32-63, parent: platform/10000600.gpio, 10000600.gpio:
gpio-38 ( |reset ) in hi
gpio-39 ( |sysfs ) out lo
gpio-40 ( |sysfs ) out hi
gpiochip2: GPIOs 64-95, parent: platform/10000600.gpio, 10000600.gpio:
We can see the low numbers. And listing on OpenWrt 22:
gpiochip2: GPIOs 416-447, parent: platform/10000600.gpio, 10000600.gpio-bank2:
gpiochip1: GPIOs 448-479, parent: platform/10000600.gpio, 10000600.gpio-bank1:
gpio-454 ( |reset ) in hi IRQ ACTIVE LOW
gpiochip0: GPIOs 480-511, parent: platform/10000600.gpio, 10000600.gpio-bank0:
gpio-491 ( |BTN_0 ) in lo IRQ ACTIVE LOW
gpio-497 ( |sysfs ) out hi
We can see high numbers.
I know that I could calculate these numbers like: bank_base + pin_number.
I did it with pin 17, which is 480 + 17 = 497. I exported it, and you can see it on the listing above.
But the idea is not changing these numbers everywhere in my system. Is it possible?
I tried to change the mt7628an.dtsi and mt7628an_widora_neo.dtsi files to try change these ranges.
I saw there is a gpio-base property, but I do not know if it can solve my problem and how to edit properly these files.