Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp262542ybl; Wed, 4 Dec 2019 02:18:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwd0t5tnp+5pZR+PYbDlQhzEZKcvdJf9rTfJ1LNpiFpYD+EUTSumGz6pcoS/Qd0K+M6olLC X-Received: by 2002:a05:6808:210:: with SMTP id l16mr1948362oie.95.1575454722403; Wed, 04 Dec 2019 02:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575454722; cv=none; d=google.com; s=arc-20160816; b=gCIuDep2DofihphauIu+KCP8/FDDewtCClZ8176rnezIrebV34h0LP2H3QySengD4t nN/j2gKAaVSu7EPoL4ZNsrjBi8xT9gA2xb9vaCF+lI10+IIki2uRlGVAij4OzBVOMnGD LYXjWQKPf00MAWUcW2S0DtFcS/2GAWjWN9HyMBDTaeHd/Za58Wvbm3Ei7HevtknLGTta lFJ1dtZdn+VZxeq6On+EhqOjl0yMQgVoYbRcgj4UlskkGE6scDjDo5Ds3Ahy275V3s5u qXAY/xtDwthD4Lw4MOW9xG/0G3e9TXr3dtTleq0FyOFpd3GGBlz1LfykuvD3jMa4FcMw W0Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=56XCQmNnE6lLCKqjjnNMjmb6dn/7eNgJunTFHZAOX9Y=; b=ph6rRbwy2OJX7vSgpeLz4uAUXPp7CunzPMxvB/PqolMRakSLXBnES4b9eQ7jucSRmH ayeDoxaWSmLm0SbwxkoQvMg4mTth4SssQQLBDODg0o9fM8hsiQC3RTC/wpoV4uJyaaxB ZdTRCpFPebIAoLBieTdBoCTbMYDMVfF6247837bxBGCJ1jwAerVtvV0lv/JzPIDCgLp0 P0j1TnA4TYbAZhyCtLaBydGhoRUzZLqQus4byJH1A/Nq9zlRcWzzn0ygrQlwGQRmNKA6 kXa0kiZtM/h2eqP1pYggAgOV3BViyfyVqgShOglClMBLrhYviKCtCOm3k3DUbFJsUQgS R/Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si2940053oib.55.2019.12.04.02.18.29; Wed, 04 Dec 2019 02:18:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbfLDKR5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 4 Dec 2019 05:17:57 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:52007 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727331AbfLDKR5 (ORCPT ); Wed, 4 Dec 2019 05:17:57 -0500 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id B85C14000B; Wed, 4 Dec 2019 10:17:52 +0000 (UTC) Date: Wed, 4 Dec 2019 11:17:51 +0100 From: Miquel Raynal To: Vignesh Raghavendra Cc: Richard Weinberger , Tudor Ambarus , Rob Herring , Mark Rutland , , Thomas Petazzoni , , , Mark Brown , Boris Brezillon , Paul Kocialkowski , Bernhard Frauendienst Subject: Re: [PATCH v5 4/4] mtd: Add driver for concatenating devices Message-ID: <20191204111751.5383b426@xps13> In-Reply-To: <690065a2-619d-3f97-30c6-5dea76896d78@ti.com> References: <20191127105522.31445-1-miquel.raynal@bootlin.com> <20191127105522.31445-5-miquel.raynal@bootlin.com> <690065a2-619d-3f97-30c6-5dea76896d78@ti.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vignesh, Vignesh Raghavendra wrote on Wed, 4 Dec 2019 15:28:46 +0530: > Hi Miquel, > > On 27/11/19 4:25 pm, Miquel Raynal wrote: > > Introduce a generic way to define concatenated MTD devices. This may > > be very useful in the case of ie. stacked SPI-NOR. Partitions to > > concatenate are described in an additional property of the partitions > > subnode: > > > > flash0 { > > partitions { > > compatible = "fixed-partitions"; > > part-concat = <&flash0_part1>, <&flash1_part0>; > > > > part0@0 { > > label = "part0_0"; > > reg = <0x0 0x800000>; > > }; > > > > flash0_part1: part1@800000 { > > label = "part0_1"; > > reg = <0x800000 0x800000>; > > }; > > }; > > }; > > IIUC flash0 and flash1 are subnodes of a SPI master node? > And I believe flash0 node's compatible is "jedec,spi-nor"? Indeed this is one possibility (probably the most common) but in theory this should work for any kind of MTD device, hence I voluntarily dropped the hardware-specific properties to focus on the partitions description here. > > > > > > flash1 { > > partitions { > > compatible = "fixed-partitions"; > > > > flash0_part1: part1@0 { > > s/flash0_part1/flash1_part0? Right! > > > label = "part1_0"; > > reg = <0x0 0x800000>; > > }; > > > > part0@800000 { > > label = "part1_1"; > > reg = <0x800000 0x800000>; > > }; > > }; > > }; > > > > For my understanding, how many /dev/mtdX entries would this create? If the master is retained (Kconfig option) and thanks to the common partitioning scheme, we would have: * flash0 (mtd0) * part0_0 (mtd1) * part0_1 (mtd2) * flash1 (mtd3) * part1_0 (mtd4) * part1_1 (mtd5) If we enable this driver, we would also get an additional device: * mtd2-mtd4-concat (or part0_1-part1_0-concat, I don't recall the exact name) being mtd6. Thanks, Miquèl