public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] maybe a priority mistake in mpc85xx_cpu\init.c
Date: Tue, 26 Oct 2010 12:14:08 +0200	[thread overview]
Message-ID: <m2vd4ptg5r.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1000d70.d8d1.12bca65bb27.Coremail.geniis@126.com> (geniis@126.com's message of "Thu, 21 Oct 2010 00:08:06 +0800 (CST)")

Hi geniis,

> hi,
>  
>     I notice that in "arch\powerpc\cpu\mpc85xx\cpu_init.c" line 193, version 2010.06:
> if (! memctl->br1 & 1)
>  
>     The original intention is to check if V bit of BR1 is set or not, but the operator "!" has higher priority than "&" ,I think it should be changed to:
>  
> if (! (memctl->br1 & 1))
>  
>     please check this question, thanks!_______________________________________________

It would have helped if you formulated your inquiry in the form of a
patch.

Nevertheless to me it seems like this problem has been fixed in mainline
by this commit:

commit f51cdaf19141151ce2b40d562a468605340f2315
Author: Becky Bruce <beckyb@kernel.crashing.org>
Date:   Thu Jun 17 11:37:20 2010 -0500

    83xx/85xx/86xx: LBC register cleanup
    
    Currently, 83xx, 86xx, and 85xx have a lot of duplicated code
    dedicated to defining and manipulating the LBC registers.  Merge
    this into a single spot.
    
    To do this, we have to decide on a common name for the data structure
    that holds the lbc registers - it will now be known as fsl_lbc_t, and we
    adopt a common name for the immap layouts that include the lbc - this was
    previously known as either im_lbc or lbus; use the former.
    
    In addition, create accessors for the BR/OR regs that use in/out_be32
    and use those instead of the mismash of access methods currently in play.
    
    I have done a successful ppc build all and tested a board or two from
    each processor family.
    
    Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
    Acked-by: Kim Phillips <kim.phillips@freescale.com>
    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


The change includes this code replacement:

+#ifdef CONFIG_MPC85xx
+       /* if cs1 is already set via debugger, leave cs0/cs1 alone */
+       if (get_lbc_br(1) & BR_V)
+               init_br1 = 0;
+#endif

So it does indeed seem to fix the problem you noted.

Cheers
  Detlev

-- 
The proprietary-Unix players proved so ponderous, so blind, and so inept at
marketing that Microsoft was able to grab away a large part of their market
with the shockingly inferior technology of its Windows operating system.
                   -- "A Brief History of Hackerdom" by Eric Steven Raymond
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

      reply	other threads:[~2010-10-26 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20 16:08 [U-Boot] maybe a priority mistake in mpc85xx_cpu\init.c geniis
2010-10-26 10:14 ` Detlev Zundel [this message]

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=m2vd4ptg5r.fsf@ohwell.denx.de \
    --to=dzu@denx.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