summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2016-03-16 13:50:54 +0800
committerYe Li <ye.li@nxp.com>2018-04-27 02:30:47 -0700
commit6e8c9ae136bee8ec0121c1db4b935510caad09db (patch)
treedce1ab3cbcf02f970c9265b36ff3e5875173106f /drivers/i2c
parente93235cbcf624a476c95f4e9e8fd51e667ab4aa2 (diff)
MLK-12483-4 mx6: Modify drivers to disable fused modules
Add the fuse checking in drivers, when the module is disabled in fuse, the driver will not work. Changed drivers: BEE, GPMI, APBH-DMA, ESDHC, FEC, QSPI, ECSPI, I2C, USB-EHCI, GIS, LCDIF and EPDC. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e) (cherry picked from commit 2d3b5df8530cd5ef883750378838dea7c40259af)
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/mxc_i2c.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 79228c2757..4ef8f6c802 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -4,6 +4,8 @@
* (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
* (c) 2011 Marek Vasut <marek.vasut@gmail.com>
*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ *
* Based on i2c-imx.c from linux kernel:
* Copyright (C) 2005 Torsten Koschorrek <koschorrek at synertronixx.de>
* Copyright (C) 2005 Matthias Blaschke <blaschke at synertronixx.de>
@@ -25,6 +27,7 @@
#include <dm.h>
#include <dm/pinctrl.h>
#include <fdtdec.h>
+#include <asm/arch/sys_proto.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -648,6 +651,14 @@ void bus_i2c_init(int index, int speed, int unused,
return;
}
+#ifdef CONFIG_MX6
+ if (mx6_i2c_fused((u32)mxc_i2c_buses[index].base)) {
+ printf("I2C@0x%x is fused, disable it\n",
+ (u32)mxc_i2c_buses[index].base);
+ return;
+ }
+#endif
+
/*
* Warning: Be careful to allow the assignment to a static
* variable here. This function could be called while U-Boot is
@@ -761,6 +772,13 @@ static int mxc_i2c_probe(struct udevice *bus)
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
+#ifdef CONFIG_MX6
+ if (mx6_i2c_fused(addr)) {
+ printf("I2C@0x%lx is fused, disable it\n", addr);
+ return -ENODEV;
+ }
+#endif
+
i2c_bus->base = addr;
i2c_bus->index = bus->seq;
i2c_bus->bus = bus;