8devices / openwrt-8devices

OpenWRT for 8devices WiFi modules
GNU General Public License v2.0
89 stars 72 forks source link

Are there examples of device tree for a SPI slave device? #37

Open codan-soea opened 6 days ago

codan-soea commented 6 days ago

Hello

I am trying to create a device tree for a SPI slave device for Linux OpenWRT 6.6.58, my SPI device will be interfaced to Lima module via SPI. I have used "target/linux/ath79/dts/qca9531_8dev_lima.dts" as template. However, I found that by just putting another client as follows will not work.

&spi { status = "okay";

/* Winbond W25Q256 SPI flash */
flash@0 {
    .....
    };

    /* more clients */
    bmi160: bmi160@1 {
    compatible = "bosch,bmi160";
    reg = <1>;
    spi-max-frequency = <7500000>;
     };

};

I am wondering are there device tree examples of how to connect a SPI slave to Lima module. Thanks!

mantas-p commented 3 days ago

Hi, you probably need to describe how CS (chip select) is connected - see https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g.dtsi#l158