Skip to contentSkip to conversation

sunxi: i2c: Add DM I2C support for A64/H3/H5

PATCH New Jernej Skrabec 5 participants 16 messages Apr 26, 2017 – Apr 29, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

Best regards,
Jernej Skrabec

Jernej Skrabec (4):
sunxi: power: Compile sy8106a driver only during SPL build
sunxi: Move function for later convenience
sunxi: i2c: Add support for DM I2C
sunxi: Enable DM_I2C for A64/H3/H5

 arch/arm/mach-sunxi/board.c    |   2 +
 board/sunxi/Kconfig            |   2 +
 board/sunxi/board.c            | 196 +++++++++++++++++++++--------------------
 drivers/i2c/mvtwsi.c           |   9 ++
 drivers/power/sy8106a.c        |   2 +
 include/configs/sunxi-common.h |   4 +-
 6 files changed, 120 insertions(+), 95 deletions(-)
Signature · 1 line
2.12.2
#1 lore raw

PATCH 1/4 sunxi: power: Compile sy8106a driver only during SPL build

Driver for that regulator is used only in SPL and it uses old I2C interface. If we want to use DM I2C in U-Boot proper, compilation of this driver has to be limited only to SPL.

---

 drivers/power/sy8106a.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/sy8106a.c +2 -0
index bbf116f655..f9db3965f2 100644
@@ -12,6 +12,7 @@
 #define SY8106A_VOUT1_SEL 1
 #define SY8106A_VOUT1_SEL_ENABLE (1 << 7)
 
+#ifdef CONFIG_SPL_BUILD
 static u8 sy8106a_mvolt_to_cfg(int mvolt, int min, int max, int div)
 {
 	if (mvolt < min)
@@ -27,3 +28,4 @@ int sy8106a_set_vout1(unsigned int mvolt)
 	u8 data = sy8106a_mvolt_to_cfg(mvolt, 680, 1950, 10) | SY8106A_VOUT1_SEL_ENABLE;
 	return i2c_write(SY8106A_I2C_ADDR, SY8106A_VOUT1_SEL, 1, &data, 1);
 }
+#endif
Signature · 1 line
2.12.2
#2 lore raw

PATCH 1/4 sunxi: power: Compile sy8106a driver only during SPL build

Hello Jernej,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 9 lines

Driver for that regulator is used only in SPL and it uses old I2C interface. If we want to use DM I2C in U-Boot proper, compilation of this driver has to be limited only to SPL.

---

  drivers/power/sy8106a.c | 2 ++
  1 file changed, 2 insertions(+)

bye,
Heiko

Quoted 19 lines
drivers/power/sy8106a.c +2 -0
index bbf116f655..f9db3965f2 100644
@@ -12,6 +12,7 @@
  #define SY8106A_VOUT1_SEL 1
  #define SY8106A_VOUT1_SEL_ENABLE (1 << 7)
 
+#ifdef CONFIG_SPL_BUILD
  static u8 sy8106a_mvolt_to_cfg(int mvolt, int min, int max, int div)
  {
  	if (mvolt < min)
@@ -27,3 +28,4 @@ int sy8106a_set_vout1(unsigned int mvolt)
  	u8 data = sy8106a_mvolt_to_cfg(mvolt, 680, 1950, 10) | SY8106A_VOUT1_SEL_ENABLE;
  	return i2c_write(SY8106A_I2C_ADDR, SY8106A_VOUT1_SEL, 1, &data, 1);
  }
+#endif
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH 2/4 sunxi: Move function for later convenience

In reply to Jernej Skrabec

This commit only moves i2c_init_board() function almost to the top and doesn't have any functional changes.

This is needed for a temporary workaround in next commit when support for DM I2C will be introduced.

---

 board/sunxi/board.c | 188 ++++++++++++++++++++++++++--------------------------
 1 file changed, 94 insertions(+), 94 deletions(-)
board/sunxi/board.c +94 -94
index 04a629125e..f903a5d0a0 100644
@@ -77,6 +77,100 @@ static int soft_i2c_board_init(void) { return 0; }
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void i2c_init_board(void)
+{
+#ifdef CONFIG_I2C0_ENABLE
+#if defined(CONFIG_MACH_SUN4I) || \
+    defined(CONFIG_MACH_SUN5I) || \
+    defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUN4I_GPB_TWI0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN4I_GPB_TWI0);
+	clock_twi_onoff(0, 1);
+#elif defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(14), SUN6I_GPH_TWI0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(15), SUN6I_GPH_TWI0);
+	clock_twi_onoff(0, 1);
+#elif defined(CONFIG_MACH_SUN8I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(2), SUN8I_GPH_TWI0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(3), SUN8I_GPH_TWI0);
+	clock_twi_onoff(0, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C1_ENABLE
+#if defined(CONFIG_MACH_SUN4I) || \
+    defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN4I_GPB_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUN4I_GPB_TWI1);
+	clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN5I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(15), SUN5I_GPB_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(16), SUN5I_GPB_TWI1);
+	clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(16), SUN6I_GPH_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(17), SUN6I_GPH_TWI1);
+	clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN8I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(4), SUN8I_GPH_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(5), SUN8I_GPH_TWI1);
+	clock_twi_onoff(1, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C2_ENABLE
+#if defined(CONFIG_MACH_SUN4I) || \
+    defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(20), SUN4I_GPB_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(21), SUN4I_GPB_TWI2);
+	clock_twi_onoff(2, 1);
+#elif defined(CONFIG_MACH_SUN5I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(17), SUN5I_GPB_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN5I_GPB_TWI2);
+	clock_twi_onoff(2, 1);
+#elif defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(18), SUN6I_GPH_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(19), SUN6I_GPH_TWI2);
+	clock_twi_onoff(2, 1);
+#elif defined(CONFIG_MACH_SUN8I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPE(12), SUN8I_GPE_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPE(13), SUN8I_GPE_TWI2);
+	clock_twi_onoff(2, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C3_ENABLE
+#if defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPG(10), SUN6I_GPG_TWI3);
+	sunxi_gpio_set_cfgpin(SUNXI_GPG(11), SUN6I_GPG_TWI3);
+	clock_twi_onoff(3, 1);
+#elif defined(CONFIG_MACH_SUN7I) || \
+      defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(0), SUN7I_GPI_TWI3);
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(1), SUN7I_GPI_TWI3);
+	clock_twi_onoff(3, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C4_ENABLE
+#if defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(2), SUN7I_GPI_TWI4);
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(3), SUN7I_GPI_TWI4);
+	clock_twi_onoff(4, 1);
+#endif
+#endif
+
+#ifdef CONFIG_R_I2C_ENABLE
+	clock_twi_onoff(5, 1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_H3_GPL_R_TWI);
+	sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_H3_GPL_R_TWI);
+#endif
+}
+
 /* add board specific code here */
 int board_init(void)
 {
@@ -406,100 +500,6 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
-void i2c_init_board(void)
-{
-#ifdef CONFIG_I2C0_ENABLE
-#if defined(CONFIG_MACH_SUN4I) || \
-    defined(CONFIG_MACH_SUN5I) || \
-    defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUN4I_GPB_TWI0);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN4I_GPB_TWI0);
-	clock_twi_onoff(0, 1);
-#elif defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(14), SUN6I_GPH_TWI0);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(15), SUN6I_GPH_TWI0);
-	clock_twi_onoff(0, 1);
-#elif defined(CONFIG_MACH_SUN8I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(2), SUN8I_GPH_TWI0);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(3), SUN8I_GPH_TWI0);
-	clock_twi_onoff(0, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C1_ENABLE
-#if defined(CONFIG_MACH_SUN4I) || \
-    defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN4I_GPB_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUN4I_GPB_TWI1);
-	clock_twi_onoff(1, 1);
-#elif defined(CONFIG_MACH_SUN5I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(15), SUN5I_GPB_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(16), SUN5I_GPB_TWI1);
-	clock_twi_onoff(1, 1);
-#elif defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(16), SUN6I_GPH_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(17), SUN6I_GPH_TWI1);
-	clock_twi_onoff(1, 1);
-#elif defined(CONFIG_MACH_SUN8I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(4), SUN8I_GPH_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(5), SUN8I_GPH_TWI1);
-	clock_twi_onoff(1, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C2_ENABLE
-#if defined(CONFIG_MACH_SUN4I) || \
-    defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(20), SUN4I_GPB_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(21), SUN4I_GPB_TWI2);
-	clock_twi_onoff(2, 1);
-#elif defined(CONFIG_MACH_SUN5I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(17), SUN5I_GPB_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN5I_GPB_TWI2);
-	clock_twi_onoff(2, 1);
-#elif defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(18), SUN6I_GPH_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(19), SUN6I_GPH_TWI2);
-	clock_twi_onoff(2, 1);
-#elif defined(CONFIG_MACH_SUN8I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPE(12), SUN8I_GPE_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPE(13), SUN8I_GPE_TWI2);
-	clock_twi_onoff(2, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C3_ENABLE
-#if defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPG(10), SUN6I_GPG_TWI3);
-	sunxi_gpio_set_cfgpin(SUNXI_GPG(11), SUN6I_GPG_TWI3);
-	clock_twi_onoff(3, 1);
-#elif defined(CONFIG_MACH_SUN7I) || \
-      defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(0), SUN7I_GPI_TWI3);
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(1), SUN7I_GPI_TWI3);
-	clock_twi_onoff(3, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C4_ENABLE
-#if defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(2), SUN7I_GPI_TWI4);
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(3), SUN7I_GPI_TWI4);
-	clock_twi_onoff(4, 1);
-#endif
-#endif
-
-#ifdef CONFIG_R_I2C_ENABLE
-	clock_twi_onoff(5, 1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_H3_GPL_R_TWI);
-	sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_H3_GPL_R_TWI);
-#endif
-}
-
 #ifdef CONFIG_SPL_BUILD
 void sunxi_board_init(void)
 {
Signature · 1 line
2.12.2
#4 lore raw

PATCH 2/4 sunxi: Move function for later convenience

Hello Jernej,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 11 lines

This commit only moves i2c_init_board() function almost to the top and doesn't have any functional changes.

This is needed for a temporary workaround in next commit when support for DM I2C will be introduced.

---

  board/sunxi/board.c | 188 ++++++++++++++++++++++++++--------------------------
  1 file changed, 94 insertions(+), 94 deletions(-)

bye,
Heiko

Quoted 208 lines
board/sunxi/board.c +94 -94
index 04a629125e..f903a5d0a0 100644
@@ -77,6 +77,100 @@ static int soft_i2c_board_init(void) { return 0; }
 
  DECLARE_GLOBAL_DATA_PTR;
 
+void i2c_init_board(void)
+{
+#ifdef CONFIG_I2C0_ENABLE
+#if defined(CONFIG_MACH_SUN4I) || \
+    defined(CONFIG_MACH_SUN5I) || \
+    defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUN4I_GPB_TWI0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN4I_GPB_TWI0);
+	clock_twi_onoff(0, 1);
+#elif defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(14), SUN6I_GPH_TWI0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(15), SUN6I_GPH_TWI0);
+	clock_twi_onoff(0, 1);
+#elif defined(CONFIG_MACH_SUN8I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(2), SUN8I_GPH_TWI0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(3), SUN8I_GPH_TWI0);
+	clock_twi_onoff(0, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C1_ENABLE
+#if defined(CONFIG_MACH_SUN4I) || \
+    defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN4I_GPB_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUN4I_GPB_TWI1);
+	clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN5I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(15), SUN5I_GPB_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(16), SUN5I_GPB_TWI1);
+	clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(16), SUN6I_GPH_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(17), SUN6I_GPH_TWI1);
+	clock_twi_onoff(1, 1);
+#elif defined(CONFIG_MACH_SUN8I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(4), SUN8I_GPH_TWI1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(5), SUN8I_GPH_TWI1);
+	clock_twi_onoff(1, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C2_ENABLE
+#if defined(CONFIG_MACH_SUN4I) || \
+    defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(20), SUN4I_GPB_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(21), SUN4I_GPB_TWI2);
+	clock_twi_onoff(2, 1);
+#elif defined(CONFIG_MACH_SUN5I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(17), SUN5I_GPB_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN5I_GPB_TWI2);
+	clock_twi_onoff(2, 1);
+#elif defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(18), SUN6I_GPH_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(19), SUN6I_GPH_TWI2);
+	clock_twi_onoff(2, 1);
+#elif defined(CONFIG_MACH_SUN8I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPE(12), SUN8I_GPE_TWI2);
+	sunxi_gpio_set_cfgpin(SUNXI_GPE(13), SUN8I_GPE_TWI2);
+	clock_twi_onoff(2, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C3_ENABLE
+#if defined(CONFIG_MACH_SUN6I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPG(10), SUN6I_GPG_TWI3);
+	sunxi_gpio_set_cfgpin(SUNXI_GPG(11), SUN6I_GPG_TWI3);
+	clock_twi_onoff(3, 1);
+#elif defined(CONFIG_MACH_SUN7I) || \
+      defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(0), SUN7I_GPI_TWI3);
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(1), SUN7I_GPI_TWI3);
+	clock_twi_onoff(3, 1);
+#endif
+#endif
+
+#ifdef CONFIG_I2C4_ENABLE
+#if defined(CONFIG_MACH_SUN7I) || \
+    defined(CONFIG_MACH_SUN8I_R40)
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(2), SUN7I_GPI_TWI4);
+	sunxi_gpio_set_cfgpin(SUNXI_GPI(3), SUN7I_GPI_TWI4);
+	clock_twi_onoff(4, 1);
+#endif
+#endif
+
+#ifdef CONFIG_R_I2C_ENABLE
+	clock_twi_onoff(5, 1);
+	sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_H3_GPL_R_TWI);
+	sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_H3_GPL_R_TWI);
+#endif
+}
+
  /* add board specific code here */
  int board_init(void)
  {
@@ -406,100 +500,6 @@ int board_mmc_init(bd_t *bis)
  }
  #endif
 
-void i2c_init_board(void)
-{
-#ifdef CONFIG_I2C0_ENABLE
-#if defined(CONFIG_MACH_SUN4I) || \
-    defined(CONFIG_MACH_SUN5I) || \
-    defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUN4I_GPB_TWI0);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN4I_GPB_TWI0);
-	clock_twi_onoff(0, 1);
-#elif defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(14), SUN6I_GPH_TWI0);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(15), SUN6I_GPH_TWI0);
-	clock_twi_onoff(0, 1);
-#elif defined(CONFIG_MACH_SUN8I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(2), SUN8I_GPH_TWI0);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(3), SUN8I_GPH_TWI0);
-	clock_twi_onoff(0, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C1_ENABLE
-#if defined(CONFIG_MACH_SUN4I) || \
-    defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN4I_GPB_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUN4I_GPB_TWI1);
-	clock_twi_onoff(1, 1);
-#elif defined(CONFIG_MACH_SUN5I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(15), SUN5I_GPB_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(16), SUN5I_GPB_TWI1);
-	clock_twi_onoff(1, 1);
-#elif defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(16), SUN6I_GPH_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(17), SUN6I_GPH_TWI1);
-	clock_twi_onoff(1, 1);
-#elif defined(CONFIG_MACH_SUN8I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(4), SUN8I_GPH_TWI1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(5), SUN8I_GPH_TWI1);
-	clock_twi_onoff(1, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C2_ENABLE
-#if defined(CONFIG_MACH_SUN4I) || \
-    defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(20), SUN4I_GPB_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(21), SUN4I_GPB_TWI2);
-	clock_twi_onoff(2, 1);
-#elif defined(CONFIG_MACH_SUN5I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(17), SUN5I_GPB_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUN5I_GPB_TWI2);
-	clock_twi_onoff(2, 1);
-#elif defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(18), SUN6I_GPH_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPH(19), SUN6I_GPH_TWI2);
-	clock_twi_onoff(2, 1);
-#elif defined(CONFIG_MACH_SUN8I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPE(12), SUN8I_GPE_TWI2);
-	sunxi_gpio_set_cfgpin(SUNXI_GPE(13), SUN8I_GPE_TWI2);
-	clock_twi_onoff(2, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C3_ENABLE
-#if defined(CONFIG_MACH_SUN6I)
-	sunxi_gpio_set_cfgpin(SUNXI_GPG(10), SUN6I_GPG_TWI3);
-	sunxi_gpio_set_cfgpin(SUNXI_GPG(11), SUN6I_GPG_TWI3);
-	clock_twi_onoff(3, 1);
-#elif defined(CONFIG_MACH_SUN7I) || \
-      defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(0), SUN7I_GPI_TWI3);
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(1), SUN7I_GPI_TWI3);
-	clock_twi_onoff(3, 1);
-#endif
-#endif
-
-#ifdef CONFIG_I2C4_ENABLE
-#if defined(CONFIG_MACH_SUN7I) || \
-    defined(CONFIG_MACH_SUN8I_R40)
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(2), SUN7I_GPI_TWI4);
-	sunxi_gpio_set_cfgpin(SUNXI_GPI(3), SUN7I_GPI_TWI4);
-	clock_twi_onoff(4, 1);
-#endif
-#endif
-
-#ifdef CONFIG_R_I2C_ENABLE
-	clock_twi_onoff(5, 1);
-	sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_H3_GPL_R_TWI);
-	sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_H3_GPL_R_TWI);
-#endif
-}
-
  #ifdef CONFIG_SPL_BUILD
  void sunxi_board_init(void)
  {
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

PATCH 3/4 sunxi: i2c: Add support for DM I2C

In reply to Jernej Skrabec

This commit adds support for DM I2C on sunxi platform. It can coexist with old style sunxi I2C driver, because it is still used in SPL and by some SoCs.

Because sunxi platform doesn't yet support DM clk, reset and pinctrl driver, workaround is needed to enable clocks and set resets and pinctrls. This is done by calling i2c_init_board() in board_init(). This means that CONFIG_I2Cx_ENABLE options needs to be correctly set in order to use needed I2C controller.

Commit is based on the previous patch made by Philipp Tomsich

---

 arch/arm/mach-sunxi/board.c    | 2 ++
 board/sunxi/board.c            | 8 ++++++++
 drivers/i2c/mvtwsi.c           | 9 +++++++++
 include/configs/sunxi-common.h | 4 +++-
 4 files changed, 22 insertions(+), 1 deletion(-)
arch/arm/mach-sunxi/board.c +2 -0
index 4507279cc5..65b1ebd837 100644
@@ -204,7 +204,9 @@ void s_init(void)
 	clock_init();
 	timer_init();
 	gpio_init();
+#ifndef CONFIG_DM_I2C
 	i2c_init_board();
+#endif
 	eth_init_board();
 }
 
board/sunxi/board.c +8 -0
index f903a5d0a0..01de42d031 100644
@@ -222,6 +222,14 @@ int board_init(void)
 	gpio_direction_output(macpwr_pin, 1);
 #endif
 
+#ifdef CONFIG_DM_I2C
+	/*
+	 * Temporary workaround for enabling I2C clocks until proper sunxi DM
+	 * clk, reset and pinctrl drivers land.
+	 */
+	i2c_init_board();
+#endif
+
 	/* Uses dm gpio code so do this here and not in i2c_init_board() */
 	return soft_i2c_board_init();
 }
drivers/i2c/mvtwsi.c +9 -0
index 648a96eeb4..3703519aa5 100644
@@ -37,6 +37,14 @@ DECLARE_GLOBAL_DATA_PTR;
 #endif /* CONFIG_DM_I2C */
 
 /*
+ * On SUNXI, we get CONFIG_SYS_TCLK from this include, so we want to
+ * always have it.
+ */
+#if defined(CONFIG_DM_I2C) && defined(CONFIG_ARCH_SUNXI)
+#include <asm/arch/i2c.h>
+#endif
+
+/*
  * TWSI register structure
  */
 
@@ -831,6 +839,7 @@ static const struct dm_i2c_ops mvtwsi_i2c_ops = {
 static const struct udevice_id mvtwsi_i2c_ids[] = {
 	{ .compatible = "marvell,mv64xxx-i2c", },
 	{ .compatible = "marvell,mv78230-i2c", },
+	{ .compatible = "allwinner,sun6i-a31-i2c", },
 	{ /* sentinel */ }
 };
 
include/configs/sunxi-common.h +3 -1
index a56b45fa2f..997a92c8be 100644
@@ -211,11 +211,13 @@
 #if defined CONFIG_I2C0_ENABLE || defined CONFIG_I2C1_ENABLE || \
     defined CONFIG_I2C2_ENABLE || defined CONFIG_I2C3_ENABLE || \
     defined CONFIG_I2C4_ENABLE || defined CONFIG_R_I2C_ENABLE
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MVTWSI
+#ifndef CONFIG_DM_I2C
+#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_SPEED		400000
 #define CONFIG_SYS_I2C_SLAVE		0x7f
 #endif
+#endif
 
 #if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
 #define CONFIG_SYS_I2C_SOFT
Signature · 1 line
2.12.2
#6 lore raw

PATCH 3/4 sunxi: i2c: Add support for DM I2C

Hello Jernej,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 12 lines

This commit adds support for DM I2C on sunxi platform. It can coexist with old style sunxi I2C driver, because it is still used in SPL and by some SoCs.

Because sunxi platform doesn't yet support DM clk, reset and pinctrl driver, workaround is needed to enable clocks and set resets and pinctrls. This is done by calling i2c_init_board() in board_init(). This means that CONFIG_I2Cx_ENABLE options needs to be correctly set in order to use needed I2C controller.

Commit is based on the previous patch made by Philipp Tomsich

Quoted 8 lines

---

  arch/arm/mach-sunxi/board.c    | 2 ++
  board/sunxi/board.c            | 8 ++++++++
  drivers/i2c/mvtwsi.c           | 9 +++++++++
  include/configs/sunxi-common.h | 4 +++-
  4 files changed, 22 insertions(+), 1 deletion(-)

bye,
Heiko

Quoted 81 lines
arch/arm/mach-sunxi/board.c +2 -0
index 4507279cc5..65b1ebd837 100644
@@ -204,7 +204,9 @@ void s_init(void)
  	clock_init();
  	timer_init();
  	gpio_init();
+#ifndef CONFIG_DM_I2C
  	i2c_init_board();
+#endif
  	eth_init_board();
  }
 
board/sunxi/board.c +8 -0
index f903a5d0a0..01de42d031 100644
@@ -222,6 +222,14 @@ int board_init(void)
  	gpio_direction_output(macpwr_pin, 1);
  #endif
 
+#ifdef CONFIG_DM_I2C
+	/*
+	 * Temporary workaround for enabling I2C clocks until proper sunxi DM
+	 * clk, reset and pinctrl drivers land.
+	 */
+	i2c_init_board();
+#endif
+
  	/* Uses dm gpio code so do this here and not in i2c_init_board() */
  	return soft_i2c_board_init();
  }
drivers/i2c/mvtwsi.c +9 -0
index 648a96eeb4..3703519aa5 100644
@@ -37,6 +37,14 @@ DECLARE_GLOBAL_DATA_PTR;
  #endif /* CONFIG_DM_I2C */
 
  /*
+ * On SUNXI, we get CONFIG_SYS_TCLK from this include, so we want to
+ * always have it.
+ */
+#if defined(CONFIG_DM_I2C) && defined(CONFIG_ARCH_SUNXI)
+#include <asm/arch/i2c.h>
+#endif
+
+/*
   * TWSI register structure
   */
 
@@ -831,6 +839,7 @@ static const struct dm_i2c_ops mvtwsi_i2c_ops = {
  static const struct udevice_id mvtwsi_i2c_ids[] = {
  	{ .compatible = "marvell,mv64xxx-i2c", },
  	{ .compatible = "marvell,mv78230-i2c", },
+	{ .compatible = "allwinner,sun6i-a31-i2c", },
  	{ /* sentinel */ }
  };
 
include/configs/sunxi-common.h +3 -1
index a56b45fa2f..997a92c8be 100644
@@ -211,11 +211,13 @@
  #if defined CONFIG_I2C0_ENABLE || defined CONFIG_I2C1_ENABLE || \
      defined CONFIG_I2C2_ENABLE || defined CONFIG_I2C3_ENABLE || \
      defined CONFIG_I2C4_ENABLE || defined CONFIG_R_I2C_ENABLE
-#define CONFIG_SYS_I2C
  #define CONFIG_SYS_I2C_MVTWSI
+#ifndef CONFIG_DM_I2C
+#define CONFIG_SYS_I2C
  #define CONFIG_SYS_I2C_SPEED		400000
  #define CONFIG_SYS_I2C_SLAVE		0x7f
  #endif
+#endif
 
  #if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
  #define CONFIG_SYS_I2C_SOFT
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#7 lore raw

PATCH 3/4 sunxi: i2c: Add support for DM I2C

In reply to Jernej Skrabec
Quoted 12 lines · Jernej Skrabec

This commit adds support for DM I2C on sunxi platform. It can coexist with old style sunxi I2C driver, because it is still used in SPL and by some SoCs.

Because sunxi platform doesn't yet support DM clk, reset and pinctrl driver, workaround is needed to enable clocks and set resets and pinctrls. This is done by calling i2c_init_board() in board_init(). This means that CONFIG_I2Cx_ENABLE options needs to be correctly set in order to use needed I2C controller.

Commit is based on the previous patch made by Philipp Tomsich

Quoted 8 lines

---

 arch/arm/mach-sunxi/board.c    | 2 ++
 board/sunxi/board.c            | 8 ++++++++
 drivers/i2c/mvtwsi.c           | 9 +++++++++
 include/configs/sunxi-common.h | 4 +++-
 4 files changed, 22 insertions(+), 1 deletion(-)
#8 lore raw

PATCH 4/4 sunxi: Enable DM_I2C for A64/H3/H5

In reply to Jernej Skrabec

This commits enable DM I2C support for A64/H3/H5 SoCs.

It is not enabled globaly for all sunxi SoCs, because some boards use PMICs which are connected through I2C. In order to keep same functionality, PMIC drivers needs to be ported to DM too.

---

 board/sunxi/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
board/sunxi/Kconfig +2 -0
index 196d8fce08..707e656ea6 100644
@@ -58,6 +58,7 @@ config SUNXI_GEN_SUN6I
 
 config MACH_SUNXI_H3_H5
 	bool
+	select DM_I2C
 	select SUNXI_DE2
 	select SUNXI_GEN_SUN6I
 	select SUPPORT_SPL
@@ -163,6 +164,7 @@ config MACH_SUN9I
 config MACH_SUN50I
 	bool "sun50i (Allwinner A64)"
 	select ARM64
+	select DM_I2C
 	select SUNXI_DE2
 	select SUNXI_GEN_SUN6I
 	select SUNXI_HIGH_SRAM
Signature · 1 line
2.12.2
#9 lore raw

PATCH 4/4 sunxi: Enable DM_I2C for A64/H3/H5

Hello Jernej,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 11 lines

This commits enable DM I2C support for A64/H3/H5 SoCs.

It is not enabled globaly for all sunxi SoCs, because some boards use PMICs which are connected through I2C. In order to keep same functionality, PMIC drivers needs to be ported to DM too.

---

  board/sunxi/Kconfig | 2 ++
  1 file changed, 2 insertions(+)

bye,
Heiko

Quoted 22 lines
board/sunxi/Kconfig +2 -0
index 196d8fce08..707e656ea6 100644
@@ -58,6 +58,7 @@ config SUNXI_GEN_SUN6I
 
  config MACH_SUNXI_H3_H5
  	bool
+	select DM_I2C
  	select SUNXI_DE2
  	select SUNXI_GEN_SUN6I
  	select SUPPORT_SPL
@@ -163,6 +164,7 @@ config MACH_SUN9I
  config MACH_SUN50I
  	bool "sun50i (Allwinner A64)"
  	select ARM64
+	select DM_I2C
  	select SUNXI_DE2
  	select SUNXI_GEN_SUN6I
  	select SUNXI_HIGH_SRAM
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#10 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

In reply to Jernej Skrabec

Hi,

Quoted 8 lines · Jernej Skrabec

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Quoted 6 lines

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

All your patches look good to me, you can add my

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170427/625590a7/attachment.sig>
#11 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

In reply to Jernej Skrabec

Hello Jagan,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 25 lines

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

Best regards,
Jernej Skrabec

Jernej Skrabec (4):
sunxi: power: Compile sy8106a driver only during SPL build
sunxi: Move function for later convenience
sunxi: i2c: Add support for DM I2C
sunxi: Enable DM_I2C for A64/H3/H5

Quoted 8 lines
  arch/arm/mach-sunxi/board.c    |   2 +
  board/sunxi/Kconfig            |   2 +
  board/sunxi/board.c            | 196 +++++++++++++++++++++--------------------
  drivers/i2c/mvtwsi.c           |   9 ++
  drivers/power/sy8106a.c        |   2 +
  include/configs/sunxi-common.h |   4 +-
  6 files changed, 120 insertions(+), 95 deletions(-)

Do you want to pick up this patchset?

Or should I push it through u-boot-i2c?
If so, please add your Ack or Review tag, thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#12 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

Hello Heiko,

Quoted 37 lines · Heiko Schocher

Hello Jagan,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 25 lines

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

Best regards,
Jernej Skrabec

Jernej Skrabec (4):
sunxi: power: Compile sy8106a driver only during SPL build
sunxi: Move function for later convenience
sunxi: i2c: Add support for DM I2C
sunxi: Enable DM_I2C for A64/H3/H5

Quoted 8 lines
  arch/arm/mach-sunxi/board.c    |   2 +
  board/sunxi/Kconfig            |   2 +
  board/sunxi/board.c            | 196 +++++++++++++++++++++--------------------
  drivers/i2c/mvtwsi.c           |   9 ++
  drivers/power/sy8106a.c        |   2 +
  include/configs/sunxi-common.h |   4 +-
  6 files changed, 120 insertions(+), 95 deletions(-)
Quoted 4 lines

Do you want to pick up this patchset?

Or should I push it through u-boot-i2c?
If so, please add your Ack or Review tag, thanks!

There's a (build) dependency of this work with the current effort to bring up HDMI, so I guess it would be easier if we merged it through the sunxi tree if it works for you.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170428/6015e88d/attachment.sig>
#13 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

Hello Maxime,

Am 28.04.2017 um 08:44 schrieb Maxime Ripard:

Quoted 40 lines

Hello Heiko,

Quoted 37 lines · Heiko Schocher

Hello Jagan,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 33 lines

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

Best regards,
Jernej Skrabec

Jernej Skrabec (4):
sunxi: power: Compile sy8106a driver only during SPL build
sunxi: Move function for later convenience
sunxi: i2c: Add support for DM I2C
sunxi: Enable DM_I2C for A64/H3/H5

   arch/arm/mach-sunxi/board.c    |   2 +
   board/sunxi/Kconfig            |   2 +
   board/sunxi/board.c            | 196 +++++++++++++++++++++--------------------
   drivers/i2c/mvtwsi.c           |   9 ++
   drivers/power/sy8106a.c        |   2 +
   include/configs/sunxi-common.h |   4 +-
   6 files changed, 120 insertions(+), 95 deletions(-)
Quoted 8 lines
Quoted 4 lines

Do you want to pick up this patchset?

Or should I push it through u-boot-i2c?
If so, please add your Ack or Review tag, thanks!

There's a (build) dependency of this work with the current effort to bring up HDMI, so I guess it would be easier if we merged it through the sunxi tree if it works for you.

Of course. I see this patches in my Patchwork ToDo list. Is it OK to assign them to jagan?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#14 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

Quoted 48 lines · Heiko Schocher invitel

Hello Maxime,

Am 28.04.2017 um 08:44 schrieb Maxime Ripard:

Quoted 45 lines

Hello Heiko,

Quoted 41 lines · Heiko Schocher

Hello Jagan,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 25 lines

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

Best regards,
Jernej Skrabec

Jernej Skrabec (4):
sunxi: power: Compile sy8106a driver only during SPL build
sunxi: Move function for later convenience
sunxi: i2c: Add support for DM I2C
sunxi: Enable DM_I2C for A64/H3/H5

Quoted 8 lines
   arch/arm/mach-sunxi/board.c    |   2 +
   board/sunxi/Kconfig            |   2 +
   board/sunxi/board.c            | 196 +++++++++++++++++++++--------------------
   drivers/i2c/mvtwsi.c           |   9 ++
   drivers/power/sy8106a.c        |   2 +
   include/configs/sunxi-common.h |   4 +-
   6 files changed, 120 insertions(+), 95 deletions(-)

Do you want to pick up this patchset?

Or should I push it through u-boot-i2c?
If so, please add your Ack or Review tag, thanks!

Quoted 6 lines
Quoted 3 lines

There's a (build) dependency of this work with the current effort to bring up HDMI, so I guess it would be easier if we merged it through the sunxi tree if it works for you.

Of course. I see this patches in my Patchwork ToDo list. Is it OK to assign them to jagan?

I just applied them and am going through a test build. You can either assign them to me, or mark them as done.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170428/4604ed3a/attachment.sig>
#15 lore raw

cover sunxi: i2c: Add DM I2C support for A64/H3/H5

Hello Maxim,

Am 28.04.2017 um 09:27 schrieb Maxime Ripard:

Quoted 53 lines · Heiko Schocher invitel
Quoted 52 lines

Hello Maxime,

Am 28.04.2017 um 08:44 schrieb Maxime Ripard:

Quoted 48 lines

Hello Heiko,

Quoted 37 lines · Heiko Schocher

Hello Jagan,

Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:

Quoted 25 lines

This series implements DM I2C support, but allows old I2C to be selected when needed.

Patch 1 makes sure that sy8106a driver is compiled only during SPL build.

Patch 2 moves i2c_init_board() function to more convenient place for follow up patch. It doens't do any functional change.

Patch 3 introduces DM I2C support for sun6i-a31 compatible I2C controllers.

Patch 4 enables DM I2C only for A64/H3/H5. Other platforms would easily support DM I2C too, but their PMIC drivers needs to be ported to DM in order not to lose any existing functionality.

Best regards,
Jernej Skrabec

Jernej Skrabec (4):
sunxi: power: Compile sy8106a driver only during SPL build
sunxi: Move function for later convenience
sunxi: i2c: Add support for DM I2C
sunxi: Enable DM_I2C for A64/H3/H5

Quoted 8 lines

arch/arm/mach-sunxi/board.c | 2 +
board/sunxi/Kconfig | 2 +
board/sunxi/board.c | 196 +++++++++++++++++++++--------------------
drivers/i2c/mvtwsi.c | 9 ++
drivers/power/sy8106a.c | 2 +
include/configs/sunxi-common.h | 4 +-
6 files changed, 120 insertions(+), 95 deletions(-)

Quoted 4 lines

Do you want to pick up this patchset?

Or should I push it through u-boot-i2c?
If so, please add your Ack or Review tag, thanks!

There's a (build) dependency of this work with the current effort to bring up HDMI, so I guess it would be easier if we merged it through the sunxi tree if it works for you.

Quoted 5 lines
Quoted 2 lines

Of course. I see this patches in my Patchwork ToDo list. Is it OK to assign them to jagan?

I just applied them and am going through a test build. You can either assign them to me, or mark them as done.

marked them as accepted.

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany