linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Sven Eckelmann <sven@narfation.org>, openwrt-devel@lists.openwrt.org
Cc: Ansuel Smith <ansuelsmth@gmail.com>,
	Michael Walle <michael@walle.cc>,
	Adrian Schmutzler <dev@schmutzler.it>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-mtd@lists.infradead.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-kernel@vger.kernel.org
Subject: Re: nvmem: Defining cells on mtd created by mtdparts
Date: Fri, 15 Oct 2021 10:20:09 +0200	[thread overview]
Message-ID: <c28ba2f5-cfd7-aef4-526d-bf0679298b5d@gmail.com> (raw)
In-Reply-To: <14722734.oMan5NXi5u@sven-desktop>

On 11.10.2021 09:06, Sven Eckelmann wrote:
> On Sunday, 10 October 2021 14:53:13 CEST Sven Eckelmann wrote:
> [...]
>> Since there are most likely more devices out there which use mtdparts, I would
>> guess that there might already be a strategy out there which can be used to
>> define the nvmem-provider for mtdparts defined partitions. At least I saw that
>> Bartosz Golaszewski added all the mtd devices automatically as nvmem provider
>> in c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem
>> API"). So there might also be something for nvmem-cells to find the correct
>> mtd instead of relying on the fixed-partitions registration + of_node (which
>> doesn't exist because it comes from mtdparts and not devicetree).
> 
> Ansuel Smith just proposed in OpenWrt [1] a workaround. It basically adds a
> minimal fixed-partitions parser to the mtd cmdlinepart parser (responsible for
> the mtdparts=) that tries to find the matching (size + offset) fixed-partition
> from the devicetree. The code in mtd_device_parse_register
> (add_mtd_partitions -> add_mtd_device -> mtd_nvmem_add) will then
> automatically take care of the rest.

I like the idea of connecting cmdline specified partitions (mtdparts=)
with DT. That will help devices that use DT at least.

One thing I'm not sure about is criteria. Ansuel in his patch
[PATCH] drivers: mtd: parsers: add nvmem support to cmdlinepart
https://gist.github.com/Ansuel/35abba1f5663ea3d9bd8eded01e8d95b
requires a matching name, offset & size.

I guess above may work for partitions that stay static like a
bootloader. What if someone wants to describe more dynamic partition
(firmware?). Should we reduce criteria to allow matching just by a
name?

      parent reply	other threads:[~2021-10-15  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 12:53 nvmem: Defining cells on mtd created by mtdparts Sven Eckelmann
2021-10-11  7:06 ` Sven Eckelmann
2021-10-12 18:24   ` Pratyush Yadav
2021-10-12 18:59     ` Sven Eckelmann
2021-10-15  8:20   ` Rafał Miłecki [this message]

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=c28ba2f5-cfd7-aef4-526d-bf0679298b5d@gmail.com \
    --to=zajec5@gmail.com \
    --cc=ansuelsmth@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=dev@schmutzler.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=openwrt-devel@lists.openwrt.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=sven@narfation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).