All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Actually implement nvmem support for mtd
@ 2020-09-19 22:30 ` Ansuel Smith
  0 siblings, 0 replies; 18+ messages in thread
From: Ansuel Smith @ 2020-09-19 22:30 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Andrew Lunn, Vignesh Raghavendra, Boris Brezillon,
	Richard Weinberger, Russell King, Ansuel Smith, devicetree,
	Rob Herring, linux-mtd, netdev, Jakub Kicinski, Frank Rowand,
	David S. Miller, linux-kernel, Heiner Kallweit

The mtd support for the nvmem api has been stalled from 2018 with a patch
half pushed hoping that a scheme is found for the mtd name later. This
pathset try to address this and add a very needed feature for the
mac-address.

My solution to the already discussed problem here [1] is to keep it simple.
A mtd subpartition can be set as a nvmem-provider with a specific tag and
each direct subnode is treat by the nvmem api as a nvmem-cell and gets
correctly registred. The mtd driver will treat a direct subnode of the
subpartition as a legacy subpartition of the subpartition using the
'fixed-partition' parser. To fix this every nvmem-cell has to have the
'nvmem-cell' tag and the fixed-partition parser will skip these node if 
this tag is detected. Simple as that. The subpartition with the tag 
'nvmem-provider' will then be set by the config to not skip the of
registration in the config and the nvmem-cells are correctly registred
and can be used to set mac-address of the devices on the system.

The last 2 patch try to address a problem in the embedded devices (mostly
routers) that have the mac-address saved in a dedicated partition and is
a ""master"" mac-address. Each device increment or decrement the extracted
mac-address based on the device number. The increment function is
implemented in the of_net function to get the mac-address that every net
driver should allready use if they don't have a trusty mac-address source.
(One example of this implementation are many ath10k device that gets the
mac-address from the art mtd partition assigned to the network driver and
increments it 1 for the wifi 2.4ghz and 2 for the wifi 5ghz).

I really hope my mtd nvmem implementation doesn't conflicts with others
and can be used, since this would remove many patch used to get mac-address
and other nvmem data.

[1] https://lore.kernel.org/patchwork/patch/765435/

Changes:
v2:
* Fix compile error (missing mtd_node in mtdcore)

Ansuel Smith (4):
  mtd: Add nvmem support for mtd nvmem-providers
  dt-bindings: mtd: partition: Document use of nvmem-provider
  of_net: add mac-address-increment support
  dt-bindings: net: Document use of mac-address-increment

 .../devicetree/bindings/mtd/partition.txt     | 59 +++++++++++++++++++
 .../bindings/net/ethernet-controller.yaml     | 19 ++++++
 drivers/mtd/mtdcore.c                         |  3 +-
 drivers/mtd/parsers/ofpart.c                  |  8 +++
 drivers/of/of_net.c                           | 53 +++++++++++++----
 5 files changed, 129 insertions(+), 13 deletions(-)

-- 
2.27.0


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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-09-20  9:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-19 22:30 [PATCH v2 0/4] Actually implement nvmem support for mtd Ansuel Smith
2020-09-19 22:30 ` Ansuel Smith
2020-09-19 22:30 ` [PATCH v2 1/4] mtd: Add nvmem support for mtd nvmem-providers Ansuel Smith
2020-09-19 22:30   ` Ansuel Smith
2020-09-19 22:30 ` [PATCH v2 2/4] dt-bindings: mtd: partition: Document use of nvmem-provider Ansuel Smith
2020-09-19 22:30   ` Ansuel Smith
2020-09-19 22:30 ` [PATCH v2 3/4] of_net: add mac-address-increment support Ansuel Smith
2020-09-19 22:30   ` Ansuel Smith
2020-09-19 22:30 ` [PATCH v2 4/4] dt-bindings: net: Document use of mac-address-increment Ansuel Smith
2020-09-19 22:30   ` Ansuel Smith
2020-09-20  0:31   ` Andrew Lunn
2020-09-20  0:31     ` Andrew Lunn
2020-09-20  0:39     ` R: " ansuelsmth
2020-09-20  0:39       ` ansuelsmth
2020-09-20  1:22       ` Andrew Lunn
2020-09-20  1:22         ` Andrew Lunn
2020-09-20  9:45         ` ansuelsmth
2020-09-20  9:45           ` ansuelsmth

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.