lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: nvmem: Defining cells on mtd created by mtdparts
Date
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.

Kind regards,
Sven

[1] https://github.com/openwrt/openwrt/pull/4664#issuecomment-939567963[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-10-11 09:07    [W:0.050 / U:1.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site