xref: /freebsd/sys/contrib/device-tree/Bindings/power/reset/gpio-restart.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1Drive a GPIO line that can be used to restart the system from a restart
2handler.
3
4This binding supports level and edge triggered reset.  At driver load
5time, the driver will request the given gpio line and install a restart
6handler. If the optional properties 'open-source' is not found, the GPIO line
7will be driven in the inactive state.  Otherwise its not driven until
8the restart is initiated.
9
10When the system is restarted, the restart handler will be invoked in
11priority order.  The gpio is configured as an output, and driven active,
12triggering a level triggered reset condition. This will also cause an
13inactive->active edge condition, triggering positive edge triggered
14reset. After a delay specified by active-delay, the GPIO is set to
15inactive, thus causing an active->inactive edge, triggering negative edge
16triggered reset. After a delay specified by inactive-delay, the GPIO
17is driven active again.  After a delay specified by wait-delay, the
18restart handler completes allowing other restart handlers to be attempted.
19
20Required properties:
21- compatible : should be "gpio-restart".
22- gpios : The GPIO to set high/low, see "gpios property" in
23  Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be
24  low to reset the board set it to "Active Low", otherwise set
25  gpio to "Active High".
26
27Optional properties:
28- open-source : Treat the GPIO as being open source and defer driving
29  it to when the restart is initiated.  If this optional property is not
30  specified, the GPIO is initialized as an output in its inactive state.
31- priority : A priority ranging from 0 to 255 (default 128) according to
32  the following guidelines:
33	0:	Restart handler of last resort, with limited restart
34		capabilities
35	128:	Default restart handler; use if no other restart handler is
36		expected to be available, and/or if restart functionality is
37		sufficient to restart the entire system
38	255:	Highest priority restart handler, will preempt all other
39		restart handlers
40- active-delay: Delay (default 100) to wait after driving gpio active [ms]
41- inactive-delay: Delay (default 100) to wait after driving gpio inactive [ms]
42- wait-delay: Delay (default 3000) to wait after completing restart
43  sequence [ms]
44
45Examples:
46
47gpio-restart {
48	compatible = "gpio-restart";
49	gpios = <&gpio 4 0>;
50	priority = <128>;
51	active-delay = <100>;
52	inactive-delay = <100>;
53	wait-delay = <3000>;
54};
55