From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Sat, 22 Aug 2009 08:32:27 +0200 Subject: [U-Boot] 83xx and LCRR setting In-Reply-To: <20090821155651.5afcc499.kim.phillips@freescale.com> References: <4A8AAB63.8010709@denx.de> <20090819193128.62f9a4b3.kim.phillips@freescale.com> <4A8D2006.2050800@denx.de> <20090821155651.5afcc499.kim.phillips@freescale.com> Message-ID: <4A8F90FB.7030409@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Kim, Kim Phillips wrote: > On Thu, 20 Aug 2009 13:03:09 +0200 > Detlev Zundel wrote: > >> 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 > > ack. nack, it should be #if !defined(LCCR_MASK) #define LCCR_MASK 0x00000000 #endif because I did: +#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 but I can do of course a: + /* LCRR - Clock Ratio Register (10.3.1.14) */ + im->lbus.lcrr = (im->lbus.lcrr & ~LCRR_MASK) | \ + (CONFIG_SYS_LCRR & LCRR_MASK); Which way is prefered? But I am not sure if this is necessary, I prefer here the conditional in code, because, if I port a new board to u-boot, I immidiately see, there is something special, if I have an 832x ... and this construct is not so ugly I think ... >> This really depends if and how this applies to the other members of the >> 83xx family. > > they're all the same, really. OK, if it is so ;-) >> And, by the way, we should _really_ be using accessor macros all around >> ;) > > actually LCRR itself has specific instructions that say if written, it > then should be read, and then an isync be issued. Hmm.. actual code did not this! Where is this documented? And shouldn;t we update this in code? bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany