Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33094c73 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Brian Norris
Browse files

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: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 020c6bcf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@

/* Magics */
#define BOARD_DATA_MAGIC		0x5246504D	/* MPFR */
#define FACTORY_MAGIC			0x59544346	/* FCTY */
#define POT_MAGIC1			0x54544f50	/* POTT */
#define POT_MAGIC2			0x504f		/* OP */
#define ML_MAGIC1			0x39685a42
@@ -118,6 +119,13 @@ static int bcm47xxpart_parse(struct mtd_info *master,
			continue;
		}

		/* Found on Huawei E970 */
		if (buf[0x000 / 4] == FACTORY_MAGIC) {
			bcm47xxpart_add_part(&parts[curr_part++], "factory",
					     offset, MTD_WRITEABLE);
			continue;
		}

		/* POT(TOP) */
		if (buf[0x000 / 4] == POT_MAGIC1 &&
		    (buf[0x004 / 4] & 0xFFFF) == POT_MAGIC2) {