From: gvb.uboot <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] question of codes in \cpu\74xx_7xx\cache.S
Date: Sat, 24 Nov 2007 07:53:54 -0500 [thread overview]
Message-ID: <47481EE2.7030202@gmail.com> (raw)
In-Reply-To: <BAY131-DS292902233E345165ED844917B0@phx.gbl>
xiangguo_li at hotmail.com wrote:
> intercepted from \cpu\74xx_7xx\cache.S
>
> /*
> * Enable L1 Instruction cache
> */
> _GLOBAL(icache_enable)
> mfspr r3, HID0
> li r5, HID0_ICFI|HID0_ILOCK
> andc r3, r3, r5
> ori r3, r3, HID0_ICE
> ori r5, r3, HID0_ICFI
> mtspr HID0, r5 // this instruction is redundant,
> mtspr HID0, r3 // or this one?
> isync
> blr
>
>
> -lxg
Most likely neither are redundant. To say for sure, you need to read
the User's Manual for the 74xx family where it specifies how to change
the HID0 register.
Changing the HID0 register (and other processor control registers)
require certain "magic" sequences that the chip designers specify. If
the software doesn't do the specified sequence *exactly,* there is no
guarantee that the processor will run properly (indeed, it likely will
crash).
The above code was written by very smart engineers who read and re-read
the User's Manual. The sequence has been working for several years now.
Odds are really good that it is exactly what is needed.
HTH,
gvb
next prev parent reply other threads:[~2007-11-24 12:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-24 2:06 [U-Boot-Users] question of codes in \cpu\74xx_7xx\cache.S xiangguo_li at hotmail.com
2007-11-24 12:53 ` gvb.uboot [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-25 10:00 xiangguo_li at hotmail.com
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=47481EE2.7030202@gmail.com \
--to=gvb.uboot@gmail.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