Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause |
| 2 | %YAML 1.2 |
| 3 | --- |
| 4 | $id: http://devicetree.org/schemas/nvmem/u-boot,env.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: U-Boot environment variables |
| 8 | |
| 9 | description: | |
| 10 | U-Boot uses environment variables to store device parameters and |
| 11 | configuration. They may be used for booting process, setup or keeping end user |
| 12 | info. |
| 13 | |
| 14 | Data is stored using U-Boot specific formats (variant specific header and NUL |
| 15 | separated key-value pairs). |
| 16 | |
| 17 | Environment data can be stored on various storage entities, e.g.: |
| 18 | 1. Raw flash partition |
| 19 | 2. UBI volume |
| 20 | |
| 21 | This binding allows marking storage device (as containing env data) and |
| 22 | specifying used format. |
| 23 | |
| 24 | Right now only flash partition case is covered but it may be extended to e.g. |
| 25 | UBI volumes in the future. |
| 26 | |
| 27 | Variables can be defined as NVMEM device subnodes. |
| 28 | |
| 29 | maintainers: |
| 30 | - Rafał Miłecki <rafal@milecki.pl> |
| 31 | |
| 32 | properties: |
| 33 | compatible: |
| 34 | oneOf: |
| 35 | - description: A standalone env data block |
| 36 | const: u-boot,env |
| 37 | - description: Two redundant blocks with active one flagged |
| 38 | const: u-boot,env-redundant-bool |
| 39 | - description: Two redundant blocks with active having higher counter |
| 40 | const: u-boot,env-redundant-count |
| 41 | - description: Broadcom's variant with custom header |
| 42 | const: brcm,env |
| 43 | |
| 44 | reg: |
| 45 | maxItems: 1 |
| 46 | |
| 47 | bootcmd: |
| 48 | type: object |
| 49 | description: Command to use for automatic booting |
| 50 | |
| 51 | ethaddr: |
| 52 | type: object |
| 53 | description: Ethernet interfaces base MAC address. |
| 54 | additionalProperties: false |
| 55 | |
| 56 | properties: |
| 57 | "#nvmem-cell-cells": |
| 58 | description: The first argument is a MAC address offset. |
| 59 | const: 1 |
| 60 | |
| 61 | additionalProperties: false |
| 62 | |
| 63 | examples: |
| 64 | - | |
| 65 | partitions { |
| 66 | compatible = "fixed-partitions"; |
| 67 | #address-cells = <1>; |
| 68 | #size-cells = <1>; |
| 69 | |
| 70 | partition@0 { |
| 71 | reg = <0x0 0x40000>; |
| 72 | label = "u-boot"; |
| 73 | read-only; |
| 74 | }; |
| 75 | |
| 76 | env: partition@40000 { |
| 77 | compatible = "u-boot,env"; |
| 78 | reg = <0x40000 0x10000>; |
| 79 | |
| 80 | mac: ethaddr { |
| 81 | #nvmem-cell-cells = <1>; |
| 82 | }; |
| 83 | }; |
| 84 | }; |
| 85 | - | |
| 86 | partitions { |
| 87 | compatible = "fixed-partitions"; |
| 88 | #address-cells = <1>; |
| 89 | #size-cells = <1>; |
| 90 | |
| 91 | partition@0 { |
| 92 | reg = <0x0 0x100000>; |
| 93 | compatible = "brcm,u-boot"; |
| 94 | label = "u-boot"; |
| 95 | |
| 96 | partition-u-boot-env { |
| 97 | compatible = "brcm,env"; |
| 98 | |
| 99 | ethaddr { |
| 100 | }; |
| 101 | }; |
| 102 | }; |
| 103 | }; |