All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model.
@ 2019-06-12  2:27 Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 2/5] gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A Chuanhua Han
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chuanhua Han @ 2019-06-12  2:27 UTC (permalink / raw
  To: u-boot

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

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
depends on:
	- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
	- http://patchwork.ozlabs.org/project/uboot/list/?series=113103

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

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index f3eaab960b..3c1c39579c 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -204,10 +204,6 @@ config ARCH_LS2080A
 	select ARCH_EARLY_INIT_R
 	select BOARD_EARLY_INIT_F
 	select SYS_I2C_MXC
-	select SYS_I2C_MXC_I2C1
-	select SYS_I2C_MXC_I2C2
-	select SYS_I2C_MXC_I2C3
-	select SYS_I2C_MXC_I2C4
 	imply DISTRO_DEFAULTS
 	imply PANIC_HANG
 
diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
index ce419dfcae..8833ed3a8f 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -163,7 +163,16 @@ int select_i2c_ch_pca9547(u8 ch)
 {
 	int ret;
 
+#ifndef CONFIG_DM_I2C
 	ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#else
+	struct udevice *dev;
+
+	ret = i2c_get_chip_for_busnum(0, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
+	if (!ret)
+		ret = dm_i2c_write(dev, 0, &ch, 1);
+#endif
+
 	if (ret) {
 		puts("PCA: failed to select proper channel\n");
 		return ret;
diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h
index c7d8a3b6eb..e776b5c667 100644
--- a/include/configs/ls2080a_common.h
+++ b/include/configs/ls2080a_common.h
@@ -74,9 +74,6 @@
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2048 * 1024)
 
-/* I2C */
-#define CONFIG_SYS_I2C
-
 /* Serial Port */
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE     1
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index 2e8a8bbdb7..806c103fbd 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -13,7 +13,6 @@
 #ifdef CONFIG_TARGET_LS2081ARDB
 #define CONFIG_QIXIS_I2C_ACCESS
 #endif
-#define CONFIG_SYS_I2C_EARLY_INIT
 #endif
 
 #define I2C_MUX_CH_VOL_MONITOR		0xa
-- 
2.17.1

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

* [U-Boot] [PATCH 2/5] gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A
  2019-06-12  2:27 [U-Boot] [PATCH 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model Chuanhua Han
@ 2019-06-12  2:27 ` Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 3/5] configs: ls2088a: enable DM support for rtc Chuanhua Han
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Chuanhua Han @ 2019-06-12  2:27 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
arch ls2080a.

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
depends on: 
	- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
	- http://patchwork.ozlabs.org/project/uboot/list/?series=113103

 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 f78b976e10..292adfa240 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -1,7 +1,7 @@
 #if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_ARCH_STI) && \
 	!defined(CONFIG_ARCH_K3) && !defined(CONFIG_ARCH_BCM6858) && \
 	!defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP) && \
-	!defined(CONFIG_ARCH_LX2160A)
+	!defined(CONFIG_ARCH_LX2160A) && !defined(CONFIG_ARCH_LS2080A)
 #include <asm/arch/gpio.h>
 #endif
 #include <asm-generic/gpio.h>
-- 
2.17.1

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

* [U-Boot] [PATCH 3/5] configs: ls2088a: enable DM support for rtc
  2019-06-12  2:27 [U-Boot] [PATCH 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 2/5] gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A Chuanhua Han
@ 2019-06-12  2:27 ` Chuanhua Han
  2019-08-22  8:33   ` Prabhakar Kushwaha
  2019-06-12  2:27 ` [U-Boot] [PATCH 4/5] armv8: dts: fsl-ls2088a: add I2C node support Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 5/5] armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller Chuanhua Han
  3 siblings, 1 reply; 6+ messages in thread
From: Chuanhua Han @ 2019-06-12  2:27 UTC (permalink / raw
  To: u-boot

Enable related configs to support rtc DM feature for
ls2088ardb board.

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
depends on: 
	- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
	- http://patchwork.ozlabs.org/project/uboot/list/?series=113103

 configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 7 ++++++-
 configs/ls2088ardb_tfa_defconfig             | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig b/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
index d3312c60fd..abc608ff3e 100644
--- a/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS2080ARDB=y
+CONFIG_SYS_MALLOC_F_LEN=0x6000
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SECURE_BOOT=y
 CONFIG_QSPI_AHB_INIT=y
@@ -8,7 +9,6 @@ CONFIG_NR_DRAM_BANKS=3
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -69,3 +69,8 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_DM_RTC=y
diff --git a/configs/ls2088ardb_tfa_defconfig b/configs/ls2088ardb_tfa_defconfig
index 1aa8dd9a59..c273a75305 100644
--- a/configs/ls2088ardb_tfa_defconfig
+++ b/configs/ls2088ardb_tfa_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS2080ARDB=y
+CONFIG_SYS_MALLOC_F_LEN=0x6000
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_TFABOOT=y
@@ -7,7 +8,6 @@ CONFIG_NR_DRAM_BANKS=3
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -70,3 +70,8 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
+CONFIG_DM_GPIO=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_DM_RTC=y
-- 
2.17.1

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

* [U-Boot] [PATCH 4/5] armv8: dts: fsl-ls2088a: add I2C node support
  2019-06-12  2:27 [U-Boot] [PATCH 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 2/5] gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 3/5] configs: ls2088a: enable DM support for rtc Chuanhua Han
@ 2019-06-12  2:27 ` Chuanhua Han
  2019-06-12  2:27 ` [U-Boot] [PATCH 5/5] armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller Chuanhua Han
  3 siblings, 0 replies; 6+ messages in thread
From: Chuanhua Han @ 2019-06-12  2:27 UTC (permalink / raw
  To: u-boot

One ls2088a, there is four I2C controllers.
This patch is to add I2C node for ls2088a.

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
depends on: 
	- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
	- http://patchwork.ozlabs.org/project/uboot/list/?series=113103

 arch/arm/dts/fsl-ls2080a.dtsi | 36 +++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi
index 5c0769bc99..99ed33af95 100644
--- a/arch/arm/dts/fsl-ls2080a.dtsi
+++ b/arch/arm/dts/fsl-ls2080a.dtsi
@@ -56,6 +56,42 @@
 		      <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
 	};
 
+	i2c0: i2c at 2000000 {
+		status = "disabled";
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2000000 0x0 0x10000>;
+		interrupts = <0 34 0x4>; /* Level high type */
+	};
+
+	i2c1: i2c at 2010000 {
+		status = "disabled";
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2010000 0x0 0x10000>;
+		interrupts = <0 34 0x4>; /* Level high type */
+	};
+
+	i2c2: i2c at 2020000 {
+		status = "disabled";
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2020000 0x0 0x10000>;
+		interrupts = <0 35 0x4>; /* Level high type */
+	};
+
+	i2c3: i2c at 2030000 {
+		status = "disabled";
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2030000 0x0 0x10000>;
+		interrupts = <0 35 0x4>; /* Level high type */
+	};
+
 	dspi: dspi at 2100000 {
 		compatible = "fsl,vf610-dspi";
 		#address-cells = <1>;
-- 
2.17.1

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

* [U-Boot] [PATCH 5/5] armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller
  2019-06-12  2:27 [U-Boot] [PATCH 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model Chuanhua Han
                   ` (2 preceding siblings ...)
  2019-06-12  2:27 ` [U-Boot] [PATCH 4/5] armv8: dts: fsl-ls2088a: add I2C node support Chuanhua Han
@ 2019-06-12  2:27 ` Chuanhua Han
  3 siblings, 0 replies; 6+ messages in thread
From: Chuanhua Han @ 2019-06-12  2:27 UTC (permalink / raw
  To: u-boot

This patch adds some slave nodes to support the i2c dm on the device
side under the i2c0 controller.

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
depends on: 
	- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
	- http://patchwork.ozlabs.org/project/uboot/list/?series=113103

 arch/arm/dts/fsl-ls2088a-rdb-qspi.dts | 45 +++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/arch/arm/dts/fsl-ls2088a-rdb-qspi.dts b/arch/arm/dts/fsl-ls2088a-rdb-qspi.dts
index bf97d138fc..768e66f941 100644
--- a/arch/arm/dts/fsl-ls2088a-rdb-qspi.dts
+++ b/arch/arm/dts/fsl-ls2088a-rdb-qspi.dts
@@ -57,6 +57,51 @@
 	};
 };
 
+&i2c0 {
+	status = "okay";
+	u-boot,dm-pre-reloc;
+
+	pca9547 at 75 {
+		compatible = "nxp,pca9547";
+		reg = <0x75>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		 i2c at 1 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x01>;
+			rtc at 68 {
+				compatible = "dallas,ds3232";
+				reg = <0x68>;
+			};
+		};
+
+		i2c at 2 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x02>;
+
+			ina220 at 40 {
+				compatible = "ti,ina220";
+				reg = <0x40>;
+				shunt-resistor = <500>;
+			};
+		};
+
+		i2c at 3 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x3>;
+
+			adt7481 at 4c {
+				compatible = "adi,adt7461";
+				reg = <0x4c>;
+			};
+		};
+	};
+};
+
 &sata {
 	status = "okay";
 };
-- 
2.17.1

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

* [U-Boot] [PATCH 3/5] configs: ls2088a: enable DM support for rtc
  2019-06-12  2:27 ` [U-Boot] [PATCH 3/5] configs: ls2088a: enable DM support for rtc Chuanhua Han
@ 2019-08-22  8:33   ` Prabhakar Kushwaha
  0 siblings, 0 replies; 6+ messages in thread
From: Prabhakar Kushwaha @ 2019-08-22  8:33 UTC (permalink / raw
  To: u-boot


> -----Original Message-----
> From: Chuanhua Han <chuanhua.han@nxp.com>
> Sent: Wednesday, June 12, 2019 7:57 AM
> To: albert.u.boot at aribaud.net; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>; Priyanka Jain <priyanka.jain@nxp.com>;
> Rajesh Bhagat <rajesh.bhagat@nxp.com>
> Cc: u-boot at lists.denx.de; Chuanhua Han <chuanhua.han@nxp.com>
> Subject: [PATCH 3/5] configs: ls2088a: enable DM support for rtc
> 
> Enable related configs to support rtc DM feature for ls2088ardb board.
> 
> Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> ---
> depends on:

Squashed with qds patch

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

--pk

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

end of thread, other threads:[~2019-08-22  8:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-12  2:27 [U-Boot] [PATCH 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model Chuanhua Han
2019-06-12  2:27 ` [U-Boot] [PATCH 2/5] gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A Chuanhua Han
2019-06-12  2:27 ` [U-Boot] [PATCH 3/5] configs: ls2088a: enable DM support for rtc Chuanhua Han
2019-08-22  8:33   ` Prabhakar Kushwaha
2019-06-12  2:27 ` [U-Boot] [PATCH 4/5] armv8: dts: fsl-ls2088a: add I2C node support Chuanhua Han
2019-06-12  2:27 ` [U-Boot] [PATCH 5/5] armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller Chuanhua Han

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.