AnsweredAssumed Answered

QorIQ - LS1021A: Chipselect with DSPI

Question asked by Leonard Van Voorthuysen on Nov 14, 2017
Latest reply on Jan 24, 2018 by Yiping Wang

Hi,

 

I try to use spi interface throught /dev/spidev0.0

 

I have already done: 

 

1. RCW: activate SPI1

 

bits 396 to 398: 001

       402 to 404: 001

2. Device tree:

  • DTSI

dspi0: dspi@2100000 {
   compatible = "fsl,vf610-dspi";
   #address-cells = <1>;
   #size-cells = <0>;
   reg = <0x0 0x2100000 0x0 0x10000>;
   interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
   clock-names = "dspi";
   clocks = <&platform_clk 1>;
   spi-num-chipselects = <2>;
   big-endian;
   tcfq-mode;
   status = "enable";

};

  • DTS

&dspi0 {
   bus-num = <0>;
   status = "okay";

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

   };
};

 

In this configuration, it's possible to see the signals SPI1_SOUT (mosi) and SPI1_SCK (clock) on the oscilloscope.

I use spi-tools to test this:

./spi-config -d /dev/spidev0.0 --mode=3 -s 100000

echo test | ./spi-pipe -d /dev/spidev0.0 

However, the SPI1_CS0 (chipselect) stand at low level, thats mean the slave is always selected. In my case, the slave need to have some change on the CS to answer.

 

Do you have anybody already use spi with the chipselect ?

 

thank you for your futher answer.

 

Léonard.

Outcomes