[PATCH v2 08/14] board: freescale: ls2080ardb: Update I2C mux config

Stephen Carlson stcarlso at linux.microsoft.com
Thu Jun 24 21:35:49 CEST 2021


Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso at linux.microsoft.com>
---
  board/freescale/ls2080ardb/ls2080ardb.c  | 27 +++---------------------
  configs/ls2080ardb_SECURE_BOOT_defconfig |  1 +
  configs/ls2080ardb_defconfig             |  1 +
  configs/ls2080ardb_nand_defconfig        |  1 +
  4 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
index 3a026b0827..6504cf768f 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -25,6 +25,7 @@
  #include <asm/arch/ppa.h>
  #include <fsl_sec.h>
  #include <asm/arch-fsl-layerscape/fsl_icid.h>
+#include "../common/i2c_mux.h"

  #ifdef CONFIG_FSL_QIXIS
  #include "../common/qixis.h"
@@ -205,31 +206,9 @@ unsigned long get_board_sys_clk(void)
  	return 100000000;
  }

-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;
-}
-
  int i2c_multiplexer_select_vid_channel(u8 channel)
  {
-	return select_i2c_ch_pca9547(channel);
+	return select_i2c_ch_pca9547(channel, 0);
  }

  int config_board_mux(int ctrl_type)
@@ -267,7 +246,7 @@ int board_init(void)
  #ifdef CONFIG_ENV_IS_NOWHERE
  	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);

  #ifdef CONFIG_FSL_QIXIS
  	QIXIS_WRITE(rst_ctl, QIXIS_RST_CTL_RESET_EN);
diff --git a/configs/ls2080ardb_SECURE_BOOT_defconfig b/configs/ls2080ardb_SECURE_BOOT_defconfig
index 1175aafadb..b3cc52ba03 100644
--- a/configs/ls2080ardb_SECURE_BOOT_defconfig
+++ b/configs/ls2080ardb_SECURE_BOOT_defconfig
@@ -66,3 +66,4 @@ CONFIG_USB_XHCI_DWC3=y
  CONFIG_RSA=y
  CONFIG_RSA_SOFTWARE_EXP=y
  CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig
index 53abd06ec6..b3c5001c50 100644
--- a/configs/ls2080ardb_defconfig
+++ b/configs/ls2080ardb_defconfig
@@ -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_FSL_USE_PCA9547_MUX=y
diff --git a/configs/ls2080ardb_nand_defconfig b/configs/ls2080ardb_nand_defconfig
index 93032edc0c..63fadc5255 100644
--- a/configs/ls2080ardb_nand_defconfig
+++ b/configs/ls2080ardb_nand_defconfig
@@ -72,3 +72,4 @@ CONFIG_DM_USB=y
  CONFIG_USB_XHCI_HCD=y
  CONFIG_USB_XHCI_DWC3=y
  CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_FSL_USE_PCA9547_MUX=y
-- 
2.17.1


More information about the U-Boot mailing list