summaryrefslogtreecommitdiff
path: root/board/freescale/t1040qds/t1040qds.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-05-05 09:08:53 -0400
committerTom Rini <trini@konsulko.com>2020-05-05 09:08:53 -0400
commit191ee8aac60d6b828ee5f933ab2c6aceda167082 (patch)
tree4c0c12e8e510475050a7ca42ee6da6e076805bad /board/freescale/t1040qds/t1040qds.c
parent425fefa9a36ca729b5088ca5381f63f8d95a2f8e (diff)
parent9e36eae1249f477275a607736eda75e663d1b57c (diff)
downloadu-boot-191ee8aac60d6b828ee5f933ab2c6aceda167082.tar.gz
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
- Add DM model for P1010RDB - Add I2C DM Model support for P1010RDB, T1042RDB, T2080, T4240RDB, MPC8548CDS, T1024RDB, P4080, P3041DS, P2041RDB, P2020RDB, P1020RDB, P5040DS - Fix reference to READM.qe_firmware
Diffstat (limited to 'board/freescale/t1040qds/t1040qds.c')
-rw-r--r--board/freescale/t1040qds/t1040qds.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c
index 92dd9237ec..9e253fdec2 100644
--- a/board/freescale/t1040qds/t1040qds.c
+++ b/board/freescale/t1040qds/t1040qds.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2013 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
*/
#include <common.h>
@@ -79,11 +80,24 @@ int checkboard(void)
return 0;
}
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
{
int ret;
+#ifdef CONFIG_DM_I2C
+ struct udevice *dev;
+
+ ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
+ if (ret) {
+ printf("%s: Cannot find udev for a bus %d\n", __func__,
+ bus_num);
+ return 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;
@@ -154,7 +168,7 @@ int board_early_init_r(void)
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
0, flash_esel, BOOKE_PAGESZ_256M, 1);
#endif
- select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
return 0;
}