]> git.sur5r.net Git - u-boot/commitdiff
powerpc/85xx: Add determining and report IFC frequency
authorKumar Gala <galak@kernel.crashing.org>
Mon, 8 Oct 2012 07:44:06 +0000 (07:44 +0000)
committerAndy Fleming <afleming@freescale.com>
Mon, 22 Oct 2012 19:31:14 +0000 (14:31 -0500)
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
arch/powerpc/cpu/mpc85xx/cpu.c
arch/powerpc/cpu/mpc85xx/speed.c

index a5048a130647383cb7925f8128cbed2800ed1281..26fc84c9aae35c158b807d3fa2de9606425adcde 100644 (file)
@@ -181,6 +181,10 @@ int checkcpu (void)
        }
 #endif
 
+#if defined(CONFIG_FSL_IFC)
+       printf("IFC:%-4s MHz\n", strmhz(buf1, sysinfo.freqLocalBus));
+#endif
+
 #ifdef CONFIG_CPM2
        printf("CPM:   %s MHz\n", strmhz(buf1, sysinfo.freqSystemBus));
 #endif
index 6dd9e8db70d6cdaeed38d4b93faa6749f9bdef68..203f53d60032946b1960cf2881f3cb2c139a8665 100644 (file)
@@ -39,6 +39,10 @@ DECLARE_GLOBAL_DATA_PTR;
 void get_sys_info (sys_info_t * sysInfo)
 {
        volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#ifdef CONFIG_FSL_IFC
+       struct fsl_ifc *ifc_regs = (void *)CONFIG_SYS_IFC_ADDR;
+       u32 ccr;
+#endif
 #ifdef CONFIG_FSL_CORENET
        volatile ccsr_clk_t *clk = (void *)(CONFIG_SYS_FSL_CORENET_CLK_ADDR);
        unsigned int cpu;
@@ -230,6 +234,13 @@ void get_sys_info (sys_info_t * sysInfo)
                sysInfo->freqLocalBus = lcrr_div;
        }
 #endif
+
+#if defined(CONFIG_FSL_IFC)
+       ccr = in_be32(&ifc_regs->ifc_ccr);
+       ccr = ((ccr & IFC_CCR_CLK_DIV_MASK) >> IFC_CCR_CLK_DIV_SHIFT) + 1;
+
+       sysInfo->freqLocalBus = sysInfo->freqSystemBus / ccr;
+#endif
 }