Hi, I add SPI support to LCDK linux kernel, It appears spidev now, but I've got such problem:
If I start linux without usb flash ROM, then there is spidev1.0 in /dev, but is no sda1(my flash ROM).
If I start it with flash ROM than there is no spidev and is sda1.
I'm working with LCDK sdk ver 01.00.00
Here is my changes:
.config
+CONFIG_SPI=y
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_DAVINCI=y
+CONFIG_SPI_SPIDEV=y
/arch/arm/mach-davinci/da850.c
/* I2C0 function */
MUX_CFG(DA850, I2C0_SDA, 4, 12, 15, 2, false)
MUX_CFG(DA850, I2C0_SCL, 4, 8, 15, 2, false)
/* SPI1 function */
+ MUX_CFG(DA850, SPI1_CLK, 5, 8, 15, 1, true)
+ MUX_CFG(DA850, SPI1_SOMI, 5, 16, 15, 1, true)
+ MUX_CFG(DA850, SPI1_SIMO, 5, 20, 15, 1, true)
+ MUX_CFG(DA850, SPI1_SCS0, 5, 4, 15, 1, true)
/* EMAC function */
MUX_CFG(DA850, MII_TXEN, 2, 4, 15, 8, false)
MUX_CFG(DA850, MII_TXCLK, 2, 8, 15, 8, false)
/* GPIO function */
+ MUX_CFG(DA850, GPIO2_0, 6, 28, 15, 8, true)
+ MUX_CFG(DA850, GPIO3_15, 7, 0, 15, 8, true)
/arch/arm/mach-davinci/include/mach/mux.h
/* I2C0 function */
DA850_I2C0_SDA,
DA850_I2C0_SCL,
/* SPI1 function */
+ DA850_SPI1_CLK,
+ DA850_SPI1_SOMI,
+ DA850_SPI1_SIMO,
+ DA850_SPI1_SCS0,
/* EMAC function */
DA850_MII_TXEN,
DA850_MII_TXCLK,
+ DA850_GPIO2_0,
+ DA850_GPIO3_15,
/arch/arm/mach-davinci/board-omapl138-hawk.c
static const short omapl138_hawk_mcasp_pins[] __initconst = {
DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE,
DA850_AXR_11, DA850_AXR_12,
-1
};
+static short da850_spi1_gpio_pins[] __initdata= {
+ DA850_GPIO2_0,DA850_GPIO3_15,
+ -1
+};
+
+static short da8xx_evm_spi_pins[] __initdata = {
+ DA850_SPI1_CLK,DA850_SPI1_SOMI,DA850_SPI1_SIMO,DA850_SPI1_SCS0,
+ -1
+};
+
+static struct spi_board_info da830evm_spi_info[] = {
+{
+ .modalias = "spidev",
+ .mode = SPI_MODE_0,
+ .max_speed_hz = 12000000,
+ .bus_num = 1,
+ .chip_select = 0,
+},
+};
static void omapl138_hawk_sound_init(void){
int ret;
ret = davinci_cfg_reg_list(omapl138_hawk_mcasp_pins);
if (ret)
pr_warning("omapl138_hawk_init: mcasp mux setup failed: %d\n",
ret);
da8xx_register_mcasp(0, &omapl138_hawk_snd_data);
+ printk("da850_spi1_gpio_pins");
+ ret = davinci_cfg_reg_list(da850_spi1_gpio_pins);
+ ret = davinci_cfg_reg_list(da8xx_evm_spi_pins);
+ ret = da8xx_register_spi(1, da830evm_spi_info,ARRAY_SIZE(da830evm_spi_info));
+ if (ret){
+ pr_warning("da830_evm_init: spi 1 registration failed: %d\n",ret);
+ return ret;
+ }
}
Have you got any ideas why is SPI and USB conflict? May it be interrupts?
Thanks