Re: [uClinux-dev] Re: [PATCH v2] m68knommu: driver for Freescale Coldfire I2C controller.

2010-03-12 Thread Philippe De Muyter
Hello all,

On Mon, Jan 25, 2010 at 11:56:30AM -0800, Steven King wrote:
  
   Add support for the I2C controller used on Freescale/Motorola Coldfire
   MCUs.
  
   Signed-off-by: Steven King sfk...@fdwdc.com

What's the status of this ?

I need to use i2c for a coldfire uclinux project (with a mcf5484) and I
now have 3 different coldfire i2c drivers, none of which is in mainline.

i2c-mcf.c (from uClinux-dist-20090618, but not in 
http://git.kernel.org/?p=linux/kernel/git/gerg/m68knommu.git;a=summary)
i2c-mcf548x.c (from ltib-m5475evb-20080808, found as Linux BSP for 
MCF5484LITE, MCF5475/85EVB at 
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCF548Xfpsp=1tab=Design_Tools_Tab)
i2c-coldfire.c (from http://lkml.org/lkml/2010/1/11/165)

I like to work with mainline sources to be be able to contribute to and benefit
from collective work.

Which one has the best chances to be put in mainline ?

Best regards

Philippe
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] Re: [PATCH v2] m68knommu: driver for Freescale Coldfire I2C controller.

2010-03-12 Thread Lennart Sorensen
On Fri, Mar 12, 2010 at 12:04:53PM +0100, Philippe De Muyter wrote:
 Hello all,
 
 On Mon, Jan 25, 2010 at 11:56:30AM -0800, Steven King wrote:
   
Add support for the I2C controller used on Freescale/Motorola Coldfire
MCUs.
   
Signed-off-by: Steven King sfk...@fdwdc.com
 
 What's the status of this ?
 
 I need to use i2c for a coldfire uclinux project (with a mcf5484) and I
 now have 3 different coldfire i2c drivers, none of which is in mainline.
 
 i2c-mcf.c (from uClinux-dist-20090618, but not in 
 http://git.kernel.org/?p=linux/kernel/git/gerg/m68knommu.git;a=summary)

It seems I use that one based on the filename.

 i2c-mcf548x.c (from ltib-m5475evb-20080808, found as Linux BSP for 
 MCF5484LITE, MCF5475/85EVB at 
 http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCF548Xfpsp=1tab=Design_Tools_Tab)
 i2c-coldfire.c (from http://lkml.org/lkml/2010/1/11/165)
 
 I like to work with mainline sources to be be able to contribute to and 
 benefit
 from collective work.
 
 Which one has the best chances to be put in mainline ?

No idea.

I am using this one on a 5271:

http://www.bitshrine.org/gpp/0006-I2C-device-driver.patch
http://www.bitshrine.org/gpp/0043-I2C-bug-fix.patch

No problems so far.

This is the patch that I use on top of
git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git

diff -urN 
build-2.6.29-1-m68k-uclinux-target1-nfs/arch/m68k/include/asm/m527xsim.h 
build-2.6.29-1-m68k-uclinux-target1/arch/m68k/include/asm/m527xsim.h
--- build-2.6.29-1-m68k-uclinux-target1-nfs/arch/m68k/include/asm/m527xsim.h
2010-02-12 11:49:19.0 -0500
+++ build-2.6.29-1-m68k-uclinux-target1/arch/m68k/include/asm/m527xsim.h
2010-02-12 12:10:59.0 -0500
@@ -248,5 +248,44 @@
 #defineMCF_RCR_SWRESET 0x80/* Software reset bit */
 #defineMCF_RCR_FRCSTOUT0x40/* Force external reset 
*/
 
+/*
+*
+* I2C Module (I2C) (Stolen from m5301xsim.h)
+*
+*/
+/* Register read/write macros */
+#ifdef CONFIG_M5271
+#define MCF_I2C_I2ADR   (volatile unsigned char *)(MCF_MBAR + 0x300)
+#define MCF_I2C_I2FDR   (volatile unsigned char *)(MCF_MBAR + 0x304)
+#define MCF_I2C_I2CR(volatile unsigned char *)(MCF_MBAR + 0x308)
+#define MCF_I2C_I2SR(volatile unsigned char *)(MCF_MBAR + 0x30C)
+#define MCF_I2C_I2DR(volatile unsigned char *)(MCF_MBAR + 0x310)
+
+/* Bit definitions and macros for I2AR */
+#define MCF_I2C_I2AR_ADR(x) (((x)0x7F)1)
+
+/* Bit definitions and macros for I2FDR */
+#define MCF_I2C_I2FDR_IC(x) (((x)0x3F))
+
+/* Bit definitions and macros for I2CR */
+#define MCF_I2C_I2CR_RSTA   (0x04)
+#define MCF_I2C_I2CR_TXAK   (0x08)
+#define MCF_I2C_I2CR_MTX(0x10)
+#define MCF_I2C_I2CR_MSTA   (0x20)
+#define MCF_I2C_I2CR_IIEN   (0x40)
+#define MCF_I2C_I2CR_IEN(0x80)
+
+/* Bit definitions and macros for I2SR */
+#define MCF_I2C_I2SR_RXAK   (0x01)
+#define MCF_I2C_I2SR_IIF(0x02)
+#define MCF_I2C_I2SR_SRW(0x04)
+#define MCF_I2C_I2SR_IAL(0x10)
+#define MCF_I2C_I2SR_IBB(0x20)
+#define MCF_I2C_I2SR_IAAS   (0x40)
+#define MCF_I2C_I2SR_ICF(0x80)
+
+/* Bit definitions and macros for I2DR */
+#define MCF_I2C_I2DR_DATA(x)(x)
+#endif /* I2C Module for CONFIG_M5271 */
 //
 #endif /* m527xsim_h */
diff -urN build-2.6.29-1-m68k-uclinux-target1-nfs/drivers/i2c/busses/Kconfig 
build-2.6.29-1-m68k-uclinux-target1/drivers/i2c/busses/Kconfig
--- build-2.6.29-1-m68k-uclinux-target1-nfs/drivers/i2c/busses/Kconfig  
2010-02-12 11:49:21.0 -0500
+++ build-2.6.29-1-m68k-uclinux-target1/drivers/i2c/busses/Kconfig  
2010-02-12 12:10:59.0 -0500
@@ -417,6 +417,16 @@
  This driver is deprecated and will be dropped soon. Use i2c-gpio
  instead.
 
+config I2C_MCF
+   tristate MCF ColdFire
+   depends on I2C  EXPERIMENTAL
+   help
+ If you say yes to this option, support will be included for the
+ I2C on most ColdFire CPUs
+
+ This driver can also be built as a module.  If so, the module
+ will be called i2c-mcf.
+
 config I2C_MPC
tristate MPC107/824x/85xx/52xx/86xx
depends on PPC32
diff -urN build-2.6.29-1-m68k-uclinux-target1-nfs/drivers/i2c/busses/Makefile 
build-2.6.29-1-m68k-uclinux-target1/drivers/i2c/busses/Makefile
--- build-2.6.29-1-m68k-uclinux-target1-nfs/drivers/i2c/busses/Makefile 
2010-02-12 11:49:21.0 -0500
+++ build-2.6.29-1-m68k-uclinux-target1/drivers/i2c/busses/Makefile 
2010-02-12 12:10:59.0 -0500
@@ -71,6 +71,7 @@
 obj-$(CONFIG_I2C_STUB) += i2c-stub.o
 obj-$(CONFIG_SCx200_ACB)   += scx200_acb.o
 obj-$(CONFIG_SCx200_I2C)   += scx200_i2c.o