SPI issue on iMX28 when change cpu clock

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SPI issue on iMX28 when change cpu clock

3,358 次查看
victorien
Contributor IV

Hi,

I add a custom driver for cpu clock control on linux 3.14 (based on freescale's driver from 2.6.35). This driver works but I have an issue. If I reduce the CPU clock (261.819, 360 or 392.728 MHz) I have some data error when I receive data on SPI bus (number 2). The SPI bus doesn't miss data but modify some bytes (but not all of them) : bxxxxxx01 is changed to bxxxxxx00 and bxxxxxx10 is changed to bxxxxxx11 . At 454.737Mhz (max clock) I have no problem.

I checked waveform of data bus with an oscilloscope and the shape and timing are correct.

Someone knows this problem ?

Regards

Victorien

标签 (1)
标记 (4)
0 项奖励
回复
10 回复数

2,287 次查看
wolfgangfraedri
Contributor I

Hi all,

I stumbled upon the same issue after analyzing problems with our SPI.

In my case the error rate correlated highly with the temperature of the i.MX28: After startup of the system we had no errors. Heating up the i.MX28 caused the error rate to go up, reaching about 30 - 40% of the affected data (where the last two bits are different). After turning off the heating the error rate dropped again to virtual zero.

Switching to ref_xtal worked also for me.

Maybe this information is helpful for others looking for temperature issues...

Best regards,

Wolfgang

0 项奖励
回复

2,287 次查看
lategoodbye
Senior Contributor I

I know this issue and i can reproduce it without cpufreq driver. Until now i didn't find a better solution than switching the clock parent to ref_xtal:

SPI receive error with mxs-spi

0 项奖励
回复

2,287 次查看
victorien
Contributor IV

Thanks for this answer ; I'll test with the clock switching.

Is it possible that it's a bug of iMX28 ?

0 项奖励
回复

2,287 次查看
fabio_estevam
NXP Employee
NXP Employee

What about using the standard cpufreq driver instead?

0 项奖励
回复

2,287 次查看
victorien
Contributor IV

I use standard cpufreq driver. The custom part is on power driver and voltage regulator. This drivers don't exist in kernel mainline for iMX28

0 项奖励
回复

2,287 次查看
fabio_estevam
NXP Employee
NXP Employee

It would be nice if you could send some patches for that (even if they are RFC) so that people could review the changes in the mailing lists.

Stefan Wahren has started to work on this sometime ago.

0 项奖励
回复

2,287 次查看
victorien
Contributor IV

I based my development on Stefan Wahren's driver. I don't send patch to kernel mainline because the driver is dirty (commit not in english, copy files from Stefan Wahren driver instead of add his patch) and writed for 3.14. I don't yet have time to clean it and modify for 4.x kernel.

I work on standby to but there are bugs.

I can share patchs on forum if some people is interested.

0 项奖励
回复

2,287 次查看
Yuri
NXP Employee
NXP Employee

Hello,

  Do You use SPI master mode ? PIO or DMA ?


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,287 次查看
victorien
Contributor IV

During my tests I read on SPI flash memory. I made the same test on my custom board and on evaluation board and I have the same issu on both board. The difference is that I have more byte change with evaluation board.

0 项奖励
回复

2,287 次查看
victorien
Contributor IV

I use SPI master mode with DMA

0 项奖励
回复