From 6e8c9ae136bee8ec0121c1db4b935510caad09db Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 16 Mar 2016 13:50:54 +0800 Subject: 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 (cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e) (cherry picked from commit 2d3b5df8530cd5ef883750378838dea7c40259af) --- drivers/spi/fsl_qspi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/spi/fsl_qspi.c') diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index 662cd1ae051..7359cb6cdc0 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -16,6 +16,7 @@ #include #include #include "fsl_qspi.h" +#include DECLARE_GLOBAL_DATA_PTR; @@ -944,6 +945,13 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, if (bus >= ARRAY_SIZE(spi_bases)) return NULL; +#ifdef CONFIG_MX6 + if (mx6_qspi_fused(spi_bases[bus])) { + printf("QSPI@0x%lx is fused, disable it\n", spi_bases[bus]); + return NULL; + } +#endif + if (cs >= FSL_QSPI_FLASH_NUM) return NULL; @@ -1074,6 +1082,13 @@ static int fsl_qspi_probe(struct udevice *bus) struct dm_spi_bus *dm_spi_bus; int i, ret; +#ifdef CONFIG_MX6 + if (mx6_qspi_fused(plat->reg_base)) { + printf("QSPI@0x%lx is fused, disable it\n", plat->reg_base); + return -ENODEV; + } +#endif + dm_spi_bus = bus->uclass_priv; dm_spi_bus->max_hz = plat->speed_hz; -- cgit v1.2.3