All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C
@ 2012-10-22  7:21 Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 1/9] exynos:clock: Add i2c clock Piotr Wilczek
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patchset enables both software and hardware I2C support for Exynos 4.
New multi_i2c driver is added to support simultaneous use of hardware
and software I2C drivers.
The s3c24x0_i2c driver is modified to use for for both Exynos 4 and Exynos 5.
Both s3c24x0_i2c and soft_i2c drivers are modified so can be used separetly
(only hardware or only software) or can be used simultaneously.
Pinmux setting and clock is add for Exynos4 to support hardware I2C.

This patchset depends on the following patchset:
http://patchwork.ozlabs.org/patch/192742/
http://patchwork.ozlabs.org/patch/192743/
http://patchwork.ozlabs.org/patch/192744/
...
http://patchwork.ozlabs.org/patch/192765/

Changes in v2:
	- added multi_i2c driver;
	- modified s3c24x0_i2c driver
	- modified soft_i2c driver
	- modified exynos4_get_i2c_clk function;

Piotr Wilczek (9):
  exynos:clock: Add i2c clock
  exynos:cpu: Add Exynos4 I2C spacing
  exynos:pinmux: Add pinmux support for i2c
  drivers:i2c: Modify I2C driver for Exynos4
  drivers:i2c: Add support for multi I2C
  driver:i2c: Modify Soft I2C driver for Multi-I2C
  driver:i2c: Modify s3c24x0_i2c driver for Multi-I2C
  drivers:i2c: modify I2C header for Multi-I2C
  arm:trats: Use Multi-I2C on Trarts board

 arch/arm/cpu/armv7/exynos/clock.c      |   17 +++++
 arch/arm/cpu/armv7/exynos/pinmux.c     |   51 +++++++++++++
 arch/arm/include/asm/arch-exynos/cpu.h |    2 +
 board/samsung/trats/trats.c            |   35 +++++++++-
 drivers/i2c/Makefile                   |    1 +
 drivers/i2c/multi_i2c.c                |  124 ++++++++++++++++++++++++++++++++
 drivers/i2c/s3c24x0_i2c.c              |   89 +++++++++++++++++++----
 drivers/i2c/soft_i2c.c                 |   60 ++++++++++++++--
 include/configs/trats.h                |    9 ++-
 include/i2c.h                          |   11 +++
 include/multi_i2c.h                    |   62 ++++++++++++++++
 11 files changed, 439 insertions(+), 22 deletions(-)
 create mode 100644 drivers/i2c/multi_i2c.c
 create mode 100644 include/multi_i2c.h

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 1/9] exynos:clock: Add i2c clock
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 2/9] exynos:cpu: Add Exynos4 I2C spacing Piotr Wilczek
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch adds i2c clock for Exynos4

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes for v2:
	- modified exynos4_get_i2c_clk function

 arch/arm/cpu/armv7/exynos/clock.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index 4f3b451..21e45d2 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -732,6 +732,21 @@ static unsigned long exynos5_get_i2c_clk(void)
 	return aclk_66;
 }
 
+static unsigned long exynos4_get_i2c_clk(void)
+{
+	struct exynos4_clock *clk =
+		(struct exynos4_clock *)samsung_get_base_clock();
+	unsigned long sclk, aclk_100;
+	unsigned int ratio;
+
+	sclk = get_pll_clk(APLL);
+
+	ratio = (readl(&clk->div_top)) >> 4;
+	ratio &= 0xf;
+	aclk_100 = sclk / (ratio + 1);
+	return aclk_100;
+}
+
 unsigned long get_pll_clk(int pllreg)
 {
 	if (cpu_is_exynos5())
@@ -752,6 +767,8 @@ unsigned long get_i2c_clk(void)
 {
 	if (cpu_is_exynos5()) {
 		return exynos5_get_i2c_clk();
+	} else if (cpu_is_exynos4()) {
+		return exynos4_get_i2c_clk();
 	} else {
 		debug("I2C clock is not set for this CPU\n");
 		return 0;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 2/9] exynos:cpu: Add Exynos4 I2C spacing
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 1/9] exynos:clock: Add i2c clock Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 3/9] exynos:pinmux: Add pinmux support for i2c Piotr Wilczek
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch add the spacing for i2c for Exynos4

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- none

 arch/arm/include/asm/arch-exynos/cpu.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h
index 2cd4ae1..3073ca1 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -28,6 +28,8 @@
 #define EXYNOS4_ADDR_BASE		0x10000000
 
 /* EXYNOS4 */
+#define EXYNOS4_I2C_SPACING		0x10000
+
 #define EXYNOS4_GPIO_PART3_BASE		0x03860000
 #define EXYNOS4_PRO_ID			0x10000000
 #define EXYNOS4_SYSREG_BASE		0x10010000
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 3/9] exynos:pinmux: Add pinmux support for i2c
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 1/9] exynos:clock: Add i2c clock Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 2/9] exynos:cpu: Add Exynos4 I2C spacing Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 4/9] drivers:i2c: Modify I2C driver for Exynos4 Piotr Wilczek
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch add pinmux for I2C for Exynos4

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- none

 arch/arm/cpu/armv7/exynos/pinmux.c |   51 ++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c
index 5796d56..3ebeb1d 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -302,6 +302,47 @@ static int exynos4_mmc_config(int peripheral, int flags)
 	return 0;
 }
 
+static void exynos4_i2c_config(int peripheral, int flags)
+{
+	struct exynos4_gpio_part1 *gpio1 =
+		(struct exynos4_gpio_part1 *) samsung_get_base_gpio_part1();
+
+	switch (peripheral) {
+	case PERIPH_ID_I2C0:
+		s5p_gpio_cfg_pin(&gpio1->d1, 0, GPIO_FUNC(0x2));
+		s5p_gpio_cfg_pin(&gpio1->d1, 1, GPIO_FUNC(0x2));
+		break;
+	case PERIPH_ID_I2C1:
+		s5p_gpio_cfg_pin(&gpio1->d1, 2, GPIO_FUNC(0x2));
+		s5p_gpio_cfg_pin(&gpio1->d1, 3, GPIO_FUNC(0x2));
+		break;
+	case PERIPH_ID_I2C2:
+		s5p_gpio_cfg_pin(&gpio1->a0, 6, GPIO_FUNC(0x3));
+		s5p_gpio_cfg_pin(&gpio1->a0, 7, GPIO_FUNC(0x3));
+		break;
+	case PERIPH_ID_I2C3:
+		s5p_gpio_cfg_pin(&gpio1->a1, 2, GPIO_FUNC(0x3));
+		s5p_gpio_cfg_pin(&gpio1->a1, 3, GPIO_FUNC(0x3));
+		break;
+	case PERIPH_ID_I2C4:
+		s5p_gpio_cfg_pin(&gpio1->b, 2, GPIO_FUNC(0x3));
+		s5p_gpio_cfg_pin(&gpio1->b, 3, GPIO_FUNC(0x3));
+		break;
+	case PERIPH_ID_I2C5:
+		s5p_gpio_cfg_pin(&gpio1->b, 6, GPIO_FUNC(0x3));
+		s5p_gpio_cfg_pin(&gpio1->b, 7, GPIO_FUNC(0x3));
+		break;
+	case PERIPH_ID_I2C6:
+		s5p_gpio_cfg_pin(&gpio1->c1, 3, GPIO_FUNC(0x4));
+		s5p_gpio_cfg_pin(&gpio1->c1, 4, GPIO_FUNC(0x4));
+		break;
+	case PERIPH_ID_I2C7:
+		s5p_gpio_cfg_pin(&gpio1->d0, 2, GPIO_FUNC(0x3));
+		s5p_gpio_cfg_pin(&gpio1->d0, 3, GPIO_FUNC(0x3));
+		break;
+	}
+}
+
 static int exynos4_pinmux_config(int peripheral, int flags)
 {
 	switch (peripheral) {
@@ -313,6 +354,16 @@ static int exynos4_pinmux_config(int peripheral, int flags)
 	case PERIPH_ID_SDMMC4:
 		printf("SDMMC device %d not implemented\n", peripheral);
 		return -1;
+	case PERIPH_ID_I2C0:
+	case PERIPH_ID_I2C1:
+	case PERIPH_ID_I2C2:
+	case PERIPH_ID_I2C3:
+	case PERIPH_ID_I2C4:
+	case PERIPH_ID_I2C5:
+	case PERIPH_ID_I2C6:
+	case PERIPH_ID_I2C7:
+		exynos4_i2c_config(peripheral, flags);
+		break;
 	default:
 		debug("%s: invalid peripheral %d", __func__, peripheral);
 		return -1;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 4/9] drivers:i2c: Modify I2C driver for Exynos4
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (2 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 3/9] exynos:pinmux: Add pinmux support for i2c Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 5/9] drivers:i2c: Add support for multi I2C Piotr Wilczek
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch modifies the S3C i2c driver to support both Exynos4 and Exynos5

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- none

 drivers/i2c/s3c24x0_i2c.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index 9bc4c7f..90d297a 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -27,7 +27,7 @@
  */
 
 #include <common.h>
-#ifdef CONFIG_EXYNOS5
+#if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 #include <asm/arch/clk.h>
 #include <asm/arch/cpu.h>
 #else
@@ -62,7 +62,7 @@
 
 static unsigned int g_current_bus;	/* Stores Current I2C Bus */
 
-#ifndef CONFIG_EXYNOS5
+#if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 static int GetI2CSDA(void)
 {
 	struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
@@ -121,7 +121,12 @@ static void ReadWriteByte(struct s3c24x0_i2c *i2c)
 
 static struct s3c24x0_i2c *get_base_i2c(void)
 {
-#ifdef CONFIG_EXYNOS5
+#ifdef CONFIG_EXYNOS4
+	struct s3c24x0_i2c *i2c = (struct s3c24x0_i2c *)(samsung_get_base_i2c()
+							+ (EXYNOS4_I2C_SPACING
+							* g_current_bus));
+	return i2c;
+#elif defined CONFIG_EXYNOS5
 	struct s3c24x0_i2c *i2c = (struct s3c24x0_i2c *)(samsung_get_base_i2c()
 							+ (EXYNOS5_I2C_SPACING
 							* g_current_bus));
@@ -134,7 +139,7 @@ static struct s3c24x0_i2c *get_base_i2c(void)
 static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
 {
 	ulong freq, pres = 16, div;
-#ifdef CONFIG_EXYNOS5
+#if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 	freq = get_i2c_clk();
 #else
 	freq = get_PCLK();
@@ -188,7 +193,7 @@ unsigned int i2c_get_bus_num(void)
 void i2c_init(int speed, int slaveadd)
 {
 	struct s3c24x0_i2c *i2c;
-#ifndef CONFIG_EXYNOS5
+#if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 	struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
 #endif
 	int i;
@@ -204,7 +209,7 @@ void i2c_init(int speed, int slaveadd)
 		i--;
 	}
 
-#ifndef CONFIG_EXYNOS5
+#if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
 	if ((readl(&i2c->iicstat) & I2CSTAT_BSY) || GetI2CSDA() == 0) {
 #ifdef CONFIG_S3C2410
 		ulong old_gpecon = readl(&gpio->gpecon);
@@ -248,7 +253,7 @@ void i2c_init(int speed, int slaveadd)
 		writel(old_gpecon, &gpio->pgcon);
 #endif
 	}
-#endif /* #ifndef CONFIG_EXYNOS5 */
+#endif /* #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5) */
 	i2c_ch_init(i2c, speed, slaveadd);
 }
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 5/9] drivers:i2c: Add support for multi I2C
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (3 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 4/9] drivers:i2c: Modify I2C driver for Exynos4 Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 6/9] driver:i2c: Modify Soft I2C driver for Multi-I2C Piotr Wilczek
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch enables use of SOFT I2C and HARD I2C simultaneously.

Signed-off-by: Gwuieon Jin <ge.jin@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- new patch

 drivers/i2c/Makefile    |    1 +
 drivers/i2c/multi_i2c.c |  124 +++++++++++++++++++++++++++++++++++++++++++++++
 include/multi_i2c.h     |   62 +++++++++++++++++++++++
 3 files changed, 187 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/multi_i2c.c
 create mode 100644 include/multi_i2c.h

diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 5dbdbe3..5c82130 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -46,6 +46,7 @@ COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
 COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
 COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
+COBJS-$(CONFIG_MULTI_I2C) += multi_i2c.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/i2c/multi_i2c.c b/drivers/i2c/multi_i2c.c
new file mode 100644
index 0000000..7751c7b
--- /dev/null
+++ b/drivers/i2c/multi_i2c.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Gwuieon Jin <ge.jin@samsung.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/errno.h>
+#include <multi_i2c.h>
+
+
+static struct multi_i2c_dev multi_i2c_devs[MULTI_I2C_MAX];
+static struct multi_i2c_dev *active_dev;
+static int count_devices;
+
+static struct multi_i2c_dev *multi_i2c_get_by_bus(const unsigned int bus)
+{
+	/* HARD I2C MAX NUM */
+	if (bus > CONFIG_MAX_I2C_NUM)
+		return &multi_i2c_devs[MULTI_I2C_SOFT];
+
+	return &multi_i2c_devs[MULTI_I2C_HARD];
+}
+
+static void multi_i2c_register(struct i2c_ops *ops, u32 flags)
+{
+	int index;
+
+	if (flags & SOFT_I2C_DEV)
+		index = MULTI_I2C_SOFT;
+	else
+		index = MULTI_I2C_HARD;
+
+	multi_i2c_devs[index].ops = ops;
+	active_dev = &multi_i2c_devs[index];
+	count_devices++;
+}
+
+void i2c_init(int speed, int slaveadd)
+{
+	int i;
+
+	count_devices = 0;
+
+#ifdef CONFIG_SOFT_I2C
+	multi_i2c_register(&soft_i2c_ops, SOFT_I2C_DEV);
+#endif
+#ifdef CONFIG_DRIVER_S3C24X0_I2C
+	multi_i2c_register(&s3c24x0_i2c_ops, HARD_I2C_DEV);
+#endif
+	for (i = 0; i < count_devices; i++) {
+		if (multi_i2c_devs[i].ops->init)
+			multi_i2c_devs[i].ops->init(speed, slaveadd);
+	}
+}
+
+int i2c_probe(uchar chip)
+{
+	return active_dev->ops->probe(chip);
+}
+
+int i2c_read(uchar chip, uint addr, int alen,
+		uchar *buffer, int len)
+{
+	return active_dev->ops->read(chip, addr, alen,
+			buffer, len);
+}
+
+int i2c_write(uchar chip, uint addr, int alen,
+		uchar *buffer, int len)
+{
+	return active_dev->ops->write(chip, addr, alen,
+			buffer, len);
+}
+
+unsigned int i2c_get_bus_num(void)
+{
+	return active_dev->ops->get_bus_num();
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+	struct multi_i2c_dev *dev;
+
+	if (bus < 0 || bus > CONFIG_SYS_MAX_I2C_BUS)
+		return -1;
+
+	dev = multi_i2c_get_by_bus(bus);
+	if (dev) {
+		active_dev = dev;
+		return dev->ops->set_bus_num(bus);
+	}
+
+	printf("%s: Can not find I2C dev for %d bus\n",
+				__func__, bus);
+	return -EINVAL;
+}
+
+void i2c_reset(void)
+{
+	int i;
+
+	for (i = 0; i < count_devices; i++) {
+		if (multi_i2c_devs[i].ops->reset)
+			multi_i2c_devs[i].ops->reset();
+	}
+}
diff --git a/include/multi_i2c.h b/include/multi_i2c.h
new file mode 100644
index 0000000..795fbf0
--- /dev/null
+++ b/include/multi_i2c.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Gwuieon Jin <ge.jin@samsung.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _MULTI_I2C_H
+#define _MULTI_I2C_H
+
+#define SOFT_I2C_DEV  (1 << 1)
+#define HARD_I2C_DEV  (1 << 2)
+
+enum {
+	MULTI_I2C_SOFT,
+	MULTI_I2C_HARD,
+	MULTI_I2C_MAX,
+};
+
+struct i2c_ops {
+	void (*init) (int speed, int slaveadd);
+	int (*probe) (uchar chip);
+	int (*read) (uchar chip, uint addr, int alen,
+		uchar *buffer, int len);
+	int (*read_r) (uchar chip, uint addr, int alen,
+		uchar *buffer, int len);
+	int (*write) (uchar chip, uint addr, int alen,
+		uchar *buffer, int len);
+	unsigned int (*get_bus_num) (void);
+	int (*set_bus_num) (unsigned int bus);
+	void (*reset) (void);
+};
+
+/* Device information */
+struct multi_i2c_dev {
+	struct i2c_ops *ops;
+};
+
+#ifdef CONFIG_SOFT_I2C
+extern struct i2c_ops soft_i2c_ops;
+#endif
+#ifdef CONFIG_DRIVER_S3C24X0_I2C
+extern struct i2c_ops s3c24x0_i2c_ops;
+#endif
+
+#endif /* _MULTI_I2C_H */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 6/9] driver:i2c: Modify Soft I2C driver for Multi-I2C
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (4 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 5/9] drivers:i2c: Add support for multi I2C Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 7/9] driver:i2c: Modify s3c24x0_i2c " Piotr Wilczek
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch modifies soft_i2c driver to support multi-I2C.
If CONFIG_MULTI_I2C is not set the original version is used.

Signed-off-by: Gwuieon Jin <ge.jin@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- new patch


 drivers/i2c/soft_i2c.c |   60 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 36c6114..f50758b 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -271,12 +271,12 @@ static int write_byte(uchar data)
 /*
  * Functions for multiple I2C bus handling
  */
-unsigned int i2c_get_bus_num(void)
+static unsigned int soft_i2c_get_bus_num(void)
 {
 	return i2c_bus_num;
 }
 
-int i2c_set_bus_num(unsigned int bus)
+static int soft_i2c_set_bus_num(unsigned int bus)
 {
 #if defined(CONFIG_I2C_MUX)
 	if (bus < CONFIG_SYS_MAX_I2C_BUS) {
@@ -337,7 +337,7 @@ static uchar read_byte(int ack)
 /*-----------------------------------------------------------------------
  * Initialization
  */
-void i2c_init (int speed, int slaveaddr)
+static void soft_i2c_init(int speed, int slaveaddr)
 {
 #if defined(CONFIG_SYS_I2C_INIT_BOARD)
 	/* call board specific i2c bus reset routine before accessing the   */
@@ -360,7 +360,7 @@ void i2c_init (int speed, int slaveaddr)
  * completion of EEPROM writes since the chip stops responding until
  * the write completes (typically 10mSec).
  */
-int i2c_probe(uchar addr)
+static int soft_i2c_probe(uchar addr)
 {
 	int rc;
 
@@ -378,7 +378,8 @@ int i2c_probe(uchar addr)
 /*-----------------------------------------------------------------------
  * Read bytes
  */
-int  i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int
+soft_i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
 	int shift;
 	PRINTD("i2c_read: chip %02X addr %02X alen %d buffer %p len %d\n",
@@ -452,7 +453,8 @@ int  i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 /*-----------------------------------------------------------------------
  * Write bytes
  */
-int  i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int
+soft_i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
 	int shift, failures = 0;
 
@@ -482,3 +484,49 @@ int  i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 	send_stop();
 	return(failures);
 }
+
+#if defined(CONFIG_MULTI_I2C)
+struct i2c_ops soft_i2c_ops = {
+	.init        = soft_i2c_init,
+	.probe       = soft_i2c_probe,
+	.read        = soft_i2c_read,
+	.read_r      = NULL,
+	.write       = soft_i2c_write,
+	.get_bus_num = soft_i2c_get_bus_num,
+	.set_bus_num = soft_i2c_set_bus_num,
+};
+#else
+void i2c_init(int speed, int slaveaddr)
+{
+	return soft_i2c_init(speed, slaveaddr);
+}
+
+int i2c_probe(uchar chip)
+{
+	return soft_i2c_probe(chip);
+}
+
+int i2c_read(uchar chip, uint addr, int alen,
+	uchar *buffer, int len)
+{
+	return soft_i2c_read(chip, addr, alen, buffer, len);
+}
+
+int i2c_write(uchar chip, uint addr, int alen,
+	uchar *buffer, int len)
+{
+	return soft_i2c_write(chip, addr, alen, buffer, len);
+}
+
+#ifdef CONFIG_I2C_MULTI_BUS
+unsigned int i2c_get_bus_num(void)
+{
+	return soft_i2c_get_bus_num();
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+	return soft_i2c_set_bus_num(bus);
+}
+#endif /* CONFIG_I2C_MULTI_BUS */
+#endif
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 7/9] driver:i2c: Modify s3c24x0_i2c driver for Multi-I2C
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (5 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 6/9] driver:i2c: Modify Soft I2C driver for Multi-I2C Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 8/9] drivers:i2c: modify I2C header " Piotr Wilczek
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch modifies s3c24x0_i2c driver to support multi-I2C.
If CONFIG_MULTI_I2C is not set the original version is used.

Signed-off-by: Gwuieon Jin <ge.jin@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- new patch

 drivers/i2c/s3c24x0_i2c.c |   70 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index 90d297a..d9e01f4 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -168,7 +168,7 @@ static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
  */
 
 #ifdef CONFIG_I2C_MULTI_BUS
-int i2c_set_bus_num(unsigned int bus)
+static int s3c24x0_i2c_set_bus_num(unsigned int bus)
 {
 	struct s3c24x0_i2c *i2c;
 
@@ -184,13 +184,13 @@ int i2c_set_bus_num(unsigned int bus)
 	return 0;
 }
 
-unsigned int i2c_get_bus_num(void)
+static unsigned int s3c24x0_i2c_get_bus_num(void)
 {
 	return g_current_bus;
 }
 #endif
 
-void i2c_init(int speed, int slaveadd)
+static void s3c24x0_i2c_init(int speed, int slaveadd)
 {
 	struct s3c24x0_i2c *i2c;
 #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
@@ -415,7 +415,7 @@ static int i2c_transfer(struct s3c24x0_i2c *i2c,
 	return result;
 }
 
-int i2c_probe(uchar chip)
+static int s3c24x0_i2c_probe(uchar chip)
 {
 	struct s3c24x0_i2c *i2c;
 	uchar buf[1];
@@ -431,7 +431,8 @@ int i2c_probe(uchar chip)
 	return i2c_transfer(i2c, I2C_READ, chip << 1, 0, 0, buf, 1) != I2C_OK;
 }
 
-int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int
+s3c24x0_i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
 	struct s3c24x0_i2c *i2c;
 	uchar xaddr[4];
@@ -475,7 +476,8 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 	return 0;
 }
 
-int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
+static int
+s3c24x0_i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
 	struct s3c24x0_i2c *i2c;
 	uchar xaddr[4];
@@ -512,4 +514,60 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 		(i2c, I2C_WRITE, chip << 1, &xaddr[4 - alen], alen, buffer,
 		 len) != 0);
 }
+
+void s3c24x0_i2c_reset(void)
+{
+	struct s3c24x0_i2c *i2c;
+
+	i2c = get_base_i2c();
+
+	/* init to STATUS register */
+	writel(0, &i2c->iicstat);
+}
 #endif /* CONFIG_HARD_I2C */
+
+#if defined(CONFIG_MULTI_I2C)
+struct i2c_ops s3c24x0_i2c_ops = {
+	.init        = s3c24x0_i2c_init,
+	.probe       = s3c24x0_i2c_probe,
+	.read        = s3c24x0_i2c_read,
+	.write       = s3c24x0_i2c_write,
+	.get_bus_num = s3c24x0_i2c_get_bus_num,
+	.set_bus_num = s3c24x0_i2c_set_bus_num,
+	.reset       = s3c24x0_i2c_reset,
+};
+#else
+void i2c_init(int speed, int slaveaddr)
+{
+	return s3c24x0_i2c_init(speed, slaveaddr);
+}
+
+int i2c_probe(uchar chip)
+{
+	return s3c24x0_i2c_probe(chip);
+}
+
+int i2c_read(uchar chip, uint addr, int alen,
+	uchar *buffer, int len)
+{
+	return s3c24x0_i2c_read(chip, addr, alen, buffer, len);
+}
+
+int i2c_write(uchar chip, uint addr, int alen,
+	uchar *buffer, int len)
+{
+	return s3c24x0_i2c_write(chip, addr, alen, buffer, len);
+}
+
+#ifdef CONFIG_I2C_MULTI_BUS
+unsigned int i2c_get_bus_num(void)
+{
+	return s3c24x0_i2c_get_bus_num();
+}
+
+int i2c_set_bus_num(unsigned int bus)
+{
+	return s3c24x0_i2c_set_bus_num(bus);
+}
+#endif /* CONFIG_I2C_MULTI_BUS */
+#endif
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 8/9] drivers:i2c: modify I2C header for Multi-I2C
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (6 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 7/9] driver:i2c: Modify s3c24x0_i2c " Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 9/9] arm:trats: Use Multi-I2C on Trarts board Piotr Wilczek
  2012-10-22 17:07 ` [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Heiko Schocher
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch modifies i2c.h header to support Multi-I2C.

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- new patch

 include/i2c.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/i2c.h b/include/i2c.h
index 16f099d..cc07058 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -30,6 +30,13 @@
 #define _I2C_H_
 
 /*
+ * Multi_I2C header file.
+ */
+#if defined(CONFIG_MULTI_I2C)
+#include <multi_i2c.h>
+#endif
+
+/*
  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  *
  * The implementation MUST NOT use static or global variables if the
@@ -234,6 +241,10 @@ int i2c_set_bus_speed(unsigned int);
  *  Returns speed of currently active I2C bus in Hz
  */
 
+#if defined(CONFIG_MULTI_I2C)
+void i2c_reset(void);
+#endif
+
 unsigned int i2c_get_bus_speed(void);
 
 /* NOTE: These two functions MUST be always_inline to avoid code growth! */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 9/9] arm:trats: Use Multi-I2C on Trarts board
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (7 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 8/9] drivers:i2c: modify I2C header " Piotr Wilczek
@ 2012-10-22  7:21 ` Piotr Wilczek
  2012-10-22 17:07 ` [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Heiko Schocher
  9 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-22  7:21 UTC (permalink / raw)
  To: u-boot

This patch use bot hardware and software I2C on Samsung Trats board

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
---
Changes in v2:
	- new patch

 board/samsung/trats/trats.c |   35 +++++++++++++++++++++++++++++++++--
 include/configs/trats.h     |    9 ++++++++-
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index afbe4b3..b51d214 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <i2c.h>
 #include <lcd.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
@@ -65,6 +66,24 @@ static int hwrevision(int rev)
 
 struct s3c_plat_otg_data s5pc210_otg_data;
 
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+static int board_i2c_init(void)
+{
+	int i, err;
+
+	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
+		err = exynos_pinmux_config((PERIPH_ID_I2C0 + i),
+						PINMUX_FLAG_NONE);
+		if (err) {
+			debug("I2C%d not configured\n", (PERIPH_ID_I2C0 + i));
+			return err;
+		}
+	}
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+	return 0;
+}
+#endif
+
 int board_init(void)
 {
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
@@ -72,19 +91,27 @@ int board_init(void)
 	check_hw_revision();
 	printf("HW Revision:\t0x%x\n", board_rev);
 
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+	board_i2c_init();
+#endif
+
 	return 0;
 }
 
 void i2c_init_board(void)
 {
+#ifndef CONFIG_MULTI_I2C
 	struct exynos4_gpio_part1 *gpio1 =
 		(struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1();
-	struct exynos4_gpio_part2 *gpio2 =
-		(struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
 
 	/* I2C_5 -> PMIC */
 	s5p_gpio_direction_output(&gpio1->b, 7, 1);
 	s5p_gpio_direction_output(&gpio1->b, 6, 1);
+#endif
+
+	struct exynos4_gpio_part2 *gpio2 =
+		(struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2();
+
 	/* I2C_9 -> FG */
 	s5p_gpio_direction_output(&gpio2->y4, 0, 1);
 	s5p_gpio_direction_output(&gpio2->y4, 1, 1);
@@ -588,6 +615,10 @@ int board_early_init_f(void)
 	board_uart_init();
 	board_power_init();
 
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+	board_i2c_init();
+#endif
+
 	return 0;
 }
 
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 268a97b..b56fc0d 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -32,6 +32,7 @@
  */
 #define CONFIG_SAMSUNG		/* in a SAMSUNG core */
 #define CONFIG_S5P		/* which is in a S5P Family */
+#define CONFIG_EXYNOS4		/* which is in a EXYNOS4XXX */
 #define CONFIG_EXYNOS4210	/* which is in a EXYNOS4210 */
 #define CONFIG_TRATS		/* working with TRATS */
 #define CONFIG_TIZEN		/* TIZEN lib */
@@ -216,7 +217,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_CACHELINE_SIZE       32
 
-
 #define CONFIG_SOFT_I2C
 #define CONFIG_SOFT_I2C_READ_REPEATED_START
 #define CONFIG_SYS_I2C_INIT_BOARD
@@ -225,6 +225,13 @@
 #define CONFIG_SOFT_I2C_MULTI_BUS
 #define CONFIG_SYS_MAX_I2C_BUS	15
 
+#define CONFIG_MULTI_I2C
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_S3C24X0_I2C
+#define CONFIG_MAX_I2C_NUM	7
+#define CONFIG_SYS_I2C_SLAVE	0x0
+#define CONFIG_CMD_I2C
+
 #include <asm/arch/gpio.h>
 
 /* I2C PMIC */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C
  2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
                   ` (8 preceding siblings ...)
  2012-10-22  7:21 ` [U-Boot] [PATCH v2 9/9] arm:trats: Use Multi-I2C on Trarts board Piotr Wilczek
@ 2012-10-22 17:07 ` Heiko Schocher
  2012-10-23 11:31   ` Piotr Wilczek
  9 siblings, 1 reply; 12+ messages in thread
From: Heiko Schocher @ 2012-10-22 17:07 UTC (permalink / raw)
  To: u-boot

Hello Piotr Wilczek,

On 22.10.2012 09:21, Piotr Wilczek wrote:
> This patchset enables both software and hardware I2C support for Exynos 4.
> New multi_i2c driver is added to support simultaneous use of hardware
> and software I2C drivers.

There was some I2C multibus support discussions, the latest was
here:

http://www.mail-archive.com/u-boot at lists.denx.de/msg75530.html

I reworked this patches (rebased to current ML, worked in some comments
from the ML) and added soft_i2c support as an example for it. Currently
compile tested for arm and powerpc, you can find the tree here:

http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus_v2_20121023

I post this patches to the ML soon, and we should try to bring this base
to mainline and you should rebase your work on it ...

> The s3c24x0_i2c driver is modified to use for for both Exynos 4 and Exynos 5.
> Both s3c24x0_i2c and soft_i2c drivers are modified so can be used separetly
> (only hardware or only software) or can be used simultaneously.
> Pinmux setting and clock is add for Exynos4 to support hardware I2C.
>
> This patchset depends on the following patchset:
> http://patchwork.ozlabs.org/patch/192742/
> http://patchwork.ozlabs.org/patch/192743/
> http://patchwork.ozlabs.org/patch/192744/
> ...
> http://patchwork.ozlabs.org/patch/192765/
>
> Changes in v2:
> 	- added multi_i2c driver;
> 	- modified s3c24x0_i2c driver
> 	- modified soft_i2c driver
> 	- modified exynos4_get_i2c_clk function;
>
> Piotr Wilczek (9):
>    exynos:clock: Add i2c clock
>    exynos:cpu: Add Exynos4 I2C spacing
>    exynos:pinmux: Add pinmux support for i2c
>    drivers:i2c: Modify I2C driver for Exynos4
>    drivers:i2c: Add support for multi I2C
>    driver:i2c: Modify Soft I2C driver for Multi-I2C
>    driver:i2c: Modify s3c24x0_i2c driver for Multi-I2C
>    drivers:i2c: modify I2C header for Multi-I2C
>    arm:trats: Use Multi-I2C on Trarts board
>
>   arch/arm/cpu/armv7/exynos/clock.c      |   17 +++++
>   arch/arm/cpu/armv7/exynos/pinmux.c     |   51 +++++++++++++
>   arch/arm/include/asm/arch-exynos/cpu.h |    2 +
>   board/samsung/trats/trats.c            |   35 +++++++++-
>   drivers/i2c/Makefile                   |    1 +
>   drivers/i2c/multi_i2c.c                |  124 ++++++++++++++++++++++++++++++++
>   drivers/i2c/s3c24x0_i2c.c              |   89 +++++++++++++++++++----
>   drivers/i2c/soft_i2c.c                 |   60 ++++++++++++++--
>   include/configs/trats.h                |    9 ++-
>   include/i2c.h                          |   11 +++
>   include/multi_i2c.h                    |   62 ++++++++++++++++
>   11 files changed, 439 insertions(+), 22 deletions(-)
>   create mode 100644 drivers/i2c/multi_i2c.c
>   create mode 100644 include/multi_i2c.h

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C
  2012-10-22 17:07 ` [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Heiko Schocher
@ 2012-10-23 11:31   ` Piotr Wilczek
  0 siblings, 0 replies; 12+ messages in thread
From: Piotr Wilczek @ 2012-10-23 11:31 UTC (permalink / raw)
  To: u-boot

Hello Heiko Schocher,

> -----Original Message-----
> From: Heiko Schocher [mailto:hs at denx.de]
> Sent: Monday, October 22, 2012 7:07 PM
> To: Piotr Wilczek
> Cc: u-boot at lists.denx.de; Kyungmin Park; Gwuieon Jin; Simon Glass
> Subject: Re: [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C
> 
> Hello Piotr Wilczek,
> 
> On 22.10.2012 09:21, Piotr Wilczek wrote:
> > This patchset enables both software and hardware I2C support for
> Exynos 4.
> > New multi_i2c driver is added to support simultaneous use of hardware
> > and software I2C drivers.
> 
> There was some I2C multibus support discussions, the latest was
> here:
> 
> http://www.mail-archive.com/u-boot at lists.denx.de/msg75530.html
> 
> I reworked this patches (rebased to current ML, worked in some comments
> from the ML) and added soft_i2c support as an example for it. Currently
> compile tested for arm and powerpc, you can find the tree here:
> 
> http://git.denx.de/?p=u-boot/u-boot-
> i2c.git;a=shortlog;h=refs/heads/multibus_v2_20121023
> 
> I post this patches to the ML soon, and we should try to bring this
> base to mainline and you should rebase your work on it ...

Thank you for information, I will rebase my work.

> 
> > The s3c24x0_i2c driver is modified to use for for both Exynos 4 and
> Exynos 5.
> > Both s3c24x0_i2c and soft_i2c drivers are modified so can be used
> > separetly (only hardware or only software) or can be used
> simultaneously.
> > Pinmux setting and clock is add for Exynos4 to support hardware I2C.
> >
> > This patchset depends on the following patchset:
> > http://patchwork.ozlabs.org/patch/192742/
> > http://patchwork.ozlabs.org/patch/192743/
> > http://patchwork.ozlabs.org/patch/192744/
> > ...
> > http://patchwork.ozlabs.org/patch/192765/
> >
> > Changes in v2:
> > 	- added multi_i2c driver;
> > 	- modified s3c24x0_i2c driver
> > 	- modified soft_i2c driver
> > 	- modified exynos4_get_i2c_clk function;
> >
> > Piotr Wilczek (9):
> >    exynos:clock: Add i2c clock
> >    exynos:cpu: Add Exynos4 I2C spacing
> >    exynos:pinmux: Add pinmux support for i2c
> >    drivers:i2c: Modify I2C driver for Exynos4
> >    drivers:i2c: Add support for multi I2C
> >    driver:i2c: Modify Soft I2C driver for Multi-I2C
> >    driver:i2c: Modify s3c24x0_i2c driver for Multi-I2C
> >    drivers:i2c: modify I2C header for Multi-I2C
> >    arm:trats: Use Multi-I2C on Trarts board
> >
> >   arch/arm/cpu/armv7/exynos/clock.c      |   17 +++++
> >   arch/arm/cpu/armv7/exynos/pinmux.c     |   51 +++++++++++++
> >   arch/arm/include/asm/arch-exynos/cpu.h |    2 +
> >   board/samsung/trats/trats.c            |   35 +++++++++-
> >   drivers/i2c/Makefile                   |    1 +
> >   drivers/i2c/multi_i2c.c                |  124
> ++++++++++++++++++++++++++++++++
> >   drivers/i2c/s3c24x0_i2c.c              |   89 +++++++++++++++++++--
> --
> >   drivers/i2c/soft_i2c.c                 |   60 ++++++++++++++--
> >   include/configs/trats.h                |    9 ++-
> >   include/i2c.h                          |   11 +++
> >   include/multi_i2c.h                    |   62 ++++++++++++++++
> >   11 files changed, 439 insertions(+), 22 deletions(-)
> >   create mode 100644 drivers/i2c/multi_i2c.c
> >   create mode 100644 include/multi_i2c.h
> 
> bye,
> Heiko
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Best regards,
Piotr

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-10-23 11:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22  7:21 [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 1/9] exynos:clock: Add i2c clock Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 2/9] exynos:cpu: Add Exynos4 I2C spacing Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 3/9] exynos:pinmux: Add pinmux support for i2c Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 4/9] drivers:i2c: Modify I2C driver for Exynos4 Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 5/9] drivers:i2c: Add support for multi I2C Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 6/9] driver:i2c: Modify Soft I2C driver for Multi-I2C Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 7/9] driver:i2c: Modify s3c24x0_i2c " Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 8/9] drivers:i2c: modify I2C header " Piotr Wilczek
2012-10-22  7:21 ` [U-Boot] [PATCH v2 9/9] arm:trats: Use Multi-I2C on Trarts board Piotr Wilczek
2012-10-22 17:07 ` [U-Boot] [PATCH v2 0/9] arm:exynos4: Enable Multi I2C Heiko Schocher
2012-10-23 11:31   ` Piotr Wilczek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.