seanshpark / rpigpio2

RPi GPIO with node.js v2
Apache License 2.0
0 stars 0 forks source link

Study: raspberrypi/utils/pinctrl #2

Closed seanshpark closed 5 months ago

seanshpark commented 7 months ago

What is going inside?

seanshpark commented 7 months ago

gpiolib_init_by_name vs gpiolib_init

gpiolib_init


RPi5

$ cat /proc/device-tree/aliases/gpio0
/axi/pcie@120000/rp1/gpio@d0000

$ cat /proc/device-tree/compatible
raspberrypi,5-model-bbrcm,bcm2712

RPi3+

$ cat /proc/device-tree/aliases/gpio
/soc/gpio@7e20000

$ cat /proc/device-tree/compatible
raspberrypi,3-model-b-plusbrcm,bcm2837
seanshpark commented 7 months ago

RPi3+

$ ./pinctrl set 23 op dh
!!! dt_read_prop: /proc/device-tree/aliases/gpio0
!!! dt_read_prop: /proc/device-tree/aliases/gpio
!!! dt_read_prop: /proc/device-tree/soc/gpio@7e200000/compatible
!!! gpio_find_chip: brcm,bcm2835-gpio
!!! chip-name: bcm2835
!!! chip-compatible: brcm,bcm2835-gpio
!!! dt_read_prop: /proc/device-tree/soc/#address-cells
!!! dt_read_prop: /proc/device-tree/soc/#size-cells
!!! dt_read_prop: /proc/device-tree/soc/gpio@7e200000/reg
!!! dt_read_prop: /proc/device-tree/soc/ranges
!!! dt_read_prop: /proc/device-tree//#address-cells
!!! dt_read_prop: /proc/device-tree//#size-cells
!!! dt_read_prop: /proc/device-tree/aliases/gpio1
!!! dt_read_prop: /proc/device-tree/soc/gpio@7e200000/gpio-line-names
$ cat /proc/device-tree/soc/gpio@7e200000/compatible
brcm,bcm2835-gpio
for (chip = &__start_gpiochips; name && chip < &__stop_gpiochips; chip++) {
seanshpark commented 7 months ago

RPi5

$ cat /proc/device-tree/aliases/gpio0
/axi/pcie@120000/rp1/gpio@d0000

$ cat /proc/device-tree/aliases/gpio1
/soc/gpio@7d508500

$ cat /proc/device-tree/aliases/gpio3
/soc/pinctrl@7d504100

$ cat /proc/device-tree/aliases/gpio4
/soc/pinctrl@7d510700

/proc/device-tree + alias + /compatible

$ cat /proc/device-tree/axi/pcie@120000/rp1/gpio@d0000/compatible
raspberrypi,rp1-gpio

$ cat /proc/device-tree//soc/gpio@7d508500/compatible
brcm,brcmstb-gpio

$ cat /proc/device-tree/soc/pinctrl@7d504100/compatible 
brcm,bcm2712-pinctrl

$ cat /proc/device-tree/soc/pinctrl@7d510700/compatible 
brcm,bcm2712-aon-pinctrl