This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI clock toggling

Hi,

I am using DM8168 processor with EZSDK version of 5_05_02_00 and my Linux version is linux-2.6.37-psp04.04.00.01. U-boot version is u-boot-2010.06-psp04.04.00.01.

During system boot, I have probed the SPI clock line. In U-boot level, the line is active and while launching Linux the same line going low.

I want to know whether this sequence is done purposefully for any reason and which register bit changing this line as active low.

And also I want to know the complete the details of SPI SCK configuration for McSPI controller.

In my case, the SPI clock is not coming from the master. Struggling with this issue for long time.

Please help me out to solve this issue.

Thanks in advance.

Regards,
Salih

  • Salih,

    Do you mean that SPI clock and data is working fine in u-boot and failed in Linux kernel? Have you compared the SPI pinmux registers and SPI module registers values between u-boot and linux kernel?

    BR
    Pavel
  • Hi,


    I have checked those registers and it looks same values. I meant the SPI_CLK line is going high in U-boot and its going low in the Linux kernel. I am not meant it as its working fine.


    I want to know what are causes to not getting the SPI clock during data transfer. Whether I have to check this in the slave device or in the master side?..

    Please advice to me to proceed further

    Thanks in advance.

    Regards,
    Salih

  • Salih,

    Check pinmux of the SPI clock, check it just before to initiate the SPI transfer, make sure it is set to SPI clock mode and it is I/O (not output only).

    BR
    Pavel
  • Dear Pavel,

    Here, in our case, I have added the below line for pin mux of SPI in my board file:

    static struct omap_board_mux board_mux[] __initdata = {

            TI816X_MUX(SPI_D0, OMAP_MUX_MODE0),
            TI816X_MUX(SPI_SCLK, OMAP_MUX_MODE0),
            TI816X_MUX(SPI_SCS0, OMAP_MUX_MODE0),

    };

    Hopefully, the MUX pins will be configured below the devices getting registered. What is SPI clock mode ?.. I have seen in the reference manual, there is only one MUX mode for the above pins (sprugx8b). 

    I have attached the screen shot with this post

    Please help me out on why the clock is not coming out from the master.

    Thanks in advance.

    Regards,
    Salih

  • Hi,

    Any updates on this above post?

    Waiting for your valuable reply.

    Thanks in advance.

    Regards,
    Salih

  • Salih,

    Make sure you have the value of 0x00000000 in PINCTRL166 register just before starting the data transfer. Make sure you are connecting DM816x R2 physical pin to your sensor and probing this pin. Make sure you are making good HW connectivity of this pin.

    Check also that SPI CS signal is in valid level to select the external device.

    BR
    Pavel
  • Dear Pavel,

    Thanks for your reply.

    Regards,
    Salih