Skip to content

Commit 2fcea44

Browse files
Rafał Miłeckigregkh
authored andcommitted
dt-bindings: nvmem: convert U-Boot env to a layout
U-Boot environment variables can be stored in various data sources. MTD is just one of available options. Refactor DT binding into a layout so it can be used with UBI volumes and other NVMEM devices. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Rafał Miłecki <[email protected]> Reviewed-by: Rob Herring (Arm) <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c3f9b7b commit 2fcea44

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ oneOf:
2121
- $ref: fixed-layout.yaml
2222
- $ref: kontron,sl28-vpd.yaml
2323
- $ref: onie,tlv-layout.yaml
24+
- $ref: u-boot,env.yaml
2425

2526
properties:
2627
compatible: true

Documentation/devicetree/bindings/nvmem/u-boot,env.yaml renamed to Documentation/devicetree/bindings/nvmem/layouts/u-boot,env.yaml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/nvmem/u-boot,env.yaml#
4+
$id: http://devicetree.org/schemas/nvmem/layouts/u-boot,env.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: U-Boot environment variables
7+
title: U-Boot environment variables layout
88

99
description: |
1010
U-Boot uses environment variables to store device parameters and
@@ -21,9 +21,6 @@ description: |
2121
This binding allows marking storage device (as containing env data) and
2222
specifying used format.
2323
24-
Right now only flash partition case is covered but it may be extended to e.g.
25-
UBI volumes in the future.
26-
2724
Variables can be defined as NVMEM device subnodes.
2825
2926
maintainers:
@@ -42,6 +39,7 @@ properties:
4239
const: brcm,env
4340

4441
reg:
42+
description: Partition offset and size for env on top of MTD
4543
maxItems: 1
4644

4745
bootcmd:
@@ -58,6 +56,17 @@ properties:
5856
description: The first argument is a MAC address offset.
5957
const: 1
6058

59+
allOf:
60+
- if:
61+
properties:
62+
$nodename:
63+
not:
64+
contains:
65+
pattern: "^partition@[0-9a-f]+$"
66+
then:
67+
properties:
68+
reg: false
69+
6170
additionalProperties: false
6271

6372
examples:
@@ -101,3 +110,23 @@ examples:
101110
};
102111
};
103112
};
113+
- |
114+
partition@0 {
115+
reg = <0x0 0x100000>;
116+
label = "ubi";
117+
compatible = "linux,ubi";
118+
119+
volumes {
120+
ubi-volume-u-boot-env {
121+
volname = "env";
122+
123+
nvmem-layout {
124+
compatible = "u-boot,env";
125+
126+
ethaddr {
127+
#nvmem-cell-cells = <1>;
128+
};
129+
};
130+
};
131+
};
132+
};

0 commit comments

Comments
 (0)