public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Phil Nitschke <phil@avalon•com.au>
To: linuxppc-embedded@ozlabs•org
Cc: Brian Waite <bwaite@irobot•com>
Subject: Re: linux DMA capabilities in MV64460
Date: 09 Mar 2006 00:32:32 +1030	[thread overview]
Message-ID: <wqhd69f30n.fsf@toby.int.avalon.com.au> (raw)
In-Reply-To: 200603060821.29220.brian@waitefamily.us

>>>>> "BW" == Brian Waite <brian@waitefamily•us> writes:

  >> I'm now looking seriously (and reluctantly!) at writing a DMA
  >> Controller Driver to supplement these functions, and I've started
  >> the process of getting an NDA from Marvell, so I can get their
  >> User Manual (and errata!).

  BW> You won't get very far without the user manual, then I think you
  BW> will find it pretty easy to write the driver with the frameworks
  BW> already in the kernel.

  >> Can someone point me in the right direction to get me started?  I
  >> need to come up the learning curve to find out where to start.
  >> 
  >> How is a DMA controlled (from a device driver writer's
  >> perspective) when a third-party (i.e. in the bridge) DMA
  >> controller needs to do the work to get the data from a PCI Target
  >> into main memory?
  >> 
  >> What kernel API should be provided by the DMA Controller Driver?

  BW> My first guess would be to follow something like
  BW> Documentation/DMA-API.txt and Documentation/DMA-mapping.txt

I can't see how trying to match those DMA functions would work.  

The dma_map_xxx() functions and friends appear to be invoked from
driver interrupt handlers, which are either responding to an interrupt
from a PCI Target which wants to commence a bus-mastered DMA to/from
main memory, or responding to a second interrupt to say the interrupt
is complete.

In my case, my driver receives one interrupt from a PCI Target which
cannot perform a DMA, and I presumably have to use an alternative API
(i.e. my "new" set of ("DMA Controller") driver functions) to get the
platform DMA controller to fetch the data and wake (interrupt) me once
complete.  Right?

  >> Any documentation, examples, similar device drivers, etc, would
  >> be appreciated.  TIA,

  BW> You could look to followup that by groking
  BW> arch/ppc/kernel/dma-mapping.c

OK.

  BW> Finally, arch/ppc/syslib ppc4xx_dma.c seems to show an example
  BW> of a low level driver.  

OK, so suppose I write a bunch of functions, like this:

    mv64x60_disable_dma();
    mv64x60_disable_dma_interrupt();
    mv64x60_enable_dma();
    mv64x60_enable_dma_interrupt();
    mv64x60_get_dma_status();
    mv64x60_init_dma_channel();
    ... etc,

then how do these get called; directly from my other driver?  

(I could not see any place that the ppc4xx_ dma functions were being
called, i.e. they don't seem to dovetail into some higher level kernel
API...?)

  BW> I didn't notice any platform dma controllers like MAG
  BW> reccommended, but that should be a better way to go.

Perhaps Mark was talking about ppc4xx_dma.c and ppc4xx_sgdma.c ?

Sorry if I'm too slow on the uptake.  Thanks for your input,

-- 
Phil

  reply	other threads:[~2006-03-08 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <kw3bkovcup.fsf@lamorak.int.avalon.com.au>
2005-12-20  1:01 ` linux DMA capabilities in MV64460 Mark A. Greer
2005-12-20 14:27   ` Brian Waite
2005-12-20 17:54     ` Mark A. Greer
2005-12-22  0:54   ` Phil Nitschke
2006-03-06  4:09   ` Phil Nitschke
2006-03-06 13:21     ` Brian Waite
2006-03-08 14:02       ` Phil Nitschke [this message]
2006-03-08 22:36     ` Adrian Cox
2006-03-09  8:02       ` Phil Nitschke
2005-12-22  2:59 KokHow Teh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wqhd69f30n.fsf@toby.int.avalon.com.au \
    --to=phil@avalon$(echo .)com.au \
    --cc=Phil.Nitschke@avalon$(echo .)com.au \
    --cc=bwaite@irobot$(echo .)com \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox