All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C
@ 2019-11-14 10:36 Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error Biwen Li
                   ` (41 more replies)
  0 siblings, 42 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_I2C for SoC LS1012A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1012a2g5rdb_qspi_defconfig           | 1 +
 configs/ls1012a2g5rdb_tfa_defconfig            | 1 +
 configs/ls1012afrdm_qspi_defconfig             | 1 +
 configs/ls1012afrdm_tfa_defconfig              | 1 +
 configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 +
 configs/ls1012afrwy_qspi_defconfig             | 1 +
 configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig  | 1 +
 configs/ls1012afrwy_tfa_defconfig              | 1 +
 configs/ls1012aqds_qspi_defconfig              | 1 +
 configs/ls1012aqds_tfa_SECURE_BOOT_defconfig   | 1 +
 configs/ls1012aqds_tfa_defconfig               | 1 +
 configs/ls1012ardb_qspi_SECURE_BOOT_defconfig  | 1 +
 configs/ls1012ardb_qspi_defconfig              | 1 +
 configs/ls1012ardb_tfa_SECURE_BOOT_defconfig   | 1 +
 configs/ls1012ardb_tfa_defconfig               | 1 +
 15 files changed, 15 insertions(+)

diff --git a/configs/ls1012a2g5rdb_qspi_defconfig b/configs/ls1012a2g5rdb_qspi_defconfig
index 980fe51404..9dd9f4039a 100644
--- a/configs/ls1012a2g5rdb_qspi_defconfig
+++ b/configs/ls1012a2g5rdb_qspi_defconfig
@@ -47,3 +47,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012a2g5rdb_tfa_defconfig b/configs/ls1012a2g5rdb_tfa_defconfig
index 5b6eeaa626..c554bd5087 100644
--- a/configs/ls1012a2g5rdb_tfa_defconfig
+++ b/configs/ls1012a2g5rdb_tfa_defconfig
@@ -47,3 +47,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrdm_qspi_defconfig b/configs/ls1012afrdm_qspi_defconfig
index f0a404929c..2a6a0b6a61 100644
--- a/configs/ls1012afrdm_qspi_defconfig
+++ b/configs/ls1012afrdm_qspi_defconfig
@@ -47,3 +47,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrdm_tfa_defconfig b/configs/ls1012afrdm_tfa_defconfig
index 493ae7e410..4fd33c539b 100644
--- a/configs/ls1012afrdm_tfa_defconfig
+++ b/configs/ls1012afrdm_tfa_defconfig
@@ -47,3 +47,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
index 8eb25434be..d8fe7e8cf1 100644
--- a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_qspi_defconfig b/configs/ls1012afrwy_qspi_defconfig
index 312c655569..78c48b5f28 100644
--- a/configs/ls1012afrwy_qspi_defconfig
+++ b/configs/ls1012afrwy_qspi_defconfig
@@ -49,3 +49,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
index ff8758434a..919a825209 100644
--- a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_tfa_defconfig b/configs/ls1012afrwy_tfa_defconfig
index 0a6d5c6d9f..3e7299f683 100644
--- a/configs/ls1012afrwy_tfa_defconfig
+++ b/configs/ls1012afrwy_tfa_defconfig
@@ -51,3 +51,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012aqds_qspi_defconfig b/configs/ls1012aqds_qspi_defconfig
index 91bacf0766..d453c74a3f 100644
--- a/configs/ls1012aqds_qspi_defconfig
+++ b/configs/ls1012aqds_qspi_defconfig
@@ -71,3 +71,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
index 2ed38af317..69bf32d98e 100644
--- a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
@@ -65,3 +65,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012aqds_tfa_defconfig b/configs/ls1012aqds_tfa_defconfig
index 588432405b..7c71126cd3 100644
--- a/configs/ls1012aqds_tfa_defconfig
+++ b/configs/ls1012aqds_tfa_defconfig
@@ -71,3 +71,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
index c7f2780bf5..3e95d56447 100644
--- a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_qspi_defconfig b/configs/ls1012ardb_qspi_defconfig
index b755a29c29..fd2f64f124 100644
--- a/configs/ls1012ardb_qspi_defconfig
+++ b/configs/ls1012ardb_qspi_defconfig
@@ -54,3 +54,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
index 6001e193f0..c8873839d6 100644
--- a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_tfa_defconfig b/configs/ls1012ardb_tfa_defconfig
index ce10c736e7..f6de300476 100644
--- a/configs/ls1012ardb_tfa_defconfig
+++ b/configs/ls1012ardb_tfa_defconfig
@@ -55,3 +55,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
-- 
2.17.1

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

* [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15 12:43   ` Priyanka Jain
  2019-11-14 10:36 ` [U-Boot] [PATCH 03/42] board: freescale: ls1012ardb: ls1012ardb.c: support dm_i2c_* API Biwen Li
                   ` (40 subsequent siblings)
  41 siblings, 1 reply; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes a compilation error as follow:
	- In file included from include/config.h:9:0,
                 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  In file included from include/config.h:9:0,
			 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  scripts/Makefile.autoconf:48: recipe for target include/autoconf.mk.dep failed
	  make[1]: *** [include/autoconf.mk.dep] Error 1
	  make[1]: *** Waiting for unfinished jobs....
	  scripts/Makefile.autoconf:77: recipe for target u-boot.cfg failed
	  make[1]: *** [u-boot.cfg] Error 1
	  make: *** No rule to make target include/config/auto.conf, needed by include/config/uboot.release.  Stop.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1012a_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index dd2a679b79..c5be1d33cc 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -74,7 +74,9 @@
 						CONFIG_SYS_SCSI_MAX_LUN)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE     1
-- 
2.17.1

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

* [U-Boot] [PATCH 03/42] board: freescale: ls1012ardb: ls1012ardb.c: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 04/42] board: freescale: ls1012ardb: eth.c: " Biwen Li
                   ` (39 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API for board LS1012ARDB

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1012ardb/ls1012ardb.c | 147 ++++++++++++++++++++----
 1 file changed, 123 insertions(+), 24 deletions(-)

diff --git a/board/freescale/ls1012ardb/ls1012ardb.c b/board/freescale/ls1012ardb/ls1012ardb.c
index e4527c19b8..271227a976 100644
--- a/board/freescale/ls1012ardb/ls1012ardb.c
+++ b/board/freescale/ls1012ardb/ls1012ardb.c
@@ -32,13 +32,27 @@ int checkboard(void)
 {
 #ifdef CONFIG_TARGET_LS1012ARDB
 	u8 in1;
+	int ret, bus_num = 0;
 
 	puts("Board: LS1012ARDB ");
 
 	/* Initialize i2c early for Serial flash bank information */
-	i2c_set_bus_num(0);
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
 
-	if (i2c_read(I2C_MUX_IO_ADDR, I2C_MUX_IO_1, 1, &in1, 1) < 0) {
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_IO_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return -ENXIO;
+	}
+	ret = dm_i2c_read(dev, I2C_MUX_IO_1, &in1, 1);
+#else /* Non DM I2C support - will be removed */
+	i2c_set_bus_num(bus_num);
+	ret = i2c_read(I2C_MUX_IO_ADDR, I2C_MUX_IO_1, 1, &in1, 1);
+#endif
+	if (ret < 0) {
 		printf("Error reading i2c boot information!\n");
 		return 0; /* Don't want to hang() on this error */
 	}
@@ -173,11 +187,25 @@ int esdhc_status_fixup(void *blob, const char *compat)
 	bool sdhc2_en = false;
 	u8 mux_sdhc2;
 	u8 io = 0;
+	int ret, bus_num = 0;
 
-	i2c_set_bus_num(0);
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
 
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_IO_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return -ENXIO;
+	}
+	ret = dm_i2c_read(dev, I2C_MUX_IO_1, &io, 1);
+#else
+	i2c_set_bus_num(bus_num);
 	/* IO1[7:3] is the field of board revision info. */
-	if (i2c_read(I2C_MUX_IO_ADDR, I2C_MUX_IO_1, 1, &io, 1) < 0) {
+	ret = i2c_read(I2C_MUX_IO_ADDR, I2C_MUX_IO_1, 1, &io, 1);
+#endif
+	if (ret < 0) {
 		printf("Error reading i2c boot information!\n");
 		return 0;
 	}
@@ -200,7 +228,12 @@ int esdhc_status_fixup(void *blob, const char *compat)
 		 *	10 - eMMC Memory
 		 *	11 - SPI
 		 */
-		if (i2c_read(I2C_MUX_IO_ADDR, I2C_MUX_IO_0, 1, &io, 1) < 0) {
+#if defined(CONFIG_DM_I2C)
+		ret = dm_i2c_read(dev, I2C_MUX_IO_0, &io, 1);
+#else
+		ret = i2c_read(I2C_MUX_IO_ADDR, I2C_MUX_IO_0, 1, &io, 1);
+#endif
+		if (ret < 0) {
 			printf("Error reading i2c boot information!\n");
 			return 0;
 		}
@@ -231,16 +264,63 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 static int switch_to_bank1(void)
 {
-	u8 data;
-	int ret;
+	u8 data = 0xf4, chip_addr = 0x24, offset_addr = 0x03;
+	int ret, bus_num = 0;
 
-	i2c_set_bus_num(0);
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
+
+	ret = i2c_get_chip_for_busnum(bus_num, chip_addr,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return -ENXIO;
+	}
+	/*
+	 * --------------------------------------------------------------------------------
+	 * | I2C bus |   I2C address    |       Device     |          Notes               |
+	 * --------------------------------------------------------------------------------
+	 * |  I2C1   | 0x24, 0x25, 0x26 | IO expander (CFG,| Provides 16bits of General   |
+	 * |	     |		        | RESET, and INT/  | Purpose parallel Input/Output|
+	 * |         |			| KW41GPIO) - NXP  | (GPIO) expansion for the     |
+	 * |         |                  | PCAL9555AHF      | I2C bus                      |
+	 * --------------------------------------------------------------------------------
+	 * - mount three IO expander(PCAL9555AHF) on I2C1
+	 *
+	 * PCAL9555A device address
+	 *  		slave address
+	 *  --------------------------------------
+	 *  | 0 | 1 | 0 | 0 | A2 | A1 | A0 | R/W |
+	 *  --------------------------------------
+	 *  |     fixed     | hardware selectable|
+	 *
+	 * Output port 1(Pinter register bits = 0x03)
+	 *
+	 * P1_[7~0] = 0xf4
+	 * P1_0 <---> CFG_MUX_QSPI_S0
+	 * P1_1 <---> CFG_MUX_QSPI_S1
+	 * CFG_MUX_QSPI_S[1:0] = 0b00
+	 *
+	 * QSPI chip-select demultiplexer select
+	 * ----------------------------------------------------------------------------
+	 * | CFG_MUX_QSPI_S1 | CFG_MUX_QSPI_S0 |              Values                  |
+	 * ---------------------------------------------------------------------------
+	 * | 0               | 0               |CS routed to SPI memory bank1(default)|
+	 * ----------------------------------------------------------------------------
+	 * | 0               | 1               |CS routed to SPI memory bank2         |
+	 * ----------------------------------------------------------------------------
+	 *
+	 */
+	ret = dm_i2c_write(dev, offset_addr, &data, 1);
+#else /* Non DM I2C support - will be removed */
+	i2c_set_bus_num(bus_num);
+	ret = i2c_write(chip_addr, offset_addr, 1, &data, 1);
+#endif
 
-	data = 0xf4;
-	ret = i2c_write(0x24, 0x3, 1, &data, 1);
 	if (ret) {
 		printf("i2c write error to chip : %u, addr : %u, data : %u\n",
-		       0x24, 0x3, data);
+		       chip_addr, offset_addr, data);
 	}
 
 	return ret;
@@ -248,25 +328,44 @@ static int switch_to_bank1(void)
 
 static int switch_to_bank2(void)
 {
-	u8 data;
-	int ret;
+	u8 data[2] = {0xfc, 0xf5}, offset_addr[2] = {0x7, 0x3}, chip_addr = 0x24;
+	int ret, i, bus_num = 0;
 
-	i2c_set_bus_num(0);
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
 
-	data = 0xfc;
-	ret = i2c_write(0x24, 0x7, 1, &data, 1);
+	ret = i2c_get_chip_for_busnum(bus_num, chip_addr,
+				      1, &dev);
 	if (ret) {
-		printf("i2c write error to chip : %u, addr : %u, data : %u\n",
-		       0x24, 0x7, data);
-		goto err;
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return -ENXIO;
 	}
+#else /* Non DM I2C support - will be removed */
+	i2c_set_bus_num(bus_num);
+#endif
 
-	data = 0xf5;
-	ret = i2c_write(0x24, 0x3, 1, &data, 1);
-	if (ret) {
-		printf("i2c write error to chip : %u, addr : %u, data : %u\n",
-		       0x24, 0x3, data);
+	/*
+	 * 1th step: config port 1
+	 *	- the port 1 pin is enabled as an output
+	 * 2th step: output port 1
+	 *	- P1_[7:0] output 0xf5,
+	 *	  then CFG_MUX_QSPI_S[1:0] equal to 0b01,
+	 *	  CS routed to SPI memory bank2
+	 */
+	for (i = 0; i < sizeof(data); i++) {
+#if defined(CONFIG_DM_I2C)
+		ret = dm_i2c_write(dev, offset_addr[i], &data[i], 1);
+#else /* Non DM I2C support - will be removed */
+		ret = i2c_write(chip_addr, offset_addr[i], 1, &data[i], 1);
+#endif
+		if (ret) {
+			printf("i2c write error to chip : %u, addr : %u, data : %u\n",
+			       chip_addr, offset_addr[i], data[i]);
+			goto err;
+		}
 	}
+
 err:
 	return ret;
 }
-- 
2.17.1

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

* [U-Boot] [PATCH 04/42] board: freescale: ls1012ardb: eth.c: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 03/42] board: freescale: ls1012ardb: ls1012ardb.c: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error Biwen Li
                   ` (38 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API for board LS1012ARDB

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1012ardb/eth.c | 35 ++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c
index b35d5343e4..0f33128996 100644
--- a/board/freescale/ls1012ardb/eth.c
+++ b/board/freescale/ls1012ardb/eth.c
@@ -27,12 +27,47 @@ static inline void ls1012ardb_reset_phy(void)
 {
 #ifdef CONFIG_TARGET_LS1012ARDB
 	/* Through reset IO expander reset both RGMII and SGMII PHYs */
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+	int ret;
+
+	/*
+	 * The I2C IO-expander PCAL9555A is mouted on I2C1 bus(bus number is 0).
+	 */
+	ret = i2c_get_chip_for_busnum(0, I2C_MUX_IO2_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       0);
+		return;
+	}
+	/* Config port 0
+	 * - config pin IOXP_RST_ETH1_B and IOXP_RST_ETH2_B
+	 *   are enabled as an output.
+	 */
+	dm_i2c_reg_write(dev, 6, __PHY_MASK);
+
+	/*
+	 * Set port 0 output a value to reset ETH2 interface
+	 * - pin IOXP_RST_ETH2_B output 0b0
+	 */
+	dm_i2c_reg_write(dev, 2, __PHY_ETH2_MASK);
+	mdelay(10);
+	dm_i2c_reg_write(dev, 2, __PHY_ETH1_MASK);
+	/*
+	 * Set port 0 output a value to reset ETH1 interface
+	 * - pin IOXP_RST_ETH1_B output 0b0
+	 */
+	mdelay(10);
+	dm_i2c_reg_write(dev, 2, 0xFF);
+#else
 	i2c_reg_write(I2C_MUX_IO2_ADDR, 6, __PHY_MASK);
 	i2c_reg_write(I2C_MUX_IO2_ADDR, 2, __PHY_ETH2_MASK);
 	mdelay(10);
 	i2c_reg_write(I2C_MUX_IO2_ADDR, 2, __PHY_ETH1_MASK);
 	mdelay(10);
 	i2c_reg_write(I2C_MUX_IO2_ADDR, 2, 0xFF);
+#endif
 	mdelay(50);
 #endif
 }
-- 
2.17.1

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

* [U-Boot] [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (2 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 04/42] board: freescale: ls1012ardb: eth.c: " Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15 12:43   ` Priyanka Jain
  2019-11-14 10:36 ` [U-Boot] [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A Biwen Li
                   ` (37 subsequent siblings)
  41 siblings, 1 reply; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_GPIO to fix
a compilation error as follows:
	- drivers/i2c/built-in.o: In function `mxc_i2c_probe:
	  drivers/i2c/mxc_i2c.c:924: undefined reference to
	  `gpio_request_by_name_nodev'
	  drivers/i2c/mxc_i2c.c:927: undefined reference to
	  `gpio_request_by_name_nodev'

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1012a2g5rdb_qspi_defconfig           | 1 +
 configs/ls1012a2g5rdb_tfa_defconfig            | 1 +
 configs/ls1012afrdm_qspi_defconfig             | 1 +
 configs/ls1012afrdm_tfa_defconfig              | 1 +
 configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 +
 configs/ls1012afrwy_qspi_defconfig             | 1 +
 configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig  | 1 +
 configs/ls1012afrwy_tfa_defconfig              | 1 +
 configs/ls1012aqds_qspi_defconfig              | 1 +
 configs/ls1012aqds_tfa_SECURE_BOOT_defconfig   | 1 +
 configs/ls1012aqds_tfa_defconfig               | 1 +
 configs/ls1012ardb_qspi_SECURE_BOOT_defconfig  | 1 +
 configs/ls1012ardb_qspi_defconfig              | 1 +
 configs/ls1012ardb_tfa_SECURE_BOOT_defconfig   | 1 +
 configs/ls1012ardb_tfa_defconfig               | 1 +
 15 files changed, 15 insertions(+)

diff --git a/configs/ls1012a2g5rdb_qspi_defconfig b/configs/ls1012a2g5rdb_qspi_defconfig
index 9dd9f4039a..ea0ec04545 100644
--- a/configs/ls1012a2g5rdb_qspi_defconfig
+++ b/configs/ls1012a2g5rdb_qspi_defconfig
@@ -48,3 +48,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012a2g5rdb_tfa_defconfig b/configs/ls1012a2g5rdb_tfa_defconfig
index c554bd5087..5ee9e2e0e2 100644
--- a/configs/ls1012a2g5rdb_tfa_defconfig
+++ b/configs/ls1012a2g5rdb_tfa_defconfig
@@ -48,3 +48,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012afrdm_qspi_defconfig b/configs/ls1012afrdm_qspi_defconfig
index 2a6a0b6a61..e147914dba 100644
--- a/configs/ls1012afrdm_qspi_defconfig
+++ b/configs/ls1012afrdm_qspi_defconfig
@@ -48,3 +48,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012afrdm_tfa_defconfig b/configs/ls1012afrdm_tfa_defconfig
index 4fd33c539b..fa9a33a9fb 100644
--- a/configs/ls1012afrdm_tfa_defconfig
+++ b/configs/ls1012afrdm_tfa_defconfig
@@ -48,3 +48,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
index d8fe7e8cf1..e92b10e89b 100644
--- a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
@@ -53,3 +53,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012afrwy_qspi_defconfig b/configs/ls1012afrwy_qspi_defconfig
index 78c48b5f28..5a3b7b7284 100644
--- a/configs/ls1012afrwy_qspi_defconfig
+++ b/configs/ls1012afrwy_qspi_defconfig
@@ -50,3 +50,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
index 919a825209..b9de7613bf 100644
--- a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
@@ -53,3 +53,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012afrwy_tfa_defconfig b/configs/ls1012afrwy_tfa_defconfig
index 3e7299f683..bf0979232f 100644
--- a/configs/ls1012afrwy_tfa_defconfig
+++ b/configs/ls1012afrwy_tfa_defconfig
@@ -52,3 +52,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012aqds_qspi_defconfig b/configs/ls1012aqds_qspi_defconfig
index d453c74a3f..b96b9968d2 100644
--- a/configs/ls1012aqds_qspi_defconfig
+++ b/configs/ls1012aqds_qspi_defconfig
@@ -72,3 +72,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
index 69bf32d98e..6ebe2894b1 100644
--- a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
@@ -66,3 +66,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012aqds_tfa_defconfig b/configs/ls1012aqds_tfa_defconfig
index 7c71126cd3..857f04c1c4 100644
--- a/configs/ls1012aqds_tfa_defconfig
+++ b/configs/ls1012aqds_tfa_defconfig
@@ -72,3 +72,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
index 3e95d56447..cd7902c5c9 100644
--- a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
@@ -56,3 +56,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012ardb_qspi_defconfig b/configs/ls1012ardb_qspi_defconfig
index fd2f64f124..54d2aa6fb2 100644
--- a/configs/ls1012ardb_qspi_defconfig
+++ b/configs/ls1012ardb_qspi_defconfig
@@ -55,3 +55,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
index c8873839d6..91edcb098d 100644
--- a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
@@ -56,3 +56,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1012ardb_tfa_defconfig b/configs/ls1012ardb_tfa_defconfig
index f6de300476..e6c6b61f04 100644
--- a/configs/ls1012ardb_tfa_defconfig
+++ b/configs/ls1012ardb_tfa_defconfig
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
-- 
2.17.1

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

* [U-Boot] [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (3 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15 12:43   ` Priyanka Jain
  2019-11-14 10:36 ` [U-Boot] [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC Biwen Li
                   ` (36 subsequent siblings)
  41 siblings, 1 reply; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

As no gpio.h is defined for this architecture, to
avoid compilation failure, do not include <asm/arch/gpio.h> for
SoC LS1012A. Compilation error as follows:
	- In file included from drivers/gpio/gpio-uclass.c:15:0:
	  ./arch/arm/include/asm/gpio.h:7:10: fatal error: asm/arch/gpio.h: No such file or directory
	  #include <asm/arch/gpio.h>
          ^~~~~~~~~~~~~~~~~
	  compilation terminated.
	  scripts/Makefile.build:278: recipe for target drivers/gpio/gpio-uclass.o failed
	  make[1]: *** [drivers/gpio/gpio-uclass.o] Error 1
	  Makefile:1629: recipe for target drivers/gpio failed
	  make: *** [drivers/gpio] Error 2
	  make: *** Waiting for unfinished jobs....
	    LD      board/freescale/common/built-in.o
	    In file included from drivers/i2c/i2c-uclass.c:15:0:
	    ./arch/arm/include/asm/gpio.h:7:10: fatal error: asm/arch/gpio.h: No such file or directory
	    #include <asm/arch/gpio.h>
            ^~~~~~~~~~~~~~~~~
	    compilation terminated.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/include/asm/gpio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 6ff5f42424..9f8c9da564 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -3,6 +3,7 @@
 	!defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP) && \
 	!defined(CONFIG_ARCH_LX2160A) && !defined(CONFIG_ARCH_LS1028A) && \
 	!defined(CONFIG_ARCH_LS2080A) && !defined(CONFIG_ARCH_LS1088A) && \
+	!defined(CONFIG_ARCH_LS1012A) && \
 	!defined(CONFIG_ARCH_ASPEED)
 #include <asm/arch/gpio.h>
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (4 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15 12:43   ` Priyanka Jain
  2019-11-14 10:36 ` [U-Boot] [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API Biwen Li
                   ` (35 subsequent siblings)
  41 siblings, 1 reply; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_RTC for SoC LS1012A
to fix compilation error when enabled CONFIG_DM_I2C
and CONFIG_CMD_DATE as follows:
	- cmd/date.c: In function ‘do_date’:
	  cmd/date.c:51:12: warning: implicit declaration of function ‘I2C_GET_BUS’; did you mean ‘IDE_BUS’? [-Wimplicit-function-declaration]
	  old_bus = I2C_GET_BUS();
		    ^~~~~~~~~~~
		    IDE_BUS
	  cmd/date.c:52:2: warning: implicit declaration of function ‘I2C_SET_BUS’; did you mean ‘IDE_BUS’? [-Wimplicit-function-declaration]
	  I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM);
	  ^~~~~~~~~~~
	  IDE_BUS
	  LD      drivers/pci/built-in.o
	  cmd/date.c:52:14: error: ‘CONFIG_SYS_RTC_BUS_NUM’ undeclared (first use in this function); did you mean ‘CONFIG_SYS_EEPROM_BUS_NUM’?
	  I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM);
		      ^~~~~~~~~~~~~~~~~~~~~~
		      CONFIG_SYS_EEPROM_BUS_NUM
	  cmd/date.c:52:14: note: each undeclared identifier is reported only once for each function it appears in
	  scripts/Makefile.build:278: recipe for target cmd/date.o failed
	  make[1]: *** [cmd/date.o] Error 1
	  make[1]: *** Waiting for unfinished jobs....

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1012a2g5rdb_qspi_defconfig           | 1 +
 configs/ls1012a2g5rdb_tfa_defconfig            | 1 +
 configs/ls1012afrdm_qspi_defconfig             | 1 +
 configs/ls1012afrdm_tfa_defconfig              | 1 +
 configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 +
 configs/ls1012afrwy_qspi_defconfig             | 1 +
 configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig  | 1 +
 configs/ls1012afrwy_tfa_defconfig              | 1 +
 configs/ls1012aqds_qspi_defconfig              | 1 +
 configs/ls1012aqds_tfa_SECURE_BOOT_defconfig   | 1 +
 configs/ls1012aqds_tfa_defconfig               | 1 +
 configs/ls1012ardb_qspi_SECURE_BOOT_defconfig  | 1 +
 configs/ls1012ardb_qspi_defconfig              | 1 +
 configs/ls1012ardb_tfa_SECURE_BOOT_defconfig   | 1 +
 configs/ls1012ardb_tfa_defconfig               | 1 +
 15 files changed, 15 insertions(+)

diff --git a/configs/ls1012a2g5rdb_qspi_defconfig b/configs/ls1012a2g5rdb_qspi_defconfig
index ea0ec04545..e6733304d9 100644
--- a/configs/ls1012a2g5rdb_qspi_defconfig
+++ b/configs/ls1012a2g5rdb_qspi_defconfig
@@ -49,3 +49,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012a2g5rdb_tfa_defconfig b/configs/ls1012a2g5rdb_tfa_defconfig
index 5ee9e2e0e2..8a52bb8e13 100644
--- a/configs/ls1012a2g5rdb_tfa_defconfig
+++ b/configs/ls1012a2g5rdb_tfa_defconfig
@@ -49,3 +49,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012afrdm_qspi_defconfig b/configs/ls1012afrdm_qspi_defconfig
index e147914dba..62ce6c7576 100644
--- a/configs/ls1012afrdm_qspi_defconfig
+++ b/configs/ls1012afrdm_qspi_defconfig
@@ -49,3 +49,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012afrdm_tfa_defconfig b/configs/ls1012afrdm_tfa_defconfig
index fa9a33a9fb..628f763101 100644
--- a/configs/ls1012afrdm_tfa_defconfig
+++ b/configs/ls1012afrdm_tfa_defconfig
@@ -49,3 +49,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
index e92b10e89b..a29a1d8309 100644
--- a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
@@ -54,3 +54,4 @@ CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012afrwy_qspi_defconfig b/configs/ls1012afrwy_qspi_defconfig
index 5a3b7b7284..3af9439ef4 100644
--- a/configs/ls1012afrwy_qspi_defconfig
+++ b/configs/ls1012afrwy_qspi_defconfig
@@ -51,3 +51,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
index b9de7613bf..7980a67717 100644
--- a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
@@ -54,3 +54,4 @@ CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012afrwy_tfa_defconfig b/configs/ls1012afrwy_tfa_defconfig
index bf0979232f..70a5eff359 100644
--- a/configs/ls1012afrwy_tfa_defconfig
+++ b/configs/ls1012afrwy_tfa_defconfig
@@ -53,3 +53,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012aqds_qspi_defconfig b/configs/ls1012aqds_qspi_defconfig
index b96b9968d2..f4424de4b6 100644
--- a/configs/ls1012aqds_qspi_defconfig
+++ b/configs/ls1012aqds_qspi_defconfig
@@ -73,3 +73,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
index 6ebe2894b1..3b75ea19de 100644
--- a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
@@ -67,3 +67,4 @@ CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012aqds_tfa_defconfig b/configs/ls1012aqds_tfa_defconfig
index 857f04c1c4..9bb207769e 100644
--- a/configs/ls1012aqds_tfa_defconfig
+++ b/configs/ls1012aqds_tfa_defconfig
@@ -73,3 +73,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
index cd7902c5c9..3cd50af13c 100644
--- a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
@@ -57,3 +57,4 @@ CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012ardb_qspi_defconfig b/configs/ls1012ardb_qspi_defconfig
index 54d2aa6fb2..c4750a3494 100644
--- a/configs/ls1012ardb_qspi_defconfig
+++ b/configs/ls1012ardb_qspi_defconfig
@@ -56,3 +56,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
index 91edcb098d..49c895007f 100644
--- a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
@@ -57,3 +57,4 @@ CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls1012ardb_tfa_defconfig b/configs/ls1012ardb_tfa_defconfig
index e6c6b61f04..92085ec708 100644
--- a/configs/ls1012ardb_tfa_defconfig
+++ b/configs/ls1012ardb_tfa_defconfig
@@ -57,3 +57,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
-- 
2.17.1

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

* [U-Boot] [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (5 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15 12:43   ` Priyanka Jain
  2019-11-14 10:36 ` [U-Boot] [PATCH 09/42] include/configs: ls1012a_common: define default i2c bus Biwen Li
                   ` (34 subsequent siblings)
  41 siblings, 1 reply; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to
fix compilation error when
enabled CONFIG_DM_I2C as follows:
	- board/freescale/ls1012aqds/built-in.o: In function `misc_init_r:
	  board/freescale/ls1012aqds/ls1012aqds.c:111: undefined reference to
	  `i2c_set_bus_num'
	  board/freescale/ls1012aqds/ls1012aqds.c:113: undefined reference to
	  `i2c_write'

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1012aqds/ls1012aqds.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c
index 86c72ee357..30bf1047d5 100644
--- a/board/freescale/ls1012aqds/ls1012aqds.c
+++ b/board/freescale/ls1012aqds/ls1012aqds.c
@@ -107,10 +107,26 @@ int board_early_init_f(void)
 int misc_init_r(void)
 {
 	u8 mux_sdhc_cd = 0x80;
-
-	i2c_set_bus_num(0);
+	int bus_num = 0;
+
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+	int ret;
+
+	ret = i2c_get_chip_for_busnum(bus_num, CONFIG_SYS_I2C_FPGA_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return ret;
+	}
+	dm_i2c_write(dev, 0x5a, &mux_sdhc_cd, 1);
+#else
+	i2c_set_bus_num(bus_num);
 
 	i2c_write(CONFIG_SYS_I2C_FPGA_ADDR, 0x5a, 1, &mux_sdhc_cd, 1);
+#endif
+
 	return 0;
 }
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 09/42] include/configs: ls1012a_common: define default i2c bus
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (6 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15 12:43   ` Priyanka Jain
  2019-11-14 10:36 ` [U-Boot] [PATCH 10/42] configs: arm: ls1043a: enable CONFIG_DM_I2C Biwen Li
                   ` (33 subsequent siblings)
  41 siblings, 1 reply; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This defines default i2c bus with
macro CONFIG_I2C_SET_DEFAULT_BUS_NUM
and CONFIG_I2C_DEFAULT_BUS_NUMBER for ls1012a

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1012a_common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index c5be1d33cc..b3a12094c1 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -76,6 +76,9 @@
 /* I2C */
 #ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
 #endif
 
 #define CONFIG_SYS_NS16550_SERIAL
-- 
2.17.1

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

* [U-Boot] [PATCH 10/42] configs: arm: ls1043a: enable CONFIG_DM_I2C
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (7 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 09/42] include/configs: ls1012a_common: define default i2c bus Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 11/42] include/configs: arm: ls1043a: fix a compilation error Biwen Li
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_I2C for SoC LS1043A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1043aqds_defconfig                    | 1 +
 configs/ls1043aqds_lpuart_defconfig             | 1 +
 configs/ls1043aqds_nand_defconfig               | 1 +
 configs/ls1043aqds_nor_ddr3_defconfig           | 1 +
 configs/ls1043aqds_qspi_defconfig               | 1 +
 configs/ls1043aqds_sdcard_ifc_defconfig         | 1 +
 configs/ls1043aqds_sdcard_qspi_defconfig        | 1 +
 configs/ls1043aqds_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1043aqds_tfa_defconfig                | 1 +
 configs/ls1043ardb_SECURE_BOOT_defconfig        | 1 +
 configs/ls1043ardb_defconfig                    | 1 +
 configs/ls1043ardb_nand_SECURE_BOOT_defconfig   | 1 +
 configs/ls1043ardb_nand_defconfig               | 1 +
 configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig | 1 +
 configs/ls1043ardb_sdcard_defconfig             | 1 +
 configs/ls1043ardb_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1043ardb_tfa_defconfig                | 1 +
 17 files changed, 17 insertions(+)

diff --git a/configs/ls1043aqds_defconfig b/configs/ls1043aqds_defconfig
index 65b2dd18f9..451808d06d 100644
--- a/configs/ls1043aqds_defconfig
+++ b/configs/ls1043aqds_defconfig
@@ -57,3 +57,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
index 51fc761f45..5feeb72580 100644
--- a/configs/ls1043aqds_lpuart_defconfig
+++ b/configs/ls1043aqds_lpuart_defconfig
@@ -59,3 +59,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_nand_defconfig b/configs/ls1043aqds_nand_defconfig
index 551176f58b..ddffd52449 100644
--- a/configs/ls1043aqds_nand_defconfig
+++ b/configs/ls1043aqds_nand_defconfig
@@ -73,3 +73,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_nor_ddr3_defconfig b/configs/ls1043aqds_nor_ddr3_defconfig
index 65734f5cda..f6c8c5b1ff 100644
--- a/configs/ls1043aqds_nor_ddr3_defconfig
+++ b/configs/ls1043aqds_nor_ddr3_defconfig
@@ -58,3 +58,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_qspi_defconfig b/configs/ls1043aqds_qspi_defconfig
index cc998775bd..fc8e43687b 100644
--- a/configs/ls1043aqds_qspi_defconfig
+++ b/configs/ls1043aqds_qspi_defconfig
@@ -54,3 +54,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_sdcard_ifc_defconfig b/configs/ls1043aqds_sdcard_ifc_defconfig
index 3506b31867..ec815b8731 100644
--- a/configs/ls1043aqds_sdcard_ifc_defconfig
+++ b/configs/ls1043aqds_sdcard_ifc_defconfig
@@ -73,3 +73,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_sdcard_qspi_defconfig b/configs/ls1043aqds_sdcard_qspi_defconfig
index 4343eb5229..99ffa1ab41 100644
--- a/configs/ls1043aqds_sdcard_qspi_defconfig
+++ b/configs/ls1043aqds_sdcard_qspi_defconfig
@@ -68,3 +68,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
index 9883d1683d..5c84e7c712 100644
--- a/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
@@ -60,3 +60,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043aqds_tfa_defconfig b/configs/ls1043aqds_tfa_defconfig
index b49ac2cb5d..817d3bdc96 100644
--- a/configs/ls1043aqds_tfa_defconfig
+++ b/configs/ls1043aqds_tfa_defconfig
@@ -65,3 +65,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig b/configs/ls1043ardb_SECURE_BOOT_defconfig
index 0d9d2dd490..8041fca352 100644
--- a/configs/ls1043ardb_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_SECURE_BOOT_defconfig
@@ -52,3 +52,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
index 49d498ae80..141d6fb4ce 100644
--- a/configs/ls1043ardb_defconfig
+++ b/configs/ls1043ardb_defconfig
@@ -50,3 +50,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
index 65c8435c57..b9af76be72 100644
--- a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
@@ -71,3 +71,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_nand_defconfig b/configs/ls1043ardb_nand_defconfig
index a9e58047ac..9c855aadd0 100644
--- a/configs/ls1043ardb_nand_defconfig
+++ b/configs/ls1043ardb_nand_defconfig
@@ -69,3 +69,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
index 1626004a46..6e595b45fb 100644
--- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
@@ -69,3 +69,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_sdcard_defconfig b/configs/ls1043ardb_sdcard_defconfig
index 01adbf0b19..2e0d318856 100644
--- a/configs/ls1043ardb_sdcard_defconfig
+++ b/configs/ls1043ardb_sdcard_defconfig
@@ -67,3 +67,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
index 187d493336..1884826d07 100644
--- a/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
@@ -53,3 +53,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1043ardb_tfa_defconfig b/configs/ls1043ardb_tfa_defconfig
index 75bb52ad4a..97dc254ab5 100644
--- a/configs/ls1043ardb_tfa_defconfig
+++ b/configs/ls1043ardb_tfa_defconfig
@@ -53,3 +53,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
-- 
2.17.1

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

* [U-Boot] [PATCH 11/42] include/configs: arm: ls1043a: fix a compilation error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (8 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 10/42] configs: arm: ls1043a: enable CONFIG_DM_I2C Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 12/42] configs: arm: ls1043a: enable CONFIG_DM_GPIO Biwen Li
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes a compilation error as follows:
	- In file included from include/config.h:8:0,
                 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  In file included from include/config.h:8:0,
			 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  scripts/Makefile.autoconf:48: recipe for target include/autoconf.mk.dep failed
	  make[1]: *** [include/autoconf.mk.dep] Error 1
	  make[1]: *** Waiting for unfinished jobs....
	  scripts/Makefile.autoconf:77: recipe for target u-boot.cfg failed
	  make[1]: *** [u-boot.cfg] Error 1
	  make: *** No rule to make target include/config/auto.conf, needed by include/config/uboot.release.  Stop.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1043a_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index e237012626..bbee26a4de 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -141,7 +141,9 @@
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 
 /* PCIe */
 #ifndef SPL_NO_PCIE
-- 
2.17.1

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

* [U-Boot] [PATCH 12/42] configs: arm: ls1043a: enable CONFIG_DM_GPIO
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (9 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 11/42] include/configs: arm: ls1043a: fix a compilation error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 13/42] board: freescale: ls1043aqds: support dm_i2c_* API Biwen Li
                   ` (30 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_GPIO for SoC LS1043A
to fix a compilation error as follows:
	- drivers/i2c/built-in.o: In function `mxc_i2c_probe':`
	  drivers/i2c/mxc_i2c.c:924: undefined reference to
	  `gpio_request_by_name_nodev'
	  drivers/i2c/mxc_i2c.c:927: undefined reference to
	 `gpio_request_by_name_nodev'

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1043aqds_defconfig                    | 1 +
 configs/ls1043aqds_lpuart_defconfig             | 1 +
 configs/ls1043aqds_nand_defconfig               | 1 +
 configs/ls1043aqds_nor_ddr3_defconfig           | 1 +
 configs/ls1043aqds_qspi_defconfig               | 1 +
 configs/ls1043aqds_sdcard_ifc_defconfig         | 1 +
 configs/ls1043aqds_sdcard_qspi_defconfig        | 1 +
 configs/ls1043aqds_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1043aqds_tfa_defconfig                | 1 +
 configs/ls1043ardb_SECURE_BOOT_defconfig        | 1 +
 configs/ls1043ardb_defconfig                    | 1 +
 configs/ls1043ardb_nand_SECURE_BOOT_defconfig   | 1 +
 configs/ls1043ardb_nand_defconfig               | 1 +
 configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig | 1 +
 configs/ls1043ardb_sdcard_defconfig             | 1 +
 configs/ls1043ardb_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1043ardb_tfa_defconfig                | 1 +
 17 files changed, 17 insertions(+)

diff --git a/configs/ls1043aqds_defconfig b/configs/ls1043aqds_defconfig
index 451808d06d..de8324fed9 100644
--- a/configs/ls1043aqds_defconfig
+++ b/configs/ls1043aqds_defconfig
@@ -58,3 +58,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
index 5feeb72580..98ef6a8113 100644
--- a/configs/ls1043aqds_lpuart_defconfig
+++ b/configs/ls1043aqds_lpuart_defconfig
@@ -60,3 +60,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_nand_defconfig b/configs/ls1043aqds_nand_defconfig
index ddffd52449..990f07cb37 100644
--- a/configs/ls1043aqds_nand_defconfig
+++ b/configs/ls1043aqds_nand_defconfig
@@ -74,3 +74,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_nor_ddr3_defconfig b/configs/ls1043aqds_nor_ddr3_defconfig
index f6c8c5b1ff..a0d1499be1 100644
--- a/configs/ls1043aqds_nor_ddr3_defconfig
+++ b/configs/ls1043aqds_nor_ddr3_defconfig
@@ -59,3 +59,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_qspi_defconfig b/configs/ls1043aqds_qspi_defconfig
index fc8e43687b..620ff23617 100644
--- a/configs/ls1043aqds_qspi_defconfig
+++ b/configs/ls1043aqds_qspi_defconfig
@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_sdcard_ifc_defconfig b/configs/ls1043aqds_sdcard_ifc_defconfig
index ec815b8731..c0c89b6de9 100644
--- a/configs/ls1043aqds_sdcard_ifc_defconfig
+++ b/configs/ls1043aqds_sdcard_ifc_defconfig
@@ -74,3 +74,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_sdcard_qspi_defconfig b/configs/ls1043aqds_sdcard_qspi_defconfig
index 99ffa1ab41..1f9c1445e9 100644
--- a/configs/ls1043aqds_sdcard_qspi_defconfig
+++ b/configs/ls1043aqds_sdcard_qspi_defconfig
@@ -69,3 +69,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
index 5c84e7c712..1536689460 100644
--- a/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
@@ -61,3 +61,4 @@ CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043aqds_tfa_defconfig b/configs/ls1043aqds_tfa_defconfig
index 817d3bdc96..e146524f41 100644
--- a/configs/ls1043aqds_tfa_defconfig
+++ b/configs/ls1043aqds_tfa_defconfig
@@ -66,3 +66,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig b/configs/ls1043ardb_SECURE_BOOT_defconfig
index 8041fca352..9c5f8b0878 100644
--- a/configs/ls1043ardb_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_SECURE_BOOT_defconfig
@@ -53,3 +53,4 @@ CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
index 141d6fb4ce..dfddc7518d 100644
--- a/configs/ls1043ardb_defconfig
+++ b/configs/ls1043ardb_defconfig
@@ -51,3 +51,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
index b9af76be72..72f5e23710 100644
--- a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
@@ -72,3 +72,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_nand_defconfig b/configs/ls1043ardb_nand_defconfig
index 9c855aadd0..4e599f1ad3 100644
--- a/configs/ls1043ardb_nand_defconfig
+++ b/configs/ls1043ardb_nand_defconfig
@@ -70,3 +70,4 @@ CONFIG_USB_XHCI_DWC3=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
index 6e595b45fb..f5276d8840 100644
--- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
@@ -70,3 +70,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_sdcard_defconfig b/configs/ls1043ardb_sdcard_defconfig
index 2e0d318856..7d5c39a11a 100644
--- a/configs/ls1043ardb_sdcard_defconfig
+++ b/configs/ls1043ardb_sdcard_defconfig
@@ -68,3 +68,4 @@ CONFIG_USB_XHCI_DWC3=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
index 1884826d07..a1e48f3639 100644
--- a/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
@@ -54,3 +54,4 @@ CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1043ardb_tfa_defconfig b/configs/ls1043ardb_tfa_defconfig
index 97dc254ab5..4eca972807 100644
--- a/configs/ls1043ardb_tfa_defconfig
+++ b/configs/ls1043ardb_tfa_defconfig
@@ -54,3 +54,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
-- 
2.17.1

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

* [U-Boot] [PATCH 13/42] board: freescale: ls1043aqds: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (10 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 12/42] configs: arm: ls1043a: enable CONFIG_DM_GPIO Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 14/42] board: freescale: ls1043aqds: fix build error Biwen Li
                   ` (29 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to
fix compilation error when enabled CONFIG_DM_I2C
as follows:
	- board/freescale/ls1043aqds/built-in.o: In function `select_i2c_ch_pca9547:
	  board/freescale/ls1043aqds/ls1043aqds.c:278: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/built-in.o: In function
	  `board_retimer_init':
	  board/freescale/ls1043aqds/ls1043aqds.c:317: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:321: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:324: undefined reference to `i2c_read'
	  board/freescale/ls1043aqds/ls1043aqds.c:329: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:332: undefined reference to `i2c_read'
	  board/freescale/ls1043aqds/ls1043aqds.c:334: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:337: undefined reference to `i2c_read'
	  board/freescale/ls1043aqds/ls1043aqds.c:339: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:342: undefined reference to `i2c_read'
	  board/freescale/ls1043aqds/ls1043aqds.c:344: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:347: undefined reference to `i2c_read'
	  board/freescale/ls1043aqds/ls1043aqds.c:350: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:354: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:356: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:358: undefined reference to `i2c_write'
	  board/freescale/ls1043aqds/ls1043aqds.c:360: undefined reference to `i2c_write'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1043aqds/ls1043aqds.c | 95 +++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 6 deletions(-)

diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
index 45f006dab7..7a0e32f6e0 100644
--- a/board/freescale/ls1043aqds/ls1043aqds.c
+++ b/board/freescale/ls1043aqds/ls1043aqds.c
@@ -271,11 +271,24 @@ unsigned long get_board_ddr_clk(void)
 	return 66666666;
 }
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
 	int ret;
 
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return ret;
+	}
+	ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
 	ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
 	if (ret) {
 		puts("PCA: failed to select proper channel\n");
 		return ret;
@@ -290,8 +303,10 @@ int dram_init(void)
 	 * When resuming from deep sleep, the I2C channel may not be
 	 * in the default channel. So, switch to the default channel
 	 * before accessing DDR SPD.
+	 *
+	 * PCA9547 mount on I2C1 bus
 	 */
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 	fsl_initdram();
 #if (!defined(CONFIG_SPL) && !defined(CONFIG_TFABOOT)) || \
 	defined(CONFIG_SPL_BUILD)
@@ -304,16 +319,83 @@ int dram_init(void)
 
 int i2c_multiplexer_select_vid_channel(u8 channel)
 {
-	return select_i2c_ch_pca9547(channel);
+	return select_i2c_ch_pca9547(channel, 0);
 }
 
 void board_retimer_init(void)
 {
 	u8 reg;
+	int bus_num = 0;
 
 	/* Retimer is connected to I2C1_CH7_CH5 */
-	select_i2c_ch_pca9547(I2C_MUX_CH7);
+	select_i2c_ch_pca9547(I2C_MUX_CH7, bus_num);
 	reg = I2C_MUX_CH5;
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+	int ret;
+
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_SEC,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return;
+	}
+	dm_i2c_write(dev, 0, &reg, 1);
+
+	/* Access to Control/Shared register */
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_RETIMER_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return;
+	}
+
+	reg = 0x0;
+	dm_i2c_write(dev, 0xff, &reg, 1);
+
+	/* Read device revision and ID */
+	dm_i2c_read(dev, 1, &reg, 1);
+	debug("Retimer version id = 0x%x\n", reg);
+
+	/* Enable Broadcast. All writes target all channel register sets */
+	reg = 0x0c;
+	dm_i2c_write(dev, 0xff, &reg, 1);
+
+	/* Reset Channel Registers */
+	dm_i2c_read(dev, 0, &reg, 1);
+	reg |= 0x4;
+	dm_i2c_write(dev, 0, &reg, 1);
+
+	/* Enable override divider select and Enable Override Output Mux */
+	dm_i2c_read(dev, 9, &reg, 1);
+	reg |= 0x24;
+	dm_i2c_write(dev, 9, &reg, 1);
+
+	/* Select VCO Divider to full rate (000) */
+	dm_i2c_read(dev, 0x18, &reg, 1);
+	reg &= 0x8f;
+	dm_i2c_write(dev, 0x18, &reg, 1);
+
+	/* Selects active PFD MUX Input as Re-timed Data (001) */
+	dm_i2c_read(dev, 0x1e, &reg, 1);
+	reg &= 0x3f;
+	reg |= 0x20;
+	dm_i2c_write(dev, 0x1e, &reg, 1);
+
+	/* Set data rate as 10.3125 Gbps */
+	reg = 0x0;
+	dm_i2c_write(dev, 0x60, &reg, 1);
+	reg = 0xb2;
+	dm_i2c_write(dev, 0x61, &reg, 1);
+	reg = 0x90;
+	dm_i2c_write(dev, 0x62, &reg, 1);
+	reg = 0xb3;
+	dm_i2c_write(dev, 0x63, &reg, 1);
+	reg = 0xcd;
+	dm_i2c_write(dev, 0x64, &reg, 1);
+#else
 	i2c_write(I2C_MUX_PCA_ADDR_SEC, 0, 1, &reg, 1);
 
 	/* Access to Control/Shared register */
@@ -360,9 +442,10 @@ void board_retimer_init(void)
 	i2c_write(I2C_RETIMER_ADDR, 0x63, 1, &reg, 1);
 	reg = 0xcd;
 	i2c_write(I2C_RETIMER_ADDR, 0x64, 1, &reg, 1);
+#endif
 
 	/* Return the default channel */
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, bus_num);
 }
 
 int board_early_init_f(void)
@@ -457,7 +540,7 @@ int board_init(void)
 	erratum_a010315();
 #endif
 
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 	board_retimer_init();
 
 #ifdef CONFIG_SYS_FSL_SERDES
-- 
2.17.1

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

* [U-Boot] [PATCH 14/42] board: freescale: ls1043aqds: fix build error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (11 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 13/42] board: freescale: ls1043aqds: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 15/42] include/configs: ls1043a_common: define default i2c bus Biwen Li
                   ` (28 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes build error as follows:
- board/freescale/ls1043aqds/built-in.o: In function `board_early_init_f:
  board/freescale/ls1043aqds/ls1043aqds.c:462: undefined reference to
  `i2c_early_init_f'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1043aqds/ls1043aqds.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c
index 7a0e32f6e0..030ec44fe2 100644
--- a/board/freescale/ls1043aqds/ls1043aqds.c
+++ b/board/freescale/ls1043aqds/ls1043aqds.c
@@ -458,8 +458,10 @@ int board_early_init_f(void)
 	u8 uart;
 #endif
 
+#ifdef CONFIG_SYS_I2C
 #ifdef CONFIG_SYS_I2C_EARLY_INIT
 	i2c_early_init_f();
+#endif
 #endif
 	fsl_lsch2_early_init_f();
 
-- 
2.17.1

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

* [U-Boot] [PATCH 15/42] include/configs: ls1043a_common: define default i2c bus
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (12 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 14/42] board: freescale: ls1043aqds: fix build error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 16/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1043A Biwen Li
                   ` (27 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This defines default i2c bus with
macro CONFIG_I2C_SET_DEFAULT_BUS_NUM
and CONFIG_I2C_DEFAULT_BUS_NUMBER
for SoC LS1043A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1043a_common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index bbee26a4de..8997a4254b 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -143,6 +143,9 @@
 /* I2C */
 #ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
 #endif
 
 /* PCIe */
-- 
2.17.1

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

* [U-Boot] [PATCH 16/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1043A
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (13 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 15/42] include/configs: ls1043a_common: define default i2c bus Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 17/42] configs: ls1046a: enable CONFIG_DM_I2C Biwen Li
                   ` (26 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

As no gpio.h is defined for this architecture, to
avoid compilation failure, do not include <asm/arch/gpio.h> for
SoC LS1043A. Compilation error as follows:
	- In file included from drivers/gpio/gpio-uclass.c:15:0:
	  ./arch/arm/include/asm/gpio.h:8:10: fatal error: asm/arch/gpio.h: No such file or directory
	  #include <asm/arch/gpio.h>
		  ^~~~~~~~~~~~~~~~~
	  In file included from drivers/i2c/i2c-uclass.c:15:0:
	  ./arch/arm/include/asm/gpio.h:8:10: fatal error: asm/arch/gpio.h: No such file or directory
	  #include <asm/arch/gpio.h>
		  ^~~~~~~~~~~~~~~~~
	  compilation terminated.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/include/asm/gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 9f8c9da564..45cb04801c 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -3,7 +3,7 @@
 	!defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP) && \
 	!defined(CONFIG_ARCH_LX2160A) && !defined(CONFIG_ARCH_LS1028A) && \
 	!defined(CONFIG_ARCH_LS2080A) && !defined(CONFIG_ARCH_LS1088A) && \
-	!defined(CONFIG_ARCH_LS1012A) && \
+	!defined(CONFIG_ARCH_LS1012A) && !defined(CONFIG_ARCH_LS1043A) && \
 	!defined(CONFIG_ARCH_ASPEED)
 #include <asm/arch/gpio.h>
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 17/42] configs: ls1046a: enable CONFIG_DM_I2C
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (14 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 16/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1043A Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 18/42] include/configs: arm: ls1046a: fix compilation error Biwen Li
                   ` (25 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_I2C for SoC LS1046A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1046afrwy_tfa_defconfig               | 1 +
 configs/ls1046aqds_SECURE_BOOT_defconfig        | 1 +
 configs/ls1046aqds_defconfig                    | 1 +
 configs/ls1046aqds_lpuart_defconfig             | 1 +
 configs/ls1046aqds_nand_defconfig               | 1 +
 configs/ls1046aqds_qspi_defconfig               | 1 +
 configs/ls1046aqds_sdcard_ifc_defconfig         | 1 +
 configs/ls1046aqds_sdcard_qspi_defconfig        | 1 +
 configs/ls1046aqds_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1046aqds_tfa_defconfig                | 1 +
 configs/ls1046ardb_emmc_defconfig               | 1 +
 configs/ls1046ardb_qspi_SECURE_BOOT_defconfig   | 1 +
 configs/ls1046ardb_qspi_defconfig               | 1 +
 configs/ls1046ardb_qspi_spl_defconfig           | 1 +
 configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 +
 configs/ls1046ardb_sdcard_defconfig             | 1 +
 configs/ls1046ardb_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1046ardb_tfa_defconfig                | 1 +
 18 files changed, 18 insertions(+)

diff --git a/configs/ls1046afrwy_tfa_defconfig b/configs/ls1046afrwy_tfa_defconfig
index 3cabb52ef0..244d3334d5 100644
--- a/configs/ls1046afrwy_tfa_defconfig
+++ b/configs/ls1046afrwy_tfa_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_SECURE_BOOT_defconfig b/configs/ls1046aqds_SECURE_BOOT_defconfig
index c39b880456..caa8ca804d 100644
--- a/configs/ls1046aqds_SECURE_BOOT_defconfig
+++ b/configs/ls1046aqds_SECURE_BOOT_defconfig
@@ -57,3 +57,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_defconfig b/configs/ls1046aqds_defconfig
index d82d786be2..e01ded6bce 100644
--- a/configs/ls1046aqds_defconfig
+++ b/configs/ls1046aqds_defconfig
@@ -57,3 +57,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_lpuart_defconfig b/configs/ls1046aqds_lpuart_defconfig
index d3fb8077ef..f53964a657 100644
--- a/configs/ls1046aqds_lpuart_defconfig
+++ b/configs/ls1046aqds_lpuart_defconfig
@@ -59,3 +59,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_nand_defconfig b/configs/ls1046aqds_nand_defconfig
index 5d6f3c10b0..8738d826f1 100644
--- a/configs/ls1046aqds_nand_defconfig
+++ b/configs/ls1046aqds_nand_defconfig
@@ -65,3 +65,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_qspi_defconfig b/configs/ls1046aqds_qspi_defconfig
index 98a42a7554..42e5dc7116 100644
--- a/configs/ls1046aqds_qspi_defconfig
+++ b/configs/ls1046aqds_qspi_defconfig
@@ -54,3 +54,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_sdcard_ifc_defconfig b/configs/ls1046aqds_sdcard_ifc_defconfig
index d2ba4dd744..cf10ba0f28 100644
--- a/configs/ls1046aqds_sdcard_ifc_defconfig
+++ b/configs/ls1046aqds_sdcard_ifc_defconfig
@@ -74,3 +74,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_sdcard_qspi_defconfig b/configs/ls1046aqds_sdcard_qspi_defconfig
index 8d68ce61ff..a535074850 100644
--- a/configs/ls1046aqds_sdcard_qspi_defconfig
+++ b/configs/ls1046aqds_sdcard_qspi_defconfig
@@ -70,3 +70,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
index a8a260fb0b..81a86ac349 100644
--- a/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
@@ -58,3 +58,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046aqds_tfa_defconfig b/configs/ls1046aqds_tfa_defconfig
index 9033f424f9..d97cf2f16e 100644
--- a/configs/ls1046aqds_tfa_defconfig
+++ b/configs/ls1046aqds_tfa_defconfig
@@ -65,3 +65,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_emmc_defconfig b/configs/ls1046ardb_emmc_defconfig
index cdc847ba95..d69b79f3a3 100644
--- a/configs/ls1046ardb_emmc_defconfig
+++ b/configs/ls1046ardb_emmc_defconfig
@@ -67,3 +67,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
index cee127f8b5..94ec9ccad2 100644
--- a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
@@ -51,3 +51,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_qspi_defconfig b/configs/ls1046ardb_qspi_defconfig
index 2f9506ab35..7036fd1fd4 100644
--- a/configs/ls1046ardb_qspi_defconfig
+++ b/configs/ls1046ardb_qspi_defconfig
@@ -51,3 +51,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_qspi_spl_defconfig b/configs/ls1046ardb_qspi_spl_defconfig
index ee3e6ea0d6..23cc3ef212 100644
--- a/configs/ls1046ardb_qspi_spl_defconfig
+++ b/configs/ls1046ardb_qspi_spl_defconfig
@@ -71,3 +71,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_SPL_GZIP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
index a07aabe18c..54b019a12f 100644
--- a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
@@ -65,3 +65,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_sdcard_defconfig b/configs/ls1046ardb_sdcard_defconfig
index be94f4ddd8..a7e801168a 100644
--- a/configs/ls1046ardb_sdcard_defconfig
+++ b/configs/ls1046ardb_sdcard_defconfig
@@ -66,3 +66,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
index b6d22fa75a..742accf602 100644
--- a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
@@ -51,3 +51,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1046ardb_tfa_defconfig b/configs/ls1046ardb_tfa_defconfig
index d183cf74ac..7fcadd214d 100644
--- a/configs/ls1046ardb_tfa_defconfig
+++ b/configs/ls1046ardb_tfa_defconfig
@@ -52,3 +52,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
-- 
2.17.1

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

* [U-Boot] [PATCH 18/42] include/configs: arm: ls1046a: fix compilation error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (15 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 17/42] configs: ls1046a: enable CONFIG_DM_I2C Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 19/42] configs: arm: ls1046a: enable CONFIG_DM_GPIO Biwen Li
                   ` (24 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes compilation error as follows:
	- In file included from include/config.h:8:0,
			 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  In file included from include/config.h:8:0,
			 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  scripts/Makefile.autoconf:48: recipe for target include/autoconf.mk.dep failed
	  make[1]: *** [include/autoconf.mk.dep] Error 1
	  make[1]: *** Waiting for unfinished jobs....
	  scripts/Makefile.autoconf:77: recipe for target u-boot.cfg failed
	  make[1]: *** [u-boot.cfg] Error 1
	  make: *** No rule to make target include/config/auto.conf, needed by include/config/uboot.release.  Stop.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1046a_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index cc8f4c0210..932aa55af5 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -127,7 +127,9 @@
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 
 /* PCIe */
 #define CONFIG_PCIE1		/* PCIE controller 1 */
-- 
2.17.1

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

* [U-Boot] [PATCH 19/42] configs: arm: ls1046a: enable CONFIG_DM_GPIO
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (16 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 18/42] include/configs: arm: ls1046a: fix compilation error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 20/42] board: freescale: ls1046aqds: fix build error Biwen Li
                   ` (23 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_GPIO for SoC LS1046A
to fix a compilation error as follows:
	- drivers/i2c/built-in.o: In function `mxc_i2c_probe:
	  drivers/i2c/mxc_i2c.c:924: undefined reference to
	  `gpio_request_by_name_nodev'
	  drivers/i2c/mxc_i2c.c:927: undefined reference to
	  `gpio_request_by_name_nodev'

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1046afrwy_tfa_defconfig               | 1 +
 configs/ls1046aqds_SECURE_BOOT_defconfig        | 1 +
 configs/ls1046aqds_defconfig                    | 1 +
 configs/ls1046aqds_lpuart_defconfig             | 1 +
 configs/ls1046aqds_nand_defconfig               | 1 +
 configs/ls1046aqds_qspi_defconfig               | 1 +
 configs/ls1046aqds_sdcard_ifc_defconfig         | 1 +
 configs/ls1046aqds_sdcard_qspi_defconfig        | 1 +
 configs/ls1046aqds_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1046aqds_tfa_defconfig                | 1 +
 configs/ls1046ardb_emmc_defconfig               | 1 +
 configs/ls1046ardb_qspi_SECURE_BOOT_defconfig   | 1 +
 configs/ls1046ardb_qspi_defconfig               | 1 +
 configs/ls1046ardb_qspi_spl_defconfig           | 1 +
 configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 +
 configs/ls1046ardb_sdcard_defconfig             | 1 +
 configs/ls1046ardb_tfa_SECURE_BOOT_defconfig    | 1 +
 configs/ls1046ardb_tfa_defconfig                | 1 +
 18 files changed, 18 insertions(+)

diff --git a/configs/ls1046afrwy_tfa_defconfig b/configs/ls1046afrwy_tfa_defconfig
index 244d3334d5..bf94db2e4a 100644
--- a/configs/ls1046afrwy_tfa_defconfig
+++ b/configs/ls1046afrwy_tfa_defconfig
@@ -53,3 +53,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_SECURE_BOOT_defconfig b/configs/ls1046aqds_SECURE_BOOT_defconfig
index caa8ca804d..7c0e351ac2 100644
--- a/configs/ls1046aqds_SECURE_BOOT_defconfig
+++ b/configs/ls1046aqds_SECURE_BOOT_defconfig
@@ -58,3 +58,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_defconfig b/configs/ls1046aqds_defconfig
index e01ded6bce..e6171249ec 100644
--- a/configs/ls1046aqds_defconfig
+++ b/configs/ls1046aqds_defconfig
@@ -58,3 +58,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_lpuart_defconfig b/configs/ls1046aqds_lpuart_defconfig
index f53964a657..dbd3a9475f 100644
--- a/configs/ls1046aqds_lpuart_defconfig
+++ b/configs/ls1046aqds_lpuart_defconfig
@@ -60,3 +60,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_nand_defconfig b/configs/ls1046aqds_nand_defconfig
index 8738d826f1..8a71ecd02b 100644
--- a/configs/ls1046aqds_nand_defconfig
+++ b/configs/ls1046aqds_nand_defconfig
@@ -66,3 +66,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_qspi_defconfig b/configs/ls1046aqds_qspi_defconfig
index 42e5dc7116..277c0a3a8a 100644
--- a/configs/ls1046aqds_qspi_defconfig
+++ b/configs/ls1046aqds_qspi_defconfig
@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_sdcard_ifc_defconfig b/configs/ls1046aqds_sdcard_ifc_defconfig
index cf10ba0f28..ee1fb8a174 100644
--- a/configs/ls1046aqds_sdcard_ifc_defconfig
+++ b/configs/ls1046aqds_sdcard_ifc_defconfig
@@ -75,3 +75,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_sdcard_qspi_defconfig b/configs/ls1046aqds_sdcard_qspi_defconfig
index a535074850..b3dffb4223 100644
--- a/configs/ls1046aqds_sdcard_qspi_defconfig
+++ b/configs/ls1046aqds_sdcard_qspi_defconfig
@@ -71,3 +71,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
index 81a86ac349..68ba54502b 100644
--- a/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
@@ -59,3 +59,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046aqds_tfa_defconfig b/configs/ls1046aqds_tfa_defconfig
index d97cf2f16e..0929efb065 100644
--- a/configs/ls1046aqds_tfa_defconfig
+++ b/configs/ls1046aqds_tfa_defconfig
@@ -66,3 +66,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_emmc_defconfig b/configs/ls1046ardb_emmc_defconfig
index d69b79f3a3..ec0148a559 100644
--- a/configs/ls1046ardb_emmc_defconfig
+++ b/configs/ls1046ardb_emmc_defconfig
@@ -68,3 +68,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
index 94ec9ccad2..d7e5c8652f 100644
--- a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_qspi_defconfig b/configs/ls1046ardb_qspi_defconfig
index 7036fd1fd4..c2d337f6dd 100644
--- a/configs/ls1046ardb_qspi_defconfig
+++ b/configs/ls1046ardb_qspi_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_qspi_spl_defconfig b/configs/ls1046ardb_qspi_spl_defconfig
index 23cc3ef212..73dab8eb5c 100644
--- a/configs/ls1046ardb_qspi_spl_defconfig
+++ b/configs/ls1046ardb_qspi_spl_defconfig
@@ -72,3 +72,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_SPL_GZIP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
index 54b019a12f..df35a31f2f 100644
--- a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
@@ -66,3 +66,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_sdcard_defconfig b/configs/ls1046ardb_sdcard_defconfig
index a7e801168a..2911ba985c 100644
--- a/configs/ls1046ardb_sdcard_defconfig
+++ b/configs/ls1046ardb_sdcard_defconfig
@@ -67,3 +67,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
index 742accf602..988bd3de3b 100644
--- a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1046ardb_tfa_defconfig b/configs/ls1046ardb_tfa_defconfig
index 7fcadd214d..3862c663c7 100644
--- a/configs/ls1046ardb_tfa_defconfig
+++ b/configs/ls1046ardb_tfa_defconfig
@@ -53,3 +53,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
-- 
2.17.1

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

* [U-Boot] [PATCH 20/42] board: freescale: ls1046aqds: fix build error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (17 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 19/42] configs: arm: ls1046a: enable CONFIG_DM_GPIO Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 21/42] include/configs: ls1046a_common: do not define CONFIG_DM_I2C for spl Biwen Li
                   ` (22 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes build error as follows:
- board/freescale/ls1046aqds/built-in.o: In function `board_early_init_f:
  board/freescale/ls1046aqds/ls1046aqds.c:333: undefined reference to
  `i2c_early_init_f'

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1046aqds/ls1046aqds.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c
index 6a51dcd649..6ab56279d7 100644
--- a/board/freescale/ls1046aqds/ls1046aqds.c
+++ b/board/freescale/ls1046aqds/ls1046aqds.c
@@ -315,8 +315,10 @@ int board_early_init_f(void)
 	u8 uart;
 #endif
 
+#ifdef CONFIG_SYS_I2C
 #ifdef CONFIG_SYS_I2C_EARLY_INIT
 	i2c_early_init_f();
+#endif
 #endif
 	fsl_lsch2_early_init_f();
 
-- 
2.17.1

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

* [U-Boot] [PATCH 21/42] include/configs: ls1046a_common: do not define CONFIG_DM_I2C for spl
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (18 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 20/42] board: freescale: ls1046aqds: fix build error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 22/42] armv8: dts: ls1046ardb: enable i2c0 and i2c3 DT node Biwen Li
                   ` (21 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This is used to fix build error as follows:
- drivers/built-in.o: In function `mxc_i2c_probe:
  drivers/i2c/mxc_i2c.c:920: undefined reference to
  `fdt_stringlist_search'
  drivers/i2c/mxc_i2c.c:920:(.text.mxc_i2c_probe+0x7c): relocation
  truncated to fit: R_AARCH64_CALL26 against undefined symbol
  `fdt_stringlist_search'
  drivers/i2c/mxc_i2c.c:924: undefined reference to
  `gpio_request_by_name_nodev'
  drivers/i2c/mxc_i2c.c:924:(.text.mxc_i2c_probe+0xb4): relocation
  truncated to fit: R_AARCH64_CALL26 against undefined symbol
  `gpio_request_by_name_nodev'
  drivers/i2c/mxc_i2c.c:927: undefined reference to
  `gpio_request_by_name_nodev'
  drivers/i2c/mxc_i2c.c:927:(.text.mxc_i2c_probe+0xd4): relocation
  truncated to fit: R_AARCH64_CALL26 against undefined symbol
  `gpio_request_by_name_nodev'
  scripts/Makefile.spl:404: recipe for target 'spl/u-boot-spl' failed
  make[1]: *** [spl/u-boot-spl] Error 1
  Makefile:1762: recipe for target 'spl/u-boot-spl' failed
  make: *** [spl/u-boot-spl] Error 2

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1046a_common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index 932aa55af5..ebf3682413 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -16,6 +16,7 @@
 #define SPL_NO_QSPI
 #define SPL_NO_USB
 #define SPL_NO_SATA
+#undef CONFIG_DM_I2C
 #endif
 #if defined(CONFIG_SPL_BUILD) && \
 	(defined(CONFIG_NAND_BOOT) || defined(CONFIG_QSPI_BOOT))
-- 
2.17.1

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

* [U-Boot] [PATCH 22/42] armv8: dts: ls1046ardb: enable i2c0 and i2c3 DT node
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (19 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 21/42] include/configs: ls1046a_common: do not define CONFIG_DM_I2C for spl Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 23/42] include/configs: ls1046a_common.h: define default i2c bus Biwen Li
                   ` (20 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables i2c0 and i2c3 DT node

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/dts/fsl-ls1046a-rdb.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/dts/fsl-ls1046a-rdb.dts b/arch/arm/dts/fsl-ls1046a-rdb.dts
index a05c9e9b9e..83e34ab02a 100644
--- a/arch/arm/dts/fsl-ls1046a-rdb.dts
+++ b/arch/arm/dts/fsl-ls1046a-rdb.dts
@@ -43,3 +43,11 @@
 &sata {
 	status = "okay";
 };
+
+&i2c0 {
+	status = "okay";
+};
+
+&i2c3 {
+	status = "okay";
+};
-- 
2.17.1

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

* [U-Boot] [PATCH 23/42] include/configs: ls1046a_common.h: define default i2c bus
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (20 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 22/42] armv8: dts: ls1046ardb: enable i2c0 and i2c3 DT node Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 24/42] armv8: dts: ls1046aqds: enable i2c0 DT node Biwen Li
                   ` (19 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This defines default i2c bus with macro
CONFIG_I2C_SET_DEFAULT_BUS_NUM and
CONFIG_I2C_DEFAULT_BUS_NUMBER for SoC LS1046A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1046a_common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index ebf3682413..648e3c8027 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -130,6 +130,9 @@
 /* I2C */
 #ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
 #endif
 
 /* PCIe */
-- 
2.17.1

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

* [U-Boot] [PATCH 24/42] armv8: dts: ls1046aqds: enable i2c0 DT node
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (21 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 23/42] include/configs: ls1046a_common.h: define default i2c bus Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 25/42] armv8: dts: ls1046afrwy: " Biwen Li
                   ` (18 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables i2c0 DT node

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/dts/fsl-ls1046a-qds.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/fsl-ls1046a-qds.dtsi b/arch/arm/dts/fsl-ls1046a-qds.dtsi
index c95f44fc36..76dc397328 100644
--- a/arch/arm/dts/fsl-ls1046a-qds.dtsi
+++ b/arch/arm/dts/fsl-ls1046a-qds.dtsi
@@ -80,3 +80,7 @@
 &sata {
 	status = "okay";
 };
+
+&i2c0 {
+	status = "okay";
+};
-- 
2.17.1

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

* [U-Boot] [PATCH 25/42] armv8: dts: ls1046afrwy: enable i2c0 DT node
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (22 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 24/42] armv8: dts: ls1046aqds: enable i2c0 DT node Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 26/42] board: freescale: ls1046aqds: support dm_i2c_* API Biwen Li
                   ` (17 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables i2c0 DT node

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/dts/fsl-ls1046a-frwy.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/dts/fsl-ls1046a-frwy.dts b/arch/arm/dts/fsl-ls1046a-frwy.dts
index 3d41e3bd44..d39159322a 100644
--- a/arch/arm/dts/fsl-ls1046a-frwy.dts
+++ b/arch/arm/dts/fsl-ls1046a-frwy.dts
@@ -32,3 +32,6 @@
 
 };
 
+&i2c0 {
+	status = "okay";
+};
-- 
2.17.1

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

* [U-Boot] [PATCH 26/42] board: freescale: ls1046aqds: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (23 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 25/42] armv8: dts: ls1046afrwy: " Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 27/42] board: freescale: ls1046afrwy: " Biwen Li
                   ` (16 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to
fix compilation error when
enabled CONFIG_DM_I2C as follows:
	- board/freescale/ls1046aqds/built-in.o: In function `select_i2c_ch_pca9547:
	  board/freescale/ls1046aqds/ls1046aqds.c:276: undefined reference to
	  `i2c_write'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1046aqds/ls1046aqds.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c
index 6ab56279d7..812cbc23d0 100644
--- a/board/freescale/ls1046aqds/ls1046aqds.c
+++ b/board/freescale/ls1046aqds/ls1046aqds.c
@@ -269,11 +269,23 @@ u32 get_lpuart_clk(void)
 }
 #endif
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
 	int ret;
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
 
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return ret;
+	}
+	ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
 	ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
 	if (ret) {
 		puts("PCA: failed to select proper channel\n");
 		return ret;
@@ -288,8 +300,10 @@ int dram_init(void)
 	 * When resuming from deep sleep, the I2C channel may not be
 	 * in the default channel. So, switch to the default channel
 	 * before accessing DDR SPD.
+	 *
+	 * PCA9547 mount on I2C1 bus
 	 */
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 	fsl_initdram();
 #if (!defined(CONFIG_SPL) && !defined(CONFIG_TFABOOT)) || \
 	defined(CONFIG_SPL_BUILD)
@@ -302,7 +316,7 @@ int dram_init(void)
 
 int i2c_multiplexer_select_vid_channel(u8 channel)
 {
-	return select_i2c_ch_pca9547(channel);
+	return select_i2c_ch_pca9547(channel, 0);
 }
 
 int board_early_init_f(void)
@@ -396,7 +410,7 @@ int misc_init_r(void)
 
 int board_init(void)
 {
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
 #ifdef CONFIG_SYS_FSL_SERDES
 	config_serdes_mux();
-- 
2.17.1

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

* [U-Boot] [PATCH 27/42] board: freescale: ls1046afrwy: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (24 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 26/42] board: freescale: ls1046aqds: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 28/42] pmic: i2c: " Biwen Li
                   ` (15 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to
fix compilation error when enabled
CONFIG_DM_I2C as follows:
	- board/freescale/ls1046afrwy/built-in.o: In function `select_i2c_ch_pca9547:
	  board/freescale/ls1046afrwy/ls1046afrwy.c:42: undefined reference to `i2c_write'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1046afrwy/ls1046afrwy.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/freescale/ls1046afrwy/ls1046afrwy.c b/board/freescale/ls1046afrwy/ls1046afrwy.c
index ac2f8ee436..4a9189b3ee 100644
--- a/board/freescale/ls1046afrwy/ls1046afrwy.c
+++ b/board/freescale/ls1046afrwy/ls1046afrwy.c
@@ -35,11 +35,24 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
 	int ret;
 
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return ret;
+	}
+	ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
 	ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
 	if (ret) {
 		puts("PCA: failed to select proper channel\n");
 		return ret;
@@ -144,7 +157,7 @@ val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
 	sec_init();
 #endif
 
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 	return 0;
 }
 
-- 
2.17.1

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

* [U-Boot] [PATCH 28/42] pmic: i2c: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (25 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 27/42] board: freescale: ls1046afrwy: " Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 29/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1046A Biwen Li
                   ` (14 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to fix
compilation error as follows:
	- drivers/power/built-in.o: In function `pmic_reg_write':
	  drivers/power/power_i2c.c:25: undefined reference to
	  `I2C_SET_BUS'
	  drivers/power/power_i2c.c:56: undefined reference to
	  `i2c_write'
	  drivers/power/built-in.o: In function `pmic_reg_read':
	  drivers/power/power_i2c.c:68: undefined reference to
	  `I2C_SET_BUS'
	  drivers/power/power_i2c.c:70: undefined reference to
	  `i2c_read'
	  drivers/power/built-in.o: In function `pmic_probe':
	  drivers/power/power_i2c.c:103: undefined reference to
	  `i2c_set_bus_num'
	  drivers/power/power_i2c.c:105: undefined reference to
	  `i2c_probe'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 drivers/power/power_i2c.c | 45 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/drivers/power/power_i2c.c b/drivers/power/power_i2c.c
index bcddff2d7a..a727f7e519 100644
--- a/drivers/power/power_i2c.c
+++ b/drivers/power/power_i2c.c
@@ -21,8 +21,20 @@ int pmic_reg_write(struct pmic *p, u32 reg, u32 val)
 
 	if (check_reg(p, reg))
 		return -EINVAL;
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
+	int ret;
 
+	ret = i2c_get_chip_for_busnum(p->bus, pmic_i2c_addr,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       p->bus);
+		return -ENXIO;
+	}
+#else /* Non DM I2C support - will be removed */
 	I2C_SET_BUS(p->bus);
+#endif
 
 	switch (pmic_i2c_tx_num) {
 	case 3:
@@ -53,7 +65,11 @@ int pmic_reg_write(struct pmic *p, u32 reg, u32 val)
 		return -EINVAL;
 	}
 
+#if defined(CONFIG_DM_I2C)
+	return dm_i2c_write(dev, reg, buf, pmic_i2c_tx_num);
+#else
 	return i2c_write(pmic_i2c_addr, reg, 1, buf, pmic_i2c_tx_num);
+#endif
 }
 
 int pmic_reg_read(struct pmic *p, u32 reg, u32 *val)
@@ -65,9 +81,21 @@ int pmic_reg_read(struct pmic *p, u32 reg, u32 *val)
 	if (check_reg(p, reg))
 		return -EINVAL;
 
-	I2C_SET_BUS(p->bus);
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
 
+	ret = i2c_get_chip_for_busnum(p->bus, pmic_i2c_addr,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       p->bus);
+		return -ENXIO;
+	}
+	ret = dm_i2c_read(dev, reg, buf, pmic_i2c_tx_num);
+#else /* Non DM I2C support - will be removed */
+	I2C_SET_BUS(p->bus);
 	ret = i2c_read(pmic_i2c_addr, reg, 1, buf, pmic_i2c_tx_num);
+#endif
 	if (ret)
 		return ret;
 
@@ -100,12 +128,25 @@ int pmic_reg_read(struct pmic *p, u32 reg, u32 *val)
 
 int pmic_probe(struct pmic *p)
 {
-	i2c_set_bus_num(p->bus);
 	debug("Bus: %d PMIC:%s probed!\n", p->bus, p->name);
+#if defined(CONFIG_DM_I2C)
+	struct udevice *dev;
+	int ret;
+
+	ret = i2c_get_chip_for_busnum(p->bus, pmic_i2c_addr,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       p->bus);
+		return -ENXIO;
+	}
+#else /* Non DM I2C support - will be removed */
+	i2c_set_bus_num(p->bus);
 	if (i2c_probe(pmic_i2c_addr)) {
 		printf("Can't find PMIC:%s\n", p->name);
 		return -ENODEV;
 	}
+#endif
 
 	return 0;
 }
-- 
2.17.1

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

* [U-Boot] [PATCH 29/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1046A
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (26 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 28/42] pmic: i2c: " Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 30/42] configs: arm: ls1021a: enable CONFIG_DM_I2C Biwen Li
                   ` (13 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

As no gpio.h is defined for this architecture, to
avoid compilation failure, do not include <asm/arch/gpio.h> for
SoC LS1046A.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/include/asm/gpio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 45cb04801c..9adebf6c04 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -4,6 +4,7 @@
 	!defined(CONFIG_ARCH_LX2160A) && !defined(CONFIG_ARCH_LS1028A) && \
 	!defined(CONFIG_ARCH_LS2080A) && !defined(CONFIG_ARCH_LS1088A) && \
 	!defined(CONFIG_ARCH_LS1012A) && !defined(CONFIG_ARCH_LS1043A) && \
+	!defined(CONFIG_ARCH_LS1046A) && \
 	!defined(CONFIG_ARCH_ASPEED)
 #include <asm/arch/gpio.h>
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 30/42] configs: arm: ls1021a: enable CONFIG_DM_I2C
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (27 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 29/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1046A Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 31/42] include/configs: arm: ls1021a: fix compilation error Biwen Li
                   ` (12 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This enables CONFIG_DM_I2C for SoC LS1021A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1021aiot_qspi_defconfig                   | 1 +
 configs/ls1021aiot_sdcard_defconfig                 | 1 +
 configs/ls1021aqds_ddr4_nor_defconfig               | 1 +
 configs/ls1021aqds_ddr4_nor_lpuart_defconfig        | 1 +
 configs/ls1021aqds_nand_defconfig                   | 1 +
 configs/ls1021aqds_nor_SECURE_BOOT_defconfig        | 1 +
 configs/ls1021aqds_nor_defconfig                    | 1 +
 configs/ls1021aqds_nor_lpuart_defconfig             | 1 +
 configs/ls1021aqds_qspi_defconfig                   | 1 +
 configs/ls1021aqds_sdcard_ifc_defconfig             | 1 +
 configs/ls1021aqds_sdcard_qspi_defconfig            | 1 +
 configs/ls1021atsn_qspi_defconfig                   | 1 +
 configs/ls1021atsn_sdcard_defconfig                 | 1 +
 configs/ls1021atwr_nor_SECURE_BOOT_defconfig        | 1 +
 configs/ls1021atwr_nor_defconfig                    | 1 +
 configs/ls1021atwr_nor_lpuart_defconfig             | 1 +
 configs/ls1021atwr_qspi_defconfig                   | 1 +
 configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 +
 configs/ls1021atwr_sdcard_ifc_defconfig             | 1 +
 configs/ls1021atwr_sdcard_qspi_defconfig            | 1 +
 20 files changed, 20 insertions(+)

diff --git a/configs/ls1021aiot_qspi_defconfig b/configs/ls1021aiot_qspi_defconfig
index 5dcec24005..3da1a9ee6e 100644
--- a/configs/ls1021aiot_qspi_defconfig
+++ b/configs/ls1021aiot_qspi_defconfig
@@ -40,3 +40,4 @@ CONFIG_FSL_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aiot_sdcard_defconfig b/configs/ls1021aiot_sdcard_defconfig
index 1e8d49a7b2..4be9591743 100644
--- a/configs/ls1021aiot_sdcard_defconfig
+++ b/configs/ls1021aiot_sdcard_defconfig
@@ -46,3 +46,4 @@ CONFIG_FSL_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_ddr4_nor_defconfig b/configs/ls1021aqds_ddr4_nor_defconfig
index 61855e9b7c..cdf0c803f7 100644
--- a/configs/ls1021aqds_ddr4_nor_defconfig
+++ b/configs/ls1021aqds_ddr4_nor_defconfig
@@ -62,3 +62,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
index 213f2dfb5b..942f1a1488 100644
--- a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
+++ b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
@@ -62,3 +62,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_nand_defconfig b/configs/ls1021aqds_nand_defconfig
index f2aafa9283..ba184b51d2 100644
--- a/configs/ls1021aqds_nand_defconfig
+++ b/configs/ls1021aqds_nand_defconfig
@@ -77,3 +77,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_nor_SECURE_BOOT_defconfig b/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
index 8dcd414c15..ad2f182ece 100644
--- a/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
+++ b/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
@@ -63,3 +63,4 @@ CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_nor_defconfig b/configs/ls1021aqds_nor_defconfig
index 7f42e51263..bb062834a0 100644
--- a/configs/ls1021aqds_nor_defconfig
+++ b/configs/ls1021aqds_nor_defconfig
@@ -63,3 +63,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_nor_lpuart_defconfig b/configs/ls1021aqds_nor_lpuart_defconfig
index b67c24cf64..bbf8b71ffe 100644
--- a/configs/ls1021aqds_nor_lpuart_defconfig
+++ b/configs/ls1021aqds_nor_lpuart_defconfig
@@ -63,3 +63,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_qspi_defconfig b/configs/ls1021aqds_qspi_defconfig
index db74cc5712..5197eab139 100644
--- a/configs/ls1021aqds_qspi_defconfig
+++ b/configs/ls1021aqds_qspi_defconfig
@@ -64,3 +64,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_sdcard_ifc_defconfig b/configs/ls1021aqds_sdcard_ifc_defconfig
index 445eb04508..6abb01a975 100644
--- a/configs/ls1021aqds_sdcard_ifc_defconfig
+++ b/configs/ls1021aqds_sdcard_ifc_defconfig
@@ -75,3 +75,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_sdcard_qspi_defconfig b/configs/ls1021aqds_sdcard_qspi_defconfig
index d12c427e9a..63e6e87bee 100644
--- a/configs/ls1021aqds_sdcard_qspi_defconfig
+++ b/configs/ls1021aqds_sdcard_qspi_defconfig
@@ -76,3 +76,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atsn_qspi_defconfig b/configs/ls1021atsn_qspi_defconfig
index 37dcc9171b..d20996752f 100644
--- a/configs/ls1021atsn_qspi_defconfig
+++ b/configs/ls1021atsn_qspi_defconfig
@@ -52,3 +52,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atsn_sdcard_defconfig b/configs/ls1021atsn_sdcard_defconfig
index ab65060c4d..bda35723ed 100644
--- a/configs/ls1021atsn_sdcard_defconfig
+++ b/configs/ls1021atsn_sdcard_defconfig
@@ -64,3 +64,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_nor_SECURE_BOOT_defconfig b/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
index 0770836208..3ed74d7139 100644
--- a/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
@@ -58,3 +58,4 @@ CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_nor_defconfig b/configs/ls1021atwr_nor_defconfig
index a5aaa9a350..afa55a2d16 100644
--- a/configs/ls1021atwr_nor_defconfig
+++ b/configs/ls1021atwr_nor_defconfig
@@ -58,3 +58,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_nor_lpuart_defconfig b/configs/ls1021atwr_nor_lpuart_defconfig
index fe0f6c4052..487822b857 100644
--- a/configs/ls1021atwr_nor_lpuart_defconfig
+++ b/configs/ls1021atwr_nor_lpuart_defconfig
@@ -59,3 +59,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_qspi_defconfig b/configs/ls1021atwr_qspi_defconfig
index 0e2525fd71..b067981e29 100644
--- a/configs/ls1021atwr_qspi_defconfig
+++ b/configs/ls1021atwr_qspi_defconfig
@@ -62,3 +62,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
index 906f0b6e3c..91ced282a4 100644
--- a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
@@ -70,3 +70,4 @@ CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_sdcard_ifc_defconfig b/configs/ls1021atwr_sdcard_ifc_defconfig
index f07820a705..f5f5574dcb 100644
--- a/configs/ls1021atwr_sdcard_ifc_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_defconfig
@@ -70,3 +70,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_sdcard_qspi_defconfig b/configs/ls1021atwr_sdcard_qspi_defconfig
index 7a9c877c74..e5f95ff975 100644
--- a/configs/ls1021atwr_sdcard_qspi_defconfig
+++ b/configs/ls1021atwr_sdcard_qspi_defconfig
@@ -73,3 +73,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_I2C=y
-- 
2.17.1

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

* [U-Boot] [PATCH 31/42] include/configs: arm: ls1021a: fix compilation error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (28 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 30/42] configs: arm: ls1021a: enable CONFIG_DM_I2C Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 32/42] board: freescale: ls1021atwr: support dm_i2c_* API Biwen Li
                   ` (11 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes compilation error as follows:
	- In file included from include/config.h:9:0,
			 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  In file included from include/config.h:9:0,
			 from ./include/common.h:23:
	  include/config_fallbacks.h:51:4: error: #error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
	    ^~~~~
	  scripts/Makefile.autoconf:48: recipe for target include/autoconf.mk.dep failed
	  make[1]: *** [include/autoconf.mk.dep] Error 1
	  make[1]: *** Waiting for unfinished jobs....
	  scripts/Makefile.autoconf:77: recipe for target u-boot.cfg failed
	  make[1]: *** [u-boot.cfg] Error 1
	  make: *** No rule to make target include/config/auto.conf, needed by include/config/uboot.release.  Stop.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1021aiot.h | 3 +++
 include/configs/ls1021aqds.h | 2 ++
 include/configs/ls1021atsn.h | 2 ++
 include/configs/ls1021atwr.h | 2 ++
 4 files changed, 9 insertions(+)

diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index ee570bc1a9..6ffd903a8d 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -97,7 +97,10 @@
  * I2C
  */
 #define CONFIG_CMD_I2C
+
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 66771e279b..a15d9a1910 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -331,7 +331,9 @@ unsigned long get_board_ddr_clk(void);
 /*
  * I2C
  */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
diff --git a/include/configs/ls1021atsn.h b/include/configs/ls1021atsn.h
index b011cb2a84..6b67cb3276 100644
--- a/include/configs/ls1021atsn.h
+++ b/include/configs/ls1021atsn.h
@@ -107,7 +107,9 @@
 #define CONFIG_BAUDRATE			115200
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 1363d3084d..1115e00b65 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -209,7 +209,9 @@
 /*
  * I2C
  */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
-- 
2.17.1

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

* [U-Boot] [PATCH 32/42] board: freescale: ls1021atwr: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (29 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 31/42] include/configs: arm: ls1021a: fix compilation error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 33/42] configs: arm: ls1021a: fix compilation error Biwen Li
                   ` (10 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to fix compilation error
when enable CONFIG_DM_I2C as follows:
	- board/freescale/ls1021atwr/built-in.o: In function `ls1twr_program_regulator:
	  board/freescale/ls1021atwr/ls1021atwr.c:469: undefined reference to
	  `i2c_get_bus_num'
	  board/freescale/ls1021atwr/ls1021atwr.c:470: undefined reference to
	  `i2c_set_bus_num'
	  board/freescale/ls1021atwr/ls1021atwr.c:471: undefined reference to
	  `i2c_reg_read'
	  board/freescale/ls1021atwr/ls1021atwr.c:478: undefined reference to
	  `i2c_reg_write'
	  board/freescale/ls1021atwr/ls1021atwr.c:479: undefined reference to
	  `i2c_reg_write'
	  board/freescale/ls1021atwr/ls1021atwr.c:480: undefined reference to
	  `i2c_reg_write'
	  board/freescale/ls1021atwr/ls1021atwr.c:481: undefined reference to
	  `i2c_reg_write'
	  board/freescale/ls1021atwr/ls1021atwr.c:482: undefined reference to
	  `i2c_reg_write'
	  board/freescale/ls1021atwr/ls1021atwr.c:484: undefined reference to
	  `i2c_set_bus_num'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>

board: freescale: ls1021atwr: remove waring unused variable i2c_bus

This removes waring: unused variable i2c_bus

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1021atwr/ls1021atwr.c | 26 ++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c
index fcf2ec9788..e48da1624b 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -458,14 +458,37 @@ void board_init_f(ulong dummy)
 /* program the regulator (MC34VR500) to support deep sleep */
 void ls1twr_program_regulator(void)
 {
-	unsigned int i2c_bus;
 	u8 i2c_device_id;
 
 #define LS1TWR_I2C_BUS_MC34VR500	1
 #define MC34VR500_ADDR			0x8
 #define MC34VR500_DEVICEID		0x4
 #define MC34VR500_DEVICEID_MASK		0x0f
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+	int ret;
+
+	ret = i2c_get_chip_for_busnum(LS1TWR_I2C_BUS_MC34VR500, MC34VR500_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       LS1TWR_I2C_BUS_MC34VR500);
+		return;
+	}
+	i2c_device_id = dm_i2c_reg_read(dev, 0x0) &
+					MC34VR500_DEVICEID_MASK;
+	if (i2c_device_id != MC34VR500_DEVICEID) {
+		printf("The regulator (MC34VR500) does not exist. The device does not support deep sleep.\n");
+		return;
+	}
 
+	dm_i2c_reg_write(dev, 0x31, 0x4);
+	dm_i2c_reg_write(dev, 0x4d, 0x4);
+	dm_i2c_reg_write(dev, 0x6d, 0x38);
+	dm_i2c_reg_write(dev, 0x6f, 0x37);
+	dm_i2c_reg_write(dev, 0x71, 0x30);
+#else
+	unsigned int i2c_bus;
 	i2c_bus = i2c_get_bus_num();
 	i2c_set_bus_num(LS1TWR_I2C_BUS_MC34VR500);
 	i2c_device_id = i2c_reg_read(MC34VR500_ADDR, 0x0) &
@@ -482,6 +505,7 @@ void ls1twr_program_regulator(void)
 	i2c_reg_write(MC34VR500_ADDR, 0x71, 0x30);
 
 	i2c_set_bus_num(i2c_bus);
+#endif
 }
 #endif
 
-- 
2.17.1

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

* [U-Boot] [PATCH 33/42] configs: arm: ls1021a: fix compilation error
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (30 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 32/42] board: freescale: ls1021atwr: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 34/42] ls1021aqds: dcu: support dm_i2c_* API Biwen Li
                   ` (9 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This fixes compilation error as follows:
	- drivers/i2c/built-in.o: In function `mxc_i2c_probe:
	  drivers/i2c/mxc_i2c.c:924: undefined reference to
	  `gpio_request_by_name_nodev'
	  drivers/i2c/mxc_i2c.c:927: undefined reference to
	  `gpio_request_by_name_nodev'

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 configs/ls1021aiot_qspi_defconfig                   | 1 +
 configs/ls1021aiot_sdcard_defconfig                 | 1 +
 configs/ls1021aqds_ddr4_nor_defconfig               | 1 +
 configs/ls1021aqds_ddr4_nor_lpuart_defconfig        | 1 +
 configs/ls1021aqds_nand_defconfig                   | 1 +
 configs/ls1021aqds_nor_SECURE_BOOT_defconfig        | 1 +
 configs/ls1021aqds_nor_defconfig                    | 1 +
 configs/ls1021aqds_nor_lpuart_defconfig             | 1 +
 configs/ls1021aqds_qspi_defconfig                   | 1 +
 configs/ls1021aqds_sdcard_ifc_defconfig             | 1 +
 configs/ls1021aqds_sdcard_qspi_defconfig            | 1 +
 configs/ls1021atsn_qspi_defconfig                   | 1 +
 configs/ls1021atsn_sdcard_defconfig                 | 1 +
 configs/ls1021atwr_nor_SECURE_BOOT_defconfig        | 1 +
 configs/ls1021atwr_nor_defconfig                    | 1 +
 configs/ls1021atwr_nor_lpuart_defconfig             | 1 +
 configs/ls1021atwr_qspi_defconfig                   | 1 +
 configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 +
 configs/ls1021atwr_sdcard_ifc_defconfig             | 1 +
 configs/ls1021atwr_sdcard_qspi_defconfig            | 1 +
 20 files changed, 20 insertions(+)

diff --git a/configs/ls1021aiot_qspi_defconfig b/configs/ls1021aiot_qspi_defconfig
index 3da1a9ee6e..f1de7aeb70 100644
--- a/configs/ls1021aiot_qspi_defconfig
+++ b/configs/ls1021aiot_qspi_defconfig
@@ -41,3 +41,4 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aiot_sdcard_defconfig b/configs/ls1021aiot_sdcard_defconfig
index 4be9591743..8b613de7af 100644
--- a/configs/ls1021aiot_sdcard_defconfig
+++ b/configs/ls1021aiot_sdcard_defconfig
@@ -47,3 +47,4 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_ddr4_nor_defconfig b/configs/ls1021aqds_ddr4_nor_defconfig
index cdf0c803f7..2891650bd2 100644
--- a/configs/ls1021aqds_ddr4_nor_defconfig
+++ b/configs/ls1021aqds_ddr4_nor_defconfig
@@ -63,3 +63,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
index 942f1a1488..14c3980976 100644
--- a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
+++ b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
@@ -63,3 +63,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_nand_defconfig b/configs/ls1021aqds_nand_defconfig
index ba184b51d2..a9b219448e 100644
--- a/configs/ls1021aqds_nand_defconfig
+++ b/configs/ls1021aqds_nand_defconfig
@@ -78,3 +78,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_nor_SECURE_BOOT_defconfig b/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
index ad2f182ece..3598a537da 100644
--- a/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
+++ b/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
@@ -64,3 +64,4 @@ CONFIG_VIDEO=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_nor_defconfig b/configs/ls1021aqds_nor_defconfig
index bb062834a0..592b6ea44f 100644
--- a/configs/ls1021aqds_nor_defconfig
+++ b/configs/ls1021aqds_nor_defconfig
@@ -64,3 +64,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_nor_lpuart_defconfig b/configs/ls1021aqds_nor_lpuart_defconfig
index bbf8b71ffe..324600c250 100644
--- a/configs/ls1021aqds_nor_lpuart_defconfig
+++ b/configs/ls1021aqds_nor_lpuart_defconfig
@@ -64,3 +64,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_qspi_defconfig b/configs/ls1021aqds_qspi_defconfig
index 5197eab139..be2aef95ac 100644
--- a/configs/ls1021aqds_qspi_defconfig
+++ b/configs/ls1021aqds_qspi_defconfig
@@ -65,3 +65,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_sdcard_ifc_defconfig b/configs/ls1021aqds_sdcard_ifc_defconfig
index 6abb01a975..bb634795ff 100644
--- a/configs/ls1021aqds_sdcard_ifc_defconfig
+++ b/configs/ls1021aqds_sdcard_ifc_defconfig
@@ -76,3 +76,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021aqds_sdcard_qspi_defconfig b/configs/ls1021aqds_sdcard_qspi_defconfig
index 63e6e87bee..0ac771d91b 100644
--- a/configs/ls1021aqds_sdcard_qspi_defconfig
+++ b/configs/ls1021aqds_sdcard_qspi_defconfig
@@ -77,3 +77,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atsn_qspi_defconfig b/configs/ls1021atsn_qspi_defconfig
index d20996752f..f8ee153770 100644
--- a/configs/ls1021atsn_qspi_defconfig
+++ b/configs/ls1021atsn_qspi_defconfig
@@ -53,3 +53,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atsn_sdcard_defconfig b/configs/ls1021atsn_sdcard_defconfig
index bda35723ed..5a4c5e62a4 100644
--- a/configs/ls1021atsn_sdcard_defconfig
+++ b/configs/ls1021atsn_sdcard_defconfig
@@ -65,3 +65,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_nor_SECURE_BOOT_defconfig b/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
index 3ed74d7139..68f5ed9847 100644
--- a/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
@@ -59,3 +59,4 @@ CONFIG_VIDEO=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_nor_defconfig b/configs/ls1021atwr_nor_defconfig
index afa55a2d16..88462493a5 100644
--- a/configs/ls1021atwr_nor_defconfig
+++ b/configs/ls1021atwr_nor_defconfig
@@ -59,3 +59,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_nor_lpuart_defconfig b/configs/ls1021atwr_nor_lpuart_defconfig
index 487822b857..5ec13aaafd 100644
--- a/configs/ls1021atwr_nor_lpuart_defconfig
+++ b/configs/ls1021atwr_nor_lpuart_defconfig
@@ -60,3 +60,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_qspi_defconfig b/configs/ls1021atwr_qspi_defconfig
index b067981e29..82339c98cf 100644
--- a/configs/ls1021atwr_qspi_defconfig
+++ b/configs/ls1021atwr_qspi_defconfig
@@ -63,3 +63,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
index 91ced282a4..0c0d3b17bd 100644
--- a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
@@ -71,3 +71,4 @@ CONFIG_VIDEO=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_sdcard_ifc_defconfig b/configs/ls1021atwr_sdcard_ifc_defconfig
index f5f5574dcb..a95a15d2ba 100644
--- a/configs/ls1021atwr_sdcard_ifc_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_defconfig
@@ -71,3 +71,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
diff --git a/configs/ls1021atwr_sdcard_qspi_defconfig b/configs/ls1021atwr_sdcard_qspi_defconfig
index e5f95ff975..4d49f370a7 100644
--- a/configs/ls1021atwr_sdcard_qspi_defconfig
+++ b/configs/ls1021atwr_sdcard_qspi_defconfig
@@ -74,3 +74,4 @@ CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
-- 
2.17.1

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

* [U-Boot] [PATCH 34/42] ls1021aqds: dcu: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (31 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 33/42] configs: arm: ls1021a: fix compilation error Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 35/42] board: freescale: ls1021aqds: " Biwen Li
                   ` (8 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to fix
compilation error when enabled CONFIG_DM_I2C
as follows:
	- board/freescale/ls1021aqds/built-in.o: In function `platform_dcu_init:
	  board/freescale/ls1021aqds/dcu.c:54: undefined reference to `i2c_read'
	  board/freescale/ls1021aqds/dcu.c:63: undefined reference to
	  `i2c_write'
	  board/freescale/ls1021aqds/dcu.c:79: undefined reference to
	  `i2c_set_bus_num'
  `
Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1021aqds/dcu.c | 43 +++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)

diff --git a/board/freescale/ls1021aqds/dcu.c b/board/freescale/ls1021aqds/dcu.c
index c4eac5e302..48953d3b31 100644
--- a/board/freescale/ls1021aqds/dcu.c
+++ b/board/freescale/ls1021aqds/dcu.c
@@ -15,11 +15,23 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int select_i2c_ch_pca9547(u8 ch)
+static int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
 	int ret;
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
 
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return ret;
+	}
+	ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
 	ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
 	if (ret) {
 		puts("PCA: failed to select proper channel\n");
 		return ret;
@@ -51,6 +63,28 @@ int platform_dcu_init(struct fb_info *fbinfo,
 	u8 ch;
 
 	/* Mux I2C3+I2C4 as HSYNC+VSYNC */
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+
+	/* QIXIS device mount on I2C1 bus*/
+	ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_QIXIS_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       0);
+		return ret;
+	}
+	ret = dm_i2c_read(dev, QIXIS_DCU_BRDCFG5, &ch, 1);
+	if (ret) {
+		printf("Error: failed to read I2C @%02x\n",
+		       CONFIG_SYS_I2C_QIXIS_ADDR);
+		return ret;
+	}
+	ch &= 0x1F;
+	ch |= 0xA0;
+	ret = dm_i2c_write(dev, QIXIS_DCU_BRDCFG5, &ch, 1);
+
+#else
 	ret = i2c_read(CONFIG_SYS_I2C_QIXIS_ADDR, QIXIS_DCU_BRDCFG5,
 		       1, &ch, 1);
 	if (ret) {
@@ -62,6 +96,7 @@ int platform_dcu_init(struct fb_info *fbinfo,
 	ch |= 0xA0;
 	ret = i2c_write(CONFIG_SYS_I2C_QIXIS_ADDR, QIXIS_DCU_BRDCFG5,
 			1, &ch, 1);
+#endif
 	if (ret) {
 		printf("Error: failed to write I2C @%02x\n",
 		       CONFIG_SYS_I2C_QIXIS_ADDR);
@@ -76,10 +111,12 @@ int platform_dcu_init(struct fb_info *fbinfo,
 		pixval = 1000000000 / dcu_fb_videomode->pixclock;
 		pixval *= 1000;
 
+#ifndef CONFIG_DM_I2C
 		i2c_set_bus_num(CONFIG_SYS_I2C_DVI_BUS_NUM);
-		select_i2c_ch_pca9547(I2C_MUX_CH_CH7301);
+#endif
+		select_i2c_ch_pca9547(I2C_MUX_CH_CH7301, CONFIG_SYS_I2C_DVI_BUS_NUM);
 		diu_set_dvi_encoder(pixval);
-		select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+		select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, CONFIG_SYS_I2C_DVI_BUS_NUM);
 	} else {
 		return 0;
 	}
-- 
2.17.1

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

* [U-Boot] [PATCH 35/42] board: freescale: ls1021aqds: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (32 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 34/42] ls1021aqds: dcu: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 36/42] include/configs: ls1021atwr: i2c: do not define DM_I2C for spl Biwen Li
                   ` (7 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API
to fix compilation error when
enabled CONFIG_DM_I2C as follows:
	- board/freescale/ls1021aqds/built-in.o: In function `select_i2c_ch_pca9547:
	  board/freescale/ls1021aqds/ls1021aqds.c:144: undefined reference to
	  `i2c_write'`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/ls1021aqds/ls1021aqds.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c
index 2ca2bd9909..a3168649ff 100644
--- a/board/freescale/ls1021aqds/ls1021aqds.c
+++ b/board/freescale/ls1021aqds/ls1021aqds.c
@@ -137,11 +137,23 @@ unsigned long get_board_ddr_clk(void)
 	return 66666666;
 }
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
 	int ret;
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
 
+	ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       bus_num);
+		return ret;
+	}
+	ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
 	ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
 	if (ret) {
 		puts("PCA: failed to select proper channel\n");
 		return ret;
@@ -156,8 +168,10 @@ int dram_init(void)
 	 * When resuming from deep sleep, the I2C channel may not be
 	 * in the default channel. So, switch to the default channel
 	 * before accessing DDR SPD.
+	 *
+	 * PCA9547(0x77) mount on I2C1 bus
 	 */
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 	return fsl_initdram();
 }
 
@@ -419,7 +433,7 @@ int board_init(void)
 	erratum_a009942_check_cpo();
 #endif
 
-	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
 #ifndef CONFIG_SYS_FSL_NO_SERDES
 	fsl_serdes_init();
-- 
2.17.1

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

* [U-Boot] [PATCH 36/42] include/configs: ls1021atwr: i2c: do not define DM_I2C for spl
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (33 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 35/42] board: freescale: ls1021aqds: " Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 37/42] video: dcu: support dm_i2c_* API Biwen Li
                   ` (6 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This is used to fix compilation error
as follows(make ls1021atwr_sdcard_ifc_SECURE_BOOT):
	- LD spl/u-boot-spl
	  drivers/built-in.o: In function `mxc_i2c_probe:
	  drivers/i2c/mxc_i2c.c:920: undefined reference to
	  `fdt_stringlist_search'
	  drivers/i2c/mxc_i2c.c:924: undefined reference to
	  `gpio_request_by_name_nodev'
	  drivers/i2c/mxc_i2c.c:927: undefined reference to
	  `gpio_request_by_name_nodev'
	  scripts/Makefile.spl:404: recipe for target 'spl/u-boot-spl' failed
	  make[1]: *** [spl/u-boot-spl] Error 1
	  Makefile:1762: recipe for target 'spl/u-boot-spl' failed
	  make: *** [spl/u-boot-spl] Error 2`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 include/configs/ls1021atwr.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 1115e00b65..d74b2e2bb9 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -448,6 +448,7 @@
 
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
+#undef CONFIG_DM_I2C
 #else
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE    /* start of monitor */
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 37/42] video: dcu: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (34 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 36/42] include/configs: ls1021atwr: i2c: do not define DM_I2C for spl Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 38/42] board: freescale: common: diu_ch7301: " Biwen Li
                   ` (5 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to fix compilation error
as follows:
	- board/freescale/common/built-in.o: In function `dcu_set_dvi_encoder:
	  board/freescale/common/dcu_sii9022a.c:67: undefined reference
	  to `i2c_set_bus_num'
	  board/freescale/common/dcu_sii9022a.c:71: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:74: undefined reference
	  to `i2c_read'
	  board/freescale/common/dcu_sii9022a.c:77: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:81: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:83: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:85: undefined reference
	  to `i2c_read'
	  board/freescale/common/dcu_sii9022a.c:87: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:91: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:96: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:98: undefined reference
	  to `i2c_write'
	  board/freescale/common/dcu_sii9022a.c:104: undefined reference
	  to `i2c_write

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/common/dcu_sii9022a.c | 94 +++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/board/freescale/common/dcu_sii9022a.c b/board/freescale/common/dcu_sii9022a.c
index 3bf71abf55..736b689e08 100644
--- a/board/freescale/common/dcu_sii9022a.c
+++ b/board/freescale/common/dcu_sii9022a.c
@@ -63,7 +63,100 @@ int dcu_set_dvi_encoder(struct fb_videomode *videomode)
 	u8 temp;
 	u16 temp1, temp2;
 	u32 temp3;
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+	int ret;
+
+	ret = i2c_get_chip_for_busnum(CONFIG_SYS_I2C_DVI_BUS_NUM, CONFIG_SYS_I2C_DVI_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       CONFIG_SYS_I2C_DVI_BUS_NUM);
+		return ret;
+	}
 
+	/* Enable TPI transmitter mode */
+	temp = TPI_TRANS_MODE_ENABLE;
+	dm_i2c_write(dev, TPI_TRANS_MODE_REG, &temp, 1);
+
+	/* Enter into D0 state, full operation */
+	dm_i2c_read(dev, TPI_PWR_STAT_REG, &temp, 1);
+	temp &= ~TPI_PWR_STAT_MASK;
+	temp |= TPI_PWR_STAT_D0;
+	dm_i2c_write(dev, TPI_PWR_STAT_REG, &temp, 1);
+
+	/* Enable source termination */
+	temp = TPI_SET_PAGE_SII9022A;
+	dm_i2c_write(dev, TPI_SET_PAGE_REG, &temp, 1);
+	temp = TPI_SET_OFFSET_SII9022A;
+	dm_i2c_write(dev, TPI_SET_OFFSET_REG, &temp, 1);
+
+	dm_i2c_read(dev, TPI_RW_ACCESS_REG, &temp, 1);
+	temp |= TPI_RW_EN_SRC_TERMIN;
+	dm_i2c_write(dev, TPI_RW_ACCESS_REG, &temp, 1);
+
+	/* Set TPI system control */
+	temp = TPI_SYS_TMDS_OUTPUT | TPI_SYS_AV_NORAML | TPI_SYS_DVI_MODE;
+	dm_i2c_write(dev, TPI_SYS_CTRL_REG, &temp, 1);
+
+	/* Set pixel clock */
+	temp1 = PICOS2KHZ(videomode->pixclock) / 10;
+	temp = (u8)(temp1 & 0xFF);
+	dm_i2c_write(dev, PIXEL_CLK_LSB_REG, &temp, 1);
+	temp = (u8)(temp1 >> 8);
+	dm_i2c_write(dev, PIXEL_CLK_MSB_REG, &temp, 1);
+
+	/* Set total pixels per line */
+	temp1 = videomode->hsync_len + videomode->left_margin +
+		videomode->xres + videomode->right_margin;
+	temp = (u8)(temp1 & 0xFF);
+	dm_i2c_write(dev, TOTAL_PIXELS_LSB_REG, &temp, 1);
+	temp = (u8)(temp1 >> 8);
+	dm_i2c_write(dev, TOTAL_PIXELS_MSB_REG, &temp, 1);
+
+	/* Set total lines */
+	temp2 = videomode->vsync_len + videomode->upper_margin +
+		videomode->yres + videomode->lower_margin;
+	temp = (u8)(temp2 & 0xFF);
+	dm_i2c_write(dev, TOTAL_LINES_LSB_REG, &temp, 1);
+	temp = (u8)(temp2 >> 8);
+	dm_i2c_write(dev, TOTAL_LINES_MSB_REG, &temp, 1);
+
+	/* Set vertical frequency in Hz */
+	temp3 = temp1 * temp2;
+	temp3 = (PICOS2KHZ(videomode->pixclock) * 1000) / temp3;
+	temp1 = (u16)temp3 * 100;
+	temp = (u8)(temp1 & 0xFF);
+	dm_i2c_write(dev, VERT_FREQ_LSB_REG, &temp, 1);
+	temp = (u8)(temp1 >> 8);
+	dm_i2c_write(dev, VERT_FREQ_MSB_REG, &temp, 1);
+
+	/* Set TPI input bus and pixel repetition data */
+	temp = TPI_INBUS_CLOCK_RATIO_1 | TPI_INBUS_FULL_PIXEL_WIDE |
+		TPI_INBUS_RISING_EDGE;
+	dm_i2c_write(dev, TPI_INBUS_FMT_REG, &temp, 1);
+
+	/* Set TPI AVI Input format data */
+	temp = TPI_INPUT_CLR_DEPTH_8BIT | TPI_INPUT_VRANGE_EXPAN_AUTO |
+		TPI_INPUT_CLR_RGB;
+	dm_i2c_write(dev, TPI_INPUT_FMT_REG, &temp, 1);
+
+	/* Set TPI AVI Output format data */
+	temp = TPI_OUTPUT_CLR_DEPTH_8BIT | TPI_OUTPUT_VRANGE_COMPRE_AUTO |
+		TPI_OUTPUT_CLR_HDMI_RGB;
+	dm_i2c_write(dev, TPI_OUTPUT_FMT_REG, &temp, 1);
+
+	/* Set TPI audio configuration write data */
+	temp = TPI_AUDIO_PASS_BASIC;
+	dm_i2c_write(dev, TPI_AUDIO_HANDING_REG, &temp, 1);
+
+	temp = TPI_AUDIO_INTF_I2S | TPI_AUDIO_INTF_NORMAL |
+		TPI_AUDIO_TYPE_PCM;
+	dm_i2c_write(dev, TPI_AUDIO_INTF_REG, &temp, 1);
+
+	temp = TPI_AUDIO_SAMP_SIZE_16BIT | TPI_AUDIO_SAMP_FREQ_44K;
+	dm_i2c_write(dev, TPI_AUDIO_FREQ_REG, &temp, 1);
+#else
 	i2c_set_bus_num(CONFIG_SYS_I2C_DVI_BUS_NUM);
 
 	/* Enable TPI transmitter mode */
@@ -147,6 +240,7 @@ int dcu_set_dvi_encoder(struct fb_videomode *videomode)
 
 	temp = TPI_AUDIO_SAMP_SIZE_16BIT | TPI_AUDIO_SAMP_FREQ_44K;
 	i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_AUDIO_FREQ_REG, 1, &temp, 1);
+#endif
 
 	return 0;
 }
-- 
2.17.1

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

* [U-Boot] [PATCH 38/42] board: freescale: common: diu_ch7301: support dm_i2c_* API
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (35 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 37/42] video: dcu: support dm_i2c_* API Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 39/42] rtc: pcf8563: support driver model Biwen Li
                   ` (4 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports dm_i2c_* API to
fix compilation error as follows:
	- board/freescale/common/built-in.o: In function `diu_set_dvi_encoder:
	  board/freescale/common/diu_ch7301.c:54: undefined reference to
	  `i2c_write'
	  board/freescale/common/diu_ch7301.c:61: undefined reference to
	  `i2c_write'
	  board/freescale/common/diu_ch7301.c:70: undefined reference to
	  `i2c_write'
	  board/freescale/common/diu_ch7301.c:80: undefined reference to
	  `i2c_write'
	  board/freescale/common/diu_ch7301.c:87: undefined reference to
	  `i2c_write'
	  board/freescale/common/diu_ch7301.c:102: more undefined
	  references to `i2c_write' follow

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 board/freescale/common/diu_ch7301.c | 79 +++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/board/freescale/common/diu_ch7301.c b/board/freescale/common/diu_ch7301.c
index 435b4a3f1a..64682f7cd5 100644
--- a/board/freescale/common/diu_ch7301.c
+++ b/board/freescale/common/diu_ch7301.c
@@ -51,6 +51,84 @@ int diu_set_dvi_encoder(unsigned int pixclock)
 	u8 temp;
 
 	temp = I2C_DVI_TEST_PATTERN_VAL;
+#ifdef CONFIG_DM_I2C
+	struct udevice *dev;
+
+	ret = i2c_get_chip_for_busnum(CONFIG_SYS_I2C_DVI_BUS_NUM, CONFIG_SYS_I2C_DVI_ADDR,
+				      1, &dev);
+	if (ret) {
+		printf("%s: Cannot find udev for a bus %d\n", __func__,
+		       CONFIG_SYS_I2C_DVI_BUS_NUM);
+		return ret;
+	}
+	ret = dm_i2c_write(dev, I2C_DVI_TEST_PATTERN_REG, &temp, 1);
+	if (ret) {
+		puts("I2C: failed to select proper dvi test pattern\n");
+		return ret;
+	}
+	temp = I2C_DVI_INPUT_DATA_FORMAT_VAL;
+	ret = dm_i2c_write(dev, I2C_DVI_INPUT_DATA_FORMAT_REG, &temp, 1);
+	if (ret) {
+		puts("I2C: failed to select dvi input data format\n");
+		return ret;
+	}
+
+	/* Set Sync polarity register */
+	temp = I2C_DVI_SYNC_POLARITY_VAL;
+	ret = dm_i2c_write(dev, I2C_DVI_SYNC_POLARITY_REG, &temp, 1);
+	if (ret) {
+		puts("I2C: failed to select dvi syc polarity\n");
+		return ret;
+	}
+
+	/* Set PLL registers based on pixel clock rate*/
+	if (pixclock > 65000000) {
+		temp = I2C_DVI_PLL_CHARGE_CNTL_HIGH_SPEED_VAL;
+		ret = dm_i2c_write(dev, I2C_DVI_PLL_CHARGE_CNTL_REG, &temp, 1);
+		if (ret) {
+			puts("I2C: failed to select dvi pll charge_cntl\n");
+			return ret;
+		}
+		temp = I2C_DVI_PLL_DIVIDER_HIGH_SPEED_VAL;
+		ret = dm_i2c_write(dev, I2C_DVI_PLL_DIVIDER_REG, &temp, 1);
+		if (ret) {
+			puts("I2C: failed to select dvi pll divider\n");
+			return ret;
+		}
+		temp = I2C_DVI_PLL_FILTER_HIGH_SPEED_VAL;
+		ret = dm_i2c_write(dev, I2C_DVI_PLL_FILTER_REG, &temp, 1);
+		if (ret) {
+			puts("I2C: failed to select dvi pll filter\n");
+			return ret;
+		}
+	} else {
+		temp = I2C_DVI_PLL_CHARGE_CNTL_LOW_SPEED_VAL;
+		ret = dm_i2c_write(dev, I2C_DVI_PLL_CHARGE_CNTL_REG, &temp, 1);
+		if (ret) {
+			puts("I2C: failed to select dvi pll charge_cntl\n");
+			return ret;
+		}
+		temp = I2C_DVI_PLL_DIVIDER_LOW_SPEED_VAL;
+		ret = dm_i2c_write(dev, I2C_DVI_PLL_DIVIDER_REG, &temp, 1);
+		if (ret) {
+			puts("I2C: failed to select dvi pll divider\n");
+			return ret;
+		}
+		temp = I2C_DVI_PLL_FILTER_LOW_SPEED_VAL;
+		ret = dm_i2c_write(dev, I2C_DVI_PLL_FILTER_REG, &temp, 1);
+		if (ret) {
+			puts("I2C: failed to select dvi pll filter\n");
+			return ret;
+		}
+	}
+
+	temp = I2C_DVI_POWER_MGMT_VAL;
+	ret = dm_i2c_write(dev, I2C_DVI_POWER_MGMT_REG, &temp, 1);
+	if (ret) {
+		puts("I2C: failed to select dvi power mgmt\n");
+		return ret;
+	}
+#else
 	ret = i2c_write(CONFIG_SYS_I2C_DVI_ADDR, I2C_DVI_TEST_PATTERN_REG, 1,
 			&temp, 1);
 	if (ret) {
@@ -128,6 +206,7 @@ int diu_set_dvi_encoder(unsigned int pixclock)
 		puts("I2C: failed to select dvi power mgmt\n");
 		return ret;
 	}
+#endif
 
 	udelay(500);
 
-- 
2.17.1

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

* [U-Boot] [PATCH 39/42] rtc: pcf8563: support driver model
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (36 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 38/42] board: freescale: common: diu_ch7301: " Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 40/42] armv8: fsl-layerscape: spl: fix build error when enabled CONFIG_DM_I2C Biwen Li
                   ` (3 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This supports driver model to
drop warning as follows:
- drivers/rtc/pcf8563.c: In function rtc_read:
  drivers/rtc/pcf8563.c:111:10: warning: implicit declaration of function i2c_reg_read; did you mean dm_i2c_reg_read? [-Wimplicit-function-declaration
  drivers/rtc/pcf8563.c: In function rtc_write:
  drivers/rtc/pcf8563.c:116:2: warning: implicit declaration of function i2c_reg_write; did you mean dm_i2c_reg_write? [-Wimplicit-function-declaration]

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 drivers/rtc/pcf8563.c | 107 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/drivers/rtc/pcf8563.c b/drivers/rtc/pcf8563.c
index a839d6cc98..44204e133e 100644
--- a/drivers/rtc/pcf8563.c
+++ b/drivers/rtc/pcf8563.c
@@ -12,9 +12,11 @@
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
 #include <rtc.h>
 #include <i2c.h>
 
+#if !CONFIG_IS_ENABLED(DM_RTC)
 static uchar rtc_read  (uchar reg);
 static void  rtc_write (uchar reg, uchar val);
 
@@ -115,3 +117,108 @@ static void rtc_write (uchar reg, uchar val)
 {
 	i2c_reg_write (CONFIG_SYS_I2C_RTC_ADDR, reg, val);
 }
+#else
+static int pcf8563_rtc_get(struct udevice *dev, struct rtc_time *tmp)
+{
+	int rel = 0;
+	uchar sec, min, hour, mday, wday, mon_cent, year;
+
+	sec	= dm_i2c_reg_read(dev, 0x02);
+	min	= dm_i2c_reg_read(dev, 0x03);
+	hour	= dm_i2c_reg_read(dev, 0x04);
+	mday	= dm_i2c_reg_read(dev, 0x05);
+	wday	= dm_i2c_reg_read(dev, 0x06);
+	mon_cent = dm_i2c_reg_read(dev, 0x07);
+	year	= dm_i2c_reg_read(dev, 0x08);
+
+	debug ("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x "
+	       "hr: %02x min: %02x sec: %02x\n",
+	       year, mon_cent, mday, wday,
+	       hour, min, sec);
+	debug ("Alarms: wday: %02x day: %02x hour: %02x min: %02x\n",
+	       dm_i2c_reg_read(dev, 0x0C),
+	       dm_i2c_reg_read(dev, 0x0B),
+	       dm_i2c_reg_read(dev, 0x0A),
+	       dm_i2c_reg_read(dev, 0x09));
+
+	if (sec & 0x80) {
+		puts ("### Warning: RTC Low Voltage - date/time not reliable\n");
+		rel = -1;
+	}
+
+	tmp->tm_sec = bcd2bin (sec & 0x7F);
+	tmp->tm_min = bcd2bin (min & 0x7F);
+	tmp->tm_hour = bcd2bin (hour & 0x3F);
+	tmp->tm_mday = bcd2bin (mday & 0x3F);
+	tmp->tm_mon = bcd2bin (mon_cent & 0x1F);
+	tmp->tm_year = bcd2bin (year) + ((mon_cent & 0x80) ? 1900 : 2000);
+	tmp->tm_wday = bcd2bin (wday & 0x07);
+	tmp->tm_yday = 0;
+	tmp->tm_isdst = 0;
+
+	debug ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+	       tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+	       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+	return rel;
+}
+
+static int pcf8563_rtc_set(struct udevice *dev, const struct rtc_time *tmp)
+{
+	uchar century;
+
+	debug ("Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+	       tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+	       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+	dm_i2c_reg_write(dev, 0x08, bin2bcd(tmp->tm_year % 100));
+
+	century = (tmp->tm_year >= 2000) ? 0 : 0x80;
+	dm_i2c_reg_write(dev, 0x07, bin2bcd(tmp->tm_mon) | century);
+
+	dm_i2c_reg_write(dev, 0x06, bin2bcd(tmp->tm_wday));
+	dm_i2c_reg_write(dev, 0x05, bin2bcd(tmp->tm_mday));
+	dm_i2c_reg_write(dev, 0x04, bin2bcd(tmp->tm_hour));
+	dm_i2c_reg_write(dev, 0x03, bin2bcd(tmp->tm_min));
+	dm_i2c_reg_write(dev, 0x02, bin2bcd(tmp->tm_sec));
+
+	return 0;
+}
+
+static int pcf8563_rtc_reset(struct udevice *dev)
+{
+	/* clear all control & status registers */
+	dm_i2c_reg_write(dev, 0x00, 0x00);
+	dm_i2c_reg_write(dev, 0x01, 0x00);
+	dm_i2c_reg_write(dev, 0x0D, 0x00);
+
+	/* clear Voltage Low bit */
+	dm_i2c_reg_write(dev, 0x02, dm_i2c_reg_read (dev, 0x02) & 0x7F);
+
+	/* reset all alarms */
+	dm_i2c_reg_write(dev, 0x09, 0x00);
+	dm_i2c_reg_write(dev, 0x0A, 0x00);
+	dm_i2c_reg_write(dev, 0x0B, 0x00);
+	dm_i2c_reg_write(dev, 0x0C, 0x00);
+
+	return 0;
+}
+
+static const struct rtc_ops pcf8563_rtc_ops = {
+	.get = pcf8563_rtc_get,
+	.set = pcf8563_rtc_set,
+	.reset = pcf8563_rtc_reset,
+};
+
+static const struct udevice_id pcf8563_rtc_ids[] = {
+	{ .compatible = "nxp,pcf8563" },
+	{ }
+};
+
+U_BOOT_DRIVER(rtc_pcf8563) = {
+	.name   = "rtc-pcf8563",
+	.id     = UCLASS_RTC,
+	.of_match = pcf8563_rtc_ids,
+	.ops    = &pcf8563_rtc_ops,
+};
+#endif
-- 
2.17.1

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

* [U-Boot] [PATCH 40/42] armv8: fsl-layerscape: spl: fix build error when enabled CONFIG_DM_I2C
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (37 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 39/42] rtc: pcf8563: support driver model Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 41/42] i2c: mxc_i2c: add DM_FLAG_PRE_RELOC flag Biwen Li
                   ` (2 subsequent siblings)
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This is used to fix build error
as follows:
- arch/arm/cpu/armv8/built-in.o: In function `board_init_f:
  arch/arm/cpu/armv8/fsl-layerscape/spl.c:74: undefined reference to `i2c_init_all'
  arch/arm/cpu/armv8/fsl-layerscape/spl.c:74:(.text.board_init_f+0x30):
  relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
  `i2c_init_all'
  make[2]: *** [spl/u-boot-spl] Error 1
  make[1]: *** [spl/u-boot-spl] Error 2
  make: *** [sub-make] Error 2
  arch/arm/cpu/armv8/fsl-layerscape/spl.c: In function 'board_init_f':
  arch/arm/cpu/armv8/fsl-layerscape/spl.c:74:2: warning: implicit
  declaration of function 'i2c_init_all'; did you mean 'misc_init_r'?
  [-Wimplicit-function-declaration]`

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 arch/arm/cpu/armv8/fsl-layerscape/spl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 3f6a5f6a42..f792db9cd8 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -70,9 +70,11 @@ void board_init_f(ulong dummy)
 	preloader_console_init();
 	spl_set_bd();
 
+#ifdef CONFIG_SYS_I2C
 #ifdef CONFIG_SPL_I2C_SUPPORT
 	i2c_init_all();
 #endif
+#endif
 #ifdef CONFIG_VID
 	init_func_vid();
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 41/42] i2c: mxc_i2c: add DM_FLAG_PRE_RELOC flag
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (38 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 40/42] armv8: fsl-layerscape: spl: fix build error when enabled CONFIG_DM_I2C Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-14 10:36 ` [U-Boot] [PATCH 42/42] Kconfigs: layerscape: use a convenient default value for SYS_MALLOC_F_LEN Biwen Li
  2019-11-15  5:06 ` [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Priyanka Jain
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

This adds DM_FLAG_PRE_RELOC flag to probe i2c driver
before relocation

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 drivers/i2c/mxc_i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 786b5a2226..6b7ce985b3 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -1049,5 +1049,6 @@ U_BOOT_DRIVER(i2c_mxc) = {
 	.probe = mxc_i2c_probe,
 	.priv_auto_alloc_size = sizeof(struct mxc_i2c_bus),
 	.ops = &mxc_i2c_ops,
+	.flags = DM_FLAG_PRE_RELOC,
 };
 #endif
-- 
2.17.1

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

* [U-Boot] [PATCH 42/42] Kconfigs: layerscape: use a convenient default value for SYS_MALLOC_F_LEN
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (39 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 41/42] i2c: mxc_i2c: add DM_FLAG_PRE_RELOC flag Biwen Li
@ 2019-11-14 10:36 ` Biwen Li
  2019-11-15  5:06 ` [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Priyanka Jain
  41 siblings, 0 replies; 49+ messages in thread
From: Biwen Li @ 2019-11-14 10:36 UTC (permalink / raw)
  To: u-boot

The default value of CONFIG_SYS_MALLOC_F_LEN (0x400)
leaves U-Boot with not enough memory to do this,
causing it to hang.

Fix this problem by providing a convenient default value
for CONFIG_SYS_MALLOC_F_LEN.

Relative SoC:
- LS1012A
- LS1021A
- LS1043A
- LS1046A

Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
 Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Kconfig b/Kconfig
index cda4f58ff7..1aae7a680b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -146,7 +146,9 @@ config SYS_MALLOC_F_LEN
 	default 0x1000 if AM33XX
 	default 0x2800 if SANDBOX
 	default 0x2000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_MX7 || \
-			   ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5)
+			   ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
+			   ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
+			   ARCH_LS1046A)
 	default 0x400
 	help
 	  Before relocation, memory is very limited on many platforms. Still,
-- 
2.17.1

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

* [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C
  2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
                   ` (40 preceding siblings ...)
  2019-11-14 10:36 ` [U-Boot] [PATCH 42/42] Kconfigs: layerscape: use a convenient default value for SYS_MALLOC_F_LEN Biwen Li
@ 2019-11-15  5:06 ` Priyanka Jain
  41 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15  5:06 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C
>
>This enables CONFIG_DM_I2C for SoC LS1012A
>
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
>---
> configs/ls1012a2g5rdb_qspi_defconfig           | 1 +
> configs/ls1012a2g5rdb_tfa_defconfig            | 1 +
> configs/ls1012afrdm_qspi_defconfig             | 1 +
> configs/ls1012afrdm_tfa_defconfig              | 1 +
> configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 +
> configs/ls1012afrwy_qspi_defconfig             | 1 +
> configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig  | 1 +
> configs/ls1012afrwy_tfa_defconfig              | 1 +
> configs/ls1012aqds_qspi_defconfig              | 1 +
> configs/ls1012aqds_tfa_SECURE_BOOT_defconfig   | 1 +
> configs/ls1012aqds_tfa_defconfig               | 1 +
> configs/ls1012ardb_qspi_SECURE_BOOT_defconfig  | 1 +
> configs/ls1012ardb_qspi_defconfig              | 1 +
> configs/ls1012ardb_tfa_SECURE_BOOT_defconfig   | 1 +
> configs/ls1012ardb_tfa_defconfig               | 1 +
> 15 files changed, 15 insertions(+)
>
>diff --git a/configs/ls1012a2g5rdb_qspi_defconfig
>b/configs/ls1012a2g5rdb_qspi_defconfig
>index 980fe51404..9dd9f4039a 100644
>--- a/configs/ls1012a2g5rdb_qspi_defconfig
>+++ b/configs/ls1012a2g5rdb_qspi_defconfig
>@@ -47,3 +47,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012a2g5rdb_tfa_defconfig
>b/configs/ls1012a2g5rdb_tfa_defconfig
>index 5b6eeaa626..c554bd5087 100644
>--- a/configs/ls1012a2g5rdb_tfa_defconfig
>+++ b/configs/ls1012a2g5rdb_tfa_defconfig
>@@ -47,3 +47,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012afrdm_qspi_defconfig
>b/configs/ls1012afrdm_qspi_defconfig
>index f0a404929c..2a6a0b6a61 100644
>--- a/configs/ls1012afrdm_qspi_defconfig
>+++ b/configs/ls1012afrdm_qspi_defconfig
>@@ -47,3 +47,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012afrdm_tfa_defconfig
>b/configs/ls1012afrdm_tfa_defconfig
>index 493ae7e410..4fd33c539b 100644
>--- a/configs/ls1012afrdm_tfa_defconfig
>+++ b/configs/ls1012afrdm_tfa_defconfig
>@@ -47,3 +47,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
>b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
>index 8eb25434be..d8fe7e8cf1 100644
>--- a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
>+++ b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
>@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
> CONFIG_RSA=y
> CONFIG_RSA_SOFTWARE_EXP=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012afrwy_qspi_defconfig
>b/configs/ls1012afrwy_qspi_defconfig
>index 312c655569..78c48b5f28 100644
>--- a/configs/ls1012afrwy_qspi_defconfig
>+++ b/configs/ls1012afrwy_qspi_defconfig
>@@ -49,3 +49,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
>b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
>index ff8758434a..919a825209 100644
>--- a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
>+++ b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
>@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
> CONFIG_RSA=y
> CONFIG_RSA_SOFTWARE_EXP=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012afrwy_tfa_defconfig
>b/configs/ls1012afrwy_tfa_defconfig
>index 0a6d5c6d9f..3e7299f683 100644
>--- a/configs/ls1012afrwy_tfa_defconfig
>+++ b/configs/ls1012afrwy_tfa_defconfig
>@@ -51,3 +51,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012aqds_qspi_defconfig
>b/configs/ls1012aqds_qspi_defconfig
>index 91bacf0766..d453c74a3f 100644
>--- a/configs/ls1012aqds_qspi_defconfig
>+++ b/configs/ls1012aqds_qspi_defconfig
>@@ -71,3 +71,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
>b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
>index 2ed38af317..69bf32d98e 100644
>--- a/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
>+++ b/configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
>@@ -65,3 +65,4 @@ CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
> CONFIG_RSA=y
> CONFIG_RSA_SOFTWARE_EXP=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012aqds_tfa_defconfig
>b/configs/ls1012aqds_tfa_defconfig
>index 588432405b..7c71126cd3 100644
>--- a/configs/ls1012aqds_tfa_defconfig
>+++ b/configs/ls1012aqds_tfa_defconfig
>@@ -71,3 +71,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
>b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
>index c7f2780bf5..3e95d56447 100644
>--- a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
>+++ b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
>@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
> CONFIG_RSA=y
> CONFIG_RSA_SOFTWARE_EXP=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012ardb_qspi_defconfig
>b/configs/ls1012ardb_qspi_defconfig
>index b755a29c29..fd2f64f124 100644
>--- a/configs/ls1012ardb_qspi_defconfig
>+++ b/configs/ls1012ardb_qspi_defconfig
>@@ -54,3 +54,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
>b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
>index 6001e193f0..c8873839d6 100644
>--- a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
>+++ b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
>@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
> CONFIG_RSA=y
> CONFIG_RSA_SOFTWARE_EXP=y
>+CONFIG_DM_I2C=y
>diff --git a/configs/ls1012ardb_tfa_defconfig
>b/configs/ls1012ardb_tfa_defconfig
>index ce10c736e7..f6de300476 100644
>--- a/configs/ls1012ardb_tfa_defconfig
>+++ b/configs/ls1012ardb_tfa_defconfig
>@@ -55,3 +55,4 @@ CONFIG_USB=y
> CONFIG_DM_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
>+CONFIG_DM_I2C=y
>--
>2.17.1
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>

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

* [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error
  2019-11-14 10:36 ` [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error Biwen Li
@ 2019-11-15 12:43   ` Priyanka Jain
  0 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15 12:43 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error
>
>This fixes a compilation error as follow:
>	- In file included from include/config.h:9:0,
>                 from ./include/common.h:23:
>	  include/config_fallbacks.h:51:4: error: #error "Cannot define
>CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
>	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is
>used"
>	    ^~~~~
>	  In file included from include/config.h:9:0,
>			 from ./include/common.h:23:
>	  include/config_fallbacks.h:51:4: error: #error "Cannot define
>CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
>	  #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is
>used"
>	    ^~~~~
>	  scripts/Makefile.autoconf:48: recipe for target
>include/autoconf.mk.dep failed
>	  make[1]: *** [include/autoconf.mk.dep] Error 1
>	  make[1]: *** Waiting for unfinished jobs....
>	  scripts/Makefile.autoconf:77: recipe for target u-boot.cfg failed
>	  make[1]: *** [u-boot.cfg] Error 1
>	  make: *** No rule to make target include/config/auto.conf, needed
>by include/config/uboot.release.  Stop.
>
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
>---
> include/configs/ls1012a_common.h | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/include/configs/ls1012a_common.h
>b/include/configs/ls1012a_common.h
>index dd2a679b79..c5be1d33cc 100644
>--- a/include/configs/ls1012a_common.h
>+++ b/include/configs/ls1012a_common.h
>@@ -74,7 +74,9 @@
> 						CONFIG_SYS_SCSI_MAX_LUN)
>
> /* I2C */
>+#ifndef CONFIG_DM_I2C
> #define CONFIG_SYS_I2C
>+#endif
>
> #define CONFIG_SYS_NS16550_SERIAL
> #define CONFIG_SYS_NS16550_REG_SIZE     1
>--
>2.17.1
This error seems to appear because of "configs: ls1012a: enable CONFIG_DM_I2C" patch,
Please merge this with first patch.
Note that all patches should independently compile and should not break builds.

-priyankajain

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

* [U-Boot] [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error
  2019-11-14 10:36 ` [U-Boot] [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error Biwen Li
@ 2019-11-15 12:43   ` Priyanka Jain
  0 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15 12:43 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix
>compilation error
>
>This enables CONFIG_DM_GPIO to fix
>a compilation error as follows:
>	- drivers/i2c/built-in.o: In function `mxc_i2c_probe:
>	  drivers/i2c/mxc_i2c.c:924: undefined reference to
>	  `gpio_request_by_name_nodev'
>	  drivers/i2c/mxc_i2c.c:927: undefined reference to
>	  `gpio_request_by_name_nodev'
>
If this error is introduced by one of your patch. Merge this change with that.
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
<snip>
-priyankajain

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

* [U-Boot] [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A
  2019-11-14 10:36 ` [U-Boot] [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A Biwen Li
@ 2019-11-15 12:43   ` Priyanka Jain
  0 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15 12:43 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for
>ARCH_LS1012A
>
>As no gpio.h is defined for this architecture, to avoid compilation failure, do
>not include <asm/arch/gpio.h> for SoC LS1012A. Compilation error as follows:
>	- In file included from drivers/gpio/gpio-uclass.c:15:0:
>	  ./arch/arm/include/asm/gpio.h:7:10: fatal error: asm/arch/gpio.h: No
>such file or directory
>	  #include <asm/arch/gpio.h>
>          ^~~~~~~~~~~~~~~~~
>	  compilation terminated.
>	  scripts/Makefile.build:278: recipe for target drivers/gpio/gpio-
>uclass.o failed
>	  make[1]: *** [drivers/gpio/gpio-uclass.o] Error 1
>	  Makefile:1629: recipe for target drivers/gpio failed
>	  make: *** [drivers/gpio] Error 2
>	  make: *** Waiting for unfinished jobs....
>	    LD      board/freescale/common/built-in.o
>	    In file included from drivers/i2c/i2c-uclass.c:15:0:
>	    ./arch/arm/include/asm/gpio.h:7:10: fatal error: asm/arch/gpio.h:
>No such file or directory
>	    #include <asm/arch/gpio.h>
>            ^~~~~~~~~~~~~~~~~
>	    compilation terminated.
>
If this compilation error is introduced by one of your patch, merge with that.
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
>---
<snip>

-priyankajain

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

* [U-Boot] [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC
  2019-11-14 10:36 ` [U-Boot] [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC Biwen Li
@ 2019-11-15 12:43   ` Priyanka Jain
  0 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15 12:43 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC
>
>This enables CONFIG_DM_RTC for SoC LS1012A to fix compilation error when
>enabled CONFIG_DM_I2C and CONFIG_CMD_DATE as follows:
>	- cmd/date.c: In function ‘do_date’:
>	  cmd/date.c:51:12: warning: implicit declaration of function
>‘I2C_GET_BUS’; did you mean ‘IDE_BUS’? [-Wimplicit-function-declaration]
>	  old_bus = I2C_GET_BUS();
>		    ^~~~~~~~~~~
>		    IDE_BUS
>	  cmd/date.c:52:2: warning: implicit declaration of function
>‘I2C_SET_BUS’; did you mean ‘IDE_BUS’? [-Wimplicit-function-declaration]
>	  I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM);
>	  ^~~~~~~~~~~
>	  IDE_BUS
>	  LD      drivers/pci/built-in.o
>	  cmd/date.c:52:14: error: ‘CONFIG_SYS_RTC_BUS_NUM’ undeclared
>(first use in this function); did you mean ‘CONFIG_SYS_EEPROM_BUS_NUM’?
>	  I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM);
>		      ^~~~~~~~~~~~~~~~~~~~~~
>		      CONFIG_SYS_EEPROM_BUS_NUM
>	  cmd/date.c:52:14: note: each undeclared identifier is reported only
>once for each function it appears in
>	  scripts/Makefile.build:278: recipe for target cmd/date.o failed
>	  make[1]: *** [cmd/date.o] Error 1
>	  make[1]: *** Waiting for unfinished jobs....
>
If this compilation error is introduced by one of your patch, merge with that.
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
<snip>
-priyankajain

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

* [U-Boot] [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API
  2019-11-14 10:36 ` [U-Boot] [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API Biwen Li
@ 2019-11-15 12:43   ` Priyanka Jain
  0 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15 12:43 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API
>
>This supports dm_i2c_* API to
>fix compilation error when
>enabled CONFIG_DM_I2C as follows:
>	- board/freescale/ls1012aqds/built-in.o: In function `misc_init_r:
>	  board/freescale/ls1012aqds/ls1012aqds.c:111: undefined reference
>to
>	  `i2c_set_bus_num'
>	  board/freescale/ls1012aqds/ls1012aqds.c:113: undefined reference
>to
>	  `i2c_write'
>
If this compilation error is introduced by one of your patch, merge with that.
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
>---
<snip>
-priyankajain

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

* [U-Boot] [PATCH 09/42] include/configs: ls1012a_common: define default i2c bus
  2019-11-14 10:36 ` [U-Boot] [PATCH 09/42] include/configs: ls1012a_common: define default i2c bus Biwen Li
@ 2019-11-15 12:43   ` Priyanka Jain
  0 siblings, 0 replies; 49+ messages in thread
From: Priyanka Jain @ 2019-11-15 12:43 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: Biwen Li <biwen.li@nxp.com>
>Sent: Thursday, November 14, 2019 4:06 PM
>To: Jagdish Gediya <jagdish.gediya@nxp.com>; Priyanka Jain
><priyanka.jain@nxp.com>; hs at denx.de; jagan at amarulasolutions.com;
>aford173 at gmail.com; Alison Wang <alison.wang@nxp.com>;
>bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com;
>Pramod Kumar <pramod.kumar_1@nxp.com>; Rajesh Bhagat
><rajesh.bhagat@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
>olteanv at gmail.com
>Cc: Xiaobo Xie <xiaobo.xie@nxp.com>; Jiafei Pan <jiafei.pan@nxp.com>; u-
>boot at lists.denx.de; Biwen Li <biwen.li@nxp.com>
>Subject: [PATCH 09/42] include/configs: ls1012a_common: define default i2c
>bus
>
>This defines default i2c bus with
>macro CONFIG_I2C_SET_DEFAULT_BUS_NUM
>and CONFIG_I2C_DEFAULT_BUS_NUMBER for ls1012a
>
>Signed-off-by: Biwen Li <biwen.li@nxp.com>
>---
> include/configs/ls1012a_common.h | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/include/configs/ls1012a_common.h
>b/include/configs/ls1012a_common.h
>index c5be1d33cc..b3a12094c1 100644
>--- a/include/configs/ls1012a_common.h
>+++ b/include/configs/ls1012a_common.h
>@@ -76,6 +76,9 @@
> /* I2C */
> #ifndef CONFIG_DM_I2C
> #define CONFIG_SYS_I2C
>+#else
>+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
>+#define CONFIG_I2C_DEFAULT_BUS_NUMBER 0
> #endif
>
> #define CONFIG_SYS_NS16550_SERIAL
>--
>2.17.1
Please reorder patches so that dependency patches are earlier and final enablement in configs file is in later patches.

-priyankajain

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

end of thread, other threads:[~2019-11-15 12:43 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 10:36 [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 02/42] include/configs: arm: ls1012a: fix compilation error Biwen Li
2019-11-15 12:43   ` Priyanka Jain
2019-11-14 10:36 ` [U-Boot] [PATCH 03/42] board: freescale: ls1012ardb: ls1012ardb.c: support dm_i2c_* API Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 04/42] board: freescale: ls1012ardb: eth.c: " Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 05/42] configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error Biwen Li
2019-11-15 12:43   ` Priyanka Jain
2019-11-14 10:36 ` [U-Boot] [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A Biwen Li
2019-11-15 12:43   ` Priyanka Jain
2019-11-14 10:36 ` [U-Boot] [PATCH 07/42] configs: ls1012a: enable CONFIG_DM_RTC Biwen Li
2019-11-15 12:43   ` Priyanka Jain
2019-11-14 10:36 ` [U-Boot] [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* API Biwen Li
2019-11-15 12:43   ` Priyanka Jain
2019-11-14 10:36 ` [U-Boot] [PATCH 09/42] include/configs: ls1012a_common: define default i2c bus Biwen Li
2019-11-15 12:43   ` Priyanka Jain
2019-11-14 10:36 ` [U-Boot] [PATCH 10/42] configs: arm: ls1043a: enable CONFIG_DM_I2C Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 11/42] include/configs: arm: ls1043a: fix a compilation error Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 12/42] configs: arm: ls1043a: enable CONFIG_DM_GPIO Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 13/42] board: freescale: ls1043aqds: support dm_i2c_* API Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 14/42] board: freescale: ls1043aqds: fix build error Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 15/42] include/configs: ls1043a_common: define default i2c bus Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 16/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1043A Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 17/42] configs: ls1046a: enable CONFIG_DM_I2C Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 18/42] include/configs: arm: ls1046a: fix compilation error Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 19/42] configs: arm: ls1046a: enable CONFIG_DM_GPIO Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 20/42] board: freescale: ls1046aqds: fix build error Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 21/42] include/configs: ls1046a_common: do not define CONFIG_DM_I2C for spl Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 22/42] armv8: dts: ls1046ardb: enable i2c0 and i2c3 DT node Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 23/42] include/configs: ls1046a_common.h: define default i2c bus Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 24/42] armv8: dts: ls1046aqds: enable i2c0 DT node Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 25/42] armv8: dts: ls1046afrwy: " Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 26/42] board: freescale: ls1046aqds: support dm_i2c_* API Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 27/42] board: freescale: ls1046afrwy: " Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 28/42] pmic: i2c: " Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 29/42] gpio: do not include <asm/arch/gpio.h> for ARCH_LS1046A Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 30/42] configs: arm: ls1021a: enable CONFIG_DM_I2C Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 31/42] include/configs: arm: ls1021a: fix compilation error Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 32/42] board: freescale: ls1021atwr: support dm_i2c_* API Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 33/42] configs: arm: ls1021a: fix compilation error Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 34/42] ls1021aqds: dcu: support dm_i2c_* API Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 35/42] board: freescale: ls1021aqds: " Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 36/42] include/configs: ls1021atwr: i2c: do not define DM_I2C for spl Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 37/42] video: dcu: support dm_i2c_* API Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 38/42] board: freescale: common: diu_ch7301: " Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 39/42] rtc: pcf8563: support driver model Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 40/42] armv8: fsl-layerscape: spl: fix build error when enabled CONFIG_DM_I2C Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 41/42] i2c: mxc_i2c: add DM_FLAG_PRE_RELOC flag Biwen Li
2019-11-14 10:36 ` [U-Boot] [PATCH 42/42] Kconfigs: layerscape: use a convenient default value for SYS_MALLOC_F_LEN Biwen Li
2019-11-15  5:06 ` [U-Boot] [PATCH 01/42] configs: ls1012a: enable CONFIG_DM_I2C Priyanka Jain

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.