AnsweredAssumed Answered

spi first time op error in imx6ull with kernel 4.19.35

Question asked by he lun on Jan 17, 2020
Latest reply on Jan 26, 2020 by igorpadykov

hardware: imx6ull

kernel: kernel 4.19.35

in custom board, i use ecspi1 controller two devices,  dts as follow:

ecspi1 {
   fsl,spi-num-chipselects = <2>;
   cs-gpios = <
      &gpio5 9 0
      &gpio3 5 0
   >;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi1_1 &pinctrl_ecspi1_spi0 &pinctrl_ecspi1_spi1>;
   status = "okay";

   spi0: spidev0 {
      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "rohm,dh2228fv";
      spi-max-frequency = <20000000>;

      reg = <0>;
   };
   spi1: spidev1 { 

      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "rohm,dh2228fv";
      spi-max-frequency = <20000000>;

      reg=<1>;

   };
};

when kernel start, i use app operate spidev1 to read devid,  it's failed to get it in first time, and soon on  i read it again, it's always ok. only first read error.

when kernel start, i read spidev0 devid in first time, it's always ok contain first time. wha't wrong with it, help me

i use logic analyize the wave when first read spidev1, wave form as follow:

   

please ignore mosi, before operate ecspi1, i config spi works mode3, but i found CLK is low in idle in first transfer, again test wave about spidev1, i can read fine devid, CLK wave is high in idle about its wave, what's wrong with it at first time, please help me, thanks

Outcomes