gpio-restart.txt 2.3 KB

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