summaryrefslogtreecommitdiff
path: root/cpu/ppc4xx/i2c.c
diff options
context:
space:
mode:
authorJeffrey Mann <mannj@embeddedplanet.com>2007-04-12 14:15:59 +0200
committerStefan Roese <sr@denx.de>2007-04-12 14:15:59 +0200
commit2ad3aba01d37b72e7c957b07e102fccd64fe6d13 (patch)
treea97f1aadb17333df38b229fec9be6e1df972315c /cpu/ppc4xx/i2c.c
parente8aac8e7bfc7cfdef5780f8f1d4c85184f59a06f (diff)
downloadu-boot-imx-2ad3aba01d37b72e7c957b07e102fccd64fe6d13.zip
u-boot-imx-2ad3aba01d37b72e7c957b07e102fccd64fe6d13.tar.gz
u-boot-imx-2ad3aba01d37b72e7c957b07e102fccd64fe6d13.tar.bz2
ppc4xx: Fix i2c divisor calcularion for PPC4xx
This patch fixes changes the i2c_init(...) function to use the function get_OPB_freq() rather than calculating the OPB speed by sysInfo.freqPLB/sysInfo.pllOpbDiv. The get_OPB_freq() function is specific per processor. The prior method was not and so was calculating the wrong speed for some PPC4xx processors. Signed-off-by: Jeffrey Mann <mannj@embeddedplanet.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'cpu/ppc4xx/i2c.c')
-rw-r--r--cpu/ppc4xx/i2c.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cpu/ppc4xx/i2c.c b/cpu/ppc4xx/i2c.c
index 8f4da86..47c264e 100644
--- a/cpu/ppc4xx/i2c.c
+++ b/cpu/ppc4xx/i2c.c
@@ -91,7 +91,6 @@ static void _i2c_bus_reset(void)
void i2c_init(int speed, int slaveadd)
{
- sys_info_t sysInfo;
unsigned long freqOPB;
int val, divisor;
int bus;
@@ -124,8 +123,7 @@ void i2c_init(int speed, int slaveadd)
/* Clock divide Register */
/* get OPB frequency */
- get_sys_info(&sysInfo);
- freqOPB = sysInfo.freqPLB / sysInfo.pllOpbDiv;
+ freqOPB = get_OPB_freq();
/* set divisor according to freqOPB */
divisor = (freqOPB - 1) / 10000000;
if (divisor == 0)