Hi,
Yes you are right. Some important points to consider for this numbering :
- The pin number is the $PINS value and should not be confused with the GPIO.
- Let us take an example of P8_12 ( $PINS value 12 ) in mode 0x27 ( Input Mode7 Pull Down ). Viewing this pins file helps in the corresponding readings.
- You can see that pin 0 is allocated to eMMC. Moreover, you can query the value at the memory address. P8_12 is mapped at the memory address 44e10830.
- "cat pingroups" will show you the registered pin groups.
root@beaglebone:/sys/kernel/debug/pinctrl/44e10800.pinmux# cat pins |more
registered pins: 142
pin 0 (44e10800) 00000031 pinctrl-single
pin 1 (44e10804) 00000031 pinctrl-single
pin 2 (44e10808) 00000031 pinctrl-single
pin 3 (44e1080c) 00000031 pinctrl-single
pin 4 (44e10810) 00000031 pinctrl-single
pin 5 (44e10814) 00000031 pinctrl-single
pin 6 (44e10818) 00000031 pinctrl-single
pin 7 (44e1081c) 00000031 pinctrl-single
pin 8 (44e10820) 00000027 pinctrl-single
pin 9 (44e10824) 00000027 pinctrl-single
pin 10 (44e10828) 00000027 pinctrl-single
pin 11 (44e1082c) 00000027 pinctrl-single
pin 12 (44e10830) 00000027 pinctrl-single
....
The pin 12 on the P9 header ( GPIO1_28 - 1*32 + 28 ) is the GPIO60 ( not PIN60 ). If we search for the same offset (0x078) we see that pin 30 is 30 HEX ( 110000 in binary ) which relates to GPIO pin configuration settings ( mmode , puden , etc).
Hope it helps. Please correct me if I'm wrong.