From patchwork Wed Nov 27 10:55:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 1201507 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nbJ+IN0P"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NHkx62n1z9sP4 for ; Wed, 27 Nov 2019 21:56:25 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=emZz3AmX76wa4BiT83DmKVzDuMu4Bw7dzGYnFPi4J0I=; b=nbJ+IN0PWzBt/9 vaC2hXvUqaYgXl/hbyqoaRLtshrrjtRtfgZZ6VhkzAzfsUcmDrAdG1Id1WZLcTYGXBAyZgllgHDEk Ye4rIfZI+A4j20WfCZ9H2OUvH9/zPaGrI0QEUk4X1vufhpthwfMiE7nXNNYbUsOFgvMg18XSByuTw A1pORmHfeN2x5OWGYmzFXxf+XoOigwBXCEl9vT9w9oCkvo3XBCAuHdEAUfmE8l2KUAYSV3CyZjsN5 r33y5yMq3damem36KimcDmgCf7jzPBVrHw/5I1rdiFws4xbYEfC+LzJNdm9cfoIz072BeLefC9SzE fJUliLmzpmThFfUtwBFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZuzS-0003pA-Gb; Wed, 27 Nov 2019 10:56:10 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZuys-00039c-VM for linux-mtd@lists.infradead.org; Wed, 27 Nov 2019 10:55:37 +0000 X-Originating-IP: 90.76.211.102 Received: from localhost.localdomain (lfbn-1-2154-102.w90-76.abo.wanadoo.fr [90.76.211.102]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B240AFF805; Wed, 27 Nov 2019 10:55:25 +0000 (UTC) From: Miquel Raynal To: Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Rob Herring , Mark Rutland Subject: [PATCH v5 1/4] dt-bindings: mtd: Describe MTD partitions concatenation Date: Wed, 27 Nov 2019 11:55:19 +0100 Message-Id: <20191127105522.31445-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191127105522.31445-1-miquel.raynal@bootlin.com> References: <20191127105522.31445-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191127_025535_143082_BFC7EA3B X-CRM114-Status: GOOD ( 12.58 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.199 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Bernhard Frauendienst , Miquel Raynal , linux-kernel@vger.kernel.org, Paul Kocialkowski , Mark Brown , linux-mtd@lists.infradead.org, Thomas Petazzoni , Boris Brezillon Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The main use case to concatenate MTD devices is probably SPI-NOR flashes where the number of address bits is limited to 24, which can access a range of 16MiB. Board manufacturers might want to double the SPI storage size by adding a second flash asserted thanks to a second chip selects which enhances the addressing capabilities to 25 bits, 32MiB. Having two devices for twice the size is great but without more glue, we cannot define partition boundaries spread across the two devices. This is the gap mtd-concat intends to address. There are three options to describe concatenated devices: 1/ One flash chip is described in the DT with two CS; 2/ Two flash chips are described in the DT with one CS each, a virtual device is also created to describe the concatenation. 3/ Partitions that must be concatenated are described in the partitions subnodes in a specific part-concat property. Solution 1/ presents at least 3 issues: * The hardware description is abused; * The concatenation only works for SPI devices (while it could be helpful for any MTD); * It would require a lot of rework in the SPI core as most of the logic assumes there is and there always will be only one CS per chip. Solution 2/ also has caveats: * The virtual device has no hardware reality; * Possible optimizations at the hardware level will be hard to enable efficiently (ie. a common direct mapping abstracted by a SPI memories oriented controller). Solution 3/ is maybe better from the bindings point of view but introduces a real mess in kernel code and the amount of boilerplate is insane compared to solution 2. This is the one finally implemented. Signed-off-by: Miquel Raynal --- Documentation/devicetree/bindings/mtd/partition.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mtd/partition.txt b/Documentation/devicetree/bindings/mtd/partition.txt index afbbd870496d..6e3ac87ff988 100644 --- a/Documentation/devicetree/bindings/mtd/partition.txt +++ b/Documentation/devicetree/bindings/mtd/partition.txt @@ -61,6 +61,7 @@ Optional properties: clobbered. - lock : Do not unlock the partition at initialization time (not supported on all devices) +- part-concat : List of MTD partitions phandles that should be concatenated. Examples: