From patchwork Tue Jan 13 15:56:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 428491 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D881140151 for ; Wed, 14 Jan 2015 03:01:59 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 014EA2873D1; Tue, 13 Jan 2015 16:58:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C277D28468A for ; Tue, 13 Jan 2015 16:57:53 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -4.2 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by arrakis.dune.hu (Postfix) with ESMTP for ; Tue, 13 Jan 2015 16:57:51 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 106) id A5FECBC4; Tue, 13 Jan 2015 17:00:04 +0100 (CET) Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id D3D89BBF; Tue, 13 Jan 2015 17:00:03 +0100 (CET) From: Maxime Ripard To: Florian Fainelli , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Luka Perkov , Imre Kaloz Date: Tue, 13 Jan 2015 16:56:40 +0100 Message-Id: <1421164606-3222-4-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1421164606-3222-1-git-send-email-maxime.ripard@free-electrons.com> References: <1421164606-3222-1-git-send-email-maxime.ripard@free-electrons.com> Cc: Thomas Petazzoni , openwrt-devel@lists.openwrt.org, Sudhakar Gundubogula Subject: [OpenWrt-Devel] [PATCH 3/9] kernel: Allow ubi autoattach to run on NOR flash X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Some devices out there only have a NOR flash to store the rootfs on. While using UBI is arguable on this kind of NAND, this is something that should be supported. Signed-off-by: Maxime Ripard --- .../490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch | 5 +++-- .../490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch | 5 +++-- .../490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/target/linux/generic/patches-3.10/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/patches-3.10/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 002a79ab73d1..27ed474127b3 100644 --- a/target/linux/generic/patches-3.10/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/patches-3.10/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1207,6 +1207,48 @@ static struct mtd_info * __init open_mtd +@@ -1207,6 +1207,49 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -43,6 +43,7 @@ Signed-off-by: Daniel Golle + + /* auto-add only media types where UBI makes sense */ + if (mtd->type == MTD_NANDFLASH || ++ mtd->type == MTD_NORFLASH || + mtd->type == MTD_DATAFLASH || + mtd->type == MTD_MLCNANDFLASH) { + mutex_lock(&ubi_devices_mutex); @@ -60,7 +61,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1290,6 +1332,12 @@ static int __init ubi_init(void) +@@ -1290,6 +1333,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 67600ae97218..d7b20b81f5f2 100644 --- a/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/patches-3.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1209,6 +1209,48 @@ static struct mtd_info * __init open_mtd +@@ -1209,6 +1209,49 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -43,6 +43,7 @@ Signed-off-by: Daniel Golle + + /* auto-add only media types where UBI makes sense */ + if (mtd->type == MTD_NANDFLASH || ++ mtd->type == MTD_NORFLASH || + mtd->type == MTD_DATAFLASH || + mtd->type == MTD_MLCNANDFLASH) { + mutex_lock(&ubi_devices_mutex); @@ -60,7 +61,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1298,6 +1340,12 @@ static int __init ubi_init(void) +@@ -1298,6 +1341,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/patches-3.18/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/patches-3.18/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 67600ae97218..d7b20b81f5f2 100644 --- a/target/linux/generic/patches-3.18/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/patches-3.18/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1209,6 +1209,48 @@ static struct mtd_info * __init open_mtd +@@ -1209,6 +1209,49 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -43,6 +43,7 @@ Signed-off-by: Daniel Golle + + /* auto-add only media types where UBI makes sense */ + if (mtd->type == MTD_NANDFLASH || ++ mtd->type == MTD_NORFLASH || + mtd->type == MTD_DATAFLASH || + mtd->type == MTD_MLCNANDFLASH) { + mutex_lock(&ubi_devices_mutex); @@ -60,7 +61,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1298,6 +1340,12 @@ static int __init ubi_init(void) +@@ -1298,6 +1341,12 @@ static int __init ubi_init(void) } }