devicetree: bcm2835:

Stephen Warren swarren at wwwdotorg.org
Mon Aug 10 21:21:48 PDT 2015


On 08/10/2015 02:41 AM, Martin Sperl wrote:
> Hi!
> 
> When adding a gpio section to enable the auxiliar spi device pins
> with the correct mode to the bcm2835 device treesimilar to this:
>         /* SPI1 pins */
>         spi1_pins: spi1_pins {
>                 brcm,pins = <19 20 21>;
>                 brcm,function = <BCM2835_FSEL_ALT4>
>         };
>         /* SPI1 GPIO-chipselects */
>         spi1_cs_pins: spi1_cs_pins {
>                 brcm,pins = <18 17 16>;
>                 brcm,function = <BCM2835_FSEL_OUT>;
>         };
> 
>         /* SPI2 pins */
>         spi2_pins: spi2_pins {
>                 brcm,pins = <40 41 42>;
>                 brcm,function = <BCM2835_FSEL_ALT4>;
>         };
>         /* SPI2 GPIO-chipselects */
>         spi2_cs_pins: spi2_cs_pins {
>                 brcm,pins = <43 44 45>;
>                 brcm,function = <BCM2835_FSEL_OUT>
>         };

You don't need to add all that to the SPI node. Just set up the existing
pinctrl configurations in the pinctrl node as you need them. Per-device
DT configuration nodes are useful if you need to do dynamic pinmuxing,
but there's no need for that to simply set up the usage of the SPI/I2C
pins at boot.



More information about the linux-rpi-kernel mailing list