Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5045

Device Tree • Re: RPi5 and RP1 GPIO ALT function

$
0
0
The pin declaration style you are referring to is intended only for backwards compatibility with older Pis. The RP1 pinctrl driver includes a translation table from old-style "brcm,function" values and the numbers for the equivalent functions on RP1. Overlays which are specific to Pi 5/RP1 should use the "generic pinctrl" and "generic pinmux" declaration styles, many examples of which you will find in rp1.dtsi: https://github.com/raspberrypi/linux/bl ... .dtsi#L470

Code:

rp1_uart0_14_15: rp1_uart0_14_15 {pin_txd {function = "uart0";pins = "gpio14";bias-disable;};pin_rxd {function = "uart0";pins = "gpio15";bias-pull-up;};};...rp1_i2s0_18_21: rp1_i2s0_18_21 {function = "i2s0";pins = "gpio18", "gpio19", "gpio20", "gpio21";bias-disable;};
You will find a table of the function names in the driver (https://github.com/raspberrypi/linux/bl ... rp1.c#L413) - they should really be in a DT bindings file as well. Note that if you'd rather use the numeric values, "alt0" to "alt8" are also defined, with the exception of "alt5" which is called "gpio".

Statistics: Posted by PhilE — Wed Jul 17, 2024 12:46 pm



Viewing all articles
Browse latest Browse all 5045

Trending Articles