From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] powerpc: why call unlock_ram_in_cache() only for e500 cores and linux?
Date: Tue, 05 May 2009 10:52:51 -0500 [thread overview]
Message-ID: <1241538771.10030.73.camel@localhost.localdomain> (raw)
For the powerpc architecture there are 2 locations that I see caches
being unlocked for those boards which lock a cache for use as early
memory:
- lib_ppc/board.c, line 757 in board_init_r()
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
unlock_ram_in_cache(); /* it's time to unlock D-cache in e500 */
#endif
- lib_ppc/bootm.c, line 74 in boot_jump_linux()
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && !defined(CONFIG_E500)
unlock_ram_in_cache();
#endif
I had a few questions about this and was hoping someone had some
insight:
1. Why is the cache only unlocked for e500 cores in board.c?
It seems like the cache should be unlocked for all processor types in
board.c. I was under the impression any data which was initially
stored/referenced in the "cache as RAM" early in the boot process was
not needed after relocating to SDRAM. I've tried unlocking an mpc8640's
cache in board.c and the board appears to function normally to
(somewhat) support this.
2. Why is the cache only unlocked when booting Linux for non-e500
processors?
Shouldn't the cache be unlocked before booting all OSes? For example,
from what I can tell, the reference VxWorks BSP for the mpc8641 expects
the caches to be unlocked/enabled when booting and has "issues" when
booting with the L1 cache locked.
It seems like unlocking the cache for all CPUs in lib_ppc/board.c would
provide a slight performance boost as well as a bit of consistency,
while I'm not aware of any downsides. Based on the git changelogs, it
looks like the 86xx and 83xx architectures used to have some bugs
related to unlock_ram_in_cache()
(d685b74c64a38849f1a129b3ab846fbf67dd937e "use r4 instead of r2 in
lock_ram_in_cache and unlock_ram_in_cache"). Perhaps these bugs were
the reason that caches were only unlocked for e500 cores?
Thanks for any insight,
Peter
reply other threads:[~2009-05-05 15:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1241538771.10030.73.camel@localhost.localdomain \
--to=ptyser@xes-inc.com \
--cc=u-boot@lists.denx.de \
/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