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.

AM1808/OMAPL138 SPI0 无法工作

Other Parts Discussed in Thread: AM1808

我在am1808/omapl138 上试图使用spi0来CS2外接FRAM SPI注册正常,但是当我通过SPI收发数据的时候总是出现 SPI BIT ERROR 

以下是我SPI0 部分代码

static struct spi_board_info __initdata da850_spi0_board_info[] = {

{
.modalias = "fm25cl64",
.platform_data = &spi_fram_data,
.mode = SPI_MODE_0,
.max_speed_hz = 30000000, /* max sample rate at 3V */
.bus_num = 0,
.chip_select = 2,
},
};

ret = da8xx_pinmux_setup(da850_spi0_pins);
if (ret)
pr_warning("da850_evm_init: spi0 mux setup failed: %d\n", ret);

da850_init_spi0(BIT(3), da850_spi0_board_info,ARRAY_SIZE(da850_spi0_board_info));

static struct davinci_spi_platform_data da850_spi0_pdata = {
.version = SPI_VERSION_2,
.num_chipselect = 3,
.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,
.use_dma = 0,
.c2tdelay = 8,
.t2cdelay = 8,
};

static struct resource da850_spi0_resources[] = {
[0] = {
.start = 0x01C41000,
.end = 0x01C41000 + 0xfff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_DA8XX_SPINT0,
.end = IRQ_DA8XX_SPINT0,
.flags = IORESOURCE_IRQ,
},

[2] = {
.start = EDMA_CTLR_CHAN(0, 14),
.end = EDMA_CTLR_CHAN(0, 14),
.flags = IORESOURCE_DMA,
},
[3] = {
.start = EDMA_CTLR_CHAN(0, 15),
.end = EDMA_CTLR_CHAN(0, 15),
.flags = IORESOURCE_DMA,
},
[4] = {
.start = 1,
.end = 1,
.flags = IORESOURCE_DMA,
},
};


static struct platform_device da850_spi0_device = {
.name = "spi_davinci",
.id = 0,
.resource = da850_spi0_resources,
.num_resources = ARRAY_SIZE(da850_spi0_resources),
.dev = {
.platform_data = &da850_spi0_pdata,
},
};
void __init da850_init_spi0(unsigned chipselect_mask,
struct spi_board_info *info, unsigned len)
{
spi_register_board_info(info, len);
platform_device_register(&da850_spi0_device);
}

请问有什么问题吗?

  • 问题有了新的进展 . 我发现除了spi的cs0,其他的片选信号无论spi0还是spi1都出现同样的bit error 错误. 难道使用其他片选信号与使用片选0 有不同之处? 我确定我的引脚复用没有问题。 有人试过用spi的其他片选信号吗,please help.