From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752212AbcCAQ7h (ORCPT ); Tue, 1 Mar 2016 11:59:37 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33418 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbcCAQ7g (ORCPT ); Tue, 1 Mar 2016 11:59:36 -0500 From: Andrey Smirnov To: linux-kernel@vger.kernel.org Cc: srinivas.kandagatla@linaro.org, maxime.ripard@free-electrons.com, Andrey Smirnov Subject: [RESEND RFC 0/3] Proposed extensions for NVMEM Date: Tue, 1 Mar 2016 08:59:09 -0800 Message-Id: <1456851552-15913-1-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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