All of lore.kernel.org
 help / color / mirror / Atom feed
From: leo.barnes@algotrim.com (Leo Barnes)
To: linux-arm-kernel@lists.infradead.org
Subject: Enabling D-cache for OneNAND BufferRAM
Date: Sun, 28 Mar 2010 19:51:38 +0200	[thread overview]
Message-ID: <4BAF972A.5080102@algotrim.com> (raw)

Hello!

I am writing a piece of software that will utilize the fact that OneNAND 
bufferram can do execute-in-place (or in my case, decode-in-place). I am 
however getting quite bad results since the D-cache is not enabled for 
the bufferram (for good reason since it is device memory). Since I have 
exclusive control over the OneNAND chip, I know exactly what information 
is in the bufferram at all times, and should therefore be able to enable 
the cache for it as long as I invalidate it when performing loads.

My question is:
How do I enable the cache for the bufferram? I assume that I will 
somehow have to change the memory attributes in the memory map for that 
part of physical memory. The people over at linux-mtd suggested using 
ioremap_cached which supposedly creates a second mapping to the physical 
address in question. From what I recall of the ARM documentation, I 
thought this was illegal since there may not be two maps of the same 
physical address with differing memory attributes. Am I wrong?

The kernel documentation also mentions that if ioremap_cached is used, 
the virtual address returned should only be accessed by readl() and 
similar. Is this necessary? My code is written in assembler since it 
requires extreme optimization, and a lot of the reads there have to be 
performed using ldrb (which is why I would like the cache to be 
enabled). Is it possible to remap the bufferram with cacheing enabled 
while still being able to access it with ldrb?

Hope someone can help!
Best regards,
//Leo

             reply	other threads:[~2010-03-28 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 17:51 Leo Barnes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-24 13:21 Enabling D-cache for OneNAND bufferram Leo Barnes
2010-03-24 15:34 ` Joakim Tjernlund
2010-03-25 10:57   ` Leo Barnes
2010-03-25 11:23     ` Joakim Tjernlund
2010-03-25 16:38       ` massimo cirillo
2010-03-26  2:39       ` Jamie Lokier

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=4BAF972A.5080102@algotrim.com \
    --to=leo.barnes@algotrim.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.