xref: /freebsd-src/sys/contrib/device-tree/Bindings/power/reset/gpio-restart.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1*aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2e67e8565SEmmanuel Vadot%YAML 1.2
3e67e8565SEmmanuel Vadot---
4e67e8565SEmmanuel Vadot$id: http://devicetree.org/schemas/power/reset/gpio-restart.yaml#
5e67e8565SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6e67e8565SEmmanuel Vadot
7e67e8565SEmmanuel Vadottitle: GPIO controlled reset
8e67e8565SEmmanuel Vadot
9e67e8565SEmmanuel Vadotmaintainers:
10e67e8565SEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
11e67e8565SEmmanuel Vadot
12e67e8565SEmmanuel Vadotdescription: >
13e67e8565SEmmanuel Vadot  Drive a GPIO line that can be used to restart the system from a restart handler.
14e67e8565SEmmanuel Vadot
15e67e8565SEmmanuel Vadot  This binding supports level and edge triggered reset.  At driver load time, the driver will
16e67e8565SEmmanuel Vadot  request the given gpio line and install a restart handler. If the optional properties
17e67e8565SEmmanuel Vadot  'open-source' is not found, the GPIO line will be driven in the inactive state.  Otherwise its
18e67e8565SEmmanuel Vadot  not driven until the restart is initiated.
19e67e8565SEmmanuel Vadot
20e67e8565SEmmanuel Vadot  When the system is restarted, the restart handler will be invoked in priority order.  The GPIO
21e67e8565SEmmanuel Vadot  is configured as an output, and driven active, triggering a level triggered reset condition.
22e67e8565SEmmanuel Vadot  This will also cause an inactive->active edge condition, triggering positive edge triggered
23e67e8565SEmmanuel Vadot  reset. After a delay specified by active-delay, the GPIO is set to inactive, thus causing an
24e67e8565SEmmanuel Vadot  active->inactive edge, triggering negative edge triggered reset. After a delay specified by
25e67e8565SEmmanuel Vadot  inactive-delay, the GPIO is driven active again.  After a delay specified by wait-delay, the
26e67e8565SEmmanuel Vadot  restart handler completes allowing other restart handlers to be attempted.
27e67e8565SEmmanuel Vadot
288bab661aSEmmanuel VadotallOf:
298bab661aSEmmanuel Vadot  - $ref: restart-handler.yaml#
308bab661aSEmmanuel Vadot
31e67e8565SEmmanuel Vadotproperties:
32e67e8565SEmmanuel Vadot  compatible:
33e67e8565SEmmanuel Vadot    const: gpio-restart
34e67e8565SEmmanuel Vadot
35e67e8565SEmmanuel Vadot  gpios:
36e67e8565SEmmanuel Vadot    description: The GPIO to set high/low, see "gpios property" in
37e67e8565SEmmanuel Vadot      Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be low to reset the board
38e67e8565SEmmanuel Vadot      set it to "Active Low", otherwise set GPIO to "Active High".
39e67e8565SEmmanuel Vadot
40e67e8565SEmmanuel Vadot  open-source:
41e67e8565SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
42e67e8565SEmmanuel Vadot    description: Treat the GPIO as being open source and defer driving it to when the restart is
43e67e8565SEmmanuel Vadot      initiated.  If this optional property is not specified, the GPIO is initialized as an output
44e67e8565SEmmanuel Vadot      in its inactive state.
45e67e8565SEmmanuel Vadot
46e67e8565SEmmanuel Vadot  priority:
47e67e8565SEmmanuel Vadot    default: 129
48e67e8565SEmmanuel Vadot
49e67e8565SEmmanuel Vadot  active-delay:
50e67e8565SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
51e67e8565SEmmanuel Vadot    description: Delay (default 100) to wait after driving gpio active [ms]
52e67e8565SEmmanuel Vadot    default: 100
53e67e8565SEmmanuel Vadot
54e67e8565SEmmanuel Vadot  inactive-delay:
55e67e8565SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
56e67e8565SEmmanuel Vadot    description: Delay (default 100) to wait after driving gpio inactive [ms]
57e67e8565SEmmanuel Vadot    default: 100
58e67e8565SEmmanuel Vadot
59e67e8565SEmmanuel Vadot  wait-delay:
60e67e8565SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
61e67e8565SEmmanuel Vadot    description: Delay (default 3000) to wait after completing restart sequence [ms]
62e67e8565SEmmanuel Vadot    default: 100
63e67e8565SEmmanuel Vadot
64e67e8565SEmmanuel VadotadditionalProperties: false
65e67e8565SEmmanuel Vadot
66e67e8565SEmmanuel Vadotrequired:
67e67e8565SEmmanuel Vadot  - compatible
68e67e8565SEmmanuel Vadot  - gpios
69e67e8565SEmmanuel Vadot
70e67e8565SEmmanuel Vadotexamples:
71e67e8565SEmmanuel Vadot  - |
72e67e8565SEmmanuel Vadot    gpio-restart {
73e67e8565SEmmanuel Vadot      compatible = "gpio-restart";
74e67e8565SEmmanuel Vadot      gpios = <&gpio 4 0>;
75e67e8565SEmmanuel Vadot      priority = <128>;
76e67e8565SEmmanuel Vadot      active-delay = <100>;
77e67e8565SEmmanuel Vadot      inactive-delay = <100>;
78e67e8565SEmmanuel Vadot      wait-delay = <3000>;
79e67e8565SEmmanuel Vadot    };
80