How to enable SPI wait state

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to enable SPI wait state

754件の閲覧回数
hillcoder
Contributor I

Hi to all,

I'm working on a linux system running on a board based on imx6q dual.

I need to put some wait states in my SPI communication. From datasheet I read that for do this I have to write in to the ECSPIx_PERIODREG register.

Below the code that I added at the end on mx51_ecspi_config functio on spi-imx.c:

period = readl(spi_imx->base + MX51_ECSPI_PERIOD);
period = 0x800F;
printk("period %x\n",period);
writel(period, spi_imx->base + MX51_ECSPI_PERIOD);
period = readl(spi_imx->base + MX51_ECSPI_PERIOD);
printk("period %x\n",period);

Also if the written value is right no wait states between words appears...

Where I have wrong ?

Many thanks 

 

 

0 件の賞賛
2 返答(返信)

743件の閲覧回数
igorpadykov
NXP Employee
NXP Employee
0 件の賞賛

751件の閲覧回数
hillcoder
Contributor I

I made a mistake...

my code is :

 

period = readl(spi_imx->base + MX51_ECSPI_PERIOD);
period = 0x16;
printk("period %x\n",period);
writel(period, spi_imx->base + MX51_ECSPI_PERIOD);
period = readl(spi_imx->base + MX51_ECSPI_PERIOD);
printk("period %x\n",period);

0 件の賞賛