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

dt-bindings: power: reset: Convert syscon-reboot-mode to DT schema

Modern device tree bindings are supposed to be created as YAML-files
in accordance with dt-schema. This commit replaces SYSCON reboot-mode
legacy bare text bindings with YAML file. As before the bindings file
states that the corresponding dts node is supposed to be compatible
"syscon-reboot-mode" device and necessarily have an offset property
to determine which register from the regmap is supposed to keep the
mode on reboot.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Serge Semin and committed by
Sebastian Reichel
a776f560 1a457329

+55 -35
-35
Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
··· 1 - SYSCON reboot mode driver 2 - 3 - This driver gets reboot mode magic value form reboot-mode driver 4 - and stores it in a SYSCON mapped register. Then the bootloader 5 - can read it and take different action according to the magic 6 - value stored. 7 - 8 - This DT node should be represented as a sub-node of a "syscon", "simple-mfd" 9 - node. 10 - 11 - Required properties: 12 - - compatible: should be "syscon-reboot-mode" 13 - - offset: offset in the register map for the storage register (in bytes) 14 - 15 - Optional property: 16 - - mask: bits mask of the bits in the register to store the reboot mode magic value, 17 - default set to 0xffffffff if missing. 18 - 19 - The rest of the properties should follow the generic reboot-mode description 20 - found in reboot-mode.txt 21 - 22 - Example: 23 - pmu: pmu@20004000 { 24 - compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd"; 25 - reg = <0x20004000 0x100>; 26 - 27 - reboot-mode { 28 - compatible = "syscon-reboot-mode"; 29 - offset = <0x40>; 30 - mode-normal = <BOOT_NORMAL>; 31 - mode-recovery = <BOOT_RECOVERY>; 32 - mode-bootloader = <BOOT_FASTBOOT>; 33 - mode-loader = <BOOT_BL_DOWNLOAD>; 34 - }; 35 - };
+55
Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Generic SYSCON reboot mode driver 8 + 9 + maintainers: 10 + - Sebastian Reichel <sre@kernel.org> 11 + 12 + description: | 13 + This driver gets reboot mode magic value from reboot-mode driver 14 + and stores it in a SYSCON mapped register. Then the bootloader 15 + can read it and take different action according to the magic 16 + value stored. The SYSCON mapped register is retrieved from the 17 + parental dt-node plus the offset. So the SYSCON reboot-mode node 18 + should be represented as a sub-node of a "syscon", "simple-mfd" node. 19 + 20 + properties: 21 + compatible: 22 + const: syscon-reboot-mode 23 + 24 + mask: 25 + $ref: /schemas/types.yaml#/definitions/uint32 26 + description: Update only the register bits defined by the mask (32 bit) 27 + 28 + offset: 29 + $ref: /schemas/types.yaml#/definitions/uint32 30 + description: Offset in the register map for the mode register (in bytes) 31 + 32 + patternProperties: 33 + "^mode-.+": 34 + $ref: /schemas/types.yaml#/definitions/uint32 35 + description: Vendor-specific mode value written to the mode register 36 + 37 + additionalProperties: false 38 + 39 + required: 40 + - compatible 41 + - offset 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/soc/rockchip,boot-mode.h> 46 + 47 + reboot-mode { 48 + compatible = "syscon-reboot-mode"; 49 + offset = <0x40>; 50 + mode-normal = <BOOT_NORMAL>; 51 + mode-recovery = <BOOT_RECOVERY>; 52 + mode-bootloader = <BOOT_FASTBOOT>; 53 + mode-loader = <BOOT_BL_DOWNLOAD>; 54 + }; 55 + ...