mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jon Ringle" <JRingle@vertical.com>
To: "linux-os \(Dick Johnson\)" <linux-os@analogic.com>
Cc: "Robert Hancock" <hancockr@shaw.ca>, <linux-kernel@vger.kernel.org>
Subject: RE: Reserving a fixed physical address page of RAM.
Date: Tue, 28 Nov 2006 14:52:42 -0500	[thread overview]
Message-ID: <22170ADB26112F478A4E293FF9D449F44D0F89@secure.comdial.com> (raw)

linux-os (Dick Johnson) wrote:
> On Mon, 27 Nov 2006, Jon Ringle wrote:
> 
> > Robert Hancock wrote:
> >> Jon Ringle wrote:
> >>> Hi,
> >>>
> >>> I need to reserve a page of memory at a specific area of RAM that 
> >>> will be used as a "shared memory" with another processor 
> over PCI. 
> >>> How can I ensure that the this area of RAM gets reseved 
> so that the 
> >>> Linux's memory management (kmalloc() and friends) don't use it?
> >>>
> >>> Some things that I've considered are iotable_init() and ioremap().
> >>> However, I've seen these used for memory mapped IO 
> devices which are 
> >>> outside of the RAM memory. Can I use them for reseving RAM too?
> >>>
> >>> I appreciate any advice in this regard.
> >>
> >> Sounds to me like dma_alloc_coherent is what you want..
> >>
> > It looks promising, however, I need to reserve a physical 
> address area 
> > that is well known (so that the code running on the other processor 
> > knows where in PCI memory to write to). It appears that 
> > dma_alloc_coherent returns the address that it allocated. Instead I 
> > need something where I can tell it what physical address 
> and range I want to use.
> >
> > Jon
> 
> First, "PCI memory" is some memory inside a board that is 
> addressed through the PCI bus. This address is allocated upon 
> machine start and is available though the PCI interface 
> (check any of the PCI card drivers). If you want to access 
> this memory, you need to follow the same procedures that 
> other boards use.

In my hardware setup, Linux is running in PCI option mode on a IXP455
processor and it exposes a segment of the IXP455's memory so that it is
available on the PCI bus. The other processor (a pentium M running
Windows OS) sees this exposed IXP455 memory as PCI memory from it's
perspective.

> 
> However, perhaps you don't mean "PCI memory". Perhaps you 
> mean real memory in the address-space, and you need to 
> reserve it and give its physical address to something inside 
> a PCI-bus card, perhaps for DMA. In that case, you can either 
> memory-map some physical memory (get_dma_pages()) or you can 
> tell the kernel you have less memory than you really have, 
> and use the memory the kernel doesn't know about for your own 
> private purposes. To access this private memory you use 
> ioremap() and friends. This can be memory-mapped to 
> user-space as well so you can perform DMA directly to 
> user-space buffers. You can find the highest address that the 
> kernel uses by reading kernel variable num_physpages. This 
> tells the number of pages the kernel uses. The kernel does 
> write to the next one so you need to start using pages that 
> are two higher than num_physpages.

I'll take a look telling the kernel it has less memory that there
physically exists and use ioremap() to map it in.

Thanks,
Jon 

             reply	other threads:[~2006-11-28 19:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-28 19:52 Jon Ringle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-11-30 21:51 Jon Ringle
2006-11-30 18:31 Jon Ringle
2006-11-30 18:56 ` Fawad Lateef
2006-11-30 17:47 Jon Ringle
2006-11-30 18:32 ` Fawad Lateef
2006-11-28 19:37 Jon Ringle
2006-11-28 19:26 Jon Ringle
     [not found] <fa.LC2HgQx8572p2lwOKfUm6cxg95s@ifi.uio.no>
2006-11-28  0:38 ` Robert Hancock
2006-11-28  3:36   ` Jon Ringle
2006-11-28  5:19     ` Robert Hancock
2006-11-28  5:34     ` Dave Airlie
2006-11-28  6:51       ` Fawad Lateef
2006-11-28 10:14         ` Jesper Juhl
2006-11-28 13:04     ` linux-os (Dick Johnson)
2006-11-27 16:31 Jon Ringle

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=22170ADB26112F478A4E293FF9D449F44D0F89@secure.comdial.com \
    --to=jringle@vertical.com \
    --cc=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@analogic.com \
    /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

Powered by JetHome