How to enable SPI wait state

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable SPI wait state

683 Views
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 Kudos
2 Replies

680 Views
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 Kudos