gpio-mmio.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Generic MMIO GPIO
  7. maintainers:
  8. - Linus Walleij <linus.walleij@linaro.org>
  9. - Bartosz Golaszewski <brgl@bgdev.pl>
  10. description:
  11. Some simple GPIO controllers may consist of a single data register or a pair
  12. of set/clear-bit registers. Such controllers are common for glue logic in
  13. FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped
  14. NAND-style parallel busses.
  15. properties:
  16. compatible:
  17. enum:
  18. - brcm,bcm6345-gpio
  19. - ni,169445-nand-gpio
  20. - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller
  21. big-endian: true
  22. '#gpio-cells':
  23. const: 2
  24. gpio-controller: true
  25. little-endian: true
  26. reg:
  27. minItems: 1
  28. description:
  29. A list of registers in the controller. The width of each register is
  30. determined by its size. All registers must have the same width. The number
  31. of GPIOs is set by the width, with bit 0 corresponding to GPIO 0.
  32. items:
  33. - description:
  34. Register to READ the value of the GPIO lines. If GPIO line is high,
  35. the bit will be set. If the GPIO line is low, the bit will be cleared.
  36. This register may also be used to drive GPIOs if the SET register is
  37. omitted.
  38. - description:
  39. Register to SET the value of the GPIO lines. Setting a bit in this
  40. register will drive the GPIO line high.
  41. - description:
  42. Register to CLEAR the value of the GPIO lines. Setting a bit in this
  43. register will drive the GPIO line low. If this register is omitted,
  44. the SET register will be used to clear the GPIO lines as well, by
  45. actively writing the line with 0.
  46. - description:
  47. Register to set the line as OUTPUT. Setting a bit in this register
  48. will turn that line into an output line. Conversely, clearing a bit
  49. will turn that line into an input.
  50. - description:
  51. Register to set this line as INPUT. Setting a bit in this register
  52. will turn that line into an input line. Conversely, clearing a bit
  53. will turn that line into an output.
  54. reg-names:
  55. minItems: 1
  56. maxItems: 5
  57. items:
  58. enum:
  59. - dat
  60. - set
  61. - clr
  62. - dirout
  63. - dirin
  64. native-endian: true
  65. no-output:
  66. $ref: /schemas/types.yaml#/definitions/flag
  67. description:
  68. If this property is present, the controller cannot drive the GPIO lines.
  69. required:
  70. - compatible
  71. - reg
  72. - reg-names
  73. - '#gpio-cells'
  74. - gpio-controller
  75. additionalProperties: false
  76. examples:
  77. - |
  78. gpio@1f300010 {
  79. compatible = "ni,169445-nand-gpio";
  80. reg = <0x1f300010 0x4>;
  81. reg-names = "dat";
  82. gpio-controller;
  83. #gpio-cells = <2>;
  84. };
  85. gpio@e0100000 {
  86. compatible = "wd,mbl-gpio";
  87. reg-names = "dat";
  88. reg = <0xe0100000 0x1>;
  89. #gpio-cells = <2>;
  90. gpio-controller;
  91. no-output;
  92. };
  93. gpio@fffe0406 {
  94. compatible = "brcm,bcm6345-gpio";
  95. reg-names = "dirout", "dat";
  96. reg = <0xfffe0406 2>, <0xfffe040a 2>;
  97. native-endian;
  98. gpio-controller;
  99. #gpio-cells = <2>;
  100. };