This patch should resolve the compilation issues on 547x/548x cpus.

Best regards

On gio, 2008-03-27 at 10:11 +0100, Luigi 'Comio' Mantellini wrote:
> 
> This patch seems incompatible with cf547x/548x cpus because the cpu
> specific global data doesn't define the i2c1_clk / i2c2_clk
> attributes.
> 
> Best regards,
> 
> luigi
> 
> On ven, 2008-03-14 at 17:45 -0500, Timur Tabi wrote: 
> > Add support to the Freescale I2C driver (fsl_i2c.c) for setting and querying
> > the I2C bus speed.  Current 8[356]xx boards define the CFG_I2C_SPEED macro,
> > but fsl_i2c.c ignores it and uses conservative value when programming the
> > I2C bus speed.
> > 

-- 
     ______       Luigi Mantellini
   .'______'.     R&D - Software
  (.'      '.)    Industrie Dial Face S.p.A.
  ( :=----=: )    Via Canzo, 4
  ('.______.')    20068 Peschiera Borromeo (MI), Italy
   '.______.'     Tel.: +39 02 5167 2813
                  Fax:  +39 02 5167 2459
Ind.  Dial Face   Email: [EMAIL PROTECTED]
www.idf-hit.com   GPG fingerprint: 3DD1 7B71 FBDF 6376 1B4A
                                   B003 175F E979 907E 1650



diff --git a/cpu/mcf547x_8x/speed.c b/cpu/mcf547x_8x/speed.c
index 389e7c9..80fea09 100644
--- a/cpu/mcf547x_8x/speed.c
+++ b/cpu/mcf547x_8x/speed.c
@@ -39,5 +39,8 @@ int get_clocks(void)
 
 	gd->bus_clk = CFG_CLK;
 	gd->cpu_clk = (gd->bus_clk * 2);
+
+	gd->i2c1_clk = gd->bus_clk;
+
 	return (0);
 }
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index dde0571..00e7d49 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -367,7 +367,11 @@ int i2c_set_bus_num(unsigned int bus)
 
 int i2c_set_bus_speed(unsigned int speed)
 {
+#ifdef CFG_I2C2_OFFSET
 	unsigned int i2c_clk = (i2c_bus_num == 1) ? gd->i2c2_clk : gd->i2c1_clk;
+#else
+	unsigned int i2c_clk = gd->i2c1_clk;
+#endif
 
 	writeb(0, &i2c_dev[i2c_bus_num]->cr);		/* stop controller */
 	i2c_bus_speed[i2c_bus_num] =
diff --git a/include/asm-m68k/global_data.h b/include/asm-m68k/global_data.h
index 958736e..d0112cd 100644
--- a/include/asm-m68k/global_data.h
+++ b/include/asm-m68k/global_data.h
@@ -47,6 +47,9 @@ typedef	struct	global_data {
 	unsigned long	vco_clk;
 	unsigned long	flb_clk;
 #endif
+#ifdef CONFIG_MCF547x_8x
+	u32 i2c1_clk;
+#endif
 	unsigned long	ram_size;	/* RAM size */
 	unsigned long	reloc_off;	/* Relocation Offset */
 	unsigned long	reset_status;	/* reset status register at boot	*/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to