All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Ansuel Smith <ansuelsmth@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Richard Weinberger <richard@nod.at>
Cc: devicetree@vger.kernel.org, Vignesh Raghavendra <vigneshr@ti.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH v2 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible
Date: Wed, 3 Mar 2021 11:01:55 +0100	[thread overview]
Message-ID: <1cf374f1-09d5-9fa9-9b0d-d8079f2f6fbc@gmail.com> (raw)
In-Reply-To: <20210216212638.28382-4-ansuelsmth@gmail.com>

[Rob: please advise]

On 16.02.2021 22:26, Ansuel Smith wrote:
> Document nvmem-partitions compatible used to treat mtd partitions as a
> nvmem provider.

Until now we were using "compatible" string in partition node only for
parsers (looking for subpartitions). We need to think if this change can
break anything from DT / Linux perspective.

Compatible strings should be unique, so there is no risk of conflict
between NVMEM and parsers.

Now: can we ever need mtd partition to:
1. Contain subpartitions
2. Provide NVMEM
at the same time?

Let's say:

partition@0 {
	compatible = "vendor,dynamic-firmware-partitions", "nvmem-partitions";
	label = "firmware";
	reg = <0x0 0x100000>;
	#address-cells = <1>;
	#size-cells = <1>;
	ranges = <0 0x0 0x100000>;

	firmware-version@10 {
		reg = <0x10 0x4>;
	};

	firmware-date@10 {
		reg = <0x20 0x4>;
	};
};

Is that allowed to respect both "compatible" strings and have:
1. Linux parser parse "firmware" for subpartitions
2. Linux MTD register "firmware" as NVMEM device
?

If not, what other options do we have? Is that allowed to have a
dangling MTD NVMEM node with phandle to MTD partition?

firmware: partition@0 {
	compatible = "vendor,dynamic-firmware-partitions";
	label = "firmware";
	reg = <0x0 0x100000>;
};

(...)

firmware-version@10 {
	compatible = "mtd-nvmem";
	reg = <0x10 0x4>;
	mtd = <&firmware>;
};

firmware-date@10 {
	compatible = "mtd-nvmem";
	reg = <0x20 0x4>;
	mtd = <&firmware>;
};


Rob: I'd really appreciate your input & help here.

WARNING: multiple messages have this Message-ID (diff)
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Ansuel Smith <ansuelsmth@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Richard Weinberger <richard@nod.at>
Cc: devicetree@vger.kernel.org, Vignesh Raghavendra <vigneshr@ti.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH v2 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible
Date: Wed, 3 Mar 2021 11:01:55 +0100	[thread overview]
Message-ID: <1cf374f1-09d5-9fa9-9b0d-d8079f2f6fbc@gmail.com> (raw)
In-Reply-To: <20210216212638.28382-4-ansuelsmth@gmail.com>

[Rob: please advise]

On 16.02.2021 22:26, Ansuel Smith wrote:
> Document nvmem-partitions compatible used to treat mtd partitions as a
> nvmem provider.

Until now we were using "compatible" string in partition node only for
parsers (looking for subpartitions). We need to think if this change can
break anything from DT / Linux perspective.

Compatible strings should be unique, so there is no risk of conflict
between NVMEM and parsers.

Now: can we ever need mtd partition to:
1. Contain subpartitions
2. Provide NVMEM
at the same time?

Let's say:

partition@0 {
	compatible = "vendor,dynamic-firmware-partitions", "nvmem-partitions";
	label = "firmware";
	reg = <0x0 0x100000>;
	#address-cells = <1>;
	#size-cells = <1>;
	ranges = <0 0x0 0x100000>;

	firmware-version@10 {
		reg = <0x10 0x4>;
	};

	firmware-date@10 {
		reg = <0x20 0x4>;
	};
};

Is that allowed to respect both "compatible" strings and have:
1. Linux parser parse "firmware" for subpartitions
2. Linux MTD register "firmware" as NVMEM device
?

If not, what other options do we have? Is that allowed to have a
dangling MTD NVMEM node with phandle to MTD partition?

firmware: partition@0 {
	compatible = "vendor,dynamic-firmware-partitions";
	label = "firmware";
	reg = <0x0 0x100000>;
};

(...)

firmware-version@10 {
	compatible = "mtd-nvmem";
	reg = <0x10 0x4>;
	mtd = <&firmware>;
};

firmware-date@10 {
	compatible = "mtd-nvmem";
	reg = <0x20 0x4>;
	mtd = <&firmware>;
};


Rob: I'd really appreciate your input & help here.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-03-03 14:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 21:26 [PATCH v2 0/3] Implement nvmem support for mtd Ansuel Smith
2021-02-16 21:26 ` Ansuel Smith
2021-02-16 21:26 ` [PATCH v2 1/3] mtd: partitions: ofpart: skip subnodes parse with compatible Ansuel Smith
2021-02-16 21:26   ` Ansuel Smith
2021-03-02 16:53   ` Rafał Miłecki
2021-03-02 16:53     ` Rafał Miłecki
2021-03-02  4:50     ` Ansuel Smith
2021-03-02  4:50       ` Ansuel Smith
2021-02-16 21:26 ` [PATCH v2 2/3] mtd: core: add nvmem-partitions compatible to parse mtd as nvmem cells Ansuel Smith
2021-02-16 21:26   ` Ansuel Smith
2021-03-03  8:01   ` Rafał Miłecki
2021-03-03  8:01     ` Rafał Miłecki
2021-02-16 21:26 ` [PATCH v2 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible Ansuel Smith
2021-02-16 21:26   ` Ansuel Smith
2021-03-03 10:01   ` Rafał Miłecki [this message]
2021-03-03 10:01     ` Rafał Miłecki
2021-03-05 22:23     ` Rob Herring
2021-03-05 22:23       ` Rob Herring
2021-03-08  9:45       ` Rafał Miłecki
2021-03-08  9:45         ` Rafał Miłecki
2021-03-08  9:48   ` Rafał Miłecki
2021-03-08  9:48     ` Rafał Miłecki
2021-03-07 17:04     ` Ansuel Smith
2021-03-07 17:04       ` Ansuel Smith
2021-03-08 13:28       ` Rafał Miłecki
2021-03-08 13:28         ` Rafał Miłecki
2021-03-08 13:32       ` Rafał Miłecki
2021-03-08 13:32         ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1cf374f1-09d5-9fa9-9b0d-d8079f2f6fbc@gmail.com \
    --to=zajec5@gmail.com \
    --cc=ansuelsmth@gmail.com \
    --cc=bbrezillon@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.