To prepare for the introduction of the Freescale I2C driver, a function that returns the system bus frequency used to compute the i2c bus frequency is added. Signed-off-by: Renaud Barbier <renaud.barbier@xxxxxx> --- arch/ppc/mach-mpc85xx/include/mach/clocks.h | 1 + arch/ppc/mach-mpc85xx/speed.c | 9 +++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/ppc/mach-mpc85xx/include/mach/clocks.h b/arch/ppc/mach-mpc85xx/include/mach/clocks.h index 2ab367b..e20d685 100644 --- a/arch/ppc/mach-mpc85xx/include/mach/clocks.h +++ b/arch/ppc/mach-mpc85xx/include/mach/clocks.h @@ -12,5 +12,6 @@ struct sys_info { unsigned long fsl_get_bus_freq(ulong dummy); unsigned long fsl_get_timebase_clock(void); +unsigned long fsl_get_i2c_freq(void); void fsl_get_sys_info(struct sys_info *sysInfo); #endif /* __ASM_ARCH_CLOCKS_H */ diff --git a/arch/ppc/mach-mpc85xx/speed.c b/arch/ppc/mach-mpc85xx/speed.c index 40d3664..fff2d22 100644 --- a/arch/ppc/mach-mpc85xx/speed.c +++ b/arch/ppc/mach-mpc85xx/speed.c @@ -102,3 +102,12 @@ unsigned long fsl_get_timebase_clock(void) return (sysinfo.freqSystemBus + 4UL)/8UL; } + +unsigned long fsl_get_i2c_freq(void) +{ + struct sys_info sysinfo; + + fsl_get_sys_info(&sysinfo); + + return sysinfo.freqSystemBus / 2; +} -- 1.7.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox