Skip to content

Commit

Permalink
powerpc/85xx: Add determining and report IFC frequency
Browse files Browse the repository at this point in the history
Signed-off-by: Kumar Gala <[email protected]>
Signed-off-by: Andy Fleming <[email protected]>
  • Loading branch information
kumargala authored and Andy Fleming committed Oct 22, 2012
1 parent 553ae6f commit 800c73c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/cpu/mpc85xx/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions arch/powerpc/cpu/mpc85xx/speed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}


Expand Down

0 comments on commit 800c73c

Please sign in to comment.