linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MPC5200, PLX9054 PCI Card - stalled DMA transfers
@ 2007-03-01 12:44 Oliver Rutsch
  2007-03-01 22:48 ` David Hawkins
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Rutsch @ 2007-03-01 12:44 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

we're using a TQM5200S-Module (MPC5200) on a STK52xx-board with a 
PLX9054-based PCI card. The 2.4.25-kernel on the 3.1.1 ELDK had big 
problems to map the PCI resources of this card, so I tried the latest 
2.6.19.2-kernel of the 4.1 ELDK. This kernel mapped successfully the PCI 
resources on this card.
After building the latest PLX driver on the 2.6.19-kernel (I had to make 
some changes for the .19 kernel and for some litte/big endian issues) I 
was able to transfer data with programmed I/O. But as this is too slow I 
like to use the DMA functions of this device and here is the problem:
PLX provides an example program for scatter/gather DMA. This program 
works with their latetst driver on a linux PC. But on the TQM5200 the 
'Channel 0 done' flag of the DMASR0 register is never set after starting 
the DMA transfer. What can be the reason for this? The debug output of 
the driver looks O.K., but waiting for the DMA done interrupt gives a 
timeout, because the flag is not set. I wrote some test patterns in my 
DMA buffer before the DMA transfer and no byte of the buffer was 
altered, so the DMA engine seems not to be able to write a single byte.
Has anybody this or a similar card running on a ppc environment? Any 
ideas what I can do?

Thanks in advance and bye,
-- 
Dipl. Ing. Oliver Rutsch
EMail: orutsch@sympatec.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MPC5200, PLX9054 PCI Card - stalled DMA transfers
  2007-03-01 12:44 MPC5200, PLX9054 PCI Card - stalled DMA transfers Oliver Rutsch
@ 2007-03-01 22:48 ` David Hawkins
  2007-03-08  7:47   ` Oliver Rutsch
  0 siblings, 1 reply; 5+ messages in thread
From: David Hawkins @ 2007-03-01 22:48 UTC (permalink / raw)
  To: Oliver Rutsch; +Cc: linuxppc-embedded

Oliver Rutsch wrote:
> Hi,
> 
> we're using a TQM5200S-Module (MPC5200) on a STK52xx-board with a 
> PLX9054-based PCI card. The 2.4.25-kernel on the 3.1.1 ELDK had big 
> problems to map the PCI resources of this card, so I tried the latest 
> 2.6.19.2-kernel of the 4.1 ELDK. This kernel mapped successfully the PCI 
> resources on this card.
> After building the latest PLX driver on the 2.6.19-kernel (I had to make 
> some changes for the .19 kernel and for some litte/big endian issues) I 
> was able to transfer data with programmed I/O. But as this is too slow I 
> like to use the DMA functions of this device and here is the problem:
> PLX provides an example program for scatter/gather DMA. This program 
> works with their latetst driver on a linux PC. But on the TQM5200 the 
> 'Channel 0 done' flag of the DMASR0 register is never set after starting 
> the DMA transfer. What can be the reason for this? The debug output of 
> the driver looks O.K., but waiting for the DMA done interrupt gives a 
> timeout, because the flag is not set. I wrote some test patterns in my 
> DMA buffer before the DMA transfer and no byte of the buffer was 
> altered, so the DMA engine seems not to be able to write a single byte.
> Has anybody this or a similar card running on a ppc environment? Any 
> ideas what I can do?
> 
> Thanks in advance and bye,

Hi,

I use the PLX-9054 in my custom boards (TI DSP on-board), and
Linux x86 host computer. When debugging, I load a simple memmap
driver, and 'tickle' the board registers directly.

There's a copy of the PLX driver in here ...
http://www.ovro.caltech.edu/~dwh/correlator/pdf/cobra_driver.pdf
http://www.ovro.caltech.edu/~dwh/correlator/software/cobra_driver-2.9.tar.gz

And if my memory serves me right, I think I wrote a generic
one that lets you map any PCI device ...
http://www.ovro.caltech.edu/~dwh/correlator/pdf/LNX-723-Hawkins.pdf
http://www.ovro.caltech.edu/~dwh/correlator/software/driver_design.tar.gz

Anyway, manually setup a DMA transfer and convince yourself that
you know which bits to twiddle, then figure out why the driver
code isn't doing as its asked.

Take a look at the COBRA driver code, it has PLX-9054 DMA control.

There might be a few clues in my docs that'll help you.

Cheers
Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MPC5200, PLX9054 PCI Card - stalled DMA transfers
  2007-03-01 22:48 ` David Hawkins
@ 2007-03-08  7:47   ` Oliver Rutsch
  2007-03-08 12:20     ` Sylvain Munaut
  2007-03-09 17:03     ` David Hawkins
  0 siblings, 2 replies; 5+ messages in thread
From: Oliver Rutsch @ 2007-03-08  7:47 UTC (permalink / raw)
  To: David Hawkins; +Cc: linuxppc-embedded

Hi David,

> 
> I use the PLX-9054 in my custom boards (TI DSP on-board), and
> Linux x86 host computer. When debugging, I load a simple memmap
> driver, and 'tickle' the board registers directly.
> 
> There's a copy of the PLX driver in here ...
> http://www.ovro.caltech.edu/~dwh/correlator/pdf/cobra_driver.pdf
> http://www.ovro.caltech.edu/~dwh/correlator/software/cobra_driver-2.9.tar.gz 
> 

I read your interesting article. Thanks for this!
The PCI card I'm using works without problems on a X86 PC, so I think 
the PLX hardware is O.K. I checked every local PLX9054 register on the 
MPC5200 against the X86 PC. On both computers they have the same values. 
Even a simple block DMA does not work, although I checked all registers 
and addresses. So I think the plx driver software is O.K. on the MPC5200 
and there has to be a hardware reason. Maybe the pci bus is not granted 
to the bus master controller of the PLX9054 when it requests the bus.
We'll check this when our hardware guy has time for this ;-)


> Anyway, manually setup a DMA transfer and convince yourself that
> you know which bits to twiddle, then figure out why the driver
> code isn't doing as its asked.
> 

I've done so without success. The driver seems to make everything 
correct. A block DMA is fairly simple on the 9054, so I think there must 
be a hardware reason for this.
Has anybody ever used a PCI card on the MPC5200 which has its own 
busmaster controller? I think most people use the BestComm DMA 
controller on the MPC5200, right?

Thanks for your interest and bye,

-- 
Dipl. Ing. Oliver Rutsch
EMail: orutsch@sympatec.com · Tel.:+49 5323 717514
Sympatec GmbH · Am Pulverhaus 1 · 38678 Clausthal-Zellerfeld · Germany

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MPC5200, PLX9054 PCI Card - stalled DMA transfers
  2007-03-08  7:47   ` Oliver Rutsch
@ 2007-03-08 12:20     ` Sylvain Munaut
  2007-03-09 17:03     ` David Hawkins
  1 sibling, 0 replies; 5+ messages in thread
From: Sylvain Munaut @ 2007-03-08 12:20 UTC (permalink / raw)
  To: Oliver Rutsch; +Cc: linuxppc-embedded


>> Anyway, manually setup a DMA transfer and convince yourself that
>> you know which bits to twiddle, then figure out why the driver
>> code isn't doing as its asked.
>>
>>     
>
> I've done so without success. The driver seems to make everything 
> correct. A block DMA is fairly simple on the 9054, so I think there must 
> be a hardware reason for this.
> Has anybody ever used a PCI card on the MPC5200 which has its own 
> busmaster controller? I think most people use the BestComm DMA 
> controller on the MPC5200, right?
>   
No, most PCI card that need big xfer uses bus mater. A ide card, a
network card, ...  all most certainly use it.

Bestcomm on the 5200 is for the SoC internal peripheral mainly.


Sylvain

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MPC5200, PLX9054 PCI Card - stalled DMA transfers
  2007-03-08  7:47   ` Oliver Rutsch
  2007-03-08 12:20     ` Sylvain Munaut
@ 2007-03-09 17:03     ` David Hawkins
  1 sibling, 0 replies; 5+ messages in thread
From: David Hawkins @ 2007-03-09 17:03 UTC (permalink / raw)
  To: Oliver Rutsch; +Cc: linuxppc-embedded

Hi Oliver,

> The PCI card I'm using works without problems on a X86 PC, so I think 
> the PLX hardware is O.K. I checked every local PLX9054 register on the 
> MPC5200 against the X86 PC. On both computers they have the same values.

Ok, that eliminates a hardware error in reading registers on the board,
i.e., the PCI connection is fine. There could still be errors in
the PCI-9054 local bus connections ...

> Even a simple block DMA does not work, although I checked all registers 
> and addresses. So I think the plx driver software is O.K. 

I'm sure you have checked this, but I'll mention it just in case ...
you are using readl/writel type functions to access the little-endian
PCI registers from the big-endian PowerPC right?

> on the MPC5200 
> and there has to be a hardware reason. Maybe the pci bus is not granted 
> to the bus master controller of the PLX9054 when it requests the bus.
> We'll check this when our hardware guy has time for this ;-)

A PCI bus logic analyzer is pretty nice for this type of issue.
I use an Agilent 1680A, and a FuturePlus PCI or CPCI adapter
board. The analyzer is about $20k, while the adapters are about
$2k. However, they pay for themselves pretty quickly.

>> Anyway, manually setup a DMA transfer and convince yourself that
>> you know which bits to twiddle, then figure out why the driver
>> code isn't doing as its asked.
> 
> I've done so without success. 

Without success on the x86 too?

> The driver seems to make everything correct. A block DMA is fairly
> simple on the 9054, so I think there must be a hardware reason for this.
> Has anybody ever used a PCI card on the MPC5200 which has its own 
> busmaster controller? I think most people use the BestComm DMA 
> controller on the MPC5200, right?

I tested the PCI debug driver I wrote from an x86 with my PLX
boards, and on a Yosemite (440EP) board. I tested DMA using
the PCI-9054 DMA controllers, and the 440EP controllers.

Read p23 to p35 of my 440EP test document, I have some tests
there that you could repeat ...

http://www.ovro.caltech.edu/~dwh/powerpc_440ep.pdf

However, life will be much easier if you can grab the hardware
guy's logic analyzer ... out of his cold dead hands if need be ;)

Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-09 17:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-01 12:44 MPC5200, PLX9054 PCI Card - stalled DMA transfers Oliver Rutsch
2007-03-01 22:48 ` David Hawkins
2007-03-08  7:47   ` Oliver Rutsch
2007-03-08 12:20     ` Sylvain Munaut
2007-03-09 17:03     ` David Hawkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).