All of lore.kernel.org
 help / color / mirror / Atom feed
* Enabling D-cache for OneNAND bufferram
@ 2010-03-24 13:21 Leo Barnes
  2010-03-24 15:34 ` Joakim Tjernlund
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Barnes @ 2010-03-24 13:21 UTC (permalink / raw)
  To: linux-mtd

Hello!

I am currently writing a piece of software that takes advantage of the 
fact that OneNAND supports read-while-loading. What I am doing is trying 
to achieve higher efficiency when decoding data from the OneNAND by 
decoding data that is available in the OneNAND bufferram directly 
instead of copying it to normal RAM and decoding there. So far, I have 
gotten quite poor results due to the fact that the bufferrams are not 
cached (for good reason since it is Device memory). My software will be 
used on ARM devices of different types, with my testrigs being a Nokia 
N810 and a N900.

I have exclusive access to the OneNAND chip, and as such know exactly 
what information is stored in the bufferrams at all times. If I could 
only enable the D-cache for the bufferrams, I could therefore make sure 
to invalidate the cache whenever I reprogram the OneNAND chip.

 From what I have read so far, it seems that the only way to enable 
cacheing of the bufferrams would be to somehow change how the memory 
attributes for the memory region in the MMU. I have however not found 
any easy way of doing this. Any tips? I dont really have very much 
experience when it comes to how the MMU works.

Best regards,
Leo

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Enabling D-cache for OneNAND BufferRAM
@ 2010-03-28 17:51 Leo Barnes
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Barnes @ 2010-03-28 17:51 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-28 17:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2010-03-28 17:51 Enabling D-cache for OneNAND BufferRAM Leo Barnes

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.