diff options
author | John Crispin <blogic@openwrt.org> | 2012-05-05 09:41:42 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-05-21 09:31:55 -0400 |
commit | fa09eded0e3764ddb8a97440f5b5c5e65e413b6a (patch) | |
tree | f0c018c8ac12a017bf21c2cd808794142bcafa4f /drivers/mtd | |
parent | 02fa961fbf1c79783781cb8967b80ceaa8be4832 (diff) |
MTD: MIPS: lantiq: verify that the NOR interface is available on falcon soc
When running on a FALC-ON SoC, we need to check the bootstrap options to see
if NOR is available.
Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: linux-mtd@lists.infradead.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3815/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/lantiq-flash.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c index aefa11121674..c03456f17004 100644 --- a/drivers/mtd/maps/lantiq-flash.c +++ b/drivers/mtd/maps/lantiq-flash.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mtd/cfi.h> | 19 | #include <linux/mtd/cfi.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
22 | #include <linux/of.h> | ||
22 | 23 | ||
23 | #include <lantiq_soc.h> | 24 | #include <lantiq_soc.h> |
24 | 25 | ||
@@ -116,6 +117,12 @@ ltq_mtd_probe(struct platform_device *pdev) | |||
116 | struct cfi_private *cfi; | 117 | struct cfi_private *cfi; |
117 | int err; | 118 | int err; |
118 | 119 | ||
120 | if (of_machine_is_compatible("lantiq,falcon") && | ||
121 | (ltq_boot_select() != BS_FLASH)) { | ||
122 | dev_err(&pdev->dev, "invalid bootstrap options\n"); | ||
123 | return -ENODEV; | ||
124 | } | ||
125 | |||
119 | ltq_mtd = kzalloc(sizeof(struct ltq_mtd), GFP_KERNEL); | 126 | ltq_mtd = kzalloc(sizeof(struct ltq_mtd), GFP_KERNEL); |
120 | platform_set_drvdata(pdev, ltq_mtd); | 127 | platform_set_drvdata(pdev, ltq_mtd); |
121 | 128 | ||