18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/power/reset/syscon-reboot.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Generic SYSCON mapped register reset driver
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Sebastian Reichel <sre@kernel.org>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |+
138c2ecf20Sopenharmony_ci  This is a generic reset driver using syscon to map the reset register.
148c2ecf20Sopenharmony_ci  The reset is generally performed with a write to the reset register
158c2ecf20Sopenharmony_ci  defined by the SYSCON register map base plus the offset with the value and
168c2ecf20Sopenharmony_ci  mask defined in the reboot node. Default will be little endian mode, 32 bit
178c2ecf20Sopenharmony_ci  access only. The SYSCON registers map is normally retrieved from the
188c2ecf20Sopenharmony_ci  parental dt-node. So the SYSCON reboot node should be represented as a
198c2ecf20Sopenharmony_ci  sub-node of a "syscon", "simple-mfd" node. Though the regmap property
208c2ecf20Sopenharmony_ci  pointing to the system controller node is also supported.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciproperties:
238c2ecf20Sopenharmony_ci  compatible:
248c2ecf20Sopenharmony_ci    const: syscon-reboot
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci  mask:
278c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
288c2ecf20Sopenharmony_ci    description: Update only the register bits defined by the mask (32 bit).
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  offset:
318c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
328c2ecf20Sopenharmony_ci    description: Offset in the register map for the reboot register (in bytes).
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci  regmap:
358c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle
368c2ecf20Sopenharmony_ci    deprecated: true
378c2ecf20Sopenharmony_ci    description: |
388c2ecf20Sopenharmony_ci      Phandle to the register map node. This property is deprecated in favor of
398c2ecf20Sopenharmony_ci      the syscon-reboot node been a child of a system controller node.
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci  value:
428c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
438c2ecf20Sopenharmony_ci    description: The reset value written to the reboot register (32 bit access).
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_cirequired:
468c2ecf20Sopenharmony_ci  - compatible
478c2ecf20Sopenharmony_ci  - offset
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciadditionalProperties: false
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciallOf:
528c2ecf20Sopenharmony_ci  - if:
538c2ecf20Sopenharmony_ci      not:
548c2ecf20Sopenharmony_ci        required:
558c2ecf20Sopenharmony_ci          - mask
568c2ecf20Sopenharmony_ci    then:
578c2ecf20Sopenharmony_ci      required:
588c2ecf20Sopenharmony_ci        - value
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciexamples:
618c2ecf20Sopenharmony_ci  - |
628c2ecf20Sopenharmony_ci    reboot {
638c2ecf20Sopenharmony_ci        compatible = "syscon-reboot";
648c2ecf20Sopenharmony_ci        regmap = <&regmapnode>;
658c2ecf20Sopenharmony_ci        offset = <0x0>;
668c2ecf20Sopenharmony_ci        mask = <0x1>;
678c2ecf20Sopenharmony_ci    };
68