mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/5] mpc85xx: i2c frequency
Date: Thu, 30 Aug 2012 15:00:13 +0100	[thread overview]
Message-ID: <1346335217-9686-2-git-send-email-renaud.barbier@ge.com> (raw)
In-Reply-To: <1346335217-9686-1-git-send-email-renaud.barbier@ge.com>

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 <renaud.barbier@ge.com>
---
 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

  reply	other threads:[~2012-08-30 14:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 14:00 [PATCH 0/5] IMX i2c driver update for the PPC 85xx Renaud Barbier
2012-08-30 14:00 ` Renaud Barbier [this message]
2012-08-30 14:00 ` [PATCH 2/5] ppc/asm/fsl_i2c.h is removed Renaud Barbier
2012-08-30 14:00 ` [PATCH 3/5] mpc85xx: header update Renaud Barbier
2012-08-31  7:16   ` Sascha Hauer
2012-08-30 14:00 ` [PATCH 4/5] i2c: adapt the i2c-imx driver to mpc85xx machines Renaud Barbier
2012-08-31  7:24   ` Sascha Hauer
2012-08-30 14:00 ` [PATCH 5/5] ppc: p2020rdb i2c support Renaud Barbier
2012-08-31 14:10 ` [PATCH V2 0/6 ] IMX i2c driver update for the PPC 85xx Renaud Barbier
2012-09-03  7:39   ` Sascha Hauer
2012-08-31 14:10 ` [PATCH 1/6] mpc85xx: i2c frequency Renaud Barbier
2012-08-31 14:10 ` [PATCH 2/6] ppc/asm/fsl_i2c.h is removed Renaud Barbier
2012-08-31 14:10 ` [PATCH 3/6] mpc85xx: header update Renaud Barbier
2012-08-31 14:10 ` [PATCH 4/6] IMX driver: replace imx -> fsl Renaud Barbier
2012-08-31 14:10 ` [PATCH 5/6] i2c: adapt the i2c-imx driver to mpc85xx machines Renaud Barbier
2012-08-31 14:10 ` [PATCH 6/6] ppc: p2020rdb i2c support Renaud Barbier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346335217-9686-2-git-send-email-renaud.barbier@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox