diff options
author | Huang Shijie <b32955@freescale.com> | 2014-04-15 01:35:59 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:58:21 -0400 |
commit | 753b8b8761404ae98eb0c76734bf512c17311a70 (patch) | |
tree | a4de0bde3080f8c9005e902c7cd4ab17db256846 | |
parent | 545c7383dfba874180b394f8b00b563a6541e158 (diff) |
ENGR00308399 mtd: fsl-quadspi: quit if the M4 is using the quadspi
Detect if the quadspi is used by the M4.
If the M4 does use it, we quit.
Signed-off-by: Huang Shijie <b32955@freescale.com>
-rw-r--r-- | drivers/mtd/spi-nor/fsl-quadspi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 4f8bc62761d6..091b2ed99f86 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c | |||
@@ -882,6 +882,13 @@ static void fsl_qspi_unprep(struct spi_nor *nor, enum spi_nor_ops ops) | |||
882 | clk_disable(q->clk_en); | 882 | clk_disable(q->clk_en); |
883 | } | 883 | } |
884 | 884 | ||
885 | /* If the uboot enable the M4 to use the Quadspi, we should quit. */ | ||
886 | static bool fsl_m4_is_using(struct fsl_qspi *q) | ||
887 | { | ||
888 | return (readl(q->iobase + QUADSPI_BUF0CR) == | ||
889 | QUADSPI_BUFXCR_INVALID_MSTRID); | ||
890 | } | ||
891 | |||
885 | static int fsl_qspi_probe(struct platform_device *pdev) | 892 | static int fsl_qspi_probe(struct platform_device *pdev) |
886 | { | 893 | { |
887 | struct device_node *np = pdev->dev.of_node; | 894 | struct device_node *np = pdev->dev.of_node; |
@@ -948,6 +955,12 @@ static int fsl_qspi_probe(struct platform_device *pdev) | |||
948 | goto map_failed; | 955 | goto map_failed; |
949 | } | 956 | } |
950 | 957 | ||
958 | if (fsl_m4_is_using(q)) { | ||
959 | dev_info(dev, "The M4 is using quadspi controller, we quit.\n"); | ||
960 | ret = -EINVAL; | ||
961 | goto irq_failed; | ||
962 | } | ||
963 | |||
951 | /* find the irq */ | 964 | /* find the irq */ |
952 | ret = platform_get_irq(pdev, 0); | 965 | ret = platform_get_irq(pdev, 0); |
953 | if (ret < 0) { | 966 | if (ret < 0) { |