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