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.

changes in SPI kernel driver for RDK

Hi,

How can I change bit_per_word setting in SPI driver? Default driver uses 8-bit, I want to change it to 32-bit. Whenevr I tried to do that kernal could not boot properly and gives error in dma section. I did not understand the reason. Could anyone please help me, to resolve this?

Thank

Rakesh Modi

  • Hi Rakesh,

    The McSPI peripheral module word length can be configured (per channel; 4 channels in DM816x device - 0,1,2,3) from 4 bits per word to 32 bits per word in register MCSPI_CHxCONF[11:7] WL (x = 0,1,2 or 3). When write 0x7 in [11:7] WL, word is 8 bits. When write 0x1F in [11:7] WL, word is 32 bits. See DM816x TRM, chapter 16 Serial Port Interface (SPI).

    The SPI driver user guide is below:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_McSPI_Driver_Guide

    I have no view to RDK, I work with EZSDK, but you can check if the below (which is valid for EZSDK) is also valid for RDK.

    The SPI driver in u-boot is located at u-boot-2010.06-psp04.04.00.01/drivers/spi/omap3_spi.c (.h) and we have the following regarding SPI word length programming:

    #define OMAP3_MCSPI_CHCONF_WL_MASK    (0x1f << 7)

    #define WORD_LEN    8

    /* wordlength */
        conf &= ~OMAP3_MCSPI_CHCONF_WL_MASK;
        conf |= (WORD_LEN - 1) << 7;

    The SPI driver in linux kernel is located at linux-2.6.37-psp04.04.00.01/drivers/spi/omap2_mcspi.c and we have the following regarding SPI word length programming:

    #define OMAP2_MCSPI_CHCONF_WL_MASK    (0x1f << 7)

    /* wordlength */
        l &= ~OMAP2_MCSPI_CHCONF_WL_MASK;
        l |= (word_len - 1) << 7;

    Regards,

    Pavel