kernel: refresh patches
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.14 / 0021-MTD-lantiq-Makes-the-Lantiq-flash-driver-try-jedec-p.patch
1 From 11180582ca6efdff86314ae4514e9df3d34a6475 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 21/36] 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 --- a/drivers/mtd/maps/lantiq-flash.c
17 +++ b/drivers/mtd/maps/lantiq-flash.c
18 @@ -117,6 +117,11 @@ ltq_mtd_probe(struct platform_device *pd
19 struct cfi_private *cfi;
20 int err;
21
22 + static const char *rom_probe_types[] = {
23 + "cfi_probe", "jedec_probe", NULL
24 + };
25 + const char **type;
26 +
27 if (of_machine_is_compatible("lantiq,falcon") &&
28 (ltq_boot_select() != BS_FLASH)) {
29 dev_err(&pdev->dev, "invalid bootstrap options\n");
30 @@ -158,7 +163,10 @@ ltq_mtd_probe(struct platform_device *pd
31 ltq_mtd->map->copy_to = ltq_copy_to;
32
33 ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING;
34 - ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map);
35 +
36 + for (type = rom_probe_types; !ltq_mtd->mtd && *type; type++)
37 + ltq_mtd->mtd = do_map_probe(*type, ltq_mtd->map);
38 +
39 ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL;
40
41 if (!ltq_mtd->mtd) {