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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B0C9EB64DA for ; Tue, 18 Jul 2023 11:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbjGRLq7 (ORCPT ); Tue, 18 Jul 2023 07:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjGRLq6 (ORCPT ); Tue, 18 Jul 2023 07:46:58 -0400 X-Greylist: delayed 6605 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 18 Jul 2023 04:46:54 PDT Received: from 16.mo561.mail-out.ovh.net (16.mo561.mail-out.ovh.net [188.165.56.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432D51AC for ; Tue, 18 Jul 2023 04:46:53 -0700 (PDT) Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.156.6]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id D5F4224DB3 for ; Tue, 18 Jul 2023 09:19:55 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-mn4ct (unknown [10.109.138.229]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 9177E1FEB2; Tue, 18 Jul 2023 09:19:49 +0000 (UTC) Received: from RCM-web4.webmail.mail.ovh.net ([176.31.235.81]) by ghost-submission-6684bf9d7b-mn4ct with ESMTPSA id gQ79HjVZtmSJDgAAInjvQA (envelope-from ); Tue, 18 Jul 2023 09:19:49 +0000 MIME-Version: 1.0 Date: Tue, 18 Jul 2023 11:19:49 +0200 From: =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= To: Ahmad Fatoum Cc: =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Srinivas Kandagatla , Alexandre Belloni , Alessandro Zummo , Vignesh Raghavendra , Kunihiko Hayashi , linux-mtd@lists.infradead.org, Miquel Raynal , Evgeniy Polyakov , Fabio Estevam , linux-stm32@st-md-mailman.stormreply.com, Alyssa Rosenzweig , Heiko Stuebner , linux-rtc@vger.kernel.org, Samuel Holland , Richard Weinberger , Michal Simek , Jernej Skrabec , linux-rockchip@lists.infradead.org, Chen-Yu Tsai , Andy Gross , NXP Linux Team , Vincent Shih , Orson Zhai , Jerome Brunet , linux-sunxi@lists.linux.dev, asahi@lists.linux.dev, Maxime Coquelin , Sven Peter , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , linux-mediatek@lists.infradead.org, Baolin Wang , Matthias Brugger , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Neil Armstrong , Chunyan Zhang , Bjorn Andersson , Hector Martin , linux-kernel@vger.kernel.org, Konrad Dybcio , Michael Walle , Masami Hiramatsu , Pengutronix Kernel Team , Kevin Hilman , Shawn Guo , Claudiu Beznea Subject: Re: [Linux-stm32] [PATCH V4] nvmem: add explicit config option to read old syntax fixed OF cells In-Reply-To: References: <20230403225540.1931-1-zajec5@gmail.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: rafal@milecki.pl X-Originating-IP: 31.11.218.106 X-Webmail-UserID: rafal@milecki.pl Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 6429732894367460296 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdduvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeggfffhvfevufgjfhgfkfigihgtgfesthejjhdttdervdenucfhrhhomheptfgrfhgrlhcuofhilhgvtghkihcuoehrrghfrghlsehmihhlvggtkhhirdhplheqnecuggftrfgrthhtvghrnhepgfeuleeuteetfeeuhefhhffgtedvgeejfeelffeuvdfhueffvdehgeeuveeuhfelnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepuddvjedrtddrtddruddpfedurdduuddrvddukedruddtiedpudejiedrfedurddvfeehrdekudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehrrghfrghlsehmihhlvggtkhhirdhplheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqrghrmhdqmhhsmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheeiuddpmhhouggvpehsmhhtphhouhht Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Ahmad, On 2023-07-18 11:08, Ahmad Fatoum wrote: >> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c >> index 60670b2f70b9..334adbae3690 100644 >> --- a/drivers/mtd/mtdcore.c >> +++ b/drivers/mtd/mtdcore.c >> @@ -522,6 +522,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd) >> config.dev = &mtd->dev; >> config.name = dev_name(&mtd->dev); >> config.owner = THIS_MODULE; >> + config.add_legacy_fixed_of_cells = of_device_is_compatible(node, >> "nvmem-cells"); > > How does the new binding look like in this situation? > > Before it was: > > &{flash/partitions} { > compatible = "fixed-partitions"; > #address-cells = <1>; > #size-cells = <1>; > > partition@0 { > compatible = "nvmem-cells"; > reg = <0 0x100>; > #address-cells = <1>; > #size-cells = <1>; > > calib@1 { > reg = <1 1>; > }; > } > }; > > It it now the same, but s/"nvmem-cells"/"fixed-layout"/ ? Please take a look at those commits and examples: bd912c991d2e ("dt-bindings: nvmem: layouts: add fixed-layout") https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bd912c991d2ef079a32558f057b8663bcf1fb6fc fa7fbe53ecdc ("dt-bindings: nvmem: convert base example to use NVMEM fixed cells layout") https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fa7fbe53ecdc4e7d549a9f73a40e257b0046b4b9 Basically you need a "nvmem-layout" node with: compatible = "fixed-layout"; So in your case that would be: &{flash/partitions} { compatible = "fixed-partitions"; partition@0 { reg = <0 0x100>; nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; calib@1 { reg = <1 1>; }; }; } };