* [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout
@ 2023-07-18 16:06 Rafał Miłecki
2023-07-18 16:06 ` [PATCH 2/3] nvmem: core: export nvmem device size Rafał Miłecki
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-07-18 16:06 UTC (permalink / raw)
To: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Michael Walle, Christian Marangi, devicetree, linux-mtd,
linux-kernel, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
Use "nvmem-layout" and drop unused "mac" label while at it.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../bindings/nvmem/layouts/nvmem-layout.yaml | 1 +
.../nvmem/{ => layouts}/u-boot,env.yaml | 17 +++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
rename Documentation/devicetree/bindings/nvmem/{ => layouts}/u-boot,env.yaml (87%)
diff --git a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
index 3b40f7880774..382507060651 100644
--- a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
+++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
@@ -21,6 +21,7 @@ oneOf:
- $ref: fixed-layout.yaml
- $ref: kontron,sl28-vpd.yaml
- $ref: onie,tlv-layout.yaml
+ - $ref: u-boot,env.yaml
properties:
compatible: true
diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml
similarity index 87%
rename from Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
rename to Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml
index 36d97fb87865..ebe3b71ba155 100644
--- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
+++ b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
-$id: http://devicetree.org/schemas/nvmem/u-boot,env.yaml#
+$id: http://devicetree.org/schemas/nvmem/layouts/u-boot,env.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: U-Boot environment variables
@@ -72,11 +72,14 @@ examples:
};
env: partition@40000 {
- compatible = "u-boot,env";
reg = <0x40000 0x10000>;
- mac: ethaddr {
- #nvmem-cell-cells = <1>;
+ nvmem-layout {
+ compatible = "u-boot,env";
+
+ ethaddr {
+ #nvmem-cell-cells = <1>;
+ };
};
};
};
@@ -92,9 +95,11 @@ examples:
label = "u-boot";
partition-u-boot-env {
- compatible = "brcm,env";
+ nvmem-layout {
+ compatible = "brcm,env";
- ethaddr {
+ ethaddr {
+ };
};
};
};
--
2.35.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] nvmem: core: export nvmem device size
2023-07-18 16:06 [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout Rafał Miłecki
@ 2023-07-18 16:06 ` Rafał Miłecki
2023-07-18 16:06 ` [PATCH WIP 3/3] nvmem: u-boot-env: convert to NVMEM layout Rafał Miłecki
2023-07-19 16:19 ` [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env " Conor Dooley
2 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-07-18 16:06 UTC (permalink / raw)
To: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Michael Walle, Christian Marangi, devicetree, linux-mtd,
linux-kernel
From: Michael Walle <michael@walle.cc>
Export the size of the nvmem device. NVMEM layout drivers might need it
and might not have access to the device which is registering the NVMEM
device.
Signed-off-by: Michael Walle <michael@walle.cc>
---
drivers/nvmem/core.c | 13 +++++++++++++
include/linux/nvmem-consumer.h | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index a0c9153cda28..57ccd4422e01 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -2224,6 +2224,19 @@ const char *nvmem_dev_name(struct nvmem_device *nvmem)
}
EXPORT_SYMBOL_GPL(nvmem_dev_name);
+/**
+ * nvmem_device_size() - Get the size of a given nvmem device.
+ *
+ * @nvmem: nvmem device.
+ *
+ * Return: size of the nvmem device.
+ */
+size_t nvmem_device_size(struct nvmem_device *nvmem)
+{
+ return nvmem->size;
+}
+EXPORT_SYMBOL_GPL(nvmem_device_size);
+
static int __init nvmem_init(void)
{
return bus_register(&nvmem_bus_type);
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index fa030d93b768..3270ad81e140 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -77,6 +77,7 @@ ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,
struct nvmem_cell_info *info, void *buf);
int nvmem_device_cell_write(struct nvmem_device *nvmem,
struct nvmem_cell_info *info, void *buf);
+size_t nvmem_device_size(struct nvmem_device *nvmem);
const char *nvmem_dev_name(struct nvmem_device *nvmem);
@@ -206,6 +207,11 @@ static inline int nvmem_device_write(struct nvmem_device *nvmem,
return -EOPNOTSUPP;
}
+static inline size_t nvmem_device_size(struct nvmem_device *nvmem)
+{
+ return 0;
+}
+
static inline const char *nvmem_dev_name(struct nvmem_device *nvmem)
{
return NULL;
--
2.35.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH WIP 3/3] nvmem: u-boot-env: convert to NVMEM layout
2023-07-18 16:06 [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout Rafał Miłecki
2023-07-18 16:06 ` [PATCH 2/3] nvmem: core: export nvmem device size Rafał Miłecki
@ 2023-07-18 16:06 ` Rafał Miłecki
2023-07-19 16:19 ` [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env " Conor Dooley
2 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-07-18 16:06 UTC (permalink / raw)
To: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Michael Walle, Christian Marangi, devicetree, linux-mtd,
linux-kernel, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
This avoids code duplication (NVMEM device access) and allows reusing
this on top of other NVMEM devices.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/mtd/mtdcore.c | 7 ++
drivers/nvmem/Kconfig | 15 ++-
drivers/nvmem/Makefile | 2 -
drivers/nvmem/layouts/Kconfig | 10 ++
drivers/nvmem/layouts/Makefile | 1 +
drivers/nvmem/{ => layouts}/u-boot-env.c | 112 +++++++++--------------
6 files changed, 68 insertions(+), 79 deletions(-)
rename drivers/nvmem/{ => layouts}/u-boot-env.c (67%)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 3d781ffb8c32..5f96affdfb0f 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -556,6 +556,13 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
config.ignore_wp = true;
config.priv = mtd;
+ if (IS_ENABLED(NVMEM_U_BOOT_ENV) &&
+ (of_device_is_compatible(node, "u-boot,env") ||
+ of_device_is_compatible(node, "brcm,env"))) {
+ /* FIXME */
+ pr_warn("Missing support for deprecated U-Boot env binding\n");
+ }
+
mtd->nvmem = nvmem_register(&config);
if (IS_ERR(mtd->nvmem)) {
/* Just ignore if there is no NVMEM support in the kernel */
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index da9befa3d6c4..ff99c284a582 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -347,18 +347,15 @@ config NVMEM_SUNXI_SID
will be called nvmem_sunxi_sid.
config NVMEM_U_BOOT_ENV
- tristate "U-Boot environment variables support"
+ bool "U-Boot environment variables support"
depends on OF && MTD
- select CRC32
- select GENERIC_NET_UTILS
+ select NVMEM_LAYOUT_U_BOOT_ENV
help
- U-Boot stores its setup as environment variables. This driver adds
- support for verifying & exporting such data. It also exposes variables
- as NVMEM cells so they can be referenced by other drivers.
-
- Currently this drivers works only with env variables on top of MTD.
+ This option enables support for the old device tree binding describing
+ U-Boot environment variables block on top of MTD partition.
- If compiled as module it will be called nvmem_u-boot-env.
+ Those bindings have been deprecated in favor of using a proper NVMEM
+ layout.
config NVMEM_UNIPHIER_EFUSE
tristate "UniPhier SoCs eFuse support"
diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile
index cc23ce4ffb1f..2558752fd9a3 100644
--- a/drivers/nvmem/Makefile
+++ b/drivers/nvmem/Makefile
@@ -69,8 +69,6 @@ obj-$(CONFIG_NVMEM_SUNPLUS_OCOTP) += nvmem_sunplus_ocotp.o
nvmem_sunplus_ocotp-y := sunplus-ocotp.o
obj-$(CONFIG_NVMEM_SUNXI_SID) += nvmem_sunxi_sid.o
nvmem_sunxi_sid-y := sunxi_sid.o
-obj-$(CONFIG_NVMEM_U_BOOT_ENV) += nvmem_u-boot-env.o
-nvmem_u-boot-env-y := u-boot-env.o
obj-$(CONFIG_NVMEM_UNIPHIER_EFUSE) += nvmem-uniphier-efuse.o
nvmem-uniphier-efuse-y := uniphier-efuse.o
obj-$(CONFIG_NVMEM_VF610_OCOTP) += nvmem-vf610-ocotp.o
diff --git a/drivers/nvmem/layouts/Kconfig b/drivers/nvmem/layouts/Kconfig
index 7ff1ee1c1f05..f33999be787e 100644
--- a/drivers/nvmem/layouts/Kconfig
+++ b/drivers/nvmem/layouts/Kconfig
@@ -20,4 +20,14 @@ config NVMEM_LAYOUT_ONIE_TLV
If unsure, say N.
+config NVMEM_LAYOUT_U_BOOT_ENV
+ tristate "U-Boot environment variables layout support"
+ depends on OF
+ select CRC32
+ select GENERIC_NET_UTILS
+ help
+ U-Boot stores its setup as environment variables. This driver adds
+ support for verifying & exporting such data. It also exposes variables
+ as NVMEM cells so they can be referenced by other drivers.
+
endmenu
diff --git a/drivers/nvmem/layouts/Makefile b/drivers/nvmem/layouts/Makefile
index 2974bd7d33ed..4940c9db0665 100644
--- a/drivers/nvmem/layouts/Makefile
+++ b/drivers/nvmem/layouts/Makefile
@@ -5,3 +5,4 @@
obj-$(CONFIG_NVMEM_LAYOUT_SL28_VPD) += sl28vpd.o
obj-$(CONFIG_NVMEM_LAYOUT_ONIE_TLV) += onie-tlv.o
+obj-$(CONFIG_NVMEM_LAYOUT_U_BOOT_ENV) += u-boot-env.o
diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/layouts/u-boot-env.c
similarity index 67%
rename from drivers/nvmem/u-boot-env.c
rename to drivers/nvmem/layouts/u-boot-env.c
index ee9fd9989b6e..32eae6df8d96 100644
--- a/drivers/nvmem/u-boot-env.c
+++ b/drivers/nvmem/layouts/u-boot-env.c
@@ -8,11 +8,9 @@
#include <linux/if_ether.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/mtd/mtd.h>
#include <linux/nvmem-consumer.h>
#include <linux/nvmem-provider.h>
#include <linux/of_device.h>
-#include <linux/platform_device.h>
#include <linux/slab.h>
enum u_boot_env_format {
@@ -25,7 +23,7 @@ struct u_boot_env {
struct device *dev;
enum u_boot_env_format format;
- struct mtd_info *mtd;
+ struct nvmem_device *nvmem;
/* Cells */
struct nvmem_cell_info *cells;
@@ -50,28 +48,6 @@ struct u_boot_env_image_broadcom {
uint8_t data[0];
} __packed;
-static int u_boot_env_read(void *context, unsigned int offset, void *val,
- size_t bytes)
-{
- struct u_boot_env *priv = context;
- struct device *dev = priv->dev;
- size_t bytes_read;
- int err;
-
- err = mtd_read(priv->mtd, offset, bytes, &bytes_read, val);
- if (err && !mtd_is_bitflip(err)) {
- dev_err(dev, "Failed to read from mtd: %d\n", err);
- return err;
- }
-
- if (bytes_read != bytes) {
- dev_err(dev, "Failed to read %zu bytes\n", bytes);
- return -EIO;
- }
-
- return 0;
-}
-
static int u_boot_env_read_post_process_ethaddr(void *context, const char *id, int index,
unsigned int offset, void *buf, size_t bytes)
{
@@ -95,17 +71,25 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
size_t data_offset, size_t data_len)
{
struct device *dev = priv->dev;
+ struct device_node *layout_np;
char *data = buf + data_offset;
char *var, *value, *eq;
+ int err = 0;
int idx;
+ layout_np = of_nvmem_layout_get_container(priv->nvmem);
+ if (!layout_np)
+ return -ENOENT;
+
priv->ncells = 0;
for (var = data; var < data + data_len && *var; var += strlen(var) + 1)
priv->ncells++;
priv->cells = devm_kcalloc(dev, priv->ncells, sizeof(*priv->cells), GFP_KERNEL);
- if (!priv->cells)
- return -ENOMEM;
+ if (!priv->cells) {
+ err = -ENOMEM;
+ goto err_of_node_put;
+ }
for (var = data, idx = 0;
var < data + data_len && *var;
@@ -117,11 +101,13 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
value = eq + 1;
priv->cells[idx].name = devm_kstrdup(dev, var, GFP_KERNEL);
- if (!priv->cells[idx].name)
- return -ENOMEM;
+ if (!priv->cells[idx].name) {
+ err = -ENOMEM;
+ goto err_of_node_put;
+ }
priv->cells[idx].offset = data_offset + value - data;
priv->cells[idx].bytes = strlen(value);
- priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
+ priv->cells[idx].np = of_get_child_by_name(layout_np, priv->cells[idx].name);
if (!strcmp(var, "ethaddr")) {
priv->cells[idx].raw_len = strlen(value);
priv->cells[idx].bytes = ETH_ALEN;
@@ -132,7 +118,10 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
if (WARN_ON(idx != priv->ncells))
priv->ncells = idx;
- return 0;
+err_of_node_put:
+ of_node_put(layout_np);
+
+ return err;
}
static int u_boot_env_parse(struct u_boot_env *priv)
@@ -143,21 +132,25 @@ static int u_boot_env_parse(struct u_boot_env *priv)
size_t crc32_offset;
size_t data_offset;
size_t data_len;
+ size_t env_size;
uint32_t crc32;
uint32_t calc;
- size_t bytes;
+ ssize_t bytes;
uint8_t *buf;
int err;
- buf = kcalloc(1, priv->mtd->size, GFP_KERNEL);
+ env_size = nvmem_device_size(priv->nvmem);
+
+ buf = kcalloc(1, env_size, GFP_KERNEL);
if (!buf) {
err = -ENOMEM;
goto err_out;
}
- err = mtd_read(priv->mtd, 0, priv->mtd->size, &bytes, buf);
- if ((err && !mtd_is_bitflip(err)) || bytes != priv->mtd->size) {
- dev_err(dev, "Failed to read from mtd: %d\n", err);
+ bytes = nvmem_device_read(priv->nvmem, 0, env_size, buf);
+ if (bytes < 0 || bytes != env_size) {
+ dev_err(dev, "Failed to read from NVMEM device: %zd\n", bytes);
+ err = -EIO;
goto err_kfree;
}
@@ -179,8 +172,8 @@ static int u_boot_env_parse(struct u_boot_env *priv)
break;
}
crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset));
- crc32_data_len = priv->mtd->size - crc32_data_offset;
- data_len = priv->mtd->size - data_offset;
+ crc32_data_len = env_size - crc32_data_offset;
+ data_len = env_size - data_offset;
calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L;
if (calc != crc32) {
@@ -189,7 +182,7 @@ static int u_boot_env_parse(struct u_boot_env *priv)
goto err_kfree;
}
- buf[priv->mtd->size - 1] = '\0';
+ buf[env_size - 1] = '\0';
err = u_boot_env_add_cells(priv, buf, data_offset, data_len);
if (err)
dev_err(dev, "Failed to add cells: %d\n", err);
@@ -200,14 +193,9 @@ static int u_boot_env_parse(struct u_boot_env *priv)
return err;
}
-static int u_boot_env_probe(struct platform_device *pdev)
+static int u_boot_env_layout_add_cells(struct device *dev, struct nvmem_device *nvmem,
+ struct nvmem_layout *layout)
{
- struct nvmem_config config = {
- .name = "u-boot-env",
- .reg_read = u_boot_env_read,
- };
- struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
struct u_boot_env *priv;
int err;
@@ -216,28 +204,18 @@ static int u_boot_env_probe(struct platform_device *pdev)
return -ENOMEM;
priv->dev = dev;
- priv->format = (uintptr_t)of_device_get_match_data(dev);
+ priv->format = (uintptr_t)nvmem_layout_get_match_data(nvmem, layout);
- priv->mtd = of_get_mtd_device_by_node(np);
- if (IS_ERR(priv->mtd)) {
- dev_err_probe(dev, PTR_ERR(priv->mtd), "Failed to get %pOF MTD\n", np);
- return PTR_ERR(priv->mtd);
- }
+ priv->nvmem = nvmem;
err = u_boot_env_parse(priv);
if (err)
return err;
- config.dev = dev;
- config.cells = priv->cells;
- config.ncells = priv->ncells;
- config.priv = priv;
- config.size = priv->mtd->size;
-
- return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config));
+ return 0;
}
-static const struct of_device_id u_boot_env_of_match_table[] = {
+static const struct of_device_id u_boot_env_layout_of_match_table[] = {
{ .compatible = "u-boot,env", .data = (void *)U_BOOT_FORMAT_SINGLE, },
{ .compatible = "u-boot,env-redundant-bool", .data = (void *)U_BOOT_FORMAT_REDUNDANT, },
{ .compatible = "u-boot,env-redundant-count", .data = (void *)U_BOOT_FORMAT_REDUNDANT, },
@@ -245,15 +223,13 @@ static const struct of_device_id u_boot_env_of_match_table[] = {
{},
};
-static struct platform_driver u_boot_env_driver = {
- .probe = u_boot_env_probe,
- .driver = {
- .name = "u_boot_env",
- .of_match_table = u_boot_env_of_match_table,
- },
+static struct nvmem_layout u_boot_env_layout = {
+ .name = "u_boot_env",
+ .of_match_table = u_boot_env_layout_of_match_table,
+ .add_cells = u_boot_env_layout_add_cells,
};
-module_platform_driver(u_boot_env_driver);
+module_nvmem_layout_driver(u_boot_env_layout);
MODULE_AUTHOR("Rafał Miłecki");
MODULE_LICENSE("GPL");
-MODULE_DEVICE_TABLE(of, u_boot_env_of_match_table);
+MODULE_DEVICE_TABLE(of, u_boot_env_layout_of_match_table);
--
2.35.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout
2023-07-18 16:06 [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout Rafał Miłecki
2023-07-18 16:06 ` [PATCH 2/3] nvmem: core: export nvmem device size Rafał Miłecki
2023-07-18 16:06 ` [PATCH WIP 3/3] nvmem: u-boot-env: convert to NVMEM layout Rafał Miłecki
@ 2023-07-19 16:19 ` Conor Dooley
2 siblings, 0 replies; 4+ messages in thread
From: Conor Dooley @ 2023-07-19 16:19 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Michael Walle, Christian Marangi, devicetree,
linux-mtd, linux-kernel, Rafał Miłecki
[-- Attachment #1: Type: text/plain, Size: 2904 bytes --]
On Tue, Jul 18, 2023 at 06:06:50PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> Use "nvmem-layout" and drop unused "mac" label while at it.
Stupid question perhaps, does the "old" way of doing this still work
after this series?
Thanks
Conor.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> .../bindings/nvmem/layouts/nvmem-layout.yaml | 1 +
> .../nvmem/{ => layouts}/u-boot,env.yaml | 17 +++++++++++------
> 2 files changed, 12 insertions(+), 6 deletions(-)
> rename Documentation/devicetree/bindings/nvmem/{ => layouts}/u-boot,env.yaml (87%)
>
> diff --git a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> index 3b40f7880774..382507060651 100644
> --- a/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml
> @@ -21,6 +21,7 @@ oneOf:
> - $ref: fixed-layout.yaml
> - $ref: kontron,sl28-vpd.yaml
> - $ref: onie,tlv-layout.yaml
> + - $ref: u-boot,env.yaml
>
> properties:
> compatible: true
> diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml
> similarity index 87%
> rename from Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
> rename to Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml
> index 36d97fb87865..ebe3b71ba155 100644
> --- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml
> @@ -1,7 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> %YAML 1.2
> ---
> -$id: http://devicetree.org/schemas/nvmem/u-boot,env.yaml#
> +$id: http://devicetree.org/schemas/nvmem/layouts/u-boot,env.yaml#
> $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> title: U-Boot environment variables
> @@ -72,11 +72,14 @@ examples:
> };
>
> env: partition@40000 {
> - compatible = "u-boot,env";
> reg = <0x40000 0x10000>;
>
> - mac: ethaddr {
> - #nvmem-cell-cells = <1>;
> + nvmem-layout {
> + compatible = "u-boot,env";
> +
> + ethaddr {
> + #nvmem-cell-cells = <1>;
> + };
> };
> };
> };
> @@ -92,9 +95,11 @@ examples:
> label = "u-boot";
>
> partition-u-boot-env {
> - compatible = "brcm,env";
> + nvmem-layout {
> + compatible = "brcm,env";
>
> - ethaddr {
> + ethaddr {
> + };
> };
> };
> };
> --
> 2.35.3
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-19 16:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 16:06 [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env to NVMEM layout Rafał Miłecki
2023-07-18 16:06 ` [PATCH 2/3] nvmem: core: export nvmem device size Rafał Miłecki
2023-07-18 16:06 ` [PATCH WIP 3/3] nvmem: u-boot-env: convert to NVMEM layout Rafał Miłecki
2023-07-19 16:19 ` [PATCH 1/3] dt-bindings: nvmem: convert U-Boot env " Conor Dooley
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).