Some questions regarding device tree and ecspi

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Some questions regarding device tree and ecspi

3,725 Views
heinrichgeiger
Contributor I

Hello colleagues,

I am developing a driver for TI SRC4193 (asynchronous sample-rate converter) and have some questions regarding the device tree.

The SRC4193 is connected to ECSPI2, here the configuration:

&ecspi2 {
fsl,spi-num-chipselects = <2>;
cs-gpios = <&gpio5 12 GPIO_ACTIVE_LOW>
, <&gpio5 9 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";

src4193@0 {
compatible="ti,src4193";
spi-max-frequency = <10000000>;
};
};

Pinmux looks like this:

&iomuxc {

...
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX6QDL_PAD_DISP0_DAT16__ECSPI2_MOSI 0x100b1
MX6QDL_PAD_DISP0_DAT17__ECSPI2_MISO 0x100b1
MX6QDL_PAD_DISP0_DAT19__ECSPI2_SCLK 0x100b1
MX6QDL_PAD_DISP0_DAT18__ECSPI2_SS0 0x000b1 /* CS0 */
MX6QDL_PAD_DISP0_DAT15__ECSPI2_SS1 0x000b1 /* CS1 */
>;
};
....
};

ECSPI2 has two CS lines.

My questions:

1. How can I explicitly assign a CS line (in this case CS1) to the SRC4193?

2. When do the settings in PINMUX become active? When booting? When loading the driver for SRC4192?

My hardware and sorftware:

Linux: Kernel 4.9.88 with boundary devices RootFS

Soc: i.MX6Dual on Embest MarsBoard

Many thanks and regards,

Heinrich

Labels (1)
0 Kudos
Reply
3 Replies

3,029 Views
darko1
Contributor I

I am also using i.MX6Dual on Embest MarsBoard

With the following setup:


&ecspi2 {     
fsl,spi-num-chipselects = <1>;     
cs-gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;     
pinctrl-names = "default";     
pinctrl-0 = <&pinctrl_ecspi2>;     
status = "okay";      

spidev@0x00 {         
compatible = "spidev";         
spi-max-frequency = <20000000>;         
reg = <0>;     
}; 

};

Following this procedure:

https://github.com/FrankBau/meta-marsboard-bsp/wiki/Using-SPI

I get no output signals on pins 15,17,19,21 on J11 connector. Just 50 Hz noise signal, all the time

Any idea why there is no output on pins ?

Loop test on SPI is working and device /dev/spidev1.0 is active.

0 Kudos
Reply

3,029 Views
darko1
Contributor I

Just to help someone else with same issue. Correct pins for MarSBoard and ecspi2 are given in the picture.

It now works correctly with 

 MX6QDL_PAD_EIM_RW__GPIO2_IO26           0x1b0b1 /* SS0 */   

ECSPI2_PINS.jpgMarsBoard_ECSPI2_PINS.jpg

0 Kudos
Reply

3,029 Views
igorpadykov
NXP Employee
NXP Employee

Hi Heinrich

boundary devices RootFS is not supported by nxp, it is supported by boundary devices

support. For nxp dts ecspi example with "cs-gpios" one can look at

imx6qdl-sabresd.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

patch for support native ecspi cs :

[v4,1/3] spi: imx: GPIO chip select DT property should not be required - Patchwork 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------

0 Kudos
Reply