4f36270aa7f4e05698092ee7f54aa88e13673dc3
[openwrt/openwrt.git] / target / linux / lantiq / patches-3.14 / 0019-MTD-lantiq-Makes-the-Lantiq-flash-driver-try-jedec-p.patch
1 From 4e2a4dcadb70985e86d9cebfca308891be377510 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 7 Aug 2014 18:57:30 +0200
4 Subject: [PATCH 19/31] MTD: lantiq: Makes the Lantiq flash driver try jedec
5 probing if cfi probing fails.
6
7 (Based on work by Simon Hayes first published on www.psidoc.com and
8 http://sourceforge.net/projects/hh2b4ever/)
9
10 Signed-off-by: Ben Mulvihill <ben.mulvihill@gmail.com>
11 Signed-off-by: John Crispin <blogic@openwrt.org>
12 ---
13 drivers/mtd/maps/lantiq-flash.c | 10 +++++++++-
14 1 file changed, 9 insertions(+), 1 deletion(-)
15
16 diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
17 index 710d699..dd1e853 100644
18 --- a/drivers/mtd/maps/lantiq-flash.c
19 +++ b/drivers/mtd/maps/lantiq-flash.c
20 @@ -117,6 +117,11 @@ ltq_mtd_probe(struct platform_device *pdev)
21 struct cfi_private *cfi;
22 int err;
23
24 + static const char *rom_probe_types[] = {
25 + "cfi_probe", "jedec_probe", NULL
26 + };
27 + const char **type;
28 +
29 if (of_machine_is_compatible("lantiq,falcon") &&
30 (ltq_boot_select() != BS_FLASH)) {
31 dev_err(&pdev->dev, "invalid bootstrap options\n");
32 @@ -158,7 +163,10 @@ ltq_mtd_probe(struct platform_device *pdev)
33 ltq_mtd->map->copy_to = ltq_copy_to;
34
35 ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING;
36 - ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map);
37 +
38 + for (type = rom_probe_types; !ltq_mtd->mtd && *type; type++)
39 + ltq_mtd->mtd = do_map_probe(*type, ltq_mtd->map);
40 +
41 ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL;
42
43 if (!ltq_mtd->mtd) {
44 --
45 1.7.10.4
46