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

Rafał Miłecki zajec5 at gmail.com
Wed Feb 22 18:22:41 CET 2023


From: Rafał Miłecki <rafal at 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(-)

-- 
2.34.1



More information about the U-Boot mailing list