David Riley | 371bb20 | 2014-08-27 12:23:51 -0700 | [diff] [blame] | 1 | Drive a GPIO line that can be used to restart the system from a restart |
| 2 | handler. |
| 3 | |
| 4 | This binding supports level and edge triggered reset. At driver load |
| 5 | time, the driver will request the given gpio line and install a restart |
| 6 | handler. If the optional properties 'open-source' is not found, the GPIO line |
| 7 | will be driven in the inactive state. Otherwise its not driven until |
| 8 | the restart is initiated. |
| 9 | |
| 10 | When the system is restarted, the restart handler will be invoked in |
| 11 | priority order. The gpio is configured as an output, and driven active, |
| 12 | triggering a level triggered reset condition. This will also cause an |
| 13 | inactive->active edge condition, triggering positive edge triggered |
| 14 | reset. After a delay specified by active-delay, the GPIO is set to |
| 15 | inactive, thus causing an active->inactive edge, triggering negative edge |
| 16 | triggered reset. After a delay specified by inactive-delay, the GPIO |
| 17 | is driven active again. After a delay specified by wait-delay, the |
| 18 | restart handler completes allowing other restart handlers to be attempted. |
| 19 | |
| 20 | Required 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 | |
| 27 | Optional 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 | |
| 45 | Examples: |
| 46 | |
| 47 | gpio-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 | }; |