Merge branch 'master' of rsync://rsync.denx.de/git/u-boot
[platform/kernel/u-boot.git] / cpu / mpc85xx / speed.c
index d40cd8c..ca81ee7 100644 (file)
 #include <ppc_asm.tmpl>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* --------------------------------------------------------------- */
 
 void get_sys_info (sys_info_t * sysInfo)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t    *immap = (immap_t *)CFG_IMMR;
        volatile ccsr_gur_t *gur = &immap->im_gur;
        uint plat_ratio,e500_ratio;
@@ -81,9 +82,8 @@ void get_sys_info (sys_info_t * sysInfo)
 
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        sys_info_t sys_info;
-#if defined(CONFIG_MPC8560)
+#if defined(CONFIG_CPM2)
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        uint sccr, dfbrg;
 
@@ -95,7 +95,7 @@ int get_clocks (void)
        get_sys_info (&sys_info);
        gd->cpu_clk = sys_info.freqProcessor;
        gd->bus_clk = sys_info.freqSystemBus;
-#if defined(CONFIG_MPC8560)
+#if defined(CONFIG_CPM2)
        gd->vco_out = 2*sys_info.freqSystemBus;
        gd->cpm_clk = gd->vco_out / 2;
        gd->scc_clk = gd->vco_out / 4;