xref: /freebsd/sys/contrib/device-tree/Bindings/nvmem/nvmem.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/nvmem/nvmem.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: NVMEM (Non Volatile Memory)
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription: |
13c66ec88fSEmmanuel Vadot  This binding is intended to represent the location of hardware
14c66ec88fSEmmanuel Vadot  configuration data stored in NVMEMs like eeprom, efuses and so on.
15c66ec88fSEmmanuel Vadot
16c66ec88fSEmmanuel Vadot  On a significant proportion of boards, the manufacturer has stored
17c66ec88fSEmmanuel Vadot  some data on NVMEM, for the OS to be able to retrieve these
18c66ec88fSEmmanuel Vadot  information and act upon it. Obviously, the OS has to know about
19c66ec88fSEmmanuel Vadot  where to retrieve these data from, and where they are stored on the
20c66ec88fSEmmanuel Vadot  storage device.
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadotproperties:
23c66ec88fSEmmanuel Vadot  "#address-cells":
24c66ec88fSEmmanuel Vadot    const: 1
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  "#size-cells":
27c66ec88fSEmmanuel Vadot    const: 1
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  read-only:
30c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
31c66ec88fSEmmanuel Vadot    description:
32c66ec88fSEmmanuel Vadot      Mark the provider as read only.
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot  wp-gpios:
35c66ec88fSEmmanuel Vadot    description:
36c66ec88fSEmmanuel Vadot      GPIO to which the write-protect pin of the chip is connected.
37c66ec88fSEmmanuel Vadot      The write-protect GPIO is asserted, when it's driven high
38c66ec88fSEmmanuel Vadot      (logical '1') to block the write operation. It's deasserted,
39c66ec88fSEmmanuel Vadot      when it's driven low (logical '0') to allow writing.
40c66ec88fSEmmanuel Vadot    maxItems: 1
41c66ec88fSEmmanuel Vadot
428bab661aSEmmanuel Vadot  nvmem-layout:
438bab661aSEmmanuel Vadot    $ref: /schemas/nvmem/layouts/nvmem-layout.yaml
448bab661aSEmmanuel Vadot    description:
458bab661aSEmmanuel Vadot      Alternative to the statically defined nvmem cells, this
468bab661aSEmmanuel Vadot      container may reference more advanced (dynamic) layout
478bab661aSEmmanuel Vadot      parsers.
488bab661aSEmmanuel Vadot
496be33864SEmmanuel VadotadditionalProperties: true
506be33864SEmmanuel Vadot
51c66ec88fSEmmanuel Vadotexamples:
52c66ec88fSEmmanuel Vadot  - |
53c66ec88fSEmmanuel Vadot      #include <dt-bindings/gpio/gpio.h>
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot      qfprom: eeprom@700000 {
568bab661aSEmmanuel Vadot          compatible = "qcom,msm8974-qfprom", "qcom,qfprom";
57c66ec88fSEmmanuel Vadot          #address-cells = <1>;
58c66ec88fSEmmanuel Vadot          #size-cells = <1>;
59c66ec88fSEmmanuel Vadot          reg = <0x00700000 0x100000>;
60c66ec88fSEmmanuel Vadot
61c66ec88fSEmmanuel Vadot          wp-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel Vadot          /* ... */
64c66ec88fSEmmanuel Vadot
65*f126890aSEmmanuel Vadot          nvmem-layout {
66*f126890aSEmmanuel Vadot              compatible = "fixed-layout";
67*f126890aSEmmanuel Vadot              #address-cells = <1>;
68*f126890aSEmmanuel Vadot              #size-cells = <1>;
69*f126890aSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot              /* Data cells */
71c66ec88fSEmmanuel Vadot              tsens_calibration: calib@404 {
72c66ec88fSEmmanuel Vadot                  reg = <0x404 0x10>;
73c66ec88fSEmmanuel Vadot              };
74c66ec88fSEmmanuel Vadot
75c66ec88fSEmmanuel Vadot              tsens_calibration_bckp: calib_bckp@504 {
76c66ec88fSEmmanuel Vadot                  reg = <0x504 0x11>;
77c66ec88fSEmmanuel Vadot                  bits = <6 128>;
78c66ec88fSEmmanuel Vadot              };
79c66ec88fSEmmanuel Vadot
80c66ec88fSEmmanuel Vadot              pvs_version: pvs-version@6 {
81c66ec88fSEmmanuel Vadot                  reg = <0x6 0x2>;
82c66ec88fSEmmanuel Vadot                  bits = <7 2>;
83c66ec88fSEmmanuel Vadot              };
84c66ec88fSEmmanuel Vadot
85c66ec88fSEmmanuel Vadot              speed_bin: speed-bin@c{
86c66ec88fSEmmanuel Vadot                  reg = <0xc 0x1>;
87c66ec88fSEmmanuel Vadot                  bits = <2 3>;
88c66ec88fSEmmanuel Vadot              };
89c66ec88fSEmmanuel Vadot          };
90*f126890aSEmmanuel Vadot      };
91c66ec88fSEmmanuel Vadot
92c66ec88fSEmmanuel Vadot...
93