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.

SPI1 chip select 2 interface on L138

Dear All,

we are using L138 EVM and custom daughter card which has LCD interface. We use SPI1 to configure LCD driver. We use SPI1_SCS[2] for chip select. I have made following changes in kernel source. Currently on EVM SPI flash is on SPI1 interface with SPI_SCS[0].

I am using dvsdk_omapl138-evm_4_01_00_09 and kernel version is linux-2.6.33-rc4-psp03.20.00.14

-----------------------------------------------------------------------------------------------------------------------

In file board_arch/arm/mach-davinci/da850.c

 

 

struct davinci_ili9325_info davinci_spi_ili9325_info = {

        .chip_sel = 0x04,               //ToDo: double check this

        .commit_delay = 3,

};

static struct spi_board_info da850_spi_board_info[] = {
        [0] = {
                .modalias = "m25p80",
                .platform_data = &spi_flash_data,
                .mode = SPI_MODE_0,
                .max_speed_hz = 30000000,       /* max sample rate at 3V */
                .bus_num = 1,
                .chip_select = 0,
        },
        [1] = {
                .modalias = DAVINCI_SPI_ILI9325_NAME,
                .platform_data = &davinci_spi_ili9325_info,
                .mode = SPI_MODE_0,
                .irq = 0,
                .max_speed_hz = 10 * 1000 * 1000 /* max sample rate at 3V */ ,
                .bus_num = 1,
                .chip_select = 2,       
        },
};
In file arch/arm/mach-davinci/da850.c
/* SPI1 function */
        MUX_CFG(DA850, SPI1_CS_0,       5,      4,      15,     1,      false)
        MUX_CFG(DA850, SPI1_CS_2,       4,      28,     15,     1,      false)                  
        MUX_CFG(DA850, SPI1_CLK,        5,      8,      15,     1,      false)
        MUX_CFG(DA850, SPI1_SOMI,       5,      16,     15,     1,      false)
        MUX_CFG(DA850, SPI1_SIMO,       5,      20,     15,     1,      false)
const short da850_spi1_pins[] __initdata = {
        DA850_SPI1_CS_0, DA850_SPI1_CS_2, DA850_SPI1_CLK, DA850_SPI1_SOMI, DA850_SPI1_SIMO,                     
        -1
};
In file arch/arm/mach-davinci/devices-da8xx.c
static struct davinci_spi_platform_data da850_spi1_pdata = {
        .version        = SPI_VERSION_2,
//      .num_chipselect = 1,
        .num_chipselect = 3,            QUESTION: Is this correct?
        .wdelay         = 0,
        .odd_parity     = 0,
        .parity_enable  = 0,
        .wait_enable    = 0,
        .timer_disable  = 0,
        .clk_internal   = 1,
        .cs_hold        = 1,
        .intr_level     = 0,
        .poll_mode      = 1,
        .use_dma        = 1,
        .c2tdelay       = 8,
        .t2cdelay       = 8,
};
In file arch/arm/mach-davinci/include/mach/mux.h
/* SPI1 function */
        DA850_SPI1_CS_0,
        DA850_SPI1_CS_2,                QUESTION: Is this entry correct? Can we create new entry anywhere in this enum or it has any method to be followed?
        DA850_SPI1_CLK,
        DA850_SPI1_SOMI,
        DA850_SPI1_SIMO,
In file driver/spi/davinci_spi.h
//#define SPI_MAX_CHIPSELECT    2
#define SPI_MAX_CHIPSELECT      3       QUESTION: I s this correct?
-----------------------------------------------------------------------------------------------------------------------
I have still not included device specific driver. I am just checking if platform specific details are OKay?
When I boot I get following error in kernel boot log
spi_davinci spi_davinci.1: can't setup spi1.2, status -11
spi_davinci spi_davinci.1: Controller at 0xfef0e000 
I dont know what am I missing here? Please let me know what i should be doing?
Regards,
Dipen patel