How to deal with this kind of dma problem.



Hi, I have a big problem, please give me some help.

I have a PCI Card use PLX9656 as a bridge. The PCI Card has a DSP
write datas into dual-ram in every 3 seconds.After DSP writting
complete, there will be a interrupt to notice the data is available.
My job is copy these data from the dual-ram and send them out by
socket.I have transfer these data successfully by use memcpy.Now I
want to use DMA to finish the job.After I complete the codes, DMA is
work and I can receive the DMA interrupt when the DMA is done.Then I
can get these data transfered by DMA, but the data is incorrect.The
situation is like this:

first group
Correct data: 0xAAAAAAAA, 0xB10043AA, 0x00000055, 0x00000098,
0x00000041, 0x00000001
Incorrect data:0x0000000000, 0xAAEAAAAA, 0xB1004355, 0x00400098,
0x00000041, 0x004000001

second group
Correct data: 0xAAAAAAAA, 0xB10043AA, 0x00000055, 0x00000098,
0x00000041, 0x00000002
Incorrect data:0x0000000000, 0xAAEAAAAA, 0xB1004355, 0x00400098,
0x00000041, 0x004000002

third group
Correct data: 0xAAAAAAAA, 0xB10043AA, 0x00000055, 0x00000098,
0x00000041, 0x00000003
Incorrect data:0x0000000000, 0xAAEAAAAA, 0xB1004355, 0x00400098,
0x00000041, 0x004000003

.......


Look at these carefully, you could find that some data has been add a
number 0x00400000, some are not.

The codes about start dma are like these:
//clear DMA Channel 0 interrupt
HAL_PLX9656_REG_WRITE_BYTE(plxRegAddr, PLX9656_DMACSR0, 0x8);


//open DMA Channel x Done Interrupt,DMA Channel 0 Clear Count Mode
bit(0xe2100080)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMAMODE0,0x20443);


//write address to DMA Channel 0 PCI Address,(0xE2100084)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMAPADR0,
ubpHAL_PLX9656_BufferBase);


//write address to DMA Channel 0 Local Address,(0xE2100088)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMALADR0,
fifoBase);


//write the size of data will be transfered(0xE210008C)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMASIZ0,
IBUFFER_SIZE);


//set from local to pci address,0xE2100090)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMADPR0, 0x8);


//start dma
HAL_PLX9656_REG_WRITE_BYTE(plxRegAddr, PLX9656_DMACSR0, 0x3);


I can assure I write these DMA registers correctly.But I don't know I
get these wrong datas.

if anybody know this problem, please tell me . thanks
.



Relevant Pages

  • PCI DMA concepts ??
    ... The pci card has built in PCI & DMA controller. ... SIZE).(These registers are memory mapped via BAR3 and can be ... the DMA registers that are memory mapped into host side. ...
    (microsoft.public.development.device.drivers)
  • Re: PCI DMA concepts ??
    ... > I don't think normal PCI cards do the DMA instead of burst transfer. ... >> Receive from the pci card. ... >> the DMA registers that are memory mapped into host side. ... >> this buffer. ...
    (microsoft.public.development.device.drivers)
  • PCI card transfer with DMA/ busmastering
    ... I have a custom PCI card that I intend on using as a coprocessor to ... I've read a lot regarding DMA transfer, I assume this is the way to go. ... When I create my driver for my PCI card does the DMA stuff need to go ... DoMatrixMultiplication(buffer A, buffer B, buffer C), where buffer C ...
    (microsoft.public.development.device.drivers)
  • SiI3112 DMA? (2.6.0-test6)
    ... SATA PCI card in one of its PCI slots. ... Is DMA supported on the Si3112? ... SiI3112 Serial ATA: IDE controller at PCI slot 0000:00:0b.0 ...
    (Linux-Kernel)
  • [PATCH 01/16] dmaengine: add base support for the async_tx api
    ... is to enable callbacks at transaction completion time, ... drop dma mapping methods, suggested by Chris Leech ... kernel reference structure that contains the DMA channel device ... struct list_head node; ...
    (Linux-Kernel)