armv8: ls2088a: The ls2088a platform supports the I2C driver model.
PATCH v3 1/5 armv8: ls2088a: The ls2088a 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 ls2088a platform does not support dm.
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
- http://patchwork.ozlabs.org/project/uboot/list/?series=113103
Change in v3:
- Change the Kconfig file to !TFABOOT.
- Define the use of CONFIG_SYS_I2C for non-dm.
- Qualified RDB boards that are not dm are used CONFIG_SYS_I2C_EARLY_INIT.
Change in v2:
- No change.
arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 8 ++++---- board/freescale/ls2080ardb/ls2080ardb.c | 9 +++++++++ include/configs/ls2080a_common.h | 2 ++ include/configs/ls2080ardb.h | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/Kconfig +4 -4
@@ -205,10 +205,10 @@ 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 + 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 DISTRO_DEFAULTS imply PANIC_HANG
board/freescale/ls2080ardb/ls2080ardb.c +9 -0
@@ -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;
include/configs/ls2080a_common.h +2 -0
@@ -75,7 +75,9 @@#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/ls2080ardb.h +2 -0
@@ -13,8 +13,10 @@#ifdef CONFIG_TARGET_LS2081ARDB #define CONFIG_QIXIS_I2C_ACCESS #endif +#ifndef CONFIG_DM_I2C #define CONFIG_SYS_I2C_EARLY_INIT #endif +#endif #define I2C_MUX_CH_VOL_MONITOR 0xa#define I2C_VOL_MONITOR_ADDR 0x38
Signature · 1 line
2.9.5
PATCH v3 2/5 gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A
As no gpio.h is defined for this architecture, to avoid compilation failure, do not include <asm/arch/gpio.h> for arch ls2080a.
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
- http://patchwork.ozlabs.org/project/uboot/list/?series=113103
Change in v3:
- No change.
Change 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
@@ -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>
Signature · 1 line
1.7.1
PATCH v3 2/5 gpio: do not include <asm/arch/gpio.h> on ARCH_LS2080A
Quoted 11 lines
-----Original Message-----
From: Chuanhua Han <[email protected]>
Sent: Monday, July 22, 2019 2:07 PM
To: albert.u.boot at aribaud.net; Prabhakar Kushwaha <[email protected]>; Priyanka Jain <[email protected]>; Rajesh Bhagat <[email protected]>
Cc: u-boot at lists.denx.de; Chuanhua Han <[email protected]>
Subject: [PATCH v3 2/5] gpio: do not include <asm/arch/gpio.h> onARCH_LS2080A
Quoted 5 lines
As no
gpio.his defined for this architecture, to avoid compilation failure, do not include <asm/arch/gpio.h> for arch ls2080a.Signed-off-by Chuanhua Han <[email protected]>---
This patch has been applied to fsl-qoriq master, awaiting upstream.
--pk
PATCH v3 3/5 configs: ls2088a: enable DM support for rtc
In reply to Chuanhua HanEnable related configs to support rtc DM feature for ls2088ardb board.
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
- http://patchwork.ozlabs.org/project/uboot/list/?series=113103
Change in v3:
- Add configuration options for i2c dm to set default bus number Settings.
Change in v2:
- No change.
configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 9 ++++++++- configs/ls2088ardb_tfa_defconfig | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-)
configs/ls2088ardb_tfa_SECURE_BOOT_defconfig +8 -1
@@ -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,10 @@ 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_GPIO=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_DM_RTC=y
configs/ls2088ardb_tfa_defconfig +8 -1
@@ -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,10 @@ 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_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_I2C_DEFAULT_BUS_NUMBER=0 +CONFIG_DM_GPIO=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_DM_RTC=y
Signature · 1 line
1.7.1
PATCH v3 4/5 armv8: dts: fsl-ls2088a: add i2c node support
In reply to Chuanhua HanFrom: chuanhua han <[email protected]>
One ls2088a, there is four I2C controllers.
This patch is to add I2C node for ls2088a.
---
depends on:
- http://patchwork.ozlabs.org/project/uboot/list/?series=109459
- http://patchwork.ozlabs.org/project/uboot/list/?series=113103
Change in v3:
- No change.
Change in v2:
- No change.
arch/arm/dts/fsl-ls2080a.dtsi | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-)
arch/arm/dts/fsl-ls2080a.dtsi +36 -0
@@ -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>;
Signature · 1 line
1.7.1
PATCH v3 4/5 armv8: dts: fsl-ls2088a: add i2c node support
Quoted 10 lines
-----Original Message-----
From: Chuanhua Han <[email protected]>
Sent: Monday, July 22, 2019 2:07 PM
To: albert.u.boot at aribaud.net; Prabhakar Kushwaha <[email protected]>; Priyanka Jain <[email protected]>; Rajesh Bhagat <[email protected]>
Cc: u-boot at lists.denx.de; Chuanhua Han <[email protected]>
Subject: [PATCH v3 4/5] armv8: dts: fsl-ls2088a: add i2c node support
Quoted 8 lines
From: chuanhua han <[email protected]>
One ls2088a, there is four I2C controllers.
This patch is to add I2C node for ls2088a.Signed-off-by Chuanhua Han <[email protected]>---
depends on:
This patch has been applied to fsl-qoriq master, awaiting upstream.
--pk
PATCH v3 5/5 armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller
In reply to Chuanhua HanThis 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=109459
- http://patchwork.ozlabs.org/project/uboot/list/?series=113103
Change in v3:
- No change.
Change in v2:
- Delete unnecessary i2c slave nodes.
arch/arm/dts/fsl-ls2088a-rdb-qspi.dts | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/dts/fsl-ls2088a-rdb-qspi.dts +22 -0
@@ -57,6 +57,28 @@ }; }; +&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>; + }; + }; + }; +}; + &sata { status = "okay"; };
Signature · 1 line
1.7.1
PATCH v3 5/5 armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller
Quoted 11 lines
-----Original Message-----
From: Chuanhua Han <[email protected]>
Sent: Monday, July 22, 2019 2:07 PM
To: albert.u.boot at aribaud.net; Prabhakar Kushwaha <[email protected]>; Priyanka Jain <[email protected]>; Rajesh Bhagat <[email protected]>
Cc: u-boot at lists.denx.de; Chuanhua Han <[email protected]>
Subject: [PATCH v3 5/5] armv8: dts: ls2088ardb: Add slave nodes under the i2c0 controller
Quoted 5 lines
This patch adds some slave nodes to support the i2c dm on the device side under the i2c0 controller.
Signed-off-by Chuanhua Han <[email protected]>---
This patch has been applied to fsl-qoriq master, awaiting upstream.
--pk
PATCH v3 1/5 armv8: ls2088a: The ls2088a platform supports the I2C driver model.
In reply to Chuanhua HanQuoted 11 lines
-----Original Message-----
From: Chuanhua Han <[email protected]>
Sent: Monday, July 22, 2019 2:07 PM
To: albert.u.boot at aribaud.net; Prabhakar Kushwaha <[email protected]>; Priyanka Jain <[email protected]>; Rajesh Bhagat <[email protected]>
Cc: u-boot at lists.denx.de; Chuanhua Han <[email protected]>
Subject: [PATCH v3 1/5] armv8: ls2088a: The ls2088a platform supports the I2C driver model.
Quoted 8 lines
DM_I2C_COMPATis a compatibility layer that allows using the non-DM I2C API whenDM_I2Cis used.WhenDM_I2C_COMPATis 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 <[email protected]>---
This patch has been applied to fsl-qoriq master, awaiting upstream.
--pk