[PATCH v2 07/14] board: freescale: ls2080aqds: Update I2C mux config

Stephen Carlson stcarlso at linux.microsoft.com
Thu Jun 24 21:35:28 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/ls2080aqds/ls2080aqds.c  | 25 ++----------------------
  configs/ls2080aqds_SECURE_BOOT_defconfig |  1 +
  configs/ls2080aqds_defconfig             |  1 +
  configs/ls2080aqds_nand_defconfig        |  1 +
  configs/ls2080aqds_qspi_defconfig        |  1 +
  configs/ls2080aqds_sdcard_defconfig      |  1 +
  6 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c
index 9572319234..c48b01f7d7 100644
--- a/board/freescale/ls2080aqds/ls2080aqds.c
+++ b/board/freescale/ls2080aqds/ls2080aqds.c
@@ -23,7 +23,7 @@
  #include <fsl_sec.h>
  #include <asm/arch/ppa.h>
  #include <asm/arch-fsl-layerscape/fsl_icid.h>
-
+#include "../common/i2c_mux.h"

  #include "../common/qixis.h"
  #include "ls2080aqds_qixis.h"
@@ -161,27 +161,6 @@ unsigned long get_board_ddr_clk(void)
  	return 66666666;
  }

-int select_i2c_ch_pca9547(u8 ch)
-{
-	int ret;
-#if CONFIG_IS_ENABLED(DM_I2C)
-	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);
-
-#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;
-	}
-
-	return 0;
-}
-
  int config_board_mux(int ctrl_type)
  {
  	u8 reg5;
@@ -235,7 +214,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_RTC_ENABLE_32KHZ_OUTPUT
  #if CONFIG_IS_ENABLED(DM_I2C)
diff --git a/configs/ls2080aqds_SECURE_BOOT_defconfig b/configs/ls2080aqds_SECURE_BOOT_defconfig
index bfa697c9ef..9e687f8066 100644
--- a/configs/ls2080aqds_SECURE_BOOT_defconfig
+++ b/configs/ls2080aqds_SECURE_BOOT_defconfig
@@ -68,3 +68,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/ls2080aqds_defconfig b/configs/ls2080aqds_defconfig
index 6f9cce5b25..a13e471a68 100644
--- a/configs/ls2080aqds_defconfig
+++ b/configs/ls2080aqds_defconfig
@@ -69,3 +69,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/ls2080aqds_nand_defconfig b/configs/ls2080aqds_nand_defconfig
index cc0f2b16aa..808140f10b 100644
--- a/configs/ls2080aqds_nand_defconfig
+++ b/configs/ls2080aqds_nand_defconfig
@@ -76,3 +76,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/ls2080aqds_qspi_defconfig b/configs/ls2080aqds_qspi_defconfig
index cbdf733456..51ab47a583 100644
--- a/configs/ls2080aqds_qspi_defconfig
+++ b/configs/ls2080aqds_qspi_defconfig
@@ -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_FSL_USE_PCA9547_MUX=y
diff --git a/configs/ls2080aqds_sdcard_defconfig b/configs/ls2080aqds_sdcard_defconfig
index 71174de458..79fa0e179f 100644
--- a/configs/ls2080aqds_sdcard_defconfig
+++ b/configs/ls2080aqds_sdcard_defconfig
@@ -75,3 +75,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