From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CEBECF11FE for ; Thu, 10 Oct 2024 15:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tVZMs2+4Io1fiOqihAdk9nOoc2Kkn2C23QOtaCcVJvE=; b=TQNuHnwgKltK+Y Saqrf6ncepGLOhsL2xe/J7iUmBKWPJB7YKcc/q+O763XGmIoIPEGyaWPDBHjcERUtETQTJuQFkVEK Ig98HMX7mqYwvRR5EIA3bn+8BtAqi0a9m8ZEn/joH9Q6wlFJ9JmftBAsJd6ld3RlDaKWf1JsxKaKw nRa2M2LXOAP06pPqWRn2s/6QyJhgurTjaTLmMEbjjo/TE7SFNcvJ7BEPnILe/OfeAAlUb2tr/c0P2 jUWb+U2xSAX5p5VnO8QNALA7R7rMOQ4YFWripNMf+pqZuZv2/D0MBz8GAGk+jpugT/dh0lh9oqcng 98s7zp2V7y0CkuDpIa8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syv9R-0000000DLhU-48Eu; Thu, 10 Oct 2024 15:32:29 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syuej-0000000DEyi-2naR; Thu, 10 Oct 2024 15:01:04 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 50EE260002; Thu, 10 Oct 2024 15:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1728572440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tVZMs2+4Io1fiOqihAdk9nOoc2Kkn2C23QOtaCcVJvE=; b=lAovvxtyuEWjNDrbvDbZ/JCn99xSytxs4tLIBt0YjbjA60De6D5cMKL3z9DwFm1X8yJh52 3/GPLC74/ITwLmc1RQP3dpsepxs4O6FiBwNMBXvrsYPuhGdwz9Ima68G6UWf0oyMGHz2vK ZaRJHNj5liMPV78OG+4kQ1UYUB753o3tk6oJWCskVeOje9cPuHiO+J184qqmLKfWVzHfDA 9RO1vKW8QN92yBkuyAe5JeTo0bZCcu30XVo76jv6Fv0WYGj80MUcdXa+/3hwSxuru+rDDZ uQiOy599+8VADJM0xigLYyGRC1jPpLsKtqk0EZpVW2tDjh18jt2ieYHHe0Tr5g== Date: Thu, 10 Oct 2024 17:00:36 +0200 From: Miquel Raynal To: "Mahapatra, Amit Kumar" Subject: Re: Add stacked and parallel memories support in spi-nor Message-ID: <20241010165933.09a4114e@xps-13> In-Reply-To: References: <20240930110408.6ec43e97@xps-13> <20241010112751.01e5afa1@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_080046_314115_5FE13A19 X-CRM114-Status: GOOD ( 32.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "alexandre.belloni@bootlin.com" , "vigneshr@ti.com" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , Conor Dooley , "linux-mtd@lists.infradead.org" , "beanhuo@micron.com" , "git \(AMD-Xilinx\)" , Rob Herring , "richard@nod.at" , Tudor Ambarus , "cornor+dt@kernel.org" , "amitrkcian2002@gmail.com" , "linux-sound@vger.kernel.org" , "broonie@kernel.org" , "Simek, Michal" , "linux-arm-kernel@lists.infradead.org" , "patches@opensource.cirrus.com" , "claudiu.beznea@tuxon.dev" , "linux-spi@vger.kernel.org" , "michael@walle.cc" , "krzk+dt@kernel.org" , "pratyush@kernel.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Amit, amit.kumar-mahapatra@amd.com wrote on Thu, 10 Oct 2024 10:35:06 +0000: > Hello Miquel, >=20 > > -----Original Message----- > > From: Miquel Raynal > > Sent: Thursday, October 10, 2024 2:58 PM > > To: Mahapatra, Amit Kumar > > Cc: Tudor Ambarus ; michael@walle.cc; > > broonie@kernel.org; pratyush@kernel.org; richard@nod.at; vigneshr@ti.co= m; Rob > > Herring ; cornor+dt@kernel.org; krzk+dt@kernel.org; li= nux- > > spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-mtd@lists.infr= adead.org; > > nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com; > > claudiu.beznea@tuxon.dev; Simek, Michal ; linux-a= rm- > > kernel@lists.infradead.org; alsa-devel@alsa-project.org; > > patches@opensource.cirrus.com; linux-sound@vger.kernel.org; git (AMD-Xi= linx) > > ; amitrkcian2002@gmail.com; Conor Dooley > > ; beanhuo@micron.com > > Subject: Re: Add stacked and parallel memories support in spi-nor > >=20 > > Hi Amit, > >=20 > > amit.kumar-mahapatra@amd.com wrote on Thu, 10 Oct 2024 09:17:58 +0000: > > =20 > > > Hello Miquel, > > > =20 > > > > > - The stacked-memories DT bindings will contain the phandles of > > > > > the flash nodes =20 > > > > connected in stacked mode. =20 > > > > > > > > > > - The first flash node will contain the mtd partition that would > > > > > have the cross over memory staring at a memory location in the > > > > > first flash and ending at some memory location of the 2nd flash = =20 > > > > > > > > I don't like that much. Describing partitions past the actual device > > > > sounds wrong. If you look into [1] there is a suggestion from Rob to > > > > handle this case using a property that tells us there is a > > > > continuation, so from a software perspective we can easily make the= link, but on =20 > > the hardware description side the information are correct. =20 > > > > > > I reviewed Rob's suggestions in [1], and I need to examine the MTD > > > layer to determine how this can be implemented from a software perspe= ctive. > > > For reference, here is Rob's suggestion: > > > > > > Describe each device and partition separately and add link(s) from one > > > partition to the next > > > > > > flash0 { > > > partitions { > > > compatible =3D "fixed-partitions"; > > > concat-partition =3D <&flash1_partitions>; > > > ... > > > }; > > > }; > > > > > > flash1 { > > > flash1_partition: partitions { > > > compatible =3D "fixed-partitions"; > > > ... > > > }; > > > }; > > > =20 > > > > > > > > If this description is accepted, then fine, you can deprecate the "= stacked- =20 > > memories" =20 > > > > property. =20 > > > > > > I believe that in addition to Rob's description, we should also > > > include the 'stacked-memories' property. This property helps us > > > identify which flashes are stacked, while Rob's suggestion explains > > > how the partitions within the stacked flashes are connected. > > > > > > For example, if we have three flashes connected to an SPI host, with > > > flash@0 and flash@1 operating in stacked mode and flash@2 functioning > > > as a standalone flash, the Device Tree binding might look something l= ike this: > > > Please share your thoughts on this. > > > > > > spi@0 { > > > ... > > > flash@0 { > > > compatible =3D "jedec,spi-nor" > > > reg =3D <0x00>; > > > stacked-memories =3D <&flash@0 &flash@1>; > > > spi-max-frequency =3D <50000000>; > > > ... > > > flash0_partition: partitions { > > > compatible =3D "fixed-partitions"; > > > concat-partition =3D <&flash1_partitions>; > > > partition@0 { > > > label =3D "Stacked-Flash-1"; > > > reg =3D <0x0 0x800000>; > > > } > > > } > > > } > > > flash@1 { > > > compatible =3D "jedec,spi-nor" > > > reg =3D <0x01>; > > > spi-max-frequency =3D <50000000>; > > > ... > > > flash1_partition: partitions { > > > compatible =3D "fixed-partitions"; > > > concat-partition =3D <&flash0_partitions>; > > > partition@0 { > > > label =3D " Stacked-Flash-2"; > > > reg =3D <0x0 0x800000>; > > > } > > > } > > > } > > > > > > flash@2 { > > > compatible =3D "jedec,spi-nor" > > > reg =3D <0x01>; > > > spi-max-frequency =3D <50000000>; > > > ... > > > partitions { > > > compatible =3D "fixed-partitions"; > > > concat-partition =3D <&flash0_partitions>; > > > partition@0 { > > > label =3D "Single-Flash"; > > > reg =3D <0x0 0x800000>; > > > } > > > } > > > } =20 > >=20 > > I'm sorry but this is pretty messed up. The alignments are wrong, I bel= ieve the labels > > are wrong, the reg properties as well. Can you please work on this exam= ple and > > send an updated version? =20 >=20 > Apologies for that. Here's the updated version along with the explanation. Thanks for the update. > spi@0 { > ... > flash@0 { > compatible =3D "jedec,spi-nor" > reg =3D <0x00>; > stacked-memories =3D <&flash@0 &flash@1>; The same property should, IMHO, also be expected... > spi-max-frequency =3D <50000000>; > ... > partitions { > compatible =3D "fixed-partitions"; > concat-partition =3D <&flash1_partition>; /* Link to the flash= @1 partition@0 */ > flash0_partition: partition@0 { > label =3D "part0_0"; > reg =3D <0x0 0x800000>; > } > } > } > flash@1 { > compatible =3D "jedec,spi-nor" > reg =3D <0x01>; ... here. > spi-max-frequency =3D <50000000>; > ... > partitions { > compatible =3D "fixed-partitions"; > concat-partition =3D <&flash0_partition>; /* Link to the flash= @0 partition@0 */ > flash1_partition: partition@0 { > label =3D "part0_1"; > reg =3D <0x0 0x800000>; > } > } > } >=20 > flash@2 { > compatible =3D "jedec,spi-nor" > reg =3D <0x02>; > spi-max-frequency =3D <50000000>; > ... > partitions { > compatible =3D "fixed-partitions"; =20 > partition@0 { > label =3D "part1_0"; > reg =3D <0x0 0x800000>; > } > } > } > } Otherwise, okay for me. Thanks, Miqu=C3=A8l