Thanks a lot, Abid :-)
The virt_to_bus it's work for me.
bit by bit between SSPtx and SSP_CLK is come out correctly, but, i have new problem now.
Only SSPTx right , SSPRx is sometime right.
I use printk" for show what i got from SSPRx by using DMA.
On start up module,after enable DMA, the memory of SSPRx that i allocate for DMA, It's sometime show my default value which i set it up on initial, but, sometime it show correct value follow by what it get from SSPRx.
I'm finding the way to solve it.
Could you have any suggestion to me?
Pakorn
--- In
.com, Abid Rashid <abidrashid24@ ...> wrote:
>
> Ã
> Kmalloc returned addresses need to be mapped to the bus addresses.
> Use
> bus_addr =
virt_to_bus( virt_addr/ *returned from kmalloc*/);
> address as the dma destination.
> Hope it would help
> br,
> Abid
>
> --- On Mon, 3/15/10, pakorn_0608 <pakorn_0608@ ...> wrote:
>
>
> From: pakorn_0608 <pakorn_0608@ ...>
> Subject: [ts-7000] DMA with SSP on TS7400
> To:
.com> Date: Monday, March 15, 2010, 3:21 AM
>
>
> Ã
>
>
>
> Dear members,
>
> I'm use DMA on M2M mode with SSP, both of SSPTx and SSPRx for each channel.
>
> I have a bit problem with data that transmit and receive from SSP.
>
> I use "kmalloc" to get allocate memory address and i write some data into that address.
> I can
write and read correctly by using "printk".
>
> I'm also use it with SSPDR for transmit data from SPI by "outl" command, data come out from SSPTx with clock sync correctly.
>
> Anyway,It's wrong when i'm using with DMA register.
>
> For example, DMA M2M0 using with SSPtx, I set DMA register, source register with address from kmalloc "0xd120_10eo" , destination address SSPDR "0x808A_0008" and BCR by 3.
>
> There are data come out from SSPtx but it is not right value that it should be in memory address shown by "printk".
>
> Could someone have some suggest to me for using DMA with SSP for 7400 board?
>
> ************ *******
> example with some coding:
> ************ *******
>
> /* I write it for kernel module*/
> ...
> char *buffer_dma[ MAX_EP93XX_ DMA_M2M_CHANNELS ];
> .
> .
> .
> buffer_dma[0] = kmalloc( size ,
GFP_KERNEL|GFP_ DMA); /* example size is 10*/
>
> for(i=0;i<10; i++)
> {
> buffer_dma[0] [i] = i*10;
>
> printk("Address of buffer_dma[0] [%d] = 0x%lx\n",i,( unsigned long)&buffer_ dma[0][i] );
> printk("Value of buffer_dma[0] [%d] = %d\n",i,buffer_ dma[0][i] );
> }
>
> /*
> I print this value for show address and value
> my address for buffer_dma[0] [0] is "0xd120_10eo" and value is 0
> next, address for buffer_dma[0] [1] is "0xd120_10e1" and value is 10... and other value is shown correctly.
>
> I also use with SSP
>
> */
>
> for(i=0;i<10; i++)
> {
> outl(buffer_ dma[0][i] , SSPDR );
> }
>
> /*
> I'm set SSP 8 bit,
> data come out from SSPTx is correctly , compare bit by bit with ssp_clock
>
> next i'm usongit with DMA M2M for SSPTx
>
> */
>
>
outl(&buffer_ dma[0][0] , m2m_channel[ channel]. base + M2M_SAR_BASE0) ;
> outl( SSPDR , m2m_channel[ channel]. base + M2M_DAR_BASE0) ;
> outl(3 , m2m_channel[ channel]. base + M2M_BCR0);
>
> /*
> After that i'm enable DMA
> my data that come out from SSPTx is wrong all,
> even i change data in my buffer_dma[0] [i] on above
> data come out from SSPTx is still the same value.
> It's not match with it should be in memory address
> */
>