AnsweredAssumed Answered

How to enable SPI2 on i.mx6ull

Question asked by Steven Yu on Oct 31, 2018
Latest reply on Nov 1, 2018 by igorpadykov

Hi all,

 

We would like to enable SPI2 on i.mx6ull, but we have no idea how to modify the device tree. Would you please advise us how to enable it and check it  ? Thanks.

 

We have already added this piece of description in arch\arm\boot\dts\imx6ull-14x14-evk.dts.

 

&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 22 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2_1 &pinctrl_ecspi2_cs_1>;
status = "disabled";

flash: n25q032@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "st,n25q032";
spi-max-frequency = <20000000>;
reg = <0>;
};
};

 

 

&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog_1>;
imx6ul-evk {

.................
pinctrl_ecspi2_cs_1: ecspi2_cs_grp-1 {
fsl,pins = <
MX6UL_PAD_UART4_RX_DATA__ECSPI2_SS0 0x10b0
>;
};

pinctrl_ecspi2_1: ecspi2grp-1 {
fsl,pins = <
MX6UL_PAD_UART5_TX_DATA__ECSPI2_MOSI 0x10b0
MX6UL_PAD_UART5_RX_DATA__ECSPI2_MISO 0x10b0
MX6UL_PAD_UART4_TX_DATA__ECSPI2_SCLK 0x10b0
>;
};

................

}

 

We have seen this piece of description in kernel-src\arch\arm\boot\dts\imx6ull.dtsi by default.

spi0 = &ecspi1;
spi1 = &ecspi2;
spi2 = &ecspi3;
spi3 = &ecspi4;

 

Regards,

shaotang

Outcomes