diff options
author | Stephen Carlson <stcarlso@linux.microsoft.com> | 2021-06-23 02:42:02 +0300 |
---|---|---|
committer | Priyanka Jain <priyanka.jain@nxp.com> | 2021-07-20 11:48:05 +0300 |
commit | 17c2a308a543de2e16af06ddf840588bea4970c6 (patch) | |
tree | 90ace39f0489e10cab5e4f133a1c17faf6653754 /board | |
parent | f4cd4a7b8be1600d87398930af0574d11c9e687b (diff) | |
download | u-boot-17c2a308a543de2e16af06ddf840588bea4970c6.tar.xz |
board: freescale: ls2080a, ls2088a: Update I2C mux config
Updates the board configuration to enable use of the PCA9547 I2C mux.
Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
[Squashed ls2088a patch to fix compilation]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/ls2080aqds/ls2080aqds.c | 25 | ||||
-rw-r--r-- | board/freescale/ls2080ardb/ls2080ardb.c | 27 |
2 files changed, 5 insertions, 47 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/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); |