diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-10-21 16:35:34 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2013-11-07 02:32:58 -0500 |
commit | 33094c736cd36a6cecadae6bce4daba89dabc326 (patch) | |
tree | 817e5f7b506c0deddfc3025f93eaf7e8ff1ca071 /drivers/mtd/bcm47xxpart.c | |
parent | 020c6bcfbeabee72c18d862769d72cf9241b9004 (diff) |
mtd: bcm47xxpart: detect "factory" partition
A new type of partition with magic FCTY was found on Huawei E970:
46 43 54 59 4b 51 37 4e 41 42 31 38 41 32 39 30 |FCTYKQ7NAB18A290|
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/bcm47xxpart.c')
-rw-r--r-- | drivers/mtd/bcm47xxpart.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c index a737450826ec..7a6384b0962a 100644 --- a/drivers/mtd/bcm47xxpart.c +++ b/drivers/mtd/bcm47xxpart.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | /* Magics */ | 28 | /* Magics */ |
29 | #define BOARD_DATA_MAGIC 0x5246504D /* MPFR */ | 29 | #define BOARD_DATA_MAGIC 0x5246504D /* MPFR */ |
30 | #define FACTORY_MAGIC 0x59544346 /* FCTY */ | ||
30 | #define POT_MAGIC1 0x54544f50 /* POTT */ | 31 | #define POT_MAGIC1 0x54544f50 /* POTT */ |
31 | #define POT_MAGIC2 0x504f /* OP */ | 32 | #define POT_MAGIC2 0x504f /* OP */ |
32 | #define ML_MAGIC1 0x39685a42 | 33 | #define ML_MAGIC1 0x39685a42 |
@@ -118,6 +119,13 @@ static int bcm47xxpart_parse(struct mtd_info *master, | |||
118 | continue; | 119 | continue; |
119 | } | 120 | } |
120 | 121 | ||
122 | /* Found on Huawei E970 */ | ||
123 | if (buf[0x000 / 4] == FACTORY_MAGIC) { | ||
124 | bcm47xxpart_add_part(&parts[curr_part++], "factory", | ||
125 | offset, MTD_WRITEABLE); | ||
126 | continue; | ||
127 | } | ||
128 | |||
121 | /* POT(TOP) */ | 129 | /* POT(TOP) */ |
122 | if (buf[0x000 / 4] == POT_MAGIC1 && | 130 | if (buf[0x000 / 4] == POT_MAGIC1 && |
123 | (buf[0x004 / 4] & 0xFFFF) == POT_MAGIC2) { | 131 | (buf[0x004 / 4] & 0xFFFF) == POT_MAGIC2) { |