linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nandor Han <nandor.han@vaisala.com>
To: srinivas.kandagatla@linaro.org, robh+dt@kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: Nandor Han <nandor.han@vaisala.com>
Subject: [PATCH v4 1/4] dt-bindings: nvmem: Add bootcount-nvmem
Date: Wed,  5 May 2021 13:42:18 +0300	[thread overview]
Message-ID: <a64b743e665baabc9ed9caed57b998bbae6d4e67.1620211180.git.nandor.han@vaisala.com> (raw)
In-Reply-To: <cover.1620211180.git.nandor.han@vaisala.com>

Documents the device tree bindings for `bootcount-nvmem` driver.

Signed-off-by: Nandor Han <nandor.han@vaisala.com>
---
 .../bindings/nvmem/bootcount-nvmem.yaml       | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml

diff --git a/Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml b/Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml
new file mode 100644
index 000000000000..1200ef906843
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/bootcount-nvmem.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+# Copyright (c) Vaisala Oyj. All rights reserved.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/bootcount-nvmem.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bootcount NVMEM bindings
+
+maintainers:
+  - Nandor Han <nandor.han@vaisala.com>
+
+description: |
+  This binding is intendent to describe the hardware location for
+  storing the bootcount value and magic combo.
+
+  The NVMEM cell size should be 2 or 4 bytes.
+
+allOf:
+  - $ref: "nvmem-consumer.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - linux,bootcount-nvmem
+
+  nvmem-cells:
+    description: Phandle to reboot mode nvmem data cell.
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+  nvmem-cell-names:
+    description: Name of the NVMEM cell.
+    $ref: /schemas/types.yaml#/definitions/string-array
+    enum:
+      - bootcount-regs
+
+  linux,bootcount-magic:
+    description: Override the default magic value.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+  - compatible
+  - nvmem-cells
+  - nvmem-cell-names
+
+additionalProperties: false
+
+examples:
+  # example with 16 bit nvram cell:
+  - |
+    bootcount {
+        compatible = "linux,bootcount-nvmem";
+        nvmem-cells = <&bootcount_regs>;
+        nvmem-cell-names = "bootcount-regs";
+    };
+
+    rtc: rtc@68 {
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        reg = <0x68 0x10>;
+
+        bootcount_regs: bootcount_nvmem_regs@e {
+            #address-cells = <1>;
+            #size-cells = <1>;
+
+            reg = <0x0e 0x2>;
+        };
+    };
+
+...
-- 
2.26.3


  reply	other threads:[~2021-05-05 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 10:42 [PATCH v4 0/4] Bootcount driver using NVMEM cell as backend Nandor Han
2021-05-05 10:42 ` Nandor Han [this message]
2021-05-05 10:42 ` [PATCH v4 2/4] nvmem: bootcount: add bootcount driver Nandor Han
2021-05-28  8:23   ` Srinivas Kandagatla
2021-06-01  7:58     ` Nandor Han
2021-06-03  8:03       ` Srinivas Kandagatla
2021-06-23 10:55         ` Vesa Jääskeläinen
2021-05-05 10:42 ` [PATCH v4 3/4] nvmem: snvs_lpgpr: use cell stride for regmap size calculation Nandor Han
2021-05-05 10:42 ` [PATCH v4 4/4] nvmem: snvs_lpgpr: support two bytes NVMEM cell size Nandor Han
2021-05-27 10:44 ` [PATCH v4 0/4] Bootcount driver using NVMEM cell as backend Nandor Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a64b743e665baabc9ed9caed57b998bbae6d4e67.1620211180.git.nandor.han@vaisala.com \
    --to=nandor.han@vaisala.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).