Hi,
I used SPI to send and receive data between DM368 and DM6435.
Unfortunately, it is found that it uses a lot of CPU usage.
Using DMA could be an answer, but SPI driver supporting DMA was not fully implemented for DM368. (linux version: 2.6.18)
I manage to modify driver to enable DMA. But it also has another problem.
If DM368 sends '12 34 56 78', DM6435 receives '00 12 34 56'.
EDMA transmits 4bytes to SPI and SPI also sends 4 bytes successfully.
The problem is its sequence.
For the first time, SPI sends SPIDAT1 which is initialized to 0x0000 in the driver.
After that, EDMA transmits 1 byte to SPIDAT1 and this sequence is repeated four times.
If SPIDAT1 is initialized to 0xFFFF, DM6435 receives 'FF 12 34 56' rather than '00 12 34 56'.
I just found the following article.
I think that the answer in article will solve my problem.
( initialize SPIDAT1 with the first byte in send buffer and decrease the number of EDMA transmission by one. )
My question is...
I want to know another solution.
I've been searching the rescent driver and patch. But, I can't find the above answer in them.
Is there another approach to solve this problem?
Any suggestions are welcome.
Best Regards,
Jinkyu Park