linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Eddie Dawydiuk <eddie@embeddedarm.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC]PPC driver lock for DMA registers
Date: Wed, 18 Mar 2009 09:53:14 -0700	[thread overview]
Message-ID: <49C126FA.90401@embeddedarm.com> (raw)
In-Reply-To: <fa686aa40903180940m782bcd65nb78b2c87353f10a@mail.gmail.com>

Hello,

>> I'm working on SD card and Nand drivers that I would like to eventually
>> submit for inclusion in the mainline kernel. This being my first kernel port
>> being submitted upstream I was hoping for comments on my proposed design to
>> ensure it would be excepted in the mainline kernel(from a design
>> standpoint). We have an FPGA on our product that has an interface for
>> transferring data via DMA. The SD card driver and Nand flash driver will
>> both be accessing these registers. As a result I was planning on writing a
>> dma driver(drivers/dma/ts81xx.c) that implements a function dma_op() that
>> gets passed a physical address, virtual address, length, and read/write op
>> and returns an int. I'd use a semaphore to protect the registers. I'd also
>> implement a function dma_bus_init() for allocating a cache coherent buffer,
>> initializing the semaphore, and ioremapping the FPGA regs.
> 
> Nothing that you describe here sounds off base, but the proof is in
> the pudding so they say.  Best advice I can offer is to follow the
> example of existing powerpc device drivers.  You'll need to describe
> your FPGA interface in the .dts file and write an of_platform driver
> that binds against it.  Make sure you post your proposed dts
> description of the FPGA to the devicetree-discuss@ozlabs.org mailing
> list before committing to it.  In you're device drivers .probe() hook
> you would create and register the NAND and SD devices with the kernel
> with the needed hooks to access the FPGA.
> 
> Here are some good examples of of_platform drivers to look at:
> 
> drivers/block/xsysace.c
> drivers/spi/xilinx_spi.c
> drivers/i2c/busses/i2c-ibm_iic.c

Thanks for the suggestions, and the pointer to some reference drivers ;)


-- 
Best Regards,
________________________________________________________________
  Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
  16525 East Laser Drive 	     | fax:    (480) 837-5300
  Fountain Hills, AZ 85268            | web: www.embeddedARM.com

      reply	other threads:[~2009-03-18 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18 16:29 [RFC]PPC driver lock for DMA registers Eddie Dawydiuk
2009-03-18 16:40 ` Grant Likely
2009-03-18 16:53   ` Eddie Dawydiuk [this message]

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=49C126FA.90401@embeddedarm.com \
    --to=eddie@embeddedarm.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).