All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ramon Fried <rfried.dev@gmail.com>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Tom Rini <trini@konsulko.com>, Mario Six <mario.six@gdsys.cc>,
	Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH v2 00/11] Add support for NVMEM API
Date: Mon,  4 Apr 2022 15:30:29 -0400	[thread overview]
Message-ID: <20220404193040.2305153-1-sean.anderson@seco.com> (raw)

This adds support for the nvmem-cells properties cropping up in manyb
device trees. This is an easy way to load configuration, version
information, or calibration data from a non-volatile memory source. For
more information, refer to patch 6 ("misc: Add support for nvmem
cells").

For the moment I have only added some integration tests using the
ethernet addresses. This hits the main code paths (looking up nvmem
cells) but doesn't test writing. I can add a few stand-alone tests if
desired.

The patches are structured in the following manner:
1-5:  These are general cleanups, and may be applied independently of
      the rest of the series.
6-7:  Add NVMEM support
8-11: Support reading ethernet addresses using the NVMEM API and add
      some tests.

Changes in v2:
- Call the appropriate API functions directly from
  nvmem_cell_(read|write). This means we can drop the nvmem_interface
  machinery.

Sean Anderson (11):
  sandbox: net: Remove fake-host-hwaddr
  sandbox: Remove eth2addr from environment
  test: eth: Add test for ethernet addresses
  sandbox: Move some mac addresses to device tree
  misc: i2c_eeprom: Make i2c_eeprom_write use a const buf
  misc: Add support for nvmem cells
  sandbox: Enable NVMEM
  net: Add support for reading mac addresses from nvmem cells
  test: Load mac address with i2c eeprom
  test: Load mac address using RTC
  test: Load mac address using misc device

 MAINTAINERS                        |   7 ++
 arch/sandbox/dts/sandbox.dts       |   1 -
 arch/sandbox/dts/sandbox64.dts     |   1 -
 arch/sandbox/dts/test.dts          |  29 +++++-
 board/sandbox/sandbox.env          |   4 -
 configs/sandbox64_defconfig        |   1 +
 configs/sandbox_defconfig          |   1 +
 configs/sandbox_flattree_defconfig |   1 +
 configs/sandbox_noinst_defconfig   |   1 +
 configs/sandbox_spl_defconfig      |   1 +
 doc/api/index.rst                  |   1 +
 doc/api/nvmem.rst                  |   7 ++
 drivers/misc/Kconfig               |  16 +++
 drivers/misc/Makefile              |   1 +
 drivers/misc/i2c_eeprom.c          |   3 +-
 drivers/misc/i2c_eeprom_emul.c     |   4 +
 drivers/misc/misc_sandbox.c        |   3 +
 drivers/misc/nvmem.c               | 142 +++++++++++++++++++++++++++
 drivers/net/sandbox.c              |  10 +-
 drivers/rtc/i2c_rtc_emul.c         |  10 ++
 include/i2c_eeprom.h               |   3 +-
 include/nvmem.h                    | 151 +++++++++++++++++++++++++++++
 net/eth-uclass.c                   |  13 ++-
 test/dm/eth.c                      |  28 ++++++
 24 files changed, 414 insertions(+), 25 deletions(-)
 create mode 100644 doc/api/nvmem.rst
 create mode 100644 drivers/misc/nvmem.c
 create mode 100644 include/nvmem.h

-- 
2.35.1.1320.gc452695387.dirty


             reply	other threads:[~2022-04-04 19:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 19:30 Sean Anderson [this message]
2022-04-04 19:30 ` [PATCH v2 01/11] sandbox: net: Remove fake-host-hwaddr Sean Anderson
2022-04-04 19:30 ` [PATCH v2 02/11] sandbox: Remove eth2addr from environment Sean Anderson
2022-04-04 19:30 ` [PATCH v2 03/11] test: eth: Add test for ethernet addresses Sean Anderson
2022-04-18 17:03   ` Tom Rini
2022-04-18 18:27     ` Sean Anderson
2022-04-04 19:30 ` [PATCH v2 04/11] sandbox: Move some mac addresses to device tree Sean Anderson
2022-04-04 19:30 ` [PATCH v2 05/11] misc: i2c_eeprom: Make i2c_eeprom_write use a const buf Sean Anderson
2022-04-04 19:30 ` [PATCH v2 06/11] misc: Add support for nvmem cells Sean Anderson
2022-04-04 19:30 ` [PATCH v2 07/11] sandbox: Enable NVMEM Sean Anderson
2022-04-04 19:30 ` [PATCH v2 08/11] net: Add support for reading mac addresses from nvmem cells Sean Anderson
2022-04-04 19:30 ` [PATCH v2 09/11] test: Load mac address with i2c eeprom Sean Anderson
2022-04-04 19:30 ` [PATCH v2 10/11] test: Load mac address using RTC Sean Anderson
2022-04-04 19:30 ` [PATCH v2 11/11] test: Load mac address using misc device Sean Anderson

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=20220404193040.2305153-1-sean.anderson@seco.com \
    --to=sean.anderson@seco.com \
    --cc=joe.hershberger@ni.com \
    --cc=mario.six@gdsys.cc \
    --cc=rfried.dev@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.