mbox series

[0/4] nvmem: cell post-processing & U-Boot env MAC support

Message ID 20230222172245.6313-1-zajec5@gmail.com
Headers show
Series nvmem: cell post-processing & U-Boot env MAC support | expand

Message

Rafał Miłecki Feb. 22, 2023, 5:22 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

U-Boot environment variables are stored using ASCII format. One of
important entries is "ethaddr" which contains base MAC address.

That NVMEM cell requires some extra processing when reading:
1. ASCII needs translating into binary MAC format
2. Final MAC needs to be calculated depending on cell index

This patchset was originally based on top of layouts implementation
which sadly ended up dropped for now. To proceed I rebased it on top of
the current NVMEM subsystem code. Michael's patch has applied cleanly
and this approach *will not* make U-Boot env transition to layouts any
harder so I believe it's fine to take those patches without waiting for
layouts updated implementation.

Michael Walle (1):
  nvmem: core: add per-cell post processing

Rafał Miłecki (3):
  nvmem: core: allow nvmem_cell_post_process_t callbacks to adjust
    buffer
  dt-bindings: nvmem: u-boot,env: add MAC's #nvmem-cell-cells
  nvmem: u-boot-env: post-process "ethaddr" env variable

 .../devicetree/bindings/nvmem/u-boot,env.yaml |  7 +++-
 drivers/nvmem/Kconfig                         |  1 +
 drivers/nvmem/core.c                          | 38 +++++++++++++++----
 drivers/nvmem/imx-ocotp.c                     |  8 ++--
 drivers/nvmem/u-boot-env.c                    | 25 ++++++++++++
 include/linux/nvmem-provider.h                |  7 +++-
 6 files changed, 71 insertions(+), 15 deletions(-)