public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: darrell.holigan@gmail.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Providing access to kernel memory from PCI bus
Date: Thu, 10 Jul 2008 17:44:36 -0600	[thread overview]
Message-ID: <48769EE4.3050101@shaw.ca> (raw)
In-Reply-To: <61c5c72f-6427-4dbf-b608-ceedc1859425@m45g2000hsb.googlegroups.com>

darrell.holigan@gmail.com wrote:
> I'm developing a PCI driver under linux to communicate with an Intel
> IQ80331 which supports PCI boot.  To accomplish this, the IQ80331
> needs access to an image stored in the host processor's (AMCC 405GPr)
> RAM.
> 
> Linux boots, sees the PCI bridge and the address translation unit on
> the IQ80331 (core is held in reset) and calls the probe function my
> driver which retrieves the address allocated to BAR0 and ioremaps it.
> The IQ80331 implements a single BAR which provides access to ATU
> registers.
> 
> From here, I can configure the IQ80331 through BAR0 to do a long jump
> at boot.  According to the dev manual I need to configure the outbound
> window of the ATU so that it translates the jump to host memory where
> my boot image is stored.
> 
> I have kmalloced kernel memory in my driver's ioctl and loaded in the
> image from user space, but I do not understand the process to tell the
> kernel that I want the kmalloced area available for access from PCI
> devices.  I assume that I must do this explicitly since allowing
> unrestricted access to kernel memory from PCI space would be a
> security/stabilty concern, yes?  But I cannot find the proper kernel
> API calls to do this.

You should likely allocate the memory that you are making available to 
the device using dma_alloc_coherent. That will give you a bus address 
that points to the memory that you can give to your device.

           reply	other threads:[~2008-07-10 23:42 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <61c5c72f-6427-4dbf-b608-ceedc1859425@m45g2000hsb.googlegroups.com>]

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=48769EE4.3050101@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=darrell.holigan@gmail.com \
    --cc=linux-kernel@vger.kernel.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