summaryrefslogtreecommitdiffstats
path: root/board/freescale/ls1012aqds
diff options
context:
space:
mode:
authorBiwen Li <biwen.li@nxp.com>2019-12-31 15:33:41 +0800
committerPriyanka Jain <priyanka.jain@nxp.com>2020-02-04 16:20:25 +0530
commita0affb367ad638e1e6f51ed3678d3daad5724a40 (patch)
treea87af25eca96e994c219b4264588fd4641d48c0d /board/freescale/ls1012aqds
parent6089d8ab31daa04ca693ba2b9c2bfca1e53cfc65 (diff)
downloadu-boot-a0affb367ad638e1e6f51ed3678d3daad5724a40.tar.gz
u-boot-a0affb367ad638e1e6f51ed3678d3daad5724a40.tar.xz
u-boot-a0affb367ad638e1e6f51ed3678d3daad5724a40.zip
dm: arm64: ls1012a: add i2c DM support
This supports i2c DM and enables CONFIG_DM_I2C for SoC LS1012A Signed-off-by: Biwen Li <biwen.li@nxp.com> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'board/freescale/ls1012aqds')
-rw-r--r--board/freescale/ls1012aqds/ls1012aqds.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c
index 86c72ee357..30bf1047d5 100644
--- a/board/freescale/ls1012aqds/ls1012aqds.c
+++ b/board/freescale/ls1012aqds/ls1012aqds.c
@@ -107,10 +107,26 @@ int board_early_init_f(void)
int misc_init_r(void)
{
u8 mux_sdhc_cd = 0x80;
-
- i2c_set_bus_num(0);
+ int bus_num = 0;
+
+#ifdef CONFIG_DM_I2C
+ struct udevice *dev;
+ int ret;
+
+ ret = i2c_get_chip_for_busnum(bus_num, CONFIG_SYS_I2C_FPGA_ADDR,
+ 1, &dev);
+ if (ret) {
+ printf("%s: Cannot find udev for a bus %d\n", __func__,
+ bus_num);
+ return ret;
+ }
+ dm_i2c_write(dev, 0x5a, &mux_sdhc_cd, 1);
+#else
+ i2c_set_bus_num(bus_num);
i2c_write(CONFIG_SYS_I2C_FPGA_ADDR, 0x5a, 1, &mux_sdhc_cd, 1);
+#endif
+
return 0;
}
#endif