From patchwork Sun Sep 15 20:41:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 275072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 843F22C010F for ; Mon, 16 Sep 2013 06:42:43 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VLJ9C-0004JV-6Z; Sun, 15 Sep 2013 20:42:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VLJ99-0002lS-Eg; Sun, 15 Sep 2013 20:42:19 +0000 Received: from mail-ea0-x231.google.com ([2a00:1450:4013:c01::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VLJ8k-0002jz-LA for linux-mtd@lists.infradead.org; Sun, 15 Sep 2013 20:41:55 +0000 Received: by mail-ea0-f177.google.com with SMTP id f15so1609709eak.22 for ; Sun, 15 Sep 2013 13:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=AQzdtN0vVh3siLDPJmRH/Uhu/1bpokYplUsO71SNKzo=; b=LhhANBsLw28snV8YsgHtXplABF9rBQdyBV6ynN2eHnPknkEM8DMAlTqYGzJSvXKQWV PJacwt5EzPQ4La8hDoI5JRb2Zq3mlaIhxO/eKMcHG7NZ8W9dxU1+iXWkfGmOXWzB0Ojc lzboacQJpBbdkslT90Y+/ZBNHw0FsUTEJ3pMsD/YNCrxjqmDCqM/QpAI5bnpMtVLFkNN eeHigJPlWtLPyLEnxQBCRL6hJ0moHS43hRrXGPLMGBb7Ir+9v/OOQOQKVbZA3Sf2cOs3 4frqwZUfIwkIXDFDZDEHJ/bKqD2n6eiPZrh3fUWslDuhRtKyxfv4uQTl25KJIUQkbhIH 2Yog== X-Received: by 10.14.177.199 with SMTP id d47mr37424746eem.14.1379277692572; Sun, 15 Sep 2013 13:41:32 -0700 (PDT) Received: from linux-samsung700g7a.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id m54sm36116650eex.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Sep 2013 13:41:32 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: linux-mtd@lists.infradead.org, Artem Bityutskiy , David Woodhouse Subject: [PATCH] mtd: bcm47xxpart: detect "factory" partition Date: Sun, 15 Sep 2013 22:41:27 +0200 Message-Id: <1379277687-6454-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130915_164154_855863_1638B03C X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- drivers/mtd/bcm47xxpart.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c index 61213f9..20ef301 100644 --- a/drivers/mtd/bcm47xxpart.c +++ b/drivers/mtd/bcm47xxpart.c @@ -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 @@ -111,6 +112,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) {