summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2016-03-16 13:50:54 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 14:04:35 +0800
commit2d3b5df8530cd5ef883750378838dea7c40259af (patch)
tree346ff7728eddc05a01e58e4d6277a753c6b8acab /drivers/spi
parent8aef13ebd92f709f4e6b80cf46c7cfe0f69bb211 (diff)
downloadu-boot-imx-2d3b5df8530cd5ef883750378838dea7c40259af.zip
u-boot-imx-2d3b5df8530cd5ef883750378838dea7c40259af.tar.gz
u-boot-imx-2d3b5df8530cd5ef883750378838dea7c40259af.tar.bz2
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. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e)
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/fsl_qspi.c15
-rw-r--r--drivers/spi/mxc_spi.c10
2 files changed, 25 insertions, 0 deletions
diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
index b2a0583..cdbe5d9 100644
--- a/drivers/spi/fsl_qspi.c
+++ b/drivers/spi/fsl_qspi.c
@@ -15,6 +15,7 @@
#include <errno.h>
#include <watchdog.h>
#include "fsl_qspi.h"
+#include <asm/arch/sys_proto.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -873,6 +874,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;
@@ -985,6 +993,13 @@ static int fsl_qspi_probe(struct udevice *bus)
struct dm_spi_bus *dm_spi_bus;
int i;
+#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;
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index fc2786e..a1c4ec0 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ *
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -13,6 +15,7 @@
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
#include <asm/imx-common/spi.h>
+#include <asm/arch/sys_proto.h>
#ifdef CONFIG_MX27
/* i.MX27 has a completely wrong register layout and register definitions in the
@@ -413,6 +416,13 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
return NULL;
}
+#ifdef CONFIG_MX6
+ if (mx6_ecspi_fused(spi_bases[bus])) {
+ printf("ECSPI@0x%lx is fused, disable it\n", spi_bases[bus]);
+ return NULL;
+ }
+#endif
+
mxcs = spi_alloc_slave(struct mxc_spi_slave, bus, cs);
if (!mxcs) {
puts("mxc_spi: SPI Slave not allocated !\n");