18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Generic SYSCON reboot mode driver
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Sebastian Reichel <sre@kernel.org>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |
138c2ecf20Sopenharmony_ci  This driver gets reboot mode magic value from reboot-mode driver
148c2ecf20Sopenharmony_ci  and stores it in a SYSCON mapped register. Then the bootloader
158c2ecf20Sopenharmony_ci  can read it and take different action according to the magic
168c2ecf20Sopenharmony_ci  value stored. The SYSCON mapped register is retrieved from the
178c2ecf20Sopenharmony_ci  parental dt-node plus the offset. So the SYSCON reboot-mode node
188c2ecf20Sopenharmony_ci  should be represented as a sub-node of a "syscon", "simple-mfd" node.
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciproperties:
218c2ecf20Sopenharmony_ci  compatible:
228c2ecf20Sopenharmony_ci    const: syscon-reboot-mode
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci  mask:
258c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
268c2ecf20Sopenharmony_ci    description: Update only the register bits defined by the mask (32 bit)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci  offset:
298c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
308c2ecf20Sopenharmony_ci    description: Offset in the register map for the mode register (in bytes)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_cipatternProperties:
338c2ecf20Sopenharmony_ci  "^mode-.+":
348c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
358c2ecf20Sopenharmony_ci    description: Vendor-specific mode value written to the mode register
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciadditionalProperties: false
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cirequired:
408c2ecf20Sopenharmony_ci  - compatible
418c2ecf20Sopenharmony_ci  - offset
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciexamples:
448c2ecf20Sopenharmony_ci  - |
458c2ecf20Sopenharmony_ci    #include <dt-bindings/soc/rockchip,boot-mode.h>
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci    reboot-mode {
488c2ecf20Sopenharmony_ci      compatible = "syscon-reboot-mode";
498c2ecf20Sopenharmony_ci      offset = <0x40>;
508c2ecf20Sopenharmony_ci      mode-normal = <BOOT_NORMAL>;
518c2ecf20Sopenharmony_ci      mode-recovery = <BOOT_RECOVERY>;
528c2ecf20Sopenharmony_ci      mode-bootloader = <BOOT_FASTBOOT>;
538c2ecf20Sopenharmony_ci      mode-loader = <BOOT_BL_DOWNLOAD>;
548c2ecf20Sopenharmony_ci    };
558c2ecf20Sopenharmony_ci...
56