Skip to contentSkip to conversation

armv8: ls1088a: The ls1088a platform supports the I2C driver model.

PATCH New Chuanhua Han 1 participant 5 messages Jul 23, 2019 Arm (32-bit)

v3 of 4 New Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/5 armv8: ls1088a: The ls1088a platform supports the I2C driver model.

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 ls1088a platform does not support dm.

---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=110856
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459

Changes in v3:
- Change the Kconfig file to !TFABOOT.
- Define the use of CONFIG_SYS_I2C for non-dm.
Changes in v2:
- No change.

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig |   8 +-
 board/freescale/ls1088a/ls1088a.c         | 148 ++++++++++++++++++++++++++++++
 include/configs/ls1088a_common.h          |   3 +
 include/configs/ls1088ardb.h              |   2 -
 4 files changed, 155 insertions(+), 6 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/Kconfig +4 -4
index ffda02a..b2768ed 100644
@@ -155,10 +155,10 @@ config ARCH_LS1088A
 	select ARCH_EARLY_INIT_R
 	select BOARD_EARLY_INIT_F
 	select SYS_I2C_MXC
-	select SYS_I2C_MXC_I2C1
-	select SYS_I2C_MXC_I2C2
-	select SYS_I2C_MXC_I2C3
-	select SYS_I2C_MXC_I2C4
+	select SYS_I2C_MXC_I2C1 if !TFABOOT
+	select SYS_I2C_MXC_I2C2 if !TFABOOT
+	select SYS_I2C_MXC_I2C3 if !TFABOOT
+	select SYS_I2C_MXC_I2C4 if !TFABOOT
 	imply SCSI
 	imply PANIC_HANG
 
board/freescale/ls1088a/ls1088a.c +148 -0

271 lines not on this page · raw message

include/configs/ls1088a_common.h +3 -0
index e8e1dc2..6f04dba 100644
@@ -67,7 +67,10 @@
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2048 * 1024)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
+#endif
+
 
 /* Serial Port */
 #define CONFIG_SYS_NS16550_SERIAL
include/configs/ls1088ardb.h +0 -2
index 322adb5..b71f704 100644
@@ -269,9 +269,7 @@
 * RTC configuration
 */
 #define RTC
-#define CONFIG_RTC_PCF8563 1
 #define CONFIG_SYS_I2C_RTC_ADDR         0x51  /* Channel 3*/
-#define CONFIG_CMD_DATE
 #endif
 
 /* EEPROM */
Signature · 1 line
2.9.5
#1 lore raw

PATCH v3 2/5 gpio: do not include <asm/arch/gpio.h> on ARCH_LS1088A

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

---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=110856
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459

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

 arch/arm/include/asm/gpio.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/include/asm/gpio.h +1 -1
index f78b976..0ca15c9 100644
@@ -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_LS1088A)
 #include <asm/arch/gpio.h>
 #endif
 #include <asm-generic/gpio.h>
Signature · 1 line
1.7.1
#2 lore raw

PATCH v3 3/5 configs: ls1088a: enable DM support for pcf2127 rtc

In reply to Chuanhua Han

Enable related configs to support pcf2127 rtc DM feature for ls1088ardb board.

---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=110856
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459

Changes in v3:
- Add configuration options for i2c dm to set default bus number Settings.
Changes in v2:
- No change.

 configs/ls1088ardb_tfa_SECURE_BOOT_defconfig |    10 +++++++++-
 configs/ls1088ardb_tfa_defconfig             |    10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
configs/ls1088ardb_tfa_SECURE_BOOT_defconfig +9 -1
index 3c4437d..364fc59 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1088ARDB=y
+CONFIG_SYS_MALLOC_F_LEN=0x6000
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SECURE_BOOT=y
 CONFIG_QSPI_AHB_INIT=y
@@ -9,7 +10,6 @@ CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -63,3 +63,11 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_I2C_DEFAULT_BUS_NUMBER=0
+CONFIG_DM_RTC=y
+CONFIG_DM_GPIO=y
+CONFIG_RTC_PCF2127=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
configs/ls1088ardb_tfa_defconfig +9 -1
index 8cea8c7..eb35782 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1088ARDB=y
+CONFIG_SYS_MALLOC_F_LEN=0x6000
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_TFABOOT=y
@@ -8,7 +9,6 @@ CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -61,3 +61,11 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_I2C_DEFAULT_BUS_NUMBER=0
+CONFIG_DM_RTC=y
+CONFIG_DM_GPIO=y
+CONFIG_RTC_PCF2127=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
Signature · 1 line
1.7.1
#3 lore raw

PATCH v3 4/5 armv8: dts: fsl-ls1088a: add I2C node support

In reply to Chuanhua Han

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

---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=110856
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459

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

 arch/arm/dts/fsl-ls1088a.dtsi |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/dts/fsl-ls1088a.dtsi +32 -0
index 7c70585..4be1ab8 100644
@@ -34,6 +34,38 @@
 			     <1 10 0x8>; /* Hypervisor PPI, active-low */
 	};
 
+	i2c0: i2c at 2000000 {
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2000000 0x0 0x10000>;
+		interrupts = <0 34 4>;
+	};
+
+	i2c1: i2c at 2010000 {
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2010000 0x0 0x10000>;
+		interrupts = <0 34 4>;
+	};
+
+	i2c2: i2c at 2020000 {
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2020000 0x0 0x10000>;
+		interrupts = <0 35 4>;
+	};
+
+	i2c3: i2c at 2030000 {
+		compatible = "fsl,vf610-i2c";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x2030000 0x0 0x10000>;
+		interrupts = <0 35 4>;
+	};
+
 	serial0: serial at 21c0500 {
 		device_type = "serial";
 		compatible = "fsl,ns16550", "ns16550a";
Signature · 1 line
1.7.1
#4 lore raw

PATCH v3 5/5 armv8: dts: ls1088ardb: Add slave nodes under the i2c0 controller

In reply to Chuanhua Han

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

---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=110856
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459

Change in v3:
- No change.
Change in v2:
- Delete unnecessary i2c slave nodes.

 arch/arm/dts/fsl-ls1088a-rdb.dts |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
arch/arm/dts/fsl-ls1088a-rdb.dts +23 -0
index 765d1e3..0fe3519 100644
@@ -17,6 +17,29 @@
 	};
 };
 
+&i2c0 {
+	status = "okay";
+	u-boot,dm-pre-reloc;
+
+	i2c-mux at 77 {
+		compatible = "nxp,pca9547";
+		reg = <0x77>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		i2c at 3 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x3>;
+
+			rtc at 51 {
+				compatible = "pcf2127-rtc";
+				reg = <0x51>;
+			};
+		};
+	};
+};
+
 &qspi {
 	bus-num = <0>;
 	status = "okay";
Signature · 1 line
1.7.1