lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d51234ebc05d2b9fe44625299c103caa@milecki.pl>
Date:   Tue, 18 Jul 2023 11:19:49 +0200
From:   Rafał Miłecki <rafal@...ecki.pl>
To:     Ahmad Fatoum <a.fatoum@...gutronix.de>
Cc:     Rafał Miłecki <zajec5@...il.com>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Alessandro Zummo <a.zummo@...ertech.it>,
        Vignesh Raghavendra <vigneshr@...com>,
        Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
        linux-mtd@...ts.infradead.org,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Evgeniy Polyakov <zbr@...emap.net>,
        Fabio Estevam <festevam@...il.com>,
        linux-stm32@...md-mailman.stormreply.com,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Heiko Stuebner <heiko@...ech.de>, linux-rtc@...r.kernel.org,
        Samuel Holland <samuel@...lland.org>,
        Richard Weinberger <richard@....at>,
        Michal Simek <michal.simek@...inx.com>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        linux-rockchip@...ts.infradead.org, Chen-Yu Tsai <wens@...e.org>,
        Andy Gross <agross@...nel.org>,
        NXP Linux Team <linux-imx@....com>,
        Vincent Shih <vincent.sunplus@...il.com>,
        Orson Zhai <orsonzhai@...il.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        linux-sunxi@...ts.linux.dev, asahi@...ts.linux.dev,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Sven Peter <sven@...npeter.dev>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        linux-arm-msm@...r.kernel.org,
        Sascha Hauer <s.hauer@...gutronix.de>,
        linux-mediatek@...ts.infradead.org,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        linux-amlogic@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        Bjorn Andersson <andersson@...nel.org>,
        Hector Martin <marcan@...can.st>, linux-kernel@...r.kernel.org,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Michael Walle <michael@...le.cc>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Kevin Hilman <khilman@...libre.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Claudiu Beznea <claudiu.beznea@...rochip.com>
Subject: Re: [Linux-stm32] [PATCH V4] nvmem: add explicit config option to
 read old syntax fixed OF cells

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>;
			};
		};
	}
};

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ