Swi-mdm9x28 Device tree


#1

Hi,

Does any one have an idea about the SPI interface on which device tree file is defined for the WP7607 yocto distibution, I need to add an SPI driver and I want to bound the “of_device_id” table with the spidev1.0 that is used for the spidev API.


#2

Hi @Souhail,

I think this would be arch/arm/boot/dts/qcom/mdm9607-wp76xx.dtsi


#3

Thank you for your help, by refering to this file and mdm9607-pinctrl.dtsi I could not found how the spi1 interface is bounded with the pins 51, 52, 53, 55 from the chip. Do you have any idea please ?


#4

Hi,

SPI can be bound with the pins to which it has been allocated we can also use GPIO lines. Also If we look at the dtsi file we can see how the pins are organized such as which pin is used MOSI,MISO,Clock and IRQ lines. Below is SPI configuration we see in mdm9607-pinctrl.dtsi where gpio0 - gpio7 are used.

spi1_sleep: spi1_sleep {
/* suspended state /
mux {
/
MOSI, MISO, CLK */
pins = “gpio4”, “gpio5”, “gpio7”;
function = “gpio”;
};

                            config {
                                    pins = "gpio4", "gpio5", "gpio7";
                                    drive-strength = <2>; /* 2 MA */
                                    bias-pull-down; /* PULL Down */
                            };
                    };

spi_0: spi_hub: spi@f9926000 {
compatible = “qlspi,qlspi_eoss3”;
reg = <1>;
interrupt-parent = <&msmgpio>;
interrupts = <94 0>;
/* spi-max-frequency = <18000000>; /
spi-max-frequency = <6000000>;
qlspi,irq-gpio = <&msmgpio 59 0x00>;
qlspi,cs-gpio = <&msmgpio 21 0x00>;
qlspi,mosi-gpio = <&msmgpio 52 0x00>;
qlspi,miso-gpio = <&msmgpio 53 0x00>;
qlspi,clk-gpio = <&msmgpio 58 0x00>;
/
qlspi,sw_intr_1_gpio = <&msmgpio 94 0x00>; /
/
SPI device on the slave device which it has to enumerate in spi_0 dev node.
spidev0@1 {
compatible = “sierra,spidev”;
spi-max-frequency = <50000000>;
reg = <0>;
};
};

In the above example 52 is for mosi,53 is for miso,58 is clock and 21 is chip select which is defined as part of SOC.