Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Raspberry Pi zero 2 dtb and devices



dtyson%anduin.org.uk@localhost (Dave Tyson) writes:

>> /dts-v1/;
>> 
>> / {
>>         compatible = "brcm,bcm2835-spi";
>> 
>>         fragment@0 {
>>                 target-path = "/soc/spi@7e204000";
>> 
>>                 __overlay__ {
>>                         status = "okay";
>>                 };
>>         };
>> };
>> 
>> 
>> However, even if you manage to get the SPI interface found... it will
>> show up in the dmesg properly if you manage that...  it probably won't
>> work.

Compile the following with e.g.:

dtc -@ -I dts -O dtb -o spi.dtbo spi.dts

Copy spi.dtbo to /boot/overlays/ and add

dtoverlay=spi.dtbo

to config.txt. The snippet references entries from
the main dtb, in particular the spi_gpio7 pinctrl
that configures GPIO7-11 with function 4:

bcm2835_gpioreg.h:#define BCM2835_GPIO_ALT0     4

This should attach the SPI driver and configure the
GPIO pins for SPI.

-------------------------------snip-------------------
/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2835";

        fragment@0 {
                target = <&spi>;

                __overlay__ {
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <&spi0_gpio7>;
                };
        };
};

-------------------------------snip-------------------


Greetings,



Home | Main Index | Thread Index | Old Index