kernel: update 3.10 to 3.10.36
[openwrt.git] / target / linux / lantiq / patches-3.10 / 0105-mips-lantiq-flash-add-jedec-probe.patch
1 Makes the Lantiq flash driver try jedec probing if cfi probing fails.
2
3 (Based on work by Simon Hayes first published on www.psidoc.com and 
4 http://sourceforge.net/projects/hh2b4ever/)
5
6 Signed-off-by: Ben Mulvihill <ben.mulvihill@gmail.com>
7
8 ---
9  lantiq-flash.c |   11 ++++++++++-
10  1 file changed, 10 insertions(+), 1 deletion(-)
11
12 --- a/drivers/mtd/maps/lantiq-flash.c
13 +++ b/drivers/mtd/maps/lantiq-flash.c
14 @@ -117,6 +117,11 @@ ltq_mtd_probe(struct platform_device *pd
15         struct cfi_private *cfi;
16         int err;
17  
18 +       static const char *rom_probe_types[] = {
19 +               "cfi_probe", "jedec_probe", NULL
20 +       };
21 +       const char **type;
22 +
23         if (of_machine_is_compatible("lantiq,falcon") &&
24                         (ltq_boot_select() != BS_FLASH)) {
25                 dev_err(&pdev->dev, "invalid bootstrap options\n");
26 @@ -154,7 +159,11 @@ ltq_mtd_probe(struct platform_device *pd
27         ltq_mtd->map->copy_to = ltq_copy_to;
28  
29         ltq_mtd->map->map_priv_1 = LTQ_NOR_PROBING;
30 -       ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map);
31 +
32 +       for (type = rom_probe_types; !ltq_mtd->mtd && *type; type++) {
33 +               ltq_mtd->mtd = do_map_probe(*type, ltq_mtd->map);
34 +       }
35
36         ltq_mtd->map->map_priv_1 = LTQ_NOR_NORMAL;
37  
38         if (!ltq_mtd->mtd) {