[RFC 0/3] Proposed extensions for NVMEM

From: Andrey Smirnov
Date: Mon Feb 22 2016 - 14:52:33 EST


Hello,

This RFC introduces two new drivers to NVMEM subsytem. First driver,
'nvmem-blob', serves the purpose of exposing data, embedded in DTB,
via NVMEM consumer API. Second, 'nvmem-composite', allows the user to
combin a number of NVMEM cells (or parts of them) into a single
continuos "blob" of data presented to the rest of the system as a
regular NVMEM device.

The intent of this RFC is to solicit feedback about the approach,
binding or if these features should be accepted upstream in general.

I originally proposed this extentions as a part of Barebox project (Barebox
borrows a lot of concepts from Linux kernel and adopting NVMEM
subsystem was being discussed), in order to facilitate usage of NVMEM
to initialize source of MAC address for a paticular Ethernet adapter
(Barebox would read that value and fixup DT blob with appropriate
value as a part of booting Linux). However the drivers should be
generic enough to not be tied to that case.

Please bear in mind the the code included is a very rough draft and a
lot of error checking/handling code in is was stubbed out.

Any feedback is welcome.

Thank you,
Andrey Smirnov

Andrey Smirnov (3):
nvmem: Add 'of_nvmem_cell_from_device_node()'
nvmem: Add 'nvmem-blob' driver
nvmem: Add 'nvmem-composite' driver

Documentation/devicetree/bindings/nvmem/blob.txt | 35 ++++
.../devicetree/bindings/nvmem/composite.txt | 44 ++++
drivers/nvmem/Makefile | 2 +
drivers/nvmem/blob.c | 132 ++++++++++++
drivers/nvmem/composite.c | 228 +++++++++++++++++++++
drivers/nvmem/core.c | 44 ++--
include/linux/nvmem-consumer.h | 7 +
7 files changed, 479 insertions(+), 13 deletions(-)
create mode 100644 Documentation/devicetree/bindings/nvmem/blob.txt
create mode 100644 Documentation/devicetree/bindings/nvmem/composite.txt
create mode 100644 drivers/nvmem/blob.c
create mode 100644 drivers/nvmem/composite.c

--
2.5.0