brcm47xx: deactivate mips wait instruction only for BCM4706
[openwrt.git] / target / linux / brcm47xx / patches-3.10 / 030-mtd-bcm47xxpart_detect_factory_partition.patch
1 mtd: bcm47xxpart: detect "factory" partition
2
3 A new type of partition with magic FCTY was found on Huawei E970:
4 46 43 54 59 4b 51 37 4e  41 42 31 38 41 32 39 30  |FCTYKQ7NAB18A290|
5
6 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
7
8 --- a/drivers/mtd/bcm47xxpart.c
9 +++ b/drivers/mtd/bcm47xxpart.c
10 @@ -28,6 +28,7 @@
11  /* Magics */
12  #define CFE_MAGIC                      0x43464531      /* 1EFC */
13  #define BOARD_DATA_MAGIC               0x5246504D      /* MPFR */
14 +#define FACTORY_MAGIC                  0x59544346      /* FCTY */
15  #define POT_MAGIC1                     0x54544f50      /* POTT */
16  #define POT_MAGIC2                     0x504f          /* OP */
17  #define ML_MAGIC1                      0x39685a42
18 @@ -113,6 +114,13 @@ static int bcm47xxpart_parse(struct mtd_
19                                              offset, MTD_WRITEABLE);
20                         continue;
21                 }
22 +
23 +               /* Found on Huawei E970 */
24 +               if (buf[0x000 / 4] == FACTORY_MAGIC) {
25 +                       bcm47xxpart_add_part(&parts[curr_part++], "factory",
26 +                                            offset, MTD_WRITEABLE);
27 +                       continue;
28 +               }
29  
30                 /* POT(TOP) */
31                 if (buf[0x000 / 4] == POT_MAGIC1 &&