Subject: Re: Quadra 840AV scsi DMA
To: Michael R. Zucca <mrz5149@acm.org>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: port-mac68k
Date: 04/08/2002 21:36:07
At 8:52 Uhr -0400 8.4.2002, Michael R. Zucca wrote:
>At 5:15 AM -0400 4/8/02, Mike Haertel wrote:
>
>>Is anybody already working on this?  If not, I would
>>like to take a crack at it.
>
>I am. I already have code which does the DMA into a bounce-buffer. However,
>this doesn't offer much of a speed up because of the extra bcopy. What I'd
>like to do is to get the bus_dma() infrastructure in place and have the dma
>engine read/write directly into the destination memory.

Heh... When I looked into my mail this morning and found the 840AV
question, I did not foresee the thread would become this interesting!

I've got a driver for the FWB Jackhammer FW-SCSI card on the back burner
for quite some time now - better: a frontend to Manuel Bouyer's siop MI
driver, as the Jackhammer is built around a (ncr|sym)53c720 and 128K static
on-board memory.

For the bus_dma implementation I started with a copy of the sparc code, but
quickly dropped that because of the strange hardware they support, and
switched to the macppc 'bus_dma.c'. During the last few days, I re-read
"Designing cards and drivers" wrt. DMA and cache coherency issues. I
remembered that the macppc's '_dmamap_sync' slot is NULL, started looking
around in the other ports' code and just yesterday came to the same
conclusion as you -- pick the next68k implementation.

>Looking around, I can see that we can pretty much copy the bus_dma()
>routines from the NeXT port.

Did you? Can we exchange our attempts?

At first, the change did me no good. I included m68k/cacheops.c and now get
an 'illegal instruction' panic early at the return from a routine (_DCFL)
that for m68030 should be a no-op.

>The next step is to make a dma engine device
>that can take a list of contiguous regions in the form of a bus_map and do
>a bunch of dmas. This is slightly different than the bounce-buffer driver
>because the bounce-buffer driver uses the SCSI chip's interrupt to see if
>the DMA is complete. What I need to do is to track down the SCSI DMA
>interrupt. Finding it shouldn't be too hard, it's probably with the rest of
>the PSC interrupts.

This sounds as if you knew how to set up the DMA controller... cool!
>
>Anyway, that's the deal. I just need a few days to work on it. Of course,
>that's the hardest part of all! :-)

Amen.  ;)

	hauke


--
/~\  The ASCII Ribbon Campaign        "They that can give up essential liberty
\ /    No HTML/RTF in email           to obtain a little temporary safety
 X     No Word docs in email          deserve neither liberty nor safety."
/ \  Respect for open standards                     -- Benjamin Franklin, 1759