From patchwork Thu Jan 18 21:13:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 863174 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U6ANn5/u"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMxWz050gz9t3C for ; Fri, 19 Jan 2018 08:13:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XF9GCD5KIe7KBKgKbJRLZhliRFh2qeqZAhOLdp77jpE=; b=U6ANn5/usbfXtg vsdKqxK5tRTFWMheb7p2Apza4JykqD8gzo/t7vuQR8bYu+MDsdWNl4aoSWY0jMRFFWDeaN2znde/Y F0Y1N7Zfn0E4xDKUANd+HzrLveXu0Vh5NzP7Kf9miXAAjJAsyz6EcyeJqmghnTqXk//hvPgp37qTF G7D+YF5mozgJgSULQOI0dnx+UFEEK6XV35bxVkDCaM63fJp0NabPGkTg85ejtF5Tm6Pa4Hj0d5Efm GouWOHY3rXdqiVfd0cPUDDAqgB1s24u8+aoWM8L+7mQwUoffn3IYhBe376r4Pvp2NH8S4x+tXlFhP 5gTYiMSCzf+Q13ZEXnww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecHV7-0000rr-6u; Thu, 18 Jan 2018 21:13:33 +0000 Received: from arrakis.dune.hu ([78.24.191.176]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecHV3-0000gm-Nh for lede-dev@lists.infradead.org; Thu, 18 Jan 2018 21:13:32 +0000 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A6ABAB80C7C; Thu, 18 Jan 2018 22:13:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost.localdomain (91.83.24.116.pool.invitel.hu [91.83.24.116]) by arrakis.dune.hu (Postfix) with ESMTPSA; Thu, 18 Jan 2018 22:13:13 +0100 (CET) From: Gabor Juhos To: lede-dev@lists.infradead.org Date: Thu, 18 Jan 2018 22:13:09 +0100 Message-Id: <20180118211309.27972-1-juhosg@freemail.hu> X-Mailer: git-send-email 2.14.3 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [78.24.191.176 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (juhosg[at]freemail.hu) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH] kernel/4.{4, 9}: add manufacturer ID for Winbond NANDs X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gabor Juhos MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some MikroTik devices are using a Winbond NAND flash. Linux treats it as an unknown NAND before version 4.11: nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1 nand: Unknown NAND 128MiB 3,3V 8-bit nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 Backport a patch from 4.11 to show the manufacturer correctly: nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1 nand: Winbond NAND 128MiB 3,3V 8-bit nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 Tested on a MikroTik R951Ui-2HnD board. Signed-off-by: Gabor Juhos --- ...4.11-mtd-nand-Add-Winbond-manufacturer-id.patch | 34 ++++++++++++++++++++++ ...4.11-mtd-nand-Add-Winbond-manufacturer-id.patch | 34 ++++++++++++++++++++++ ...allow-to-use-platform-specific-chip-fixup.patch | 2 +- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch create mode 100644 target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch diff --git a/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch new file mode 100644 index 0000000000..cbab378b2b --- /dev/null +++ b/target/linux/generic/backport-4.9/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch @@ -0,0 +1,34 @@ +From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001 +From: "Andrey Jr. Melnikov" +Date: Thu, 8 Dec 2016 19:57:08 +0300 +Subject: [PATCH] mtd: nand: Add Winbond manufacturer id + +Add WINBOND manufacturer id. + +Signed-off-by: Andrey Jr. Melnikov +Signed-off-by: Boris Brezillon +--- + drivers/mtd/nand/nand_ids.c | 1 + + include/linux/mtd/nand.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/mtd/nand/nand_ids.c ++++ b/drivers/mtd/nand/nand_ids.c +@@ -182,6 +182,7 @@ struct nand_manufacturers nand_manuf_ids + {NAND_MFR_SANDISK, "SanDisk"}, + {NAND_MFR_INTEL, "Intel"}, + {NAND_MFR_ATO, "ATO"}, ++ {NAND_MFR_WINBOND, "Winbond"}, + {0x0, "Unknown"} + }; + +--- a/include/linux/mtd/nand.h ++++ b/include/linux/mtd/nand.h +@@ -928,6 +928,7 @@ static inline void nand_set_controller_d + #define NAND_MFR_SANDISK 0x45 + #define NAND_MFR_INTEL 0x89 + #define NAND_MFR_ATO 0x9b ++#define NAND_MFR_WINBOND 0xef + + /* The maximum expected count of bytes in the NAND ID sequence */ + #define NAND_MAX_ID_LEN 8 diff --git a/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch b/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch new file mode 100644 index 0000000000..d102d89b20 --- /dev/null +++ b/target/linux/generic/pending-4.4/067-v4.11-mtd-nand-Add-Winbond-manufacturer-id.patch @@ -0,0 +1,34 @@ +From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001 +From: "Andrey Jr. Melnikov" +Date: Thu, 8 Dec 2016 19:57:08 +0300 +Subject: [PATCH] mtd: nand: Add Winbond manufacturer id + +Add WINBOND manufacturer id. + +Signed-off-by: Andrey Jr. Melnikov +Signed-off-by: Boris Brezillon +--- + drivers/mtd/nand/nand_ids.c | 1 + + include/linux/mtd/nand.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/mtd/nand/nand_ids.c ++++ b/drivers/mtd/nand/nand_ids.c +@@ -181,6 +181,7 @@ struct nand_manufacturers nand_manuf_ids + {NAND_MFR_SANDISK, "SanDisk"}, + {NAND_MFR_INTEL, "Intel"}, + {NAND_MFR_ATO, "ATO"}, ++ {NAND_MFR_WINBOND, "Winbond"}, + {0x0, "Unknown"} + }; + +--- a/include/linux/mtd/nand.h ++++ b/include/linux/mtd/nand.h +@@ -736,6 +736,7 @@ struct nand_chip { + #define NAND_MFR_SANDISK 0x45 + #define NAND_MFR_INTEL 0x89 + #define NAND_MFR_ATO 0x9b ++#define NAND_MFR_WINBOND 0xef + + /* The maximum expected count of bytes in the NAND ID sequence */ + #define NAND_MAX_ID_LEN 8 diff --git a/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch b/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch index 3ce7f13dc4..b1072047c3 100644 --- a/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch +++ b/target/linux/generic/pending-4.4/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch @@ -5,7 +5,7 @@ --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h -@@ -863,6 +863,7 @@ struct platform_nand_chip { +@@ -864,6 +864,7 @@ struct platform_nand_chip { unsigned int options; unsigned int bbt_options; const char **part_probe_types;