X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=cpu%2Fmpc8xx%2Fcpu_init.c;h=c79e5780ad3d74d7adc3397837383ffa2298d9e2;hb=8e990cb076a1c77daf3a50cc0df9732135e9eef5;hp=8f06dd1ab91329ee1b30c75f8cd162a9fa165f96;hpb=b028f7151379c5bb6814099fbbccb31d8b07b891;p=u-boot diff --git a/cpu/mpc8xx/cpu_init.c b/cpu/mpc8xx/cpu_init.c index 8f06dd1ab9..c79e5780ad 100644 --- a/cpu/mpc8xx/cpu_init.c +++ b/cpu/mpc8xx/cpu_init.c @@ -27,6 +27,10 @@ #include #include +#if defined(CFG_RTCSC) || defined(CFG_RMDS) +DECLARE_GLOBAL_DATA_PTR; +#endif + #if defined(CFG_I2C_UCODE_PATCH) || defined(CFG_SPI_UCODE_PATCH) void cpm_load_patch (volatile immap_t * immr); #endif @@ -42,6 +46,9 @@ void cpu_init_f (volatile immap_t * immr) { #ifndef CONFIG_MBX volatile memctl8xx_t *memctl = &immr->im_memctl; +# ifdef CFG_PLPRCR + ulong mfmask; +# endif #endif ulong reg; @@ -86,17 +93,26 @@ void cpu_init_f (volatile immap_t * immr) /* If CFG_PLPRCR (set in the various *_config.h files) tries to * set the MF field, then just copy CFG_PLPRCR over car_plprcr, - * otherwise OR in CFG_PLPRCR so we do not change the currentMF + * otherwise OR in CFG_PLPRCR so we do not change the current MF * field value. + * + * For newer (starting MPC866) chips PLPRCR layout is different. */ -#if ((CFG_PLPRCR & PLPRCR_MF_MSK) != 0) - reg = CFG_PLPRCR; /* reset control bits */ -#else - reg = immr->im_clkrst.car_plprcr; - reg &= PLPRCR_MF_MSK; /* isolate MF field */ - reg |= CFG_PLPRCR; /* reset control bits */ -#endif +#ifdef CFG_PLPRCR + if (get_immr(0xFFFF) >= MPC8xx_NEW_CLK) + mfmask = PLPRCR_MFACT_MSK; + else + mfmask = PLPRCR_MF_MSK; + + if ((CFG_PLPRCR & mfmask) != 0) + reg = CFG_PLPRCR; /* reset control bits */ + else { + reg = immr->im_clkrst.car_plprcr; + reg &= mfmask; /* isolate MF-related fields */ + reg |= CFG_PLPRCR; /* reset control bits */ + } immr->im_clkrst.car_plprcr = reg; +#endif /* * Memory Controller: @@ -132,8 +148,7 @@ void cpu_init_f (volatile immap_t * immr) * I owe him a free beer. - wd] */ -#if defined(CONFIG_ADDERII) || \ - defined(CONFIG_GTH) || \ +#if defined(CONFIG_GTH) || \ defined(CONFIG_HERMES) || \ defined(CONFIG_ICU862) || \ defined(CONFIG_IP860) || \ @@ -143,8 +158,10 @@ void cpu_init_f (volatile immap_t * immr) defined(CONFIG_MHPC) || \ defined(CONFIG_PCU_E) || \ defined(CONFIG_R360MPI) || \ + defined(CONFIG_RMU) || \ defined(CONFIG_RPXCLASSIC) || \ defined(CONFIG_RPXLITE) || \ + defined(CONFIG_SPC1920) || \ defined(CONFIG_SPD823TS) memctl->memc_br0 = CFG_BR0_PRELIM; @@ -227,6 +244,10 @@ void cpu_init_f (volatile immap_t * immr) rpxclassic_init (); #endif +#if defined(CONFIG_RPXLITE) && defined(CFG_ENV_IS_IN_NVRAM) + rpxlite_init (); +#endif + #ifdef CFG_RCCR /* must be done before cpm_load_patch() */ /* write config value */ immr->im_cpm.cp_rccr = CFG_RCCR; @@ -243,8 +264,6 @@ void cpu_init_f (volatile immap_t * immr) int cpu_init_r (void) { #if defined(CFG_RTCSC) || defined(CFG_RMDS) - DECLARE_GLOBAL_DATA_PTR; - bd_t *bd = gd->bd; volatile immap_t *immr = (volatile immap_t *) (bd->bi_immr_base); #endif