configs: ls1012a: enable CONFIG_DM_I2C
Subsystems (4)
PATCH 1/42 configs: ls1012a: enable CONFIG_DM_I2C
This enables CONFIG_DM_I2C for SoC LS1012A
--- 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(+)
configs/ls1012a2g5rdb_qspi_defconfig +1 -0
@@ -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
configs/ls1012a2g5rdb_tfa_defconfig +1 -0
@@ -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
configs/ls1012afrdm_qspi_defconfig +1 -0
@@ -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
configs/ls1012afrdm_tfa_defconfig +1 -0
@@ -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
configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012afrwy_qspi_defconfig +1 -0
@@ -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
configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012afrwy_tfa_defconfig +1 -0
@@ -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
configs/ls1012aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1012aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1012ardb_qspi_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012ardb_qspi_defconfig +1 -0
@@ -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
configs/ls1012ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 2/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.
--- include/configs/ls1012a_common.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/ls1012a_common.h +2 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 2/42 include/configs: arm: ls1012a: fix compilation error
Quoted 61 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 02/42]include/configs: arm: ls1012a: fix compilation errorThis fixes a compilation error as follow:
- In file included frominclude/config.h:9:0,
from./include/common.h:23:
include/config_fallbacks.h:51:4: error: #error "Cannot defineCONFIG_SYS_I2CwhenCONFIG_DM_I2Cis used"
# error "Cannot defineCONFIG_SYS_I2CwhenCONFIG_DM_I2Cis
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.depfailed
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 targetinclude/config/auto.conf, needed
byinclude/config/uboot.release. Stop.Signed-off-by Biwen Li <[email protected]>---
include/configs/ls1012a_common.h| 2 ++1 file changed, 2 insertions(+)include/configs/ls1012a_common.h +2
-1@@ -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 --
Quoted 1 line
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
PATCH 3/42 board: freescale: ls1012ardb: ls1012ardb.c: support dm_i2c_* API
In reply to Biwen LiThis supports dm_i2c_* API for board LS1012ARDB
--- board/freescale/ls1012ardb/ls1012ardb.c | 147 ++++++++++++++++++++---- 1 file changed, 123 insertions(+), 24 deletions(-)
board/freescale/ls1012ardb/ls1012ardb.c +123 -24
@@ -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; }
Signature · 1 line
2.17.1
PATCH 4/42 board: freescale: ls1012ardb: eth.c: support dm_i2c_* API
In reply to Biwen LiThis supports dm_i2c_* API for board LS1012ARDB
--- board/freescale/ls1012ardb/eth.c | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
board/freescale/ls1012ardb/eth.c +35 -0
@@ -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 }
Signature · 1 line
2.17.1
PATCH 5/42 configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error
In reply to Biwen LiThis 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'
--- 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(+)
configs/ls1012a2g5rdb_qspi_defconfig +1 -0
@@ -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
configs/ls1012a2g5rdb_tfa_defconfig +1 -0
@@ -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
configs/ls1012afrdm_qspi_defconfig +1 -0
@@ -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
configs/ls1012afrdm_tfa_defconfig +1 -0
@@ -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
configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012afrwy_qspi_defconfig +1 -0
@@ -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
configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012afrwy_tfa_defconfig +1 -0
@@ -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
configs/ls1012aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1012aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1012ardb_qspi_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012ardb_qspi_defconfig +1 -0
@@ -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
configs/ls1012ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1012ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 5/42 configs: ls1012a: enable CONFIG_DM_GPIO to fix compilation error
Quoted 17 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 05/42] configs: ls1012a: enableCONFIG_DM_GPIOto fix compilation error
Quoted 8 lines
This enables
CONFIG_DM_GPIOto fix
a compilation error as follows:
-drivers/i2c/built-in.o: In function `mxc_i2c_probe:
drivers/i2c/mxc_i2c.c:924: undefined reference togpio_request_by_name_nodev' drivers/i2c/mxc_i2c.c:927: undefined reference togpio_request_by_name_nodev'
If this error is introduced by one of your patch. Merge this change with that.
Quoted 1 line
Signed-off-by Biwen Li <[email protected]>
<snip>
-priyankajain
PATCH 6/42 gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A
In reply to Biwen LiAs 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.
--- arch/arm/include/asm/gpio.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/include/asm/gpio.h +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 6/42 gpio: do not include <asm/arch/gpio.h> for ARCH_LS1012A
Quoted 35 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 06/42] gpio: do not include <asm/arch/gpio.h> forARCH_LS1012AAs no
gpio.his 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 targetdrivers/gpiofailed
make: *** [drivers/gpio] Error 2
make: *** Waiting for unfinished jobs....
LDboard/freescale/common/built-in.o
In file included fromdrivers/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
Quoted 4 lines
#include <asm/arch/gpio.h>
^~~~~~~~~~~~~~~~~
compilation terminated.If this compilation error is introduced by one of your patch, merge with that.
Quoted 2 lines
Signed-off-by Biwen Li <[email protected]>---
<snip>
-priyankajain
PATCH 7/42 configs: ls1012a: enable CONFIG_DM_RTC
In reply to Biwen LiThis 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....
--- 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(+)
configs/ls1012a2g5rdb_qspi_defconfig +1 -0
@@ -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
configs/ls1012a2g5rdb_tfa_defconfig +1 -0
@@ -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
configs/ls1012afrdm_qspi_defconfig +1 -0
@@ -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
configs/ls1012afrdm_tfa_defconfig +1 -0
@@ -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
configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig +1 -0
@@ -54,3 +54,4 @@ CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_DM_I2C=y CONFIG_DM_GPIO=y +CONFIG_DM_RTC=y
configs/ls1012afrwy_qspi_defconfig +1 -0
@@ -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
configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig +1 -0
@@ -54,3 +54,4 @@ CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_DM_I2C=y CONFIG_DM_GPIO=y +CONFIG_DM_RTC=y
configs/ls1012afrwy_tfa_defconfig +1 -0
@@ -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
configs/ls1012aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1012aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -67,3 +67,4 @@ CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_DM_I2C=y CONFIG_DM_GPIO=y +CONFIG_DM_RTC=y
configs/ls1012aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1012ardb_qspi_SECURE_BOOT_defconfig +1 -0
@@ -57,3 +57,4 @@ CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_DM_I2C=y CONFIG_DM_GPIO=y +CONFIG_DM_RTC=y
configs/ls1012ardb_qspi_defconfig +1 -0
@@ -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
configs/ls1012ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -57,3 +57,4 @@ CONFIG_RSA=y CONFIG_RSA_SOFTWARE_EXP=y CONFIG_DM_I2C=y CONFIG_DM_GPIO=y +CONFIG_DM_RTC=y
configs/ls1012ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 7/42 configs: ls1012a: enable CONFIG_DM_RTC
Quoted 36 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 07/42] configs: ls1012a: enableCONFIG_DM_RTCThis enables
CONFIG_DM_RTCfor SoC LS1012A to fix compilation error when enabledCONFIG_DM_I2CandCONFIG_CMD_DATEas 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
Quoted 5 lines
once for each function it appears in
scripts/Makefile.build:278: recipe for targetcmd/date.ofailed 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.
Quoted 1 line
Signed-off-by Biwen Li <[email protected]>
<snip>
-priyankajain
PATCH 8/42 board: freescale: ls1012aqds: support dm_i2c_* API
In reply to Biwen LiThis 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'
--- board/freescale/ls1012aqds/ls1012aqds.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
board/freescale/ls1012aqds/ls1012aqds.c +18 -2
@@ -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
Signature · 1 line
2.17.1
PATCH 8/42 board: freescale: ls1012aqds: support dm_i2c_* API
Quoted 19 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 08/42] board: freescale: ls1012aqds: support dm_i2c_* APIThis supports dm_i2c_* API to
fix compilation error when
enabledCONFIG_DM_I2Cas follows:
Quoted 8 lines
- 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.
Quoted 2 lines
Signed-off-by Biwen Li <[email protected]>---
<snip>
-priyankajain
PATCH 9/42 include/configs: ls1012a_common: define default i2c bus
In reply to Biwen LiThis defines default i2c bus with
macro CONFIG_I2C_SET_DEFAULT_BUS_NUM
and CONFIG_I2C_DEFAULT_BUS_NUMBER for ls1012a
--- include/configs/ls1012a_common.h | 3 +++ 1 file changed, 3 insertions(+)
include/configs/ls1012a_common.h +3 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 9/42 include/configs: ls1012a_common: define default i2c bus
Quoted 42 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 09/42]include/configs:ls1012a_common: define default i2c busThis defines default i2c bus with
macroCONFIG_I2C_SET_DEFAULT_BUS_NUM
andCONFIG_I2C_DEFAULT_BUS_NUMBERfor ls1012aSigned-off-by Biwen Li <[email protected]>---
include/configs/ls1012a_common.h| 3 +++1 file changed, 3 insertions(+)include/configs/ls1012a_common.h +3
-1@@ -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 --
Quoted 1 line
2.17.1
Please reorder patches so that dependency patches are earlier and final enablement in configs file is in later patches.
-priyankajain
PATCH 10/42 configs: arm: ls1043a: enable CONFIG_DM_I2C
In reply to Biwen LiThis enables CONFIG_DM_I2C for SoC LS1043A
--- 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(+)
configs/ls1043aqds_defconfig +1 -0
@@ -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
configs/ls1043aqds_lpuart_defconfig +1 -0
@@ -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
configs/ls1043aqds_nand_defconfig +1 -0
@@ -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
configs/ls1043aqds_nor_ddr3_defconfig +1 -0
@@ -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
configs/ls1043aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1043aqds_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1043aqds_sdcard_qspi_defconfig +1 -0
@@ -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
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1043ardb_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_defconfig +1 -0
@@ -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
configs/ls1043ardb_nand_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_nand_defconfig +1 -0
@@ -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
configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_sdcard_defconfig +1 -0
@@ -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
configs/ls1043ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 11/42 include/configs: arm: ls1043a: fix a compilation error
In reply to Biwen LiThis 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.
--- include/configs/ls1043a_common.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/ls1043a_common.h +2 -0
@@ -141,7 +141,9 @@#endif /* I2C */ +#ifndef CONFIG_DM_I2C #define CONFIG_SYS_I2C +#endif /* PCIe */ #ifndef SPL_NO_PCIE
Signature · 1 line
2.17.1
PATCH 12/42 configs: arm: ls1043a: enable CONFIG_DM_GPIO
In reply to Biwen LiThis 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'
--- 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(+)
configs/ls1043aqds_defconfig +1 -0
@@ -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
configs/ls1043aqds_lpuart_defconfig +1 -0
@@ -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
configs/ls1043aqds_nand_defconfig +1 -0
@@ -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
configs/ls1043aqds_nor_ddr3_defconfig +1 -0
@@ -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
configs/ls1043aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1043aqds_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1043aqds_sdcard_qspi_defconfig +1 -0
@@ -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
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1043ardb_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_defconfig +1 -0
@@ -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
configs/ls1043ardb_nand_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_nand_defconfig +1 -0
@@ -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
configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_sdcard_defconfig +1 -0
@@ -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
configs/ls1043ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1043ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 13/42 board: freescale: ls1043aqds: support dm_i2c_* API
In reply to Biwen LiThis 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'`
--- board/freescale/ls1043aqds/ls1043aqds.c | 95 +++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 6 deletions(-)
board/freescale/ls1043aqds/ls1043aqds.c +89 -6
@@ -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 , ®,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 , ®,1 ); + +/* Read device revision and ID */ +dm_i2c_read (dev,1 , ®,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 , ®,1 ); + +/* Reset Channel Registers */ +dm_i2c_read (dev,0 , ®,1 ); + reg |=0x4 ; +dm_i2c_write (dev,0 , ®,1 ); + +/* Enable override divider select and Enable Override Output Mux */ +dm_i2c_read (dev,9 , ®,1 ); + reg |=0x24 ; +dm_i2c_write (dev,9 , ®,1 ); + +/* Select VCO Divider to full rate (000) */ +dm_i2c_read (dev,0x18 , ®,1 ); + reg &=0x8f ; +dm_i2c_write (dev,0x18 , ®,1 ); + +/* Selects active PFD MUX Input as Re-timed Data (001) */ +dm_i2c_read (dev,0x1e , ®,1 ); + reg &=0x3f ; + reg |=0x20 ; +dm_i2c_write (dev,0x1e , ®,1 ); + +/* Set data rate as 10.3125 Gbps */ + reg =0x0 ; +dm_i2c_write (dev,0x60 , ®,1 ); + reg =0xb2 ; +dm_i2c_write (dev,0x61 , ®,1 ); + reg =0x90 ; +dm_i2c_write (dev,0x62 , ®,1 ); + reg =0xb3 ; +dm_i2c_write (dev,0x63 , ®,1 ); + reg =0xcd ; +dm_i2c_write (dev,0x64 , ®,1 ); +#else i2c_write (I2C_MUX_PCA_ADDR_SEC ,0 ,1 , ®,1 );/* Access to Control/Shared register */
@@ -360,9 +442,10 @@ void board_retimer_init(void)i2c_write (I2C_RETIMER_ADDR ,0x63 ,1 , ®,1 ); reg =0xcd ;i2c_write (I2C_RETIMER_ADDR ,0x64 ,1 , ®,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
Signature · 1 line
2.17.1
PATCH 14/42 board: freescale: ls1043aqds: fix build error
In reply to Biwen LiThis 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'
--- board/freescale/ls1043aqds/ls1043aqds.c | 2 ++ 1 file changed, 2 insertions(+)
board/freescale/ls1043aqds/ls1043aqds.c +2 -0
@@ -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 ();
Signature · 1 line
2.17.1
PATCH 15/42 include/configs: ls1043a_common: define default i2c bus
In reply to Biwen LiThis defines default i2c bus with
macro CONFIG_I2C_SET_DEFAULT_BUS_NUM
and CONFIG_I2C_DEFAULT_BUS_NUMBER
for SoC LS1043A
--- include/configs/ls1043a_common.h | 3 +++ 1 file changed, 3 insertions(+)
include/configs/ls1043a_common.h +3 -0
@@ -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 */
Signature · 1 line
2.17.1
PATCH 16/42 gpio: do not include <asm/arch/gpio.h> for ARCH_LS1043A
In reply to Biwen LiAs 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.
--- arch/arm/include/asm/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/gpio.h +1 -1
@@ -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
Signature · 1 line
2.17.1
PATCH 17/42 configs: ls1046a: enable CONFIG_DM_I2C
In reply to Biwen LiThis enables CONFIG_DM_I2C for SoC LS1046A
--- 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(+)
configs/ls1046afrwy_tfa_defconfig +1 -0
@@ -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
configs/ls1046aqds_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046aqds_defconfig +1 -0
@@ -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
configs/ls1046aqds_lpuart_defconfig +1 -0
@@ -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
configs/ls1046aqds_nand_defconfig +1 -0
@@ -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
configs/ls1046aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1046aqds_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1046aqds_sdcard_qspi_defconfig +1 -0
@@ -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
configs/ls1046aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1046ardb_emmc_defconfig +1 -0
@@ -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
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046ardb_qspi_defconfig +1 -0
@@ -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
configs/ls1046ardb_qspi_spl_defconfig +1 -0
@@ -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
configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046ardb_sdcard_defconfig +1 -0
@@ -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
configs/ls1046ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 18/42 include/configs: arm: ls1046a: fix compilation error
In reply to Biwen LiThis 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.
--- include/configs/ls1046a_common.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/ls1046a_common.h +2 -0
@@ -127,7 +127,9 @@#endif /* I2C */ +#ifndef CONFIG_DM_I2C #define CONFIG_SYS_I2C +#endif /* PCIe */ #define CONFIG_PCIE1 /* PCIE controller 1 */
Signature · 1 line
2.17.1
PATCH 19/42 configs: arm: ls1046a: enable CONFIG_DM_GPIO
In reply to Biwen LiThis 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'
--- 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(+)
configs/ls1046afrwy_tfa_defconfig +1 -0
@@ -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
configs/ls1046aqds_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046aqds_defconfig +1 -0
@@ -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
configs/ls1046aqds_lpuart_defconfig +1 -0
@@ -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
configs/ls1046aqds_nand_defconfig +1 -0
@@ -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
configs/ls1046aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1046aqds_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1046aqds_sdcard_qspi_defconfig +1 -0
@@ -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
configs/ls1046aqds_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046aqds_tfa_defconfig +1 -0
@@ -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
configs/ls1046ardb_emmc_defconfig +1 -0
@@ -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
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046ardb_qspi_defconfig +1 -0
@@ -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
configs/ls1046ardb_qspi_spl_defconfig +1 -0
@@ -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
configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046ardb_sdcard_defconfig +1 -0
@@ -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
configs/ls1046ardb_tfa_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1046ardb_tfa_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 20/42 board: freescale: ls1046aqds: fix build error
In reply to Biwen LiThis 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'
--- board/freescale/ls1046aqds/ls1046aqds.c | 2 ++ 1 file changed, 2 insertions(+)
board/freescale/ls1046aqds/ls1046aqds.c +2 -0
@@ -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 ();
Signature · 1 line
2.17.1
PATCH 21/42 include/configs: ls1046a_common: do not define CONFIG_DM_I2C for spl
In reply to Biwen LiThis 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
--- include/configs/ls1046a_common.h | 1 + 1 file changed, 1 insertion(+)
include/configs/ls1046a_common.h +1 -0
@@ -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 ))
Signature · 1 line
2.17.1
PATCH 22/42 armv8: dts: ls1046ardb: enable i2c0 and i2c3 DT node
In reply to Biwen LiThis enables i2c0 and i2c3 DT node
--- arch/arm/dts/fsl-ls1046a-rdb.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/dts/fsl-ls1046a-rdb.dts +8 -0
@@ -43,3 +43,11 @@ &sata { status = "okay"; }; + +&i2c0 { + status = "okay"; +}; + +&i2c3 { + status = "okay"; +};
Signature · 1 line
2.17.1
PATCH 23/42 include/configs: ls1046a_common.h: define default i2c bus
In reply to Biwen LiThis defines default i2c bus with macroCONFIG_I2C_SET_DEFAULT_BUS_NUM andCONFIG_I2C_DEFAULT_BUS_NUMBER for SoC LS1046A
--- include/configs/ls1046a_common.h | 3 +++ 1 file changed, 3 insertions(+)
include/configs/ls1046a_common.h +3 -0
@@ -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 */
Signature · 1 line
2.17.1
PATCH 24/42 armv8: dts: ls1046aqds: enable i2c0 DT node
In reply to Biwen LiThis enables i2c0 DT node
--- arch/arm/dts/fsl-ls1046a-qds.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/fsl-ls1046a-qds.dtsi +4 -0
@@ -80,3 +80,7 @@ &sata { status = "okay"; }; + +&i2c0 { + status = "okay"; +};
Signature · 1 line
2.17.1
PATCH 25/42 armv8: dts: ls1046afrwy: enable i2c0 DT node
In reply to Biwen LiThis enables i2c0 DT node
--- arch/arm/dts/fsl-ls1046a-frwy.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/dts/fsl-ls1046a-frwy.dts +3 -0
@@ -32,3 +32,6 @@ }; +&i2c0 { + status = "okay"; +};
Signature · 1 line
2.17.1
PATCH 26/42 board: freescale: ls1046aqds: support dm_i2c_* API
In reply to Biwen LiThis 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'`
--- board/freescale/ls1046aqds/ls1046aqds.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
board/freescale/ls1046aqds/ls1046aqds.c +18 -4
@@ -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 ();
Signature · 1 line
2.17.1
PATCH 27/42 board: freescale: ls1046afrwy: support dm_i2c_* API
In reply to Biwen LiThis supports dm_i2c_* API to
fix compilation error when enabledCONFIG_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'`
--- board/freescale/ls1046afrwy/ls1046afrwy.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
board/freescale/ls1046afrwy/ls1046afrwy.c +15 -2
@@ -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 ; }
Signature · 1 line
2.17.1
PATCH 28/42 pmic: i2c: support dm_i2c_* API
In reply to Biwen LiThis 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'`
--- drivers/power/power_i2c.c | 45 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-)
drivers/power/power_i2c.c +43 -2
@@ -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 ; }
Signature · 1 line
2.17.1
PATCH 29/42 gpio: do not include <asm/arch/gpio.h> for ARCH_LS1046A
In reply to Biwen LiAs no gpio.h is defined for this architecture, to avoid compilation failure, do not include <asm/arch/gpio.h> for SoC LS1046A.
--- arch/arm/include/asm/gpio.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/include/asm/gpio.h +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 30/42 configs: arm: ls1021a: enable CONFIG_DM_I2C
In reply to Biwen LiThis enables CONFIG_DM_I2C for SoC LS1021A
--- 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(+)
configs/ls1021aiot_qspi_defconfig +1 -0
@@ -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
configs/ls1021aiot_sdcard_defconfig +1 -0
@@ -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
configs/ls1021aqds_ddr4_nor_defconfig +1 -0
@@ -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
configs/ls1021aqds_ddr4_nor_lpuart_defconfig +1 -0
@@ -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
configs/ls1021aqds_nand_defconfig +1 -0
@@ -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
configs/ls1021aqds_nor_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1021aqds_nor_defconfig +1 -0
@@ -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
configs/ls1021aqds_nor_lpuart_defconfig +1 -0
@@ -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
configs/ls1021aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1021aqds_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1021aqds_sdcard_qspi_defconfig +1 -0
@@ -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
configs/ls1021atsn_qspi_defconfig +1 -0
@@ -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
configs/ls1021atsn_sdcard_defconfig +1 -0
@@ -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
configs/ls1021atwr_nor_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1021atwr_nor_defconfig +1 -0
@@ -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
configs/ls1021atwr_nor_lpuart_defconfig +1 -0
@@ -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
configs/ls1021atwr_qspi_defconfig +1 -0
@@ -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
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig +1 -0
@@ -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
configs/ls1021atwr_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1021atwr_sdcard_qspi_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 31/42 include/configs: arm: ls1021a: fix compilation error
In reply to Biwen LiThis 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.
--- 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(+)
include/configs/ls1021aiot.h +3 -0
@@ -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 */
include/configs/ls1021aqds.h +2 -0
@@ -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 */
include/configs/ls1021atsn.h +2 -0
@@ -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 */
include/configs/ls1021atwr.h +2 -0
@@ -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 */
Signature · 1 line
2.17.1
PATCH 32/42 board: freescale: ls1021atwr: support dm_i2c_* API
In reply to Biwen LiThis 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'`
board: freescale: ls1021atwr: remove waring unused variable i2c_bus
This removes waring: unused variable i2c_bus
--- board/freescale/ls1021atwr/ls1021atwr.c | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
board/freescale/ls1021atwr/ls1021atwr.c +25 -1
@@ -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
Signature · 1 line
2.17.1
PATCH 33/42 configs: arm: ls1021a: fix compilation error
In reply to Biwen LiThis 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'
--- 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(+)
configs/ls1021aiot_qspi_defconfig +1 -0
@@ -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
configs/ls1021aiot_sdcard_defconfig +1 -0
@@ -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
configs/ls1021aqds_ddr4_nor_defconfig +1 -0
@@ -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
configs/ls1021aqds_ddr4_nor_lpuart_defconfig +1 -0
@@ -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
configs/ls1021aqds_nand_defconfig +1 -0
@@ -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
configs/ls1021aqds_nor_SECURE_BOOT_defconfig +1 -0
@@ -64,3 +64,4 @@ CONFIG_VIDEO=y CONFIG_RSA=y CONFIG_SPL_RSA=y CONFIG_DM_I2C=y +CONFIG_DM_GPIO=y
configs/ls1021aqds_nor_defconfig +1 -0
@@ -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
configs/ls1021aqds_nor_lpuart_defconfig +1 -0
@@ -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
configs/ls1021aqds_qspi_defconfig +1 -0
@@ -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
configs/ls1021aqds_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1021aqds_sdcard_qspi_defconfig +1 -0
@@ -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
configs/ls1021atsn_qspi_defconfig +1 -0
@@ -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
configs/ls1021atsn_sdcard_defconfig +1 -0
@@ -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
configs/ls1021atwr_nor_SECURE_BOOT_defconfig +1 -0
@@ -59,3 +59,4 @@ CONFIG_VIDEO=y CONFIG_RSA=y CONFIG_SPL_RSA=y CONFIG_DM_I2C=y +CONFIG_DM_GPIO=y
configs/ls1021atwr_nor_defconfig +1 -0
@@ -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
configs/ls1021atwr_nor_lpuart_defconfig +1 -0
@@ -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
configs/ls1021atwr_qspi_defconfig +1 -0
@@ -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
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig +1 -0
@@ -71,3 +71,4 @@ CONFIG_VIDEO=y CONFIG_RSA=y CONFIG_SPL_RSA=y CONFIG_DM_I2C=y +CONFIG_DM_GPIO=y
configs/ls1021atwr_sdcard_ifc_defconfig +1 -0
@@ -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
configs/ls1021atwr_sdcard_qspi_defconfig +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 34/42 ls1021aqds: dcu: support dm_i2c_* API
In reply to Biwen LiThis 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'
`
--- board/freescale/ls1021aqds/dcu.c | 43 +++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-)
board/freescale/ls1021aqds/dcu.c +40 -3
@@ -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 ; }
Signature · 1 line
2.17.1
PATCH 35/42 board: freescale: ls1021aqds: support dm_i2c_* API
In reply to Biwen LiThis 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'`
--- board/freescale/ls1021aqds/ls1021aqds.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
board/freescale/ls1021aqds/ls1021aqds.c +17 -3
@@ -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 ();
Signature · 1 line
2.17.1
PATCH 36/42 include/configs: ls1021atwr: i2c: do not define DM_I2C for spl
In reply to Biwen LiThis 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`
--- include/configs/ls1021atwr.h | 1 + 1 file changed, 1 insertion(+)
include/configs/ls1021atwr.h +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 37/42 video: dcu: support dm_i2c_* API
In reply to Biwen LiThis 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
--- board/freescale/common/dcu_sii9022a.c | 94 +++++++++++++++++++++++++++ 1 file changed, 94 insertions(+)
board/freescale/common/dcu_sii9022a.c +94 -0
@@ -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 ; }
Signature · 1 line
2.17.1
PATCH 38/42 board: freescale: common: diu_ch7301: support dm_i2c_* API
In reply to Biwen LiThis 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
--- board/freescale/common/diu_ch7301.c | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+)
board/freescale/common/diu_ch7301.c +79 -0
@@ -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 );
Signature · 1 line
2.17.1
PATCH 39/42 rtc: pcf8563: support driver model
In reply to Biwen LiThis 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]
--- drivers/rtc/pcf8563.c | 107 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+)
drivers/rtc/pcf8563.c +107 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 40/42 armv8: fsl-layerscape: spl: fix build error when enabled CONFIG_DM_I2C
In reply to Biwen LiThis 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]`
--- arch/arm/cpu/armv8/fsl-layerscape/spl.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/spl.c +2 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 41/42 i2c: mxc_i2c: add DM_FLAG_PRE_RELOC flag
In reply to Biwen LiThis adds DM_FLAG_PRE_RELOC flag to probe i2c driver before relocation
--- drivers/i2c/mxc_i2c.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/mxc_i2c.c +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH 42/42 Kconfigs: layerscape: use a convenient default value for SYS_MALLOC_F_LEN
In reply to Biwen LiThe 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
--- Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Kconfig +3 -1
@@ -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,
Signature · 1 line
2.17.1
PATCH 1/42 configs: ls1012a: enable CONFIG_DM_I2C
In reply to Biwen LiQuoted 183 lines
-----Original Message-----
From: Biwen Li <[email protected]>
Sent: Thursday, November 14, 2019 4:06 PM
To: Jagdish Gediya <[email protected]>; Priyanka Jain <[email protected]>; hs at denx.de; jagan at amarulasolutions.com; aford173 at gmail.com; Alison Wang <[email protected]>; bhaskar.upadhaya at nxp.com; feng.li_2 at nxp.com; jh80.chung at samsung.com; Pramod Kumar <[email protected]>; Rajesh Bhagat <[email protected]>; Ruchika Gupta <[email protected]>; olteanv at gmail.com
Cc: Xiaobo Xie <[email protected]>; Jiafei Pan <[email protected]>; u- boot at lists.denx.de; Biwen Li <[email protected]>
Subject: [PATCH 01/42] configs: ls1012a: enableCONFIG_DM_I2CThis enables
CONFIG_DM_I2Cfor SoC LS1012ASigned-off-by Biwen Li <[email protected]>---
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(+)configs/ls1012a2g5rdb_qspi_defconfig +0
-0@@ -47,3 +47,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012a2g5rdb_qspi_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012a2g5rdb_tfa_defconfig +0
-0@@ -47,3 +47,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012a2g5rdb_tfa_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012afrdm_qspi_defconfig +0
-0@@ -47,3 +47,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012afrdm_qspi_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012afrdm_tfa_defconfig +0
-0@@ -47,3 +47,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012afrdm_tfa_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012afrwy_qspi_SECURE_BOOT_defconfig +0
-0@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=yCONFIG_RSA=yCONFIG_RSA_SOFTWARE_EXP=yconfigs/ls1012afrwy_qspi_SECURE_BOOT_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012afrwy_qspi_defconfig +0
-0@@ -49,3 +49,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012afrwy_qspi_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012afrwy_tfa_SECURE_BOOT_defconfig +0
-0@@ -52,3 +52,4 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=yCONFIG_RSA=yCONFIG_RSA_SOFTWARE_EXP=yconfigs/ls1012afrwy_tfa_SECURE_BOOT_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012afrwy_tfa_defconfig +0
-0@@ -51,3 +51,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012afrwy_tfa_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012aqds_qspi_defconfig +0
-0@@ -71,3 +71,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012aqds_qspi_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012aqds_tfa_SECURE_BOOT_defconfig +0
-0@@ -65,3 +65,4 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=yCONFIG_RSA=yCONFIG_RSA_SOFTWARE_EXP=yconfigs/ls1012aqds_tfa_SECURE_BOOT_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012aqds_tfa_defconfig +0
-0@@ -71,3 +71,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012aqds_tfa_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012ardb_qspi_SECURE_BOOT_defconfig +0
-0@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=yCONFIG_RSA=yCONFIG_RSA_SOFTWARE_EXP=yconfigs/ls1012ardb_qspi_SECURE_BOOT_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012ardb_qspi_defconfig +0
-0@@ -54,3 +54,4 @@ CONFIG_USB=y
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=yconfigs/ls1012ardb_qspi_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012ardb_tfa_SECURE_BOOT_defconfig +0
-0@@ -55,3 +55,4 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=yCONFIG_RSA=yCONFIG_RSA_SOFTWARE_EXP=yconfigs/ls1012ardb_tfa_SECURE_BOOT_defconfig +1
-0+CONFIG_DM_I2C=yconfigs/ls1012ardb_tfa_defconfig +0
-0@@ -55,3 +55,4 @@ CONFIG_USB=y
Quoted 6 lines
CONFIG_DM_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_XHCI_DWC3=y
+CONFIG_DM_I2C=y
--
2.17.1