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