Hello,
I plan to connect some devices to VIM3 board using gpio pins but will be using , Kernel 5.4 . My AOSP build will be android 11 .I have referred this link [How To Access GPIO | Khadas Documentation] but it only has numbers for kernel 4.9 and NOT 5.4.
Could some one help me on how to get the GPIO numbers on this Kernal 5.4 ?. I would really appreciate any suggestions.
I think I got my Answer .
1|vim3:/ $ cat /sys/kernel/debug/pinctrl/ff634400.bus:pinctrl@40-pinctrl-meson/gpio-ranges
GPIO ranges handled:
0: periphs-banks GPIOS [427 - 512] PINS [0 - 85]
vim3:/ $ cat /sys/kernel/debug/pinctrl/ff800000.sys-ctrl:pinctrl@14-pinctrl-meson/gpio-ranges
GPIO ranges handled:
0: aobus-banks GPIOS [412 - 426] PINS [0 - 14]
vim3:/ $ cat /sys/kernel/debug/pinctrl/ff800000.sys-ctrl:pinctrl@14-pinctrl-meson/pins
registered pins: 15
pin 0 (GPIOAO_0) ff800000.sys-ctrl:pinctrl@14
pin 1 (GPIOAO_1) ff800000.sys-ctrl:pinctrl@14
pin 2 (GPIOAO_2) ff800000.sys-ctrl:pinctrl@14
pin 3 (GPIOAO_3) ff800000.sys-ctrl:pinctrl@14
pin 4 (GPIOAO_4) ff800000.sys-ctrl:pinctrl@14
pin 5 (GPIOAO_5) ff800000.sys-ctrl:pinctrl@14
pin 6 (GPIOAO_6) ff800000.sys-ctrl:pinctrl@14
pin 7 (GPIOAO_7) ff800000.sys-ctrl:pinctrl@14
pin 8 (GPIOAO_8) ff800000.sys-ctrl:pinctrl@14
pin 9 (GPIOAO_9) ff800000.sys-ctrl:pinctrl@14
pin 10 (GPIOAO_10) ff800000.sys-ctrl:pinctrl@14
pin 11 (GPIOAO_11) ff800000.sys-ctrl:pinctrl@14
pin 12 (GPIOE_0) ff800000.sys-ctrl:pinctrl@14
pin 13 (GPIOE_1) ff800000.sys-ctrl:pinctrl@14
pin 14 (GPIOE_2) ff800000.sys-ctrl:pinctrl@14
vim3:/ $ cat /sys/kernel/debug/pinctrl/ff634400.bus:pinctrl@40-pinctrl-meson/pins
registered pins: 85
pin 0 (GPIOZ_0) ff634400.bus:pinctrl@40
pin 1 (GPIOZ_1) ff634400.bus:pinctrl@40
pin 2 (GPIOZ_2) ff634400.bus:pinctrl@40
pin 3 (GPIOZ_3) ff634400.bus:pinctrl@40
pin 4 (GPIOZ_4) ff634400.bus:pinctrl@40
pin 5 (GPIOZ_5) ff634400.bus:pinctrl@40
pin 6 (GPIOZ_6) ff634400.bus:pinctrl@40
pin 7 (GPIOZ_7) ff634400.bus:pinctrl@40
pin 8 (GPIOZ_8) ff634400.bus:pinctrl@40
pin 9 (GPIOZ_9) ff634400.bus:pinctrl@40
pin 10 (GPIOZ_10) ff634400.bus:pinctrl@40
pin 11 (GPIOZ_11) ff634400.bus:pinctrl@40
pin 12 (GPIOZ_12) ff634400.bus:pinctrl@40
pin 13 (GPIOZ_13) ff634400.bus:pinctrl@40
pin 14 (GPIOZ_14) ff634400.bus:pinctrl@40
pin 15 (GPIOZ_15) ff634400.bus:pinctrl@40
pin 16 (GPIOH_0) ff634400.bus:pinctrl@40
pin 17 (GPIOH_1) ff634400.bus:pinctrl@40
pin 18 (GPIOH_2) ff634400.bus:pinctrl@40
pin 19 (GPIOH_3) ff634400.bus:pinctrl@40
pin 20 (GPIOH_4) ff634400.bus:pinctrl@40
pin 21 (GPIOH_5) ff634400.bus:pinctrl@40
pin 22 (GPIOH_6) ff634400.bus:pinctrl@40
pin 23 (GPIOH_7) ff634400.bus:pinctrl@40
pin 24 (GPIOH_8) ff634400.bus:pinctrl@40
pin 25 (BOOT_0) ff634400.bus:pinctrl@40
pin 26 (BOOT_1) ff634400.bus:pinctrl@40
pin 27 (BOOT_2) ff634400.bus:pinctrl@40
pin 28 (BOOT_3) ff634400.bus:pinctrl@40
pin 29 (BOOT_4) ff634400.bus:pinctrl@40
pin 30 (BOOT_5) ff634400.bus:pinctrl@40
pin 31 (BOOT_6) ff634400.bus:pinctrl@40
pin 32 (BOOT_7) ff634400.bus:pinctrl@40
pin 33 (BOOT_8) ff634400.bus:pinctrl@40
pin 34 (BOOT_9) ff634400.bus:pinctrl@40
pin 35 (BOOT_10) ff634400.bus:pinctrl@40
pin 36 (BOOT_11) ff634400.bus:pinctrl@40
pin 37 (BOOT_12) ff634400.bus:pinctrl@40
pin 38 (BOOT_13) ff634400.bus:pinctrl@40
pin 39 (BOOT_14) ff634400.bus:pinctrl@40
pin 40 (BOOT_15) ff634400.bus:pinctrl@40
pin 41 (GPIOC_0) ff634400.bus:pinctrl@40
pin 42 (GPIOC_1) ff634400.bus:pinctrl@40
pin 43 (GPIOC_2) ff634400.bus:pinctrl@40
pin 44 (GPIOC_3) ff634400.bus:pinctrl@40
pin 45 (GPIOC_4) ff634400.bus:pinctrl@40
pin 46 (GPIOC_5) ff634400.bus:pinctrl@40
pin 47 (GPIOC_6) ff634400.bus:pinctrl@40
pin 48 (GPIOC_7) ff634400.bus:pinctrl@40
pin 49 (GPIOA_0) ff634400.bus:pinctrl@40
pin 50 (GPIOA_1) ff634400.bus:pinctrl@40
pin 51 (GPIOA_2) ff634400.bus:pinctrl@40
pin 52 (GPIOA_3) ff634400.bus:pinctrl@40
pin 53 (GPIOA_4) ff634400.bus:pinctrl@40
pin 54 (GPIOA_5) ff634400.bus:pinctrl@40
pin 55 (GPIOA_6) ff634400.bus:pinctrl@40
pin 56 (GPIOA_7) ff634400.bus:pinctrl@40
pin 57 (GPIOA_8) ff634400.bus:pinctrl@40
pin 58 (GPIOA_9) ff634400.bus:pinctrl@40
pin 59 (GPIOA_10) ff634400.bus:pinctrl@40
pin 60 (GPIOA_11) ff634400.bus:pinctrl@40
pin 61 (GPIOA_12) ff634400.bus:pinctrl@40
pin 62 (GPIOA_13) ff634400.bus:pinctrl@40
pin 63 (GPIOA_14) ff634400.bus:pinctrl@40
pin 64 (GPIOA_15) ff634400.bus:pinctrl@40
pin 65 (GPIOX_0) ff634400.bus:pinctrl@40
pin 66 (GPIOX_1) ff634400.bus:pinctrl@40
pin 67 (GPIOX_2) ff634400.bus:pinctrl@40
pin 68 (GPIOX_3) ff634400.bus:pinctrl@40
pin 69 (GPIOX_4) ff634400.bus:pinctrl@40
pin 70 (GPIOX_5) ff634400.bus:pinctrl@40
pin 71 (GPIOX_6) ff634400.bus:pinctrl@40
pin 72 (GPIOX_7) ff634400.bus:pinctrl@40
pin 73 (GPIOX_8) ff634400.bus:pinctrl@40
pin 74 (GPIOX_9) ff634400.bus:pinctrl@40
pin 75 (GPIOX_10) ff634400.bus:pinctrl@40
pin 76 (GPIOX_11) ff634400.bus:pinctrl@40
pin 77 (GPIOX_12) ff634400.bus:pinctrl@40
pin 78 (GPIOX_13) ff634400.bus:pinctrl@40
pin 79 (GPIOX_14) ff634400.bus:pinctrl@40
pin 80 (GPIOX_15) ff634400.bus:pinctrl@40
pin 81 (GPIOX_16) ff634400.bus:pinctrl@40
pin 82 (GPIOX_17) ff634400.bus:pinctrl@40
pin 83 (GPIOX_18) ff634400.bus:pinctrl@40
pin 84 (GPIOX_19) ff634400.bus:pinctrl@40
Hi @Furhad_Jidda ,
Are you flashing image by the following steps?
fastboot flash boot boot.img
fastboot flash super super.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
fastboot flash recovery recovery.img
fastboot flash dtbo dtbo-unsigned.img
fastboot reboot
When I flash kernel 5.4, nothing under /sys/kernel/debug/
console:/ # ls /sys/kernel/debug/
console:/ # ls -lht /sys/kernel/debug
total 0
console:/ #
Have you met this problem?
Best Regards
@lthxxn Yes , I have seen this. This usually means that the debugfs partition is not mounted , you can mount the debugfs partition with this.
adb shell mount -t debugfs debugfs /sys/kernel/debug
Seems not take effect…
mount: bad /etc/fstab: No such file or directory
@lthxxn aah yes you are correct you need to be a su to do that follow this
- login vim3 shell using
adb shell
Then on the vim3 terminal do this - su
- mount -t debugfs debugfs /sys/kernel/debug
Successfully!
So the only question remain is, why we need mount it manually…
Best Regards
It seems that if I replace the super.img to official release in VIM3 Android T(12) V211126 Preview Rom Release, the debugfs will automatically mount.
@lthxxn in the past i did not have to do this but lately I am needing to mount it, not sure why may be @tenk.wang or @numbqq could help answer on what changed. It would be nice to know if there is anything that needs to be done during building the image so we do not have to do this during development phases