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

Device Tree • Configure overlay for SPI in kernel 6.8

$
0
0
Hi, I want to switch from Ubuntu 22.04 (kernel 5.15) to 24.04 (kernel 6.8). I have an overlay that configures SPI, and it worked perfectly with kernel 5.15. Below is the current overlay, with comments explaining how SPI should work.

Code:

    // Assign SPI 0 CS pin to PIN 20    fragment@2 {        target = <&spi0_cs_pins>;        frag2: __overlay__ {            brcm,pins = <20>;        };    };    // Configure pin 20 to be used as CS pin and set it to CS high as default.    // This links front panel to /dev/spidev0.0 and rear panel to /dev/spidev0.1.    // The CS pin will change state every time data is being sent over /dev/spidev0.0.    // No data on /dev/spidev0.0 sets pin to default state, allowing sending data to rear panel.    // That is why there is no CS pin for /dev/spidev0.1. Default state of /dev/spidev0.0 is in fact    // transmission state of /dev/spidev0.1    fragment@3 {        target = <&spi0>;        frag3: __overlay__ {            cs-gpios = <&gpio 20 0>;            status = "okay";            spidev@0 {                spi-cs-high;            };        };    };    // Export pin 10 as MOSI and pin 11 as CLK    // MISO on pin 9 is not exported leaving it as regular GPIO    fragment@4 {        target = <&spi0_pins>;        __overlay__ {            brcm,pins = <10 11>;        };    };
When I try to apply the overlay I get this error:

Code:

kernel: spi spi0.1: cannot find GPIO chip pinctrl-bcm2835, deferring
As a result, `/dev/spidev0.1` is not created and can't be used. This also causes the GPIO to malfunction—for example, it freezes when I call `gpioinfo`. If I modify `cs-gpios` and add a CS pin for spidev0.1, it works, but that is not how SPI should work in my setup.

Do you know what has changed between kernel versions that causes this problem, and how can I configure the overlay to work as expected?

Statistics: Posted by KmakD197 — Thu Oct 17, 2024 10:23 am



Viewing all articles
Browse latest Browse all 3881

Trending Articles