From: Kim Phillips Date: Mon, 24 Aug 2009 11:43:09 -0500 Subject: [U-Boot] 83xx and LCRR setting In-Reply-To: References: <4A8AAB63.8010709@denx.de> <20090819193128.62f9a4b3.kim.phillips@freescale.com> <4A8D2006.2050800@denx.de> <20090821155651.5afcc499.kim.phillips@freescale.com> <4A8F90FB.7030409@denx.de> Message-ID: <20090824114309.47868c92.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 24 Aug 2009 12:15:39 +0200 Detlev Zundel wrote: > > 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? > > Personally I'd prefer the latter, as I expect a bitmask to specifiy > which bits I'm allowed to _write_. which is consistent with the rest of the assignment style in that file. > >>> 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 ;-) > > Then why not put this into mpc83xx.h? that makes a lot of sense - I don't know why original code has multiple #ifdef configuration based sccr assignments in cpu_init.c. > >>> 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? > > Of course "we" should update this ;) of course. Heiko, I got tired of looking up all the errata docs for common parts of 83xx, so now I look at the latest device manuals. In this case, the source was "MPC8379E PowerQUICC II Pro Integrated Host Processor Family Reference Manual, Rev. 1", p. 10-34, in the description for the CLKDIV bitfield. let's not duplicate existing bad code, and use the io accessor fns (e.g., out_be, etc.) for new code here please. Thanks, Kim