linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] nvmem: add ethernet address offset support
@ 2021-12-28 14:25 Michael Walle
  2021-12-28 14:25 ` [PATCH 1/8] of: base: add of_parse_phandle_with_optional_args() Michael Walle
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Michael Walle @ 2021-12-28 14:25 UTC (permalink / raw)
  To: linux-mtd, devicetree, linux-kernel, linux-arm-kernel, netdev
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Srinivas Kandagatla, Shawn Guo, Li Yang,
	Frank Rowand, David S . Miller, Jakub Kicinski, Ansuel Smith,
	Andrew Lunn, Michael Walle

This is my second attempt to solve the use case where there is only the
base MAC address stored in an EEPROM or similar storage provider. This
is the case for the Kontron sl28 board and multiple openwrt supported
boards.

Introduce an NVMEM transformation op. This can then be used to parse or
swap bytes of the NVMEM cell value. A transformation might also have
multiple output values, like in the base mac address case. It reads the mac
address from the nvmem storage and generates multiple individual addresses,
i.e. on our board we reserve 8 consecutive addresses. These addresses then
can be assigned to different network interfaces. To make it possible to
reference different values we need to introduce an argument to the phandle.
This additional argument is then an index which is can be used by the
transformation op.

Previous discussion can be found here:
https://lore.kernel.org/linux-devicetree/20211123134425.3875656-1-michael@walle.cc/

Michael Walle (8):
  of: base: add of_parse_phandle_with_optional_args()
  dt-bindings: nvmem: add transformation bindings
  nvmem: core: add an index parameter to the cell
  nvmem: core: add transformations support
  net: add helper eth_addr_add()
  nvmem: transformations: ethernet address offset support
  arm64: dts: ls1028a: sl28: get MAC addresses from VPD
  arm64: defconfig: enable NVMEM transformations

 .../devicetree/bindings/mtd/mtd.yaml          |  7 +-
 .../bindings/nvmem/nvmem-transformations.yaml | 46 ++++++++++++
 .../fsl-ls1028a-kontron-kbox-a-230-ls.dts     |  8 ++
 .../fsl-ls1028a-kontron-sl28-var1.dts         |  2 +
 .../fsl-ls1028a-kontron-sl28-var2.dts         |  4 +
 .../fsl-ls1028a-kontron-sl28-var4.dts         |  2 +
 .../freescale/fsl-ls1028a-kontron-sl28.dts    | 17 +++++
 arch/arm64/configs/defconfig                  |  1 +
 drivers/nvmem/Kconfig                         |  7 ++
 drivers/nvmem/Makefile                        |  1 +
 drivers/nvmem/core.c                          | 44 ++++++++---
 drivers/nvmem/imx-ocotp.c                     |  4 +-
 drivers/nvmem/transformations.c               | 73 +++++++++++++++++++
 drivers/of/base.c                             | 23 ++++++
 include/linux/etherdevice.h                   | 14 ++++
 include/linux/nvmem-provider.h                | 13 +++-
 include/linux/of.h                            | 12 +++
 17 files changed, 260 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/nvmem/nvmem-transformations.yaml
 create mode 100644 drivers/nvmem/transformations.c

-- 
2.30.2


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

end of thread, other threads:[~2022-08-25  9:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 14:25 [PATCH 0/8] nvmem: add ethernet address offset support Michael Walle
2021-12-28 14:25 ` [PATCH 1/8] of: base: add of_parse_phandle_with_optional_args() Michael Walle
2022-01-10 19:06   ` Rob Herring
2021-12-28 14:25 ` [PATCH 2/8] dt-bindings: nvmem: add transformation bindings Michael Walle
2021-12-29 17:34   ` Rob Herring
2022-01-04 15:03   ` Rob Herring
2022-01-05  8:25     ` Michael Walle
2022-01-05 14:20       ` Rob Herring
2021-12-28 14:25 ` [PATCH 3/8] nvmem: core: add an index parameter to the cell Michael Walle
2021-12-28 14:25 ` [PATCH 4/8] nvmem: core: add transformations support Michael Walle
2021-12-28 14:25 ` [PATCH 5/8] net: add helper eth_addr_add() Michael Walle
2022-01-25 10:24   ` Rafał Miłecki
2022-08-25  9:46     ` Michael Walle
2021-12-28 14:25 ` [PATCH 6/8] nvmem: transformations: ethernet address offset support Michael Walle
2022-01-25 12:08   ` Rafał Miłecki
2022-01-25 14:59     ` Michael Walle
2021-12-28 14:25 ` [PATCH 7/8] arm64: dts: ls1028a: sl28: get MAC addresses from VPD Michael Walle
2021-12-28 14:25 ` [PATCH 8/8] arm64: defconfig: enable NVMEM transformations Michael Walle

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).