
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 hs@denx.de
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<<RMR_CSRE_SHIFT));
+#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