Re: [U-Boot] [PATCH v4 1/4] armv8: ls1028a: The ls1028a platform supports the I2C driver model

2019-08-22 Thread Prabhakar Kushwaha

> -Original Message-
> From: Alex Marginean 
> Sent: Friday, July 12, 2019 5:17 PM
> To: Chuanhua Han ; albert.u.b...@aribaud.net;
> Sudhanshu Gupta ; Harninder Rai
> ; Rajesh Bhagat ; Andy
> Tang ; Prabhakar Kushwaha
> 
> Cc: u-boot@lists.denx.de
> Subject: Re: [U-Boot] [PATCH v4 1/4] armv8: ls1028a: The ls1028a platform
> supports the I2C driver model
> 
> On 7/10/2019 4:16 PM, Chuanhua Han wrote:
> > DM_I2C_COMPAT is a compatibility layer that allows using the non-DM
> > I2C API when DM_I2C is used.When DM_I2C_COMPAT is not enabled for
> > compilation, a compilation error will be generated. This patch solves
> > the problem that the i2c-related api of the ls1028a platform does not
> > support dm.
> 
> I wouldn't mention DM_I2C_COMPAT at all in the commit message, it's not
> currently enabled and after this patch set it's not needed either.
> You could just mention that the patch is updating ls1028a board init code to
> support DM_I2C.
> 
> >
> > Signed-off-by: Chuanhua Han 
> > ---
> > depends on:
> > -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.ozlabs.org%2Fproject%2Fuboot%2Flist%2F%3Fseries%3D113364
> data=02%7C01%7Cprabhakar.kushwaha%40nxp.com%7C6f4831088b7844837
> 72d08d706bea74c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636
> 985288233302816sdata=Fca4rUVC9A%2BemvycTWnILNfGvlg42iOlwozk
> c0ngIwM%3Dreserved=0
> > -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.ozlabs.org%2Fproject%2Fuboot%2Flist%2F%3Fseries%3D110856
> data=02%7C01%7Cprabhakar.kushwaha%40nxp.com%7C6f4831088b7844837
> 72d08d706bea74c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636
> 985288233302816sdata=9%2F1FmA0GZqnODbYvuX3SERC8TDcYF8eMX
> mLzILb3wH0%3Dreserved=0
> > -
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> >
> hwork.ozlabs.org%2Fproject%2Fuboot%2Flist%2F%3Fseries%3D109677
> ;dat
> >
> a=02%7C01%7Cprabhakar.kushwaha%40nxp.com%7C6f4831088b784483772d
> 08d706b
> >
> ea74c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6369852882333
> 02816&
> >
> amp;sdata=HYgFDC9knJz3HdY5BLAHwotg5OutAWWEbz6xmm%2FTXzs%3D&
> amp;reserve
> > d=0
> >
> > Changes in v4:
> > - No change.
> > Changes in v3:
> > - No change.
> > Changes in v2:
> > - No change.
> >
> >   arch/arm/cpu/armv8/fsl-layerscape/Kconfig |8 
> >   board/freescale/ls1028a/ls1028a.c |8 
> >   include/configs/ls1028a_common.h  |3 ---
> >   include/configs/ls1028ardb.h  |1 -
> >   4 files changed, 8 insertions(+), 12 deletions(-)
> >
> 
> code changes look OK to me.
> 
> Reviewed-by: Alex Marginean 

This patch has been applied to fsl-qoriq master, awaiting upstream.

--pk

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/4] armv8: ls1028a: The ls1028a platform supports the I2C driver model

2019-07-12 Thread Alex Marginean

On 7/10/2019 4:16 PM, Chuanhua Han wrote:

DM_I2C_COMPAT is a compatibility layer that allows using the non-DM
I2C API when DM_I2C is used.When DM_I2C_COMPAT is not enabled for
compilation, a compilation error will be generated. This patch
solves the problem that the i2c-related api of the ls1028a platform
does not support dm.


I wouldn't mention DM_I2C_COMPAT at all in the commit message, it's not
currently enabled and after this patch set it's not needed either.
You could just mention that the patch is updating ls1028a board init
code to support DM_I2C.



Signed-off-by: Chuanhua Han 
---
depends on:
- https://patchwork.ozlabs.org/project/uboot/list/?series=113364
- https://patchwork.ozlabs.org/project/uboot/list/?series=110856
- https://patchwork.ozlabs.org/project/uboot/list/?series=109677

Changes in v4:
- No change.
Changes in v3:
- No change.
Changes in v2:
- No change.

  arch/arm/cpu/armv8/fsl-layerscape/Kconfig |8 
  board/freescale/ls1028a/ls1028a.c |8 
  include/configs/ls1028a_common.h  |3 ---
  include/configs/ls1028ardb.h  |1 -
  4 files changed, 8 insertions(+), 12 deletions(-)



code changes look OK to me.

Reviewed-by: Alex Marginean 

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 1/4] armv8: ls1028a: The ls1028a platform supports the I2C driver model

2019-07-10 Thread Chuanhua Han
DM_I2C_COMPAT is a compatibility layer that allows using the non-DM
I2C API when DM_I2C is used.When DM_I2C_COMPAT is not enabled for
compilation, a compilation error will be generated. This patch
solves the problem that the i2c-related api of the ls1028a platform
does not support dm.

Signed-off-by: Chuanhua Han 
---
depends on:
- https://patchwork.ozlabs.org/project/uboot/list/?series=113364
- https://patchwork.ozlabs.org/project/uboot/list/?series=110856
- https://patchwork.ozlabs.org/project/uboot/list/?series=109677

Changes in v4:
- No change.
Changes in v3:
- No change.
Changes in v2:
- No change.

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig |8 
 board/freescale/ls1028a/ls1028a.c |8 
 include/configs/ls1028a_common.h  |3 ---
 include/configs/ls1028ardb.h  |1 -
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index ffda02a..d6ef7fc 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -40,14 +40,6 @@ config ARCH_LS1028A
select ARCH_EARLY_INIT_R
select BOARD_EARLY_INIT_F
select SYS_I2C_MXC
-   select SYS_I2C_MXC_I2C1
-   select SYS_I2C_MXC_I2C2
-   select SYS_I2C_MXC_I2C3
-   select SYS_I2C_MXC_I2C4
-   select SYS_I2C_MXC_I2C5
-   select SYS_I2C_MXC_I2C6
-   select SYS_I2C_MXC_I2C7
-   select SYS_I2C_MXC_I2C8
select SYS_FSL_ERRATUM_A008997
select SYS_FSL_ERRATUM_A009007
select SYS_FSL_ERRATUM_A008514 if !TFABOOT
diff --git a/board/freescale/ls1028a/ls1028a.c 
b/board/freescale/ls1028a/ls1028a.c
index e5de4eb..49a9292 100644
--- a/board/freescale/ls1028a/ls1028a.c
+++ b/board/freescale/ls1028a/ls1028a.c
@@ -73,7 +73,15 @@ int board_init(void)
 #if defined(CONFIG_TARGET_LS1028ARDB)
u8 val = I2C_MUX_CH_DEFAULT;
 
+#ifndef CONFIG_DM_I2C
i2c_write(I2C_MUX_PCA_ADDR_PRI, 0x0b, 1, , 1);
+#else
+   struct udevice *dev;
+
+   if (!i2c_get_chip_for_busnum(0, I2C_MUX_PCA_ADDR_PRI, 1, ))
+   dm_i2c_write(dev, 0x0b, , 1);
+#endif
+
 #endif
return 0;
 }
diff --git a/include/configs/ls1028a_common.h b/include/configs/ls1028a_common.h
index d3d787f..0fa5095 100644
--- a/include/configs/ls1028a_common.h
+++ b/include/configs/ls1028a_common.h
@@ -41,9 +41,6 @@
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 2048 * 1024)
 
-/* I2C */
-#define CONFIG_SYS_I2C
-
 /* Serial Port */
 #define CONFIG_CONS_INDEX   1
 #define CONFIG_SYS_NS16550_SERIAL
diff --git a/include/configs/ls1028ardb.h b/include/configs/ls1028ardb.h
index 10791be..b77c36d 100644
--- a/include/configs/ls1028ardb.h
+++ b/include/configs/ls1028ardb.h
@@ -22,7 +22,6 @@
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
 
 #define CONFIG_QIXIS_I2C_ACCESS
-#define CONFIG_SYS_I2C_EARLY_INIT
 
 /*
  * QIXIS Definitions
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot