linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadym Kochan <vadym.kochan@plvision.eu>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: Robert Marko <robert.marko@sartura.hr>,
	Vadym Kochan <vadym.kochan@plvision.eu>
Subject: [PATCH v2 0/3] nvmem: add ONIE NVMEM cells parser
Date: Tue,  8 Jun 2021 22:03:24 +0300	[thread overview]
Message-ID: <20210608190327.22071-1-vadym.kochan@plvision.eu> (raw)

This series adds cells parser for the ONIE TLV attributes which are
stored on NVMEM device. It adds possibility to read the mac address (and
other info) by other drivers.

Because ONIE stores info in TLV format it should be parsed first and
then register the cells. Current NVMEM API allows to register cell
table with known cell's offset which is not guaranteed in case of TLV.

To make it properly handled the NVMEM parser object is introduced. The
parser needs to be registered before target NVMEM device is registered.
During the registration of NVMEM device the parser is called to parse
the device's cells and reister the cell table.

v2:
    1) Series title changed, "provider" is replaced by "parser".

    2) onie-cells.c renamed to onie-tlv-cells.c

    3) Do not register onie cells parser via platform driver,
       but via module_init().

    4) Removed cells_remove callback from nvmem_parser_config because
       now cells table and lookups are registered by core.c

    5) Introduced nvmem_parser_data which is passed to parser
       handler/driver to fill cells table & lookups.

    6) core.c registers cells table & lookups to simplify the parser
       handler logic.

    7) parser's module refcount is incremented/decremented on each parser
       bind/unbind to nvmem device.

    8) core.c relies on parser name which is obtained via
       device_property API, instead of of_node which was used
       in previous version.

    9) nvmem-cell-parser-name DT nvmem property was added to bind
       cells parser to nvmem device during the nvmem registration.

P.S.
I marked it with v2 as relative to series which was sent as:

    "nvmem: add ONIE NVMEM cells provider"
    
Vadym Kochan (3):
  nvmem: core: introduce cells parser
  dt-bindings: nvmem: document nvmem-cells-parser-name property
  nvmem: add ONIE nvmem cells parser

 .../devicetree/bindings/nvmem/nvmem.yaml      |   5 +
 drivers/nvmem/Kconfig                         |   9 +
 drivers/nvmem/Makefile                        |   2 +
 drivers/nvmem/core.c                          | 178 +++++++++++
 drivers/nvmem/onie-tlv-cells.c                | 302 ++++++++++++++++++
 include/linux/nvmem-provider.h                |  31 ++
 6 files changed, 527 insertions(+)
 create mode 100644 drivers/nvmem/onie-tlv-cells.c

-- 
2.17.1


             reply	other threads:[~2021-06-08 19:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 19:03 Vadym Kochan [this message]
2021-06-08 19:03 ` [PATCH v2 1/3] nvmem: core: introduce cells parser Vadym Kochan
2021-06-08 22:49   ` kernel test robot
2021-06-09  3:05   ` kernel test robot
2021-06-14 10:44   ` Srinivas Kandagatla
2021-06-16 12:33     ` Vadym Kochan
2021-06-21 11:00       ` Srinivas Kandagatla
2021-09-08  9:38         ` Vadym Kochan
2021-09-13 14:19           ` Srinivas Kandagatla
2021-09-20 10:24             ` Vadym Kochan
2021-09-20 10:36               ` Srinivas Kandagatla
2021-09-20 11:25                 ` Vadym Kochan
2021-09-20 11:32                   ` Srinivas Kandagatla
2021-09-20 12:29                     ` Vadym Kochan
2021-09-20 12:34                       ` Srinivas Kandagatla
2021-09-20 13:29                         ` Vadym Kochan
2021-09-20 13:40                           ` Srinivas Kandagatla
2021-09-21  5:50                             ` John Thomson
2021-09-27  7:50                               ` Vadym Kochan
2021-09-27 10:12                                 ` Srinivas Kandagatla
2021-09-28 13:31                                   ` Vadym Kochan
2021-09-28 13:51                                     ` Srinivas Kandagatla
2021-09-28 14:11                                       ` Vadym Kochan
2021-09-28 14:39                                         ` Srinivas Kandagatla
2021-09-27 10:12                               ` Srinivas Kandagatla
2021-09-27 12:38                                 ` John Thomson
2021-09-08  9:44     ` Vadym Kochan
2021-06-08 19:03 ` [PATCH v2 2/3] dt-bindings: nvmem: document nvmem-cells-parser-name property Vadym Kochan
2021-06-18 20:59   ` Rob Herring
2021-06-08 19:03 ` [PATCH v2 3/3] nvmem: add ONIE nvmem cells parser Vadym Kochan
2021-08-06 15:39   ` Jan Lübbe
2021-09-08  9:56     ` Vadym Kochan
2021-09-12 21:06       ` John Thomson
2021-09-13 14:20         ` Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210608190327.22071-1-vadym.kochan@plvision.eu \
    --to=vadym.kochan@plvision.eu \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.marko@sartura.hr \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).