summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorTsiChung Liew <Tsi-Chung.Liew@freescale.com>2008-08-19 03:01:19 +0600
committerJohn Rigby <jrigby@freescale.com>2008-08-28 09:16:54 -0600
commiteec567a67e00d1ed8d941e9098b7d421f4091abf (patch)
treededad365b22f5893a7483d5bd3549ab61b8a166d /cpu
parentd53cf6a9c7423cba668b867978648645f71c3090 (diff)
ColdFire: I2C fix for multiple platforms
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mcf5227x/speed.c4
-rw-r--r--cpu/mcf523x/cpu_init.c4
-rw-r--r--cpu/mcf523x/speed.c4
-rw-r--r--cpu/mcf52x2/cpu_init.c12
-rw-r--r--cpu/mcf52x2/speed.c8
-rw-r--r--cpu/mcf532x/speed.c5
-rw-r--r--cpu/mcf5445x/speed.c4
-rw-r--r--cpu/mcf547x_8x/speed.c5
8 files changed, 43 insertions, 3 deletions
diff --git a/cpu/mcf5227x/speed.c b/cpu/mcf5227x/speed.c
index 78c946f258..0baf9bcd99 100644
--- a/cpu/mcf5227x/speed.c
+++ b/cpu/mcf5227x/speed.c
@@ -116,5 +116,9 @@ int get_clocks(void)
gd->bus_clk = gd->flb_clk;
}
+#ifdef CONFIG_FSL_I2C
+ gd->i2c1_clk = gd->bus_clk;
+#endif
+
return (0);
}
diff --git a/cpu/mcf523x/cpu_init.c b/cpu/mcf523x/cpu_init.c
index 55c9cd356d..8ab5b8ed8b 100644
--- a/cpu/mcf523x/cpu_init.c
+++ b/cpu/mcf523x/cpu_init.c
@@ -110,8 +110,8 @@ void cpu_init_f(void)
#endif
#ifdef CONFIG_FSL_I2C
- gpio->par_feci2c &= ~(GPIO_PAR_FECI2C_SCL_MASK | GPIO_PAR_FECI2C_SDA_MASK);
- gpio->par_feci2c |= (GPIO_PAR_FECI2C_SCL_I2CSCL | GPIO_PAR_FECI2C_SDA_I2CSDA);
+ CFG_I2C_PINMUX_REG &= CFG_I2C_PINMUX_CLR;
+ CFG_I2C_PINMUX_REG |= CFG_I2C_PINMUX_SET;
#endif
icache_enable();
diff --git a/cpu/mcf523x/speed.c b/cpu/mcf523x/speed.c
index 247d3188bb..1bda2d482e 100644
--- a/cpu/mcf523x/speed.c
+++ b/cpu/mcf523x/speed.c
@@ -45,5 +45,9 @@ int get_clocks(void)
gd->bus_clk = CFG_CLK;
gd->cpu_clk = (gd->bus_clk * 2);
+#ifdef CONFIG_FSL_I2C
+ gd->i2c1_clk = gd->bus_clk;
+#endif
+
return (0);
}
diff --git a/cpu/mcf52x2/cpu_init.c b/cpu/mcf52x2/cpu_init.c
index 3cacb55f77..68aefe9151 100644
--- a/cpu/mcf52x2/cpu_init.c
+++ b/cpu/mcf52x2/cpu_init.c
@@ -80,6 +80,15 @@ void cpu_init_f(void)
mbar_writeShort(MCFSIM_CSCR0, CFG_CSCR0);
mbar_writeLong(MCFSIM_CSMR0, CFG_CSMR0);
+#ifdef CONFIG_FSL_I2C
+ CFG_I2C_PINMUX_REG = CFG_I2C_PINMUX_REG & CFG_I2C_PINMUX_CLR;
+ CFG_I2C_PINMUX_REG |= CFG_I2C_PINMUX_SET;
+#ifdef CFG_I2C2_OFFSET
+ CFG_I2C2_PINMUX_REG &= CFG_I2C2_PINMUX_CLR;
+ CFG_I2C2_PINMUX_REG |= CFG_I2C2_PINMUX_SET;
+#endif
+#endif
+
/* enable instruction cache now */
icache_enable();
}
@@ -322,7 +331,8 @@ void cpu_init_f(void)
#endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
#ifdef CONFIG_FSL_I2C
- gpio_reg->par_feci2c = 0x000F;
+ CFG_I2C_PINMUX_REG &= CFG_I2C_PINMUX_CLR;
+ CFG_I2C_PINMUX_REG |= CFG_I2C_PINMUX_SET;
#endif
/* enable instruction cache now */
diff --git a/cpu/mcf52x2/speed.c b/cpu/mcf52x2/speed.c
index f6edd5b6fa..4cb8f9300d 100644
--- a/cpu/mcf52x2/speed.c
+++ b/cpu/mcf52x2/speed.c
@@ -82,5 +82,13 @@ int get_clocks (void)
#else
gd->bus_clk = gd->cpu_clk;
#endif
+
+#ifdef CONFIG_FSL_I2C
+ gd->i2c1_clk = gd->bus_clk;
+#ifdef CFG_I2C2_OFFSET
+ gd->i2c2_clk = gd->bus_clk;
+#endif
+#endif
+
return (0);
}
diff --git a/cpu/mcf532x/speed.c b/cpu/mcf532x/speed.c
index 001b9f42d6..a11e425cab 100644
--- a/cpu/mcf532x/speed.c
+++ b/cpu/mcf532x/speed.c
@@ -212,5 +212,10 @@ int get_clocks(void)
{
gd->bus_clk = clock_pll(CFG_CLK / 1000, 0) * 1000;
gd->cpu_clk = (gd->bus_clk * 3);
+
+#ifdef CONFIG_FSL_I2C
+ gd->i2c1_clk = gd->bus_clk;
+#endif
+
return (0);
}
diff --git a/cpu/mcf5445x/speed.c b/cpu/mcf5445x/speed.c
index f677f3ced0..6711a1d7c8 100644
--- a/cpu/mcf5445x/speed.c
+++ b/cpu/mcf5445x/speed.c
@@ -209,5 +209,9 @@ int get_clocks(void)
#endif
}
+#ifdef CONFIG_FSL_I2C
+ gd->i2c1_clk = gd->bus_clk;
+#endif
+
return (0);
}
diff --git a/cpu/mcf547x_8x/speed.c b/cpu/mcf547x_8x/speed.c
index 389e7c99f5..28fe657298 100644
--- a/cpu/mcf547x_8x/speed.c
+++ b/cpu/mcf547x_8x/speed.c
@@ -39,5 +39,10 @@ int get_clocks(void)
gd->bus_clk = CFG_CLK;
gd->cpu_clk = (gd->bus_clk * 2);
+
+#ifdef CONFIG_FSL_I2C
+ gd->i2c1_clk = gd->bus_clk;
+#endif
+
return (0);
}