TI 團隊, 您好:
現行的kernel 為 2.6.18
硬體線路使用的 SPI0 / SPI1
SPI0是與一般SENSOR溝通使用
另外我們使用 SPI1與其他的感測SENSOR進行對接
static u8 chsel1[1] = {29};
static struct davinci_spi_platform_data dm365_spi1_pdata = {
.version = DAVINCI_SPI_VERSION_1,
.num_chipselect = 1,
.chip_sel = chsel1,
.clk_name = "***",
};
static struct resource dm3xx_spi1_resources[] = {
[0] = {
.start = DM3XX_SPI1_BASE,
.end = DM3XX_SPI1_BASE + (SZ_4K/2) – 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_DM3XX_SPINT0_1,
.end = IRQ_DM3XX_SPINT0_1,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = 15,
.flags = IORESOURCE_DMA | IORESOURCE_DMA_RX_CHAN,
},
[3] = {
.start = 14,
.flags = IORESOURCE_DMA | IORESOURCE_DMA_TX_CHAN,
},
[4] = {
.start = EVENTQ_3,
.end = EVENTQ_3,
.flags = IORESOURCE_DMA | IORESOURCE_DMA_EVENT_Q,
},
};
static struct platform_device dm365_spi1_pdev = {
.name = "dm_spi",
.id = 1,
.resource = dm3xx_spi1_resources,
.num_resources = ARRAY_SIZE(dm3xx_spi1_resources),
.dev = {
.dma_mask = &dm365_spi1_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &dm365_spi1_pdata,
},
};
struct davinci_spi_config_t davinci_spi_1_spi_cfg = {
.wdelay = 0,
.odd_parity = 0,
.parity_enable = 0,
.wait_enable = 0,
.lsb_first = 0,
.timer_disable = 0,
.clk_high = 1,//0,
.phase_in = 0,
.clk_internal = 1,
.loop_back = 0,
.cs_hold = 1,
.intr_level = 0,
.pin_op_modes = SPI_OPMODE_SPISCS_4PIN,
#ifndef CONFIG_SPI_INTERRUPT
.poll_mode = 1,
#endif
};
設置成DMA模式之後, 完全沒有收到任何資料
但是變更成 PIO模式是可以正確讀取到資料
想請教貴Team, 請問目前我的DMA傳輸那邊設定有錯呢??
以上
Juncor
Chris Meng:
你好,
请看看下面讨论的信息是否有帮助?
e2echina.ti.com/…/20871