From: Leo Barnes <leo.barnes@algotrim.com>
To: linux-mtd@lists.infradead.org
Subject: Re: Enabling D-cache for OneNAND bufferram
Date: Thu, 25 Mar 2010 11:57:10 +0100 [thread overview]
Message-ID: <4BAB4186.5080805@algotrim.com> (raw)
In-Reply-To: <OF34D80617.67587BAB-ONC12576F0.00554519-C12576F0.005583EF@transmode.se>
Joakim Tjernlund wrote:
>> 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.
>>
>
> Have a look at ioremap_cached(). Seems to be availabe on ARM
> Basically you need to create a second virtual address mapping of the devices
> RAM which is cached.
>
> Jocke
>
>
Thanks for the suggestion, but I am having some trouble getting it to
work. This is how I tried to use ioremap_cached, along with the problems
I got:
Given a pointer to the first byte in the bufferram, I did:
unsigned long int phys_addr = virt_to_phys(bufaddr);
void *rmap = ioremap_cached(phys_addr, 2048);
/* Read from rmap */
iounmap(rmap);
This would not compile however since L_PTE_CACHEABLE was not defined.
After scanning through the kernel source, I found that L_PTE_CACHEABLE
was usually defined as (1 << 3) for arm. With this defined,
ioremap_cached returned a new virtual address, but gave a segmentation
fault along with "Unhandled fault: external abort on non-linefetch
(0x008) at 0xc8accc00" in /proc/kmsg when trying to do a read. Am I
using ioremap correctly? Does ioremap change the old mapping, or simply
add a second one? If it creates a second one without changing the first,
this is illegal on ARM IIRC since two mappings cannot have differing
memory attributes...
Any other ideas?
Best regards,
//Leo
next prev parent reply other threads:[~2010-03-25 10:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=4BAB4186.5080805@algotrim.com \
--to=leo.barnes@algotrim.com \
--cc=linux-mtd@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.