From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Tue, 26 Oct 2010 12:14:08 +0200 Subject: [U-Boot] maybe a priority mistake in mpc85xx_cpu\init.c 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)") References: <1000d70.d8d1.12bca65bb27.Coremail.geniis@126.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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 Acked-by: Kim Phillips Signed-off-by: Kumar Gala 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