]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: freescale: lx2160a: Update I2C mux config
authorStephen Carlson <stcarlso@linux.microsoft.com>
Tue, 22 Jun 2021 23:43:03 +0000 (16:43 -0700)
committerPriyanka Jain <priyanka.jain@nxp.com>
Tue, 20 Jul 2021 08:48:05 +0000 (14:18 +0530)
Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
board/freescale/lx2160a/lx2160a.c
configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
configs/lx2160aqds_tfa_defconfig
configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
configs/lx2160ardb_tfa_defconfig
configs/lx2160ardb_tfa_stmm_defconfig
configs/lx2162aqds_tfa_SECURE_BOOT_defconfig
configs/lx2162aqds_tfa_defconfig
configs/lx2162aqds_tfa_verified_boot_defconfig

index 891bc0051413379d93f739f3ec45310c422a25b0..db00ad867ddd795f2b4988317eeca59cbb07eb2a 100644 (file)
@@ -29,6 +29,8 @@
 #include <asm/arch/config.h>
 #include <asm/arch/fsl_serdes.h>
 #include <asm/arch/soc.h>
+#include "../common/i2c_mux.h"
+
 #include "../common/qixis.h"
 #include "../common/vid.h"
 #include <fsl_immap.h>
@@ -79,27 +81,6 @@ U_BOOT_DRVINFO(nxp_serial1) = {
        .plat = &serial1,
 };
 
-int select_i2c_ch_pca9547(u8 ch)
-{
-       int ret;
-
-#if !CONFIG_IS_ENABLED(DM_I2C)
-       ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
-#else
-       struct udevice *dev;
-
-       ret = i2c_get_chip_for_busnum(0, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
-       if (!ret)
-               ret = dm_i2c_write(dev, 0, &ch, 1);
-#endif
-       if (ret) {
-               puts("PCA: failed to select proper channel\n");
-               return ret;
-       }
-
-       return 0;
-}
-
 static void uart_get_clock(void)
 {
        serial0.clock = get_serial_clock();
@@ -115,10 +96,10 @@ int board_early_init_f(void)
        uart_get_clock();
 
 #ifdef CONFIG_EMC2305
-       select_i2c_ch_pca9547(I2C_MUX_CH_EMC2305);
+       select_i2c_ch_pca9547(I2C_MUX_CH_EMC2305, 0);
        emc2305_init(I2C_EMC2305_ADDR);
        set_fan_speed(I2C_EMC2305_PWM, I2C_EMC2305_ADDR);
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 #endif
 
        fsl_lsch3_early_init_f();
@@ -275,7 +256,7 @@ int esdhc_status_fixup(void *blob, const char *compat)
 #if defined(CONFIG_VID)
 int i2c_multiplexer_select_vid_channel(u8 channel)
 {
-       return select_i2c_ch_pca9547(channel);
+       return select_i2c_ch_pca9547(channel, 0);
 }
 
 int init_func_vid(void)
@@ -611,7 +592,7 @@ int board_init(void)
        gd->env_addr = (ulong)&default_environment[0];
 #endif
 
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
 #if defined(CONFIG_FSL_MC_ENET) && defined(CONFIG_TARGET_LX2160ARDB)
        /* invert AQR107 IRQ pins polarity */
index 5cdf47221f9065ca59d9decc8442f5467225ffcc..9c5d0067dcc4f48c94f01405e27690d9c0a24189 100644 (file)
@@ -85,3 +85,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index d6fbfe0f9e778dfb026966780e822d06e9c7b007..2a755e05740c81357caeaaf6e73ab1b02770421d 100644 (file)
@@ -91,3 +91,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_WDT=y
 CONFIG_WDT_SBSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 8151ebdb2a8afa1c5e4a5d2ba52a8504643cd640..40fbaca4ed0a1254c5bb0c1b67879fb85c88d4fc 100644 (file)
@@ -76,3 +76,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 1dbf8f08c219b90c0c1e50b9e7212650c30da931..b75d217d67cbe3bff8c8cd2c92cdef45755861d8 100644 (file)
@@ -86,3 +86,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_WDT=y
 CONFIG_WDT_SBSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 9b921e73e66f4ca9bb831ddf92bdb07a91e2a78a..9d1e9dc5b7ac462f0cece6acda08935f2a007f8d 100644 (file)
@@ -85,3 +85,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_MM_COMM_TEE=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 2840fd9bb5e3b5c6c2b32f267486ad0968f81a17..f9fdee8a093a8f942e53a16574e4eada4fb4050e 100644 (file)
@@ -88,3 +88,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 5174dbcf03ca00457df1d87c29100e0935be29c6..76f4abab32dc81ff9b31da7071e546ccba9888f1 100644 (file)
@@ -95,3 +95,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_WDT=y
 CONFIG_WDT_SBSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 96d9ba6e83c5bc3e6c2d79a415e90f1caa388bda..b31403a25e41cc2b19e1ff518f21829e2a51be1c 100644 (file)
@@ -96,3 +96,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_WDT=y
 CONFIG_WDT_SBSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y