Other Parts Discussed in Thread: DA8XX
Hi,
We have a system using the LogicPD SOM on our own baseboard running Linux (no dsp application at the moment, though we do plan to use the dsplink module in the future). There are three NXP SC16IS762 SPI to dual UART chips (linux driver merged in sc16is7x2) on SPI0 CS2, CS3, CS4. We have the system working with the 2.6.37 kernel (linux-03.21.00.04). Trying to bring the platform up using 3.3.0 kernel (Davinci-PSP-SDK-03.22.00.03 linux-03.22.00.03) the system hangs when probing the third chip (SPI0_SCS[4]). I have traced this up to __spi_sync in spi.c, stuck waiting for wait_for_completion(&done), which never returns for this chip (but does return for SPI0 CS2, SPI0 CS3 and SPI1 CS0 [flash]). When i replace this call with a wait_for_completion_timeout() call I can get through the boot process and ssh in, but accessing anything on SPI0 bus causes an eventual kernel panic. It looks like CS4 is also stuck low once the device is probed, and it is a little tough to tell from the register prints I've added but something may be setting SPI0 to 5-wire mode, or at least forcing SPI_READY without modifying the spi devices .mode field.
I'm looking for any help into how to get this CS4 working reliably (as it did in 2.6.37 kernel)
The MII Bus (shares pins with SPI0) is disabled and the PHY is set to isolate before booting, the following are tweaks to the board-da850-evm.c file to fit our system:
static struct davinci_spi_platform_data da850evm_spi0_pdata = {
.version = SPI_VERSION_2,
.num_chipselect = 6, /*2,*/ /* 1, */
.intr_line = 1,
};
static struct davinci_spi_platform_data da850evm_spi1_pdata = {
.version = SPI_VERSION_2,
.num_chipselect = 3, /*2,*/ /* 1, */
.intr_line = 1,
};
static struct flash_platform_data da850evm_spiflash_data = {
.name = "m25p80",
.parts = da850evm_spiflash_part,
.nr_parts = ARRAY_SIZE(da850evm_spiflash_part),
.type = "m25p64",
};
static struct davinci_spi_config da850evm_spiflash_cfg = {
.io_type = SPI_IO_TYPE_DMA,
.c2tdelay = 8,
.t2cdelay = 8,
};
static struct sc16is7x2_platform_data da850evm_sc16is7x2_data = {
.uartclk = 14745600,
.uart_base = 0,
.gpio_base = 180,
.label = "eser",
.names = da850_sc16is7x2_names, /*"test",*/
};
static struct sc16is7x2_platform_data da850evm_sc16is7x2_data_2 = {
.uartclk = 14745600,
.uart_base = 2,
.gpio_base = 188,
.label = "eser",
.names = da850_sc16is7x2_names2, /*"first", */
};
static struct sc16is7x2_platform_data da850evm_sc16is7x2_data_3 = {
.uartclk = 14745600,
.uart_base = 4,
.gpio_base = 196,
.label = "eser",
.names = da850_sc16is7x2_names3, /*"first", */
};
static struct davinci_spi_config da850evm_sc16is7x2_cfg = {
.io_type = SPI_IO_TYPE_INTR,
.c2tdelay = 63,/*8,*/
.t2cdelay = 63, /*8,*/
};
static struct spi_board_info da850evm_spi_info[] = {
[0] = {
.modalias = "m25p80",
.platform_data = &da850evm_spiflash_data,
.controller_data = &da850evm_spiflash_cfg,
.mode = SPI_MODE_0,
.max_speed_hz = 30000000,
.bus_num = 1,
.chip_select = 0,
},
[1] = {
.modalias = "sc16is7x2",
.platform_data = &da850evm_sc16is7x2_data,
.controller_data = &da850evm_sc16is7x2_cfg,
.mode = SPI_MODE_0,
.max_speed_hz = 14000000,
.bus_num = 0,
.chip_select = 2,
.irq = 203,
},
[2] = {
.modalias = "sc16is7x2",
.platform_data = &da850evm_sc16is7x2_data_2,
.controller_data = &da850evm_sc16is7x2_cfg,
.mode = SPI_MODE_0,
.max_speed_hz = 14000000,
.bus_num = 0,
.chip_select = 3,
.irq = 205,
},
[3] = {
.modalias = "sc16is7x2",
.platform_data = &da850evm_sc16is7x2_data_3,
.controller_data = &da850evm_sc16is7x2_cfg,
.mode = SPI_MODE_0,
.max_speed_hz = 14000000,
.bus_num = 0,
.chip_select = 4,
.irq = 206,
},
};
in da850_evm_init(void) function:
ret = davinci_cfg_reg_list(da850_spi0_pins); /* enable SPI0 in pinmux */
/*this function is added to devices-da8xx.c since the original da8xx_register_spi seems to be limited to a single bus/spi board info, also it ties length of board info array to max chip select numbers which is not correct*/
da8xx_register_spi_both_busses(da850evm_spi0_pdata.num_chipselect,da850evm_spi1_pdata.num_chipselect,da850evm_spi_info, ARRAY_SIZE(da850evm_spi_info));
I can provide more detailed trace information but I'm hoping someone else has managed to get the L138 and 3.3.x kernel working with both SPI busses and multiple chip selects.
Thanks,
Scott