From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 04 Jun 2014 06:34:38 +0200 Subject: [U-Boot] [PATCH v2 07/12] sunxi: Add i2c support In-Reply-To: <1401824522-11353-8-git-send-email-hdegoede@redhat.com> References: <1401824522-11353-1-git-send-email-hdegoede@redhat.com> <1401824522-11353-8-git-send-email-hdegoede@redhat.com> Message-ID: <538EA1DE.8020407@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Hans, Am 03.06.2014 21:41, schrieb Hans de Goede: > Add support for the i2c controller found on all Allwinner sunxi SoCs, > this is the same controller as found on the Marvell orion5x and kirkwood > SoC families, with a slightly different register layout, so this patch uses > the existing mvtwsi code. > > Signed-off-by: Hans de Goede > Acked-by: Ian Campbell > --- > arch/arm/cpu/armv7/sunxi/board.c | 6 ++++++ > arch/arm/include/asm/arch-sunxi/i2c.h | 15 +++++++++++++++ > board/sunxi/board.c | 7 +++++++ > drivers/i2c/Makefile | 1 + > drivers/i2c/mvtwsi.c | 18 ++++++++++++++++++ > include/configs/sunxi-common.h | 9 +++++++++ > 6 files changed, 56 insertions(+) > create mode 100644 arch/arm/include/asm/arch-sunxi/i2c.h [...] > diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h > index 1d1c87d..2db083c 100644 > --- a/include/configs/sunxi-common.h > +++ b/include/configs/sunxi-common.h > @@ -161,6 +161,15 @@ > #undef CONFIG_CMD_NET > #undef CONFIG_CMD_NFS > > +/* I2C */ > +#define CONFIG_SPL_I2C_SUPPORT > +/* No CONFIG_SYS_I2C as we use the non converted mvtwsi driver */ > +#define CONFIG_HARD_I2C NACK. Goal is to get rid of HARD_I2C define ... please convert this driver to fit with CONFIG_SYS_I2C framework. A fast look in this driver, this should not to be to hard, as this driver does not support multi busses... A good example for porting a i2c driver with no multibus support is: commit 0bdffe71fddeaa46768a39305797e4512dee0f15 Author: Heiko Schocher Date: Fri Nov 8 07:30:53 2013 +0100 i2c, zynq: convert zynq i2c driver to new multibus/multiadapter framework > +#define CONFIG_SYS_I2C_SUNXI > +#define CONFIG_SYS_I2C_SPEED 400000 > +#define CONFIG_SYS_I2C_SLAVE 0x7f > +#define CONFIG_CMD_I2C > + > #ifndef CONFIG_CONS_INDEX > #define CONFIG_CONS_INDEX 1 /* UART0 */ > #endif bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany