From: Detlev Zundel Date: Thu, 20 Aug 2009 13:03:09 +0200 Subject: [U-Boot] 83xx and LCRR setting In-Reply-To: <4A8D2006.2050800@denx.de> (Heiko Schocher's message of "Thu, 20 Aug 2009 12:05:58 +0200") References: <4A8AAB63.8010709@denx.de> <20090819193128.62f9a4b3.kim.phillips@freescale.com> <4A8D2006.2050800@denx.de> 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 Heiko, > I stumbled over this, just because I didn;t set this > LCRR_DBYP bit, which the CPU sets after a reset, so > what Do you think about this patch? > > 832x, LCRR: change only the valid bits for this register > > Signed-off-by: Heiko Schocher > --- > cpu/mpc83xx/cpu_init.c | 6 ++++++ > include/asm-ppc/fsl_lbc.h | 4 ++++ > 2 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c > index ea4f2af..b5f64a8 100644 > --- a/cpu/mpc83xx/cpu_init.c > +++ b/cpu/mpc83xx/cpu_init.c > @@ -193,8 +193,14 @@ void cpu_init_f (volatile immap_t * im) > */ > im->reset.rmr = (RMR_CSRE & (1< > +#if defined(CONFIG_MPC832x) > + /* LCRR - Clock Ratio Register (10.3.1.14) */ > + im->lbus.lcrr = (im->lbus.lcrr & LCRR_MASK) | \ > + (CONFIG_SYS_LCRR & ~LCRR_MASK); > +#else > /* LCRR - Clock Ratio Register (10.3.1.16) */ > im->lbus.lcrr = CONFIG_SYS_LCRR; > +#endif Please don't invent yet another conditional here. Why not do a #if defined LCCR_MASK ... #endif or maybe even always use the mask, define it in the board config and do a #if !defined(LCCR_MASK) #define LCCR_MASK 0xFFFFFFFF #endif This really depends if and how this applies to the other members of the 83xx family. And, by the way, we should _really_ be using accessor macros all around ;) Cheers Detlev -- Bacchus, n. A convenient deity invented by the ancients as an excuse for getting drunk. -- 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