From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from exprod5og116.obsmtp.com ([64.18.0.147]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T7Rvt-0005Aq-P2 for barebox@lists.infradead.org; Fri, 31 Aug 2012 14:10:50 +0000 From: Renaud Barbier Date: Fri, 31 Aug 2012 15:10:30 +0100 Message-Id: <1346422235-3949-2-git-send-email-renaud.barbier@ge.com> In-Reply-To: <1346335217-9686-1-git-send-email-renaud.barbier@ge.com> References: <1346335217-9686-1-git-send-email-renaud.barbier@ge.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1/6] mpc85xx: i2c frequency To: barebox@lists.infradead.org A function that returns the system bus frequency used to compute the i2c bus frequency is added for future use. Signed-off-by: Renaud Barbier --- 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@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox