]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Convert CONFIG_SYS_I2C_EARLY_INIT to Kconfig
authorTom Rini <trini@konsulko.com>
Thu, 19 Aug 2021 03:12:25 +0000 (23:12 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 30 Aug 2021 18:10:07 +0000 (14:10 -0400)
Convert SYS_I2C_EARLY_INIT to Kconfig, and make it depend on
SPL_SYS_I2C_LEGACY.  Remove the weak implementation as it's either
something that needs to exist for real, or shouldn't be called.

Signed-off-by: Tom Rini <trini@konsulko.com>
31 files changed:
arch/arm/include/asm/arch-fsl-layerscape/config.h
board/freescale/ls1028a/ls1028a.c
board/freescale/ls1043aqds/ls1043aqds.c
board/freescale/ls1046aqds/ls1046aqds.c
board/freescale/ls2080aqds/ls2080aqds.c
board/freescale/ls2080ardb/ls2080ardb.c
board/freescale/lx2160a/lx2160a.c
configs/ls1043aqds_qspi_defconfig
configs/ls1043aqds_sdcard_qspi_defconfig
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
configs/ls1043aqds_tfa_defconfig
configs/ls1046aqds_qspi_defconfig
configs/ls1046aqds_sdcard_qspi_defconfig
configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
configs/ls1046aqds_tfa_defconfig
configs/ls1088aqds_defconfig
configs/ls1088aqds_sdcard_ifc_defconfig
configs/ls2080aqds_nand_defconfig
configs/ls2080aqds_qspi_defconfig
configs/ls2080aqds_sdcard_defconfig
configs/ls2081ardb_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_defconfig
drivers/i2c/Kconfig
drivers/i2c/i2c_core.c
include/configs/ls1043aqds.h
include/configs/ls1046aqds.h
include/configs/ls1088aqds.h
include/configs/ls2080aqds.h
include/configs/ls2080ardb.h
include/i2c.h

index f8d0656ca98e4b0ca9588bfb048d3ee6fd2c5217..7a7f166e823cd0cda7bc2b18a90ccb989ad6a07b 100644 (file)
 #elif defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A)
 #define TZPC_BASE                              0x02200000
 #define TZPCDECPROT_0_SET_BASE                 (TZPC_BASE + 0x804)
-#if !CONFIG_IS_ENABLED(DM_I2C)
-#define CONFIG_SYS_I2C_EARLY_INIT
-#endif
 #define SRDS_MAX_LANES  8
 #ifndef L1_CACHE_BYTES
 #define L1_CACHE_SHIFT         6
index 5269fd34c693e44cefb2a704b16c3441c5d37f93..461c571b36c8e5f1b525d944c268bd765e2e9d58 100644 (file)
@@ -137,7 +137,7 @@ int board_early_init_f(void)
        u8 uart;
 #endif
 
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
+#if defined(CONFIG_SYS_I2C_EARLY_INIT) && defined(CONFIG_SPL_BUILD)
        i2c_early_init_f();
 #endif
 
index 76bbb6087afdc354b56a8b69a79c5b5fa7f01a09..2d5322406aa1043c80553243bdc66d672e22fc9d 100644 (file)
@@ -52,10 +52,6 @@ enum {
 #define CFG_UART_MUX_SHIFT     1
 #define CFG_LPUART_EN          0x1
 
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
-void i2c_early_init_f(void);
-#endif
-
 #ifdef CONFIG_TFABOOT
 struct ifc_regs ifc_cfg_nor_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = {
        {
@@ -447,7 +443,7 @@ int board_early_init_f(void)
         */
        out_le32(cntcr, 0x1);
 
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
+#if defined(CONFIG_SYS_I2C_EARLY_INIT)
        i2c_early_init_f();
 #endif
        fsl_lsch2_early_init_f();
index 2b0786ac30d4b59d09dee9768b44413a28967634..cc95d441b607c05256202c1fc4b485c2aaf9fe05 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
-void i2c_early_init_f(void);
-#endif
-
 #ifdef CONFIG_TFABOOT
 struct ifc_regs ifc_cfg_nor_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = {
        {
@@ -318,7 +314,7 @@ int board_early_init_f(void)
         */
        out_le32(cntcr, 0x1);
 
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
+#if defined(CONFIG_SYS_I2C_EARLY_INIT)
        i2c_early_init_f();
 #endif
        fsl_lsch2_early_init_f();
index c48b01f7d7d14e3a435cfea9d8cc0b9b59edc8a9..62658c4702907d18c3369388219a4cb44883885d 100644 (file)
@@ -241,7 +241,7 @@ int board_init(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
+#if defined(CONFIG_SYS_I2C_EARLY_INIT)
        i2c_early_init_f();
 #endif
        fsl_lsch3_early_init_f();
index e8722f20c139489173f72dd4ed3072a6a4827f52..58b852383e995f93d475991f524f7605c0aafee9 100644 (file)
@@ -314,7 +314,7 @@ int board_init(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
+#if defined(CONFIG_SYS_I2C_EARLY_INIT)
        i2c_early_init_f();
 #endif
        fsl_lsch3_early_init_f();
index f505e82fb963967b942eac14702f2774efbdc702..e61289d228027899225cb389ec9cfac0a96646dd 100644 (file)
@@ -89,7 +89,7 @@ static void uart_get_clock(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
+#if defined(CONFIG_SYS_I2C_EARLY_INIT) && defined(CONFIG_SPL_BUILD)
        i2c_early_init_f();
 #endif
        /* get required clock for UART IP */
index 4825ff2d1bbc7235b6ed57bf7edfb8e22484e77c..dabaadf73d49140dfa850b4e0736022e6339c4f4 100644 (file)
@@ -45,6 +45,7 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 # CONFIG_SPI_FLASH_BAR is not set
index 0cd69fd596ef427c5a91f935db57a8e3239e4fcb..750fd544deeb06142b204538971de7900800ca21 100644 (file)
@@ -58,6 +58,7 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 # CONFIG_SPI_FLASH_BAR is not set
index c7a4b463f389f00209933091ebc2ab35036ee50f..c9d22e73750b96d766ac9a940454e753ca324420 100644 (file)
@@ -42,6 +42,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_DM_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 4903cb2c0c96990dbda9991e47b24ca5641a94d0..12240b0147ce29bd4c002a223dd5c9c9a6ef7b93 100644 (file)
@@ -52,6 +52,7 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index f0c281ecae9b26a53245b068683370eba1ad8a6c..1b06cc640853c21edaa5c11df646cdf17091fec2 100644 (file)
@@ -44,6 +44,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 # CONFIG_SPI_FLASH_BAR is not set
index 6100417cd8b009a51823a3daf85a8755a9b40b9a..16fb3c41dfa5ec9e0a8cbaab2b11176cfe89e6a2 100644 (file)
@@ -59,6 +59,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 # CONFIG_SPI_FLASH_BAR is not set
index c4005ab43a2118acfd3aecb52539043768d764e7..d12c8b6a0caeb319bc874c7fb1f96534c4351238 100644 (file)
@@ -42,6 +42,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 05972837a1c2324e487d820fd12a0528e3048929..6ff00d56abbb158014f95b080a053ae0b8795aea 100644 (file)
@@ -51,6 +51,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index db23c448610f50e0d03a3358cdf8109e6977c451..dd9c18b05bf2b842f3c254ae5e6170eccedb9c4d 100644 (file)
@@ -46,6 +46,7 @@ CONFIG_DM=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 19a0b2e8d103209ed5f0d8e1a19d7cef4c2e3c45..4281fd2dbf288895ef9011f817cd6f53f28aad68 100644 (file)
@@ -57,6 +57,7 @@ CONFIG_DM=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 12037d7283f59faf929e4d866c72944b73392ccc..9e20233315cb31b21b96586b12d5eac1ac95ec85 100644 (file)
@@ -53,6 +53,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index fa5857b4ac73acc2c9e30728c84854884c6545c1..f1d77758669ad58de7749e0c33c070d82067334e 100644 (file)
@@ -44,6 +44,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 7cd1bec0daf1d4f508b757287aa38a5a1acad292..e768f47cfee0f8d8cff86c984bbd86e48a7c9a2b 100644 (file)
@@ -50,6 +50,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index ad32df7ef172e7ba450d862c5881f288e6be7e01..42ccf3f8844b99a485131cecf65eaa225ff004c8 100644 (file)
@@ -41,6 +41,7 @@ CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 26c7074d1893d33059511abe5494a014e08c9b6b..09790e1144c6c80967513bc6fb875400b09ca59f 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 02822a0a48446292e12d056bad68a56fab10aa81..f79a2828ac5bb6db9bbd67df844a9d3ffd4db334 100644 (file)
@@ -44,6 +44,7 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_EARLY_INIT=y
 CONFIG_SYS_I2C_EEPROM_ADDR=0x57
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 1466f8dd9331e1c6b90cc60f35087d11898da0b9..f4df4bac5e67d89918a6f98ad484f2ec0f51d84e 100644 (file)
@@ -69,6 +69,13 @@ config TPL_SYS_I2C_LEGACY
          Enable the legacy I2C subsystem and drivers in TPL.  This is useful
          in some size constrained situations.
 
+config SYS_I2C_EARLY_INIT
+       bool "Enable legacy I2C subsystem early in boot"
+       depends on BOARD_EARLY_INIT_F && SPL_SYS_I2C_LEGACY && SYS_I2C_MXC
+       help
+         Add the function prototype for i2c_early_init_f which is called in
+         board_early_init_f.
+
 config I2C_CROS_EC_TUNNEL
        tristate "Chrome OS EC tunnel I2C bus"
        depends on CROS_EC
index 85cf75ecd9221c0f71824b914c971e0f643334a4..09f91e674d441af342818f4c185d8315d93da950 100644 (file)
@@ -190,11 +190,6 @@ __weak void i2c_init_board(void)
 {
 }
 
-/* implement possible for i2c specific early i2c init */
-__weak void i2c_early_init_f(void)
-{
-}
-
 /*
  * i2c_init_all():
  *
index d3a8681fd845cb2bf6d163257f35122f3482239c..2677090249c4bf4827cc540fa970e25888c3c785 100644 (file)
@@ -186,7 +186,6 @@ unsigned long get_board_ddr_clk(void);
 #if defined(CONFIG_TFABOOT) || \
        defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_QIXIS_I2C_ACCESS
-#define CONFIG_SYS_I2C_EARLY_INIT
 #endif
 
 /*
index 98b3f8be9b1288305bddd2118ed7b1493afbdc1e..b7e6ba890f82373505d6687b859350be424a189a 100644 (file)
@@ -204,7 +204,6 @@ unsigned long get_board_ddr_clk(void);
 #if defined(CONFIG_TFABOOT) || \
        defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_QIXIS_I2C_ACCESS
-#define CONFIG_SYS_I2C_EARLY_INIT
 #endif
 
 /*
index ed70122e74318b4bf230657728ca3ea7b8d52d18..f556fb387f0345788206cd555fde78ee8d47a1ad 100644 (file)
@@ -26,9 +26,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_DDR_CLK_FREQ            100000000
 #else
 #define CONFIG_QIXIS_I2C_ACCESS
-#if !CONFIG_IS_ENABLED(DM_I2C)
-#define CONFIG_SYS_I2C_EARLY_INIT
-#endif
 #define CONFIG_SYS_CLK_FREQ            get_board_sys_clk()
 #define CONFIG_DDR_CLK_FREQ            get_board_ddr_clk()
 #endif
index c94684e3e72172e864745b23bbe6905a0a4db598..dc5f347e510ed0ba1218a7518057808be87b8d22 100644 (file)
@@ -16,9 +16,6 @@ unsigned long get_board_ddr_clk(void);
 
 #ifdef CONFIG_FSL_QSPI
 #define CONFIG_QIXIS_I2C_ACCESS
-#if !CONFIG_IS_ENABLED(DM_I2C)
-#define CONFIG_SYS_I2C_EARLY_INIT
-#endif
 #define CONFIG_SYS_I2C_IFDR_DIV                0x7e
 #endif
 
index 9438af897dd72eaba434c8b9e048e612ded707b0..6362b7f8f0bd89901fcfaecd7b45e2800e4d524b 100644 (file)
@@ -13,9 +13,6 @@
 #ifdef CONFIG_TARGET_LS2081ARDB
 #define CONFIG_QIXIS_I2C_ACCESS
 #endif
-#if !CONFIG_IS_ENABLED(DM_I2C)
-#define CONFIG_SYS_I2C_EARLY_INIT
-#endif
 #endif
 
 #define I2C_MUX_CH_VOL_MONITOR         0xa
index 07867059f68f2d3c195d7b5ad83a68b19ac963bf..2a8649e95ec818307b2cdcbd9759c77779ab811c 100644 (file)
@@ -610,6 +610,10 @@ extern struct acpi_ops i2c_acpi_ops;
  */
 int acpi_i2c_of_to_plat(struct udevice *dev);
 
+#ifdef CONFIG_SYS_I2C_EARLY_INIT
+void i2c_early_init_f(void);
+#endif
+
 #if !CONFIG_IS_ENABLED(DM_I2C)
 
 /*
@@ -756,9 +760,6 @@ extern struct i2c_bus_hose  i2c_bus[];
  * Initialization, must be called once on start up, may be called
  * repeatedly to change the speed and slave addresses.
  */
-#ifdef CONFIG_SYS_I2C_EARLY_INIT
-void i2c_early_init_f(void);
-#endif
 void i2c_init(int speed, int slaveaddr);
 void i2c_init_board(void);