Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: nvmem: Add YAML schemas for the generic NVMEM bindings

The nvmem providers and consumers have a bunch of generic properties that
are needed in a device tree. Add a YAML schemas for those.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
[Srini: Changed licence to (GPL-2.0 OR BSD-2-Clause)]
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Maxime Ripard and committed by
Rob Herring
c61f0256 f1765a18

+139 -80
+45
Documentation/devicetree/bindings/nvmem/nvmem-consumer.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/nvmem/nvmem-consumer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NVMEM (Non Volatile Memory) Consumer Device Tree Bindings 8 + 9 + maintainers: 10 + - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 11 + 12 + select: true 13 + 14 + properties: 15 + nvmem: 16 + $ref: /schemas/types.yaml#/definitions/phandle-array 17 + description: 18 + List of phandle to the nvmem providers. 19 + 20 + nvmem-cells: 21 + $ref: /schemas/types.yaml#/definitions/phandle-array 22 + description: 23 + List of phandle to the nvmem data cells. 24 + 25 + nvmem-names: 26 + $ref: /schemas/types.yaml#/definitions/string-array 27 + description: 28 + Names for the each nvmem provider. 29 + 30 + nvmem-cell-names: 31 + $ref: /schemas/types.yaml#/definitions/string-array 32 + description: 33 + Names for each nvmem-cells specified. 34 + 35 + dependencies: 36 + nvmem-names: [ nvmem ] 37 + nvmem-cell-names: [ nvmem-cells ] 38 + 39 + examples: 40 + - | 41 + tsens { 42 + /* ... */ 43 + nvmem-cells = <&tsens_calibration>; 44 + nvmem-cell-names = "calibration"; 45 + };
+1 -80
Documentation/devicetree/bindings/nvmem/nvmem.txt
··· 1 - = NVMEM(Non Volatile Memory) Data Device Tree Bindings = 2 - 3 - This binding is intended to represent the location of hardware 4 - configuration data stored in NVMEMs like eeprom, efuses and so on. 5 - 6 - On a significant proportion of boards, the manufacturer has stored 7 - some data on NVMEM, for the OS to be able to retrieve these information 8 - and act upon it. Obviously, the OS has to know about where to retrieve 9 - these data from, and where they are stored on the storage device. 10 - 11 - This document is here to document this. 12 - 13 - = Data providers = 14 - Contains bindings specific to provider drivers and data cells as children 15 - of this node. 16 - 17 - Optional properties: 18 - read-only: Mark the provider as read only. 19 - 20 - = Data cells = 21 - These are the child nodes of the provider which contain data cell 22 - information like offset and size in nvmem provider. 23 - 24 - Required properties: 25 - reg: specifies the offset in byte within the storage device. 26 - 27 - Optional properties: 28 - 29 - bits: Is pair of bit location and number of bits, which specifies offset 30 - in bit and number of bits within the address range specified by reg property. 31 - Offset takes values from 0-7. 32 - 33 - For example: 34 - 35 - /* Provider */ 36 - qfprom: qfprom@700000 { 37 - ... 38 - 39 - /* Data cells */ 40 - tsens_calibration: calib@404 { 41 - reg = <0x404 0x10>; 42 - }; 43 - 44 - tsens_calibration_bckp: calib_bckp@504 { 45 - reg = <0x504 0x11>; 46 - bits = <6 128> 47 - }; 48 - 49 - pvs_version: pvs-version@6 { 50 - reg = <0x6 0x2> 51 - bits = <7 2> 52 - }; 53 - 54 - speed_bin: speed-bin@c{ 55 - reg = <0xc 0x1>; 56 - bits = <2 3>; 57 - 58 - }; 59 - ... 60 - }; 61 - 62 - = Data consumers = 63 - Are device nodes which consume nvmem data cells/providers. 64 - 65 - Required-properties: 66 - nvmem-cells: list of phandle to the nvmem data cells. 67 - nvmem-cell-names: names for the each nvmem-cells specified. Required if 68 - nvmem-cells is used. 69 - 70 - Optional-properties: 71 - nvmem : list of phandles to nvmem providers. 72 - nvmem-names: names for the each nvmem provider. required if nvmem is used. 73 - 74 - For example: 75 - 76 - tsens { 77 - ... 78 - nvmem-cells = <&tsens_calibration>; 79 - nvmem-cell-names = "calibration"; 80 - }; 1 + This file has been moved to nvmem.yaml and nvmem-consumer.yaml.
+93
Documentation/devicetree/bindings/nvmem/nvmem.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/nvmem/nvmem.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NVMEM (Non Volatile Memory) Device Tree Bindings 8 + 9 + maintainers: 10 + - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 11 + 12 + description: | 13 + This binding is intended to represent the location of hardware 14 + configuration data stored in NVMEMs like eeprom, efuses and so on. 15 + 16 + On a significant proportion of boards, the manufacturer has stored 17 + some data on NVMEM, for the OS to be able to retrieve these 18 + information and act upon it. Obviously, the OS has to know about 19 + where to retrieve these data from, and where they are stored on the 20 + storage device. 21 + 22 + properties: 23 + $nodename: 24 + pattern: "^(eeprom|efuse|nvram)(@.*|-[0-9a-f])*$" 25 + 26 + "#address-cells": 27 + const: 1 28 + 29 + "#size-cells": 30 + const: 1 31 + 32 + read-only: 33 + $ref: /schemas/types.yaml#/definitions/flag 34 + description: 35 + Mark the provider as read only. 36 + 37 + patternProperties: 38 + "^.*@[0-9a-f]+$": 39 + type: object 40 + 41 + properties: 42 + reg: 43 + maxItems: 1 44 + description: 45 + Offset and size in bytes within the storage device. 46 + 47 + bits: 48 + maxItems: 1 49 + items: 50 + items: 51 + - minimum: 0 52 + maximum: 7 53 + description: 54 + Offset in bit within the address range specified by reg. 55 + - minimum: 1 56 + description: 57 + Size in bit within the address range specified by reg. 58 + 59 + required: 60 + - reg 61 + 62 + additionalProperties: false 63 + 64 + examples: 65 + - | 66 + qfprom: eeprom@700000 { 67 + #address-cells = <1>; 68 + #size-cells = <1>; 69 + 70 + /* ... */ 71 + 72 + /* Data cells */ 73 + tsens_calibration: calib@404 { 74 + reg = <0x404 0x10>; 75 + }; 76 + 77 + tsens_calibration_bckp: calib_bckp@504 { 78 + reg = <0x504 0x11>; 79 + bits = <6 128>; 80 + }; 81 + 82 + pvs_version: pvs-version@6 { 83 + reg = <0x6 0x2>; 84 + bits = <7 2>; 85 + }; 86 + 87 + speed_bin: speed-bin@c{ 88 + reg = <0xc 0x1>; 89 + bits = <2 3>; 90 + }; 91 + }; 92 + 93 + ...