simple-framebuffer.yaml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/display/simple-framebuffer.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Simple Framebuffer
  7. maintainers:
  8. - Hans de Goede <hdegoede@redhat.com>
  9. description: |+
  10. A simple frame-buffer describes a frame-buffer setup by firmware or
  11. the bootloader, with the assumption that the display hardware has
  12. already been set up to scan out from the memory pointed to by the
  13. reg property.
  14. Since simplefb nodes represent runtime information they must be
  15. sub-nodes of the chosen node (*). Simplefb nodes must be named
  16. framebuffer@<address>.
  17. If the devicetree contains nodes for the display hardware used by a
  18. simplefb, then the simplefb node must contain a property called
  19. display, which contains a phandle pointing to the primary display
  20. hw node, so that the OS knows which simplefb to disable when handing
  21. over control to a driver for the real hardware. The bindings for the
  22. hw nodes must specify which node is considered the primary node.
  23. If a panel node is given, then the driver uses this to configure the
  24. physical width and height of the display. If no panel node is given,
  25. then the driver uses the width and height properties of the simplefb
  26. node to estimate it.
  27. It is advised to add display# aliases to help the OS determine how
  28. to number things. If display# aliases are used, then if the simplefb
  29. node contains a display property then the /aliases/display# path
  30. must point to the display hw node the display property points to,
  31. otherwise it must point directly to the simplefb node.
  32. If a simplefb node represents the preferred console for user
  33. interaction, then the chosen node stdout-path property should point
  34. to it, or to the primary display hw node, as with display#
  35. aliases. If display aliases are used then it should be set to the
  36. alias instead.
  37. It is advised that devicetree files contain pre-filled, disabled
  38. framebuffer nodes, so that the firmware only needs to update the
  39. mode information and enable them. This way if e.g. later on support
  40. for more display clocks get added, the simplefb nodes will already
  41. contain this info and the firmware does not need to be updated.
  42. If pre-filled framebuffer nodes are used, the firmware may need
  43. extra information to find the right node. In that case an extra
  44. platform specific compatible and platform specific properties should
  45. be used and documented.
  46. properties:
  47. compatible:
  48. oneOf:
  49. - items:
  50. - enum:
  51. - apple,simple-framebuffer
  52. - allwinner,simple-framebuffer
  53. - amlogic,simple-framebuffer
  54. - const: simple-framebuffer
  55. - const: simple-framebuffer
  56. reg:
  57. description: Location and size of the framebuffer memory
  58. memory-region:
  59. maxItems: 1
  60. description: Phandle to a node describing the memory to be used for the
  61. framebuffer. If present, overrides the "reg" property (if one exists).
  62. clocks:
  63. description: List of clocks used by the framebuffer.
  64. power-domains:
  65. description: List of power domains used by the framebuffer.
  66. width:
  67. $ref: /schemas/types.yaml#/definitions/uint32
  68. description: Width of the framebuffer in pixels
  69. height:
  70. $ref: /schemas/types.yaml#/definitions/uint32
  71. description: Height of the framebuffer in pixels
  72. stride:
  73. $ref: /schemas/types.yaml#/definitions/uint32
  74. description: Number of bytes of a line in the framebuffer
  75. format:
  76. description: >
  77. Format of the framebuffer:
  78. * `a1r5g5b5` - 16-bit pixels, d[15]=a, d[14:10]=r, d[9:5]=g, d[4:0]=b
  79. * `a2r10g10b10` - 32-bit pixels, d[31:30]=a, d[29:20]=r, d[19:10]=g, d[9:0]=b
  80. * `a8b8g8r8` - 32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r
  81. * `a8r8g8b8` - 32-bit pixels, d[31:24]=a, d[23:16]=r, d[15:8]=g, d[7:0]=b
  82. * `r5g6b5` - 16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b
  83. * `r5g5b5a1` - 16-bit pixels, d[15:11]=r, d[10:6]=g, d[5:1]=b d[1:0]=a
  84. * `r8g8b8` - 24-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b
  85. * `x1r5g5b5` - 16-bit pixels, d[14:10]=r, d[9:5]=g, d[4:0]=b
  86. * `x2r10g10b10` - 32-bit pixels, d[29:20]=r, d[19:10]=g, d[9:0]=b
  87. * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b
  88. * `x8b8g8r8` - 32-bit pixels, d[23:16]=b, d[15:8]=g, d[7:0]=r
  89. enum:
  90. - a1r5g5b5
  91. - a2r10g10b10
  92. - a8b8g8r8
  93. - a8r8g8b8
  94. - r5g6b5
  95. - r5g5b5a1
  96. - r8g8b8
  97. - x1r5g5b5
  98. - x2r10g10b10
  99. - x8r8g8b8
  100. - x8b8g8r8
  101. display:
  102. $ref: /schemas/types.yaml#/definitions/phandle
  103. description: Primary display hardware node
  104. panel:
  105. $ref: /schemas/types.yaml#/definitions/phandle
  106. description: Display panel node
  107. allwinner,pipeline:
  108. description: Pipeline used by the framebuffer on Allwinner SoCs
  109. enum:
  110. - de_be0-lcd0
  111. - de_be0-lcd0-hdmi
  112. - de_be0-lcd0-tve0
  113. - de_be1-lcd0
  114. - de_be1-lcd1-hdmi
  115. - de_fe0-de_be0-lcd0
  116. - de_fe0-de_be0-lcd0-hdmi
  117. - de_fe0-de_be0-lcd0-tve0
  118. - mixer0-lcd0
  119. - mixer0-lcd0-hdmi
  120. - mixer1-lcd1-hdmi
  121. - mixer1-lcd1-tve
  122. amlogic,pipeline:
  123. description: Pipeline used by the framebuffer on Amlogic SoCs
  124. enum:
  125. - vpu-cvbs
  126. - vpu-hdmi
  127. patternProperties:
  128. "^[a-zA-Z0-9-]+-supply$":
  129. $ref: /schemas/types.yaml#/definitions/phandle
  130. description:
  131. Regulators used by the framebuffer. These should be named
  132. according to the names in the device design.
  133. required:
  134. # The binding requires also reg, width, height, stride and format,
  135. # but usually they will be filled by the bootloader.
  136. - compatible
  137. allOf:
  138. - if:
  139. properties:
  140. compatible:
  141. contains:
  142. const: allwinner,simple-framebuffer
  143. then:
  144. required:
  145. - allwinner,pipeline
  146. - if:
  147. properties:
  148. compatible:
  149. contains:
  150. const: amlogic,simple-framebuffer
  151. then:
  152. required:
  153. - amlogic,pipeline
  154. additionalProperties: false
  155. examples:
  156. - |
  157. / {
  158. compatible = "foo";
  159. model = "foo";
  160. #address-cells = <1>;
  161. #size-cells = <1>;
  162. chosen {
  163. #address-cells = <1>;
  164. #size-cells = <1>;
  165. framebuffer0: framebuffer@1d385000 {
  166. compatible = "allwinner,simple-framebuffer", "simple-framebuffer";
  167. allwinner,pipeline = "de_be0-lcd0";
  168. reg = <0x1d385000 3840000>;
  169. width = <1600>;
  170. height = <1200>;
  171. stride = <3200>;
  172. format = "r5g6b5";
  173. clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>;
  174. lcd-supply = <&reg_dc1sw>;
  175. display = <&lcdc0>;
  176. };
  177. };
  178. };
  179. ...