Closed seanshpark closed 5 months ago
gpiolib_init_by_name
vs gpiolib_init
gpiolib_init
/proc/device-tree/aliases/
gpio0
~ gpio3
gpio
/proc/device-tree/compatible
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
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++) {
__start_gpiochips
and __stop_gpiochips
came from.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
What is going inside?