From: Sebastian Siewior <bigeasy@linutronix.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] mpc85xx: fix upmconfig
Date: Tue, 15 Jul 2008 10:49:56 +0200 [thread overview]
Message-ID: <20080715084956.GA30428@www.tglx.de> (raw)
In-Reply-To: <2acbd3e40807141732n155d7007oa39c7eb9ec1c9308@mail.gmail.com>
* Andy Fleming | 2008-07-14 19:32:56 [-0500]:
>> --- a/cpu/mpc85xx/cpu.c
>> +++ b/cpu/mpc85xx/cpu.c
>> @@ -71,8 +71,7 @@ struct cpu_type *identify_cpu(u32 ver)
>>
>> static void set_lcb_clock(uint clkdiv)
>> {
>> - volatile immap_t *immap = (immap_t *)CFG_IMMR;
>> - volatile ccsr_lbc_t *lbc= &immap->im_lbc;
>> + volatile ccsr_lbc_t *lbc = (void *)(CFG_MPC85xx_LBC_ADDR);
>> uint lcrr;
>>
>> lcrr = lbc->lcrr;
>> @@ -352,8 +351,8 @@ void upmconfig (uint upm, uint * table, uint size)
>> i++, brp += 2, orp += 2) {
>>
>> /* Look for a valid BR with selected UPM */
>> - if ((in_be32(brp) & (BR_V | upmmask)) == (BR_V | upmmask)) {
>> - dummy = (volatile u8*)(in_be32(brp) >> BR_BA_SHIFT);
>> + if ((in_be32(brp) & (BR_V | BR_MSEL)) == (BR_V | upmmask)) {
>> + dummy = (volatile u8*)(in_be32(brp) & BR_BA);
>
>This looks pretty good to me, but I'm not very familiar with this
>code. Could you explain a little more deeply what is wrong with the
>old way, and why the new way is better? I think I understand the
>problem with the BA_SHIFT (actually, it alarms me, a bit), but I'm not
the first part, changes the computation of the dummy address. The spec
[1] chap 14.4.4.2 referes to the dummy address as "...by a (dummy) write
transaction to the relevant UPM assigned bank." The address is assigned
in the relevant BRx[BA] register (bits 0-16 if not used extened
addresses) and therefore shift is wrong, logical and is correct.
>so sure about using MSEL on one side of the ==, and not the other.
BRx[MSEL] specifies the machines used (table 14-4, pdf page 631 in my
document). MSEL is the mask while upmmask (UPMC, UPMB, or UPMB) is the
content of the register. For instance, if your BR[MSEL] register would
have all bits set (what is reserved / not legal) than the old compare
method would match UPMA, UPMB & UPMC where is the new method would skip
it.
>Andy
Sebastian
[1] MPC8544ERM.pdf Rev1
next prev parent reply other threads:[~2008-07-15 8:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 12:36 [U-Boot-Users] [PATCH] mpc85xx: fix upmconfig Sebastian Siewior
2008-07-15 0:32 ` Andy Fleming
2008-07-15 8:49 ` Sebastian Siewior [this message]
2008-07-29 13:23 ` Wolfgang Denk
2008-07-16 11:15 ` Detlev Zundel
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=20080715084956.GA30428@www.tglx.de \
--to=bigeasy@linutronix.de \
--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