All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Randy Dunlap <rdunlap@infradead.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Daniel Golle <daniel@makrotopia.org>,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/8] mtd: ubi: allow UBI volumes to provide NVMEM
Date: Fri, 11 Aug 2023 02:36:03 +0100	[thread overview]
Message-ID: <cover.1691717480.git.daniel@makrotopia.org> (raw)

The series is a follow-up and contains all patches of the previous
series "mtd: ubi: behave like a good MTD citizen"[1] which was meant in
preparation for implementing the NVMEM provider.

The goal is to support embedded Linux devices which got NVMEM bits
stored inside a UBI volume. Representing the UBI volume in the Device
Tree, adding a phandle to be referenced by NVMEM consumers allows such
devices to come up with their correct MAC addresses and device-specific
Wi-Fi calibration data loaded.

In order to be available for other drivers, attaching UBI devices has
to be moved from late_initcall (which is too late for other drivers) to
happen earlier. As an alternative to the existing kernel cmdline
parameter the Device Tree property 'compatible = "linux,ubi";' inside
an MTD partition can be used to have that MTD device attached as UBI
device. MTD partitions which serve as UBI devices may have a "volumes"
firmware subnode with volumes which may be compatible with
"nvmem-cells".

In this way, other drivers (think: Ethernet, Wi-Fi) can resolve and
acquire NVMEM bits using the usual device tree phandle, just this time
the NVMEM content is read from a UBI volume.

[1]: https://patchwork.ozlabs.org/project/linux-mtd/list/?series=353177&state=%2A&archive=both

Changes since v3:
 * dt-bindings fixes as requested

Changes since v2:
 * include dt-bindings additions

Changes since v1:
 * include patch to fix exiting Kconfig formatting issues
 * fix typo and indentation in Kconfig

Daniel Golle (8):
  dt-bindings: mtd: add basic bindings for UBI
  dt-bindings: mtd: nvmem-cells: add support for UBI volumes
  mtd: ubi: block: don't return on error when removing
  mtd: ubi: block: use notifier to create ubiblock
  mtd: ubi: attach MTD partition from device-tree
  mtd: ubi: introduce pre-removal notification for UBI volumes
  mtd: ubi: populate ubi volume fwnode
  mtd: ubi: provide NVMEM layer over UBI volumes

 .../bindings/mtd/partitions/linux,ubi.yaml    |  66 ++++++
 .../bindings/mtd/partitions/nvmem-cells.yaml  |   5 +-
 .../bindings/mtd/partitions/ubi-volume.yaml   |  36 ++++
 drivers/mtd/ubi/Kconfig                       |  12 ++
 drivers/mtd/ubi/Makefile                      |   1 +
 drivers/mtd/ubi/block.c                       | 186 ++++++++++-------
 drivers/mtd/ubi/build.c                       | 160 +++++++++++----
 drivers/mtd/ubi/cdev.c                        |   4 +-
 drivers/mtd/ubi/nvmem.c                       | 189 ++++++++++++++++++
 drivers/mtd/ubi/ubi.h                         |   6 +-
 drivers/mtd/ubi/vmt.c                         |  32 +++
 include/linux/mtd/ubi.h                       |   2 +
 12 files changed, 579 insertions(+), 120 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml
 create mode 100644 drivers/mtd/ubi/nvmem.c

-- 
2.41.0

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Golle <daniel@makrotopia.org>
To: Randy Dunlap <rdunlap@infradead.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Daniel Golle <daniel@makrotopia.org>,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/8] mtd: ubi: allow UBI volumes to provide NVMEM
Date: Fri, 11 Aug 2023 02:36:03 +0100	[thread overview]
Message-ID: <cover.1691717480.git.daniel@makrotopia.org> (raw)

The series is a follow-up and contains all patches of the previous
series "mtd: ubi: behave like a good MTD citizen"[1] which was meant in
preparation for implementing the NVMEM provider.

The goal is to support embedded Linux devices which got NVMEM bits
stored inside a UBI volume. Representing the UBI volume in the Device
Tree, adding a phandle to be referenced by NVMEM consumers allows such
devices to come up with their correct MAC addresses and device-specific
Wi-Fi calibration data loaded.

In order to be available for other drivers, attaching UBI devices has
to be moved from late_initcall (which is too late for other drivers) to
happen earlier. As an alternative to the existing kernel cmdline
parameter the Device Tree property 'compatible = "linux,ubi";' inside
an MTD partition can be used to have that MTD device attached as UBI
device. MTD partitions which serve as UBI devices may have a "volumes"
firmware subnode with volumes which may be compatible with
"nvmem-cells".

In this way, other drivers (think: Ethernet, Wi-Fi) can resolve and
acquire NVMEM bits using the usual device tree phandle, just this time
the NVMEM content is read from a UBI volume.

[1]: https://patchwork.ozlabs.org/project/linux-mtd/list/?series=353177&state=%2A&archive=both

Changes since v3:
 * dt-bindings fixes as requested

Changes since v2:
 * include dt-bindings additions

Changes since v1:
 * include patch to fix exiting Kconfig formatting issues
 * fix typo and indentation in Kconfig

Daniel Golle (8):
  dt-bindings: mtd: add basic bindings for UBI
  dt-bindings: mtd: nvmem-cells: add support for UBI volumes
  mtd: ubi: block: don't return on error when removing
  mtd: ubi: block: use notifier to create ubiblock
  mtd: ubi: attach MTD partition from device-tree
  mtd: ubi: introduce pre-removal notification for UBI volumes
  mtd: ubi: populate ubi volume fwnode
  mtd: ubi: provide NVMEM layer over UBI volumes

 .../bindings/mtd/partitions/linux,ubi.yaml    |  66 ++++++
 .../bindings/mtd/partitions/nvmem-cells.yaml  |   5 +-
 .../bindings/mtd/partitions/ubi-volume.yaml   |  36 ++++
 drivers/mtd/ubi/Kconfig                       |  12 ++
 drivers/mtd/ubi/Makefile                      |   1 +
 drivers/mtd/ubi/block.c                       | 186 ++++++++++-------
 drivers/mtd/ubi/build.c                       | 160 +++++++++++----
 drivers/mtd/ubi/cdev.c                        |   4 +-
 drivers/mtd/ubi/nvmem.c                       | 189 ++++++++++++++++++
 drivers/mtd/ubi/ubi.h                         |   6 +-
 drivers/mtd/ubi/vmt.c                         |  32 +++
 include/linux/mtd/ubi.h                       |   2 +
 12 files changed, 579 insertions(+), 120 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml
 create mode 100644 drivers/mtd/ubi/nvmem.c

-- 
2.41.0

             reply	other threads:[~2023-08-11  1:37 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11  1:36 Daniel Golle [this message]
2023-08-11  1:36 ` [PATCH v4 0/8] mtd: ubi: allow UBI volumes to provide NVMEM Daniel Golle
2023-08-11  1:36 ` [PATCH v4 1/8] dt-bindings: mtd: add basic bindings for UBI Daniel Golle
2023-08-11  1:36   ` Daniel Golle
2023-08-21 17:31   ` Rob Herring
2023-08-21 17:31     ` Rob Herring
2023-09-11 19:01     ` Daniel Golle
2023-09-11 19:01       ` Daniel Golle
2023-09-11 19:10       ` Richard Weinberger
2023-09-11 19:10         ` Richard Weinberger
2023-09-13 13:10       ` Tudor Ambarus
2023-09-13 13:10         ` Tudor Ambarus
2023-08-11  1:36 ` [PATCH v4 2/8] dt-bindings: mtd: nvmem-cells: add support for UBI volumes Daniel Golle
2023-08-11  1:36   ` Daniel Golle
2023-08-21 17:31   ` Rob Herring
2023-08-21 17:31     ` Rob Herring
2023-08-11  1:37 ` [PATCH v4 3/8] mtd: ubi: block: don't return on error when removing Daniel Golle
2023-08-11  1:37   ` Daniel Golle
2023-10-03 18:14   ` Richard Weinberger
2023-10-03 18:14     ` Richard Weinberger
2023-08-11  1:37 ` [PATCH v4 4/8] mtd: ubi: block: use notifier to create ubiblock Daniel Golle
2023-08-11  1:37   ` Daniel Golle
2023-10-03 18:46   ` Richard Weinberger
2023-10-03 18:46     ` Richard Weinberger
2023-08-11  1:37 ` [PATCH v4 5/8] mtd: ubi: attach MTD partition from device-tree Daniel Golle
2023-08-11  1:37   ` Daniel Golle
2023-10-03 19:45   ` Richard Weinberger
2023-10-03 19:45     ` Richard Weinberger
2023-10-05 20:46     ` Richard Weinberger
2023-10-05 20:46       ` Richard Weinberger
2023-11-12 15:09       ` Daniel Golle
2023-11-12 15:09         ` Daniel Golle
2023-08-11  1:38 ` [PATCH v4 6/8] mtd: ubi: introduce pre-removal notification for UBI volumes Daniel Golle
2023-08-11  1:38   ` Daniel Golle
2023-08-11  1:38 ` [PATCH v4 7/8] mtd: ubi: populate ubi volume fwnode Daniel Golle
2023-08-11  1:38   ` Daniel Golle
2023-08-11  1:38 ` [PATCH v4 8/8] mtd: ubi: provide NVMEM layer over UBI volumes Daniel Golle
2023-08-11  1:38   ` Daniel Golle

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=cover.1691717480.git.daniel@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=rdunlap@infradead.org \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    /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.